Re: Cron sending to root after changing MAILTO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> Date: Thursday, July 20, 2017 02:25:52 +0000
> From: Richard <lists-centos@xxxxxxxxxxxxxxxxxxxxx>
> 
>> Date: Wednesday, July 19, 2017 23:31:10 +0000
>> From: Chad Cordero <ccordero@xxxxxxxxx>
>> 
>> It’s being rejected before it even reaches the mailbox, so
>> forwarding won’t work.  Crond should really be using the MAILTO
>> variable and it’s not.
>> 
> 
> In my testing, this worked as advertised. Changing the "MAILTO=" in
> /etc/crontab from the default "root" to either a local username or a
> remote address resulted in the crontab messages being delivered to
> the desired mailboxes. I think I'd put a test command into the
> crontab and watch the logs to see what might be going on --
> including making certain that the crontab is reloading correctly
> after changing the "mailto" value.
> 
> Separately, but related, did you run newaliases or postalias after
> you added the entry to "root:" in /etc/aliases?
> 

Re-reading earlier messages, are the commands in question being
invoked out of /etc/crontab, /etc/cron.daily, etc. or  user-level
crontabs?

The "mailto" value is crontab file specific, so setting it in
/etc/crontab would only effect commands run from there (a file that
isn't used much any longer). As the /etc/cron.daily, etc. jobs are
now run from /etc/anacrontab you'd need to adjust the "mailto" in
that file for things run that way. If run from a user-level crontab
the "mailto" needs to be in that user's crontab file. [cron.hourly is
run out of /etc/cron.d/0hourly, not anacrontab, and has its own
"mailto".]


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]


  Powered by Linux