MailDiode README
A simple incoming mail MTA SMTP daemon
Copyright 2007-2008 Kevin B. Smith
Released under the GNU GPL v3
*** NOTE ***
This code is NOT ready for production use.
You mightlose email if you use it on a real server!!
PROJECT GOALS:
- Simplicity (Ruby, incoming only, minimal core plus plugins)
- Trivial to install and configure (GEM, easy .conf file)
- Security (Ruby, tainting, unit tested, lack of features)
- Modest performance (fine for personal servers)
- Modularity (plugins for non-core features)
FEATURES:
- Unix/Linux Daemon
- Implements SMTP protocol
- Hands off messages to non-core extensions
- Full unit test suite
- Runs in ruby SAFE mode for security
INTENTIONAL NON-FEATURES:
- No outgoing mail
- No TLS/SSL
- No filtering, greylisting, aliases, etc. in the core
- Not expected to handle hundreds of users
REQUIREMENTS:
- POSIX (only tested on Ubuntu Linux)
- Ruby 1.8
- Gems:
a. gurgitate-mail (for maildir)
- Optional Gems:
a. maildiode-greylist, kirbybase (for greylisting)
INSTALLATION AND CONFIGURATION
To install the local .gem file:
gem install
Edit configuration file (can use maildiode.conf.sample as a
starting point. Note that the daemon will drop privileges and
become the user specified in the config file (default 'mail').
This user must have write privileges in any maildir directories,
as well as in any directories used by plugins to store data.
Copy configuration to:
/etc/maildiode/maildiode.conf
Optional: symlink or copy maildiode executable to /etc/init.d/
and add to runlevels as appropriate.
To run in the foreground, for debugging (requires su/sudo):
maildiode run
To start as a daemon (requires su/sudo):
maildiode start
Stop the daemon (requires su/sudo):
maildiode stop
Check status of running daemon:
maildiode status
Check version (requires su/sudo):
maildiode run -- --version
By default, the log is written to /var/log/maildiode
TODO
- Replace generic plugin system with:
alias - given a recipient, returns a recipient; called for RCPT
(probably doesn't need to be a plugin)
envelope_rejector - can reject based on envelope; called
for HELO/EHLO, MAIL, and RCPT
header_rejector - can reject message delivery based on envelope
plus email headers
message_modifier - given an envelope and entire message,
returns an entire message
delivery - given a recipient an entire message, delivers it or
rejects it
- Add rspec tests for each filter/plugin
- Blacklist: Should allow filtering on from, subject, etc
- Add debounce filter to reject bounces for mail we didn't send
- Greylist: Implement greylisting IP exemptions
- Greylist: Periodically clear out old database entries
- Allow integrating milters and/or other external filters
- Remove gurgitate dependency
- Properly handle multiple recipients where some work and some fail
(Reply OK but send bounces to the failures)
- Add a return path header?
- Create SPF filter?
SEE ALSO
Official SMTP spec:
http://rfc.net/rfc2821.html
Great SMTP implementation notes by D. J. Bernstein:
http://cr.yp.to/smtp.html
"Spam filtering for Mail Exchangers":
http://www.tldp.org/HOWTO/Spam-Filtering-for-MX/index.html
List of IP addresses that should be exempt from greylisting:
http://cvs.puremagic.com/viewcvs/greylisting/schema/whitelist_ip.txt?view=markup
An smtp proxy with delay and greylisting, but it is written in C++
and it's not a full MTA: http://www.hermes-project.com/