You are not logged in.

#1 2018-04-22 08:27:20

ua4000
Member
Registered: 2015-10-14
Posts: 402

[SOLVED] send local status emails to my email provider

I want my servers to send some local status emails, e.g. from cron or smartmon to my external email Provider.

Testing the available tools (ssmtp, esmtp, msmtp, opensmtp, nullmailer, postfix) are somehow disappointing, either un-maintained, EOL, no setgui feature, not working with my email Provider, "null" error handling, too big for my task.

So I come to https://wiki.archlinux.org/index.php/S- … MTP_server
which seems nice and simple, only lacking:
* sendmail binary for cron
* central config file for the SMTP credentials, which not overwritten during update like /etc/mail.rc

The task seems easy:
* create a binary with setgid for user "mail"
* append SMTP credentials to the command line from a central config file, owned by "root:mail"
* call the mailx from s-nail and let it do all the work
* provide a symlink to sendmail

Question: is there already this kind of "s-nail wrapper" package out there ?
setgid works only with binary, a shell script won't work ?
Would my idea work, or is there a better way ?

Thanks very much!



EDIT + Solved:

I managed to get opensmtp working with my email provider. Seems now the "best" tool, active developed, nice config syntax, no "listen" address required for my case:

# /etc/smtpd/smtpd.conf
table aliases file:/etc/smtpd/aliases 
table secrets file:/etc/smtpd/secrets 
accept from local for local virtual <aliases> deliver to mda "procmail -f -"
accept from local for any relay via smtps+auth://label@xxx.xxx.xxx:465 auth <secrets> as "me@xxx.xxx"

Also the virtual aliases file contains only one line, a catch all :-)

===A big thanks to the opensmtp developers.===

Last edited by ua4000 (2018-04-24 16:58:20)

Offline

Board footer

Powered by FluxBB