Ignore Fcc.
Showing
2 changed files
with
32 additions
and
3 deletions
... | @@ -38,6 +38,7 @@ | ... | @@ -38,6 +38,7 @@ |
38 | #include <mailutils/property.h> | 38 | #include <mailutils/property.h> |
39 | #include <mailutils/stream.h> | 39 | #include <mailutils/stream.h> |
40 | #include <mailutils/url.h> | 40 | #include <mailutils/url.h> |
41 | #include <mailutils/header.h> | ||
41 | 42 | ||
42 | #include <mailer0.h> | 43 | #include <mailer0.h> |
43 | #include <registrar0.h> | 44 | #include <registrar0.h> |
... | @@ -346,8 +347,35 @@ sendmail_send_message (mailer_t mailer, message_t msg, address_t from, | ... | @@ -346,8 +347,35 @@ sendmail_send_message (mailer_t mailer, message_t msg, address_t from, |
346 | size_t len = 0; | 347 | size_t len = 0; |
347 | int rc; | 348 | int rc; |
348 | size_t offset = 0; | 349 | size_t offset = 0; |
350 | header_t hdr; | ||
349 | 351 | ||
350 | message_get_stream (msg, &stream); | 352 | message_get_stream (msg, &stream); |
353 | |||
354 | if (message_get_header (msg, &hdr) | ||
355 | && header_get_value (hdr, MU_HEADER_FCC, NULL, 0, NULL) == 0) | ||
356 | { | ||
357 | while ((status = stream_readline (stream, buffer, sizeof (buffer), | ||
358 | offset, &len)) == 0 | ||
359 | && len != 0) | ||
360 | { | ||
361 | if (strncasecmp (buffer, MU_HEADER_FCC, | ||
362 | sizeof (MU_HEADER_FCC) - 1) == 0) | ||
363 | continue; | ||
364 | |||
365 | if (write (sendmail->fd, buffer, len) == -1) | ||
366 | { | ||
367 | status = errno; | ||
368 | |||
369 | MAILER_DEBUG1 (mailer, MU_DEBUG_TRACE, | ||
370 | "write() failed: %s\n", strerror (status)); | ||
371 | |||
372 | break; | ||
373 | } | ||
374 | offset += len; | ||
375 | sendmail->offset += len; | ||
376 | } | ||
377 | } | ||
378 | |||
351 | while ((status = stream_read (stream, buffer, sizeof (buffer), | 379 | while ((status = stream_read (stream, buffer, sizeof (buffer), |
352 | offset, &len)) == 0 | 380 | offset, &len)) == 0 |
353 | && len != 0) | 381 | && len != 0) | ... | ... |
... | @@ -713,14 +713,15 @@ smtp_send_message (mailer_t mailer, message_t argmsg, address_t argfrom, | ... | @@ -713,14 +713,15 @@ smtp_send_message (mailer_t mailer, message_t argmsg, address_t argfrom, |
713 | status = smtp_writeline (smtp, ".%s\r\n", data); | 713 | status = smtp_writeline (smtp, ".%s\r\n", data); |
714 | CHECK_ERROR (smtp, status); | 714 | CHECK_ERROR (smtp, status); |
715 | } | 715 | } |
716 | else | 716 | else if (strncasecmp (data, MU_HEADER_FCC, |
717 | sizeof (MU_HEADER_FCC) - 1)) | ||
717 | { | 718 | { |
718 | status = smtp_writeline (smtp, "%s\r\n", data); | 719 | status = smtp_writeline (smtp, "%s\r\n", data); |
719 | CHECK_ERROR (smtp, status); | 720 | CHECK_ERROR (smtp, status); |
721 | status = smtp_write (smtp); | ||
722 | CHECK_EAGAIN (smtp, status); | ||
720 | } | 723 | } |
721 | smtp->offset += n; | 724 | smtp->offset += n; |
722 | status = smtp_write (smtp); | ||
723 | CHECK_EAGAIN (smtp, status); | ||
724 | } | 725 | } |
725 | smtp->offset = 0; | 726 | smtp->offset = 0; |
726 | status = smtp_writeline (smtp, ".\r\n"); | 727 | status = smtp_writeline (smtp, ".\r\n"); | ... | ... |
-
Please register or sign in to post a comment