summaryrefslogtreecommitdiff
path: root/mailbox/sendmail.c
diff options
context:
space:
mode:
Diffstat (limited to 'mailbox/sendmail.c')
-rw-r--r--mailbox/sendmail.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mailbox/sendmail.c b/mailbox/sendmail.c
index 70c50fbdb..fde4893f8 100644
--- a/mailbox/sendmail.c
+++ b/mailbox/sendmail.c
@@ -345,10 +345,11 @@ sendmail_send_message (mailer_t mailer, message_t msg, address_t from,
char buffer[512];
size_t len = 0;
int rc;
-
+ size_t offset = 0;
+
message_get_stream (msg, &stream);
while ((status = stream_read (stream, buffer, sizeof (buffer),
- sendmail->offset, &len)) == 0
+ offset, &len)) == 0
&& len != 0)
{
if (write (sendmail->fd, buffer, len) == -1)
@@ -360,6 +361,7 @@ sendmail_send_message (mailer_t mailer, message_t msg, address_t from,
break;
}
+ offset += len;
sendmail->offset += len;
}
if (status == EAGAIN)

Return to:

Send suggestions and report system problems to the System administrator.