On 15/09/2022 12:00, Mark Rogers mark@more-solutions.co.uk wrote:
I always seem to struggle with this most simple of configuration tasks!
Starting from a clean install of (say) Ubuntu/Debian, and with a set of SMTP server credentials in your hand, what's the best/simplest way to get email set up so that emails from cron jobs get sent, and so that there's a minimal "mail" client at the commandline?
I don't want the overheads of postfix + MySQL that things like mailutils bring in. (Or maybe I should accept those overheads?)
The broader objective is that I can set the recipient address for email to root or other users, and the sender address from which emails get sent by default.
I would opt for msmtp-mta (standard package) which fakes sendmail: https://packages.debian.org/bullseye/msmtp-mta
No daemons, queues, special accounts or other malarky, just an API that other programs know how to operate and a protocol engine that can talk SMTP to your real mail system.
P.
On Thu, 15 Sept 2022 at 14:19, Phil Ashby phil.alug@ashbysoft.com wrote:
I would opt for msmtp-mta (standard package) which fakes sendmail: https://packages.debian.org/bullseye/msmtp-mta
Interesting: that's what I have on the server that's causing me problems and prompted the question!
It prompted me to dig deeper. My issues were down to apparmor not allowing access to /etc/msmtp.aliases (I changed the config to look for /etc/aliases and that problem was fixed).
One thing it doesn't give me is a minimal mail client (all I ever use it for is testing that mail is working but that's obviously a useful test!) I know I can use msmtp but expects (unless I am missing something) a fully formed email with headers to be piped to it, rather than building one from user input the way "mail" does.
On 16/09/2022 11:07, Mark Rogers wrote:
On Thu, 15 Sept 2022 at 14:19, Phil Ashby phil.alug@ashbysoft.com wrote:
I would opt for msmtp-mta (standard package) which fakes sendmail: https://packages.debian.org/bullseye/msmtp-mta
Interesting: that's what I have on the server that's causing me problems and prompted the question!
It prompted me to dig deeper. My issues were down to apparmor not allowing access to /etc/msmtp.aliases (I changed the config to look for /etc/aliases and that problem was fixed).
One thing it doesn't give me is a minimal mail client (all I ever use it for is testing that mail is working but that's obviously a useful test!) I know I can use msmtp but expects (unless I am missing something) a fully formed email with headers to be piped to it, rather than building one from user input the way "mail" does.
Glad you found the apparmor issue - they do make a lot of assumptions writing those rules..
I use mutt on my server for command line mail, the package suggests mail-transport-agent (as provided by msmtp-mta), but doesn't hard depend on anything transport related.
P
On Sat, 17 Sept 2022 at 09:23, Phil Ashby phil.alug@ashbysoft.com wrote:
I use mutt on my server for command line mail, the package suggests mail-transport-agent (as provided by msmtp-mta), but doesn't hard depend on anything transport related.
Thanks, I'll look at mutt.
For now I have found s-nail works quite well.