procmail
[Top] [All Lists]

Re: concurrent sendmails when forwarding

1998-08-15 01:42:18
On 14 August 1998, Walter Haidinger <walter(_dot_)haidinger(_at_)gmx(_dot_)net> 
wrote:
[...]
It would be nice (BTW, the sendmail processes spawned are
already running nice +12) if procmail would forward the mails
sequentially. That is, just having one sendmail active, launching the
next for forwarding when the previous has finished.
[...]

    Instruct sendmail to queue messages when called from procmail:

        SENDMAILFLAGS="-oi -od d"

then disable the normal sendmail daemon from your system init scripts,
and run it in flush queue mode only, that is, replace

        /usr/sbin/sendmail -bd -q 15m

in your init scripts with

        /usr/sbin/sendmail -q 15m

("15m" is the flush interval, change it to whatever is appropriate for
your purposes).  Also make sure to disable forking in your sendmail.cf.

    The downside of this approach is that it will also delay the
delivery of local messages.

    Different approach: pipe messages to sendmail instead of using '!'
and use the wait flag.  Something along the lines of:

        :0 w
        * <conditions>
        | $SENDMAIL $SENDMAILFLAGS <recipients>

    Well, I'm actually not sure you can use the 'w' flag without 'f'
(the manual doesn't say it, and I'm not too familiar with procmail
internals), so if that doesn't work you might also try

        :0 fw
        * <conditions>
        | $SENDMAIL $SENDMAILFLAGS <recipients>

        # dummy recipe to stop procmail from delivering an empty message
        :0 a
        /dev/null

    Regards,

    Liviu

-- 
Dr. Liviu Daia                   e-mail:   daia(_at_)stoilow(_dot_)imar(_dot_)ro
Institute of Mathematics         web page: http://www.imar.ro/~daia
of the Romanian Academy          PGP key:  finger 
daia(_at_)stoilow(_dot_)imar(_dot_)ro