Re: Sending mail from CLI to another SMTP host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Fajar Priyanto wrote:
> Hi all,
> 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?
> Thank you.

Personally, I'd use the default Centos install of sendmail because it's there, 
it's easy, and it works the way mail has been intended to work for decades.  The 
default setup is to accept only from localhost, but send anywhere. If you want 
to relay through a known host, configure SMART_HOST in /etc/mail/sendmail.mc and 
restart the sendmail service.  Then your scripts and other programs can simply 
run sendmail to queue/delivey instead of doing it themselves, and can deliver to 
local recipients as well as remote.

If you really don't want a mailer and are ok with failures or want to handle 
queuing and retries yourself, the epel repo has perl-Mail-Sender which is a 
fairly complete smtp send-only client.  After installing use perldoc or 'man 
Mail::Sender' to see the documentation.

-- 
   Les Mikesell
    lesmikesell@xxxxxxxxx


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux