Configuring Email on Rasbian Buster (Not Sending Email)

I had issues configuring sending Email on Rasbian Buster.  (Linux 10)

In the past I'd followed this type of procedure:

apt-get install ssmtp
apt-get install mailutils
vim /etc/ssmtp/ssmtp.conf

Adding something along the lines of the following:

AuthUser=<myEmail>
AuthPass=<MyEmailPassword>
FromLineOverride=YES
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES
      
However, the problem was that it didn't work. Whenever I tried to send Email, it would fail:
    echo "This is a test" | mail -s "Test" <email>
    mail: cannot send message: Process exited with a non-zero status
      
The first thing was to change from ssmtp to msmtp
    apt remove ssmtp
    apt install msmtp
    vim /etc/msmtprc

    # Gmail specifics
account      gmail
host            smtp.gmail.com
port           587

from           <email>
user           <email>
password       <password>

# Default
account default : gmail

Now you can send Email from msmtp, but 'mail' still doesn't work. 
Make sure that you've installed mailutils:

    apt-get install mailutils

You need to configure the Exim file:
    vim /etc/exim4/update-exim4.conf.conf
Set to internet (wasn't too sure about this)
    dc_eximconfig_configtype='internet'

Finally you need to configure the email alias file:
    vim /etc/email-addresses
    user: <email>
      eg:
    root: me@here.com
 
restart exim4:

    /etc/init.d/exim4 restart

This will say that Email to outgoing email from root should from <email>
      
All works now - not as clear/clean as I would like.

If you want to see what's going wrong:

    tail -f /var/log/exim4/mainlog



Comments

Popular posts from this blog

Quick guide: ADS1115 on Raspberry Pi

Bash Garage Door Monitor on Raspberry Pi