Long-running cron job emails appearing in queue with large delay value

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Long-running cron job emails appearing in queue with large delay value

Will Payne

Hi,

When a long-running (24hr) cron job runs with log output sent to STDOUT,
it's emailed in the standard way but the resulting email appears in the
queue with a delay value of ~86000 seconds. Our monitoring system,
depending on timing, occasionally spots these and raises an alert about
a potential delivery issue.

Is there any way of tweaking postfix so that it starts the clock only
once the sendmail/postdrop process has received the entire mail from the
cron job?

Ta,
W
Reply | Threaded
Open this post in threaded view
|

Re: Long-running cron job emails appearing in queue with large delay value

Wietse Venema
Will Payne:

>
> Hi,
>
> When a long-running (24hr) cron job runs with log output sent to STDOUT,
> it's emailed in the standard way but the resulting email appears in the
> queue with a delay value of ~86000 seconds. Our monitoring system,
> depending on timing, occasionally spots these and raises an alert about
> a potential delivery issue.
>
> Is there any way of tweaking postfix so that it starts the clock only
> once the sendmail/postdrop process has received the entire mail from the
> cron job?

TEMPFILE=`mktemp`
command >$TEMPFILE
mail -s hello root <$TEMPFILE
rm -f $TEMPFILE

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Long-running cron job emails appearing in queue with large delay value

Will Payne
On 2018-07-02 12:05, Wietse Venema wrote:

>
> TEMPFILE=`mktemp`
> command >$TEMPFILE
> mail -s hello root <$TEMPFILE
> rm -f $TEMPFILE

Yes, I'm aware I can try and push users into sending the mails themself
instead of relying on the default cron output -> sendmail functionality.

My question is whether the postfix behaviour can be modified. I don't
want the delay time to include the time it takes to pipe an email into
sendmail..

W
Reply | Threaded
Open this post in threaded view
|

Re: Long-running cron job emails appearing in queue with large delay value

Wietse Venema
Will Payne:

> On 2018-07-02 12:05, Wietse Venema wrote:
>
> >
> > TEMPFILE=`mktemp`
> > command >$TEMPFILE
> > mail -s hello root <$TEMPFILE
> > rm -f $TEMPFILE
>
> Yes, I'm aware I can try and push users into sending the mails themself
> instead of relying on the default cron output -> sendmail functionality.
>
> My question is whether the postfix behaviour can be modified. I don't
> want the delay time to include the time it takes to pipe an email into
> sendmail..

Everyting is possible, it is software after all.

You want to add a config parameter so that the pickup daemon's
copy_segment() function will use the file mtime instead of the
REC_TYPE_TIME record in in the queue file.

        Wietse