From c67d7d47af6838d0df89fa5072d6c1248eadf29d Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 18 Feb 2014 13:14:03 +0100 Subject: get rid of DNS ANY query UltraDNS started blocking UDP-ANY queries so this is a problem. This will disable domain canonicalization of the envelope address of outgoing messages. This is as specified by RFC 1123 section 5.2.2. However this requirement is obsolete and modern MTAs have disabled it too. --- qmail-remote.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/qmail-remote.c b/qmail-remote.c index 49bd5c4..be997f0 100644 --- a/qmail-remote.c +++ b/qmail-remote.c @@ -798,19 +798,14 @@ void qmtp() zerodie(); } -stralloc canonhost = {0}; stralloc canonbox = {0}; -void addrmangle(saout,s,flagalias,flagcname) +void addrmangle(saout,s) stralloc *saout; /* host has to be canonical, box has to be quoted */ char *s; -int *flagalias; -int flagcname; { int j; - *flagalias = flagcname; - j = str_rchr(s,'@'); if (!s[j]) { if (!stralloc_copys(saout,s)) temp_nomem(); @@ -820,17 +815,7 @@ int flagcname; canonbox.len = j; if (!quote(saout,&canonbox)) temp_nomem(); if (!stralloc_cats(saout,"@")) temp_nomem(); - - if (!stralloc_copys(&canonhost,s + j + 1)) temp_nomem(); - if (flagcname) - switch(dns_cname(&canonhost)) { - case 0: *flagalias = 0; break; - case DNS_MEM: temp_nomem(); - case DNS_SOFT: temp_dnscanon(); - case DNS_HARD: ; /* alias loop, not our problem */ - } - - if (!stralloc_cat(saout,&canonhost)) temp_nomem(); + if (!stralloc_cats(saout,s + j + 1)) temp_nomem(); } void getcontrols() @@ -860,8 +845,6 @@ char **argv; unsigned long random; char **recips; unsigned long prefme; - int flagallaliases; - int flagalias; char *relayhost; sig_pipeignore(); @@ -902,18 +885,16 @@ char **argv; } - addrmangle(&sender,argv[2],&flagalias,0); + addrmangle(&sender,argv[2]); if (!saa_readyplus(&reciplist,0)) temp_nomem(); if (ipme_init() != 1) temp_oserr(); - flagallaliases = 1; recips = argv + 3; while (*recips) { if (!saa_readyplus(&reciplist,1)) temp_nomem(); reciplist.sa[reciplist.len] = sauninit; - addrmangle(reciplist.sa + reciplist.len,*recips,&flagalias,!relayhost); - if (!flagalias) flagallaliases = 0; + addrmangle(reciplist.sa + reciplist.len,*recips); ++reciplist.len; ++recips; } @@ -937,7 +918,6 @@ char **argv; prefme = ip.ix[i].pref; if (relayhost) prefme = 300000; - if (flagallaliases) prefme = 500000; for (i = 0;i < ip.len;++i) if (ip.ix[i].pref < prefme) -- cgit v1.2.3