Mail box lock

Discussion in 'Server Operation' started by whoisit, Feb 5, 2008.

  1. whoisit

    whoisit New Member

    Hi guys,

    My linux CentOS 4.5 postfix is misbehaving, from time to time I keep on getting the below error and during that time any account copied in the mail or is forwarded mail by that account gets multiple repetition of the same mail until delivery is made to the mailbox having a problem.
    Error:

    (cannot update mailbox /var/mail/foo. for user foo. unable to lock for exclusive access: Resource temporarily unavailable)

    Help!!!
     
  2. falko

    falko Super Moderator

    It can happen that some other process (e.g. Postfix) is currently accessing the mailbox, and then you cannot fetch mails from it until this other process is finished.
     
  3. whoisit

    whoisit New Member

    This is happening during delivery of mail to mailbox

    Feb 6 16:01:20 mail postfix/local[26248]: D84D34511F8: to=<foo@mail.xxx.com>, orig_to=<zzz@xxx.com>, relay=local, delay=71, delays=25/6.3/0/39, dsn=4.2.0, status=deferred (cannot update mailbox /var/mail/foo for user foo. unable to lock for exclusive access: Resource temporarily unavailable)
     
  4. falko

    falko Super Moderator

    What's the output of
    Code:
    ls -la /var/mail
    ?
     
  5. whoisit

    whoisit New Member

    the output is:
    lrwxrwxrwx 1 root root 10 Oct 8 14:14 /var/mail -> spool/mail
     
  6. falko

    falko Super Moderator

    Ok, what's the output of
    Code:
    ls -la /var/spool/mail
    ?
     
  7. whoisit

    whoisit New Member

    output of ls -la /var/spool/mail

    drwxrwxr-x 2 root mail 4096 Feb 12 16:31 .
    drwxr-xr-x 18 root root 4096 Oct 8 15:35 ..
    -rw------- 1 as mail 1179 Jan 21 10:55 as
    -rw------- 1 ast mail 55877822 Feb 12 16:31 ast
    -rw-r--r-- 1 root root 223360024 Feb 8 13:15 backup
    -rw------- 1 da mail 9151 Feb 12 12:36 da
    -rw------- 1 foo mail 3443748 Feb 12 16:31 foo
    -rw------- 1 e mail 0 Feb 4 10:09 e
    -rw------- 1 eu mail 37306 Feb 12 09:58 eu
     
  8. topdog

    topdog HowtoForge Supporter

    That seems like a race condition to me, use lsof to see what application has opened the file and is not releasing it.
     
  9. whoisit

    whoisit New Member

    The mail box is being locked by a blackberry device which pops mail from it. Is there a way of configuring the black berry or the mailbox to avoid this conflict
     
  10. topdog

    topdog HowtoForge Supporter

    switch to using imap
     
  11. whoisit

    whoisit New Member

    The blackberry is on imap actually. I don't understands how it locks the mailbox such that postfix is unable to access it. Is there a way of making postix superior per se to the blackberry device over the mbox
     
  12. falko

    falko Super Moderator

    Not sure if this helps, but maybe you can switch to Maildir instead of using mbox?
     

Share This Page