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 --- fetchmail.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'fetchmail.c') 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) -- cgit v1.2.3