What is it? EXPN is all the rage now? Must expand email addresses?
So I decide to fix it once and for all. I check the configuration file for Sendmail and don't see any obvious way to disable the EXPN command. Not wanting to hack the source code to remove the EXPN command I figure the next easiest way is to hack the actual binary and change any occurence of E-S-P-N-NULBYTE such that sendmail will no longer be able to actually respond to the EXPN command. I have some software I wrote years ago that makes this relatively easy to do.
So, I find the occurences of E-X-P-N-NULBYTE and make the changes.
No go. Sendmail still reponds to the EXPN command.
Okay, so next it's occurrences of e-x-p-n-NULLBYTE and that's when I find the curious string “noexpn” in the executable. Hmmmmmmmm … I think to myself. Might there actually be a way to disable the EXPN command?
Set the privacy options. “Privacy” is really a misnomer; many of these are just a way of insisting on stricter adherence to the SMTP protocol. The options can be selected from:
- Allow open access
- Insist on HELO or EHLO command before MAIL
- Insist on HELO or EHLO command before EXPN
- Disallow EXPN entirely
- Insist on HELO or EHLO command before VRFY
- Disallow VRFY entirely
- Restrict mailq command
- Restrict -q command line flag
- Don't return success DSNs
- Disallow essentially all SMTP status queries
- Put X-Authentication-Warning: headers in messages
The goaway pseudo-flag sets all flags except restrictmailq and restrictqrun. If mailq is restricted, only people in the same group as the queue directory can print the queue. If queue runs are restricted, only root and the owner of the queue directory can run the queue. Authentication Warnings add warnings about various conditions that may indicate attempts to spoof the mail system, such as using an non-standard queue directory.
I don't know if it's A Good Thing or A Bad Thing that you can learn more about a program from scanning the executable than you could probably get reading the documentation.