dovecot: Removed MAILBOX_OPEN_MBOX_ONE_MSG_ONLY flag and handlin...

dovecot at dovecot.org dovecot at dovecot.org
Thu Nov 8 21:28:15 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/a6782f59c44f
changeset: 6751:a6782f59c44f
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Nov 08 21:27:44 2007 +0200
description:
Removed MAILBOX_OPEN_MBOX_ONE_MSG_ONLY flag and handling. Raw storage
replaced its functionality.

diffstat:

4 files changed, 15 insertions(+), 30 deletions(-)
src/lib-storage/index/mbox/istream-raw-mbox.c |   27 ++++++++++---------------
src/lib-storage/index/mbox/istream-raw-mbox.h |    3 --
src/lib-storage/index/mbox/mbox-file.c        |   11 +---------
src/lib-storage/mail-storage.h                |    4 ---

diffs (121 lines):

diff -r b822b7b78d7b -r a6782f59c44f src/lib-storage/index/mbox/istream-raw-mbox.c
--- a/src/lib-storage/index/mbox/istream-raw-mbox.c	Thu Nov 08 21:25:55 2007 +0200
+++ b/src/lib-storage/index/mbox/istream-raw-mbox.c	Thu Nov 08 21:27:44 2007 +0200
@@ -16,7 +16,6 @@ struct raw_mbox_istream {
 	struct istream *input;
 	uoff_t input_peak_offset;
 
-	unsigned int one_mail_only:1;
 	unsigned int crlf_ending:1;
 	unsigned int corrupted:1;
 	unsigned int eof:1;
@@ -238,18 +237,16 @@ static ssize_t i_stream_raw_mbox_read(st
 				   rest of the line buffered.
 				   FIXME: if From-line is longer than input
 				   buffer, we break. probably irrelevant.. */
-				if (!rstream->one_mail_only) {
-					i++;
-					from_after_pos = i;
-					from_start_pos = i - 6;
-					if (from_start_pos > 0 &&
-					    buf[from_start_pos-1] == '\r') {
-						/* CR also belongs to it. */
-						crlf_ending = TRUE;
-						from_start_pos--;
-					} else {
-						crlf_ending = FALSE;
-					}
+				i++;
+				from_after_pos = i;
+				from_start_pos = i - 6;
+				if (from_start_pos > 0 &&
+				    buf[from_start_pos-1] == '\r') {
+					/* CR also belongs to it. */
+					crlf_ending = TRUE;
+					from_start_pos--;
+				} else {
+					crlf_ending = FALSE;
 				}
 				fromp = mbox_from;
 			} else if (from_start_pos != (size_t)-1) {
@@ -345,8 +342,7 @@ i_stream_raw_mbox_stat(struct istream_pr
 	return &stream->statbuf;
 }
 
-struct istream *i_stream_create_raw_mbox(struct istream *input,
-					 bool kludge_one_mail_only)
+struct istream *i_stream_create_raw_mbox(struct istream *input)
 {
 	struct raw_mbox_istream *rstream;
 
@@ -354,7 +350,6 @@ struct istream *i_stream_create_raw_mbox
 
 	rstream = i_new(struct raw_mbox_istream, 1);
 
-	rstream->one_mail_only = kludge_one_mail_only;
 	rstream->input = input;
 	rstream->body_offset = (uoff_t)-1;
 	rstream->mail_size = (uoff_t)-1;
diff -r b822b7b78d7b -r a6782f59c44f src/lib-storage/index/mbox/istream-raw-mbox.h
--- a/src/lib-storage/index/mbox/istream-raw-mbox.h	Thu Nov 08 21:25:55 2007 +0200
+++ b/src/lib-storage/index/mbox/istream-raw-mbox.h	Thu Nov 08 21:27:44 2007 +0200
@@ -3,8 +3,7 @@
 
 /* Create a mbox stream for parsing mbox. Reading stops before From-line,
    you'll have to call istream_raw_mbox_next() to get to next message. */
-struct istream *i_stream_create_raw_mbox(struct istream *input,
-					 bool kludge_one_mail_only);
+struct istream *i_stream_create_raw_mbox(struct istream *input);
 
 /* Return offset to beginning of the "\nFrom"-line. */
 uoff_t istream_raw_mbox_get_start_offset(struct istream *stream);
diff -r b822b7b78d7b -r a6782f59c44f src/lib-storage/index/mbox/mbox-file.c
--- a/src/lib-storage/index/mbox/mbox-file.c	Thu Nov 08 21:25:55 2007 +0200
+++ b/src/lib-storage/index/mbox/mbox-file.c	Thu Nov 08 21:27:44 2007 +0200
@@ -60,21 +60,15 @@ void mbox_file_close(struct mbox_mailbox
 
 int mbox_file_open_stream(struct mbox_mailbox *mbox)
 {
-	bool one_mail_only;
-
 	if (mbox->mbox_stream != NULL)
 		return 0;
-
-	one_mail_only =
-		(mbox->ibox.open_flags & MAILBOX_OPEN_MBOX_ONE_MSG_ONLY) != 0;
 
 	if (mbox->mbox_file_stream != NULL) {
 		/* read-only mbox stream */
 		i_assert(mbox->mbox_fd == -1 && mbox->mbox_readonly);
 
 		mbox->mbox_stream =
-			i_stream_create_raw_mbox(mbox->mbox_file_stream,
-						 one_mail_only);
+			i_stream_create_raw_mbox(mbox->mbox_file_stream);
 		return 0;
 	}
 
@@ -91,8 +85,7 @@ int mbox_file_open_stream(struct mbox_ma
 					   MAIL_READ_BLOCK_SIZE, FALSE);
 	}
 
-	mbox->mbox_stream =
-		i_stream_create_raw_mbox(mbox->mbox_file_stream, one_mail_only);
+	mbox->mbox_stream = i_stream_create_raw_mbox(mbox->mbox_file_stream);
 	return 0;
 }
 
diff -r b822b7b78d7b -r a6782f59c44f src/lib-storage/mail-storage.h
--- a/src/lib-storage/mail-storage.h	Thu Nov 08 21:25:55 2007 +0200
+++ b/src/lib-storage/mail-storage.h	Thu Nov 08 21:27:44 2007 +0200
@@ -54,9 +54,7 @@ enum mailbox_open_flags {
 	/* Don't create index files for the mailbox */
 	MAILBOX_OPEN_NO_INDEX_FILES	= 0x10,
 	/* Keep mailbox exclusively locked all the time while it's open */
-	MAILBOX_OPEN_KEEP_LOCKED	= 0x20,
-	/* FIXME: Kludge for deliver: Ignore all but the first From-line */
-	MAILBOX_OPEN_MBOX_ONE_MSG_ONLY	= 0x40
+	MAILBOX_OPEN_KEEP_LOCKED	= 0x20
 };
 
 enum mailbox_status_items {


More information about the dovecot-cvs mailing list