These patches to Zmailer 2.2e10's smtpserver/smtpserver.c file add several features to the SMTP server. You must rebuild and reinstall smtpserver to enable them, and some of them require new command line or configuration file options.
smtpserver will now use Wietse Venema's TCP Wrappers if compiled with -DWRAPPERS (you will also need to add appropriate -I and -L/-l options to the Makefile). smtpserver continues to run standalone, not from inetd; all expanded TCP Wrappers options (such as twist) work fine. The daemon name it looks for in your TCP Wrappers control file is hardcoded as smtpserver.
Two environment variables can be set in TCP Wrappers lines to control the subsequent behavior of the SMTP server for both accepted and rejected connections. On rejected connections:
There are two new command line flags that let you limit how many simultaneous connections the SMTP server will accept, plus a new option to set the listen() backlog size. They are:
This adds a new smtpserver.conf option, h, that enables verification of the hostname given in HELO greetings. If you use this your $MAILSHARE/cf/server.cf file MUST support the helo key in the server function. Failure to do this will cause all mail to be rejected.
In our server.cf file, we require HELO names to be fully qualified. You can do any verification you want to (or none, and just save the HELO address for later use). Some of our antispam mods require the HELO name being available. If you require fully qualified HELO names, you will need to specifically exempt any machines that HELO with partially qualified ones that you want to talk to from this check.
This check doesn't conform with the letter of RFC 821 as amended by the Hosts Requirement RFC. But then again, neither do people who send bad HELO names in the first place, and it does deal with the spammers who like making them up at random. We've chosen rejecting spam and badly configured machines over the strict letter of RFC 821 compliance.
The original code for smtpserver-based HELO syntax checking incorrectly accepted spaces in the HELO name due to use of sscanf(). This is fixed (or at least changed) in this patch.
Messages from the underlying router process used to be used as the argument to a printf() call and as a result had any % signs expanded in random ways. This has been fixed.