aboutsummaryrefslogtreecommitdiffstats
path: root/sink.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-09-23 09:25:31 +0000
committerEric S. Raymond <esr@thyrsus.com>2001-09-23 09:25:31 +0000
commite631821f9a2843185e64c07c2b3e9f8919c0edf8 (patch)
tree2cde450273f38395ff582bfbc4ecbdbf383beef4 /sink.c
parent85a28511dba564f987dfdf46310e18cb97f3c978 (diff)
downloadfetchmail-e631821f9a2843185e64c07c2b3e9f8919c0edf8.tar.gz
fetchmail-e631821f9a2843185e64c07c2b3e9f8919c0edf8.tar.bz2
fetchmail-e631821f9a2843185e64c07c2b3e9f8919c0edf8.zip
LMTP problem has been solved.
svn path=/trunk/; revision=3470
Diffstat (limited to 'sink.c')
-rw-r--r--sink.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/sink.c b/sink.c
index 4fec6cb5..aab220e6 100644
--- a/sink.c
+++ b/sink.c
@@ -49,6 +49,8 @@ static int lmtp_responses;
int smtp_open(struct query *ctl)
/* try to open a socket to the appropriate SMTP server for this query */
{
+ char *parsed_host = NULL;
+
/* maybe it's time to close the socket in order to force delivery */
if (NUM_NONZERO(ctl->batchlimit) && (ctl->smtp_socket != -1) && ++batchcount == ctl->batchlimit)
{
@@ -95,7 +97,7 @@ int smtp_open(struct query *ctl)
set_timeout(ctl->server.timeout);
for (idp = ctl->smtphunt; idp; idp = idp->next)
{
- char *cp, *parsed_host;
+ char *cp;
#ifdef INET6_ENABLE
char *portnum = SMTP_PORT;
#else
@@ -169,8 +171,19 @@ int smtp_open(struct query *ctl)
* or MX but not a CNAME. Some listeners (like exim)
* enforce this. Now that we have the actual hostname,
* compute what we should canonicalize with.
+ *
+ * make sure we do not forget to drop the /port if
+ * using LMTP (hmh)
*/
- ctl->destaddr = ctl->smtpaddress ? ctl->smtpaddress : ( ctl->smtphost && ctl->smtphost[0] != '/' ? ctl->smtphost : "localhost");
+ if (ctl->listener == LMTP_MODE && !ctl->smtpaddress)
+ {
+ if (parsed_host && parsed_host[0] != 0)
+ ctl->destaddr = xstrdup(parsed_host);
+ else
+ ctl->destaddr = (ctl->smtphost && ctl->smtphost[0] != '/') ? ctl->smtphost : "localhost";
+ }
+ else
+ ctl->destaddr = ctl->smtpaddress ? ctl->smtpaddress : ( ctl->smtphost && ctl->smtphost[0] != '/' ? ctl->smtphost : "localhost");
if (outlevel >= O_DEBUG && ctl->smtp_socket != -1)
report(stdout, _("forwarding to %s\n"), ctl->smtphost);
@@ -695,8 +708,6 @@ int open_sink(struct query *ctl, struct msgblk *msg,
(*good_addresses)++;
else
{
- char errbuf[POPBUFSIZE];
-
handle_smtp_report(ctl, msg);
(*bad_addresses)++;