simta/simta — pull request #11 by flowerysong (2014-04-03 22:00:21+00:00)
Title: Loopback, banner consumption, and you

MX records were not checked for validity, which (in combination with simta's incorrect greeting banner) can cause a mail loop on global relays when people have stupid, broken MX entries.

simta's greeting banner had the hostname in angle brackets, but RFC 2821 (and our connection code that checks whether we connected to ourselves) expect it to be just a plain hostname.

The connection code was also wrong; it didn't properly handle a plain reply code and would strdup() gibberish into hq_smtp_hostname.