Bug 188270

Summary: logdigest doesn't send mails
Product: [openSUSE] SUSE Linux 10.1 Reporter: Martin Schröder <martin>
Component: OtherAssignee: Peter Poeml <poeml>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: werner
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: SuSE Linux 10.1   
Whiteboard:
Found By: Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Martin Schröder 2006-06-26 14:59:54 UTC
After installing the logdigest package, I expected to get a daily mail.

It didn't arrive.

In a default install, logdigest doesn't send mails, because cron.daily only sends mails if something goes wrong (SEND_MAIL_ON_NO_ERROR). But with logdigest one wants a mail even if nothing did go wrong. 

So installing logdigest should set SEND_MAIL_ON_NO_ERROR to on.
Comment 1 Martin Schröder 2006-06-26 17:52:41 UTC
Sorry, I can't reproduce it.
Comment 2 Martin Schröder 2006-07-11 15:22:58 UTC
I'm reopening this, as logdigest doesn't send mails every day (as it should). I've received one mail, but that was days ago. OTOH, if I do a 

sudo rm /var/spool/cron/lastrun/cron.daily

the next run of cron.daily will cause a mail by logdigest. %-{
Comment 3 Martin Schröder 2006-07-14 15:04:38 UTC
logdigest generates mails, but fails to send them: they end up in /root/dead.letter :-(

Any idea how to debug this? /var/log/messages shows nothing
Comment 4 Peter Poeml 2006-07-19 14:42:38 UTC
> After installing the logdigest package, I expected to get a daily mail.
> 
> It didn't arrive.

It should -- but it depends on a working mail setup, of course.

> In a default install, logdigest doesn't send mails, because cron.daily
> only
> sends mails if something goes wrong (SEND_MAIL_ON_NO_ERROR). But with
> logdigest
> one wants a mail even if nothing did go wrong.

No, it doesn't depend on SEND_MAIL_ON_NO_ERROR. SEND_MAIL_ON_NO_ERROR is
totally unrelated, it is used for error output produced by cron scripts,
while logdigest sends mail itself.

> sudo rm /var/spool/cron/lastrun/cron.daily
> 
> the next run of cron.daily will cause a mail by logdigest. %-{

That's interesting.

> logdigest generates mails, but fails to send them: they end up in
> /root/dead.letter :-(

That's also interesting...

> Any idea how to debug this? /var/log/messages shows nothing

Simply execute /etc/cron.daily/logdigest as root... does it send mail?

Comment 5 Martin Schröder 2006-07-22 18:04:00 UTC
Further testing.

This works (i.e. mail is sent):
- sudo /etc/cron.daily/logdigest
- sudo rm /var/spool/cron/lastrun/cron.daily
- setting the system date a day back, touch /var/spool/cron/lastrun/cron.daily, setting the system date to the correct date

This doesn't work (i.e. generates no mail, but leaves a /root/dead.letter):
- normal call of cron.daily a day later

Again /var/log/messages shows nothing unusual:
...
Jul 22 19:45:01 dream run-crons[4720]: mcelog: OK
Jul 22 19:45:09 dream run-crons[4720]: logdigest: OK
Jul 22 19:45:11 dream run-crons[4720]: logrotate: OK
Jul 22 19:45:11 dream run-crons[4720]: suse-clean_catman: OK
Jul 22 19:45:24 dream run-crons[4720]: suse-do_mandb: OK
...
Comment 6 Martin Schröder 2006-07-24 09:35:46 UTC
The cause is mailx. I've now added a set -avx to the script and removed the output redirection from /etc/crontab. And voila:

test -s $TMPDIR/mail.$$ -a $FOUND = 1 && $MAIL -s "logdigest $DATE $HOSTNAME" $SYSADMIN < $TMPDIR/mail.$$
+ test -s /var/lib/logdigest/mail.5032 -a 1 = 1
+ mail -s 'logdigest 2006-07-24 11:30 dream.oneiros.kn-bremen.de' root
Invalid or incomplete multibyte or wide character
. . . message not sent.
"/root/dead.letter" 356/24246
Comment 7 Martin Schröder 2006-07-24 10:34:05 UTC
I've upgraded to mailx 12.1 and the last run of logdigest (I've moved it to hourly) worked perfectly, despite an "äöüß" in /var/log/messages.
   Content-Type: text/plain; charset=utf-8
Comment 8 Dr. Werner Fink 2006-07-25 09:56:14 UTC
In other words I can close this bug as fixed?
Comment 9 Martin Schröder 2006-07-28 09:37:25 UTC
Yes, the new mailx fixes it.
Thanks.
Comment 10 Peter Poeml 2006-07-31 11:47:08 UTC
Thanks a lot for analysing, testing and fixing.