The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Email lock

Discussion in 'E-mail Discussions' started by adapter, Dec 15, 2003.

  1. adapter

    adapter Well-Known Member
    PartnerNOC

    Joined:
    Sep 17, 2003
    Messages:
    391
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    we have a site that sometime the email get lock and we need to delete the inbox file on the server and delete it from Cpanel and make the email again, what's can be the problem?

    thx
     
  2. ehpmahesh

    ehpmahesh Well-Known Member

    Joined:
    Jul 3, 2004
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Well i am also having the same problem each time i have to remove the inbox.lock file. I am getting follwing error in the mail queue for inbox lock problem. Please tell why this happen and how to over come this.

    Message 1CfX9r-0004zG-3G is not frozen
    delivering 1CfX9r-0004zG-3G
    LOG: MAIN
    == pradeep@acalmar.com R=virtual_user T=virtual_userdelivery defer (-9): failed to lock mailbox /home/acalmar/mail/acalmar.com/pradeep/inbox (lock file)
     
  3. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    find the inbox.lock file

    cat the inbox.lock file. It should contain a number.

    Run

    ps uxawww|grep number_from_file_here

    then post it.
     
  4. ehpmahesh

    ehpmahesh Well-Known Member

    Joined:
    Jul 3, 2004
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    This is a output
    choice 3002 0.0 0.3 9956 3504 ? S 11:38 0:00 cppop - serving 203.196.161.116 - TRANSACTION - jagan@choice-solutions.com
    root 21086 0.0 0.0 4504 668 pts/1 S 12:13 0:00 grep 3002

    It will give process ID for the pop connection. With grep command we can find out that wheather that process is running or not. Let me know why this is happening and how to overcome with this
     
  5. rfrench10

    rfrench10 Well-Known Member

    Joined:
    Feb 19, 2004
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    New York
    http://nnn.nnn.nnn.nnn:2086/scripts2/mailperm
    Will fix the mailbox permissions, including the inbox lock you describe. I run it hourly and usually it will find one or more mail boxes on the server with a permission or lock problem. I wish it was not necessary to run such a utility but it works. In WHM / EMAIL / [Rebuild/Fix Mail Dbs/Boxes] you will find the option to manually run this utility. Use it with a cron to run hourly and forget about it.
     
  6. damainman

    damainman Well-Known Member

    Joined:
    Nov 13, 2003
    Messages:
    515
    Likes Received:
    0
    Trophy Points:
    16
    I might be wrong but i could've sworn in a recent post they said if you run mailperm while a user is logged into their account it might cause problems.

    I was going to set it up to run on cron too, but don't want to come across no issues.. can someone from cpanel verify this to be safe?
     
  7. pizzaman

    pizzaman Well-Known Member
    PartnerNOC

    Joined:
    Oct 1, 2003
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    I'm not sure if mailperm script will really fix the lock problem, since I browsed through the source code and couldn't find it at any place.

    However, I went to the source (exim.org) and found this FAQ:
    http://library.n0i.net/linux-unix/applications/daemons/exim/spec/spec_15.html

    Go down to read the topics at:
    - lock_fcntl_timeout (appendfile)
    - lock_interval (appendfile)
    - lock_retries (appendfile)

    So I've adjusted my /etc/exim.conf to see if it helps.
    lock_fcntl_timeout = 3s
    lock_retries = 10
    lock_interval = 3s

    This problem, failed to lock mailbox /some/file, only happens in my higher load server
    (means lower end hardware, etc...).
     
  8. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Nope. Exim has nothing at all to do with it, that's your SMTP server. The server invloved here is cppop the cPanel POP server (which is not open source). There has been a fix recently that addressed some pop file locking issues:

    9.9.9 (build 146) - EDGE Tree Sun Jan 16 19:01:43 2005

    cppop: When SIGPIPE is recieved (client disconnect) auto remove all the
    [mbox].lock (inbox.lock) file.
     
  9. pizzaman

    pizzaman Well-Known Member
    PartnerNOC

    Joined:
    Oct 1, 2003
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    From ehpmahesh's post (2nd post), I think that's from exim log file.

    Anyway, both exim local delivery agent, and cppop would access the same inbox file. I'm not sure if cppop is competing for same locking mechanism with exaim, and if it is so then that's the problem.
     
  10. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Just to clarify, there are 2 types of locking going on here, one is to do with write locking for appending data, the other is POP3 locking which is to do with the POP3 protocol and access to the emails within the inbox file. While they're operating on the file, they're working on different levels.
     
    #10 chirpy, Jan 24, 2005
    Last edited: Jan 24, 2005
  11. pizzaman

    pizzaman Well-Known Member
    PartnerNOC

    Joined:
    Oct 1, 2003
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Thanks Chirpy, but how do you explain this?

    #1
    /var/log/maillog
    Jan 24 15:44:21 host2 cpanelpop[3488]: Login host=xx.xx.xx.xx ip=xx.xx.xx.xx user=ticket.res@domain.com realuser=ticket.res@domain.com
    Jan 24 15:49:17 host2 cpanelpop[3488]: Session Closed host=xx.xx.xx.xx ip=xx.xx.xx.xx user=ticket.res@domain.com realuser=ticket.res@domain.com totalxfer=194937

    /var/log/exim_mainlog
    2005-01-24 15:46:42 1CszrN-00010p-1o == ticket.res@domain.com R=virtual_user T=virtual_userdelivery defer (-9): failed to lock mailbox /home/domaincom/mail/domain.com/ticket.res/inbox (lock file)

    #2
    /var/log/maillog
    Jan 24 15:54:27 host2 cpanelpop[6220]: Login host=xx.xx.xx.xx ip=xx.xx.xx.xx user=ticket.res@domain.com realuser=ticket.res@domain.com
    Jan 24 16:07:27 host2 cpanelpop[6220]: Session Closed host=xx.xx.xx.xx ip=xx.xx.xx.xx user=ticket.res@domain.com realuser=ticket.res@domain.com totalxfer=72041

    /var/log/exim_mainlog
    2005-01-24 16:05:50 1Ct09v-0002LC-8l == ticket.res@domain.com R=virtual_user T=virtual_userdelivery defer (-9): failed to lock mailbox /home/domaincom/mail/domain.com/ticket.res/inbox (lock file)
     
  12. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Well, I guess that does show a locking problem ;)

    It isn't clear from the logs causing the locking issue and I did want to dispell the idea that there was a link between that and the POP3 access type locking which was getting blurred in the thread :)

    I would suspect that any locking issues that Exim would report would indeed be down to exim lock checking (i.e. an issue with exim processes trying to write to the same file at the same time).

    It will be interesting if the settings that you have found make a difference.
     
  13. pizzaman

    pizzaman Well-Known Member
    PartnerNOC

    Joined:
    Oct 1, 2003
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    It's pretty amazing that a client was taking more than 13 minutes to POP just 70kB. I did try downloading from same server myself, and I was certain it wasn't a problem with our server. You really can't be sure of anything in the real world. :)

    Now, I came across several threads from googling the net and some of those show the not-so-well behave of exim's locking mechanism. I can only tell that our other servers (we have more than 20 under management) running qmail + vpopmail don't have this kind of problem under any circumstance, even with heavire load and smaller hardware. That's one of the strength of qmail's Maildir architecture and better locking logic. Can't blame exim either, at the moment, cause there might be some settings that can solve this and we still can't figure it out.

    Perhaps if cppop could be open sourced, then we can probably take a peek. Or at least someone could shed some light about locking mechanism of these 2 programs.

    Sadly, there are still problems. I made some adjustment to those settings, but to no avail.

    Now, where is Nick?
     
  14. pizzaman

    pizzaman Well-Known Member
    PartnerNOC

    Joined:
    Oct 1, 2003
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    #14 pizzaman, Jan 24, 2005
    Last edited: Aug 1, 2005
  15. cPanelBilly

    cPanelBilly Guest

    Best thing to do at this point in time is to follow what cPanelNick said earlier and follow that up with an strace to see what the process is doing. It may be they are on a really slow connection (maybe wireless nextel card at 19.2 or something).
     
  16. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Whenever I've seen these problems I've done exactly that, an strace, and invariably it's just hanging there on what nearly always transpires as being a dodgy connection at the users ISP. Another thing that can cause it is if the user has a huge inbox because they're one of those people who leave their POP mail in their inbox after collecting it, which is asking for trouble.
     
  17. linuxman

    linuxman Well-Known Member

    Joined:
    Sep 20, 2003
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    We discovered this to be a problem when large email 20MB plus were being delivered to our mail server. Is there any way we limit the size of the email coming in.
     
  18. jcn

    jcn Well-Known Member

    Joined:
    Sep 17, 2003
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    I actually just upgraded to WHM 10.1.0 cPanel 10.2.0-S83 to try to tackle some of these problems, but they're still there. Seems to crop up at random times with several different users, and often by the time I can check out their mail directory, the lock file is already gone.

    Apart from the switch to maildir, is there anything that anyone's found that has worked around this problem? It's sort of driving me insane.
     
  19. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Do make sure that you're using an up to date exim as the upgrade to STABLE doesn't always upgrade it:

    /scripts/updatenow
    /scripts/eximup
     
  20. jcn

    jcn Well-Known Member

    Joined:
    Sep 17, 2003
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Yup, according to the updater I'm running the newest version:

    exim is up to date. Use eximup --force to force a reinstall

    I don't really mind if the lock defers delivery, what I do mind is that delivery doesn't happen for another several hours. For some reason the message isn't immediately retried. Is there a recommended way for decreasing the amount of time before Exim tries to deliver this message again?
     
Loading...

Share This Page