diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-02-13 04:40:28 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-02-13 04:40:28 +0000 |
commit | 563b31d0fdc97c1abc70a570a7c3f9733c4ef1b6 (patch) | |
tree | c51854eb2fe5d6782f8cc19152da5f600bfc6cca /fetchmail.c | |
parent | 62956ac9f03d14a812455af8b4c80dd5f9a57914 (diff) | |
download | fetchmail-563b31d0fdc97c1abc70a570a7c3f9733c4ef1b6.tar.gz fetchmail-563b31d0fdc97c1abc70a570a7c3f9733c4ef1b6.tar.bz2 fetchmail-563b31d0fdc97c1abc70a570a7c3f9733c4ef1b6.zip |
Allow the smtphost option to set the host queried for by ETRN.
svn path=/trunk/; revision=875
Diffstat (limited to 'fetchmail.c')
-rw-r--r-- | fetchmail.c | 10 |
1 files changed, 7 insertions, 3 deletions
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) |