Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This is an odd issue that I tend to see with Blackberry devices connecting via IMAP on some of my Sendmail+Dovecot mail deployments. For users of those devices, the Dovecot indexes tend to get locked. This prevents mail flow to the Blackberry device as well as the user's Outlook client. The corresponding messages in /var/log/maillog look like:

May 2 08:13 XXX imap(asmith): Timeout while waiting for release of exclusive fcntl() lock for index file /home/asmith/mail/.imap/INBOX/.imap.index

This is repeated for every mailbox synchronization attempt...

It's a strange error and is easily resolved by removing the offending index file. However, I'm curious about the root cause of the error and locked-state and if there's something I can modify on the configuration side to prevent it.

In other situations, I've only had a handful of BB devices to deal with. In this case, 80 new Blackberries were added, and this locking has an impact on system load and performance.

share|improve this question
2  
From what I have seen on BlackBerry IMAP connections is that they are ALWAYS connected looking for updates. This gives the BlackBerry user like push email. Works well for the user but can add additional load on the mail server. –  xeon May 9 '11 at 17:51
2  
blackberrys are known to play loose with the imap spec and pummel the server. There are optimized to work with exchange via BES (more of an enterprise solution) –  Jim B May 11 '11 at 0:30
add comment

1 Answer

up vote 4 down vote accepted
+25

The mbox storage format keeps the entire folder in a single unindexed file, requiring Dovecot to use complicated locking even for read access. This causes problems with multiple clients, especially when they attempt to keep the folder selected in order to wait for IDLE notifications, used by most modern IMAP clients.

(Also, the .imap.index file is an addition by Dovecot to avoid some performance issues, and often gets out of sync if an external delivery agent updates the folder.)

Consider switching to Maildir format, which has no such issues with locking. Dovecot has instructions (for v1.x).

share|improve this answer
    
Other IMAP clients don't seem to have this issue. E.g. if a user has webmail, Outlook and an iPhone, this does not come up. The problem here seems to be specific to Blackberry interaction with Dovecot. I do understand that maildir may be more efficient. How would one go about converting without heavy downtime? –  ewwhite May 5 '11 at 13:59
    
@ewwhite: See the "instructions" links. For Dovecot v2, update mail_location and use dsync; for v1, enable the convert plug-in. –  grawity May 5 '11 at 14:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.