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:
The 00logwatch files in cron.daily are identical:
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:
On both machines:
On the working machine I see this in the .msmtp.log:
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:
Machine that fails:
So, what am I doing wrong here? I suspect it's something obvious and simple.
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"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 mailBut, 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)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/msmtpCode:
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_OKThat'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 msmtprcCode:
-rw-r--r-- 1 root root 616 Dec 28 2021 msmtprcStatistics: Posted by Ratsima — Sat Oct 18, 2025 12:51 am