aboutsummaryrefslogtreecommitdiffstats
path: root/sink.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2000-12-06 17:42:23 +0000
committerEric S. Raymond <esr@thyrsus.com>2000-12-06 17:42:23 +0000
commit012d86a81392ac10183b2cc7abe7f06132fc30b6 (patch)
treedad070209f49b1cc1abbb59ee69eba7d14a6fecb /sink.c
parent6da7693ce8c3391c5b7e1cf61edd89a4179961a8 (diff)
downloadfetchmail-012d86a81392ac10183b2cc7abe7f06132fc30b6.tar.gz
fetchmail-012d86a81392ac10183b2cc7abe7f06132fc30b6.tar.bz2
fetchmail-012d86a81392ac10183b2cc7abe7f06132fc30b6.zip
Samuel Leo's LMTP enhancement.
svn path=/trunk/; revision=2995
Diffstat (limited to 'sink.c')
-rw-r--r--sink.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sink.c b/sink.c
index b519e0d7..11df1871 100644
--- a/sink.c
+++ b/sink.c
@@ -104,6 +104,8 @@ static int smtp_open(struct query *ctl)
xalloca(parsed_host, char *, strlen(idp->id) + 1);
ctl->smtphost = idp->id; /* remember last host tried. */
+ if(ctl->smtphost[0]=='/')
+ ctl->listener = LMTP_MODE;
strcpy(parsed_host, idp->id);
if ((cp = strrchr(parsed_host, '/')))
@@ -116,6 +118,10 @@ static int smtp_open(struct query *ctl)
#endif /* INET6_ENABLE */
}
+ if (ctl->smtphost[0]=='/'){
+ if((ctl->smtp_socket = UnixOpen(ctl->smtphost))==-1)
+ continue;
+ } else
if ((ctl->smtp_socket = SockOpen(parsed_host,portnum,NULL,
ctl->server.plugout)) == -1)
continue;
@@ -159,7 +165,7 @@ static int smtp_open(struct query *ctl)
* enforce this. Now that we have the actual hostname,
* compute what we should canonicalize with.
*/
- ctl->destaddr = ctl->smtpaddress ? ctl->smtpaddress : ( ctl->smtphost ? ctl->smtphost : "localhost");
+ 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);