[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-save.c, 1.94.2.3, 1.94.2.4
tss at dovecot.org
tss at dovecot.org
Sun Oct 15 16:42:59 UTC 2006
Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv21833
Modified Files:
Tag: branch_1_0
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.94.2.3
retrieving revision 1.94.2.4
diff -u -d -r1.94.2.3 -r1.94.2.4
--- mbox-save.c 10 Aug 2006 21:40:46 -0000 1.94.2.3
+++ mbox-save.c 15 Oct 2006 15:42:57 -0000 1.94.2.4
@@ -327,8 +327,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