comparison src/lib-storage/index/mbox/mbox-save.c @ 9002:9d0037a997f4 HEAD

Initial commit for config rewrite.
author Timo Sirainen <tss@iki.fi>
date Tue, 27 Jan 2009 18:21:53 -0500
parents a9dd29e7dc4f
children 21d4363a3cf7
comparison
equal deleted inserted replaced
8692:77c67307d316 9002:9d0037a997f4
391 i_stream_unref(&filter); 391 i_stream_unref(&filter);
392 filter = ret; 392 filter = ret;
393 } 393 }
394 394
395 /* convert linefeeds to wanted format */ 395 /* convert linefeeds to wanted format */
396 ret = (ctx->mbox->storage->storage.flags & 396 ret = ctx->mbox->storage->storage.set->mail_save_crlf ?
397 MAIL_STORAGE_FLAG_SAVE_CRLF) != 0 ?
398 i_stream_create_crlf(filter) : i_stream_create_lf(filter); 397 i_stream_create_crlf(filter) : i_stream_create_lf(filter);
399 i_stream_unref(&filter); 398 i_stream_unref(&filter);
400 399
401 if (ctx->mail != NULL) { 400 if (ctx->mail != NULL) {
402 /* caching creates a tee stream */ 401 /* caching creates a tee stream */
540 /* if mail doesn't end with LF, we'll do that. 539 /* if mail doesn't end with LF, we'll do that.
541 otherwise some mbox parsers don't like the result. 540 otherwise some mbox parsers don't like the result.
542 this makes it impossible to save a mail that doesn't 541 this makes it impossible to save a mail that doesn't
543 end with LF though. */ 542 end with LF though. */
544 const char *linefeed = 543 const char *linefeed =
545 (ctx->mbox->storage->storage.flags & 544 ctx->mbox->storage->storage.set->mail_save_crlf ?
546 MAIL_STORAGE_FLAG_SAVE_CRLF) != 0 ?
547 "\r\n" : "\n"; 545 "\r\n" : "\n";
548 if (o_stream_send_str(ctx->output, linefeed) < 0) 546 if (o_stream_send_str(ctx->output, linefeed) < 0)
549 return write_error(ctx); 547 return write_error(ctx);
550 } 548 }
551 return 0; 549 return 0;