What's the simplest (least config, lowest footprint) way to give a Linux box the capability to send email?
Eg: if I have a Pi running a few cron jobs and I want it to be able to email me any issues, that kind of thing. Or a web server that might need to send forgotten password reminders but little else.
It'll never need to receive email or provide mail services to others.
I've used ssmtp in the past but recently found something better, but for the life of me can't remember what it was! But as it's a common requirement I'd like to know what other people do.
Mark
On 04/12, Mark Rogers wrote:
What's the simplest (least config, lowest footprint) way to give a Linux box the capability to send email?
Just `mail` on it's own would do the job. It's probably already installed.
echo Hello Steve | mail -s "A subject" steve@offend.me.uk
Steve
That’s a MUA (mail user agent). It needs an MTA (Mail Transfer Agent), too, else it has nowhere to send the mail.
For my sins, I usually install sendmail. Yes, I know its config file looks like heavily corrupted line noise, but you only need to make one change in it; the line that specifies the name of the “smarthost” - the place to send the mail onward - usually your ISP’s mail host.
On 4 Dec 2015, at 09:57, Steve Engledow steve@offend.me.uk wrote:
On 04/12, Mark Rogers wrote:
What's the simplest (least config, lowest footprint) way to give a Linux box the capability to send email?
Just `mail` on it's own would do the job. It's probably already installed.
echo Hello Steve | mail -s "A subject" steve@offend.me.uk
Steve
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
— Sent from my Psion 5MX
On 4 December 2015 at 09:57, Steve Engledow steve@offend.me.uk wrote:
Just `mail` on it's own would do the job. It's probably already installed.
echo Hello Steve | mail -s "A subject" steve@offend.me.uk
Not here (Ubuntu):
$ mail The program 'mail' is currently not installed. You can install it by typing: sudo apt-get install mailutils
Installing mailutils would also bring in postfix amongst others (guile-2.0-libs libgsasl7 libkyotocabinet16 liblzo2-2 libmailutils4 libntlm0 libunistring0 mailutils-common ssl-cert).
Of-course mail can be provided by other packages that don't rely on postfix, which is where I got stuck: which to pick?
Sendmail!
-- Sent from my Psion 5MX Original Message From: Mark Rogers Sent: Friday, 4 December 2015 10:53 To: alug-main Subject: Re: [ALUG] Minimal mail sending
On 4 December 2015 at 09:57, Steve Engledow steve@offend.me.uk wrote:
Just `mail` on it's own would do the job. It's probably already installed.
echo Hello Steve | mail -s "A subject" steve@offend.me.uk
Not here (Ubuntu):
$ mail The program 'mail' is currently not installed. You can install it by typing: sudo apt-get install mailutils
Installing mailutils would also bring in postfix amongst others (guile-2.0-libs libgsasl7 libkyotocabinet16 liblzo2-2 libmailutils4 libntlm0 libunistring0 mailutils-common ssl-cert).
Of-course mail can be provided by other packages that don't rely on postfix, which is where I got stuck: which to pick?
On 2015-12-04 10:52, Mark Rogers wrote:
Of-course mail can be provided by other packages that don't rely on postfix, which is where I got stuck: which to pick?
One small MTA is DMA (DragonFly Mail Agent), which can deliver locally or over SMTP to a remote smarthost, but does not open an SMTP port itself.
On 04/12/15 09:43, Mark Rogers wrote:
What's the simplest (least config, lowest footprint) way to give a Linux box the capability to send email?
Eg: if I have a Pi running a few cron jobs and I want it to be able to email me any issues, that kind of thing. Or a web server that might need to send forgotten password reminders but little else.
It'll never need to receive email or provide mail services to others.
I've used ssmtp in the past but recently found something better, but for the life of me can't remember what it was! But as it's a common requirement I'd like to know what other people do.
Mark
I do this on an Ubuntu machine that doesn't have a proper MTA installed and never will:
apt-get install ssmtp heirloom-mailx -y
then follow this:
https://wiki.archlinux.org/index.php/SSMTP
I secure ssmtp.conf like this:
groupadd ssmtp chown :ssmtp /etc/ssmtp/ssmtp.conf chown :ssmtp /usr/sbin/ssmtp chmod 640 /etc/ssmtp/ssmtp.conf chmod g+s /usr/sbin/ssmtp
This is a helpful link as well:
http://www.binarytides.com/linux-mailx-command/
Cheers, Laurie.
On 4 December 2015 at 11:16, Laurie Brown laurie@brownowl.com wrote:
I do this on an Ubuntu machine that doesn't have a proper MTA installed and never will:
apt-get install ssmtp heirloom-mailx -y
Thanks.
Based on this and other tips what I've just done is: sudo apt-get install dma heirloom-mailx -y
dma doesn't need a smarthost (it'll lookup MX records and send directly, but can be given a smarthost if I want to) so I'm trying that for now and it seems to work.
Thanks all for the advice, and I'm still open to new suggestions!
On 04/12/15 12:55, Mark Rogers wrote:
On 4 December 2015 at 11:16, Laurie Brown laurie@brownowl.com wrote:
I do this on an Ubuntu machine that doesn't have a proper MTA installed and never will:
apt-get install ssmtp heirloom-mailx -y
Thanks.
Based on this and other tips what I've just done is: sudo apt-get install dma heirloom-mailx -y
dma doesn't need a smarthost (it'll lookup MX records and send directly, but can be given a smarthost if I want to) so I'm trying that for now and it seems to work.
Thanks all for the advice, and I'm still open to new suggestions!
Cool. Let me know how you get on with DMA, please. I have quite a few servers with no MTA on them, running SSMTP and mailx, but if DMA is a better solution, I'll look into it.
Cheers, Laurie.
On 4 December 2015 at 13:35, Laurie Brown laurie@brownowl.com wrote:
Cool. Let me know how you get on with DMA, please. I have quite a few servers with no MTA on them, running SSMTP and mailx, but if DMA is a better solution, I'll look into it.
I believe that SSMTP is no longer being maintained, and I had issues a while back - I don't recall what exactly, I think it was TLS certificate related.
DMA is working for me in my environment, which is sending to an email account hosted on Google Apps, albeit that it did get dumped into spam. I think that will generally be the problem with not using authenticated SMTP relays - some destinations will be fine, others will take that as a hint that it is spam like Google did, and others will probably flat out refuse it.
Of-course DMA supports using an authenticated relay as well (not that I have tried that). I just don't like having to store account passwords on boxes like these if I can help it.
If I have any issues I'll try to remember to report back here, although it's such a limited test environment it's not likely to throw up any issues. By so far so good.
On Fri, 4 Dec 2015 12:55:21 +0000 Mark Rogers mark@more-solutions.co.uk allegedly wrote:
On 4 December 2015 at 11:16, Laurie Brown laurie@brownowl.com wrote:
I do this on an Ubuntu machine that doesn't have a proper MTA installed and never will:
apt-get install ssmtp heirloom-mailx -y
Thanks.
Based on this and other tips what I've just done is: sudo apt-get install dma heirloom-mailx -y
dma doesn't need a smarthost (it'll lookup MX records and send directly, but can be given a smarthost if I want to) so I'm trying that for now and it seems to work.
Thanks all for the advice, and I'm still open to new suggestions!
+1 for mailx. I also avoid mailutils because it pulls in too much other stuff. (And -1 for sendmail :-) If I need an MTA, I use postfix......)
Mick
(Oh, and I too would like to know what you think of DMA. I've never used it.)
---------------------------------------------------------------------
Mick Morgan gpg fingerprint: FC23 3338 F664 5E66 876B 72C0 0A1F E60B 5BAD D312 http://baldric.net
---------------------------------------------------------------------
On Fri, Dec 04, 2015 at 02:36:50PM +0000, mick wrote:
On Fri, 4 Dec 2015 12:55:21 +0000 Mark Rogers mark@more-solutions.co.uk allegedly wrote:
On 4 December 2015 at 11:16, Laurie Brown laurie@brownowl.com wrote:
I do this on an Ubuntu machine that doesn't have a proper MTA installed and never will:
apt-get install ssmtp heirloom-mailx -y
Thanks.
Based on this and other tips what I've just done is: sudo apt-get install dma heirloom-mailx -y
dma doesn't need a smarthost (it'll lookup MX records and send directly, but can be given a smarthost if I want to) so I'm trying that for now and it seems to work.
Thanks all for the advice, and I'm still open to new suggestions!
+1 for mailx. I also avoid mailutils because it pulls in too much other stuff. (And -1 for sendmail :-) If I need an MTA, I use postfix......)
I agree about postfix, in fact it seems to get installed anyway on Ubuntu systems. Basic configuration is quite simple.
On 04/12/15 09:43, Mark Rogers wrote:
What's the simplest (least config, lowest footprint) way to give a Linux box the capability to send email?
Eg: if I have a Pi running a few cron jobs and I want it to be able to email me any issues, that kind of thing. Or a web server that might need to send forgotten password reminders but little else.
It'll never need to receive email or provide mail services to others.
I've used ssmtp in the past but recently found something better, but for the life of me can't remember what it was! But as it's a common requirement I'd like to know what other people do.
I use msmtp. Does everything I want to do regarding sending mail. Either from command line, bash scripts or from my websites.
Nev