Tuesday, September 28, 2004
Overly pendantic commands
I was called by R (guy I work for) to double check the email system since it looked like (to him) that it wasn't working at all and no emails were being sent (order confirmations, etc). I start checking, and from what I could tell, the email system was working fine. I placed a few test orders from a few sites and got the confirmation email. And from the mail logs, it looked like it was sent off to R as well.
But he wasn't getting them.
A few more tests while talking to R seemed to confirm that email sent to him from the server was being accepted by his ISP, but R was still not getting them. Which indicates to me that his ISP is filtering out spam and for whatever reason, email from this server was being flagged as spam and not delivered.
I then did the following on the server to check something out:
[root]rnm.miami:~>hostx -t mx XXXXXXXXXXXX XXXXXXXXXXXX MX 20 mail2.XXXXXXXXXXXX !!! XXXXXXXXXXXX MX host mail2.XXXXXXXXXXXX is not canonical XXXXXXXXXXXX MX 10 mail.XXXXXXXXXXXX !!! XXXXXXXXXXXX MX host mail.XXXXXXXXXXXX is not canonical
Hmmm … odd. Double check the zone file.
$TTL 3600 @ IN SOA ns1.XXXXXXXXXXXX. root.XXXXXXXXXXXX. ( 2004091801 ; Serial 10800 ; Refresh 3600 ; Retry 3600000 ; Expire 3600 ) ; Minimum IN NS ns1 IN NS ns2 IN NS ns3 IN MX 10 mail IN MX 20 mail2 mail IN A XXX.XXX.XXX.XXX mail2 IN A XXX.XXX.XXX.XXX ns1 IN A XXX.XXX.XXX.XXX ns2 IN A XXX.XXX.XXX.XXX ns3 IN A XXX.XXX.XXX.XXX
Nothing out of the ordinary. The RRs for mail
and mail2
aren't
CNAME
s (which is a common mistake). They look fine to me, and
running host
on outside machines report back fine:
[root]linus:~>host -t mx XXXXXXXXXXXX XXXXXXXXXXXX MX 20 mail2.XXXXXXXXXXXX XXXXXXXXXXXX MX 10 mail.XXXXXXXXXXXX
A quick Google
didn't reveal anything I already didn't know (most of the problems I found
were CNAME
errors). So, I started playing around with the zone
file. Make a change, same error. Make another change, same error. It was
only when I removed all references to mail
and
mail2
when I discovered the problem.
By then, I was doing hostx -G -S -C -A -L 1 zone
(which verifies the entire zone) and getting back errors about
mail
and mail2
. Which shouldn't be happening, as
I had just removed all references to them in the zone file. There
was only one other place where they were defined—/etc/hosts
.
Once I removed those entries from /etc/hosts
, the problem went
away:
[root]rnm.miami:~>hostx -t mx XXXXXXXXXXXX XXXXXXXXXXXX MX 20 mail2.XXXXXXXXXXXX XXXXXXXXXXXX MX 10 mail.XXXXXXXXXXXX
Talk about your overly pendantic host
command.