-
- Posts: 2
- Joined: Sun Feb 14, 2016 4:55 pm
Mail on Buster
On a fresh installed Buster OS on a Raspi zero I can't send mail, I get this error:
mail: cannot send message: Process exited with a non-zero status
On a Raspi zero with Stretch and the same mail configuration the mail works.
Anybody has the same issue? suggestions?
Riccardo
Here is my setup:
Loading the packages
sudo apt-get install ssmtp
sudo apt-get install mailutils mpack
Setting up the defaults for SSMTP
sudo nano /etc/ssmtp/ssmtp.conf
1. Now edit the fields:
root=postmaster
mailhub=smtp.gmail.com:587
hostname=rpi0c
AuthUser=youruserid@gmail.com
AuthPass=userpass
FromLineOverride=YES
UseSTARTTLS=YES
Using Email Now
sudo reboot
echo "sample text" | mail -s "Subject" username@domain.tld
mail: cannot send message: Process exited with a non-zero status
On a Raspi zero with Stretch and the same mail configuration the mail works.
Anybody has the same issue? suggestions?
Riccardo
Here is my setup:
Loading the packages
sudo apt-get install ssmtp
sudo apt-get install mailutils mpack
Setting up the defaults for SSMTP
sudo nano /etc/ssmtp/ssmtp.conf
1. Now edit the fields:
root=postmaster
mailhub=smtp.gmail.com:587
hostname=rpi0c
AuthUser=youruserid@gmail.com
AuthPass=userpass
FromLineOverride=YES
UseSTARTTLS=YES
Using Email Now
sudo reboot
echo "sample text" | mail -s "Subject" username@domain.tld
Re: Mail on Buster
Yes SSMTP does not seem to work on buster, but I can send email using the same gmail credentials using smtplib in a python program, So there must be an incomparability with SSMTP or one of it dependants in buster, but I have no idea what.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported
The use of crystal balls & mind reading are not supported
Re: Mail on Buster
I have made the same observations with Debian / Raspbian – Buster and ssmtp.
Then, I have followed this Wiki Ubuntu about msmtp
https://doc.ubuntu-fr.org/msmtp and
https://doc.ubuntu-fr.org/tutoriel/comm ... e_commande.
Reboot and tested with mail like this :
echo 'message' | mail user@domain.com
I could reuse my programs without changes.
Then, I have followed this Wiki Ubuntu about msmtp
https://doc.ubuntu-fr.org/msmtp and
https://doc.ubuntu-fr.org/tutoriel/comm ... e_commande.
Reboot and tested with mail like this :
echo 'message' | mail user@domain.com
I could reuse my programs without changes.
Re: Mail on Buster
Hi,
Below are my own observations, in case they can help.
I added DEBUG=YES in ssmtp.conf and examined the differences in /var/etc/mail.log
between two identically configured raspberry boxes. In both boxes ssmtp was configured
to send email via gmail.
- Box A with raspberry stretch (ssmtp working ok)
- Box B with raspberry buster (ssmtp not working)
I observed that after trying to send an email from both boxes,
in Box A (the mail went through ok) I had the following log line in mail.log:
SSL connection using RSA_AES_128_CBC_SHA1
In Box B (sending the mail failed) the above log line had been replaced with:
SSL connection using ECDHE_RSA_AES_256_GCM_SHA384
So, it seams that, in buster, ssmpt tries to use a different ciffer.
Below are my own observations, in case they can help.
I added DEBUG=YES in ssmtp.conf and examined the differences in /var/etc/mail.log
between two identically configured raspberry boxes. In both boxes ssmtp was configured
to send email via gmail.
- Box A with raspberry stretch (ssmtp working ok)
- Box B with raspberry buster (ssmtp not working)
I observed that after trying to send an email from both boxes,
in Box A (the mail went through ok) I had the following log line in mail.log:
SSL connection using RSA_AES_128_CBC_SHA1
In Box B (sending the mail failed) the above log line had been replaced with:
SSL connection using ECDHE_RSA_AES_256_GCM_SHA384
So, it seams that, in buster, ssmpt tries to use a different ciffer.
Re: Mail on Buster
Thanks HMo for the linksHMo wrote: ↑Sun Jun 30, 2019 1:44 pm
Then, I have followed this Wiki Ubuntu about msmtp
https://doc.ubuntu-fr.org/msmtp and
https://doc.ubuntu-fr.org/tutoriel/comm ... e_commande.
got my pi email working on buster , with a bit of help from google translate.





