[Dovecot] does dovecot interpret any mail headers specially with maildir?
Hi.
For mbox, http://wiki2.dovecot.org/MailboxFormat/mbox#Dovecot.27s_Metadata lists a numer of mail headers: that are treated specially by dovecot.
- X-IMAPbase
- X-IMAP
- X-UID
- Status
- X-Status
- X-Keywords
- Content-Length
It also suggests, that these should be stripped by the LDA (I guess in order that someone sending you such mail cannot set the status or keywords, or even "attack you" by setting a bogus Content-Length).
I wondered, when using maildir, are there any headers that dovecote would treat specially, too? And which I therefore should strip?
Thanks, Chris.
On 29.10.2012, at 22.31, Christoph Anton Mitterer wrote:
For mbox, http://wiki2.dovecot.org/MailboxFormat/mbox#Dovecot.27s_Metadata lists a numer of mail headers: that are treated specially by dovecot.
- X-IMAPbase
- X-IMAP
- X-UID
- Status
- X-Status
- X-Keywords
- Content-Length
It also suggests, that these should be stripped by the LDA (I guess in order that someone sending you such mail cannot set the status or keywords, or even "attack you" by setting a bogus Content-Length).
Right.
I wondered, when using maildir, are there any headers that dovecote would treat specially, too? And which I therefore should strip?
No. Maildir metadata is stored elsewhere.
Hi Timo.
On Mon, 2012-10-29 at 22:40 +0200, Timo Sirainen wrote:
I wondered, when using maildir, are there any headers that dovecote would treat specially, too? And which I therefore should strip?
No. Maildir metadata is stored elsewhere.
Great... and I expect that this ("no headers from the maildir files are interpreted") applies also, when one "imports" mails the first time.
With import I don't mean via IMAP, but plainly moving e.g. a maildir++ tree under dovecots mail location.
Then dovecot usually starts to generate all it's metadata,... and I expect that things like status and keywords are left simply unset... and things like UID and UIDVALIDITY are freshly initialised and not tried to be converted from the maildir files, right?
Thanks, Chris.
On 29.10.2012, at 23.09, Christoph Anton Mitterer wrote:
On Mon, 2012-10-29 at 22:40 +0200, Timo Sirainen wrote:
I wondered, when using maildir, are there any headers that dovecote would treat specially, too? And which I therefore should strip?
No. Maildir metadata is stored elsewhere.
Great... and I expect that this ("no headers from the maildir files are interpreted") applies also, when one "imports" mails the first time.
With import I don't mean via IMAP, but plainly moving e.g. a maildir++ tree under dovecots mail location.
Yeah.
Then dovecot usually starts to generate all it's metadata,... and I expect that things like status and keywords are left simply unset... and things like UID and UIDVALIDITY are freshly initialised and not tried to be converted from the maildir files, right?
Flags are stored in the maildir filenames, so they're always preserved. Keywords, UIDs, UIDVALIDITY etc is preserved if you copy the dovecot-* files with it (which is a good idea to do).
Great... and I expect that this ("no headers from the maildir files are interpreted") applies also, when one "imports" mails the first time.
With import I don't mean via IMAP, but plainly moving e.g. a maildir ++ tree under dovecots mail location.
Yeah. So that means: From a "security" point of view, when using maildir (!)
On Mon, 2012-10-29 at 23:13 +0200, Timo Sirainen wrote: there's no need to remove such headers, cause dovcote ignores them (on maildir) always. Right?!
I just wondered because when I looked through my mail archive (currently as mentioned, under Evolution)... many emails already had X-UID and X-IMAP* headers.... (set by the remote side, not by Evolution) ... and in no case these should be able to mess around in my dovecot :)
UIDs, UIDVALIDITY etc is preserved if you copy the dovecot-* files with it (which is a good idea to do). I'll have a question on that too, but ask it under a separate mail in a few minutes,.. cause it doesn't fit this thread anymore ;)
Thanks, Chris.
On 29.10.2012, at 23.20, Christoph Anton Mitterer wrote:
Great... and I expect that this ("no headers from the maildir files are interpreted") applies also, when one "imports" mails the first time.
With import I don't mean via IMAP, but plainly moving e.g. a maildir ++ tree under dovecots mail location.
Yeah. So that means: From a "security" point of view, when using maildir (!)
On Mon, 2012-10-29 at 23:13 +0200, Timo Sirainen wrote: there's no need to remove such headers, cause dovcote ignores them (on maildir) always. Right?!
Right. The only special case is X-UIDL: header, which is used for POP3 UIDLs but only if pop3_reuse_xuidl=yes (which isn't really recommended nowadays as there are other ways to do it).
I just wondered because when I looked through my mail archive (currently as mentioned, under Evolution)... many emails already had X-UID and X-IMAP* headers.... (set by the remote side, not by Evolution) ... and in no case these should be able to mess around in my dovecot :)
If you migrated from mbox format it could have brought those headers to maildir. They're anyway not used for anything by Dovecot.
On Mon, 2012-10-29 at 23:39 +0200, Timo Sirainen wrote:
Right. The only special case is X-UIDL: header, which is used for POP3 UIDLs but only if pop3_reuse_xuidl=yes (which isn't really recommended nowadays as there are other ways to do it).
Great... I think it would worth adding all this to: http://wiki2.dovecot.org/MailboxFormat/Maildir
Is the wiki open for public editing (after registering an account)?
Cheers, Chris.
On 29.10.2012, at 23.52, Christoph Anton Mitterer wrote:
On Mon, 2012-10-29 at 23:39 +0200, Timo Sirainen wrote:
Right. The only special case is X-UIDL: header, which is used for POP3 UIDLs but only if pop3_reuse_xuidl=yes (which isn't really recommended nowadays as there are other ways to do it).
Great... I think it would worth adding all this to: http://wiki2.dovecot.org/MailboxFormat/Maildir
Well, that isn't really maildir-specific. It's pop3 specific that is done with all mailbox formats. pop3_reuse_xuidl setting's comments should probably warn about the possibility of receiving unwanted X-UIDL headers in new mails.
Is the wiki open for public editing (after registering an account)?
Yes. You don't even need to register.
On Tue, 2012-10-30 at 00:08 +0200, Timo Sirainen wrote:
Great... I think it would worth adding all this to: http://wiki2.dovecot.org/MailboxFormat/Maildir
Well, that isn't really maildir-specific. It's pop3 specific that is done with all mailbox formats. pop3_reuse_xuidl setting's comments should probably warn about the possibility of receiving unwanted X-UIDL headers in new mails. No I meant _everything_.. i.e. that dovecote never interprets these message headers when using maildir... unless for that one case when using POP3 on maildir and when pop3_reuse_xuidl is set to yes.
I'll make some chances and post you the diff links here, so you can check this and correct if something's wrong.
Cheers, Chris.
Please have a look at: http://master.wiki2.dovecot.org/MailboxFormat/mbox?action=diff&rev2=17&rev1=16 http://master.wiki2.dovecot.org/MailboxFormat/Maildir?action=diff&rev2=45&rev1=44
whether it's correct.
Oh and... I'd assume that everything I've added for maildir also applies to the dbox formats? If so, I'd add the text there, too.
Chris.
participants (2)
-
Christoph Anton Mitterer
-
Timo Sirainen