Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 150391 - app-forensics/rkhunter: cronjob sends email even if empty
Summary: app-forensics/rkhunter: cronjob sends email even if empty
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Forensics Herd [disbanded]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-07 09:05 UTC by Zak Kipling
Modified: 2009-01-17 20:58 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch: don't mail output if empty (rkhunter.cron.patch,364 bytes, patch)
2006-10-07 09:09 UTC, Zak Kipling
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zak Kipling 2006-10-07 09:05:37 UTC
Even if you're using --quiet and there is no output from rkhunter, the cronjob will send a blank email if SEND_EMAIL is on.

Patch to follow
Comment 1 Zak Kipling 2006-10-07 09:09:49 UTC
Created attachment 99053 [details, diff]
Patch: don't mail output if empty
Comment 2 Radek Podgorny 2006-10-07 14:26:39 UTC
Well, shouldn't cron filter out empty mail by default by itself? As I remember, last time I tried rkhunter, it was returning 1 (insted of 0) which force cron to send a mail (error happened, user should be notified) but with programs returning null output and return value of 0, it didn't send anything...
Comment 3 Zak Kipling 2006-10-07 15:33:44 UTC
That's correct -- cron itself won't send any mail for a job that produces no output.

However, the /etc/cron.daily/rkhunter script doesn't write to stdout/stderr and let cron send the email but rather captures the output from rkhunter and mails it explicitly by invoking the "mail" command -- hence it (rather than cron) has the responsibility for deciding whether or not the mail should be sent.
Comment 4 Radek Podgorny 2006-10-08 05:15:27 UTC
Ah, that makes sense. But isn't a a bad solution to depend on "mail" utility to send mails from a cronjob? IMHO this should be handled by cron so if you want to supress email sending, just run rkhunter with ">/dev/null". Wouldn't that be much cleaner?
Comment 5 Patrick Lauer gentoo-dev 2009-01-17 20:58:03 UTC
rkhunter-1.3.4-r1 should have a patch that fixes this issue. Please test and reopen if it doesn't :)