简体   繁体   English

编辑 email 主题行 (IMAP)

[英]Edit an email subject line (IMAP)

I am trying to integrate IMAP email processing with another in house system that bases what it uses off of the subject line / email content.我正在尝试将 IMAP email 处理与另一个内部系统集成,该系统基于它使用的主题行/email 内容。

We need to be able to change the text of the subject line before moving the email to a new folder.在将 email 移动到新文件夹之前,我们需要能够更改主题行的文本。 What/where would be a good place to start?什么/从哪里开始是个好地方?

I've had a look around and it IS possible in a manual sense, via a thunderbird plugin or using outlook.我环顾四周,可以通过雷鸟插件或使用 outlook 手动实现。 I just can't seem to find a relevant example in PHP, or any other language for that matter.我似乎无法在 PHP 或任何其他语言中找到相关示例。 I also hear the idea is flakey at best as you need to modify the email content and upload it back to the imap server.我还听说这个想法充其量是古怪的,因为您需要修改 email 内容并将其上传回 imap 服务器。

The outlook implementation seems to delete the original and save a new one to your IMAP folder on the server. outlook 实现似乎删除了原始文件并将新文件保存到服务器上的 IMAP 文件夹中。

Side note: Yes I know it is a weird requirement, and although forwarding the email to ourselves then moving it is our fall back plan it is not much liked as it moves original headers useful for things like reply-all.旁注:是的,我知道这是一个奇怪的要求,尽管将 email 转发给我们自己,然后移动它是我们的后备计划,但它并不是很受欢迎,因为它移动了原始标题,对诸如回复所有内容有用。

Any suggestions appreciated.任何建议表示赞赏。

PS If I'm blind and there is something obvious I'm missing in the manual let me know. PS 如果我是盲人并且手册中有明显遗漏的内容,请告诉我。

Do you already have any code built to handle the email processing?您是否已经构建了任何代码来处理 email 处理? IMAP subject line information is stored as a header so you would need to utilize the PHP functions of imap_headerinfo() and/or imap_fetchheader() depending on the functionality you're looking for to achieve this. IMAP 主题行信息存储为 header,因此您需要利用imap_headerinfo()和/或imap_fetchheader()的 PHP 函数,具体取决于您要实现此目的的功能。 You could have PHP check each message header and if it matches X format, remove the message, and create a new one with the appropriately modified header information.您可以让 PHP 检查每条消息 header 如果它与 X 格式匹配,则删除该消息,并使用适当修改的 header 信息创建一个新消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM