收到电子邮件后立即解析 [英] Parsing emails as soon as they are received

查看:108
本文介绍了收到电子邮件后立即解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有用户发送带有一些我需要提取的文本的电子邮件.每个用户的电子邮件都映射到一个邮箱.我当前正在使用一项cron作业,该作业每5分钟轮询一次邮箱(后缀),检查是否有新邮件,然后将其发送到我有工作人员对其进行解析的队列中.我有两个主要问题:

I have users sending emails with some text I need to extract. Each user's email is mapped to a single mailbox. I'm currently using a cron job that polls the mailbox (postfix) every 5 minutes, checks for new messages, and sends it to a queue where I have workers parse them. I have two main questions:

  1. 有没有一种方法可以让我在收到电子邮件后立即对其进行解析,而不是 轮询服务器?还有,怎么可能 我实现此目的是可扩展的?为了 例如,如果有50个传入 每秒的消息数.
  2. 我正在以编程方式编写每个用户的电子邮件地址,以指向postfix配置文件中的邮箱.创建一个全部捕获"帐户会更好,这样我就不必写每个电子邮件地址了吗?但是,我知道全部使用的帐户都更容易受到垃圾邮件的攻击.<​​/li>
  1. Is there a way I can parse the email as soon as it's received instead of polling the server? Also, how could I implement this to be scalable? For example, if there are 50 incoming messages per second.
  2. I'm programatically writing each user's email address to point to mailbox in the postfix configuration file. Would it be better to create a catch all account, so I don't have to write each email address? However, I know catch-all accounts are more susceptible to spam.

推荐答案

使用管道别名捕获电子邮件,然后使用芹菜将其转储到MQ中进行处理.

Use a pipe alias to catch the email, then use celery to dump it into a MQ for processing.

这篇关于收到电子邮件后立即解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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