[Dovecot] Bug? Expunging Symlinked Maildir w/ Lazy_expunge Enabled
Hi all,
Using Dovecot 1.0.3 on RedHat Enterprise 5 (kernel 2.6.18-8.1.6.el5PAE), and NFS storage, we symlinked a Maildir folder:
/mailstore/user/Maildir/.Junk -> /junkstore/user/Junkmaildir
Everything works fine, until we try to expunge, which produces:
A04 NO BUG: Unknown internal error
This only happens if "lazy_expunge" is enabled:
mail_plugins = quota imap_quota acl lazy_expunge lazy_expunge = .EXPUNGED/ .EXPUNGED/ .EXPUNGED/
Lazy_expunge works great on non-symlinked folders. We tried version 1.1 alpha2, which actually crashes in this scenario.
The only fix we've found is to disable "lazy_expunge". Attached is our "dovecot -n" config.
Anyone have an idea what might be causing this or a workaround?
Thanks!
Rich richs@whidbey.net
1.0.3: /shared/dovecot.conf
base_dir: /var/dovecot-mail/ log_path: /var/dovecot-mail/dovecot.log protocols: imap imaps pop3 pop3s ssl_ca_file: /adminstore/exim/ssl/instantsslroot.crt ssl_cert_file: /adminstore/exim/ssl/public-mail.crt ssl_key_file: /adminstore/exim/ssl/private-mail.key disable_plaintext_auth: no shutdown_clients: no login_dir: /var/dovecot-mail//login login_executable(default): /usr/local/libexec/dovecot/imap-login login_executable(imap): /usr/local/libexec/dovecot/imap-login login_executable(pop3): /usr/local/libexec/dovecot/pop3-login login_user: exim login_greeting: System ready. login_processes_count: 32 login_max_processes_count: 400 verbose_proctitle: yes mail_location: maildir:/mailstore/%Lu/Maildir:INDEX=MEMORY mail_cache_fields: mail_cache_min_mail_count: 65536 mailbox_idle_check_interval: 10 mmap_disable: yes lock_method: dotlock maildir_stat_dirs: yes maildir_copy_with_hardlinks: yes maildir_copy_preserve_filename: yes mail_executable(default): /usr/local/libexec/dovecot/rawlog /usr/local/libexec/dovecot/imap mail_executable(imap): /usr/local/libexec/dovecot/rawlog /usr/local/libexec/dovecot/imap mail_executable(pop3): /usr/local/libexec/dovecot/pop3 mail_plugins(default): quota imap_quota acl lazy_expunge mail_plugins(imap): quota imap_quota acl lazy_expunge mail_plugins(pop3): quota mail_plugin_dir(default): /usr/local/lib/dovecot/imap mail_plugin_dir(imap): /usr/local/lib/dovecot/imap mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3 imap_client_workarounds(default): delay-newmail outlook-idle imap_client_workarounds(imap): delay-newmail outlook-idle imap_client_workarounds(pop3): outlook-idle pop3_uidl_format(default): pop3_uidl_format(imap): pop3_uidl_format(pop3): %Mf pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh namespace: type: private separator: . inbox: yes namespace: type: private separator: . prefix: .EXPUNGED/ location: maildir:/mailstore/%u/Expunged:INDEX=MEMORY hidden: yes auth default: mechanisms: plain login passdb: driver: pam args: exim userdb: driver: ldap args: /adminstore/configs/dovecot-ldap.conf plugin: quota: maildir:storage=250000:ignore=Junk acl: vfile:/adminstore/configs/dovecot-acls
On Wed, 2007-08-29 at 09:04 -0700, Rich at Whidbey Telecom wrote:
You really mean EXPUNGE, not DELETE command?
A04 NO BUG: Unknown internal error
I couldn't reproduce this myself. I can't also think of why it would work any differently with symlinks. Does it happen if you don't use acl or quota plugins?
Timo Sirainen wrote:
OK, we can still reproduce this error even without quota's or ACL's, but we were able to narrow it down.
EXPUNGE fails only with "lazy_expunge" enabled, and you have symlinked a folder to a different file system:
ln -s /mailstore/user/Maildir/.Junk -> /junkstore/user/JunkMail
When we symlink to the same filesystem, it works:
ln -s /mailstore/user/Maildir/.Junk -> /mailstore/user/JunkMail
The /mailstore and /junkstore are separate NFS-mounted filesystems.
Here is the transaction log when it fails, using Dovecot 1.0.3:
- OK System ready. a a BAD Error in IMAP command received by server. a001 LOGIN testuser testpw a001 OK Logged in. a002 SELECT Junk
- FLAGS (\Answered \Flagged \Deleted \Seen \Draft $NotJunk $Junk)
- OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft $NotJunk $Junk \*)] Flags permitted.
- 5 EXISTS
- 1 RECENT
- OK [UNSEEN 1] First unseen.
- OK [UIDVALIDITY 1186687991] UIDs valid
- OK [UIDNEXT 3777] Predicted next UID a002 OK [READ-WRITE] Select completed. a003 FETCH 1:* (UID)
- 1 FETCH (UID 3772)
- 2 FETCH (UID 3773)
- 3 FETCH (UID 3774)
- 4 FETCH (UID 3775)
- 5 FETCH (UID 3776) a003 OK Fetch completed. a004 STORE 1 +flags \Deleted
- 1 FETCH (FLAGS (\Deleted $NotJunk)) a004 OK Store completed. a005 EXPUNGE a005 NO BUG: Unknown internal error a006 LOGOUT
BYE Logging out a006 OK Logout completed.
We appreciate your help! :)
Rich
On Mon, 2007-09-10 at 14:05 -0700, Rich at Whidbey Telecom wrote:
http://hg.dovecot.org/dovecot-1.0/rev/f0ea8a04225d changes this to a proper error message.
Right. The symlink isn't the problem, the problem is that it's on a different filesystem so rename() fails. There are two ways to handle this:
- Copy the message to the other filesystem. This is slow.
- Just unlink() the message.
Perhaps this could be configurable.
On Mon, 2008-09-29 at 16:32 +0200, Joseba Torre wrote:
If your plan was that the quota would decrease when mail was expunged, then no, it's not compatible currently.
It would of course be possible to fix it using 1), but I don't have time to implement it.
participants (3)
-
Joseba Torre
-
Rich at Whidbey Telecom
-
Timo Sirainen