Keld Jørn Simonsen wrote:
I am fooling around with my postfix, and I wanted to reject mail
without a valid MX record. How to do that?
Don't do that. MX records are not required, and you will reject
legitimate email.
That sounds reasonable.
Yes it is understood that the RFCs do not require MX for mail.
But how many legitimate mails do not have MX?
You will find out once you reject them ;)
Anyway: IMHO, a "valid" MX record should be a fully qualified domain
name (FQDN) which would contain at least two characters from the
alphabet [a-z] in the top level domain at the end of the record. So
maybe you
could use a regexp table to check for those:
!/[a-z][a-z]$/
For details, see
man regexp_table
Hope this helps,
wolfgang