A gem is available: gem install maildiode,
or you can download it from
RubyForge.
Because all the others I have found are either too hard to configure, or are written in insecure languages (C).
SMTP servers like sendmail, postfix, and exim serve two completely different purposes:
It turns out that handling outgoing mail is really hard, while handling incoming mail is really simple. So MailDiode handles incoming mail and not outgoing mail.
#debug warn # error warn info debug
server hostname localhost
server ip 0.0.0.0
server port 10025
server maxconnections 20
#server user maildiode
maildir bob@example.com /home/bob/mail
maildir kevin /home/kevins/TestMail/main/
maildir catchall /home/kevins/TestMail/other/
plugin alias
alias kevin ^kevin@qualitycode.com$
alias kevin ^kevins@qualitycode.com$
alias catchall @qualitycode.com$
alias catchall @example.com$
plugin blacklist
blacklist to \d{6,}.*@qualitycode.com$
plugin delay
delay helo 5
delay mail 6
delay rcpt 7
plugin greylist
greylist delayminutes 5
The first section has general information about the server. The second section sets up two maildir destinations, each identified by an arbitrary string. (These could be local accounts, full email addresses, or anything else). The alias section uses regular expressions to create multiple aliases and "catchall accounts" that route to the destinations set up in the earlier section. The rest of the file is used to configure any optional plugins.
That's it. Simple.