diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2000-10-08 14:34:22 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2000-10-08 14:34:22 +0000 |
commit | c7f3b6621d652480a1b57a6ea2deddd4b71ff2fe (patch) | |
tree | 9b7c17d7bf73ffcf937eb9140535622df4c42d29 | |
parent | 288d03eaf77643d32abe2f009029e73955eb786c (diff) | |
download | fetchmail-c7f3b6621d652480a1b57a6ea2deddd4b71ff2fe.tar.gz fetchmail-c7f3b6621d652480a1b57a6ea2deddd4b71ff2fe.tar.bz2 fetchmail-c7f3b6621d652480a1b57a6ea2deddd4b71ff2fe.zip |
Before showdots,
svn path=/trunk/; revision=2975
-rw-r--r-- | Makefile.in | 18 | ||||
-rw-r--r-- | NEWS | 13 | ||||
-rw-r--r-- | configure.in | 12 | ||||
-rw-r--r-- | driver.c | 13 | ||||
-rw-r--r-- | fetchmail-FAQ.html | 23 | ||||
-rw-r--r-- | fetchmail.c | 10 | ||||
-rw-r--r-- | fetchmail.h | 10 | ||||
-rwxr-xr-x | fetchmailconf | 11 | ||||
-rw-r--r-- | interface.c | 227 | ||||
-rw-r--r-- | rcfile_y.y | 25 | ||||
-rw-r--r-- | socket.c | 24 | ||||
-rwxr-xr-x | specgen.sh | 2 | ||||
-rw-r--r-- | unmime.c | 1 |
13 files changed, 327 insertions, 62 deletions
diff --git a/Makefile.in b/Makefile.in index 43100622..e8c05cb6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -52,6 +52,8 @@ EXTRASRC = @EXTRASRC@ EXTRAOBJ = @EXTRAOBJ@ # EXTRAOBJ = strcasecmp.o getopt.o getopt1.o alloca.o +DESTDIR = + # Common prefix for machine-independent installed files. prefix = @prefix@ # Common prefix for machine-dependent installed files. @@ -148,21 +150,21 @@ tags: $(tagsrcs) .PHONY: install uninstall install: @echo "Creating installation directories..." - $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(mandir) + $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(mandir) @echo "Installing fetchmail binary..." - $(INSTALL_PROGRAM) ./fetchmail $(bindir)/fetchmail + $(INSTALL_PROGRAM) ./fetchmail $(DESTDIR)$(bindir)/fetchmail @echo "Installing fetchmail configurator..." - $(INSTALL_PROGRAM) ${srcdir}/fetchmailconf $(bindir)/fetchmailconf + $(INSTALL_PROGRAM) ${srcdir}/fetchmailconf $(DESTDIR)$(bindir)/fetchmailconf @echo "Installing manual page..." - $(INSTALL_DATA) $(srcdir)/fetchmail.man $(mandir)/fetchmail.$(manext) - rm -f $(mandir)/fetchmailconf.$(manext) - ln -s $(mandir)/fetchmail.$(manext) $(mandir)/fetchmailconf.$(manext) + $(INSTALL_DATA) $(srcdir)/fetchmail.man $(DESTDIR)$(mandir)/fetchmail.$(manext) + rm -f $(DESTDIR)$(mandir)/fetchmailconf.$(manext) + cd $(DESTDIR)$(mandir) && ln -s fetchmail.$(manext) fetchmailconf.$(manext) @echo "Installing language catalogs..." @POMAKE@ install uninstall: - rm -f $(bindir)/fetchmail $(bindir)/fetchmailconf - rm -f $(mandir)/fetchmail.$(manext) $(mandir)/fetchmailconf.$(manext) + rm -f $(DESTDIR)$(bindir)/fetchmail $(DESTDIR)$(bindir)/fetchmailconf + rm -f $(DESTDIR)$(mandir)/fetchmail.$(manext) $(DESTDIR)$(mandir)/fetchmailconf.$(manext) @POMAKE@ uninstall .PHONY: clean realclean distclean mostlyclean @@ -2,6 +2,17 @@ (The `lines' figures total .c, .h, .l, and .y files under version control.) +* Fall back on the computed queryname if we need the DNS name of a a host + and can't get it. Resolves Debian bug #69199. +* Andrej Borsenkow's fix for configuration with new SOCKS. +* Pavel Roskin's fix to build the RPM without libcrypto (Red Hat changed + the library name to libk5crypto in 6.2). +* Peter Backes's sm-hybrid patch added to contrib; more FAQ item T1 changes. +* Emiliano's patch to make dropdelivered and envelope interact properly. +* In fetchmailconf, always reset the port number when changing protocols. +* Patrick Bihan-Faou's changes to use sysctl() for interface checking + so fetchmail doesn't have to be suid kmem. + fetchmail-5.5.3 (Tue Sep 26 17:56:32 EDT 2000), 19278 lines: * Added skip size reporting as suggested by Franck Pommereau. @@ -13,7 +24,7 @@ There are 280 people on fetchmail-friends and 557 on fetchmail-announce. fetchmail-5.5.2 (Thu Sep 7 23:00:24 EDT 2000), 19243 lines: -* Horst Von Brand's security and specfile patches. +* Horst von Brand's security and specfile patches. * Major changes to FAQ item T1. * Minor correction to FAQ item K3 by Malte Kiesel. * Added to FAQ R1, on enabling sendmail in RH 6.9. diff --git a/configure.in b/configure.in index 710cd78f..7f9c9ca9 100644 --- a/configure.in +++ b/configure.in @@ -507,13 +507,15 @@ then if test "$with_socks5" != yes then LDEFLAGS="$LDEFLAGS -L$with_socks5" - else - AC_CHECK_LIB(socks5, SOCKSconnect,, - AC_MSG_ERROR([could not find libsocks5 which is needed for built-in SOCKS5 support])) fi + ac_savedLDFLAGS="$LDFLAGS" + LDFLAGS="$LDEFLAGS $LDFLAGS" + AC_CHECK_LIB(socks5, SOCKSconnect,, + AC_MSG_ERROR([could not find libsocks5 which is needed for built-in SOCKS5 support])) AC_DEFINE(HAVE_SOCKS) - CEFLAGS="$CEFLAGS -Dconnect=SOCKSconnect -Dgetsockname=SOCKSgetsockname -Dbind=SOCKSbind -Daccept=SOCKSaccept -Dlisten=SOCKSlisten -Dselect=SOCKSselect -Drecvfrom=SOCKSrecvfrom -Dsendto=SOCKSsendto -Drecv=SOCKSrecv -Dsend=SOCKSsend -Dread=SOCKSread -Dwrite=SOCKSwrite -Drresvport=SOCKSrresvport -Dshutdown=SOCKSshutdown -Dlisten=SOCKSlisten -Dclose=SOCKSclose -Ddup=SOCKSdup -Ddup2=SOCKSdup2 -Dfclose=SOCKSfclose -Dgethostbyname=SOCKSgethostbyname" - LIBS="-lsocks5 $LIBS" + CEFLAGS="$CEFLAGS -Dconnect=SOCKSconnect -Dgetsockname=SOCKSgetsockname -Dbind=SOCKSbind -Daccept=SOCKSaccept -Dlisten=SOCKSlisten -Dselect=SOCKSselect -Drecvfrom=SOCKSrecvfrom -Dsendto=SOCKSsendto -Drecv=SOCKSrecv -Dsend=SOCKSsend -Dread=SOCKSread -Dwrite=SOCKSwrite -Drresvport=SOCKSrresvport -Dshutdown=SOCKSshutdown -Dlisten=SOCKSlisten -Dclose=SOCKSclose -Ddup=SOCKSdup -Ddup2=SOCKSdup2 -Dgethostbyname=SOCKSgethostbyname" + AC_CHECK_FUNC(SOCKSfclose, [CFLAGS="$CFLAGS -Dfclose=SOCKSfclose"]) + LDFLAGS="$ac_savedLDFLAGS" fi]) ### use option --with-hesiod=DIR to point at a HESIOD directory @@ -434,7 +434,7 @@ static int readheaders(int sock, int from_offs, reply_to_offs, resent_from_offs; int app_from_offs, sender_offs, resent_sender_offs; int env_offs; - char *received_for, *rcv, *cp; + char *received_for, *rcv, *cp, *delivered_to; int n, linelen, oldlen, ch, remaining, skipcount; struct idlist *idp; flag no_local_matches = FALSE; @@ -458,7 +458,7 @@ static int readheaders(int sock, if (msgblk.headers) free(msgblk.headers); - msgblk.headers = received_for = NULL; + msgblk.headers = received_for = delivered_to = NULL; from_offs = reply_to_offs = resent_from_offs = app_from_offs = sender_offs = resent_sender_offs = env_offs = -1; oldlen = 0; @@ -656,7 +656,8 @@ static int readheaders(int sock, * Should be controlled by an option */ if (ctl->dropdelivered && !strncasecmp(line, "Delivered-To:", 13)) { - free(line); + if (delivered_to) free(line); + else delivered_to = line; continue; } @@ -924,6 +925,12 @@ static int readheaders(int sock, #endif /* SDPS_ENABLE */ if (env_offs > -1) /* We have the actual envelope addressee */ find_server_names(msgblk.headers + env_offs, ctl, &msgblk.recipients); + else if (delivered_to && ctl->server.envelope != STRING_DISABLED && + ctl->server.envelope && !strcasecmp(ctl->server.envelope, "Delivered-To")) + { + find_server_names(delivered_to, ctl, &msgblk.recipients); + free(delivered_to); + } else if (received_for) /* * We have the Received for addressee. diff --git a/fetchmail-FAQ.html b/fetchmail-FAQ.html index 10f5ebd9..d4fe8bc0 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: 2000/09/30 00:04:01 $ +<td width="30%" align=right>$Date: 2000/10/08 14:34:19 $ </table> <HR> <H1>Frequently Asked Questions About Fetchmail</H1> @@ -1066,12 +1066,10 @@ your site. To fix even that problem, you might want to try the following hack, which is however untested and quite experimental:<P> <PRE> -H?l?Delivered-To: $u +H?J?Delivered-To: $u -Mmdrop, P=/usr/bin/procmail, - F=lsDFMqSPfhnu9, - S=EnvFromSMTP/HdrFromSMTP, - R=EnvToSMTP/HdrToSMTP, +Mmdrop, P=/usr/bin/procmail, F=lsDFMqSPfhnu9J, + S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP/HdrToSMTP, T=DNS/RFC822/X-Unix, A=procmail -Y -a $u -d $h </PRE> @@ -1082,10 +1080,17 @@ with RELAY permission into your access file and to add a line reading `<CODE>domain.com local:local-pop-user</CODE>' for the first and `<CODE>domain.com mdrop:local-pop-user</CODE>' for the second hack to your mailertable.<P> - + +You will notice that if the mail already has a Delivered-To header, +sendmail will not add another. Further, editing sendmail.cf +directly is not very comfortable. Solutions for both problems +can be found in Peter `Rattacresh' Backes' `hybrid' patch against +sendmail. Have a look at it, you can find it in the contrib +subdirectory.<P> + Feel free to try Martijn Lievaart's detailed recipe in the contrib subdirectory of the fetchmail source distribution, it attempts -to address this problem with an external script.<P> +to realize multidrop mailboxes with an external script.<P> <hr> <h2><a name="T2">T2. How can I use fetchmail with qmail?</a></h2> @@ -2914,7 +2919,7 @@ install Linux on your server...<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: 2000/09/30 00:04:01 $ +<td width="30%" align=right>$Date: 2000/10/08 14:34:19 $ </table> <P><ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS> diff --git a/fetchmail.c b/fetchmail.c index 3e41d1d9..28ad2aa2 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -102,7 +102,7 @@ static void unlockit(void) unlink(lockfile); } -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) && defined(__FreeBSD_USE_KVM) /* drop SGID kmem privileage until we need it */ static void dropprivs(void) { @@ -152,7 +152,7 @@ int main(int argc, char **argv) pid_t pid; int lastsig = 0; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) && defined(__FreeBSD_USE_KVM) dropprivs(); #endif @@ -1146,8 +1146,7 @@ static int load_params(int argc, char **argv, int optind) /* prevent core dump from ill-formed or duplicate entry */ if (!leadname) { - report(stderr, - _("Lead server has no name.\n")); + report(stderr, _("Lead server has no name.\n")); exit(PS_SYNTAX); } @@ -1168,7 +1167,8 @@ static int load_params(int argc, char **argv, int optind) report(stderr, _("couldn't find canonical DNS name of %s\n"), ctl->server.pollname); - ctl->active = FALSE; + ctl->server.truename = xstrdup(ctl->server.queryname); + ctl->server.trueaddr = NULL; } else ctl->server.truename=xstrdup((char *)namerec->h_name); diff --git a/fetchmail.h b/fetchmail.h index c6fc2ebd..bba30e21 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -496,7 +496,15 @@ char *xstrdup(const char *); #pragma alloca #endif #endif -#define xalloca(ptr, t, n) if (!(ptr = (t) alloca(n))) {report(stderr, "alloca failed"); exit(PS_UNDEFINED);} +#define xalloca(ptr, t, n) if (!(ptr = (t) alloca(n)))\ + {report(stderr, _("alloca failed")); exit(PS_UNDEFINED);} +#if FALSE +/* + * This is a hack to help xgettext which cannot find strings in + * macro definitions like the one for xalloca above. + */ +static char *dummy = gettext_noop("alloca failed"); +#endif /* protocol driver and methods */ int do_protocol(struct query *, const struct method *); diff --git a/fetchmailconf b/fetchmailconf index 15ccc2fb..f3d7004a 100755 --- a/fetchmailconf +++ b/fetchmailconf @@ -4,7 +4,7 @@ # by Eric S. Raymond, <esr@snark.thyrsus.com>. # Requires Python with Tkinter, and the following OS-dependent services: # posix, posixpath, socket -version = "1.28" +version = "1.29" from Tkinter import * from Dialog import * @@ -969,8 +969,13 @@ class ServerEdit(Frame, MyWidget): def refreshPort(self): proto = self.protocol.get() - if self.port.get() == 0: - self.port.set(defaultports[proto]) + # We used to only reset the port if it had a default (zero) value. + # This turns out to be a bad idea especially in Novice mode -- if + # you set POP3 and then set IMAP, the port invisibly remained 110. + # Now we reset unconditionally on the theory that if you're setting + # a custom port number you should be in expert mode and playing + # close enough attention to notice this... + self.port.set(defaultports[proto]) if not proto in ("POP3", "APOP", "KPOP"): self.uidl.state = DISABLED def user_edit(self, username, mode): diff --git a/interface.c b/interface.c index eefcfd1d..bca8b0e8 100644 --- a/interface.c +++ b/interface.c @@ -33,12 +33,18 @@ #include <arpa/inet.h> #include <net/if.h> #if defined(__FreeBSD__) -#if __FreeBSD_version >= 300001 -#include <net/if_var.h> +#if defined __FreeBSD_USE_KVM + #if __FreeBSD_version >= 300001 + #include <net/if_var.h> + #endif + #include <kvm.h> + #include <nlist.h> + #include <sys/fcntl.h> +#else + #include <sys/sysctl.h> + #include <net/route.h> + #include <net/if_dl.h> #endif -#include <kvm.h> -#include <nlist.h> -#include <sys/fcntl.h> #endif #include "config.h" #include "fetchmail.h" @@ -182,6 +188,8 @@ static int get_ifinfo(const char *ifname, ifinfo_t *ifinfo) #elif defined __FreeBSD__ +#if defined __FreeBSD_USE_KVM + static kvm_t *kvmfd; static struct nlist symbols[] = { @@ -326,6 +334,215 @@ get_ifinfo(const char *ifname, ifinfo_t *ifinfo) return 0; } + +#else /* Do not use KVM on FreeBSD */ + +/* + * Expand the compacted form of addresses as returned via the + * configuration read via sysctl(). + */ + +static void +rt_xaddrs(caddr_t cp, caddr_t cplim, struct rt_addrinfo *rtinfo) +{ + struct sockaddr *sa; + int i; + +#define ROUNDUP(a) \ + ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) +#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) + + memset(rtinfo->rti_info, 0, sizeof(rtinfo->rti_info)); + for (i = 0; (i < RTAX_MAX) && (cp < cplim); i++) { + if ((rtinfo->rti_addrs & (1 << i)) == 0) + continue; + rtinfo->rti_info[i] = sa = (struct sockaddr *)cp; + ADVANCE(cp, sa); + } + +#undef ROUNDUP +#undef ADVANCE +} + +static int +get_ifinfo(const char *ifname, ifinfo_t *ifinfo) +{ + uint i; + int rc = 0; + int ifindex = -1; + size_t needed; + char *buf = NULL; + char *lim = NULL; + char *next = NULL; + struct if_msghdr *ifm; + struct ifa_msghdr *ifam; + struct sockaddr_in *sin; + struct sockaddr_dl *sdl; + struct rt_addrinfo info; + char iname[16]; + int mib[6]; + + memset(ifinfo, 0, sizeof(ifinfo)); + + /* trim interface name */ + + for (i = 0; i < sizeof(iname) && ifname[i] && ifname[i] != '/'; i++) + iname[i] = ifname[i]; + + if (i == 0 || i == sizeof(iname)) + { + report(stderr, _("Unable to parse interface name from %s"), ifname); + return 0; + } + + iname[i] = 0; + + + /* get list of existing interfaces */ + + mib[0] = CTL_NET; + mib[1] = PF_ROUTE; + mib[2] = 0; + mib[3] = AF_INET; /* Only IP addresses please. */ + mib[4] = NET_RT_IFLIST; + mib[5] = 0; /* List all interfaces. */ + + + /* Get interface data. */ + + if (sysctl(mib, 6, NULL, &needed, NULL, 0) == -1) + { + report(stderr, + _("get_ifinfo: sysctl (iflist estimate) failed")); + exit(1); + } + if ((buf = malloc(needed)) == NULL) + { + report(stderr, + _("get_ifinfo: malloc failed")); + exit(1); + } + if (sysctl(mib, 6, buf, &needed, NULL, 0) == -1) + { + report(stderr, + _("get_ifinfo: sysctl (iflist) failed")); + exit(1); + } + + lim = buf+needed; + + + /* first look for the interface information */ + + next = buf; + while (next < lim) + { + ifm = (struct if_msghdr *)next; + next += ifm->ifm_msglen; + + if (ifm->ifm_version != RTM_VERSION) + { + report(stderr, + _("Routing message version %d not understood."), + ifm->ifm_version); + exit(1); + } + + if (ifm->ifm_type == RTM_IFINFO) + { + sdl = (struct sockaddr_dl *)(ifm + 1); + + if (!(strlen(iname) == sdl->sdl_nlen + && strncmp(iname, sdl->sdl_data, sdl->sdl_nlen) == 0)) + { + continue; + } + + if ( !(ifm->ifm_flags & IFF_UP) ) + { + /* the interface is down */ + goto get_ifinfo_end; + } + + ifindex = ifm->ifm_index; + ifinfo->rx_packets = ifm->ifm_data.ifi_ipackets; + ifinfo->tx_packets = ifm->ifm_data.ifi_opackets; + + break; + } + } + + if (ifindex < 0) + { + /* we did not find an interface with a matching name */ + report(stderr, _("No interface found with name %s"), iname); + goto get_ifinfo_end; + } + + /* now look for the interface's IP address */ + + next = buf; + while (next < lim) + { + ifam = (struct ifa_msghdr *)next; + next += ifam->ifam_msglen; + + if (ifindex > 0 + && ifam->ifam_type == RTM_NEWADDR + && ifam->ifam_index == ifindex) + { + /* Expand the compacted addresses */ + info.rti_addrs = ifam->ifam_addrs; + rt_xaddrs((char *)(ifam + 1), + ifam->ifam_msglen + (char *)ifam, + &info); + + /* Check for IPv4 address information only */ + if (info.rti_info[RTAX_IFA]->sa_family != AF_INET) + { + continue; + } + + rc = 1; + + sin = (struct sockaddr_in *)info.rti_info[RTAX_IFA]; + if (sin) + { + ifinfo->addr = sin->sin_addr; + } + + sin = (struct sockaddr_in *)info.rti_info[RTAX_NETMASK]; + if (!sin) + { + ifinfo->netmask = sin->sin_addr; + } + + /* note: RTAX_BRD contains the address at the other + * end of a point-to-point link or the broadcast address + * of non point-to-point link + */ + sin = (struct sockaddr_in *)info.rti_info[RTAX_BRD]; + if (!sin) + { + ifinfo->dstaddr = sin->sin_addr; + } + + break; + } + } + + if (rc == 0) + { + report(stderr, _("No IP address found for %s"), iname); + } + +get_ifinfo_end: + free(buf); + return rc; +} + +#endif /* __FREEBSD_USE_SYSCTL_GET_IFFINFO */ + #endif /* defined __FreeBSD__ */ @@ -27,7 +27,8 @@ #endif /* NET_SECURITY */ #include "fetchmail.h" - +#include "i18n.h" + /* parser reads these */ char *rcfile; /* path name of rc file */ struct query cmd_opts; /* where to put command-line info */ @@ -107,7 +108,7 @@ statement : SET LOGFILE optmap STRING {run.logfile = xstrdup($4);} /* detect and complain about the most common user error */ | define_server serverspecs userspecs serv_option - {yyerror("server option after user options");} + {yyerror(_("server option after user options"));} ; define_server : POLL STRING {reset_server($2, FALSE);} @@ -151,7 +152,7 @@ serv_option : AKA alias_list current.server.protocol = P_POP3; current.server.sdps = TRUE; #else - yyerror("SDPS not enabled."); + yyerror(_("SDPS not enabled.")); #endif /* SDPS_ENABLE */ } | UIDL {current.server.uidl = FLAG_TRUE;} @@ -207,27 +208,27 @@ serv_option : AKA alias_list int requestlen; if (net_security_strtorequest($2, &request, &requestlen)) - yyerror("invalid security request"); + yyerror(_("invalid security request")); else { current.server.netsec = xstrdup($2); free(request); } #else - yyerror("network-security support disabled"); + yyerror(_("network-security support disabled")); #endif /* NET_SECURITY */ } | INTERFACE STRING { #if (defined(linux) && !defined(INET6_ENABLE)) || defined(__FreeBSD__) interface_parse($2, ¤t.server); #else /* (defined(linux) && !defined(INET6_ENABLE)) || defined(__FreeBSD__) */ - fprintf(stderr, "fetchmail: interface option is only supported under Linux and FreeBSD\n"); + fprintf(stderr, _("fetchmail: interface option is only supported under Linux and FreeBSD\n")); #endif /* (defined(linux) && !defined(INET6_ENABLE)) || defined(__FreeBSD__) */ } | MONITOR STRING { #if (defined(linux) && !defined(INET6_ENABLE)) || defined(__FreeBSD__) current.server.monitor = xstrdup($2); #else /* (defined(linux) && !defined(INET6_ENABLE)) || defined(__FreeBSD__) */ - fprintf(stderr, "fetchmail: monitor option is only supported under Linux\n"); + fprintf(stderr, _("fetchmail: monitor option is only supported under Linux\n")); #endif /* (defined(linux) && !defined(INET6_ENABLE) || defined(__FreeBSD__)) */ } | PLUGIN STRING { current.server.plugin = xstrdup($2); } @@ -366,8 +367,8 @@ static struct query *hosttail; /* where to add new elements */ void yyerror (const char *s) /* report a syntax error */ { - report_at_line(stderr, 0, rcfile, prc_lineno, "%s at %s", s, - (yytext && yytext[0]) ? yytext : "end of input"); + report_at_line(stderr, 0, rcfile, prc_lineno, _("%s at %s"), s, + (yytext && yytext[0]) ? yytext : _("end of input")); prc_errflag++; } @@ -404,14 +405,14 @@ int prc_filecheck(const char *pathname, const flag securecheck) if ((statbuf.st_mode & S_IFLNK) == S_IFLNK) { - fprintf(stderr, "File %s must not be a symbolic link.\n", pathname); + fprintf(stderr, _("File %s must not be a symbolic link.\n"), pathname); return(PS_IOERR); } #ifndef __BEOS__ if (statbuf.st_mode & ~(S_IFREG | S_IREAD | S_IWRITE | S_IEXEC | S_IXGRP)) { - fprintf(stderr, "File %s must have no more than -rwx--x--- (0710) permissions.\n", + fprintf(stderr, _("File %s must have no more than -rwx--x--- (0710) permissions.\n"), pathname); return(PS_IOERR); } @@ -423,7 +424,7 @@ int prc_filecheck(const char *pathname, const flag securecheck) if (statbuf.st_uid != getuid()) #endif /* HAVE_GETEUID */ { - fprintf(stderr, "File %s must be owned by you.\n", pathname); + fprintf(stderr, _("File %s must be owned by you.\n"), pathname); return(PS_IOERR); } #endif @@ -119,6 +119,12 @@ static int handle_plugin(const char *host, { int fds[2]; char *const *argvec; + + /* + * The author of this code, Felix von Leitner <felix@convergence.de>, says: + * he chose socketpair() instead of pipe() because socketpair creates + * bidirectional sockets while allegedly some pipe() implementations don't. + */ if (socketpair(AF_UNIX,SOCK_STREAM,0,fds)) { report(stderr, _("fetchmail: socketpair failed\n")); @@ -141,7 +147,7 @@ static int handle_plugin(const char *host, /* fds[0] is now connected to 0 and 1; close it */ (void) close(fds[0]); if (outlevel >= O_VERBOSE) - report(stderr, _("running %s %s %s\n"), plugin, host, service); + report(stderr, _("running %s (host %s service %s)\n"), plugin, host, service); argvec = (char *const *)parse_plugin(plugin,host,service); execvp(*argvec, argvec); report(stderr, _("execvp(%s) failed\n"), *argvec); @@ -620,10 +626,10 @@ int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx ) *str_ptr = '\0'; } if (outlevel == O_VERBOSE) - report(stdout, "Issuer Organization: %s\n", cbuf ); + report(stdout, _("Issuer Organization: %s\n"), cbuf ); } else { if (outlevel == O_VERBOSE) - report(stdout, "Unknown Organization\n", cbuf ); + report(stdout, _("Unknown Organization\n"), cbuf ); } if( ( str_ptr = strstr( ibuf, "/CN=" ) ) ) { str_ptr += 4; @@ -632,10 +638,10 @@ int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx ) *str_ptr = '\0'; } if (outlevel == O_VERBOSE) - report(stdout, "Issuer CommonName: %s\n", cbuf ); + report(stdout, _("Issuer CommonName: %s\n"), cbuf ); } else { if (outlevel == O_VERBOSE) - report(stdout, "Unknown Issuer CommonName\n", cbuf ); + report(stdout, _("Unknown Issuer CommonName\n"), cbuf ); } if( ( str_ptr = strstr( buf, "/CN=" ) ) ) { str_ptr += 4; @@ -644,17 +650,17 @@ int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx ) *str_ptr = '\0'; } if (outlevel == O_VERBOSE) - report(stdout, "Server CommonName: %s\n", cbuf ); + report(stdout, _("Server CommonName: %s\n"), cbuf ); /* Should we have some wildcarding here? */ if ( NULL != _ssl_server_cname && 0 != strcasecmp( cbuf, _ssl_server_cname ) ) { report(stdout, - "Server CommonName mismatch: %s != %s\n", + _("Server CommonName mismatch: %s != %s\n"), cbuf, _ssl_server_cname ); } } else { if (outlevel == O_VERBOSE) - report(stdout, "Unknown Server CommonName\n", cbuf ); + report(stdout, _("Unknown Server CommonName\n"), cbuf ); } } @@ -689,7 +695,7 @@ int SSLOpen(int sock, char *mycert, char *mykey, char *servercname ) SSLeay_add_ssl_algorithms(); if( sock < 0 || sock > FD_SETSIZE ) { - report(stderr, "File descriptor out of range for SSL" ); + report(stderr, _("File descriptor out of range for SSL") ); return( -1 ); } @@ -117,7 +117,7 @@ GUI konfigurator do fetchmaila napisany w pythonie. %build CFLAGS="\$RPM_OPT_FLAGS" LDFLAGS="-s" export CFLAGS LDFLAGS -./configure --prefix=/usr --mandir=%{_mandir} +./configure --prefix=/usr --without-kerberos --mandir=%{_mandir} # Add --enable-nls --without-included-gettext # for internationalization. Also look below. make @@ -18,6 +18,7 @@ #include <stdio.h> #include <ctype.h> #include "fetchmail.h" +#include "i18n.h" static unsigned char unhex(unsigned char c) { |