We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported
The use of crystal balls & mind reading are not supported
Re: Mail on Buster
Just to follow-up on the previous posts, ssmtp is deprecated on Buster, it is no longer maintained.
(typical experience with a major system change..., sigh!)
The more modern and supported alternative is msmtp.
You can install that package with:
The configuration file is located here : /etc/msmtprc
Strangely enough, it is empty with no clues, which is different from the good old ssmtp.conf file.
However, there is a very large description with details if you use
For gmail accounts, these are the specific elements you should put into /etc/msmtprc:
You can test this with:
I have not yet found a way to set the subject, there is no -s flag either.
However, if you also install mailutils:
Then these two work again:
Unfortunately, my watchdog setup nor cron get the mail out. From the error message in /var/log/mail.err it seems that there is an incompatibility with this setup, and the previously established mail setup.
Hopefully somebody that is more adept can help out to get this fixed.
Hope this helps to get mail going on buster.
Enjoy!
(typical experience with a major system change..., sigh!)
The more modern and supported alternative is msmtp.
You can install that package with:
Code: Select all
sudo apt-get install msmtp msmtp-mta
Strangely enough, it is empty with no clues, which is different from the good old ssmtp.conf file.
However, there is a very large description with details if you use
Code: Select all
man msmtp
Code: Select all
# Generics
defaults
auth on
tls on
# following is different from ssmtp:
tls_trust_file /etc/ssl/certs/ca-certificates.crt
# user specific log location, otherwise use /var/log/msmtp.log, however,
# this will create an access violation if you are user pi, and have not changes the access rights
logfile ~/.msmtp.log
# Gmail specifics
account gmail
host smtp.gmail.com
port 587
from root@raspi-buster
user your-gmail-accountname@gmail.com
password your-gmail-account-password
# Default
account default : gmail
Code: Select all
echo 'your message' | msmtp destination-email-address@gmail.com
However, if you also install mailutils:
Code: Select all
sudo apt-get install mailutils
Code: Select all
echo 'message' | mail -s "raspi-buster" destination-email-address@gmail.com
echo 'message' | sendmail destination-email-address@gmail.com
Hopefully somebody that is more adept can help out to get this fixed.
Hope this helps to get mail going on buster.
Enjoy!
Last edited by paulv on Fri Jul 12, 2019 1:15 pm, edited 3 times in total.
Re: Mail on Buster
You can use both mailutils and mpack with msmtp just as you did with ssmtp.
So any scripts that you have used before with ssmtp, mailutils or mpack will work just the same using msmtp, mailutils or mpack
So any scripts that you have used before with ssmtp, mailutils or mpack will work just the same using msmtp, mailutils or mpack
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported
The use of crystal balls & mind reading are not supported
Re: Mail on Buster
pcmanbob,
Did you try to get mails out from cron or watchdog?
Did you try to get mails out from cron or watchdog?
Re: Mail on Buster
I have several pi's sending emails using cron and also had error messages from cron, if you set up the mailto line in cron, seeing as I am using mail or mpack to send mail from cron I don't see why it should not work with msmtp in exactly the same way.
I would normally just write a short bash script to send the email with what ever information is required
( for example the current IP address of the pi ) and then just call that using cron,
not forgetting that cron runs early in the boot process so if sending email at boot you need to add a delay before trying to send the email to allow networking to be up.
I have never used watchdog so can't comment on that.
I would normally just write a short bash script to send the email with what ever information is required
( for example the current IP address of the pi ) and then just call that using cron,
not forgetting that cron runs early in the boot process so if sending email at boot you need to add a delay before trying to send the email to allow networking to be up.
I have never used watchdog so can't comment on that.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported
The use of crystal balls & mind reading are not supported
Re: Mail on Buster
In case it helps. This comes from a Jessie machine working in the field with msmtp as mailer.
/etc/aliases:
/etc/msmtprc:
The machine has linux watchdog installed and basically the machine (watchdog) sends at least an email per day. I will post a few bits of possibly relevant config in paulv's thread on watchdog. Nothing much.
HTH
Code: Select all
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 8.0 (jessie)
Release: 8.0
Codename: jessie
$ msmtp --version
msmtp version 1.4.32
Platform: arm-unknown-linux-gnueabihf
TLS/SSL library: GnuTLS
Authentication library: GNU SASL
Supported authentication methods:
plain scram-sha-1 cram-md5 external digest-md5 login ntlm
IDN support: enabled
NLS: enabled, LOCALEDIR is /usr/share/locale
Keyring support: none
System configuration file name: /etc/msmtprc
User configuration file name: /root/.msmtprc
Copyright (C) 2014 Martin Lambers and others.
...
Code: Select all
$ cat /etc/aliases
mailer-daemon: postmaster@localhost
postmaster: root@localhost
nobody: root@localhost
hostmaster: root@localhost
usenet: root@localhost
news: root@localhost
webmaster: root@localhost
www: root@localhost
ftp: root@localhost
abuse: root@localhost
noc: root@localhost
security: root@localhost
root: randomuser@gmail.com
Code: Select all
$ cat /etc/msmtprc
# Accounts will inherit settings from this section
defaults
auth on
tls on
tls_certcheck off
# tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile /var/log/msmtp.log
aliases /etc/aliases
# A first gmail address
account admin_mail
host smtp.gmail.com
port 587
from root@thishostname
user randomuser@gmail.com
# App password for this host
# Defined by user randomuser in their G account prefs
# (login to G and add other machines/apps)
password tokengeneratedbygmailforthisapp
# Add more accounts if you want
# Set a default account
account default : admin_mail
HTH
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Re: Mail on Buster
Epoch1970,
Your help is very much appreciated. Merci bien!
First off, I found that you have to use the TLS method the way I used it above, if I use it without as you have, there is an error generated.
With your other information, I think I found the problem with Buster.
There is no /etc/aliases file.
A default installation on one of my Jessie RPi's produces this:
So on Buster, the system has no idea where to send stuff to.
Oversight or bug?
To test this, I added the above entries to /etc/aliases, and as a last line: To cron I added this: Just set your own time instead of 17 14, and this will trigger an email to be sent by cron coming from pi-user@raspi-host-name because /home/pi/whatever does not exist. You could also use
BTW, I still can't get the watchdog package to mail, or log...
Your help is very much appreciated. Merci bien!
First off, I found that you have to use the TLS method the way I used it above, if I use it without as you have, there is an error generated.
With your other information, I think I found the problem with Buster.
There is no /etc/aliases file.
A default installation on one of my Jessie RPi's produces this:
Code: Select all
# /etc/aliases
mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
Oversight or bug?
To test this, I added the above entries to /etc/aliases, and as a last line:
Code: Select all
root: your_email_address@gmail.com
Code: Select all
MAILTO=root
17 14 * * * /bin/sh /home/pi/whatever
Code: Select all
MAILTO="your-email-address@gmail.com"
Re: Mail on Buster
I tend to port working recipes from machine to machine until it breaks, my encounter with msmtp occurred many years ago.
If you lookup the list of files provided by packages msmtp or msmtp-mta you can find /usr/sbin/sendmail and newaliases (in msmtp-mta) but a template for /etc/aliases is nowhere to be found.
I don't know which package provides /etc/aliases on Debian, if any. Not sendmail-base, as far as I can see. Perhaps some greybeards made an executive decision...
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Re: Mail on Buster
Thank you. This worked like a charm for me!paulv wrote: ↑Wed Jul 10, 2019 1:03 pmJust to follow-up on the previous posts, ssmtp is deprecated on Buster, it is no longer maintained.
(typical experience with a major system change..., sigh!)
The more modern and supported alternative is msmtp.
You can install that package with:The configuration file is located here : /etc/msmtprcCode: Select all
sudo apt-get install msmtp msmtp-mta
Strangely enough, it is empty with no clues, which is different from the good old ssmtp.conf file.
However, there is a very large description with details if you useFor gmail accounts, these are the specific elements you should put into /etc/msmtprc:Code: Select all
man msmtp
You can test this with:Code: Select all
# Generics defaults auth on tls on # following is different from ssmtp: tls_trust_file /etc/ssl/certs/ca-certificates.crt # user specific log location, otherwise use /var/log/msmtp.log, however, # this will create an access violation if you are user pi, and have not changes the access rights logfile ~/.msmtp.log # Gmail specifics account gmail host smtp.gmail.com port 587 from root@raspi-buster user your-gmail-accountname@gmail.com password your-gmail-account-password # Default account default : gmail
I have not yet found a way to set the subject, there is no -s flag either.Code: Select all
echo 'your message' | msmtp destination-email-address@gmail.com
However, if you also install mailutils:Then these two work again:Code: Select all
sudo apt-get install mailutils
Unfortunately, my watchdog setup nor cron get the mail out. From the error message in /var/log/mail.err it seems that there is an incompatibility with this setup, and the previously established mail setup.Code: Select all
echo 'message' | mail -s "raspi-buster" destination-email-address@gmail.com echo 'message' | sendmail destination-email-address@gmail.com
Hopefully somebody that is more adept can help out to get this fixed.
Hope this helps to get mail going on buster.
Enjoy!
Re: Mail on Buster
Hello Im new in this world, I have a rapsberry pi3 with debian y want to send email.
I followed this steps :
but return to me pi@raspberrypi:~ $ sudo echo 'your message' | msmtp asanzmaroto@gmail.com
msmtp: /home/pi/.msmtprc: contains secrets and therefore must have no more than user read/write permissions
I give the permision with chmon 777 /home/pi/.msmtprc
pi@raspberrypi:~ $ ls -l /home/pi/.msmtprc
-rwxrwxrwx 1 pi pi 1378 Sep 2 18:11 /home/pi/.msmtprc
But the problem is still.
Can somebody help me please?
Thank you so much
I followed this steps :
Daddyfix wrote:Thank you. This worked like a charm for me!paulv wrote: ↑Wed Jul 10, 2019 1:03 pmJust to follow-up on the previous posts, ssmtp is deprecated on Buster, it is no longer maintained.
(typical experience with a major system change..., sigh!)
The more modern and supported alternative is msmtp.
You can install that package with:The configuration file is located here : /etc/msmtprcCode: Select all
sudo apt-get install msmtp msmtp-mta
Strangely enough, it is empty with no clues, which is different from the good old ssmtp.conf file.
However, there is a very large description with details if you useFor gmail accounts, these are the specific elements you should put into /etc/msmtprc:Code: Select all
man msmtp
You can test this with:Code: Select all
# Generics defaults auth on tls on # following is different from ssmtp: tls_trust_file /etc/ssl/certs/ca-certificates.crt # user specific log location, otherwise use /var/log/msmtp.log, however, # this will create an access violation if you are user pi, and have not changes the access rights logfile ~/.msmtp.log # Gmail specifics account gmail host smtp.gmail.com port 587 from root@raspi-buster user your-gmail-accountname@gmail.com password your-gmail-account-password # Default account default : gmail
I have not yet found a way to set the subject, there is no -s flag either.Code: Select all
echo 'your message' | msmtp destination-email-address@gmail.com
However, if you also install mailutils:Then these two work again:Code: Select all
sudo apt-get install mailutils
Unfortunately, my watchdog setup nor cron get the mail out. From the error message in /var/log/mail.err it seems that there is an incompatibility with this setup, and the previously established mail setup.Code: Select all
echo 'message' | mail -s "raspi-buster" destination-email-address@gmail.com echo 'message' | sendmail destination-email-address@gmail.com
Hopefully somebody that is more adept can help out to get this fixed.
Hope this helps to get mail going on buster.
Enjoy!
but return to me pi@raspberrypi:~ $ sudo echo 'your message' | msmtp asanzmaroto@gmail.com
msmtp: /home/pi/.msmtprc: contains secrets and therefore must have no more than user read/write permissions
I give the permision with chmon 777 /home/pi/.msmtprc
pi@raspberrypi:~ $ ls -l /home/pi/.msmtprc
-rwxrwxrwx 1 pi pi 1378 Sep 2 18:11 /home/pi/.msmtprc
But the problem is still.
Can somebody help me please?
Thank you so much
Re: Mail on Buster
Hi.Aroa wrote: ↑Tue Sep 03, 2019 10:34 ambut return to me pi@raspberrypi:~ $ sudo echo 'your message' | msmtp asanzmaroto@gmail.com
msmtp: /home/pi/.msmtprc: contains secrets and therefore must have no more than user read/write permissions
I give the permision with chmon 777 /home/pi/.msmtprc
pi@raspberrypi:~ $ ls -l /home/pi/.msmtprc
-rwxrwxrwx 1 pi pi 1378 Sep 2 18:11 /home/pi/.msmtprc
But the problem is still.
Can somebody help me please?
Thank you so much
So first question is why are you using " sudo " to call your send mail line ?
You don't need sudo you can send it as the pi user.
Secondly you are getting the message about user permissions because you should only have one user who can read/write the config file for msmtp, so you should be using chmon 700 /home/pi/.msmtprc so that only the pi user has read/write access to the config file.
As always read the error message it tells you what the problem is " contains secrets and therefore must have no more than user read/write permissions "
If you want msmtp to be usable by all users then you need to put the config file in " /etc " and not " /home/pi/ "
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported
The use of crystal balls & mind reading are not supported
Re: Mail on Buster
pcmanbob wrote:Hi.Aroa wrote: ↑Tue Sep 03, 2019 10:34 ambut return to me pi@raspberrypi:~ $ sudo echo 'your message' | msmtp asanzmaroto@gmail.com
msmtp: /home/pi/.msmtprc: contains secrets and therefore must have no more than user read/write permissions
I give the permision with chmon 777 /home/pi/.msmtprc
pi@raspberrypi:~ $ ls -l /home/pi/.msmtprc
-rwxrwxrwx 1 pi pi 1378 Sep 2 18:11 /home/pi/.msmtprc
But the problem is still.
Can somebody help me please?
Thank you so much
So first question is why are you using " sudo " to call your send mail line ?
You don't need sudo you can send it as the pi user.
Secondly you are getting the message about user permissions because you should only have one user who can read/write the config file for msmtp, so you should be using chmon 700 /home/pi/.msmtprc so that only the pi user has read/write access to the config file.
As always read the error message it tells you what the problem is " contains secrets and therefore must have no more than user read/write permissions "
If you want msmtp to be usable by all users then you need to put the config file in " /etc " and not " /home/pi/ "
Thank you so much. It is solve
You are right, i didnt need sudo before.
i change chmon 700 /home/pi/.msmtprc and also i move the config file in "/etc"
Everything is working great!!!! Thanks





