# HG changeset patch # User meillo@marmaro.de # Date 1277982698 -7200 # Node ID 1e2fd87d58eab7364874e768763efc23065fad6f # Parent 7f1f364c2a2928d2b97cb0da7027ecbe04d6ac9f some annotations related to mail sending with SMTP SIZE diff -r 7f1f364c2a29 -r 1e2fd87d58ea src/smtp_out.c --- a/src/smtp_out.c Thu Jul 01 13:09:40 2010 +0200 +++ b/src/smtp_out.c Thu Jul 01 13:11:38 2010 +0200 @@ -363,10 +363,12 @@ ptr = data; while (*ptr) { int c = (int) (*ptr); - if (c == '.') - if (new_line) - putc('.', psb->out); + if (c == '.' && new_line) { + /* dot-stuffing */ + putc('.', psb->out); + } if (c == '\n') { + /* CRLF line terminators */ putc('\r', psb->out); putc('\n', psb->out); new_line = TRUE; @@ -722,7 +724,9 @@ } if (ok) { - smtp_cmd_mailfrom(psb, return_path, psb->use_size ? size + SMTP_SIZE_ADD : 0); + /* pretend the message is a bit larger, + just in case the size calculation is buggy */ + smtp_cmd_mailfrom(psb, return_path, psb->use_size ? size+SMTP_SIZE_ADD : 0); if (!psb->use_pipelining) { if ((ok = read_response(psb, SMTP_CMD_TIMEOUT))) diff -r 7f1f364c2a29 -r 1e2fd87d58ea src/smtp_out.h --- a/src/smtp_out.h Thu Jul 01 13:09:40 2010 +0200 +++ b/src/smtp_out.h Thu Jul 01 13:11:38 2010 +0200 @@ -23,7 +23,7 @@ #include #define SMTP_BUF_LEN 1024 -#define SMTP_SIZE_ADD 1024 +#define SMTP_SIZE_ADD 1024 /* add to the size of a message */ #define SMTP_INITIAL_TIMEOUT 5*60 #define SMTP_CMD_TIMEOUT 5*60