Actually, I'm using a RaspberryPI 3b.
This is my /etc/ssmtp/ssmtp.conf
:
[email protected]
mailhub=smtp.gmail.com:587
rewriteDomain=gmail.com
hostname=raspi
FromLineOverride=YES
UseTLS=Yes
UseSTARTTLS=YES
AuthUser=gmail_user
AuthPass=PASSWD
This is my /etc/ssmtp/revaliases
:
root:[email protected]:smtp.gmail.com:587
pi:[email protected]:smtp.gmail.com:587
Trying to send a mail:
root@raspberrypi:~# echo "hola" | ssmtp [email protected] -v
[<-] 220 smtp.gmail.com ESMTP x129sm89284054wmg.44 - gsmtp
[->] EHLO raspi
[<-] 250 SMTPUTF8
[->] STARTTLS
[<-] 220 2.0.0 Ready to start TLS
[->] EHLO raspi
[<-]
ssmtp: (raspi)
hostname
:
root@raspberrypi:~# hostname
raspberrypi
This is a ping
to google and the DNS servers that I'm using:
root@raspberrypi:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=13.1 ms
^C
--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 13.134/13.134/13.134/0.000 ms
root@raspberrypi:~# cat /etc/resolv.conf
# Generated by resolvconf
nameserver 8.8.8.8
nameserver 8.8.4.4
Also...
- the GMail account have the thing to let less secure applications use the account.
- to make sure the name and password where correct, used copy/paste to google Chrome (Using SSH, so that I can copy/paste things)
- I have a Debian server which works well, also trying to copy/paste all the configuration and change the names from users and hostname, but it didn't work.
I had the same problem (on PC-x64) after updating from 18.04 to 18.10. As some other unrelated things got broken, I updated to 19.04 and even zero-installed 19.10 (currently beta). Now everything else works, but SSMTP still broken. It may be needing an unlisted dependent SSL/TLS library or something like that.
Sadly, SSMTP is unmaintained and my searches turned up of no help too. After reading this question and the comments, I too gave up and installed MSMTP, which is supposed to be the actively maintained, basically following the instructions of that link:
Install (I am assuming you use a debian-related distro on your pi):
Edit
/etc/msmtprc
and put that minimal config:On the Ubuntu 19.10 beta I saw that the package installer added a user/group "msmtp", and made the binary SGUID, so, for security and homogeneity regarding permissions of the config and log file, I did the same on my other systems:
Try that, it has more features than SSMTP (like multiple accounts and user-specific
~/.msmtprc
config) but continues to be simple to configure.