[Dovecot] 1.1 and the zlib plugin
Hello,
I've been playing around with using namespaces to change the way messages are stored. My idea was to use mbox for archival stuff, like this:
namespace private {
separator = .
hidden = no
inbox = yes
prefox =
location = maildir:%h/Maildir
}
namespace private {
separator = .
hidden = no
prefix = "INBOX.Archive."
location = mbox:%h/Maildir/Archive
}
This works *GREAT*, and I'm really pleased with it. However, it occurred to me that for deeply frozen archives, it might be nice to gzip them. Conveniently, there's the zlib plugin. From what I could tell from the documentation, the compressed mbox names must end in ".gz", so I thought I could simply go into ~/Maildir/Archive and gzip everything. But when I did that, Dovecot started behaving strangely.
First of all, the result of LIST shows the files like this:
* LIST (\NoInferiors \Marked) "." "INBOX.Archive.Friends.gz"
Which is obviously wrong. When I try to SELECT it, I get this:
? SELECT "INBOX.Archive.Friends.gz"
? NO Mailbox doesn't exist: Friends/gz
Which seems to indicate that Dovecot is treating the dot in the extension as the separator (understandably), and failing. However, if I leave off the extension, I get this:
? SELECT "INBOX.Archive.Friends"
? NO Mailbox doesn't exist: Friends
Which seems to indicate that Dovecot isn't translating "Friends" into "Friends.gz" for some reason.
Then I remembered that in the ChangeLog, back in May, the zlib plugin was changed to look for the zlib header rather than the Z flag. I assume that was for using it with Maildirs, but I figured it was worth a shot. So I renamed the Friends.gz file to remove the extension. But that just gives me an error message:
? SELECT "INBOX.Archive.Friends"
? NO Mailbox isn't a valid mbox file
It seems like loading the zlib plugin either doesn't have any effect, or I'm not doing it right. I have it in the config file along with other plugins that work just fine:
mail_plugins = fts fts_squat zlib
And when I check that with dovecot -p, it shows up:
mail_plugins: fts fts_squat zlib
There's no entry in the plugin {} section of the config file for the zlib plugin... but I assume that none is necessary.
Am I doing something wrong?
~Kyle
No people can be great who have ceased to be virtuous. -- Samuel Johnson, on the behavior of the British colonists in America
On Tuesday, June 24 at 01:59 PM, quoth Kyle Wheeler:
I've been playing around with using namespaces to change the way messages are stored. My idea was to use mbox for archival stuff, like this:
namespace private { separator = . hidden = no inbox = yes prefox = location = maildir:%h/Maildir } namespace private { separator = . hidden = no prefix = "INBOX.Archive." location = mbox:%h/Maildir/Archive }
Something seems to have gone wrong with my setup here. As I've been testing moving large numbers of email into the archive folders (2000+ messages), some of them never make it to the new namespace. Instead of showing up like they're supposed to, they appear as entirely empty messages. Inspecting the raw mbox file, the message has become just an mbox header and an empty line. Not good! Does anyone have any idea how I can help debug this?
~Kyle
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian Kernighan
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
OT, maybe, but this...
namespace private { separator = . hidden = no inbox = yes prefox =
^^^
...is such a nice typo I I couldn't resist :-) But I doubt it has to do with your original problem.
Regards
- -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFIYiR8Bcgs9XrR2kYRAgSjAJ9jwzWgWCfQX5dEeEHpkxgsJCOKngCbBdAc NTWQsIO+SNG6Kkscwsfncss= =LOtI -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wednesday, June 25 at 12:57 PM, quoth tomas@tuxteam.de:
OT, maybe, but this...
namespace private { separator = . hidden = no inbox = yes prefox =
^^^
...is such a nice typo I I couldn't resist :-) But I doubt it has to do with your original problem.
HEH! Yeah... sorry - that was my fault typing it into the email; it's "prefix" in the actual config file.
~Kyle
The real problem is not whether machines think, but whether men do. -- B. F. Skinner -----BEGIN PGP SIGNATURE----- Comment: Thank you for using encryption!
iEYEARECAAYFAkhiRzcACgkQBkIOoMqOI16GKACg8IjCoSW+vilan2D0iwWGtpKV 9PgAn0pDtVkqQUD6jJL4a+xiuD2dlXWm =DMRd -----END PGP SIGNATURE-----
Kyle Wheeler wrote:
Conveniently, there's the zlib plugin. From what I could tell from the documentation, the compressed mbox names must end in ".gz",
Not a solution, but I believe also now that you don't need to change the ending? I think the plugin looks at the first few bytes to determine the type of the file?
Ed W
On Wednesday, June 25 at 01:24 PM, quoth Ed W:
Kyle Wheeler wrote:
Conveniently, there's the zlib plugin. From what I could tell from the documentation, the compressed mbox names must end in ".gz",
Not a solution, but I believe also now that you don't need to change the ending? I think the plugin looks at the first few bytes to determine the type of the file?
I tried that... as you can see in my original email, it doesn't seem to work.
I *have* been able to get the zlib plugin to work with compressed messages in Maildirs (no gz extension), but I can't seem to get it to work with compressed mboxes. :(
~Kyle
This is my simple religion. There is no need for temples; no need for complicated philosophy. Our own brain, our own heart is our temple; the philosophy is kindness. -- Dalai Lama
On Tue, 2008-06-24 at 13:59 -0500, Kyle Wheeler wrote:
I've been playing around with using namespaces to change the way messages are stored. My idea was to use mbox for archival stuff, like this:
namespace private { separator = . hidden = no inbox = yes prefox = location = maildir:%h/Maildir } namespace private { separator = . hidden = no prefix = "INBOX.Archive." location = mbox:%h/Maildir/Archive }
.. ? SELECT "INBOX.Archive.Friends.gz" ? NO Mailbox doesn't exist: Friends/gz
I'd just suggest switching separator to '/' and this problem goes away.
Then I remembered that in the ChangeLog, back in May, the zlib plugin was changed to look for the zlib header rather than the Z flag. I assume that was for using it with Maildirs, but I figured it was worth a shot. So I renamed the Friends.gz file to remove the extension. But that just gives me an error message:
? SELECT "INBOX.Archive.Friends" ? NO Mailbox isn't a valid mbox file
For mbox detecting this by reading the file header would be extra disk I/O (since often the file hasn't changed and Dovecot never has to open/read the file).
participants (4)
-
Ed W
-
Kyle Wheeler
-
Timo Sirainen
-
tomas@tuxteam.de