2

I recently set up a new Pi 4 (running Buster) and installed msmtp and mailutils. I previously did this on two other Pi4s (also running Buster) on which this has worked perfectly. On the new machine it fails. I must have done something wrong, but I can't figure out what it is:

Fails:

pi@raspmountain:~ $ mail [email protected]
Cc:
Subject: sub
body
cannot send message: Process exited with a non-zero status

Works:

pi@raspsky:~ $ mail [email protected]
Cc:
Subject: sub
body
pi@raspsky:~ $

Here's the log entry for the one that works:

Mar 11 14:53:30 host=smtp.gmail.com tls=on auth=on user=me 
from=pi@raspsky [email protected] mailsize=132 
smtpstatus=250 smtpmsg='250 2.0.0 OK  1615449210 
c193sm1615010pfc.180 - gsmtp' exitcode=EX_OK

The one that fails does not result in any log entries.

On the new Pi I used the exact same configuration file as on the older Pi:

This is the one that works:

pi@raspsky:~ $ ls -la .msmtprc
-rw------- 1 pi pi 613 May 29  2020 .msmtprc

This is the one that doesn't:

pi@raspmountain:~ $ ls -la .msmtprc
-rwxr--r-- 1 pi pi 613 Feb 22 05:46 .msmtprc

Mail points to the same binary on both machines:

pi@raspmountain:~ $ ls -la /etc/alternatives/mail
lrwxrwxrwx 1 root root 23 Mar 11 13:34 /etc/alternatives/mail -> /usr/bin/mail.mailutils
pi@raspsky:~ $ ls -la /etc/alternatives/mail
lrwxrwxrwx 1 root root 23 Oct 21  2019 /etc/alternatives/mail -> /usr/bin/mail.mailutils

What have I done wrong here?

Buadhai
  • 237
  • 4
  • 11

1 Answers1

1

I had to change the permissions on .msmtprc to remove group and other:

pi@raspmountain:~ $ chmod 600  .msmtprc
pi@raspmountain:~ $ ls -la  .msmtprc
-rw------- 1 pi pi 612 Mar 11 15:45 .msmtprc
Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Buadhai
  • 237
  • 4
  • 11
  • I don't understand the change made to my answer. Can someone please explain. I clearly need to learn something here. – Buadhai Mar 14 '21 at 21:58