X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=sink.c;h=5e9bef9864eb80f6ae3bac880a33b582be8a1e55;hb=98cfcef26048bba06975e68a1aad05a8bac0d65d;hp=8da89f4d22bfef75818deddc8a741db198f764eb;hpb=aa404982fe7cb8339247fc104e99b05dbca47204;p=~andy%2Ffetchmail diff --git a/sink.c b/sink.c index 8da89f4d..5e9bef98 100644 --- a/sink.c +++ b/sink.c @@ -116,12 +116,12 @@ int smtp_setup(struct query *ctl) oldphase = phase; phase = LISTENER_WAIT; + set_timeout(ctl->server.timeout); for (idp = ctl->smtphunt; idp; idp = idp->next) { char *cp; const char *portnum = SMTP_PORT; - set_timeout(ctl->server.timeout); ctl->smtphost = idp->id; /* remember last host tried. */ if (ctl->smtphost[0]=='/') { @@ -169,7 +169,6 @@ int smtp_setup(struct query *ctl) * so it's safest not to assume the socket will still be good. */ smtp_close(ctl, 0); - set_timeout(ctl->server.timeout); /* if opening for ESMTP failed, try SMTP */ if (ctl->smtphost[0]=='/') @@ -1151,6 +1150,16 @@ static int open_mda_sink(struct query *ctl, struct msgblk *msg, for (dp = after, sp = before; (*dp = *sp); dp++, sp++) { if (sp[0] != '%') continue; + if (sp > before && sp[-1] == '\'') { + report(stderr, GT_("MDA option contains single-quoted %%%c expansion.\n"), sp[1]); + report(stderr, GT_("Refusing to deliver. Check the manual and fix your mda option.\n")); + free(before); + free(after); + if (from) free(from); + if (names) free(names); + return PS_SYNTAX; + } + /* need to expand? BTW, no here overflow, because in ** the worst case (end of string) sp[1] == '\0' */ if (sp[1] == 's' || sp[1] == 'T') {