send email from command line

Smoot Carl-Mitchell smoot at tic.com
Wed Sep 24 15:36:26 UTC 2008


On Wed, 2008-09-24 at 10:42 -0300, Derek Broughton wrote:
> Ken McLennan wrote:
> 
> > G'day there Derek,
> > 
> >> No, there shouldn't.  Mail was written by people who believe that mail
> >> clients _shouldn't_ speak SMTP, and it _must_ have a sendmail-compatible
> >> program to actually deliver the mail
> 
> >     I've no idea about the pros & cons of mtas. Is there a thumbnail
> > version of the argument somewhere? or can you please explain why someone
> > would think SMTP should be avoided?
> 
> In a word, "No". :-)  I've hashed this over so many times with so many
> people, without getting a response that makes sense to me.  It's just a
> Unix meme.  From the point of view of a program like "mailx", outputting a
> message via SMTP syntax is no different from outputting it to a file - it's
> all just I/O - but all the MTA developers I've ever corresponded with
> (quite a few, especially since I hung out on the Exim developers list for a
> while) swear that it's insane to have a client program need to know SMTP
> syntax.  I don't see where it makes a difference to have to know SMTP or to
> have to know _sendmail_ syntax.

There is a distinct difference between SMTP and writing a mail message
to a file.  SMTP is a transport protocol which defines the interaction
between a client (sender) and a server (receiver) to move a mail message
from one to the other.  You may be confusing the difference between the
transport protocol and the format of the message.  SMTP has nothing to
do with the contents of a mail message.  To SMTP those contents are
opaque.

As for the argument about not using SMTP to deliver a mail message to a
local MTA for further processing, I think it comes down to not adding
complexity to the MUA and not duplicating code, plus as I said in a
previous post eliminating the need to handle message queueing and
retransmission in the MUA in case of network problems. 

As a practical matter I think the choice to write, say, mailx
(originally Berkeley Mail) without SMTP support was mostly a result of
the availability of a simple and reliable inter process communications
method (pipes) coupled with a simple process creation system (fork and
exec) in Unix systems.  Why go through all the muck of setting up a
network connection and running SMTP when all you want to do is send a
message to a process (sendmail) which can handle all the harder stuff?

-- 
Smoot Carl-Mitchell
System/Network Architect
smoot at tic.com
+1 480 922 7313
cell: +1 602 421 9005




More information about the ubuntu-users mailing list