Re: Mailbox locking issue?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Mailbox locking issue?

Timo Sirainen
On Fri, 2008-04-11 at 22:52 -0700, Mark Sapiro wrote:
> Apr  8 19:07:20 sbh16 dovecot: pop3-login: Login: user=<xxx>,
> method=PLAIN, rip=72.52.113.36, lip=72.52.113.36, secured

Dovecot read-locks the mbox file here.

> Apr  8 19:07:22 sbh16 postfix/local[13745]: D959169046B:
> to=[hidden email]>, orig_to=<[hidden email]>, relay=local,
> delay=16, delays=15/0/0/1.1, dsn=2.0.0, status=sent (delivered to
> mailbox)
> Apr  8 19:07:22 sbh16 dovecot: POP3(xxx): Disconnected: Logged out
> top=2/15995, retr=0/0, del=2/2, size=15985

These both happen within the same second, so most likely Postfix
correctly waits that Doveocot has finished modifying the mbox file and
only then delivers its changes.

> Five minutes later when fetchmail comes back, we see
>
> Apr  8 19:12:42 sbh16 dovecot: POP3(xxx): mbox sync: Expunged message
> reappeared in mailbox /var/spool/mail/xxx (UID 4683 < 4684, seq=2,
> idx_msgs=0)

seq=2 would indicate that there are now two mails, but there should have
been only one now.. I tried this a couple of times myself, but it worked
in my tests. I'm using v1.0.13 though, so there's also a chance this has
been fixed already.

> From now on, as messages are added to the mailbox by Postfix, fetchmail
> keeps retrieving both old and new messages. i.e. even though dovecot's
> log says del 1/1 (or del n/n) no messages are actually deleted from
> the mailbox.
>
> This situation continues until someone accesses the mailbox locally
> (e.g. via mutt through a local shell) and deletes the old messages.

When this happens, could you put the mbox file through
http://dovecot.org/tools/mbox-anonymize.pl and send the result to me,
along with dovecot.index and dovecot.index.log files.

> Also it seems that dovecot should recover from the 'corrupt' mailbox
> and fix it rather than just continuing to encounter the same problem.

Yes, it shold.

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mailbox locking issue?

Mark Sapiro-3
Timo Sirainen wrote:

> On Fri, 2008-04-11 at 22:52 -0700, Mark Sapiro wrote:
>
>> From now on, as messages are added to the mailbox by Postfix, fetchmail
>> keeps retrieving both old and new messages. i.e. even though dovecot's
>> log says del 1/1 (or del n/n) no messages are actually deleted from
>> the mailbox.
>>
>> This situation continues until someone accesses the mailbox locally
>> (e.g. via mutt through a local shell) and deletes the old messages.
>
> When this happens, could you put the mbox file through
> http://dovecot.org/tools/mbox-anonymize.pl and send the result to me,
> along with dovecot.index and dovecot.index.log files.


Yes, I will do that.

Here's one additional piece of information which may or may not be
relevant. There are actually three users (and three separate mailboxes)
whose mail is being retrieved via POP3/fetchmail, but all three users
have the same UID so there is only one set of .imap/INBOX/dovecot.*
files for all three mailboxes.

This may have been at least part of the problem in the case where the
error appeared to be precipitated by simultaneous access from two
different remote machines.

--
Mark Sapiro <[hidden email]>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

Reply | Threaded
Open this post in threaded view
|

Re: Mailbox locking issue?

Timo Sirainen
On Sun, 2008-05-04 at 10:45 -0700, Mark Sapiro wrote:

> Here's one additional piece of information which may or may not be
> relevant. There are actually three users (and three separate mailboxes)
> whose mail is being retrieved via POP3/fetchmail, but all three users
> have the same UID so there is only one set of .imap/INBOX/dovecot.*
> files for all three mailboxes.

So you mean all 3 mailboxes share the same index files? That's a sure
way to cause all kinds of problems.


signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mailbox locking issue?

Mark Sapiro-3
Timo Sirainen wrote:

> On Sun, 2008-05-04 at 10:45 -0700, Mark Sapiro wrote:
>
>> Here's one additional piece of information which may or may not be
>> relevant. There are actually three users (and three separate mailboxes)
>> whose mail is being retrieved via POP3/fetchmail, but all three users
>> have the same UID so there is only one set of .imap/INBOX/dovecot.*
>> files for all three mailboxes.
>
> So you mean all 3 mailboxes share the same index files? That's a sure
> way to cause all kinds of problems.


Yes, that's what I mean. I didn't realize this was the case until just
now when I looked at exactly which log files I would send if I saw a
recurrence. I think they have the same index files because they all have
the same home directory which is an artifact from an old set up. This
could easily be changed.

--
Mark Sapiro <[hidden email]>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan