aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-05-13 12:08:21 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-05-13 13:36:16 +0300
commitee39bc3e3cc2414ad9e6966abda8a571a6b48850 (patch)
treedaa5dd0bfa5389ae5aa4b9f07f650e308e40d8aa
parent083da60323640dbc1072a91bd47f2aebbdea4124 (diff)
downloadmailfromd-ee39bc3e3cc2414ad9e6966abda8a571a6b48850.tar.gz
mailfromd-ee39bc3e3cc2414ad9e6966abda8a571a6b48850.tar.bz2
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.
-rw-r--r--doc/mailfromd.texi10
-rw-r--r--mtasim/mtasim.c23
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
@@ -152,13 +152,12 @@ Tutorial
* Avoiding Verification Loops::
* HELO Domain::
* Controlling Number of Recipients::
* Sending Rate::
* Greylisting::
* Local Account Verification::
-* Examining mail contents::
* Databases::
* Testing Filter Scripts::
* Run Mode::
* Logging and Debugging::
* Runtime errors::
* Cautions::
@@ -1149,13 +1148,12 @@ detailed discussion of the mail filtering language and
* Avoiding Verification Loops::
* HELO Domain::
* Controlling Number of Recipients::
* Sending Rate::
* Greylisting::
* Local Account Verification::
-* Examining mail contents::
* Databases::
* Testing Filter Scripts::
* Run Mode::
* Logging and Debugging::
* Runtime errors::
* Cautions::
@@ -2458,18 +2456,12 @@ fi
@end group
@end smallexample
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
Some @command{mailfromd} functions use @acronym{DBM} databases to save their
persistent state data. Each database has a unique @dfn{identifier},
and is assigned several pieces of information for its maintenance: the
@@ -7798,13 +7790,13 @@ strftime('%Y-%m-%d %H:%M:%S %Z', 1164477564)
strftime('%Y-%m-%d %H:%M:%S %Z', 1164477564, 1)
@result{} 2006-11-25 17:59:24 GMT
@end group
@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.
Conversion specifiers are introduced by a @samp{%} character.
The following conversions are defined:
diff --git a/mtasim/mtasim.c b/mtasim/mtasim.c
index ac751d12..1c433a3b 100644
--- a/mtasim/mtasim.c
+++ b/mtasim/mtasim.c
@@ -1700,14 +1700,18 @@ process_header (struct obstack *stk, size_t header_size,
int rc, len;
*hv++ = 0;
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);
}
obstack_free (stk, hn);
return status;
}
@@ -2002,30 +2006,30 @@ smtp (void)
{
int rc;
if (header_size)
{
rc = process_header (&stk, header_size, &state,
- &datareply);
+ &datareply);
header_size = 0;
if (rc)
continue;
}
rc = gacopyz_srv_eoh (gsrv);
if (process_data_reply ("cmd", "eoh", rc, &state, &datareply))
continue;
}
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;
}
}
else if (strcmp (buf, ".") == 0)
{
if (gsrv)
@@ -2053,14 +2057,15 @@ smtp (void)
int rc = process_header (&stk, header_size, &state,
&datareply);
header_size = 0;
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;
case STATE_DATA:
if (strcmp (buf, ".\n") == 0)
{
@@ -2068,13 +2073,13 @@ smtp (void)
{
int rc;
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)
{
smtp_send_string (datareply, 0);
free (datareply);

Return to:

Send suggestions and report system problems to the System administrator.