Need an example POP3 server or IMAP server written in Python

Experimenting with app emails for apps. I already created my SMTP server, but now there is no centralized delivery mechanism. I can create a decency delivery mechanism very easily, but I'm trying to use protocol standards. I'm not interested in HTTP, FTP, or SOAP, but only mail protocols.

I browsed the net for python examples, still no luck. I donโ€™t want to spend too much time and effort on this, because at the moment this is the only field study of the technique to see if asynchronous email delivery is a viable approach for exchanging data between applications. I know about sendmail solutions, and I am not interested in this, since the solution should be complete on a Python solution, using โ€œbatteriesโ€ where possible, or maybe Twisted if I really do too.

The only two standards that I have reviewed so far are IMAP and POP. I still canโ€™t believe that on this day and at the age we require two protocols for sending and delivering mail, if there is something that does two in one (this is a protocol), I would be very glad to look into it.

After further investigation, I believe that the only viable option will be distorted, any help with this will be great

Update Stop at the POP / IMAP server; all this works too much for a very small reward. However, I used an off-the-shelf server solution that serves email as IMAP4 and sends it as SMTP. Now that I have found this, I will continue to research email apps. So far, an application has been created that downloads RSS feeds and sends them by e-mail in html format. Letters are filtered for content that interests me in a server application written in Python. The next step is the DSL language for communicating with the server, similar to telnet by email. It should be fun. After that, RPC via e-mail between several applications.

+4
source share
4 answers

Edit: A simple example of a POP3 server can be found here: http://code.activestate.com/recipes/534131-pypopper-python-pop3-server/ You will need to replace the message service mechanism, but you will need to do this anyway. To implement an IMAP server using Twisted, see https://github.com/davglass/twimapd .

If you need email, you are looking at SMTP, POP and IMAP. What is email by definition.

Actually, SMTP should be enough for delivery; POP / IMAP is designed for search and is actually not so useful if your applications can always connect directly to each other.

If you donโ€™t need to use email specifically, you may need to learn alternative protocols such as XMPP (Jabber): http://en.wikipedia.org/wiki/Extensible_Messaging_and_Presence_Protocol

+4
source

I wrote a simple email message queue for an application to communicate with applications. Here you can find the details http://blog.bootstraptoday.com/2010/11/28/really-simple-python-message-queue/

Main idea 1. Derive a class from smtpd.SMTPServer. 2. Override the process_message method. 3. In 'process_message, start the thread. 4. Inside the stream function, read the contents of the message and complete the task. 5. The contents of the message are simple JSON objects. 6. The client code is simple. The client just needs to send an email to this local SMTP server. Send the task parameters encoded in JSON format as the contents of this email. Thus, the client can be a simple shell script.

There were about 40-50 lines of python code in total.

A somewhat similar idea, but a much more complicated check on the Lamson implementation : Delayed queuing

+2
source

Quotient is a messaging server that includes Twisted-based email support. A few years ago, development began at a new database level, and the latest version supports SMTP and POP3 . An older version supports IMAP4 support .

+1
source

It looks like you want to play with Lamson and bring it back using Postfix (+ Cyrus , optional).

+1
source

All Articles