masqmail-0.2
changeset 119:1e2fd87d58ea
some annotations related to mail sending with SMTP SIZE
author | meillo@marmaro.de |
---|---|
date | Thu, 01 Jul 2010 13:11:38 +0200 |
parents | 7f1f364c2a29 |
children | cd59a5b4d3dd |
files | src/smtp_out.c src/smtp_out.h |
diffstat | 2 files changed, 9 insertions(+), 5 deletions(-) [+] |
line diff
1.1 --- a/src/smtp_out.c Thu Jul 01 13:09:40 2010 +0200 1.2 +++ b/src/smtp_out.c Thu Jul 01 13:11:38 2010 +0200 1.3 @@ -363,10 +363,12 @@ 1.4 ptr = data; 1.5 while (*ptr) { 1.6 int c = (int) (*ptr); 1.7 - if (c == '.') 1.8 - if (new_line) 1.9 - putc('.', psb->out); 1.10 + if (c == '.' && new_line) { 1.11 + /* dot-stuffing */ 1.12 + putc('.', psb->out); 1.13 + } 1.14 if (c == '\n') { 1.15 + /* CRLF line terminators */ 1.16 putc('\r', psb->out); 1.17 putc('\n', psb->out); 1.18 new_line = TRUE; 1.19 @@ -722,7 +724,9 @@ 1.20 } 1.21 1.22 if (ok) { 1.23 - smtp_cmd_mailfrom(psb, return_path, psb->use_size ? size + SMTP_SIZE_ADD : 0); 1.24 + /* pretend the message is a bit larger, 1.25 + just in case the size calculation is buggy */ 1.26 + smtp_cmd_mailfrom(psb, return_path, psb->use_size ? size+SMTP_SIZE_ADD : 0); 1.27 1.28 if (!psb->use_pipelining) { 1.29 if ((ok = read_response(psb, SMTP_CMD_TIMEOUT)))
2.1 --- a/src/smtp_out.h Thu Jul 01 13:09:40 2010 +0200 2.2 +++ b/src/smtp_out.h Thu Jul 01 13:11:38 2010 +0200 2.3 @@ -23,7 +23,7 @@ 2.4 #include <netdb.h> 2.5 2.6 #define SMTP_BUF_LEN 1024 2.7 -#define SMTP_SIZE_ADD 1024 2.8 +#define SMTP_SIZE_ADD 1024 /* add to the size of a message */ 2.9 2.10 #define SMTP_INITIAL_TIMEOUT 5*60 2.11 #define SMTP_CMD_TIMEOUT 5*60