Commit 5b8f8d5a 5b8f8d5afa7c0330d3e29ecdb2514e2c2464a0e2 by Sergey Poznyakoff

Ignore Fcc.

1 parent eb841dd7
......@@ -38,6 +38,7 @@
#include <mailutils/property.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
#include <mailutils/header.h>
#include <mailer0.h>
#include <registrar0.h>
......@@ -346,8 +347,35 @@ sendmail_send_message (mailer_t mailer, message_t msg, address_t from,
size_t len = 0;
int rc;
size_t offset = 0;
header_t hdr;
message_get_stream (msg, &stream);
if (message_get_header (msg, &hdr)
&& header_get_value (hdr, MU_HEADER_FCC, NULL, 0, NULL) == 0)
{
while ((status = stream_readline (stream, buffer, sizeof (buffer),
offset, &len)) == 0
&& len != 0)
{
if (strncasecmp (buffer, MU_HEADER_FCC,
sizeof (MU_HEADER_FCC) - 1) == 0)
continue;
if (write (sendmail->fd, buffer, len) == -1)
{
status = errno;
MAILER_DEBUG1 (mailer, MU_DEBUG_TRACE,
"write() failed: %s\n", strerror (status));
break;
}
offset += len;
sendmail->offset += len;
}
}
while ((status = stream_read (stream, buffer, sizeof (buffer),
offset, &len)) == 0
&& len != 0)
......
......@@ -713,14 +713,15 @@ smtp_send_message (mailer_t mailer, message_t argmsg, address_t argfrom,
status = smtp_writeline (smtp, ".%s\r\n", data);
CHECK_ERROR (smtp, status);
}
else
else if (strncasecmp (data, MU_HEADER_FCC,
sizeof (MU_HEADER_FCC) - 1))
{
status = smtp_writeline (smtp, "%s\r\n", data);
CHECK_ERROR (smtp, status);
status = smtp_write (smtp);
CHECK_EAGAIN (smtp, status);
}
smtp->offset += n;
status = smtp_write (smtp);
CHECK_EAGAIN (smtp, status);
}
smtp->offset = 0;
status = smtp_writeline (smtp, ".\r\n");
......