From 7d5df1b80b43bfe60de33b0b62c992eea1d8d531 Mon Sep 17 00:00:00 2001 From: Dan Harkless Date: Fri, 21 Jul 2000 02:35:43 +0000 Subject: [PATCH] Applied Kurt J. Lidl 's $MAILHOST patch: I have a small patch that would be nice to be included -- basically, it allows the usage of the "MAILHOST" environment variable, without having to have HESIOD turned on. I need this functionality for my environment, where we have identical /usr/local on all my machines (so I cannot just hardcode into the mts.conf file), and I have multiple POP mail servers for my users. Modified inc.man to reflect that along with "pophost:" and -host, $MAILHOST can now activate POP mail inclusion as well. --- ChangeLog | 15 ++++++++++++++- man/inc.man | 11 ++++++----- uip/inc.c | 8 ++++---- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e741c7..971101e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Thu Jul 20 19:24:17 2000 Dan Harkless +Thu Jul 20 19:30:23 2000 Dan Harkless * Moved Kimmo's new "--with-hash-backup" to be output with the rest of the --with options in the configure --help output. Also, @@ -19,6 +19,19 @@ Thu Jul 20 19:24:17 2000 Dan Harkless overkill. You only need 3 steps, since configure.in is the only autoconf file with the RCS $Id keyword. + * Applied Kurt J. Lidl 's $MAILHOST patch: + + I have a small patch that would be nice to be included -- + basically, it allows the usage of the "MAILHOST" environment + variable, without having to have HESIOD turned on. I need + this functionality for my environment, where we have identical + /usr/local on all my machines (so I cannot just hardcode into + the mts.conf file), and I have multiple POP mail servers for + my users. + + Modified inc.man to reflect that along with "pophost:" and -host, + $MAILHOST can now activate POP mail inclusion as well. + Tue Jul 18 19:36:59 EDT 2000 Kimmo Suominen * Added the answer to Dan's question in README.developers. diff --git a/man/inc.man b/man/inc.man index fc53359..4a06a7f 100644 --- a/man/inc.man +++ b/man/inc.man @@ -116,11 +116,12 @@ and going on to other things. %nmhbeginpop% .Uh "Using POP" -\fIinc\fR will normally check local mail drops for mail, as given -above. But if the option \*(lqpophost:\*(rq is set in the mts -configuration file \*(lqmts.conf\*(rq, or if the `\-host\ hostname' -switch is given, then \fIinc\fR will query this POP service host -for mail to incorporate. +\fIinc\fR will normally check local mail drops for mail, as covered above. But +if the option \*(lqpophost:\*(rq is set in \*(lqmts.conf\*(rq, or if the +`\-host\ hostname' switch is given, or if the \fB$MAILHOST\fR environment +variable is set, then \fIinc\fR will query this POP service host for mail to +incorporate. If \fB$MAILHOST\fR is set and \-host is specified as well, the +commandline switch will override the environment variable. The default is for \fIinc\fR to assume that your account name on the POP server is the same as your current username. To specify diff --git a/uip/inc.c b/uip/inc.c index 9c8049a..e6adb32 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -245,6 +245,7 @@ main (int argc, char **argv) #ifdef POP int nmsgs, nbytes, p = 0; char *pass = NULL; + char *MAILHOST_env_variable; #endif #ifdef MHE @@ -253,7 +254,6 @@ main (int argc, char **argv) #ifdef HESIOD struct hes_postoffice *po; - char *tmphost; #endif /* absolutely the first thing we do is save our privileges, @@ -275,7 +275,6 @@ main (int argc, char **argv) argp = arguments; #ifdef POP -# ifdef HESIOD /* * Scheme is: * use MAILHOST environment variable if present, @@ -283,8 +282,9 @@ main (int argc, char **argv) * If that fails, use the default (if any) * provided by mts.conf in mts_init() */ - if ((tmphost = getenv("MAILHOST")) != NULL) - pophost = tmphost; + if ((MAILHOST_env_variable = getenv("MAILHOST")) != NULL) + pophost = MAILHOST_env_variable; +# ifdef HESIOD else if ((po = hes_getmailhost(getusername())) != NULL && strcmp(po->po_type, "POP") == 0) pophost = po->po_host; -- 1.7.10.4