Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fcron mails: change from
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
nielchiano
Veteran
Veteran


Joined: 11 Nov 2003
Posts: 1287
Location: 50N 3E

PostPosted: Sun Mar 28, 2004 10:42 am    Post subject: fcron mails: change from Reply with quote

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
View user's profile Send private message
BobDylan
Tux's lil' helper
Tux's lil' helper


Joined: 10 Dec 2003
Posts: 135
Location: On The Road

PostPosted: Tue Mar 30, 2004 12:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum