See also the example Sendmail configurations for mail server, proxy, and client roles.
The following image shows a general outline of the flow of e-mail through Sendmail, configuration files and queue directories, and logging. The image is explained below.
E-mail passing through this daemon may be saved under the /var/spool/mqueue directory before being delivered elsewhere: to another system, or a Local Delivery Agent (LDA) such as procmail. Use mailq to list the contents of this default queue directory, and sendmail -q to force a queue run.
$ sudo mailq
/var/spool/mqueue/df (1 request)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-------
i99I41HC004652 58 Sat Oct 9 11:04 <postmaster@example.org>
<postmaster@example.org>
Total requests: 1
$ sudo /usr/sbin/sendmail -q
Sendmail does not handle local mail delivery. Instead, a LDA handles saving the messages, usually somewhere under /var/mail or /var/spool/mail. Look for Mlocal in sendmail.cf to see what LDA a system uses:
$ grep
^Mlocal /etc/mail/sendmail.cf
Mlocal,P=/usr/local/bin/procmail, F=lsDFMAw5:/|@qSPfhn9,↲
S=EnvFromL/HdrFromL,R=EnvToL/HdrToL,
In Sendmail 8.12 and higher, local e-mail to sendmail is handled by the Mail Submission Agent (MSA), which is configured via the submit.cf file. The MSA will attempt to deliver e-mail via port 25 or 587 (Submission). To configure this destination, set the msp FEATURE in submit.mc and rebuild submit.cf.
$ grep msp /etc/mail/submit.mc
FEATURE(`msp', `[127.0.0.1]')dnl
E-mail passing through the MSA may be saved under the /var/spool/clientmqueue directory. Use mailq -Ac to list the contents of this default queue directory, and sendmail -q -Ac to force a queue run.
$ /usr/sbin/sendmail -d0.13 </dev/null | grep file
Conf file: /etc/mail/submit.cf (default for MSP)
Conf file: /etc/mail/sendmail.cf (default for MTA)
Pid file: /var/run/sendmail.pid (default)
Conf file: /etc/mail/submit.cf (selected)
Pid file: /var/spool/clientmqueue/sm-client.pid (selected)