diff options
-rw-r--r-- | env.c | 10 | ||||
-rw-r--r-- | fetchmail-FAQ.html | 20 | ||||
-rw-r--r-- | fetchmail.c | 15 | ||||
-rwxr-xr-x | fetchmailconf | 3 | ||||
-rw-r--r-- | lock.c | 2 | ||||
-rw-r--r-- | sink.c | 28 |
6 files changed, 41 insertions, 37 deletions
@@ -41,9 +41,13 @@ void envquery(int argc, char **argv) { struct passwd by_name, by_uid, *pwp; - (user = getenv("FETCHMAILUSER")) - || (user = getenv("LOGNAME")) - || (user = getenv("USER")); + if (!(user = getenv("FETCHMAILUSER"))) + { + if (!(user = getenv("LOGNAME"))) + { + user = getenv("USER"); + } + } if (!(pwp = getpwuid(getuid()))) { diff --git a/fetchmail-FAQ.html b/fetchmail-FAQ.html index a002fe22..fb66cac3 100644 --- a/fetchmail-FAQ.html +++ b/fetchmail-FAQ.html @@ -10,7 +10,7 @@ <table width="100%" cellpadding=0><tr> <td width="30%">Back to <a href="index.html">Fetchmail Home Page</a> <td width="30%" align=center>To <a href="/~esr/sitemap.html">Site Map</a> -<td width="30%" align=right>$Date: 2001/07/07 17:05:56 $ +<td width="30%" align=right>$Date: 2001/07/25 07:18:36 $ </table> <HR> <H1>Frequently Asked Questions About Fetchmail</H1> @@ -705,6 +705,22 @@ make: *** [fetchmail] Error 1 then you must add "-lresolv" to the LOADLIBS line in your Makefile once you have installed the `bind' package. +If you get link errors involving <tt>dcgettext</tt>, like this: + +<pre> +rcfile_y.o: In function `yyparse': +rcfile_y.o(.text+0x3aa): undefined reference to `dcgettext__' +rcfile_y.o(.text+0x4f2): undefined reference to `dcgettext__' +rcfile_y.o(.text+0x5ee): undefined reference to `dcgettext__' +rcfile_y.o: In function `yyerror': +rcfile_y.o(.text+0xc7c): undefined reference to `dcgettext__' +rcfile_y.o(.text+0xcc8): undefined reference to `dcgettext__' +rcfile_y.o(.text+0xdf9): more undefined references to `dcgettext__' follow +</pre> + +reconfigure with <tt>configure --with-included-gettext</tt>. This is +due to some brain-damage + <hr> <h2><a name="F1">F1. Why does my old .fetchmailrc file no longer work?</a></h2> @@ -2864,7 +2880,7 @@ date from the last Received header.<p> <table width="100%" cellpadding=0><tr> <td width="30%">Back to <a href="index.html">Fetchmail Home Page</a> <td width="30%" align=center>To <a href="/~esr/sitemap.html">Site Map</a> -<td width="30%" align=right>$Date: 2001/07/07 17:05:56 $ +<td width="30%" align=right>$Date: 2001/07/25 07:18:36 $ </table> <ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@thyrsus.com></A></ADDRESS> diff --git a/fetchmail.c b/fetchmail.c index 5b8c28ea..cba2c678 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -1322,12 +1322,10 @@ static void terminate_poll(int sig) for (ctl = querylist; ctl; ctl = ctl->next) if (ctl->smtp_socket != -1) { - /* - * Don't send QUIT for ODMR case because we're acting - * as a proxy between the SMTP server and client. - */ - if (ctl->server.protocol != P_ODMR) - SMTP_quit(ctl->smtp_socket); + /* don't send QUIT for ODMR case because we're acting + as a proxy between the SMTP server and client. */ + if (ctl->server.protocol != P_ODMR) + SMTP_quit(ctl->smtp_socket); SockClose(ctl->smtp_socket); ctl->smtp_socket = -1; } @@ -1395,7 +1393,7 @@ static const int autoprobe[] = static int query_host(struct query *ctl) /* perform fetch transaction with single host */ { - int i, st; + int i, st = 0; /* * If we're syslogging the progress messages are automatically timestamped. @@ -1414,7 +1412,8 @@ static int query_host(struct query *ctl) for (i = 0; i < sizeof(autoprobe)/sizeof(autoprobe[0]); i++) { ctl->server.protocol = autoprobe[i]; - if ((st = query_host(ctl)) == PS_SUCCESS || st == PS_NOMAIL || st == PS_AUTHFAIL || st == PS_LOCKBUSY || st == PS_SMTP || st == PS_MAXFETCH) + st = query_host(ctl); + if (st == PS_SUCCESS || st == PS_NOMAIL || st == PS_AUTHFAIL || st == PS_LOCKBUSY || st == PS_SMTP || st == PS_MAXFETCH) break; } ctl->server.protocol = P_AUTO; diff --git a/fetchmailconf b/fetchmailconf index 60043f05..d2c9bafd 100755 --- a/fetchmailconf +++ b/fetchmailconf @@ -219,7 +219,7 @@ class User: self.password = None # Password for mail account access self.mailboxes = [] # Remote folders to retrieve from self.smtphunt = [] # Hosts to forward to - self.fetchdomains = [] # Domains to fetch from + self.fetchdomains = [] # Domains to fetch from self.smtpaddress = None # Append this to MAIL FROM line self.smtpname = None # Use this for RCPT TO self.preconnect = None # Connection setup @@ -369,7 +369,6 @@ class User: res = res + " " + x res = res + "\n" trimmed = self.fetchdomains - print "FOO!", `trimmed` if trimmed != [] and trimmed[len(trimmed) - 1] == hostname: trimmed = trimmed[0:len(trimmed) - 1] if trimmed != []: @@ -31,7 +31,7 @@ void lock_setup(void) #define FETCHMAIL_PIDFILE "fetchmail.pid" if (!getuid()) { lockfile = (char *)xmalloc( - sizeof(PID_DIR) + sizeof(FETCHMAIL_PIDFILE)); + sizeof(PID_DIR) + sizeof(FETCHMAIL_PIDFILE) + 1); sprintf(lockfile, "%s/%s", PID_DIR, FETCHMAIL_PIDFILE); } else { lockfile = (char *)xmalloc(strlen(fmhome)+sizeof(FETCHMAIL_PIDFILE)+2); @@ -127,8 +127,8 @@ int smtp_open(struct query *ctl) ctl->server.plugout)) == -1) continue; - /* return immediately for ODMR */ - if (ctl->server.protocol == P_ODMR) + /* return immediately for ODMR */ + if (ctl->server.protocol == P_ODMR) return(ctl->smtp_socket); /* success */ /* are we doing SMTP or LMTP? */ @@ -180,11 +180,6 @@ int smtp_open(struct query *ctl) /* these are shared by open_sink and stuffline */ static FILE *sinkfp; -#ifndef HAVE_SIGACTION -static RETSIGTYPE (*sigchld)(int); -#else -static struct sigaction sa_old; -#endif /* HAVE_SIGACTION */ int stuffline(struct query *ctl, char *buf) /* ship a line to the given control block's output sink (SMTP server or MDA) */ @@ -694,7 +689,6 @@ int open_sink(struct query *ctl, struct msgblk *msg, else { char errbuf[POPBUFSIZE]; - int res; /* * Do *not* interpret a PS_REFUSED here as a directive @@ -966,7 +960,7 @@ int open_sink(struct query *ctl, struct msgblk *msg, memset (&sa_new, 0, sizeof sa_new); sigemptyset (&sa_new.sa_mask); sa_new.sa_handler = SIG_DFL; - sigaction (SIGCHLD, &sa_new, &sa_old); + sigaction (SIGCHLD, &sa_new, NULL); #endif /* HAVE_SIGACTION */ } @@ -991,12 +985,7 @@ void release_sink(struct query *ctl) pclose(sinkfp); sinkfp = (FILE *)NULL; } -#ifndef HAVE_SIGACTION - signal(SIGCHLD, sigchld); -#else - sigaction (SIGCHLD, &sa_old, NULL); -#endif /* HAVE_SIGACTION */ - deal_with_sigchld(); + deal_with_sigchld(); /* Restore SIGCHLD handling to reap zombies */ } } @@ -1015,12 +1004,9 @@ int close_sink(struct query *ctl, struct msgblk *msg, flag forward) } else rc = 0; -#ifndef HAVE_SIGACTION - signal(SIGCHLD, sigchld); -#else - sigaction (SIGCHLD, &sa_old, NULL); -#endif /* HAVE_SIGACTION */ - deal_with_sigchld(); + + deal_with_sigchld(); /* Restore SIGCHLD handling to reap zombies */ + if (rc) { report(stderr, |