procmail
[Top] [All Lists]

Re: lockfile and qmail

1999-09-14 23:15:45
Karthik <n6026002(_at_)cc(_dot_)iitb(_dot_)ernet(_dot_)in> writes:
On Sat, 11 Sep 1999, Philip Guenther wrote:

Karthik <n6026002(_at_)cc(_dot_)iitb(_dot_)ernet(_dot_)in> writes:
If I use lockfile to lock my system mailbox (which is $HOME/Mailbox) then
will qmail take note of it and queue up deliveries? 

Have you checked the qmail docs?

Yes i have.  It says that qmail uses flock() to lock files when writing to
them.  I don't really know what that means which is why I posted.

It means it uses the flock() system call.  If procmail was compiled to use
flock() on your system then you don't need to do the "chmod +t" trick,
as the flock() will be sufficient to avoid conflict between procmail
and qmail.  You can see what locking methods procmail uses by entering
the command:
        procmail -v


...
That is what I am doing right now but with my fingers crossed.  The
problem is that I use qmail, procmail and mutt (which is my usual mail
agent) and I don't know how each one of them handles locking. 

You'll need to find out how mutt does locking.  If it uses flock(), then
you're home free and don't need to do dotlocking or the "chmod +t" trick.
If it doesn't use flock(), or you need to be able to manipulate the
mailbox from shellscripts also, then you'll need to use a combination
of dotlocking and the "chmod +t" trick to avoid conflicts
    a) between mutt and procmail (by having them both do dotlocking); and
    b) between mutt and qmail (by using the "chmod +t" trick).
That could get *really* ugly though, as you would have to check the
order of the locks carefully to avoid deadlocking.


Philip Guenther

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