Pepijn
Pepijn

Reputation: 4253

Writing a Python mail server with authentication

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?

Upvotes: 2

Views: 2819

Answers (2)

Felix Schwarz
Felix Schwarz

Reputation: 3078

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.

Upvotes: 1

tgray
tgray

Reputation: 8966

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.

Upvotes: 2

Related Questions