IMAP-从退回邮件中解析原始标头 [英] IMAP- Parsing original headers from a bounced mail

查看:100
本文介绍了IMAP-从退回邮件中解析原始标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过电子邮件标题发送数百封具有唯一ID的电子邮件.我必须跟踪退回的邮件中的特定唯一ID.

I am sending hundreds of emails with an unique id through email header. I have to track the bounced mails for the particular unique id.

我可以在邮箱中看到带有附件EML文件的退回电子邮件.不幸的是,我要查找的唯一ID放置在附加的EML文件的标题中,而不是退回的电子邮件标题中.

I can see the bounced emails with an attached EML file in my mailbox. Unfortunately the unique ID which I am looking for is placed in the attached EML file's header instead of bounced email's header.

我正在使用PHP的IMAP函数读取标题和正文部分.但无法读取EML附件.

I am using PHP's IMAP function to read the headers and body sections. But unable to read EML attachment.

任何人都可以解释如何使用IMAP函数读取或解析EML附件.

Could any one explain how to read or parse the EML attachment using IMAP function.

谢谢.

推荐答案

.eml最恰当地描述为message/rfc822正文部分;它包含multipart/report的一部分.

The .eml is most properly described as a message/rfc822 bodypart; it comprises one part of a multipart/report.

在IMAP中,每个主体都有自己的零件编号,您可以通过提供编号来访问标头和各个字段.在多次跳动中,消息/rfc822的数量为3,您可以访问例如主题使用f uid fetch 123456 body.peek[3.1.header.fields (subject)].服务器将进行所需的解析,并将主题字段还给您.

In IMAP each bodypart has its own part number, and you can access headers and individual fields by supplying the number. In many bounces, the number of the message/rfc822 is 3, and you can access e.g. the subject using f uid fetch 123456 body.peek[3.1.header.fields (subject)]. The server will do the parsing you want and give you back the subject field.

获取零件号的常用方法是使用bodystructure.

The usual way to get the part number is to use bodystructure.

使用PHP进行表达是读者的一项练习.祝你好运.

Expressing this using PHP is left as an exercise for the reader. Good luck.

这篇关于IMAP-从退回邮件中解析原始标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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