[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-save.c, 1.99, 1.100
tss at dovecot.org
tss at dovecot.org
Sun Oct 15 16:43:01 UTC 2006
Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv21829
Modified Files:
mbox-save.c
Log Message:
Filter out "From " lines from headers. There's no reason they should exist
in there and they'll cause problems.
Index: mbox-save.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-save.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- mbox-save.c 10 Aug 2006 21:40:48 -0000 1.99
+++ mbox-save.c 15 Oct 2006 15:42:58 -0000 1.100
@@ -326,8 +326,18 @@
{
struct mbox_save_context *ctx = context;
- if (!*matched && ctx->mbox_md5_ctx && hdr != NULL)
- mbox_md5_continue(ctx->mbox_md5_ctx, hdr);
+ if (hdr != NULL) {
+ if (strncmp(hdr->name, "From ", 5) == 0) {
+ /* we can't allow From_-lines in headers. there's no
+ legitimate reason for allowing them in any case,
+ so just drop them. */
+ *matched = TRUE;
+ return;
+ }
+
+ if (!*matched && ctx->mbox_md5_ctx != NULL)
+ mbox_md5_continue(ctx->mbox_md5_ctx, hdr);
+ }
if ((hdr == NULL && ctx->eoh_input_offset == (uoff_t)-1) ||
(hdr != NULL && hdr->eoh))
More information about the dovecot-cvs
mailing list