aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/driver.c b/driver.c
index 9f2a8915..50974746 100644
--- a/driver.c
+++ b/driver.c
@@ -28,6 +28,9 @@
#ifdef HAVE_NET_SOCKET_H
#include <net/socket.h>
#endif
+#ifdef HESIOD
+#include <hesiod.h>
+#endif
#ifdef HAVE_RES_SEARCH
#include <netdb.h>
@@ -806,6 +809,26 @@ const int maxfetch; /* maximum number of messages to fetch */
#endif
#endif /* !INET6_ENABLE */
+#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 {
+ report(stderr,
+ GT_("couldn't find HESIOD pobox for %s\n"),
+ ctl->remotename);
+ }
+ }
+#endif /* HESIOD */
+
#ifdef HAVE_GETHOSTBYNAME
/*
* Canonicalize the server truename for later use. This also