aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-02-13 01:19:04 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-02-13 01:19:04 +0000
commit2738a6c6de1c4d894c9d97688bd96db32d7dc71d (patch)
treef70d7085c722ae644bf0ef406d8a8f3298ea0d53
parentf87ddcebc141c1db8086227fe0b141aba9837bb5 (diff)
downloadfetchmail-2738a6c6de1c4d894c9d97688bd96db32d7dc71d.tar.gz
fetchmail-2738a6c6de1c4d894c9d97688bd96db32d7dc71d.tar.bz2
fetchmail-2738a6c6de1c4d894c9d97688bd96db32d7dc71d.zip
Ready for 3-4.
svn path=/trunk/; revision=872
-rw-r--r--etrn.c3
-rw-r--r--fetchmail.c5
-rw-r--r--fetchmail.h1
3 files changed, 7 insertions, 2 deletions
diff --git a/etrn.c b/etrn.c
index e7845819..e791f4fc 100644
--- a/etrn.c
+++ b/etrn.c
@@ -45,8 +45,7 @@ static int etrn_getrange(FILE *sockfp, struct query *ctl, int*countp, int*newp)
*countp = *newp = -1; /* make sure we don't enter the fetch loop */
/* ship the actual poll and get the response */
- gethostbyname(buf, sizeof(buf));
- gen_send(sockfp, "ETRN %s", buf);
+ gen_send(sockfp, "ETRN %s", fetchmailhost);
if (ok = gen_recv(sockfp, buf, sizeof(buf)))
return(ok);
diff --git a/fetchmail.c b/fetchmail.c
index 1caf1d98..20c9cc45 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -65,6 +65,7 @@ char *rcfile; /* path name of rc file */
char *idfile; /* UID list file */
int versioninfo; /* emit only version info */
char *user; /* the name of the invoking user */
+char *fetchmailhost; /* the name of the host running fetchmail */
char *program_name; /* the name to prefix error messages with */
static char *lockfile; /* name of lockfile */
@@ -115,6 +116,10 @@ int main (int argc, char **argv)
}
}
+ /* we'll need this for error messages */
+ gethostname(tmpbuf, sizeof(tmpbuf));
+ fetchmailhost = xstrdup(tmpbuf);
+
/*
* Backward-compatibility hack. If we're called by the name of the
* ancestral popclient, look for .poprc. This will actually work
diff --git a/fetchmail.h b/fetchmail.h
index baba9198..7ee72a2f 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -178,6 +178,7 @@ extern char *idfile; /* path name of UID file */
extern int linelimit; /* limit # lines retrieved per site */
extern int versioninfo; /* emit only version info */
extern char *user; /* name of invoking user */
+extern char *fetchmailhost; /* the name of the host running fetchmail */
/* prototypes for globally callable functions */
#if defined(HAVE_STDARG_H)