We have two servers, one of which runs Ubuntu and the other Amazon Linux 2. Both run a series of cron jobs for different clients.
The Ubuntu server sends an email (to a group email address) with the output of every cron job. There is no output redirection: just a command to execute, for each entry:
0 2 * * * /apps/ourapp/sync_data -c variable1 -s all -i CLIENT1
... repeated with different times and different values for -i
.
The scheduled start time is always of the form
hh:00, hh:15 or hh:45.
It works satisfactorily: people get the email.
This isn't the case with the Amazon Linux machine. Its mail log has entries like this (slightly redacted):
Feb 28 07:05:04 ip-XXXX sSMTP[32212]: Connection lost in middle of processing
Feb 28 08:05:04 ip-XXXX sSMTP[32382]: killed: timeout on stdin while reading body -- message saved to dead.letter.
Feb 28 08:05:04 ip-XXXX sSMTP[32382]: Timeout on stdin while reading body
Feb 28 21:50:04 ip-XXXX sSMTP[2261]: killed: timeout on stdin while reading body -- message saved to dead.letter.
Feb 28 21:50:04 ip-XXXX sSMTP[2261]: Timeout on stdin while reading body
Feb 28 22:05:04 ip-XXXX sSMTP[2505]: killed: timeout on stdin while reading body -- message saved to dead.letter.
Feb 28 22:05:04 ip-XXXX sSMTP[2505]: Timeout on stdin while reading body
Feb 28 22:20:05 ip-XXXX sSMTP[2845]: killed: timeout on stdin while reading body -- message saved to dead.letter.
Feb 28 22:20:05 ip-XXXX sSMTP[2845]: Timeout on stdin while reading body
You'll note that the timestamp minute components are 5 min past either the hour, the 15 minute, or the 45 minute mark. These correspond to cron jobs that aren't sending email.
dead.letter
is always empty, which makes sense if the log doesn't get sent until the job ends (as I infer happens.)
What I've read about sSMTP
suggests that you can't override the stdin
timeout with config options (though that information may be out of date).
So what can I do? Is this because we're using sSMTP
rather than some other mail mechanism?
dead.letter
files are empty. If you believe that you do, please clarify your explanation.