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.
These details are provided for information only. No information here is legal advice and should not be used as such.