For reasons™ I needed my own setup of a temporary and anonymous email server. All it needed to do is accept all incoming emails and store them in a database. To be on the safe side, only the smallest subset of RFC 5321 and not too much unnecessary program logic were implemented. As a result, less than 300 lines of erlang code are able to receive emails just fine.
Check out tmpmail on github.
Interesting observation: A few hours after starting the server, the first scanners started spamming or rather probing. The first few emails received contained a correct 'Received' header that would ordinarily have been inserted by the receiving end. Two months later four distinct To/From combinations send probes on a regular basis from different IPs. I guess this is botnet related. Never mind.
The actual purpose of this exercise was to be able to receive emails from software during a security audit, e.g. password recovery, registration confirmation, newsletters, status emails. For short-term analysis I prefer the python-script mailsink, but tmpmail is best suitable for long-term tests and provides permanent storage.