IMAP FETCH主题 [英] IMAP FETCH Subject

查看:100
本文介绍了IMAP FETCH主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过telnet使用IMAP,我希望能够从特定的给定电子邮件中提取主题.现在我知道fetch命令负责从电子邮件中获取数据.

Using IMAP via telnet, I want to be able to extract the subject from the specific given email. Now I know that the fetch command is responsible for getting data from an email.

我的问题是,如何使用对BODY [HEADER.FIELDS(SUBJECT)]的调用来具体获取主题标头,而没有它们(在服务器的眼中,它将打开"电子邮件",并因此设置了/seen标志,这是我不想发生的事情)?

My question is, how do I get the subject header specifically, without using a call to BODY[HEADER.FIELDS (SUBJECT)] (which will, in the eyes of the server, 'open the email' and thus set the /seen flag, which is what I don't want to occur)?

我知道FETCH FULL返回完整的标头,其中包含主题,但是解析它是一场噩梦,如果我手动解析它,可能会遇到看不见的陷阱.我将如何让服务器将标题中的主题给我?

I understand FETCH FULL returns the full header, which contains the subject but it's a nightmare to parse through and could be riddled with unseen pitfalls if I manually parse it. How would I get the server to give me just the subject from the header?

推荐答案

我找到了答案:

BODY.PEEK [标题.字段(主题)]

BODY.PEEK[HEADER.FIELDS (SUBJECT)]

.PEEK告诉它不要打开它(因此未设置/seen).

.PEEK tells it not open it (so /seen isn't set).

这篇关于IMAP FETCH主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