*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);
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 */
}
}
+ /* 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
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)