Sendmail - Troubleshooting

Table of Contents

Documents

Troubleshooting

MX Record Domain Information

Sendmail can report domain information for MX records in test mode.

mail:~# sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> /mx norang.ca
getmxrr(norang.ca) returns 1 value(s):
        mail.norang.ca.
> /mx google.com
getmxrr(google.com) returns 4 value(s):
        smtp1.google.com.
        smtp2.google.com.
        smtp4.google.com.
        smtp3.google.com.
>

Checking Local Delivery

To get a list of domains that sendmail considers to be local use:

mail:~# sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> $*w
norang.ca
thorin.intra.norang.ca
ns.intra.norang.ca
frodo.intra.norang.ca
sauron.intra.norang.ca
scatha.intra.norang.ca
www.intra.norang.ca
mail
firewall.intra.norang.ca
gollum.intra.norang.ca
ns3.intra.norang.ca
localhost
glaurung.intra.norang.ca
legolas.intra.norang.ca
wireless.intra.norang.ca
[192.168.0.2]
[192.168.0.7]
[192.168.0.8]
[192.168.0.5]
[192.168.0.6]
[192.168.0.3]
[192.168.0.4]
gandalf.intra.norang.ca
smaug.intra.norang.ca
ssh.intra.norang.ca
mail.intra.norang.ca
[127.0.0.1]
debian.intra.norang.ca
bzflag.intra.norang.ca
> 

Miscellaneous

To force retry attempts for mail stuck in the sendmail queue use

sendmail -q -OMinQueueAge=0

Testing

Relaying

To verify if relaying is enabled use telnet to connect to the target mail server.

gollum:~$ telnet mail.intra.norang.ca 25
Trying 192.168.1.1...
Connected to thorin.intra.norang.ca.
Escape character is '^]'.
220 thorin.intra.norang.ca ESMTP Sendmail 8.13.3/8.13.3/Debian-4; Mon, 14 Feb 2005 16:00:26 -0500; (No UCE/UBE) logging access from: gollum.intra.norang.ca(OK)-gollum.intra.norang.ca [192.168.1.5]

Issue a new mail connection

helo test.com
250 thorin.intra.norang.ca Hello gollum.intra.norang.ca [192.168.1.5], pleased to meet you

Enter the mail from address and the recipient

mail from: bernt@norang.ca
250 2.1.0 bernt@norang.ca... Sender ok
rcpt to: bernt@norang.ca
250 2.1.5 bernt@norang.ca... Recipient ok

If both of these say 'ok' then the mail will accepted for delivery. Terminate the session with

quit
221 2.0.0 thorin.intra.norang.ca closing connection
Connection closed by foreign host.

A connection to mail.norang.ca from somewhere on the Internet should fail if the rcpt to: address is not something@norang.ca as in this session:

bernt@dedalos:~$ telnet mail.norang.ca 25
Trying 69.198.211.168...
Connected to mail.norang.ca.
Escape character is '^]'.
220 thorin.intra.norang.ca ESMTP Sendmail 8.13.3/8.13.3/Debian-4; Mon, 14 Feb 2005 16:06:48 -0500; (No UCE/UBE) logging access from: CPE000102c6bd1e-CM400045980376.cpe.net.cable.rogers.com(OK)-CPE000102c6bd1e-CM400045980376.cpe.net.cable.rogers.com [24.112.12.43]
helo my.fake.domain.com
250 thorin.intra.norang.ca Hello CPE000102c6bd1e-CM400045980376.cpe.net.cable.rogers.com [24.112.12.43], pleased to meet you
mail from: spamaddr@internet.addr.net
250 2.1.0 spamaddr@internet.addr.net... Sender ok
rcpt to: somewhere.else@msn.com
550 5.7.1 somewhere.else@msn.com... Relaying denied
quit
221 2.0.0 thorin.intra.norang.ca closing connection
Connection closed by foreign host.

Debug mode

You can run sendmail in debug mode so it displays current configuration values with

sendmail -d

Author: Bernt Hansen