On 07/25/2015 09:43 AM, Peter Humphrey wrote:
> On Saturday 25 July 2015 08:49:35 Daniel Frey wrote:
> 
>> I'm going to convert vixie-cron and anacron to cronie with the anacron USE
>> set as well, so I can set the MAILFROM var in crontab as when machines email
>> me I can't figure out which machine it came from.
> 
> That's odd. When vixie-cron is run as root on one of my boxes, the e-mail I 
> get says who it's from, thus:
> 
> --->8
> From: Cron Daemon <root@serv.prhnet>
> To: prh@serv.prhnet
> Subject: Cron <root@serv> /sbin/fstrim -av
> --->8
> 
> That's on the box named serv on my LAN, prhnet.
> 

I should've been more specific, I'm using ssmtp to forward to gmail and
gmail seems to change the FROM header as if I sent it from the gmail
account. I do this so I can get notifications to my phone without having
to deal with setting up local mail infrastructure and dealing with
routing around port blocking issues with my ISP.

However, you can set MAILFROM=b...@whatever.net and google shows this in
the headers, which is all I need to identify the box it came from. When
I view it with my phone or Thunderbird all it says is "(Cron Daemon)".
But the headers actually identify the box which is all I need. In the
GMail headers I see:

X-Google-Original-From: "(Cron Daemon)" <root@coreserver>

I don't know if I can change the displayed name with cronie. I haven't
tried that yet. I have changed the full name on all root accounts to
identify the box it came from, but alas, cron seems to ignore it. If I
send mail using `echo "Hah" | mail -s "Testing" myaddr...@gmail.com` it
works fine (picking up the full name set with chfn.)

Dan


Reply via email to