Using Sendmail as a Mail User Agent (MUA)

This section provides an example using Sendmail a Mail User Agent (MUA) to transfer a local email message.

Sendmail is designed as a Mail Transfer Agent (MTA), not a Mail User Agent (MUA). There are other better MUA programs available on UNIX systems, like mail, elm, and pine.

But Sendmail can be used as MUA to collect an email message directly from the user interface and transfer it to the machine identified in the recipient email address. Here is an example session of using Sendmail as a MUA to transfer a local email on a Linux system:

$su root

#which sendmail
/usr/sbin/sendmail

#ls -l /var/spool/mail/herong
-rw-rw----   1 herong   mail   442638 Jul 20 12:08 herong

#rm /var/log/mail.log
#rm /var/spool/mail/herong
#sendmail -X /var/log/mail.log -v herong
From: root
To: herong
Subject: First Test

Hi. This is a test.
.
herong... Connecting to local...
herong... Sent

#more /var/log/mail.log
<<< From: root
<<< To: herong
<<< Subject: First Test
<<<
<<< Hi. This is a test.
<<< .
>>> herong... Connecting to local...
=== EXEC procmail -a -d herong
>>> From root@darkstar.home.com Thu 23 Jul 12:25:29 1998
>>> Return-Path: <root>
>>> Received: (from root@localhost)
>>>       by darkstar.home.com (8.9.0/8.9.0) id MAA00402
>>>       for herong; Thu, 23 Jul 1998 12:25:29
>>> Date: Thu, 23 Jul 1998 12:25:29
>>> Message-Id: <199807231625.MAA00402@darkstar.home.com
>>> From: root@darkstar.home.com
>>> To: herong@darkstar.home.com
>>> Subject: First Test
>>>
>>> Hi. Test is test 1.
>>> herong... Sent

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

Hi. Test is test 1.

Notice that:

Table of Contents

 About This Book

 2002 - .NET Framework Developed by Microsoft

 1995 - PHP: Hypertext Preprocessor Created by Rasmus Lerdorf

 1995 - Java Language Developed by Sun Microsystems

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

 1991 - Gopher Protocol Created by a University of Minnesota Team

 1984 - X Window System Developed a MIT Team

 1984 - Macintosh Developed by Apple Inc.

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

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

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

 1978 - The C Shell Developed by Bill Joy

 1977 - The Bourne Shell Developed by Stephen Bourne

 1977 - Apple II Designed by Steve Jobs and Steve Wozniak

 1976 - vi Text Editor Developed by Bill Joy

 1974 - Internet by Vinton Cerf

 1972 - C Language Developed by Dennis Ritchie

 1971 - FTP Protocol Created by Abhay Bhushan

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

 1957 - FORTRAN Language Developed by IBM

 References

 Full Version in PDF/EPUB