I configured reject_invalid_helo_hostname and was surprised to find that underscores were permitted. Judging by the source (I'm not conversant in C), it looks like the author had this comment regarding allowing underscores: "grr.." I feel similarly. Is that you, Mr. Venema? My sympathy. I take it that allowing underscores is for the sake of handling Windows MUAs?
I also noticed that unbracketed address literals were accepted by my server despite the configured reject_invalid_helo_hostname restriction. (I believe RFC 2821 3.1.4 allows only bracketed address literals?) The rejection code seems it would be compiled out with the SLOPPY_VALID_HOSTNAME macro, but a test compile with a couple #warnings inserted shows the macro not to be defined. Ah, but over here in smtpd_check.c it looks like the hostname must also fail valid_hostaddr() to be rejected. The comment here is "XXX back compat". Is allowance of unbracketed address literals done for the sake of matching the behavior of prior versions? Would I be able to apply a local patch to remove that compatibility without adversely affecting the system? And do you have any advice regarding such SMTP stringency as rejecting RFC-incompliant hostname syntax? Lastly, I also configured reject_non_fqdn_helo_hostname, immediately following reject_invalid_helo_hostname, and noticed that _it_ rejected unbracketed address literals. I found it a little confusing that reject_invalid_helo_hostname would not, yet reject_non_fqdn_helo_hostname would. Is this behavior by design? Is there something I'm not understanding about these restrictions? Thanks, RSK
