6

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.

ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • 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 09 '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 00:30

1 Answers1

4

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).

user1686
  • 8,717
  • 25
  • 38
  • 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 05 '11 at 13:59
  • @ewwhite: See the "instructions" links. For Dovecot v2, [update mail_location and use `dsync`](http://wiki2.dovecot.org/Migration/MailFormat); for v1, [enable the `convert` plug-in](http://wiki1.dovecot.org/Migration/MailFormat). – user1686 May 05 '11 at 14:06