SMTP Injection via recipient email addresses [pdf]
mbsd.jp
mbsd.jp
It wasn't clear if this can be defeated simply by disabling pipelining? If so, that seems like a sane fix if you don't feel you can trust your application.
In my case we had a server that was running Adobe Coldfusion suddenly start misbehaving itself. After digging around a little we discovered all the outgoing email. I can't remember the exact form but it was something like a forgot password mechanism.
As described in the article the attackers were just exploiting the non-validation of the recipient so they could inject an smtp payload. I remember at the time thinking that it was a) clever of the hackers and b) sloppy of the entire pipeline to not be doing some sense checking.
This is an attack against the SMTP protocol that is run through an SMTP client library. There is very little that an MTA could do to mitigate the attack.
AFAIK qmail doesn't have an API that accepts untrusted input like this.
It could be interesting to see whether there are similar attacks against local MTAs in which a malformed email ends up sending unexpected requests to the remote server when the local server tries to deliver it, but that's not what the article is about.