Technical article 107702

Basic troubleshooting for sendmail.

OpenServer 6.0.0OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7UnixWare 7.1.3UnixWare 7.1.4

Written · Last revised

Problem

Sendmail is not working properly.

Cause

There are several reasons why sendmail may not work. Follow the steps below to narrow down the problem, and collect information needed to solve the issue.

Solution

1. Verify network connectivity.  Can you ping the systems you are
   trying to send mail to?  Can the systems sending mail to you ping
   you  successfully?  If ping by name fails, can you ping or be
   pinged by ip address?  Network connectivity must be sound before
   sendmail will work as expected.  For example, if your server was
   experiencing DNS problems, mail may not be properly delivered.
   Once you have resolved the DNS issues, you may need to restart
   the sendmail process to complete mail delivery. The commands
   to restart sendmail are:
# /etc/rc2.d/P86sendmail stop
# /etc/rc2.d/P86sendmail start
2. Was sendmail recently configured?  Was the system converted from
   MMDF to sendmail?  For the appropriate procedures for converting
   from MMDF to sendmail see TA107593, "How do I change from MMDF to
   sendmail in SCO OpenServer Release 5?", or tcpip/491 "How do I
   change from MMDF to sendmail in OSR 3.2v4.x.  For basic sendmail
   configuration steps see tcpip/482, "How to set up a basic sendmail
   configuration for SCO OpenServer 5.".

3. Sendmail listens on port 25. Check that port by telneting to yourself on port 25 on "0" or "localhost".

# telnet 0 25

Or, telent to the sendmail machine from another box:

# telnet x.x.x.x 25
where x.x.x.x is the ip address of the sendmail machine. If
telneting to that port fails, can you telnet to other ports? If
not, check for loose cable connections.  You must be able to
telnet to port 25 on the sendmail machine for sendmail to work
properly.

4. Check the sendmail configuration by typing:

# cd /etc
# cp sendmail.cf sendmail.cf.orig
For OpenServer:
--------------
"mkdev cf" and choosing menu option 7: "Review configuration
information".
For UnixWare:
------------
"scoadmin mail"

Write this information down for future reference.

5. Run sendmail in verbose mode to collect potential error messages:

# /usr/lib/sendmail -v user@domain < /dev/null
user@domain... Connecting to mailserver.domain. via tcp...
220 mailserver.domain Server SMTP (Complaints/bugs to: Postmaster)
>>> HELO user.domain
250 mailserver.domain
>>> MAIL From:<user@client.domain>
250 OK
>>> RCPT To:<user@domain>
250 Recipient OK.
>>> DATA
354 Enter Mail, end by a line with only '.'
>>> .
250 Submitted & queued (msg.aa15179)
user@domain... Sent (Submitted & queued (msg.aa15179))
Closing connection to mailserver.domain.
>>> QUIT
221 mailserver.domain says goodbye to client.domain at Wed Aug 20
09:53:50.

A successful send will give output similar to the above. A failed send will give informative error messages. Write them down.

Alternatively, simply run:
# telnet mailserver.domain 25
and enter the commands manually:

HELO user.domain MAIL FROM: user@client.domain RCPT TO:user@domain DATA Testing! .

Please note that RCPT TO: MUST be in Upper Case and there's no
space after the TO:.  This may vary between different mail
servers.

6. Repeat #5 with different addresses, local and remote.

7. If sendmail shows the mail is sent successfully, but it does not arrive as expected, check the target machine's queue directory.

Either look at the contents of the directory /usr/spool/mqueue, or
use the command "/usr/bin/mailq".  Are the messages there?

In the above example, you would check for the file msg.aa15179.

Sendmail can be stopped but local mail will still continue to be
delivered.  To stop local email then use the following change in
the /usr/lib/sendmail.cf file:
# default delivery mode
O DeliveryMode=background
to:
O DeliveryMode=queue
Then restart Sendmail with:
# /etc/rc2.d/P86sendmail stop
# /etc/rc2.d/P86sendmail start

Any local mail will then reside in /usr/spool/mqueue until either the above is reversed or the mail queue can be cleared manually with:

# /usr/lib/sendmail -q

8. For even more detailed debugging information, run sendmail with the -d option. The output can be extensive, so be sure to write it to a file so you can view and search the file easily. For example:

# /usr/lib/sendmail -d user@domain < /dev/null > /tmp/sendmail.log

9. Check the logfile /usr/adm/syslog for entries containing the word "sendmail".

NOTES:    If Sendmail and DNS are failing please check the permission of:
/etc/resolv.conf
are set to:
# chmod 644 /etc/resolv.conf

If you see the following errors when "Sendmail" starts:

sendmail[10200]: n0I8R2Zv008224: SYSERR(root): hash map "Alias0": unsafe map file /etc/mail/aliases.db: World writable directory

or:

/etc/mail/sendmail.cf: line 72: fileclass: cannot open '/etc/mail/local-host-names': World writable directory

or:
WARNING: World writable directory /

The permissions or ownerships of the files or directories that sendmail uses are not correct.

Then check the permissions of:

/ - with "ls -al /" - should be 755 and owned by root and sys.

/etc, /etc/mail, /usr, /var, /var/spool and /var/spool/mqueue

Make sure these permissions are set to the following:

For UnixWare 7.1.3
drwxr-xr-x   58 root     sys            4096 Jan 21 05:33 /
drwxr-xr-x   71 root     sys            6144 Jan 21 05:34 /etc/
drwxr-xr-x    8 bin      bin            2048 Aug 20 10:50 /etc/mail
drwxr-xr-x   33 root     sys            2048 Nov 14  2007 /usr
drwxr-xr-x   33 root     sys            2048 Jun 16  2008 /var
drwxrwxr-x   19 root     bin            2048 Dec 18 16:46 /var/spool
drwx--x--x    2 root     bin           34816 Jan 21 05:34 /var/spool/mqueue
For UnixWare 7.1.4:
drwxr-xr-x   63 root     sys            4096 Jan 22 06:35 /
drwxr-xr-x   66 root     sys            6144 Jan 22 06:41 /etc/
drwxr-xr-x    8 bin      bin            2048 Jan 22 07:09 /etc/mail
drwxr-xr-x   33 root     sys            2048 Sep 12 14:35 /usr
drwxr-xr-x   31 root     sys            2048 Sep 12 15:05 /var
drwxrwxr-x   17 root     bin            2048 Sep 12 15:05 /var/spool
drwx------    2 root     sys            2048 Jan 21 23:45 /var/spool/mqueue
For OpenServer6:
drwxr-xr-x   37 root     bin       2048 Jan 21 16:40 /
drwxrwxr-x   52 bin      auth     10240 Dec 18 14:19 /etc
drwxr-xr-x    4 bin      bin       2048 Jul  4  2006 /etc/mail
drwxrwxr-x   27 root     auth      2048 Apr  9  2008 /usr
drwxr-xr-x   14 root     sys       2048 Apr  9  2008 /var
drwxrwxr-x   10 root     bin       2048 May 20  2008 /var/spool
drwx------    2 root     sys       2048 Jan 20 23:45 /var/spool/mqueue@
NOTE:     I get the following error during the creation of sendmail.cf:

makemap: error opening type hash map mailertable.db: Permission denied

Run:
# chmod 666 /etc/mail/mailertable*
NOTE:     If you see "Name Server Timeout" after configuring Sendmail, check
          that you have SMTP access to the server you are trying to email to.

See also

TA105554, "Tips for troubleshooting POP mail."

From the Xinuos technical article database, record 107702. Reproduced with permission. The original is at www.sco.com/ta/107702, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.