Commit b2ea3c71 authored by Sam Varshavchik's avatar Sam Varshavchik

8-bit clean SPF headers.

parent d68efd3b
2019-07-30 Sam Varshavchik <mrsam@courier-mta.com>
* courier/submit.C (my_spf_lookup): Convert hostnames and addresses
in the Received-SPF: header from UTF-8 to ACE.
* rfc1035/spf.c (get_macro): When expanding macros in SPF messages
convert UTF-8 domains to ACE.
2019-07-21 Sam Varshavchik <mrsam@courier-mta.com>
* courier/module.esmtp/esmtp.c (isindomaindb): use ualllower instead
......
......@@ -5,7 +5,7 @@ dnl distribution information.
AC_PREREQ(2.59)
AC_INIT(courier, 1.0.8.20190721, [courier-users@lists.sourceforge.net])
AC_INIT(courier, 1.0.8.20190728, [courier-users@lists.sourceforge.net])
version=$PACKAGE_VERSION
AC_CONFIG_SRCDIR(courier/courier.c)
AM_INIT_AUTOMAKE
......
......@@ -710,7 +710,21 @@ static const char *my_spf_lookup(const char *checkname,
for (i=0; i<sizeof(values)/sizeof(values[0]); i++)
{
char *v=strdup(values[i] ? values[i]:"");
const char *c=values[i] ? values[i]:"";
char *v;
switch (i) {
case 0:
v=udomainace(c);
break;
case 1:
v=strdup(c);
break;
default:
if (idna_to_ascii_8z(c, &v, 0) != IDNA_SUCCESS)
v=strdup(c);
}
for (q=v; q && *q; q++)
if (*q < ' ' || *q >= 127)
......@@ -722,6 +736,9 @@ static const char *my_spf_lookup(const char *checkname,
(*hdrOut) += "=";
(*hdrOut) += v ? v:strerror(errno);
(*hdrOut) += ";\n";
if (v)
free(v);
}
return str;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment