:: Re: [DNG] Problem with cron-job ema…
Top Page
Delete this message
Reply to this message
Author: Ken Dibble
Date:  
To: dng
Subject: Re: [DNG] Problem with cron-job emails

On 4/16/25 13:12, Walter Dnes wrote:
>    I have my main desktop "dev2", and a newer "hot backup" machine named
> "dev3".  A "singing, dancing" cron job runs daily at 03:30 local time.
> root's crontab is...

>
> 30 03 * * * /root/bin/bkup
>
>    The script "/root/bin/bkup"...
> * uses "wakeonlan" to fire up my "hot backup" machine
> * waits 30 seconds for it to boot up (NVME is nice!)
> * rsync my $HOME directory, and a VM image in another directory, to
>    the "hot backup" (exclude .ssh directory and some other stuff)
> * ssh root@dev3 /sbin/poweroff

>
>    The script works, but the cron job email output has problems.  My ISP
> is "EBOX" https://www.ebox.ca/en/ontario/residential/ My email to this list 
> ccomes from "mutt" MUA which is set to use a 3rd-party service
> (cotse.net).  Cron jobs come from <wherever?> and default to using ssmtp
> on my machine, which is configured to use EBOX mail server as follows...

>
> #
> # The person who gets all mail for userids < 10
> root=walterdnes
> # The place where the mail goes. The actual machine name is required
> # no MX records are consulted. Commonly mailhosts are named mail.domain.com
> # The example will fit if you are in domain.com and you mailhub is so named.
> mailhub=smtp.ebox.net
> # Where will the mail seem to come from?
> #rewriteDomain=waltdnes.org
> # The full hostname
> hostname=waltdnes.org
> FromLineOverride=YES
>
>    This seems like a "Rube Goldberg contraption" https://en.wikipedia.org/wiki/Rube_Goldberg_machine where... * the 
> cron job sends an email to my ISP's smtp server * which sends it to my 
> inbound personal domain email host cotse.net * which I poll manually 
> occasionally Is this *REALLY* necessary? Can I turn off cron job 
> emails alltogether? The failure seems to happen when the EBOX server 
> submits the cron job email to cotse.net. Which one of them is "out of spec"?  Here is the
> relavent part of the diagnostics...

>
> ===========================================================================
> This is the Email Security Gateway at host barracuda.ebox.ca.
>
> I'm sorry to inform you that the message below could not be delivered.
> When delivery was attempted, the following error was returned.
>
>
> <walterdnes@???>: host mail.cotse.net[173.166.91.11] said: 421 4.5.0
>      Bare carriage return (CR) not allowed (in reply to end of DATA command)
> ===========================================================================

>


> Can I turn off cron job emails alltogether?


It is my understanding that this can be accomplished in the following ways.

1) set |MAILTO="" at the beginning of your crontab|

|2) redirect output of cron command with >/dev/null 2>&1 as cron only
sends output if there is any|

|OR|

|if you are willing to spend time and have patience, some MTAs have
destination based filtering|

|so that a local piece of mail would not have to leave the lan
|

|
|

|Hope this helps.|

|Ken
|