procmail
[Top] [All Lists]

Re: Returning temporary failures

1997-10-24 12:51:24
Replies again directed to list.

At 01:05 PM, 24 October 1997, "David W. Tamkin" <dattier(_at_)wwa(_dot_)com> 
wrote:
It seems to me that if there are many processes trying to deliver to one
user's spool file at once, that user probably doesn't have a .procmailrc
[otherwise he or she would most likely be sprinkling incoming mail among
assorted folders], so I tend to think that some code in /etc/procmailrc will
do the job just as well as modifying procmail.

While most of these users do not have a .procmailrc, there are also
many that just use it to send spam to /dev/null, but still have
everything else delivered to $DEFAULT. The number of users that do
this is likely to increase.

Lockfile(1) has no way to specify how long to keep trying before giving up;
you can specify how many times to try for the lock before giving up and how
long to wait between tries, and you can specify how long to keep trying
before stealing the lock.  So I'm wondering if this won't do the job in
/etc/procmailrc:

  DROPPRIVS=yes
  TIMES_TO_TRY=10 # or whatever number you select

  :0
  * $ $TIMES_TO_TRY^0
  * -1^0
  { NUMBER_OF_RETRIES = $= }

  :0
  * ! ? test -r $HOME/.procmailrc
  * ! ? lockfile -r $NUMBER_OF_RETRIES -ml
  {
   # Do whatever it takes to requeue a message on your system:
   EXITCODE=75
   HOST 
   # Since the lockfile was never created, it needn't be removed.
  }

Wouldn't it then lock up when it actually tries to deliver?

-- 
Aaron Schrab         aarons(_at_)execpc(_dot_)com     
http://www.execpc.com/~aarons/
ExecPC Internet Systems Administration     mail info(_at_)execpc(_dot_)com for 
info

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