Using Sendmail as a STMP Server Daemon

This section provides an example using Sendmail as a daemon acting as a STMP server to receive email messages from remote machines.

Sendmail can be used a daemon to:

Here is an example session of using Sendmail as a daemon to receive incoming new emails and process old emails in the queue.

(On darkstar machine)
%su
#ps -x | grep sendmail 
250  ?  S   0:00 sendmail: accepting connections on port 25
#kill 250

#rm /var/log/mail.log
#rm /var/spool/mqueue/*
#rm /var/spool/mail/*
#sendmail -bd -q20m -X /var/log/mail.log
#ps -x | grep sendmail 
323  ?  S   0:00 sendmail: accepting connections on port 25
#


(Go to another machine and login as herong)
$telnet darkstar.home.com 25
Trying 192.168.0.2
Connected to darkstar.home.com.
Escape character is '^]'.
220 darkstar.home.com ESMTP Sendmail 8.9.0/8.9.0 ready; Thu, 13 ...
HELO localhost.home.com
250 darkstar.home.com Hello localhost [192.168.0.1], pleased to mee...
MAIL From: herong@localhost.home.com
250 herong@localhost.home.com... Sender ok
RCPT To: root@darkstar.home.com
250 root@darkstar.home.com... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
From: herong@localhost.home.com
To: root@darkstar.home.com
Subject: Third Test

Hi. Third Test
.
250 VAA00143 Message accepted for delivery


(Back on darkstar machine)
#more /var/log/mail.log
00142 >>> 220 darkstar.home.com ESMTP Sendmail 8.9.0/8.9.0 ready; ...
00142 <<< HELO localhost.home.com
00142 >>> 250 darkstar.home.com Hello localhost [192.168.0.1], ple...
00143 <<< MAIL From: herong@localhost.home.com
00143 >>> 250 herong@localhost.home.com... Sender ok
00143 <<< RCPT To: root@darkstar.home.com
00143 >>> 250 root@darkstar.home.com... Recipient ok
00143 <<< DATA
00143 >>> 354 Enter mail, end with "." on a line by itself
00143 <<< Subject: Third Test
00143 <<< 
00143 <<< Hi. Third Test
00143 <<< .
250 VAA00143 Message accepted for delivery

#more /var/spool/mail/root
From herong@darkstar.home.com Thu 23 Jul 12:25:29 1998
Return-Path: <herong@darkstar.home.com>
Received: from localhost.home.com (localhost [192.168.0.1])
      by darkstar.home.com (8.9.0/8.9.0) id VAA00143
      for root@darkstar.home.com; Thu, 23 Jul 1998 12:25:29
Date: Thu, 23 Jul 1998 12:25:29
Message-Id: <199807230114.VAA00143@darkstar.home.com>
From: herong@localhost.home.com
To: root@darkstar.home.com
Subject: Third Test

Hi. Third Test

Notice that:

Table of Contents

 About This Book

 1957 - FORTRAN Language Developed by IBM

 1970 - UNIX Operating System Developed by AT&T Bell Labs

 1971 - FTP Protocol Created by Abhay Bhushan

 1972 - C Language Developed by Dennis Ritchie

 1976 - vi Text Editor Developed by Bill Joy

 1977 - Apple II Designed by Steve Jobs and Steve Wozniak

 1977 - The Bourne Shell Developed by Stephen Bourne

 1978 - The C Shell Developed by Bill Joy

 1978 - Bash (Bourne-Again Shell) Developed by Brian Fox

 1979 - The Tcsh (TENEX C Shell) Developed by Ken Greer

1983 - "Sendmail" Mail Transfer Agent Developed by Eric Allman

 What Is Sendmail?

 Using Sendmail as a Mail User Agent (MUA)

 Pushing an Email Message in Mail Queue

Using Sendmail as a STMP Server Daemon

 1984 - Macintosh Developed by Apple Inc.

 1984 - X Window System Developed a MIT Team

 1991 - WWW (World Wide Web) Developed by Tim Berners-Lee

 1991 - Gopher Protocol Created by a University of Minnesota Team

 1995 - Java Language Developed by Sun Microsystems

 1995 - PHP: Hypertext Preprocessor Created by Rasmus Lerdorf

 2002 - .NET Framework Developed by Microsoft

 References

 PDF Printing Version