aboutsummaryrefslogtreecommitdiffstats
path: root/fetchmail.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-11-17 16:29:23 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-11-17 16:29:23 +0000
commit0d956b2fa9e3dc4a72cfba11b8fb05de03100b82 (patch)
tree87c9c01220f38f9d69fe71a9ca95bd484f008404 /fetchmail.c
parentba3aa3131df992d170bff923186126845bdaa23b (diff)
downloadfetchmail-0d956b2fa9e3dc4a72cfba11b8fb05de03100b82.tar.gz
fetchmail-0d956b2fa9e3dc4a72cfba11b8fb05de03100b82.tar.bz2
fetchmail-0d956b2fa9e3dc4a72cfba11b8fb05de03100b82.zip
Gerald Britton's support for mixed Kerberos and Hesiod.
svn path=/trunk/; revision=2183
Diffstat (limited to 'fetchmail.c')
-rw-r--r--fetchmail.c24
1 files changed, 24 insertions, 0 deletions
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