diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2000-12-06 17:42:23 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2000-12-06 17:42:23 +0000 |
commit | 012d86a81392ac10183b2cc7abe7f06132fc30b6 (patch) | |
tree | dad070209f49b1cc1abbb59ee69eba7d14a6fecb | |
parent | 6da7693ce8c3391c5b7e1cf61edd89a4179961a8 (diff) | |
download | fetchmail-012d86a81392ac10183b2cc7abe7f06132fc30b6.tar.gz fetchmail-012d86a81392ac10183b2cc7abe7f06132fc30b6.tar.bz2 fetchmail-012d86a81392ac10183b2cc7abe7f06132fc30b6.zip |
Samuel Leo's LMTP enhancement.
svn path=/trunk/; revision=2995
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | fetchmail-features.html | 6 | ||||
-rw-r--r-- | fetchmail.man | 6 | ||||
-rw-r--r-- | sink.c | 8 | ||||
-rw-r--r-- | socket.c | 26 |
5 files changed, 43 insertions, 6 deletions
@@ -4,11 +4,12 @@ * More on ETRN in the FAQ. * Horst Klokow's patch to make interface check the remote IP address. -* Roger Luethi's patc to write the UIDL file when you hit a fetchlimit. +* Roger Luethi's patch to write the UIDL file when you hit a fetchlimit. * Don Beusee's patch to eliminate wedging on authentication failure. Instead, fetchmail will now notify the user on the third failure, then continue polling silently until service is restored (at which time the user will get a notification). +* Samuel Leo's patch to add LMTP capability to the smtphost option. ------------------------------------------------------------------------------ fetchmail-5.6.0 (Sun Nov 26 22:11:09 EST 2000), 19625 lines: diff --git a/fetchmail-features.html b/fetchmail-features.html index 474183b0..ae49ebef 100644 --- a/fetchmail-features.html +++ b/fetchmail-features.html @@ -10,7 +10,7 @@ <table width="100%" cellpadding=0><tr> <td width="30%">Back to <a href="index.html">Fetchmail Home Page</a> <td width="30%" align=center>To <a href="/~esr/sitemap.html">Site Map</a> -<td width="30%" align=right>$Date: 2000/12/01 09:47:53 $ +<td width="30%" align=right>$Date: 2000/12/06 17:42:20 $ </table> <HR> @@ -18,6 +18,8 @@ <H2>Since 5.0:</H2> <UL> +<LI>It's now easy to deliver mail to a local LMTP socket.<p> + <LI>The interface option now checks both local and remote interface IPs.<p> <LI> @@ -234,7 +236,7 @@ get-mail, gwpop, pimp-1.0, pop-perl5-1.2, popc, popmail-1.6 and upop.<P> <table width="100%" cellpadding=0><tr> <td width="30%">Back to <a href="index.html">Fetchmail Home Page</a> <td width="30%" align=center>To <a href="/~esr/sitemap.html">Site Map</a> -<td width="30%" align=right>$Date: 2000/12/01 09:47:53 $ +<td width="30%" align=right>$Date: 2000/12/06 17:42:20 $ </table> <P><ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS> diff --git a/fetchmail.man b/fetchmail.man index e7aead68..00faf901 100644 --- a/fetchmail.man +++ b/fetchmail.man @@ -316,9 +316,11 @@ preauthentication, the FQDN of the machine running fetchmail is added to the end of the list as an invisible default. Each hostname may have a port number following the host name. The port number is separated from the host name by a slash; the default port is 25 (or ``smtp'' under IPv6). -Example: +If you specify an absolute pathname (beginning with a /), it will be +interpreted as the name of a UNIX socket accepting LMTP connections +(such as is supported by the Cyrus IMAP daemon) Example: - --smtphost server1,server2/2525,server3 + --smtphost server1,server2/2525,server3,/var/imap/socket/lmtp .TP .B \-D <domain>, --smtpaddress <domain> @@ -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); @@ -18,6 +18,7 @@ #else #include <net/socket.h> #endif +#include <sys/un.h> #include <netinet/in.h> #ifdef HAVE_ARPA_INET_H #include <arpa/inet.h> @@ -188,6 +189,31 @@ int SockCheckOpen(int fd) } #endif /* __UNUSED__ */ +int UnixOpen(const char *path) +{ + int sock = -1; + struct sockaddr_un ad; + memset(&ad, 0, sizeof(ad)); + ad.sun_family = AF_UNIX; + strncpy(ad.sun_path, path, sizeof(ad.sun_path)-1); + + sock = socket( AF_UNIX, SOCK_STREAM, 0 ); + if (sock < 0) + { + h_errno = 0; + return -1; + } + if (connect(sock, (struct sockaddr *) &ad, sizeof(ad)) < 0) + { + int olderr = errno; + fm_close(sock); /* don't use SockClose, no traffic yet */ + h_errno = 0; + errno = olderr; + return -1; + } + return sock; +} + #if INET6_ENABLE int SockOpen(const char *host, const char *service, const char *options, const char *plugin) |