View previous topic :: View next topic |
Author |
Message |
nielchiano Veteran
Joined: 11 Nov 2003 Posts: 1287 Location: 50N 3E
|
Posted: Sun Mar 28, 2004 10:42 am Post subject: fcron mails: change from |
|
|
Hi,
I have (at the moment) 2 servers running fcron jobs and mailing them to me.
They all come into 1 mailbox. It's hard to find out which server mailed what.
is it possible to change the "from" header of the mails fcron sends to contain the machine name?
Greets,
Niels |
|
Back to top |
|
|
BobDylan Tux's lil' helper
Joined: 10 Dec 2003 Posts: 135 Location: On The Road
|
Posted: Tue Mar 30, 2004 12:39 pm Post subject: |
|
|
If you are using a MTA that has a wrapper for /usr/sbin/sendmail, you could modify your cron script to look like that:
Code: | #!bin/sh
MAILFROM="mycronalias"
SENDMAIL=/usr/sbin/sendmail
TMPFILE=/tmp/mytmpfile
/usr/bin/mycronexec > $TMPFILE
(echo "From: $MAILFROM"
echo "Subject: my cron subject"
echo ""
cat $TMPFILE) | $SENDMAIL root
rm -f $TMPFILE
exit 0 |
|
|
Back to top |
|
|
|