Problem: mail moved by thunderbird script is invisible to mail clients, but in cur directory
Over the last year I've had a script moving old mail (120 days) into my annual archive folder. This is the first year I've done this with Dovecot, previously it was running against Cyrus.
There's nothing particularly clever: a few conditions to match, then "move message to" the appropriate archive folder. There's one for every year from 2000 to 2015. 2015 is just barely ahead of need. 2014 has about a year's mail in the cur directory.
The 2000-2013 folders were filled by Cyrus and were migrated over using IMAP Migrate. They're fine, and read normally.
The 2014 layout looks normal to me # ls cur dovecot-uidlist dovecot.index.cache dovecot.index.log.2 new dovecot-keywords dovecot.index dovecot.index.log maildirfolder tmp
Permissions are the same as every other folder, as is owner: drw-r----- 2 vmail vmail 9.6K Apr 12 21:13 cur
and # ls | wc -l 9822
I've checked with Thunderbird, Mulberry, Claws, and Sylpheed - none can read the directory.
The files look normal: 2014/cur 1426411329.M123928P26360.host.domain.com,S=3523,W=3591:2,R
More or less the same as a working directory: 2013/cur 1405500734.M958596P27867.host.domain.com,S=794,W=819:2,RS
I've run
# doveadm force-resync -u user .archives.2014
and nothing changed.
I'm at a bit of a loss since no client can read them, something like moving them to another folder and back is a little complicated. Any hints?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 14 Apr 2015, David Gessel wrote:
There's nothing particularly clever: a few conditions to match, then "move message to" the appropriate archive folder. There's one for every year from 2000 to 2015. 2015 is just barely ahead of need. 2014 has about a year's mail in the cur directory.
The 2000-2013 folders were filled by Cyrus and were migrated over using IMAP Migrate. They're fine, and read normally.
The 2014 layout looks normal to me # ls cur dovecot-uidlist dovecot.index.cache dovecot.index.log.2 new dovecot-keywords dovecot.index dovecot.index.log maildirfolder tmp
Permissions are the same as every other folder, as is owner: drw-r----- 2 vmail vmail 9.6K Apr 12 21:13 cur
I've checked with Thunderbird, Mulberry, Claws, and Sylpheed - none can read the directory.
What does Dovecot log?
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBVSyuunz1H7kL/d9rAQKRRAf/fn3KoLeLyjgZcB3r6TV7WuothiUg513/ Nf/eTbyu/Xe1dR24oFyWVSE7yOKPttwSKsSFHZqVs75MOGRCv9j0441WEXnDFiqE TJ8JZ8KQfkgjaS7YEIO2loZJfJa4ValcTWsL2kO23UCmITsedIQLwqtO5n+1yhUT 5InO2FC2TsEuD0kmWjEnFoNq0jpqkwCZhRDYrW3eZC/dFr95mNAxS7PlQe2Ps5n+ 4NEVLPSfBCuM02iL+Gni+SgFGGo3iCtxeacfYLx5wCNDIV4kwX0WAwaKagGQdcGF ZNm8dOZJ1L5BVBOj+MbE6THc0RW3Dq3UDbL107MS8FsKhmKcYDEalg== =X1/v -----END PGP SIGNATURE-----
-------- Original Message -------- Subject: Re: Problem: mail moved by thunderbird script is invisible to mail clients, but in cur directory From: Steffen Kaiser <skdovecot@smail.inf.fh-brs.de> To: David Gessel <gessel@blackrosetech.com> Date: Tue Apr 14 2015 09:07:54 GMT+0300 (Arabic Standard Time)
On Tue, 14 Apr 2015, David Gessel wrote:
There's nothing particularly clever: a few conditions to match, then "move message to" the appropriate archive folder. There's one for every year from 2000 to 2015. 2015 is just barely ahead of need. 2014 has about a year's mail in the cur directory.
The 2000-2013 folders were filled by Cyrus and were migrated over using IMAP Migrate. They're fine, and read normally.
The 2014 layout looks normal to me # ls cur dovecot-uidlist dovecot.index.cache dovecot.index.log.2 new dovecot-keywords dovecot.index dovecot.index.log maildirfolder tmp
Permissions are the same as every other folder, as is owner: drw-r----- 2 vmail vmail 9.6K Apr 12 21:13 cur
I've checked with Thunderbird, Mulberry, Claws, and Sylpheed - none can read the directory.
What does Dovecot log?
-- Steffen Kaiser
Nothing useful as I tried to list it, but just to make sure, I tried copying a new file in and got the immensely useful:
Apr 14 09:48:15 imap(user@domain): Error: rename(/mail/domain/user//.archives.2014/tmp/1429030095.M674819P29788.shiofuki, /mail/domain/user//.archives.2014/cur/1405004806.M943913P44906.shiofuki.domain,S=36977,W=37882:2,S) failed: Permission denied
And checking again I see the above permissions are accurate but incorrect. 640 isn't right for cur, it should be 740.
Curiously, this directory was created by t-bird, but a simple
# chmod 740 cur
and the folder opens correctly. Thank you, Steffen, for the help!
-David
On 4/14/2015 10:59 AM, David Gessel wrote:
Curiously, this directory was created by t-bird, but a simple
# chmod 740 cur
and the folder opens correctly. Thank you, Steffen, for the help!
I believe you should make those permissions 750, so the execute bit is present on both user and group. This may not be strictly required because the user is likely to always be vmail, but it fits better with POSIX conventions.
It's very odd that a directory would be created without the execute bit set wherever read permissions are granted. I hope this is an isolated incident and not a bug.
Here is a more verbose explanation of what the execute bit does on a directory:
"Execute permission on a directory is sometimes called search permission. If you found a directory that gave you execute permission, but not read permission, you could use any file in that directory. However, you must know the name. You cannot look inside the directory to find out the names of the files. Think of this type of directory as a black box. You can throw filenames at this directory, and sometimes you find a file, sometimes you don't."
I found this explanation here:
http://www.grymoire.com/Unix/Permissions.html#Execute_permission_on_a_direct...
Thanks, Shawn
participants (3)
-
David Gessel
-
Shawn Heisey
-
Steffen Kaiser