Technical article 109614

How can sendmail(ADMN) be configured to log incoming and outgoing emails?

OpenServer 5.0.4

Written · Last revised

Problem

Can sendmail(ADMN) log all incoming and outgoing emails?

Solution

sendmail(ADMN) supports various logging levels, including the ability to log the sender and recipient of an email.

(Note: It does not support logging the content of an email.)

Logging is controlled by the LogLevel option (OL) in:

/usr/lib/sendmail.cf

If you want to log all incoming and outgoing email, level 9 is a good choice. Log in as root, edit sendmail.cf(SFF), and change:

# log level
OL1
to:
# log level
OL9
This change will take effect once sendmail(ADMN) is stopped and
re-started.  Log in as root and run the following to stop and
re-start sendmail(ADMN):
/etc/rc2.d/P86sendmail stop
/etc/rc2.d/P86sendmail start

The logging information is placed in /usr/adm/syslog.

NOTE:     The following explains the various logging levels that sendmail
          supports (higher levels include the lower levels):
 0    Minimal Logging
 1    Serious system failures and security problems
 2    Communication failures
 3    Malformed addresses
 4    Malformed qf filenames and similar minor errors
 5    A record of each message received
 6    SMTP VRFY attempts and messages returned to sender
 7    Delivery failures excluding deferred mail due to lack of
      resource
 8    Successful deliveries
 9    Mail deferred due to lack of resource
10    Each key as it is looked up, and the results of each
      database lookup
11    All NIS errors
12    All incoming and outgoing SMTP commands and their
      arguments
13    Bad user shells and world-writable files

See also

The manual pages for sendmail(ADMN) and sendmail.cf(SFF)

From the Xinuos technical article database, record 109614. Reproduced with permission. The original is at www.sco.com/ta/109614, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

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.