From e5bbb9eb9290dc44bb2499fa40d7b3eb1f0d1f2f Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 11 Aug 1997 20:03:53 +0000 Subject: Better exim support. svn path=/trunk/; revision=1262 --- NEWS | 3 ++- driver.c | 36 +++++++++++++++++++++++++----------- fetchmail-FAQ.html | 9 +++++---- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/NEWS b/NEWS index 3595719b..42bcad01 100644 --- a/NEWS +++ b/NEWS @@ -18,8 +18,9 @@ fetchmail-4.1.0 () * Enable parser to detect and complain about the most common syntax error. * More warnings about things that can go wrong with multidrop. * Dave Bodenstab's fix for flaky phone lines. +* Always pass FQDNs in RCPT TO addresses (avoids minor tsuris with exim). -There are 262 people on the fetchmail-friends list. +There are 263 people on the fetchmail-friends list. fetchmail-4.0.8 (Thu Aug 7 17:05:27 EDT 1997) * Fixed core dump bug in UID handling introduced by the 4.0.6 change. diff --git a/driver.c b/driver.c index 04d45414..4816ee34 100644 --- a/driver.c +++ b/driver.c @@ -862,7 +862,7 @@ int num; /* index of message */ } else { - char *ap, *ctt, options[MSGBUFSIZE]; + char *ap, *ctt, options[MSGBUFSIZE], addr[128]; /* build a connection to the SMTP listener */ if ((smtp_open(ctl) == -1)) @@ -984,14 +984,19 @@ int num; /* index of message */ * * RFC 1123 requires that the domain name part of the * RCPT TO address be "canonicalized", that is a FQDN - * or MX but not a CNAME. RFC1123 doesn't say whether - * the FQDN part can be null (as it frequently will be - * here), but it's hard to see how this could cause a - * problem. + * or MX but not a CNAME. Some listeners (like exim) + * enforce this. */ for (idp = xmit_names; idp; idp = idp->next) if (idp->val.num == XMIT_ACCEPT) - if (SMTP_rcpt(ctl->smtp_socket, idp->id) == SM_OK) + { +#ifdef HAVE_SNPRINTF + snprintf(addr, sizeof(addr)-1, "%s@%s", idp->id,fetchmailhost); +#else + sprintf(addr, "%s@%s", idp->id, ); +#endif /* HAVE_SNPRINTF */ + + if (SMTP_rcpt(ctl->smtp_socket, addr) == SM_OK) good_addresses++; else { @@ -1000,12 +1005,21 @@ int num; /* index of message */ error(0, 0, "SMTP listener doesn't like recipient address `%s'", idp->id); } - if (!good_addresses && SMTP_rcpt(ctl->smtp_socket, user) != SM_OK) + } + if (!good_addresses) { - error(0, 0, - "can't even send to calling user!"); - free(headers); - return(PS_SMTP); +#ifdef HAVE_SNPRINTF + snprintf(addr, sizeof(addr)-1, "%s@%s", idp->id, fetchmailhost); +#else + sprintf(addr, "%s@%s", idp->id, ); +#endif /* HAVE_SNPRINTF */ + + if (SMTP_rcpt(ctl->smtp_socket, user) != SM_OK) + { + error(0, 0, "can't even send to calling user!"); + free(headers); + return(PS_SMTP); + } } /* tell it we're ready to send data */ diff --git a/fetchmail-FAQ.html b/fetchmail-FAQ.html index 844ad20a..4d48e2a6 100644 --- a/fetchmail-FAQ.html +++ b/fetchmail-FAQ.html @@ -10,7 +10,7 @@
Back to Fetchmail Home Page To Site Map -$Date: 1997/08/10 19:00:48 $ +$Date: 1997/08/11 20:03:53 $

Frequently Asked Questions About Fetchmail

@@ -741,10 +741,11 @@ Note this does require a modern /bin/sh.

T2. How can I use fetchmail with exim?

By default, the exim listener enforces the the RFC1123 requirement -that MAIL FROM addresses you pass to it have to be canonical +that MAIL FROM and RCPT TO addresses you pass to it have to be canonical (e.g. with a fully qualified hostname part).

-This is a potential problem if the MTAs upstream from your fetchmail +Fetchmail always passes fully qualified RCPT TO addresses. But +MAIL FROM is a potential problem if the MTAs upstream from your fetchmail don't necessarily pass canonicalized From and Return-Path addresses, and fetchmail's rewrite option is off. The specific case where this has come up involves bounce messages generated by sendmail @@ -1233,7 +1234,7 @@ to solve the problem system-wide.

Back to Fetchmail Home Page To Site Map -$Date: 1997/08/10 19:00:48 $ +$Date: 1997/08/11 20:03:53 $

Eric S. Raymond <esr@snark.thyrsus.com>
-- cgit v1.2.3