I am running CentOS 7 on an outbound gateway server running Postfix.? I have a couple of cron jobs I was expecting to see in my email that never showed up.? It turns out that they were delivered to root, which is restricted on our exchange server, instead of the address I defined.? Please help. # cat /etc/crontab SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=ecssupport at csusb.edu # For details see man 4 crontabs # Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * user-name command to be executed # cat /etc/sysconfig/crond # Settings for the CRON daemon. # CRONDARGS= : any extra command-line startup arguments for crond CRONDARGS --- Chad Cordero Information Technology Consultant Enterprise & Cloud Services Information Technology Services California State University, San Bernardino 5500 University Pkwy San Bernardino, CA 92407-2393 Main Line: 909/537-7677 Direct Line: 909/537-7281 Fax: 909/537-7141 http://support.csusb.edu/ --- Disclaimer: This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer.
Alexander Dalloz
2017-Jul-19 21:24 UTC
[CentOS] Cron sending to root after changing MAILTO
Am 19.07.2017 um 22:46 schrieb Chad Cordero:> I am running CentOS 7 on an outbound gateway server running Postfix. I have a couple of cron jobs I was expecting to see in my email that never showed up. It turns out that they were delivered to root, which is restricted on our exchange server, instead of the address I defined. Please help.[ ... ] Best is to define a mail alias for the root user. That way you have it defined at a single place for all occurances of mail destined to root. To do so edit /etc/aliases at the very bottom where you find a pre-defined but commented setting: # Person who should get root's mail #root: marc Change it to root: ecssupport at csusb.edu and run `newaliases' after that change. It is always a good idea to verify that the database file, which is the one really used, has been changed and carries a new time flag. Alexander> Chad Cordero > Information Technology Consultant > > Enterprise & Cloud Services > > Information Technology Services > > California State University, San Bernardino > 5500 University Pkwy > San Bernardino, CA 92407-2393 > Main Line: 909/537-7677 > > Direct Line: 909/537-7281 > > Fax: 909/537-7141 > > http://support.csusb.edu/
I have ?root: ecssupport at csusb.edu? in my /etc/aliases file already. --- Chad Cordero Information Technology Consultant Enterprise & Cloud Services Information Technology Services California State University, San Bernardino 5500 University Pkwy San Bernardino, CA 92407-2393 Main Line: 909/537-7677 Direct Line: 909/537-7281 Fax: 909/537-7141 http://support.csusb.edu/ --- Disclaimer: This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. From: CentOS <centos-bounces at centos.org> on behalf of Alexander Dalloz <ad+lists at uni-x.org> Reply-To: CentOS mailing list <centos at centos.org> Date: Wednesday, July 19, 2017 at 2:25 PM To: "centos at centos.org" <centos at centos.org> Subject: Re: [CentOS] Cron sending to root after changing MAILTO Am 19.07.2017 um 22:46 schrieb Chad Cordero: I am running CentOS 7 on an outbound gateway server running Postfix. I have a couple of cron jobs I was expecting to see in my email that never showed up. It turns out that they were delivered to root, which is restricted on our exchange server, instead of the address I defined. Please help. [ ... ] Best is to define a mail alias for the root user. That way you have it defined at a single place for all occurances of mail destined to root. To do so edit /etc/aliases at the very bottom where you find a pre-defined but commented setting: # Person who should get root's mail #root: marc Change it to root:?????????????????????? ecssupport at csusb.edu and run `newaliases' after that change. It is always a good idea to verify that the database file, which is the one really used, has been changed and carries a new time flag. Alexander Chad Cordero Information Technology Consultant Enterprise & Cloud Services Information Technology Services California State University, San Bernardino 5500 University Pkwy San Bernardino, CA 92407-2393 Main Line: 909/537-7677 Direct Line: 909/537-7281 Fax: 909/537-7141 http://support.csusb.edu/ _______________________________________________ CentOS mailing list CentOS at centos.org https://lists.centos.org/mailman/listinfo/centos
hns1 at iinet.net.au
2017-Jul-19 23:13 UTC
[CentOS] Cron sending to root after changing MAILTO
? ----- Original Message ----- From: "CentOS mailing list" To:"CentOS mailing list" Cc: Sent:Wed, 19 Jul 2017 20:46:21 +0000 Subject:[CentOS] Cron sending to root after changing MAILTO I am running CentOS 7 on an outbound gateway server running Postfix.? I have a couple of cron jobs I was expecting to see in my email that never showed up.? It turns out that they were delivered to root, which is restricted on our exchange server, instead of the address I defined.? Please help. The quick fix for such issues is to put a .forward file in the /root folder containing your target e-mail address,?ecssupport at csusb.edu
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. --- Chad Cordero Information Technology Consultant Enterprise & Cloud Services Information Technology Services California State University, San Bernardino 5500 University Pkwy San Bernardino, CA 92407-2393 Main Line: 909/537-7677 Direct Line: 909/537-7281 Fax: 909/537-7141 http://support.csusb.edu/ --- Disclaimer: This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. From: CentOS <centos-bounces at centos.org> on behalf of "hns1 at iinet.net.au" <hns1 at iinet.net.au> Reply-To: CentOS mailing list <centos at centos.org> Date: Wednesday, July 19, 2017 at 4:13 PM To: CentOS mailing list <centos at centos.org> Subject: Re: [CentOS] Cron sending to root after changing MAILTO ----- Original Message ----- From: "CentOS mailing list" To:"CentOS mailing list" Cc: Sent:Wed, 19 Jul 2017 20:46:21 +0000 Subject:[CentOS] Cron sending to root after changing MAILTO I am running CentOS 7 on an outbound gateway server running Postfix. I have a couple of cron jobs I was expecting to see in my email that never showed up. It turns out that they were delivered to root, which is restricted on our exchange server, instead of the address I defined. Please help. The quick fix for such issues is to put a .forward file in the /root folder containing your target e-mail address, ecssupport at csusb.edu _______________________________________________ CentOS mailing list CentOS at centos.org https://lists.centos.org/mailman/listinfo/centos
> Best is to define a mail alias for the root user. That way you have it > defined at a single place for all occurances of mail destined to root.postfix only uses the aliases map for local delivery. If the recipient email address is fully qualified, local delivery is not even in the picture (and I literally mean "the big picture", http://www.porcupine.org/postfix/doc/big-picture.html). The only way to get local delivery involved here is to add root to masquerade_exceptions. postfix is not the problem here as the log shows ... to=<root at csusb.edu>, orig_to=<root> ...