I'm having some trouble getting SSMTP to let me send email as a regular user. When I set up this machine ~a year ago, I'd used Arch's instructions to set up security, but that apparently broke silently at some point with (I assume) an update, and I just realized that I haven't been getting email from cron and whatnot. I'd rather not have to hope that I notice when ssmtp updates and go change everything manually.
I'm getting what looks like a classic permission error:
$ echo "This is a test" | mail -s "Subject" <my email>
send-mail: Cannot open mailhub:25
Can't send mail: sendmail process failed with error code 1
This works perfectly fine when I run mail with sudo. However, my permissions look fine:
$ sudo ls -l /usr/sbin/ssmtp
-rwxr-xr-x 1 root root 39784 Jul 14 2014 /usr/sbin/ssmtp
$ sudo ls -l /etc/ssmtp/ssmtp.conf
-rw-r----- 1 root root 699 Dec 28 16:35 /etc/ssmtp/ssmtp.conf
I've added my user to the "root" group, which seems little iffy, although I'd tried using the "mail" group earlier:
$ groups
root mail [...]
The frustrating part is that I've got a ubuntu box sitting here with what looks like exactly the same configuration, except that it works. What the heck am I doing wrong? [This machine is running Debian "stretch", ssmtp package version 2.64-8+b2]
Edit- As requested, I tried using mail in verbose mode, which didn't yield any additional output (?)
$ echo "Test" | mail -v -s "Test" [email protected]
send-mail: Cannot open mailhub:25
Can't send mail: sendmail process failed with error code 1