Postmaster implements an ESMTP server. Given a configuration, it starts up and listens for incoming SMTP connections, handles them, and pipes the accepted e-mail messages into an arbitrary local mailer of your choice. A good local mailer is Procmail. Beyond that, you can configure and modify every little step of the SMTP transaction. All the real work is done through call-back functions.