Re: Mail on Buster
Some additional info for people that find this.
msmtp is expecting a fully formatted complete email with RFC5322 compliant headers. (which is why there is no option to set a subject)
I use a line similar to this in a script called by a cron to send an alert email.
msmtp is expecting a fully formatted complete email with RFC5322 compliant headers. (which is why there is no option to set a subject)
I use a line similar to this in a script called by a cron to send an alert email.
Code: Select all
printf "To: email@domain.com\nFrom: ProperName <email2@domain.com>\nSubject: This is my subject\n\nThis is my message" | msmtp email@domainc.com
Re: Mail on Buster
For those that arrive here in trying to setup MSMTP for e-mail on Buster. I have it running on several Buster Pi's (B+, 3B+ and 4B) after following much of the information in this thread and some other research.
Here are my config files:
/etc/msmtprc
and
/etc/aliases
The following works to email a message:
One thing I have noticed which is different from SSMTP on my other Pi's/OS's is that before when the e-mal arrived the FROM displayed both the e-mail address (me@gmail.com) AND the "friendly name" which g-mail associated with that address, ie "Sam Smith <me@gmail.com> ". Now usng MSMTP what I get is this "<me@gmail.com", but no "friendly name". I'm not aware of anything I did special with SSMTP. Can anyone suggest how I can again get the "friendly name"?
Thanks....RDK
Here are my config files:
/etc/msmtprc
Code: Select all
defaults
auth on
tls on
# following is different from ssmtp:
tls_trust_file /etc/ssl/certs/ca-certificates.crt
# user specific log location, otherwise use /var/log/msmtp.log, however,
# this will create an access violation if you are user pi, and have not changes$
#logfile ~/.msmtp.log
logfile /var/log/msmtp/msmtp.log
aliases /etc/aliases
# Gmail specifics
account gmail
host smtp.gmail.com
port 587
from me@gmail.com
user me@gmail.com
password my#@%$*pw
# Default
account default : gmail
/etc/aliases
Code: Select all
# Send root to
root: me@somewhere.com
# Send cron to
cron: me@somewhere.com
# Send everything else to
default: me@somewhere.com
Code: Select all
echo "MSMTP Test Messsage" | mail -s "MSmpt Msg" me@somewhere.com
Thanks....RDK
Re: Mail on Buster
Looking at the mail log you should find that when using the mail command to send mail with msmtp that the FROM address is actually set to pi@hostname , so for example one of my pi this is " pi@Busterpi "
But for some reason Gmail just seems to ignore this when using msmtp, I have even tried using the -F option to change the FROM to something else using the msmtp command to send mail directly and even though the FROM is changed to what ever I set it to, it never appears on the email.
I have tried lots of examples I found on the web and non have worked when using msmtp , mail or mpack to send emails , some even broke the email so it would not send.
So it seems to me that using msmtp with a Gmail account you are stuck with the From just containing " mail@gmail.com(mail@gmail.com) "
If I ever find a way I will of course post it here.
edit.....
I have also found that when using smtplib to send mail directly from a python program even though the FROM is set to something other than the email address Gmail still only displays the From just containing " mail@gmail.com(mail@gmail.com) "
But for some reason Gmail just seems to ignore this when using msmtp, I have even tried using the -F option to change the FROM to something else using the msmtp command to send mail directly and even though the FROM is changed to what ever I set it to, it never appears on the email.
I have tried lots of examples I found on the web and non have worked when using msmtp , mail or mpack to send emails , some even broke the email so it would not send.
So it seems to me that using msmtp with a Gmail account you are stuck with the From just containing " mail@gmail.com(mail@gmail.com) "
If I ever find a way I will of course post it here.
edit.....
I have also found that when using smtplib to send mail directly from a python program even though the FROM is set to something other than the email address Gmail still only displays the From just containing " mail@gmail.com(mail@gmail.com) "
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported
The use of crystal balls & mind reading are not supported
Re: Mail on Buster
PCMANBOB.....Thanks, I'll stop looking and worrying about it....RDK
Re: Mail on Buster
get rid of access violation for /var/log/msmtp.log:paulv wrote: ↑Wed Jul 10, 2019 1:03 pmUnfortunately, my watchdog setup nor cron get the mail out. From the error message in /var/log/mail.err it seems that there is an incompatibility with this setup, and the previously established mail setup.Code: Select all
# user specific log location, otherwise use /var/log/msmtp.log, however, # this will create an access violation if you are user pi, and have not changes the access rights logfile ~/.msmtp.log
Code: Select all
sudo touch /var/log/msmtp.log
sudo chown mail:mail /var/log/msmtp.log
sudo chmod 660 /var/log/msmtp.log
adduser pi mail
#log out and in again, to make new group-membership effective
add the following line to your crontab
Code: Select all
MAILTO=mymail@mydomain.com
add the following line to your watchdog.sh
Code: Select all
mailto=mymail@mydomain.com
Re: Mail on Buster
Hi guys
I am struggling to get working this email sending On Pi4.
First of all on my buster I don't have this 2 files: /etc/msmtprc and /etc/aliases
I followed the installation, was successful.
Really stucked because I don't know what I am doing wrong...
Please advice.
Thanks , Peter
I am struggling to get working this email sending On Pi4.
First of all on my buster I don't have this 2 files: /etc/msmtprc and /etc/aliases
I followed the installation, was successful.
Code: Select all
pi@raspberrypipeti:/ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster
Code: Select all
pi@raspberrypipeti:/ $ msmtp --version
msmtp version 1.8.3
Platform: arm-unknown-linux-gnueabihf
TLS/SSL library: GnuTLS
Authentication library: GNU SASL
Supported authentication methods:
plain scram-sha-1 external gssapi cram-md5 digest-md5 login ntlm
IDN support: enabled
NLS: enabled, LOCALEDIR is /usr/share/locale
Keyring support: none
System configuration file name: /etc/msmtprc
User configuration file name: /home/pi/.msmtprc
Please advice.
Thanks , Peter
Re: Mail on Buster
You did nothing wrong , you have to create these 2 files using a simple file editor like nano, putting in the required information for your particular email account.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported
The use of crystal balls & mind reading are not supported
Re: Mail on Buster
Thank you.....
After changing write permission and creating the 2 files working nice. Tested with:
Code: Select all
echo 'your message' | msmtp destination-email-address@gmail.com
Thank you for your advice
Peter
Re: Mail on Buster
hello i tried this but it did not work for me i dont know if its a mistake i made or how but i need helppaulv wrote: ↑Wed Jul 10, 2019 1:03 pmJust to follow-up on the previous posts, ssmtp is deprecated on Buster, it is no longer maintained.
(typical experience with a major system change..., sigh!)
The more modern and supported alternative is msmtp.
You can install that package with:The configuration file is located here : /etc/msmtprcCode: Select all
sudo apt-get install msmtp msmtp-mta
Strangely enough, it is empty with no clues, which is different from the good old ssmtp.conf file.
However, there is a very large description with details if you useFor gmail accounts, these are the specific elements you should put into /etc/msmtprc:Code: Select all
man msmtp
You can test this with:Code: Select all
# Generics defaults auth on tls on # following is different from ssmtp: tls_trust_file /etc/ssl/certs/ca-certificates.crt # user specific log location, otherwise use /var/log/msmtp.log, however, # this will create an access violation if you are user pi, and have not changes the access rights logfile ~/.msmtp.log # Gmail specifics account gmail host smtp.gmail.com port 587 from root@raspi-buster user your-gmail-accountname@gmail.com password your-gmail-account-password # Default account default : gmail
I have not yet found a way to set the subject, there is no -s flag either.Code: Select all
echo 'your message' | msmtp destination-email-address@gmail.com
However, if you also install mailutils:Then these two work again:Code: Select all
sudo apt-get install mailutils
Unfortunately, my watchdog setup nor cron get the mail out. From the error message in /var/log/mail.err it seems that there is an incompatibility with this setup, and the previously established mail setup.Code: Select all
echo 'message' | mail -s "raspi-buster" destination-email-address@gmail.com echo 'message' | sendmail destination-email-address@gmail.com
Hopefully somebody that is more adept can help out to get this fixed.
Hope this helps to get mail going on buster.
Enjoy!
i get this error wen i try to test it.
msmtp: authentication failed (method PLAIN)
msmtp: server message: 535-5.7.8 Username and Password not accepted. Learn more at
msmtp: server message: 535 5.7.8 https://support.google.com/mail/?p=BadCredentials h7sm503835wml.24 - gsmtp
msmtp: could not send mail (account default from /etc/msmtprc)