Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8026

Troubleshooting • Logwatch Sends daily mail from one Pi, but not from another Pi

$
0
0
I've had Logwatch running on a Pi4 running Buster for several years now.

I wanted to run it on a different Pi4, also running buster.

The logwatch.conf files are identical:

Code:

Output = mailMailTo = [me]@mac.comMailFrom = LogwatchDetail = MedService = -zz-sysService = -auditmailer = "/usr/sbin/sendmail -t"
The 00logwatch files in cron.daily are identical:

Code:

#!/bin/bash#Check if removed-but-not-purgedtest -x /usr/share/logwatch/scripts/logwatch.pl || exit 0#execute/usr/sbin/logwatch --output mail#Note: It's possible to force the recipient in above command#Just pass --mailto address@a.com instead of --output mail
If I run logwatch from the command line it works fine and sends me the logwatch output.

But, running from cron.daily I find this error message:

Code:

journalctl | grep -E "msmtp|sendmail"Oct 18 06:25:10 raspmountain cron[394]: sendmail: TLS handshake failed: An unexpected TLS packet was received.Oct 18 06:25:10 raspmountain cron[394]: sendmail: could not send mail (account default from /etc/msmtprc)
On both machines:

Code:

pi@raspsky:/etc/logwatch/conf $ ls -la /usr/sbin/sendmaillrwxrwxrwx 1 root root 12 Feb 15  2019 /usr/sbin/sendmail -> ../bin/msmtppi@raspmountain:/etc/logwatch/conf $ ls -la /usr/sbin/sendmaillrwxrwxrwx 1 root root 12 Feb 15  2019 /usr/sbin/sendmail -> ../bin/msmtp
On the working machine I see this in the .msmtp.log:

Code:

Oct 18 06:25:10 host=smtp.gmail.com tls=on auth=on user=[me] from=[me]@gmail.com recipients=[me]@mac.com  mailsize=2938 smtpstatus=250 smtpmsg='250 2.0.0 OK    1760743510 d9443c01a7336-292471d598asm6745195ad.63 - gsmtp'   exitcode=EX_OK


That's logwatch successfully sending email.

But, on the failing machine there is no entry at all for 06:25 when logwatch runs. The only indication that email was attempted is from journalctl | grep -E "msmtp|sendmail", shown above.

The only obvious difference between the two machines is in the /etc directory:

Machine that works:

Code:

-rw-r-----   1 root msmtp    851 Sep  4  2021 msmtprc
Machine that fails:

Code:

-rw-r--r--   1 root root     616 Dec 28  2021 msmtprc
So, what am I doing wrong here? I suspect it's something obvious and simple.

Statistics: Posted by Ratsima — Sat Oct 18, 2025 12:51 am



Viewing all articles
Browse latest Browse all 8026

Trending Articles