From 563b31d0fdc97c1abc70a570a7c3f9733c4ef1b6 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 13 Feb 1997 04:40:28 +0000 Subject: Allow the smtphost option to set the host queried for by ETRN. svn path=/trunk/; revision=875 --- NEWS | 7 +++++++ etrn.c | 2 +- fetchmail.c | 10 +++++++--- fetchmail.man | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index e71af0cc..509e37f9 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,12 @@ Release Notes: +------------------------------------------------------------------------------ +fetchmail-3.5 () + +features -- + +* The host that ETRN specifies is now set by the smtphost option. + ------------------------------------------------------------------------------ fetchmail-3.4 (Wed Feb 12 19:23:06 EST 1997) diff --git a/etrn.c b/etrn.c index e791f4fc..dc8990a2 100644 --- a/etrn.c +++ b/etrn.c @@ -45,7 +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 */ - gen_send(sockfp, "ETRN %s", fetchmailhost); + gen_send(sockfp, "ETRN %s", ctl->smtphost); if (ok = gen_recv(sockfp, buf, sizeof(buf))) return(ok); diff --git a/fetchmail.c b/fetchmail.c index 20c9cc45..702e2a67 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -116,8 +116,12 @@ int main (int argc, char **argv) } } - /* we'll need this for error messages */ - gethostname(tmpbuf, sizeof(tmpbuf)); + /* we'll need this for the SMTP forwarding target and error messages */ + if (gethostname(tmpbuf, sizeof(tmpbuf))) + { + fprintf(stderr, "fetchmail: can't determine fetchmail's host!"); + exit(PS_IOERR); + } fetchmailhost = xstrdup(tmpbuf); /* @@ -518,7 +522,7 @@ static int load_params(int argc, char **argv, int optind) def_opts.server.protocol = P_AUTO; def_opts.server.timeout = CLIENT_TIMEOUT; def_opts.remotename = user; - def_opts.smtphost = "localhost"; + def_opts.smtphost = fetchmailhost; /* this builds the host list */ if (prc_parse_file(rcfile) != 0) diff --git a/fetchmail.man b/fetchmail.man index 788b3ebb..549fdfba 100644 --- a/fetchmail.man +++ b/fetchmail.man @@ -167,6 +167,7 @@ under POP3 or ETRN. .TP .B \-S host, --smtphost host Specify a host to forward mail to (other than localhost). +In ETRN mode, set the host that the mailserver is asked to ship mail to. .TP .B \-m, \--mda You can force mail to be passed to an MDA directly (rather than -- cgit v1.2.3