0

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?

  • We are not able to guess how a custom made application behaves, much less without any source code, logs or debugging in the question. I also suspect from the question there might be wrong expectation of this group, we are slanted through clarifying Linux know how, not debugging unknown applications behaviour. – Rui F Ribeiro Mar 1 at 17:46
  • (1) Please verify my edit and roll it back (or correct it) if it’s wrong.  (2) I don’t understand why the dead.letter files are empty.  If you believe that you do, please clarify your explanation. – G-Man Mar 1 at 19:12
  • Debian has the source for sSMTP M. Ribeiro, and manuals too. – JdeBP Mar 1 at 19:19
  • 2
    The questioner is asking about sSMTP. – JdeBP Mar 1 at 19:26
  • @RuiFRibeiro JdeBP is correct: I was asking about sSMTP, where the stdin input was coming from a cron job's stdout. But I do see that the way I structured the question was misleading. – Ann L. Mar 1 at 21:17
1

There's nothing that you can do if you stick with sSMTP. As you surmised, this is not configurable. The 5 minute timeout is hardwired into the code of the program. If your job takes more than 5 minutes, then you will simply need a different mail submission system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.