We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 months ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
编辑:
可以在此处找到 POP3 服务器的简单示例: http:// code.activestate.com/recipes/534131-pypopper-python-pop3-server/ 您将必须替换消息服务机制,但无论如何您都需要这样做。有关使用 Twisted 的 IMAP 服务器实现,请参阅 https://github.com/davglass/twimapd 。
如果您需要电子邮件,那么您会考虑 SMTP、POP 和 IMAP。这就是电子邮件的定义。
其实,对于投递来说,SMTP应该足够了; POP/IMAP 用于检索,如果您的应用程序始终可以直接相互连接,那么它实际上并没有那么有用。
如果您不需要专门使用电子邮件,您可能需要研究替代协议,例如 XMPP (Jabber): http://en.wikipedia.org/wiki/Extensible_Messaging_and_Presence_Protocol
Edit:
A simple example of a POP3 server can be found here: http://code.activestate.com/recipes/534131-pypopper-python-pop3-server/ You will have to replace the message serving mechanism, but you would need to do that anyway. For an IMAP server implementation using Twisted, see https://github.com/davglass/twimapd .
If you want email, then you're looking at SMTP, POP and IMAP. That's what email is by definition.
Actually, for delivery, SMTP should be enough; POP/IMAP is for retrieval and is not really that useful if your applications can always connect to each other directly.
If you don't need to use email specifically, you might want to look into alternative protocols, such as XMPP (Jabber): http://en.wikipedia.org/wiki/Extensible_Messaging_and_Presence_Protocol
我编写了一个简单的基于电子邮件的消息队列,用于应用程序到应用程序的通信。您可以在 http://blog 找到详细信息。 bootstraptoday.com/2010/11/28/really-simple-python-message-queue/
基本思想是
1. 从 smtpd.SMTPServer 派生一个类。
2. 重写“process_message”方法。
3. 在“process_message”中启动一个线程。
4. 在线程函数内部,读取消息内容并执行任务。
5.消息内容是简单的JSON对象。
6.客户端代码简单。客户端只需向该本地 SMTP 服务器发送“电子邮件”即可。将以 JSON 格式编码的任务参数作为此电子邮件的内容发送。所以客户端可以是一个简单的shell脚本。
总共大约有 40-50 行 Python 代码。
有点类似的想法,但更复杂的实现检查Lamson:延迟处理到队列
I wrote a simple email based message queue for application to application communication. You can find the details here http://blog.bootstraptoday.com/2010/11/28/really-simple-python-message-queue/
Basic idea is
1. Derive a class from smtpd.SMTPServer.
2. Override ‘process_message’ method.
3. In ‘process_message’ start a thread.
4. Inside the thread function, read the message contents and execute the task.
5. The message contents are simple JSON objects.
6. Client code is simple. Client just have to send a ‘email’ to this local SMTP server. Send the task parameters encoded in JSON format as content of this email. So the client can be a simple shell script.
In all it was about 40-50 lines of python code.
Somewhat similar idea but much more sophisticated implementation check Lamson : Deferred Processing To Queues
Quotient 是一个消息传递服务器,包括基于 Twisted 的电子邮件支持。几年前,开发从新的数据库层开始,最新版本支持 SMTP 和 POP3。不过,旧版本具有 IMAP4 支持。
Quotient is a messaging server which includes email support based on Twisted. A few years ago development started over on a new database layer, and the most recent version supports SMTP and POP3. The older version has IMAP4 support, though.
看起来你想玩 Lamson 并用 Postfix(+Cyrus,可选)。
Looks like you want to play with Lamson and back it with Postfix (+Cyrus, optionally).