Sendmail question
Wolfgang S. Rupprecht
wolfgang.rupprecht at gmail.com
Mon Aug 9 20:26:41 UTC 2010
Terry Polzin <foxec208 at wowway.com> writes:
> Is there a way to configure sendmail NOT to send messages with empty
> bodies?
Sendmail is an MTA. It isn't a good idea for the MTA to second guess
intentions. Yes, some other OS's might do things that way, but that
isn't the un*x way. If you have a program that sometimes generates
output that should be mailed off you can easily have it capture the
output in a file and only mail that file if the file is no-zero.
programname > /tmp/log$$ 2>&1
if [ -n /tmp/log$$ ]
then
/bin/mail -s "programname run at $(date)" username
fi
/bin/rm /tmp/log$$
--
Wolfgang S. Rupprecht http://www.wsrcc.com/wolfgang/ (IPv6-only)
More information about the users
mailing list