diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-11-17 16:29:23 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-11-17 16:29:23 +0000 |
commit | 0d956b2fa9e3dc4a72cfba11b8fb05de03100b82 (patch) | |
tree | 87c9c01220f38f9d69fe71a9ca95bd484f008404 | |
parent | ba3aa3131df992d170bff923186126845bdaa23b (diff) | |
download | fetchmail-0d956b2fa9e3dc4a72cfba11b8fb05de03100b82.tar.gz fetchmail-0d956b2fa9e3dc4a72cfba11b8fb05de03100b82.tar.bz2 fetchmail-0d956b2fa9e3dc4a72cfba11b8fb05de03100b82.zip |
Gerald Britton's support for mixed Kerberos and Hesiod.
svn path=/trunk/; revision=2183
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | configure.in | 107 | ||||
-rw-r--r-- | driver.c | 7 | ||||
-rw-r--r-- | fetchmail-features.html | 6 | ||||
-rw-r--r-- | fetchmail.c | 24 | ||||
-rw-r--r-- | fetchmail.man | 4 | ||||
-rw-r--r-- | imap.c | 5 | ||||
-rw-r--r-- | options.c | 6 |
8 files changed, 125 insertions, 37 deletions
@@ -1,5 +1,8 @@ Release Notes: +fetchmail-4.6.7 (): +* Gerald Britton's patches to enable Hesiod support. + fetchmail-4.6.6 (Sat Nov 7 17:27:04 EST 1998): * Fixed a core-dump bug in reply_hack with -v -v on. * Fix fetchmailconf to be able to edit properties. diff --git a/configure.in b/configure.in index 5ec3cdbc..817046e7 100644 --- a/configure.in +++ b/configure.in @@ -231,24 +231,31 @@ AC_ARG_ENABLE(netsec, exit 1]) ]) AC_DEFINE(NET_SECURITY, 1) ]) -### use option --with-gssapi=DIR to compile in GSSAPI support -AC_ARG_WITH(gssapi, - [ --with-gssapi[=DIR] compile in GSSAPI support using libraries in DIR], -[ -if test "$with_gssapi" != "no" +### use option --with-kerberos5=DIR to point at a Kerberos 5 directory +AC_ARG_WITH(kerberos5, + [ --with-kerberos5=DIR point fetchmail compilation at a Kerberos 5 directory]) + +# The "then" arm (nonempty $with_kerberos5) is kind of a crock. It works for +# configuring the BSD/OS Kerberos IV support, though. +if test -n "$with_kerberos5" then - if test "$with_gssapi" != "yes" -a -n "$with_gssapi" - then - CFLAGS="$CFLAGS -I$with_gssapi/include" - LDFLAGS="$LDFLAGS -L$with_gssapi/lib" - fi - AC_CHECK_LIB(krb5, krb5_init_context,, - AC_MSG_ERROR([could not find libkrb5 which is needed for GSSAPI support])) - AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context,, - AC_MSG_ERROR([could not find libgssapi_krb5 which is needed for GSSAPI support]), -lkrb5) - AC_DEFINE(GSSAPI) - LIBS="$LIBS -lgssapi_krb5 -lkrb5" -fi]) + # Path given + CEFLAGS="$CEFLAGS -DKERBEROS_V5 -I$with_kerberos5/include" + LDEFLAGS="$LDEFLAGS -L$with_kerberos5/lib" + LIBS="$LIBS -lkrb5 -lcrypto -lcom_err" +else + for dir in /usr/kerberos /usr/local/krb5 /usr/athena + do + if test -f "$dir/include/krb5.h" + then + CEFLAGS="$CEFLAGS -DKERBEROS_V5 -I$dir/include" + LDEFLAGS="$LDEFLAGS -L$dir/lib" + LIBS="$LIBS -lkrb5 -lcrypto -lcom_err" + with_kerberos5=$dir + break + fi + done +fi ### use option --with-kerberos=DIR to point at a Kerberos directory AC_ARG_WITH(kerberos, @@ -263,6 +270,23 @@ then echo "Configuring kerberosIV for NetBSD" CEFLAGS="$CEFLAGS -DKERBEROS_V4 -I/usr/include/kerberosIV" LIBS="$LIBS -lkrb -ldes" +elif test -n "$with_kerberos" -a -n "$with_kerberos5" +then + CEFLAGS="$CEFLAGS -DKERBEROS_V4 -I$with_kerberos/include" + LDEFLAGS="$LDEFLAGS -L$with_kerberos/lib" + LIBS="$LIBS -lkrb4" +elif test -n "$with_kerberos5" +then + for dir in /usr/kerberos /usr/kerberosIV /usr/athena + do + if test -f "$dir/include/kerberosIV/krb.h" + then + CEFLAGS="$CEFLAGS -DKERBEROS_V4 -I$dir/include" + LDEFLAGS="$LDEFLAGS -L$dir/lib" + LIBS="$LIBS -lkrb4" + break + fi + done elif test -n "$with_kerberos" then CEFLAGS="$CEFLAGS -DKERBEROS_V4 -I$with_kerberos/include" @@ -281,31 +305,54 @@ else done fi -### use option --with-kerberos5=DIR to point at a Kerberos 5 directory -AC_ARG_WITH(kerberos5, - [ --with-kerberos5=DIR point fetchmail compilation at a Kerberos 5 directory]) +### use option --with-hesiod=DIR to point at a HESIOD directory +AC_ARG_WITH(hesiod, + [ --with-hesiod=DIR point fetchmail compilation at a HESIOD directory]) -# The "then" arm (nonempty $with_kerberos5) is kind of a crock. It works for -# configuring the BSD/OS Kerberos IV support, though. -if test -n "$with_kerberos5" +if test -n "$with_hesiod" then # Path given - CEFLAGS="$CEFLAGS -DKERBEROS_V5 -I$with_kerberos5/include" - LDEFLAGS="$LDEFLAGS -L$with_kerberos5/lib" - LIBS="$LIBS -lkrb5 -lcrypto -lcom_err" + CEFLAGS="$CEFLAGS -DHESIOD -I$with_hesiod/include" + LDEFLAGS="$LDEFLAGS -L$with_hesiod/lib" + LIBS="$LIBS -lhesiod" else - for dir in /usr/kerberos /usr/local/krb5 /usr/athena + for dir in /usr/athena /usr /usr/local do - if test -f "$dir/include/krb5.h" + if test -f "$dir/include/hesiod.h" then - CEFLAGS="$CEFLAGS -DKERBEROS_V5 -I$dir/include" + CEFLAGS="$CEFLAGS -DHESIOD -I$dir/include" LDEFLAGS="$LDEFLAGS -L$dir/lib" - LIBS="$LIBS -lkrb5 -lcrypto -lcom_err" + LIBS="$LIBS -lhesiod" + with_hesiod=$dir break fi done fi +### use option --with-gssapi=DIR to compile in GSSAPI support +AC_ARG_WITH(gssapi, + [ --with-gssapi[=DIR] compile in GSSAPI support using libraries in DIR], +[ +if test "$with_gssapi" != "no" +then + if test "$with_gssapi" = "yes" -a -n "$with_kerberos5" + then + with_gssapi=$with_kerberos5 + fi + if test "$with_gssapi" != "yes" -a -n "$with_gssapi" + then + CFLAGS="$CFLAGS -I$with_gssapi/include" + LDFLAGS="$LDFLAGS -L$with_gssapi/lib" + fi + + AC_CHECK_LIB(krb5, krb5_init_context,, + AC_MSG_ERROR([could not find libkrb5 which is needed for GSSAPI support])) + AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context,, + AC_MSG_ERROR([could not find libgssapi_krb5 which is needed for GSSAPI support]), -lkrb5) + AC_DEFINE(GSSAPI) + LIBS="$LIBS -lgssapi_krb5 -lkrb5" +fi]) + AC_OUTPUT(Makefile, [ # The reason for this odd makedepend line is that we want # to have all dependencies evaluated relative to the source directory @@ -37,6 +37,10 @@ #endif /* HAVE_RES_SEARCH */ #ifdef KERBEROS_V4 +#ifdef KERBEROS_V5 +#include <kerberosIV/des.h> +#include <kerberosIV/krb.h> +#else #if defined (__bsdi__) #include <des.h> /* order of includes matters */ #include <krb.h> @@ -51,6 +55,7 @@ #include <des.h> #endif /* ! defined (__FreeBSD__) */ #endif /* ! defined (__bsdi__) */ +#endif /* KERBEROS_V5 */ #include <netinet/in.h> #include <netdb.h> #endif /* KERBEROS_V4 */ @@ -596,7 +601,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl, app_from_offs = (line - msg.headers); else if (!strncasecmp("Sender:", line, 7)) sender_offs = (line - msg.headers); - else if (!strncasecmp("Resent_Sender:", line, 14)) + else if (!strncasecmp("Resent-Sender:", line, 14)) resent_sender_offs = (line - msg.headers); else if (!strncasecmp("Message-Id:", buf, 11)) diff --git a/fetchmail-features.html b/fetchmail-features.html index fb8ebeb6..1bed085b 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: 1998/10/30 03:51:49 $ +<td width="30%" align=right>$Date: 1998/11/17 16:29:22 $ </table> <HR> @@ -18,6 +18,8 @@ <H2>Since 4.0:</H2> <UL> +<LI> Support for use of HESIOD with Kerberos. + <LI> The -bsmtp option supports recording fetched mail as a BSMTP batch. <LI> The --limit option can now be used in daemon mode, with oversized-message @@ -157,7 +159,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: 1998/10/30 03:51:49 $ +<td width="30%" align=right>$Date: 1998/11/17 16:29:22 $ </table> <P><ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS> diff --git a/fetchmail.c b/fetchmail.c index be0818b9..e38273fe 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -34,6 +34,10 @@ #include <netdb.h> #endif /* HAVE_GETHOSTBYNAME */ +#ifdef HESIOD +#include <hesiod.h> +#endif + #include "fetchmail.h" #include "tunable.h" #include "smtp.h" @@ -966,6 +970,26 @@ static int load_params(int argc, char **argv, int optind) else ctl->server.queryname = xstrdup(ctl->server.pollname); +#ifdef HESIOD + /* If either the pollname or vianame are "hesiod" we want to + lookup the user's hesiod pobox host */ + + if (!strcasecmp(ctl->server.queryname, "hesiod")) { + struct hes_postoffice *hes_p; + hes_p = hes_getmailhost(ctl->remotename); + if (hes_p != NULL && strcmp(hes_p->po_type, "POP") == 0) { + free(ctl->server.queryname); + ctl->server.queryname = xstrdup(hes_p->po_host); + if (ctl->server.via) + free(ctl->server.via); + ctl->server.via = xstrdup(hes_p->po_host); + } else { + error(0, errno, "couldn't find HESIOD pobox for %s", + ctl->remotename); + } + } +#endif /* HESIOD */ + /* * We may have to canonicalize the server truename for later use. * Do this just once for each lead server, if necessary, in order diff --git a/fetchmail.man b/fetchmail.man index 7e33b5c6..a0565145 100644 --- a/fetchmail.man +++ b/fetchmail.man @@ -591,7 +591,9 @@ checking its authorization database. If your \fIfetchmail\fR was built with Kerberos support and you specify Kerberos preauthentication (either with --auth or the \fI.fetchmailrc\fR option \fBauthenticate kerberos_v4\fR) it will try to get a Kerberos -ticket from the mailserver at the start of each query. +ticket from the mailserver at the start of each query. Note: if +either the pollnane or via name is `hesiod', fetchmail will try to use +Hesiod to look up the mailserver. .PP If you use IMAP-K4, \fIfetchmail\fR will expect the IMAP server to have RFC1731-conformant AUTHENTICATE KERBEROS_V4 capability, and will use it. @@ -16,6 +16,10 @@ #include "socket.h" #ifdef KERBEROS_V4 +#ifdef KERBEROS_V5 +#include <kerberosIV/des.h> +#include <kerberosIV/krb.h> +#else #if defined (__bsdi__) #include <des.h> #define krb_get_err_text(e) (krb_err_txt[e]) @@ -24,6 +28,7 @@ #define krb_get_err_text(e) (krb_err_txt[e]) #endif #include <krb.h> +#endif #endif /* KERBEROS_V4 */ #ifdef GSSAPI @@ -363,13 +363,13 @@ struct query *ctl; /* option record to be initialized */ else if (strcmp(optarg, "kerberos") == 0) #ifdef KERBEROS_V5 ctl->server.preauthenticate = A_KERBEROS_V5; - else if (strcmp(optarg, "kerberos_v5") == 0) - ctl->server.preauthenticate = A_KERBEROS_V5; #else ctl->server.preauthenticate = A_KERBEROS_V4; +#endif /* KERBEROS_V5 */ + else if (strcmp(optarg, "kerberos_v5") == 0) + ctl->server.preauthenticate = A_KERBEROS_V5; else if (strcmp(optarg, "kerberos_v4") == 0) ctl->server.preauthenticate = A_KERBEROS_V4; -#endif /* KERBEROS_V5 */ else { fprintf(stderr,"Invalid preauthentication `%s' specified.\n", optarg); errflag++; |