summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2003-02-22 22:33:53 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2003-02-22 22:33:53 +0000
commit5b8f8d5afa7c0330d3e29ecdb2514e2c2464a0e2 (patch)
tree7d3b140cca1d272b178a4e661f77b323ad6fe3c3
parenteb841dd75c11362f3912813095bc74222489c21c (diff)
downloadmailutils-5b8f8d5afa7c0330d3e29ecdb2514e2c2464a0e2.tar.gz
mailutils-5b8f8d5afa7c0330d3e29ecdb2514e2c2464a0e2.tar.bz2
Ignore Fcc.
-rw-r--r--mailbox/sendmail.c28
-rw-r--r--mailbox/smtp.c7
2 files changed, 32 insertions, 3 deletions
diff --git a/mailbox/sendmail.c b/mailbox/sendmail.c
index c1e5c7bf3..d48cd910e 100644
--- a/mailbox/sendmail.c
+++ b/mailbox/sendmail.c
@@ -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)
diff --git a/mailbox/smtp.c b/mailbox/smtp.c
index 5c25a5857..2ed109110 100644
--- a/mailbox/smtp.c
+++ b/mailbox/smtp.c
@@ -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");

Return to:

Send suggestions and report system problems to the System administrator.