From ee39bc3e3cc2414ad9e6966abda8a571a6b48850 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Wed, 13 May 2009 12:08:21 +0300 Subject: Bugfixes. * doc/mailfromd.texi: Fix declaration of `uname' * mtasim/mtasim.c: Fix handling of header continuation. When sending headers and body to the milter, consistently use \r\n line terminators. --- doc/mailfromd.texi | 10 +--------- mtasim/mtasim.c | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index 090222eb..efb716cd 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi @@ -155,7 +155,6 @@ Tutorial * Sending Rate:: * Greylisting:: * Local Account Verification:: -* Examining mail contents:: * Databases:: * Testing Filter Scripts:: * Run Mode:: @@ -1152,7 +1151,6 @@ detailed discussion of the mail filtering language and * Sending Rate:: * Greylisting:: * Local Account Verification:: -* Examining mail contents:: * Databases:: * Testing Filter Scripts:: * Run Mode:: @@ -2461,12 +2459,6 @@ fi For more information about @code{dbmap} function, see @ref{dbmap}. For a description of @code{dbprop} pragma, see @ref{Database functions}. -@node Examining mail contents -@section Examining mail contents -@cindex Examining mail contents -@cindex mail contents, examining -@WRITEME{} - @node Databases @section Databases @@ -7801,7 +7793,7 @@ strftime('%Y-%m-%d %H:%M:%S %Z', 1164477564, 1) @end smallexample @end deftypefn -@deftypefn {Built-in Function} uname (string @var{format}) +@deftypefn {Built-in Function} string uname (string @var{format}) This function returns system information formatted according to the format specification @var{format}. Ordinary characters placed in the format string are copied to the output without conversion. diff --git a/mtasim/mtasim.c b/mtasim/mtasim.c index ac751d12..1c433a3b 100644 --- a/mtasim/mtasim.c +++ b/mtasim/mtasim.c @@ -1703,8 +1703,12 @@ process_header (struct obstack *stk, size_t header_size, while (*hv && c_isspace (*hv)) hv++; len = strlen (hv); - if (len > 0 && hv[len-1] == '\n') - hv[len - 1] = 0; + if (len > 0 && hv[len - 1] == '\n') + { + if (--len > 0 && hv[len - 1] == '\r') + len--; + hv[len] = 0; + } rc = gacopyz_srv_header(gsrv, hn, hv); status = process_data_reply ("cmd", "header", rc, state, reply); } @@ -2005,7 +2009,7 @@ smtp (void) if (header_size) { rc = process_header (&stk, header_size, &state, - &datareply); + &datareply); header_size = 0; if (rc) continue; @@ -2017,12 +2021,12 @@ smtp (void) body_buf.level = 0; state = STATE_DATA; } - else if (buf[0] == ' ' || buf[1] == '\t') + else if (buf[0] == ' ' || buf[0] == '\t') { if (gsrv) { - obstack_1grow (&stk, '\n'); - obstack_grow (&stk, buf, len); + obstack_grow (&stk, buf, len - 1); + obstack_grow (&stk, "\r\n", 2); header_size += len + 1; } } @@ -2056,8 +2060,9 @@ smtp (void) if (rc) continue; } - obstack_grow (&stk, buf, len); - header_size += len; + obstack_grow (&stk, buf, len - 1); + obstack_grow (&stk, "\r\n", 2); + header_size += len + 1; } break; @@ -2071,7 +2076,7 @@ smtp (void) rc = gacopyz_srv_eom (gsrv, body_buf.bufptr, body_buf.level); process_data_reply ("cmd", "eom", rc, &state, &datareply); /* FIXME: Clear macro table, except for the entries from - command line */ + the command line */ gacopyz_srv_clear_macros (gsrv); } if (datareply) -- cgit v1.2.1