Robert JR
2012-Oct-24 20:04 UTC
[Dovecot] Locking /var/mail/user issue with postfix and dovecot
Hello, I have a question regarding mailbox locking and hope any one can help me to better understanding the locking of mbox My Postfix lock option is fcntl dotlock mailbox_delivery_lock = fcntl, dotlock virtual_mailbox_lock = fcntl, dotlock My Dovecot lock option is fcntl only mbox_write_locks = fcntl mbox_read_locks = fcntl now, when user is download a large mail (20 MB) for example, dovecot locks /var/mail/user with fcntl until the users finish downloading the mail ok here comes my question. While the user is downloading the mail , a mail arrives so postfix make some thing weird 1- Postfix creates /var/mail/user.lock for 5 secs , then postfix defer the mail with reason that the /var/mail/user is locked and then delete the /var/mail/user.lock (after 5 secs) My question is ? why postfix create user.lock although it shouldn't because already dovecot fcntl it ? 1- Dovecot locks /var/mail/user using FCNTL 2- Posttix at the same time tries to FCNTL /var/mail/user .. but it fail since dovecot already fcnl it. 3- Postfix at the same time add dot lock /var/mail/user for 5 secs then remove the lock. the question is how come postfix dot lock /var/mail although it couldn't FCNTL the file in the first place ??????? what i was expecting is 1- Dovecot locks /var/mail/user using FCNTL 2- Postfix tries to FCNTL /var/mail/user 3- POSTFIX WILL NOT CREATE DOTLOCK file unless the FCNTL is released by dovecot!!!! Please advise if postfix will dot lock the file even if it couldn't FCNTL the file in the first place?? Regards
Stan Hoeppner
2012-Oct-25 03:57 UTC
[Dovecot] Locking /var/mail/user issue with postfix and dovecot
On 10/24/2012 3:04 PM, Robert JR wrote:> I have a question regarding mailbox locking and hope any one can help me > to better understanding the locking of mbox > > My Postfix lock option is fcntl dotlock > mailbox_delivery_lock = fcntl, dotlock > virtual_mailbox_lock = fcntl, dotlock > > My Dovecot lock option is fcntl only > mbox_write_locks = fcntl > mbox_read_locks = fcntl<snip> Postfix is delivering the mail to dovecot. This is done via the deliver program or lmtp which are pipes, not files. Thus, why is Postfix attempting to write files in the user's mail directory? You write new mail to the mailbox file with either Dovecot or Postfix, not both. Fix that problem and the locking problem disappears. -- Stan