procmail
[Top] [All Lists]

Re: Run scr after all mail retrieved

1999-06-02 21:35:15
On 2 Jun 1999, Harry Putnam wrote:

"David W. Tamkin" <dattier(_at_)Mcs(_dot_)Net> writes:

So Harry, how is procmail (or formail -s procmail) invoked?  Can you go
up one level to the thing that calls procmail and have *it* run the script
after finishing with procmail?  Failing that, can you schedule the script
with cron?

I'm not sure of the full sequence of events but I call fetchmail to
retrieve mail.  If I put that call in a wrapper that waits for it to
finish and then calls the cleanup, would procmail still be running?
ie does fetchmail close down before procmail finishes its work?

In default operation fetchmail is not guaranteed to wait for all the mail
to be delivered; it connects to port 25 to get your sendmail daemon, feeds
it the mail, and exits once sendmail has accepted.

However, you can ask fetchmail to bypass sendmail by using the --mda
option; the fetchmail manual explicitly mentions formail as a possible
MDA.  In that case, fetchmail would not exit until the MDA finished,
and you could execute the cleanup script immediately after fetchmail.

<Prev in Thread] Current Thread [Next in Thread>