我即将开始开发一个新的自动电子邮件应用程序。这个想法是,客户(或其他外部用户)将电子邮件发送到邮箱,然后自动化流程将读取它们,提取其信息并将其插入到某个数据库中。电子邮件必须具有标准格式才能进行解析(标准主题等)。
显而易见的事情是建立一个进程,定期轮询普通邮箱(例如通过 pop-3),处理它找到的消息。然而,对我来说,如果能够在电子邮件到达时对其进行处理会更好。我当时就想知道,有什么办法可以设置一个充当假邮箱的进程吗?你知道我可以扩展的任何开源实现吗?我更喜欢已经用 c# 编写的东西。
预先感谢您的帮助,
贝尔纳贝
i'm about to start the development of a new automated-email application. The idea is that customers (or other external users) send emails to a mailbox and then an automated process will read them, extract their information and insert it into some database. It's a requirement that the emails have an standard format in order to be parsed (standard subject, etc.).
The obvious thing to do would be to set up a process that periodically polls an ordinary mailbox, through pop-3 for example, processing the messages it finds. However, it would be for me much nicer to be able to process the emails as they arrive. I was wondering then, is there any way to set up a process that acts as a fake email-box? do you know about any open-source implementation of something like that I can extend? I would prefer something already written in c#.
Thanks in advance for your help,
bernabé
发布评论
评论(1)
使用邮件检索代理 (MRA) 和邮件传送代理 (MDA) 设置本地邮件系统可能是最简单的。常见的组合是 MRA 的 fetchmail 和 procmail 或 maildrop 用于丙二醛。 MRA 从您的帐户(POP3、IMAP 等)下载邮件,MDA 对其进行处理以找出它属于哪个邮箱。我至少知道 maildrop,但也可能知道 procmail,支持在邮件上运行任意脚本,这样你就可以用它来处理每封电子邮件
It's probably easiest to set up a local mail system with a mail retrieval agent (MRA) and mail delivery agent (MDA). A common combination is fetchmail for an MRA and either procmail or maildrop for an MDA. The MRA downloads mail from your account (POP3, IMAP, etc.), and the MDA processes it to figure out what mailbox it belongs in. I know at least maildrop, but probably procmail as well, supports running arbitrary scripts on the messages, so you could use that to process each e-mail