[EMAIL PROTECTED] said:
>  This is basically a global lock; I don't think this works as well as
> it should. I used to lock the context file. Every once in a while, the
> context file gets corrupted so I know something was wrong. Now, I lock
> the sequences file, and haven't noticed any corrupted sequences.

> :0: `mhpath +nmh`/.mh_sequences.lock
> * ^[EMAIL PROTECTED] 
> | rcvstore +nmh 

I used to use a line in an Exim filter:
 pipe "/usr/bin/nmh/rcvstore +inbox"

But that would bounce mail whenever the files got corrupted, which is quite 
often for the linux kernel mailing list, as there are often concurrent 
deliveries, and there's no locking.

Now I've produced a wrapper for it which returns EX_TEMPFAIL if there's a 
problem, which means that the MTA keeps the mail on its queue rather than 
bouncing it. Now I've stopped losing mail, but frequently I have to delete a 
corrupted .mh_sequences and flush the mail queue. There is no substitute for 
real locking on mail delivery. 

I think this functionality should be built in to rcvstore - an option
'-mtapipe' which prevents all output, and exits with return code EX_TEMPFAIL
upon temporary errors. That way, we can properly distinguish between temporary 
errors and permanent ones, rather than classing them all as temporary. 
It's on my TODO list right after implementing locking.

#!/bin/bash

exec >>$HOME/Mail/mystore-log 2>&1

if /usr/lib/nmh/rcvstore "$@" ; then
        exit 0
else
        exit 75 # EX_TEMPFAIL: Tells MTA to try again later, not bounce.
fi                   

----                                 ----                                 ----
David Woodhouse        [EMAIL PROTECTED]       Office: (+44) 1223 810302
 Project Leader,     Process Information Systems      Mobile: (+44) 976 658355
    Axiom (Cambridge) Ltd., Swaffham Bulbeck, Cambridge, CB5 0NA, UK.
             finger [EMAIL PROTECTED] for PGP key.

Reply via email to