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:

  1. Simplicity (Ruby, incoming only, minimal core plus plugins)

  2. Trivial to install and configure (GEM, easy .conf file)

  3. Security (Ruby, tainting, unit tested, lack of features)

  4. Modest performance (fine for personal servers)

  5. Modularity (plugins for non-core features)

FEATURES:

  1. Unix/Linux Daemon

  2. Implements SMTP protocol

  3. Hands off messages to non-core extensions

  4. Full unit test suite

  5. Runs in ruby SAFE mode for security

INTENTIONAL NON-FEATURES:

  1. No outgoing mail

  2. No TLS/SSL

  3. No filtering, greylisting, aliases, etc. in the core

  4. Not expected to handle hundreds of users

REQUIREMENTS:

  1. POSIX (only tested on Ubuntu Linux)

  2. Ruby 1.8

  3. Gems:

    1. gurgitate-mail (for maildir)

  4. Optional Gems:

    1. maildiode-greylist, kirbybase (for greylisting)

INSTALLATION AND CONFIGURATION

To install the local .gem file:
  gem install <local maildiode gem>

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: rfc.net/rfc2821.html

Great SMTP implementation notes by D. J. Bernstein: cr.yp.to/smtp.html

“Spam filtering for Mail Exchangers”: www.tldp.org/HOWTO/Spam-Filtering-for-MX/index.html

List of IP addresses that should be exempt from greylisting: 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: www.hermes-project.com/