procmail
[Top] [All Lists]

Re: Procmail locking and timeouts

1998-09-02 13:03:50
Jason Carroll asked,

| So my question is is there a way to tell procmail to try to get a lock,
| and if it fails to just requeue the mail and exit?

The only way to do that would be with a global lockfile -- at least per
user, but not per destination folder.  Something like this:

 :0 # try only once to get the lock; requeue and bail if we can't
 * ! ? lockfile -r0 $ORGMAIL$LOCKEXT
 { EXITCODE=75
   HOST }

 # If we have the lock, procmail does not know it as $LOCKFILE and will
 # not automatically remove it on exit, so trick procmail into removing it:

 TRAP="rm -f $ORGMAIL$LOCKEXT ${TRAP:+ ; $TRAP}"

| As a side note my first though was to enable verbose logging, can I do
| this in the /etc/procmailrc by defing a LOGFILE and turning on Verbose?

Yes.

| Will users .procmailrcs still be read in also overriding any values I set
| in there for variables?

Yes, provided that they know what /etc/procmailrc did so that they can change
the settings for themselves; alternatively, the recipe in /etc/procmailrc can
turn VERBOSE on and set a LOGFILE only for mail to your LOGNAME, and then you
can test it without affecting other users' mail.

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