At 08:47 13/03/03 -0500, Alan Brown wrote:


On Thu, 13 Mar 2003, Eric Luyten wrote:

> > Just looking at the possibility of using "server mode" for qpopper to solve
> > the above mentioned problem, but would I be right in thinking that its then
> > unsafe to have uw-imap providing imap access to the same mail spools ?
>
> Yes !
>
> We (25,000 users, 65 GB of mailboxes, mixed POP3 and IMAP4 spool access
> with a few shell users thrown in for good measure) are bitten by this a
> couple of times per week.


The issue isn't that the programs don't play nice together, bt that they
don't use the same locking methods.

Well I don't think thats true from the investigating I've done. As long as you don't use server mode in qpopper you should be ok. They *do* use compatible locking methods, because uw-imap uses the same locking scheme as procmail. ( .lock file, and kernel locking on top of that)


At the very least, qpopper, procmail, and uw-imap all honour the .lock file locking method. In non-server mode, while a pop3 session is open the mail spool is moved to the temp drop file and worked on from there. procmail and uw-imap are unable to upset this temp drop file and cause qpopper to lose consistancy.

Meanwhile messages can come and go in the real spool (procmail and uw-imap) without incident. Of course uw-imap temporarily won't see messages that are in the temp drop file until the spool is copied back. During the copying back process qpopper locks the spool and cats the temp drop spool and the actual spool back together so that newly arrived messages aren't lost, then unlocks the spool again.

The problem with server mode, is that it makes the *assumption* that nothing will touch the spool file during a pop3 session *except* new messages being appended to the end of the spool. (Eg procmail delivering another message) Deleting any message in the spool breaks this assumption, and all hell breaks loose.

Furthermore, qpopper does not lock the mail spool during the pop3 session, so any other program such as uw-imap (and not just uw-imap) can't possibly know to leave the spool alone. So basically qpoppers server mode is a *deliberate* breaking of locking rules to get a performance boost, in a way that you get away with when the only other program that accesses the rule simply appends new messages to the end.

They can be tweaked to behave, but it's probably more effort than it's
worth.

Investigate installing courier-imap(+ssl+pop3) as a unified answer... :-)
(And for those wanting maildir format, it supports that too)

I checked out courier-imap a while ago and as far as I could see, it didn't support unix mail spool format mailboxes... (eg all messages in one file)


Regards,
Simon



Reply via email to