views:

74

answers:

2

Hi,

I'm trying to write a simple mail server using Python.

I found smtpd that can be used as a simple smtp server, but I don't think it supports any form of authentication.

For pop or imap, I haven't found anything at all yet.

I do know Twisted has some support for both smtp and pop or imap, but I can't find any examples or tutorials about it.

An alternative would be to use Clojure, but I still have the same question:

Which libraries should I use and is there any documentation about them?

+1  A: 

Here is an example from Twisted.

And the main page. Follow the link for documentation to find the example and a tutorial.

Edit:

Check the attachment for this ticket for an example IMAP server. Definitely read the thread as it talks about the shortcomings of the example.

tgray
I saw this one. Only a SMTP server without any comments or explanation, and no IMAP server. This is going to be tough for sure...
Pepijn
+1  A: 

A bit late probably but for experimentation you might also want to check pymta which is a pure-python SMTP implementation I'm using for some experiments/testing. It supports SMTP basic auth. Documentation should be at a 'decent' level, check the examples directory and the unit tests-

For anything production-related I'd go for twisted if you don't mind the asynchronous nature.

Felix Schwarz