| Summary: | app-forensics/rkhunter: cronjob sends email even if empty | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Zak Kipling <zak.kipling> |
| Component: | Current packages | Assignee: | Forensics Herd [disbanded] <forensics+obsolete> |
| Status: | RESOLVED TEST-REQUEST | ||
| Severity: | trivial | CC: | ka0ttic, radek |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: | Patch: don't mail output if empty | ||
|
Description
Zak Kipling
2006-10-07 09:05:37 UTC
Created attachment 99053 [details, diff]
Patch: don't mail output if empty
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... 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. 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? rkhunter-1.3.4-r1 should have a patch that fixes this issue. Please test and reopen if it doesn't :) |