diff options
-rw-r--r-- | Makefile.in | 8 | ||||
-rw-r--r-- | NEWS | 13 | ||||
-rw-r--r-- | checkalias.c | 6 | ||||
-rw-r--r-- | env.c | 22 | ||||
-rw-r--r-- | etrn.c | 6 | ||||
-rw-r--r-- | fetchmail-FAQ.html | 8 | ||||
-rw-r--r-- | fetchmail.h | 2 | ||||
-rwxr-xr-x | fetchmailconf | 8 | ||||
-rw-r--r-- | imap.c | 2 | ||||
-rw-r--r-- | kerberos.c | 2 | ||||
-rw-r--r-- | sink.c | 6 | ||||
-rw-r--r-- | socket.c | 4 | ||||
-rw-r--r-- | transact.c | 2 | ||||
-rw-r--r-- | xalloca.c | 2 |
14 files changed, 62 insertions, 29 deletions
diff --git a/Makefile.in b/Makefile.in index d010f562..ca352610 100644 --- a/Makefile.in +++ b/Makefile.in @@ -185,20 +185,20 @@ uninstall: .PHONY: clean realclean distclean mostlyclean clean: -cd intl; $(MAKE) clean - #work around braindamage in GNU gettext - -rm -f $(top_builddir)/intl/libintl.h + -rm -f $(top_builddir)/intl/libintl.h # work around GNU gettext brain-damage -cd po; $(MAKE) clean -rm -f fetchmail *.o core fetchmail.dvi \ rcfile_l.c rcfile_y.h rcfile_y.c \ fetchmail.tar fetchmail.tar.gz \ netrc rfc822 unmime fetchmail-man.html +# This target would also normally invoke the following line, but doing so +# messes up the RPM build, so the line was disabled. +# -rm -f config.h config.cache config.status config.log stamp-config distclean: clean -cd intl; $(MAKE) distclean -cd po; $(MAKE) distclean -rm -f TAGS tags - # Can't do these, it messes up RPM build - #-rm -f config.h config.cache config.status config.log stamp-config realclean: distclean -rm -f FAQ FEATURES NOTES MANIFEST @@ -3,6 +3,19 @@ (The `lines' figures total .c, .h, .l, and .y files under version control.) * Changed the logging logic along lines suggested by Jan Klaverstijn, +* fetchmauilconf looks first in the directory it's running from to find + fetchmail. +* Make sure we vet a success status correctly from open_smtp_sink() + and open_bsmtp_sink(). +* Matthias Andree's env.c patch to refuse service when QMAILINJECT is defined. +* Immediately abort if a non-empty QMAILINJECT environment variable is + found. If it is set and contains f or i, qmail-inject or qmail's + sendmail `compatibility' wrapper will rewrite From: or Message-ID: + headers, respectively. En passant, fix the bug that program_name was + not filled in before used when the user's ID had no PW entry, leading + to (null) or crash when printing the error message. Patch by Matthias + Andree. +* NextStep and OpenStep port patch from Eric Sunshine. fetchmail-5.9.4 (Wed Oct 3 07:47:45 EDT 2001), 21104 lines: diff --git a/checkalias.c b/checkalias.c index f8f8058b..cd5caca5 100644 --- a/checkalias.c +++ b/checkalias.c @@ -48,7 +48,7 @@ static int is_ip_alias(const char *name1,const char *name2) struct hostent *hp; char **p; - hp = gethostbyname(name1); + hp = gethostbyname((char*)name1); dummy_addr = (address_e *)NULL; @@ -63,7 +63,7 @@ static int is_ip_alias(const char *name1,const char *name2) dummy_addr = host_a_addr; } - hp = gethostbyname(name2); + hp = gethostbyname((char*)name2); dummy_addr = (address_e *)NULL; for (i=0,p = hp->h_addr_list; *p != 0; i++,p++) @@ -161,7 +161,7 @@ int is_host_alias(const char *name, struct query *ctl) * delivering the current message or anything else from the * current server until it's back up. */ - if ((he = gethostbyname(name)) != (struct hostent *)NULL) + if ((he = gethostbyname((char*)name)) != (struct hostent *)NULL) { if (strcasecmp(ctl->server.truename, he->h_name) == 0) goto match; @@ -49,6 +49,23 @@ void envquery(int argc, char **argv) } } + if ((program_name = strrchr(argv[0], '/')) != NULL) + ++program_name; + else + program_name = argv[0]; + + if (getenv("QMAILINJECT") && strcmp(getenv("QMAILINJECT"), "")) + { + fprintf(stderr, + GT_("%s: The QMAILINJECT environment variable is set.\n" + "This is dangerous as it can make qmail-inject or qmail's sendmail wrapper\n" + "tamper with your From: or Message-ID: headers.\n" + "Try \"env QMAILINJECT= %s YOUR ARGUMENTS HERE\"\n" + "%s: Abort.\n"), + program_name, program_name, program_name); + exit(PS_UNDEFINED); + } + if (!(pwp = getpwuid(getuid()))) { fprintf(stderr, @@ -85,11 +102,6 @@ void envquery(int argc, char **argv) if (!(fmhome = getenv("FETCHMAILHOME"))) fmhome = home; - if ((program_name = strrchr(argv[0], '/')) != NULL) - ++program_name; - else - program_name = argv[0]; - #define RCFILE_NAME "fetchmailrc" /* * The (fmhome==home) leaves an extra character for a . at the @@ -71,18 +71,18 @@ static int etrn_getrange(int sock, struct query *ctl, const char *id, switch(atoi(buf)) { case 250: /* OK, queuing for node <x> started */ - if (outlevel >= O_SILENT) + if (outlevel > O_SILENT) report(stdout, GT_("Queuing for %s started\n"), qnp->id); break; case 251: /* OK, no messages waiting for node <x> */ - if (outlevel >= O_SILENT) + if (outlevel > O_SILENT) report(stdout, GT_("No messages waiting for %s\n"), qnp->id); return(PS_NOMAIL); case 252: /* OK, pending messages for node <x> started */ case 253: /* OK, <n> pending messages for node <x> started */ - if (outlevel >= O_SILENT) + if (outlevel > O_SILENT) report(stdout, GT_("Pending messages for %s started\n"), qnp->id); break; diff --git a/fetchmail-FAQ.html b/fetchmail-FAQ.html index 50b9ffb6..db64b9ff 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/10/13 04:51:50 $ +<td width="30%" align=right>$Date: 2001/11/08 16:53:52 $ </table> <HR> <H1>Frequently Asked Questions About Fetchmail</H1> @@ -1609,6 +1609,10 @@ Fetchmail normally uses TOP for message retrieval in order to avoid marking messages seen, but `<CODE>fetchall</CODE>' forces it to use RETR instead. +<p>Also, we're told USA.NET adds a ton of hops to your messages. You may +need to raise the MaxHopCount parameter in your sendmail.cf to avoid having +fetched mail rejected. + <p>(Note: Other failure modes have been reported on usa.net's servers. They seem to be chronically flaky. We recommend finding another provider.) @@ -2921,7 +2925,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/10/13 04:51:50 $ +<td width="30%" align=right>$Date: 2001/11/08 16:53:52 $ </table> <ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@thyrsus.com></A></ADDRESS> diff --git a/fetchmail.h b/fetchmail.h index 1380ee95..46344627 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -540,7 +540,7 @@ char *xstrdup(const char *); #endif #define xalloca(ptr, t, n) if (!(ptr = (t) alloca(n)))\ {report(stderr, GT_("alloca failed")); exit(PS_UNDEFINED);} -#if FALSE +#if 0 /* * This is a hack to help xgettext which cannot find strings in * macro definitions like the one for xalloca above. diff --git a/fetchmailconf b/fetchmailconf index 18c81fd8..f049a04c 100755 --- a/fetchmailconf +++ b/fetchmailconf @@ -1770,10 +1770,10 @@ class RunWindow(Frame): self.update() # Draw widget before executing fetchmail - # Always look for a runnable command in the current directory first. - # This avoids some obscure version-skew errors that can occur if you - # pick up an old fetchmail from the standard system locations. - os.environ["PATH"] = ".:" + os.environ["PATH"] + # Always look for a runnable command in the directory we're running in + # first. This avoids some obscure version-skew errors that can occur + # if you pick up an old fetchmail from the standard system locations. + os.environ["PATH"] = os.path.dirname(sys.argv[0]) + ":" + os.environ["PATH"] child_stdout = os.popen(command + " 2>&1", "r") while 1: ch = child_stdout.read(1) @@ -181,7 +181,7 @@ static int do_imap_ntlm(int sock, struct query *ctl) if ((gen_recv(sock, msgbuf, sizeof msgbuf))) return result; - len = from64tobits ((unsigned char*)&challenge, msgbuf); + len = from64tobits ((unsigned char*)&challenge, msgbuf, sizeof(msgbuf)); if (outlevel >= O_DEBUG) dumpSmbNtlmAuthChallenge(stdout, &challenge); @@ -208,7 +208,7 @@ int do_rfc1731(int sock, char *command, char *truename) * process is complete. */ - len = from64tobits(buf2, buf1, sizeof(buf2x)); + len = from64tobits(buf2, buf1, sizeof(buf2)); if (len < 0) { report(stderr, GT_("could not decode BASE64 ready response\n")); return PS_AUTHFAIL; @@ -793,6 +793,8 @@ static int open_smtp_sink(struct query *ctl, struct msgblk *msg, SMTP_rset(ctl->smtp_socket); /* stay on the safe side */ return(handle_smtp_report(ctl, msg)); } + + return(PS_SUCCESS); } static int open_mda_sink(struct query *ctl, struct msgblk *msg, @@ -951,13 +953,15 @@ static int open_mda_sink(struct query *ctl, struct msgblk *msg, * error status instead of 0 for successful completion. */ #ifndef HAVE_SIGACTION - sigchld = signal(SIGCHLD, SIG_DFL); + signal(SIGCHLD, SIG_DFL); #else memset (&sa_new, 0, sizeof sa_new); sigemptyset (&sa_new.sa_mask); sa_new.sa_handler = SIG_DFL; sigaction (SIGCHLD, &sa_new, NULL); #endif /* HAVE_SIGACTION */ + + return(PS_SUCCESS); } int open_sink(struct query *ctl, struct msgblk *msg, @@ -340,7 +340,7 @@ int SockOpen(const char *host, int clientPort, const char *options, /* we'll accept a quad address */ #ifndef HAVE_INET_ATON - inaddr = inet_addr(host); + inaddr = inet_addr((char*)host); if (inaddr != INADDR_NONE) { memcpy(&ad.sin_addr, &inaddr, sizeof(inaddr)); @@ -370,7 +370,7 @@ int SockOpen(const char *host, int clientPort, const char *options, } #endif /* HAVE_INET_ATON */ else { - hp = gethostbyname(host); + hp = gethostbyname((char*)host); if (hp == NULL) { @@ -549,7 +549,7 @@ int readheaders(int sock, { if (ctl->lastid) free(ctl->lastid); - ctl->lastid = strdup(line); + ctl->lastid = xstrdup(line); } } @@ -41,7 +41,7 @@ int n; p = (XALLOCATYPE *) alloca(n); if (p == (XALLOCATYPE *) 0) { - report(stderr, "alloca failed\n"); + report(stderr, GT_("alloca failed\n")); exit(PS_UNDEFINED); } return(p); |