[CentOS] Sending mail from CLI to another SMTP host

R P Herrold herrold at centos.org
Thu Apr 1 04:27:08 UTC 2010


On Thu, 1 Apr 2010, Fajar Priyanto wrote:

> Is it possible to send mail from CLI (bash, python) without any LOCAL
> SMTP installed, using SMTP on another machine.
> Care to give a glimpse of the code?

One approach

step 1: make sure packages 'expect' and 'telnet' are installed
step 2: read: man autoexpect  and RFC 2821
... see worked example for handing email to a remote server
 	http://www.owlriver.com/tips/sendmail-tip/
 	http://www.owlriver.com/tips/trace-sendmail/
step 3: experiment to taste in talking the protocol.  'expect'
 	and autoexpect makes it trivial to build a script that
 	works

-- Russ herrold



More information about the CentOS mailing list