Run as a daemon All versions
command-line switch causes
sendmail to become a daemon,
running in the background, listening for and
handling incoming SMTP connections.
To become a daemon, sendmail
first performs a fork(2). The
parent then exits, and the child becomes the daemon
by disconnecting itself from its controlling
command-line switch can be used to prevent the
fork(2) and the detachment
and allows the sendmail
program’s behavior to be observed while it runs in
As a daemon, sendmail does a listen(2) on TCP port 25 by default for incoming SMTP messages. When another site connects to the listening daemon, the daemon performs a fork(2), and the child handles receipt of the incoming mail message.