[Dovecot] deliver copies "^From " header lines when delivering to Maildir
deliver appears to copy "^From " header lines from stdin when delivering to Maildir. The header filtering in mbox-save.c prevents this when delivering to an mbox and instead a synthesized "^From " header is written.
This is an issue when using, for example, Postfix and
mailbox_command = /usr/libexec/dovecot/deliver
which does not appear to have an option not to write a "^From " header on the mailbox_command input.
I'm attaching a patch that adds a save_header_callback() along the same lines as in mbox-save.c but I'm really not sure this is the right way to do it.
On Tue, 2007-08-14 at 17:40 +0100, pod wrote:
I'm attaching a patch that adds a save_header_callback() along the same lines as in mbox-save.c but I'm really not sure this is the right way to do it.
Well, doing it only if it's the first header would make it better. I guess I could do something like that since this is a pretty common problem..
"TS" == Timo Sirainen tss@iki.fi writes:
TS> Well, doing it only if it's the first header would make it better.
Sure, I considered that. I note though that the save_header_callback() from mbox-save.c also does not make this distinction and will strip a "^From " anywhere in the headers so I am going to claim I followed suit on grounds of consistency :-)
On Tue, 2007-08-14 at 22:00 +0100, pod wrote:
"TS" == Timo Sirainen tss@iki.fi writes:
TS> Well, doing it only if it's the first header would make it better.
Sure, I considered that. I note though that the save_header_callback() from mbox-save.c also does not make this distinction and will strip a "^From " anywhere in the headers so I am going to claim I followed suit on grounds of consistency :-)
The difference is that with mbox there must not be "From " lines anywhere in the header or the following data will be treated as a new message, while with other formats it doesn't really matter.
On Tue, 2007-08-14 at 22:42 +0300, Timo Sirainen wrote:
On Tue, 2007-08-14 at 17:40 +0100, pod wrote:
I'm attaching a patch that adds a save_header_callback() along the same lines as in mbox-save.c but I'm really not sure this is the right way to do it.
Well, doing it only if it's the first header would make it better. I guess I could do something like that since this is a pretty common problem..
"TS" == Timo Sirainen tss@iki.fi writes:
>> Well, doing it only if it's the first header would make it
>> better. I guess I could do something like that since this is a
>> pretty common problem..
TS> http://hg.dovecot.org/dovecot-1.0/rev/4c807839ac0c
Hasn't create_mbox_stream() returned by the time save_header_callback() is called? Doesn't that mean that the &first passed as *context to save_header_callback() is of dubious validity?
On Mon, 2007-09-24 at 15:41 +0100, pod wrote:
"TS" == Timo Sirainen tss@iki.fi writes:
>> Well, doing it only if it's the first header would make it >> better. I guess I could do something like that since this is a >> pretty common problem.. TS> http://hg.dovecot.org/dovecot-1.0/rev/4c807839ac0c
Hasn't create_mbox_stream() returned by the time save_header_callback() is called? Doesn't that mean that the &first passed as *context to save_header_callback() is of dubious validity?
Oh, good catch. Yes, that was a security hole just waiting to be exploited. :) I couldn't figure out a clean and safe way to do it, so: http://hg.dovecot.org/dovecot/rev/2821a472806f
deliver could use a rewrite some day..
participants (2)
-
pod
-
Timo Sirainen