changeset 2477:63dca331c266 HEAD

Save mails through CRLF or LF output streams.
author Timo Sirainen <tss@iki.fi>
date Mon, 23 Aug 2004 10:55:29 +0300
parents bce342d816f0
children 87b6d3303031
files src/lib-storage/index/maildir/maildir-save.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-save.c	Mon Aug 23 10:51:53 2004 +0300
+++ b/src/lib-storage/index/maildir/maildir-save.c	Mon Aug 23 10:55:29 2004 +0300
@@ -3,6 +3,7 @@
 #include "lib.h"
 #include "ioloop.h"
 #include "ostream.h"
+#include "ostream-crlf.h"
 #include "str.h"
 #include "maildir-storage.h"
 #include "maildir-uidlist.h"
@@ -114,6 +115,7 @@
 	struct maildir_save_context *ctx;
 	struct index_mailbox *ibox = t->ictx.ibox;
 	struct maildir_filename *mf;
+	struct ostream *output;
 	const char *fname, *dest_fname, *path;
 	enum mail_flags mail_flags;
 	keywords_mask_t keywords;
@@ -139,7 +141,12 @@
 
 	ctx->received_date = received_date;
 	ctx->input = input;
-	ctx->output = o_stream_create_file(ctx->fd, system_pool, 0, FALSE);
+
+	output = o_stream_create_file(ctx->fd, system_pool, 0, FALSE);
+	ctx->output = ctx->save_crlf ?
+		o_stream_create_crlf(default_pool, output) :
+		o_stream_create_lf(default_pool, output);
+	o_stream_unref(output);
 
 	mail_flags = (flags->flags & ~MAIL_RECENT) |
 		(ibox->keep_recent ? MAIL_RECENT : 0);