Ssmtp send email

Hi,

I'm trying to sending email via ssmtp but getting alway this error

ssmtp: Cannot open mail.gmail.com:465

I followed these istructions: https://openwrt.org/docs/guide-user/services/email/smtp.client on the bottom page, changin user,password etc...

Question: how is UseTLS=YES handled?
Do I have to install certifcate?

Thanks

If you installed ssmtp, it should have pulled all the necessary dependencies (including certificates). If you're using GMail, your /etc/ssmtp/ssmtp.conf should contain something like this:

root=<username>@gmail.com
mailhub=smtp.gmail.com:587
rewriteDomain=gmail.com
hostname=<router hostname>
FromLineOverride=YES
UseTLS=YES
UseSTARTTLS=YES
AuthUser=<username>
AuthPass=<password>
AuthMethod=LOGIN

This configuration Works For Me™.

1 Like

I had to enable this from gmail in order to allow the email forwarding: https://www.dev2qa.com/how-do-i-enable-less-secure-apps-on-gmail/

Question: is this communication encrypted? The auth method and then the message sent from my device to gmail and from gmail to my mail address ?

Thanks

Yes, everything's encrypted. It's just a way to bypass 2FA for a specific app which doesn't support it (in this case, ssmtp).