From cffef417bb9e0a231968c5fbadca8e5141a65083 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 26 Nov 1998 03:58:57 +0000 Subject: Internationalization support via GNU gettext(). svn path=/trunk/; revision=2208 --- INSTALL | 8 ++ Makefile.in | 26 ++++- NEWS | 7 ++ acconfig.h | 25 +++- checkalias.c | 13 ++- configure.in | 19 ++- design-notes.html | 26 +++-- driver.c | 172 ++++++++++++++------------- env.c | 10 +- etrn.c | 31 ++--- fetchmail-features.html | 6 +- fetchmail.c | 302 +++++++++++++++++++++++++----------------------- getpass.c | 7 +- imap.c | 67 ++++++----- interface.c | 19 +-- netrc.c | 7 +- options.c | 115 +++++++++--------- pop3.c | 23 ++-- report.c | 18 +-- rpa.c | 85 +++++++------- sink.c | 31 ++--- socket.c | 13 ++- specgen.sh | 9 ++ xmalloc.c | 7 +- 24 files changed, 598 insertions(+), 448 deletions(-) diff --git a/INSTALL b/INSTALL index f6be989e..7676aff9 100644 --- a/INSTALL +++ b/INSTALL @@ -68,6 +68,14 @@ If you want to build for debugging, will do that. +To enable multilingual support using GNU gettext, + + configure --prefix=/usr --enable-NLS + +The prefix argument is needed to generate the makefiles in the po directory +correctly; otherwise, they'll install the internationalization stuff in +/usr/local where fetchmail can't see it. + Advanced configuration: Specifying --with-kerberos=DIR or --with-kerberos5=DIR will tell the diff --git a/Makefile.in b/Makefile.in index 41e11d24..415700d4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -5,6 +5,11 @@ VERS=4.6.7 +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SUBDIRS = @INTLSUB@ @POSUB@ + # Ultrix 2.2 make doesn't expand the value of VPATH. srcdir = @srcdir@ VPATH = @srcdir@ @@ -37,7 +42,7 @@ defines = -DRELEASE_ID=\"$(VERS)\" $(DEFS) # If your system needs extra libraries loaded in, define them here. # In particular, add -lresolv if you are running bind 4.9.5 -LOADLIBS = @LIBS@ @LEXLIB@ +LOADLIBS = @LIBS@ @LEXLIB@ @INTLLIBS@ # LOADLIBS = -lsocket3r -lunix3r # QNX # Any extra object files your system needs. @@ -100,7 +105,7 @@ srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \ .SUFFIXES: .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi -all: fetchmail +all: fetchmail po # Some makes apparently use .PHONY as the default goal if it is before `all'. .PHONY: all @@ -108,6 +113,11 @@ all: fetchmail fetchmail: $(objs) $(CC) $(LDEFLAGS) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail +po: dummy + make -C po + +dummy: + # Tester for address parsing rfc822: rfc822.c gcc -DTESTMAIN -g rfc822.c -o rfc822 @@ -140,23 +150,29 @@ install: @echo "Installing manual page..." $(INSTALL_DATA) $(srcdir)/fetchmail.man $(mandir)/fetchmail.$(manext) ln -f -s $(mandir)/fetchmail.$(manext) $(mandir)/fetchmailconf.$(manext) + @echo "Installing language catalogs..." + make -C po install uninstall: rm -f $(bindir)/fetchmail $(bindir)/fetchmailconf rm -f $(mandir)/fetchmail.$(manext) $(mandir)/fetchmailconf.$(manext) + make -C po uninstall .PHONY: clean realclean distclean mostlyclean clean: + make -C po clean -rm -f fetchmail *.o core fetchmail.dvi \ rcfile_l.c rcfile_y.h rcfile_y.c \ fetchmail.tar fetchmail.tar.gz \ rfc822 unmime distclean: clean + make -C po distclean -rm -f Makefile config.h TAGS tags -rm -f config.cache config.status config.log stamp-config realclean: distclean + make -C po clean -rm -f FAQ FEATURES NOTES MANIFEST -rm -f config.cache config.log Makefile -rm -f fetchmail-*.tar.gz fetchmail-*.i386.rpm @@ -199,7 +215,8 @@ rcfile_y.o: rcfile_y.c rcfile_y.h config.h fetchmail.h parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \ $(srcdir)/mx.h $(srcdir)/md5.h $(srcdir)/md5global.h \ - $(srcdir)/netrc.h $(srcdir)/tunable.h + $(srcdir)/netrc.h $(srcdir)/tunable.h $(srcdir)/i18n.h \ + $(srcdir)/aclocal.m4 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \ $(srcdir)/strcasecmp.c $(srcdir)/strstr.c $(srcdir)/memmove.c docs = $(srcdir)/COPYING $(srcdir)/FEATURES $(srcdir)/fetchmail-features.html \ @@ -213,7 +230,8 @@ config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \ scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs \ $(srcdir)/specgen.sh $(srcdir)/lsmgen.sh $(srcdir)/fetchmailconf all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \ - $(srcdir)/rh-config/* $(srcdir)/contrib/*[A-Za-uw-z] $(srcdir)/MANIFEST + $(srcdir)/rh-config/* $(srcdir)/contrib/*[A-Za-uw-z] \ + $(srcdir)/intl/* $(srcdir)/po/* ABOUT-NLS $(srcdir)/MANIFEST MANIFEST: $(srcdir) Makefile.in @echo $(all) | tr "[ \t]" '\n' | sed -e '/^\.\//s///' | sort >MANIFEST diff --git a/NEWS b/NEWS index 191ba83f..280d14c2 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,12 @@ Release Notes: +fetchmail-4.6.8 (): +* Internationalization support via GNU gettext from Arnaldo Carvalho de Melo + and Jorge Godoy . First + supported language is Brazilo-Portuegese (LC_ALL=pt_BR). + +There are 247 people on fetchmail-friends and 309 on fetchmail-announce. + fetchmail-4.6.7 (Sat Nov 21 13:59:47 EST 1998): * Gerald Britton's patches to enable Hesiod support. * Postmaster option fix from Bill Metzenthen . diff --git a/acconfig.h b/acconfig.h index bed9dde3..d0f1c611 100644 --- a/acconfig.h +++ b/acconfig.h @@ -14,12 +14,27 @@ Leave the following blank line there!! Autoheader needs it. */ -/* Define if you have res_search available in your bind library */ -#undef HAVE_RES_SEARCH +/* Define to 1 if NLS is requested. */ +#undef ENABLE_NLS + +/* Define as 1 if you have catgets and don't want to use GNU gettext. */ +#undef HAVE_CATGETS + +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +#undef HAVE_GETTEXT /* Define if you have herror available in your bind library */ #undef HAVE_HERROR +/* Define if your locale.h file contains LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define if you have res_search available in your bind library */ +#undef HAVE_RES_SEARCH + +/* Define as 1 if you have the stpcpy function. */ +#undef HAVE_STPCPY + /* Define if your C compiler allows void * as a function result */ #undef HAVE_VOIDPOINTER @@ -53,6 +68,9 @@ /* Define if you have setrlimit */ #undef HAVE_SETRLIMIT +/* Define to the name of the distribution. */ +#undef PACKAGE + /* Compute an appropriate directory for PID lock files */ #undef PID_DIR @@ -94,6 +112,9 @@ /* Define if you want built-in SOCKS support */ #undef HAVE_SOCKS +/* Define to the version of the distribution. */ +#undef VERSION + /* Leave that blank line there!! Autoheader needs it. If you're adding to this file, keep in mind: diff --git a/checkalias.c b/checkalias.c index 2afd8454..c7bf1872 100644 --- a/checkalias.c +++ b/checkalias.c @@ -3,6 +3,8 @@ * * Copyright 1997 by Eric S. Raymond * For license terms, see the file COPYING in this directory. + * + * i18n by Arnaldo Carvalho de Melo 7-Nov-1998 */ #include "config.h" #ifdef HAVE_GETHOSTBYNAME @@ -14,6 +16,7 @@ #include #include #include +#include "i18n.h" #include "mx.h" #include "fetchmail.h" @@ -136,15 +139,15 @@ int is_host_alias(const char *name, struct query *ctl) else if (((he_st = gethostbyname(ctl->server.truename)) != (struct hostent *)NULL) && ctl->server.checkalias) { if (outlevel >= O_DEBUG) - error(0, 0, "Checking if %s is really the same node as %s",ctl->server.truename,name); + error(0, 0, _("Checking if %s is really the same node as %s"),ctl->server.truename,name); if (is_ip_alias(ctl->server.truename,name) == TRUE) { if (outlevel >= O_DEBUG) - error(0, 0, "Yes, their IP addresses match"); + error(0, 0, _("Yes, their IP addresses match")); goto match; } if (outlevel >= O_DEBUG) - error(0, 0, "No, their IP addresses don't match"); + error(0, 0, _("No, their IP addresses don't match")); } else return(FALSE); @@ -162,7 +165,7 @@ int is_host_alias(const char *name, struct query *ctl) if (outlevel != O_SILENT) putchar('\n'); /* terminate the progress message */ error(0, 0, - "nameserver failure while looking for `%s' during poll of %s.", + _("nameserver failure while looking for `%s' during poll of %s."), name, ctl->server.pollname); ctl->errcount++; break; @@ -187,7 +190,7 @@ int is_host_alias(const char *name, struct query *ctl) case TRY_AGAIN: /* temporary error on authoritative server */ default: error(0, -1, - "nameserver failure while looking for `%s' during poll of %s.", + _("nameserver failure while looking for `%s' during poll of %s."), name, ctl->server.pollname); ctl->errcount++; break; diff --git a/configure.in b/configure.in index 1b16b394..52b2bd39 100644 --- a/configure.in +++ b/configure.in @@ -48,6 +48,23 @@ then fi fi +# i18n +# Arnaldo Carvalho de Melo +# Sat Nov 7 15:39:03 EDT 1998 + +PACKAGE=fetchmail +VERSION=4.6.7 +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") +AC_DEFINE_UNQUOTED(VERSION, "$VERSION") +AC_SUBST(PACKAGE) +AC_SUBST(VERSION) + +ALL_LINGUAS="pt_BR" + +AM_GNU_GETTEXT + +# end i18n + # Under sysV68, socket and friends are provided by the C library. # -linet does not provide socket, but causes multiple definition # errors at link-time. It is thus better to only use the C library. @@ -387,7 +404,7 @@ then LIBS="$LIBS -lgssapi_krb5 -lkrb5" fi]) -AC_OUTPUT(Makefile, [ +AC_OUTPUT([Makefile intl/Makefile po/Makefile.in], [ # The reason for this odd makedepend line is that we want # to have all dependencies evaluated relative to the source directory # and let VPATH do all the dirty work when we build remotely diff --git a/design-notes.html b/design-notes.html index fe4a511c..2e7a55da 100644 --- a/design-notes.html +++ b/design-notes.html @@ -10,7 +10,7 @@
Back to Fetchmail Home Page To Site Map -$Date: 1998/11/22 18:28:43 $ +$Date: 1998/11/26 03:58:51 $

Design Notes On Fetchmail

@@ -237,13 +237,13 @@ careful to preserve.

for the most common case can be much simpler and more robust.

  • - The multidrop handing does not rely on doing the equivalent of passing - the message to sendmail -oem -t. Instead, it explicitly mines members - of a specified set of local usernames out of the header.

    + The multidrop handing does not rely on doing the equivalent of + passing the message to sendmail -oem -t. Instead, it explicitly mines + members of a specified set of local usernames out of the header.

  • - We do not attempt delivery to multidrop mailboxes in the presence of DNS - errors. Before each multidrop poll we probe DNS to see if we have a + We do not attempt delivery to multidrop mailboxes in the presence + of DNS errors. Before each multidrop poll we probe DNS to see if we have a nameserver handy. If not, the poll is skipped. If DNS crashes during a poll, the error return from the next nameserver lookup aborts message delivery and ends the poll. The daemon mode will then quietly spin until @@ -299,6 +299,18 @@ in a system's libc, but we can just include that source file if the day comes when we want to support IPv6 without the inet6-apps library. It just makes life easier.

    +

    Internationalization

    + +Internationalization is handled using GNU gettext (see the file +ABOUT_NLS in the source distribution). This places some +minor constraints on the code.

    + +Strings that must be subject to translation should be wrapped with _() +or N_() -- the former in functuib arguments, the latter in static +initializers and other non-function-argument contexts.

    + +To test the support +

    Checklist for Adding Options

    Adding a control option is not complicated in principle, but there are @@ -516,7 +528,7 @@ all shaped the design in one way or another.

    Back to Fetchmail Home Page To Site Map -$Date: 1998/11/22 18:28:43 $ +$Date: 1998/11/26 03:58:51 $

    Eric S. Raymond <esr@snark.thyrsus.com>
    diff --git a/driver.c b/driver.c index a001d54e..32e08797 100644 --- a/driver.c +++ b/driver.c @@ -3,6 +3,8 @@ * * Copyright 1997 by Eric S. Raymond * For license terms, see the file COPYING in this directory. + * + * i18n by Arnaldo Carvalho de Melo 7-Nov-1998 */ #include "config.h" @@ -63,6 +65,7 @@ #include #include #endif /* KERBEROS_V5 */ +#include "i18n.h" #include "socket.h" #include "fetchmail.h" @@ -131,7 +134,7 @@ static void map_name(const char *name, struct query *ctl, struct idlist **xmit_n if (lname != (char *)NULL) { if (outlevel >= O_DEBUG) - error(0, 0, "mapped %s to local %s", name, lname); + error(0, 0, _("mapped %s to local %s"), name, lname); save_str(xmit_names, lname, XMIT_ACCEPT); accept_count++; } @@ -186,7 +189,7 @@ void find_server_names(const char *hdr, struct query *ctl, struct idlist **xmit_ strcasecmp(rhs, idp->id) == 0) { if (outlevel >= O_DEBUG) - error(0, 0, "passed through %s matching %s", + error(0, 0, _("passed through %s matching %s"), cp, idp->id); save_str(xmit_names, cp, XMIT_ACCEPT); accept_count++; @@ -232,7 +235,7 @@ static char *parse_received(struct query *ctl, char *bufp) static char rbuf[HOSTLEN + USERNAMELEN + 4]; if (outlevel >= O_DEBUG) - error(0, 0, "analyzing Received line:\n%s", bufp); + error(0, 0, _("analyzing Received line:\n%s"), bufp); /* * Try to extract the real envelope addressee. We look here * specifically for the mailserver's Received line. @@ -262,13 +265,13 @@ static char *parse_received(struct query *ctl, char *bufp) { if (outlevel >= O_DEBUG) error(0, 0, - "line accepted, %s is an alias of the mailserver", rbuf); + _("line accepted, %s is an alias of the mailserver"), rbuf); } else { if (outlevel >= O_DEBUG) error(0, 0, - "line rejected, %s is not an alias of the mailserver", + _("line rejected, %s is not an alias of the mailserver"), rbuf); return(NULL); } @@ -313,7 +316,7 @@ static char *parse_received(struct query *ctl, char *bufp) if (!ok) { if (outlevel >= O_DEBUG) - error(0, 0, "no Received address found"); + error(0, 0, _("no Received address found")); return(NULL); } else @@ -322,7 +325,7 @@ static char *parse_received(struct query *ctl, char *bufp) char *lf = rbuf + strlen(rbuf)-1; *lf = '\0'; if (outlevel >= O_DEBUG) - error(0, 0, "found Received address `%s'", rbuf+2); + error(0, 0, _("found Received address `%s'"), rbuf+2); *lf = '\n'; } return(rbuf); @@ -677,7 +680,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl, if (!headers_ok) { if (outlevel > O_SILENT) - error(0,0,"message delimiter found while scanning headers"); + error(0,0,_("message delimiter found while scanning headers")); } /* @@ -801,7 +804,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl, save_str(&msg.recipients, run.postmaster, XMIT_ACCEPT); if (outlevel >= O_DEBUG) error(0, 0, - "no local matches, forwarding to %s", + _("no local matches, forwarding to %s"), run.postmaster); } } @@ -815,7 +818,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl, if (ctl->errcount > olderrs) /* there were DNS errors above */ { if (outlevel >= O_DEBUG) - error(0,0, "forwarding and deletion suppressed due to DNS errors"); + error(0,0, _("forwarding and deletion suppressed due to DNS errors")); free(msg.headers); free_str_list(&msg.recipients); return(PS_TRANSIENT); @@ -903,7 +906,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl, if (n == -1) { - error(0, errno, "writing RFC822 msg.headers"); + error(0, errno, _("writing RFC822 msg.headers")); release_sink(ctl); free(msg.headers); free_str_list(&msg.recipients); @@ -923,13 +926,13 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl, if (no_local_matches) { if (reject_count != 1) - strcat(errhd, "no recipient addresses matched declared local names"); + strcat(errhd, _("no recipient addresses matched declared local names")); else { for (idp = msg.recipients; idp; idp = idp->next) if (idp->val.status.mark == XMIT_REJECT) break; - sprintf(errhd+strlen(errhd), "recipient address %s didn't match any local name", idp->id); + sprintf(errhd+strlen(errhd), _("recipient address %s didn't match any local name"), idp->id); } } @@ -937,14 +940,14 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl, { if (errhd[sizeof("X-Fetchmail-Warning: ")]) strcat(errhd, "; "); - strcat(errhd, "message has embedded NULs"); + strcat(errhd, _("message has embedded NULs")); } if (bad_addresses) { if (errhd[sizeof("X-Fetchmail-Warning: ")]) strcat(errhd, "; "); - strcat(errhd, "SMTP listener rejected local recipient addresses: "); + strcat(errhd, _("SMTP listener rejected local recipient addresses: ")); errlen = strlen(errhd); for (idp = msg.recipients; idp; idp = idp->next) if (idp->val.status.mark == XMIT_ANTISPAM) @@ -1059,7 +1062,7 @@ static int readbody(int sock, struct query *ctl, flag forward, int len) if (n < 0) { - error(0, errno, "writing message text"); + error(0, errno, _("writing message text")); release_sink(ctl); return(PS_IOERR); } @@ -1102,7 +1105,7 @@ const char *canonical; /* server name */ "KPOPV0.1")); if (rem != KSUCCESS) { - error(0, -1, "kerberos error %s", (krb_get_err_text (rem))); + error(0, -1, _("kerberos error %s"), (krb_get_err_text (rem))); return (PS_AUTHFAIL); } return (0); @@ -1161,7 +1164,7 @@ const char *canonical; /* server name */ if (retval) { if (err_ret && err_ret->text.length) { - error(0, 0, "krb5_sendauth: %s [server says '%*s'] ", + error(0, 0, _("krb5_sendauth: %s [server says '%*s'] "), error_message(retval), err_ret->text.length, err_ret->text.data); @@ -1256,7 +1259,7 @@ static void send_size_warnings(struct query *ctl) nbr = current->val.status.mark; size = atoi(current->id); stuff_warning(ctl, - "\t%d msg %d octets long skipped by fetchmail.", + _("\t%d msg %d octets long skipped by fetchmail."), nbr, size); } current->val.status.num++; @@ -1291,7 +1294,7 @@ const struct method *proto; /* protocol method table */ #ifndef KERBEROS_V4 if (ctl->server.preauthenticate == A_KERBEROS_V4) { - error(0, -1, "Kerberos V4 support not linked."); + error(0, -1, _("Kerberos V4 support not linked.")); return(PS_ERROR); } #endif /* KERBEROS_V4 */ @@ -1299,7 +1302,7 @@ const struct method *proto; /* protocol method table */ #ifndef KERBEROS_V5 if (ctl->server.preauthenticate == A_KERBEROS_V5) { - error(0, -1, "Kerberos V5 support not linked."); + error(0, -1, _("Kerberos V5 support not linked.")); return(PS_ERROR); } #endif /* KERBEROS_V5 */ @@ -1310,13 +1313,13 @@ const struct method *proto; /* protocol method table */ /* check for unsupported options */ if (ctl->flush) { error(0, 0, - "Option --flush is not supported with %s", + _("Option --flush is not supported with %s"), proto->name); return(PS_SYNTAX); } else if (ctl->fetchall) { error(0, 0, - "Option --all is not supported with %s", + _("Option --all is not supported with %s"), proto->name); return(PS_SYNTAX); } @@ -1324,7 +1327,7 @@ const struct method *proto; /* protocol method table */ if (!proto->getsizes && NUM_SPECIFIED(ctl->limit)) { error(0, 0, - "Option --limit is not supported with %s", + _("Option --limit is not supported with %s"), proto->name); return(PS_SYNTAX); } @@ -1342,22 +1345,22 @@ const struct method *proto; /* protocol method table */ { if (phase == OPEN_WAIT) error(0, 0, - "timeout after %d seconds waiting to connect to server %s.", + _("timeout after %d seconds waiting to connect to server %s."), ctl->server.timeout, ctl->server.pollname); else if (phase == SERVER_WAIT) error(0, 0, - "timeout after %d seconds waiting for server %s.", + _("timeout after %d seconds waiting for server %s."), ctl->server.timeout, ctl->server.pollname); else if (phase == FORWARDING_WAIT) error(0, 0, - "timeout after %d seconds waiting for %s.", + _("timeout after %d seconds waiting for %s."), ctl->server.timeout, ctl->mda ? "MDA" : "SMTP"); else if (phase == LISTENER_WAIT) error(0, 0, - "timeout after %d seconds waiting for listener to respond."); + _("timeout after %d seconds waiting for listener to respond.")); else - error(0, 0, "timeout after %d seconds.", ctl->server.timeout); + error(0, 0, _("timeout after %d seconds."), ctl->server.timeout); release_sink(ctl); if (ctl->smtp_socket != -1) @@ -1372,20 +1375,20 @@ const struct method *proto; /* protocol method table */ if (timeoutcount > MAX_TIMEOUTS && !open_warning_by_mail(ctl)) { stuff_warning(ctl, - "Subject: fetchmail sees repeated timeouts\r\n"); + _("Subject: fetchmail sees repeated timeouts\r\n")); stuff_warning(ctl, - "Fetchmail saw more than %d timouts while attempting to get mail from %s@%s.", + _("Fetchmail saw more than %d timouts while attempting to get mail from %s@%s."), MAX_TIMEOUTS, ctl->remotename, ctl->server.truename); stuff_warning(ctl, - "This could mean that your mailserver is stuck, or that your SMTP listener"); + _("This could mean that your mailserver is stuck, or that your SMTP listener")); stuff_warning(ctl, - "is wedged, or that your mailbox file on the server has been corrupted by"); + _("is wedged, or that your mailbox file on the server has been corrupted by")); stuff_warning(ctl, - "a server error. You can run `fetchmail -v -v' to diagnose the problem."); + _("a server error. You can run `fetchmail -v -v' to diagnose the problem.")); stuff_warning(ctl, - "Fetchmail won't poll this mailbox again until you restart it."); + _("Fetchmail won't poll this mailbox again until you restart it.")); close_warning_by_mail(ctl); ctl->wedged = TRUE; } @@ -1406,7 +1409,7 @@ const struct method *proto; /* protocol method table */ /* execute pre-initialization command, if any */ if (ctl->preconnect && (ok = system(ctl->preconnect))) { - sprintf(buf, "pre-connection command failed with status %d", ok); + sprintf(buf, _("pre-connection command failed with status %d"), ok); error(0, 0, buf); ok = PS_SYNTAX; goto closeUp; @@ -1433,7 +1436,7 @@ const struct method *proto; /* protocol method table */ int err_no = errno; #ifdef HAVE_RES_SEARCH if (err_no != 0 && h_errno != 0) - error(0, 0, "fetchmail: internal inconsistency"); + error(0, 0, _("fetchmail: internal inconsistency")); #endif /* * Avoid generating a bogus error every poll cycle when we're @@ -1443,21 +1446,21 @@ const struct method *proto; /* protocol method table */ if (err_no == EHOSTUNREACH && run.poll_interval) goto ehostunreach; - error_build("fetchmail: %s connection to %s failed", + error_build(_("fetchmail: %s connection to %s failed"), protocol->name, ctl->server.pollname); #ifdef HAVE_RES_SEARCH if (h_errno != 0) { if (h_errno == HOST_NOT_FOUND) - error_complete(0, 0, ": host is unknown"); + error_complete(0, 0, _(": host is unknown")); else if (h_errno == NO_ADDRESS) - error_complete(0, 0, ": name is valid but has no IP address"); + error_complete(0, 0, _(": name is valid but has no IP address")); else if (h_errno == NO_RECOVERY) - error_complete(0, 0, ": unrecoverable name server error"); + error_complete(0, 0, _(": unrecoverable name server error")); else if (h_errno == TRY_AGAIN) - error_complete(0, 0, ": temporary name server error"); + error_complete(0, 0, _(": temporary name server error")); else - error_complete(0, 0, ": unknown DNS error %d", h_errno); + error_complete(0, 0, _(": unknown DNS error %d"), h_errno); } else #endif /* HAVE_RES_SEARCH */ @@ -1513,14 +1516,14 @@ const struct method *proto; /* protocol method table */ if (ok != 0) { if (ok == PS_LOCKBUSY) - error(0, -1, "Lock-busy error on %s@%s", + error(0, -1, _("Lock-busy error on %s@%s"), ctl->remotename, ctl->server.truename); else { if (ok == PS_ERROR) ok = PS_AUTHFAIL; - error(0, -1, "Authorization failure on %s@%s", + error(0, -1, _("Authorization failure on %s@%s"), ctl->remotename, ctl->server.truename); @@ -1533,15 +1536,15 @@ const struct method *proto; /* protocol method table */ && !ctl->wedged && !open_warning_by_mail(ctl)) { stuff_warning(ctl, - "Subject: fetchmail authentication failed\r\n"); + _("Subject: fetchmail authentication failed\r\n")); stuff_warning(ctl, - "Fetchmail could not get mail from %s@%s.", + _("Fetchmail could not get mail from %s@%s."), ctl->remotename, ctl->server.truename); stuff_warning(ctl, - "The attempt to get authorization failed."); + _("The attempt to get authorization failed.")); stuff_warning(ctl, - "This probably means your password is invalid."); + _("This probably means your password is invalid.")); close_warning_by_mail(ctl); ctl->wedged = TRUE; } @@ -1562,9 +1565,9 @@ const struct method *proto; /* protocol method table */ if (outlevel >= O_DEBUG) if (idp->id) - error(0, 0, "selecting or re-polling folder %s", idp->id); + error(0, 0, _("selecting or re-polling folder %s"), idp->id); else - error(0, 0, "selecting or re-polling default folder"); + error(0, 0, _("selecting or re-polling default folder")); /* compute # of messages and number of new messages waiting */ ok = (protocol->getrange)(sock, ctl, idp->id, &count, &new, &bytes); @@ -1600,32 +1603,35 @@ const struct method *proto; /* protocol method table */ /* show user how many messages we downloaded */ if (idp->id) - (void) sprintf(buf, "%s at %s (folder %s)", + (void) sprintf(buf, _("%s at %s (folder %s)"), ctl->remotename, ctl->server.truename, idp->id); else - (void) sprintf(buf, "%s at %s", + (void) sprintf(buf, _("%s at %s"), ctl->remotename, ctl->server.truename); if (outlevel > O_SILENT) if (count == -1) /* only used for ETRN */ - error(0, 0, "Polling %s", ctl->server.truename); + error(0, 0, _("Polling %s"), ctl->server.truename); else if (count != 0) { if (new != -1 && (count - new) > 0) - error_build("%d message%s (%d seen) for %s", - count, count > 1 ? "s" : "", count-new, buf); + error_build(_("%d %s (%d seen) for %s"), + count, count > 1 ? _("messages") : + _("message"), + count-new, buf); else - error_build("%d message%s for %s", - count, count > 1 ? "s" : "", buf); + error_build(_("%d %s for %s"), + count, count > 1 ? _("messages") : + _("message"), buf); if (bytes == -1) error_complete(0, 0, "."); else - error_complete(0, 0, " (%d octets).", bytes); + error_complete(0, 0, _(" (%d octets)."), bytes); } else { /* these are pointless in normal daemon mode */ if (pass == 1 && (run.poll_interval == 0 || outlevel >= O_VERBOSE)) - error(0, 0, "No mail for %s", buf); + error(0, 0, _("No mail for %s"), buf); } /* very important, this is where we leave the do loop */ @@ -1698,7 +1704,7 @@ const struct method *proto; /* protocol method table */ { if (outlevel >= O_VERBOSE) error(0, 0, - "Skipping message %d, length -1", + _("Skipping message %d, length -1"), num - 1); continue; } @@ -1708,7 +1714,7 @@ const struct method *proto; /* protocol method table */ { if (outlevel > O_SILENT) { - error_build("skipping message %d", num); + error_build(_("skipping message %d"), num); if (toolarge && !check_only) { char size[32]; @@ -1753,7 +1759,7 @@ const struct method *proto; /* protocol method table */ tmp->val.status.num = cnt; } - error_build(" (oversized, %d octets)", + error_build(_(" (oversized, %d octets)"), msgsizes[num-1]); } } @@ -1776,12 +1782,12 @@ const struct method *proto; /* protocol method table */ if (outlevel > O_SILENT) { - error_build("reading message %d of %d", + error_build(_("reading message %d of %d"), num,count); if (len > 0) - error_build(" (%d %soctets)", - len, wholesize ? "" : "header "); + error_build(_(" (%d %soctets)"), + len, wholesize ? "" : _("header ")); if (outlevel >= O_VERBOSE) error_complete(0, 0, ""); else @@ -1826,7 +1832,7 @@ const struct method *proto; /* protocol method table */ if ((ok=(protocol->fetch_body)(sock,ctl,num,&len))) goto cleanUp; if (outlevel > O_SILENT && !wholesize) - error_build(" (%d body octets) ", len); + error_build(_(" (%d body octets) "), len); } } @@ -1895,7 +1901,7 @@ const struct method *proto; /* protocol method table */ { if (outlevel >= O_DEBUG) error(0, 0, - "message %d was not the expected length (%d actual != %d expected)", + _("message %d was not the expected length (%d actual != %d expected)"), num, msglen, msgsizes[num-1]); } @@ -1933,7 +1939,7 @@ const struct method *proto; /* protocol method table */ if (retained) { if (outlevel > O_SILENT) - error_complete(0, 0, " retained"); + error_complete(0, 0, _(" retained")); } else if (protocol->delete && !suppress_delete @@ -1941,7 +1947,7 @@ const struct method *proto; /* protocol method table */ { deletions++; if (outlevel > O_SILENT) - error_complete(0, 0, " flushed"); + error_complete(0, 0, _(" flushed")); ok = (protocol->delete)(sock, ctl, num); if (ok != 0) goto cleanUp; @@ -1950,7 +1956,7 @@ const struct method *proto; /* protocol method table */ #endif /* POP3_ENABLE */ } else if (outlevel > O_SILENT) - error_complete(0, 0, " not flushed"); + error_complete(0, 0, _(" not flushed")); /* perhaps this as many as we're ready to handle */ if (NUM_NONZERO(ctl->fetchlimit) && ctl->fetchlimit <= fetches) @@ -1993,40 +1999,40 @@ const struct method *proto; /* protocol method table */ switch (ok) { case PS_SOCKET: - msg = "socket"; + msg = _("socket"); break; case PS_AUTHFAIL: - msg = "authorization"; + msg = _("authorization"); break; case PS_SYNTAX: - msg = "missing or bad RFC822 header"; + msg = _("missing or bad RFC822 header"); break; case PS_IOERR: - msg = "MDA"; + msg = _("MDA"); break; case PS_ERROR: - msg = "client/server synchronization"; + msg = _("client/server synchronization"); break; case PS_PROTOCOL: - msg = "client/server protocol"; + msg = _("client/server protocol"); break; case PS_LOCKBUSY: - msg = "lock busy on server"; + msg = _("lock busy on server"); break; case PS_SMTP: - msg = "SMTP transaction"; + msg = _("SMTP transaction"); break; case PS_DNS: - msg = "DNS lookup"; + msg = _("DNS lookup"); break; case PS_UNDEFINED: - error(0, 0, "undefined"); + error(0, 0, _("undefined")); break; } if (ok==PS_SOCKET || ok==PS_AUTHFAIL || ok==PS_SYNTAX || ok==PS_IOERR || ok==PS_ERROR || ok==PS_PROTOCOL || ok==PS_LOCKBUSY || ok==PS_SMTP) - error(0,-1, "%s error while fetching from %s", msg, ctl->server.pollname); + error(0,-1, _("%s error while fetching from %s"), msg, ctl->server.pollname); closeUp: /* execute post-initialization command, if any */ @@ -2034,7 +2040,7 @@ closeUp: { char buf[80]; - sprintf(buf, "post-connection command failed with status %d", ok); + sprintf(buf, _("post-connection command failed with status %d"), ok); error(0, 0, buf); if (ok == PS_SUCCESS) ok = PS_SYNTAX; diff --git a/env.c b/env.c index da8168d6..95d93be2 100644 --- a/env.c +++ b/env.c @@ -2,6 +2,8 @@ * env.c -- small service routines * * For license terms, see the file COPYING in this directory. + * + * i18n by Arnaldo Carvalho de Melo 7-Nov-1998 */ #include "config.h" @@ -25,6 +27,8 @@ #endif #include "fetchmail.h" +#include "i18n.h" + extern char *getenv(); /* needed on sysV68 R3V7.1. */ extern char *program_name; @@ -52,7 +56,7 @@ void envquery(int argc, char **argv) else { fprintf(stderr, - "%s: can't find your name and home directory!\n", + _("%s: can't find your name and home directory!\n"), program_name); exit(PS_UNDEFINED); } @@ -77,7 +81,7 @@ char *host_fqdn(void) if (gethostname(tmpbuf, sizeof(tmpbuf))) { - fprintf(stderr, "%s: can't determine your host!", + fprintf(stderr, _("%s: can't determine your host!"), program_name); exit(PS_DNS); } @@ -93,7 +97,7 @@ char *host_fqdn(void) { /* exit with error message */ fprintf(stderr, - "gethostbyname failed for %s\n", tmpbuf); + _("gethostbyname failed for %s\n"), tmpbuf); exit(PS_DNS); } return(xstrdup(hp->h_name)); diff --git a/etrn.c b/etrn.c index d0647d00..74dadc1e 100644 --- a/etrn.c +++ b/etrn.c @@ -2,6 +2,8 @@ * etrn.c -- ETRN protocol methods * * For license terms, see the file COPYING in this directory. + * + * i18n by Arnaldo Carvalho de Melo 7-Nov-1998 */ #include "config.h" @@ -12,6 +14,7 @@ #include #include #include +#include "i18n.h" #include "fetchmail.h" #include "smtp.h" #include "socket.h" @@ -38,13 +41,13 @@ static int etrn_getrange(int sock, struct query *ctl, const char *id, if ((ok = SMTP_ehlo(sock, ctl->server.truename, &opts))) { - error(0, 0, "%s's SMTP listener does not support ESMTP", + error(0, 0, _("%s's SMTP listener does not support ESMTP"), ctl->server.pollname); return(ok); } else if (!(opts & ESMTP_ETRN)) { - error(0, 0, "%s's SMTP listener does not support ETRN", + error(0, 0, _("%s's SMTP listener does not support ETRN"), ctl->server.pollname); return(PS_PROTOCOL); } @@ -67,36 +70,36 @@ static int etrn_getrange(int sock, struct query *ctl, const char *id, switch(atoi(buf)) { case 250: /* OK, queuing for node started */ - error(0, 0, "Queuing for %s started", qnp->id); + error(0, 0, _("Queuing for %s started"), qnp->id); break; case 251: /* OK, no messages waiting for node */ - error(0, 0, "No messages waiting for %s", qnp->id); + error(0, 0, _("No messages waiting for %s"), qnp->id); return(PS_NOMAIL); case 252: /* OK, pending messages for node started */ case 253: /* OK, pending messages for node started */ - error(0, 0, "Pending messages for %s started", qnp->id); + error(0, 0, _("Pending messages for %s started"), qnp->id); break; case 458: /* Unable to queue messages for node */ - error(0, -1, "Unable to queue messages for node %s",qnp->id); + error(0, -1, _("Unable to queue messages for node %s"),qnp->id); return(PS_PROTOCOL); case 459: /* Node not allowed: */ - error(0, -1, "Node %s not allowed: %s", qnp->id, buf); + error(0, -1, _("Node %s not allowed: %s"), qnp->id, buf); return(PS_AUTHFAIL); case 500: /* Syntax Error */ - error(0, -1, "ETRN syntax error"); + error(0, -1, _("ETRN syntax error")); return(PS_PROTOCOL); case 501: /* Syntax Error in Parameters */ - error(0, -1, "ETRN syntax error in parameters"); + error(0, -1, _("ETRN syntax error in parameters")); return(PS_PROTOCOL); default: - error(0, -1, "Unknown ETRN error %d", atoi(buf)); + error(0, -1, _("Unknown ETRN error %d"), atoi(buf)); return(PS_PROTOCOL); } } @@ -140,19 +143,19 @@ int doETRN (struct query *ctl) int status; if (ctl->keep) { - fprintf(stderr, "Option --keep is not supported with ETRN\n"); + fprintf(stderr, _("Option --keep is not supported with ETRN\n")); return(PS_SYNTAX); } if (ctl->flush) { - fprintf(stderr, "Option --flush is not supported with ETRN\n"); + fprintf(stderr, _("Option --flush is not supported with ETRN\n")); return(PS_SYNTAX); } if (ctl->mailboxes->id) { - fprintf(stderr, "Option --remote is not supported with ETRN\n"); + fprintf(stderr, _("Option --remote is not supported with ETRN\n")); return(PS_SYNTAX); } if (check_only) { - fprintf(stderr, "Option --check is not supported with ETRN\n"); + fprintf(stderr, _("Option --check is not supported with ETRN\n")); return(PS_SYNTAX); } peek_capable = FALSE; diff --git a/fetchmail-features.html b/fetchmail-features.html index 1bed085b..39201aa4 100644 --- a/fetchmail-features.html +++ b/fetchmail-features.html @@ -10,7 +10,7 @@
    Back to Fetchmail Home Page To Site Map -$Date: 1998/11/17 16:29:22 $ +$Date: 1998/11/26 03:58:53 $

    @@ -18,6 +18,8 @@

    Since 4.0:

      +
    • True multi-language support using GNU gettext. +
    • Support for use of HESIOD with Kerberos.
    • The -bsmtp option supports recording fetched mail as a BSMTP batch. @@ -159,7 +161,7 @@ get-mail, gwpop, pimp-1.0, pop-perl5-1.2, popc, popmail-1.6 and upop.

      Back to Fetchmail Home Page To Site Map -$Date: 1998/11/17 16:29:22 $ +$Date: 1998/11/26 03:58:53 $

      Eric S. Raymond <esr@snark.thyrsus.com>
      diff --git a/fetchmail.c b/fetchmail.c index cd8657bc..cafde674 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -2,6 +2,8 @@ * fetchmail.c -- main driver module for fetchmail * * For license terms, see the file COPYING in this directory. + * + * i18n by Arnaldo Carvalho de Melo 7-Nov-1998 */ #include "config.h" @@ -43,6 +45,7 @@ #include "smtp.h" #include "getopt.h" #include "netrc.h" +#include "i18n.h" #ifndef ENETUNREACH #define ENETUNREACH 128 /* Interactive doesn't know this */ @@ -128,7 +131,7 @@ static void unlockit(void) int itimerflag; void itimerthread(void* dummy) { if (outlevel >= O_VERBOSE) - fprintf(stderr, "fetchmail: thread sleeping for %d sec.\n", poll_interval); + fprintf(stderr, _("fetchmail: thread sleeping for %d sec.\n"), poll_interval); while(1) { _sleep2(poll_interval*1000); kill((getpid()), SIGALRM); @@ -147,6 +150,10 @@ int main (int argc, char **argv) pid_t pid; envquery(argc, argv); +#ifdef ENABLE_NLS + bindtextdomain("fetchmail", "/usr/share/locale"); + textdomain("fetchmail"); +#endif #define IDFILE_NAME ".fetchids" run.idfile = (char *) xmalloc(strlen(home)+strlen(IDFILE_NAME)+2); @@ -164,7 +171,7 @@ int main (int argc, char **argv) if (versioninfo) { - printf("This is fetchmail release %s", RELEASE_ID); + printf(_("This is fetchmail release %s"), RELEASE_ID); #ifdef POP2_ENABLE printf("+POP2"); #endif /* POP2_ENABLE */ @@ -200,6 +207,9 @@ int main (int argc, char **argv) printf("+SOCKS"); #endif #endif /* HAVE_SOCKS */ +#if ENABLE_NLS + printf("+NLS"); +#endif /* ENABLE_NLS */ putchar('\n'); /* this is an attempt to help remote debugging */ @@ -225,17 +235,17 @@ int main (int argc, char **argv) /* perhaps we just want to check options? */ if (versioninfo) { - printf("Taking options from command line"); + printf(_("Taking options from command line")); if (access(rcfile, 0)) printf("\n"); else - printf(" and %s\n", rcfile); + printf(_(" and %s\n"), rcfile); if (outlevel >= O_VERBOSE) - printf("Lockfile at %s\n", tmpbuf); + printf(_("Lockfile at %s\n"), tmpbuf); if (querylist == NULL) (void) fprintf(stderr, - "No mailservers set up -- perhaps %s is missing?\n", rcfile); + _("No mailservers set up -- perhaps %s is missing?\n"), rcfile); else dump_params(&run, querylist, implicitmode); exit(0); @@ -252,7 +262,7 @@ int main (int argc, char **argv) pid = -1; if ((lockfile = (char *) malloc(strlen(tmpbuf) + 1)) == NULL) { - fprintf(stderr,"fetchmail: cannot allocate memory for lock name.\n"); + fprintf(stderr,_("fetchmail: cannot allocate memory for lock name.\n")); exit(PS_EXCLUDE); } else @@ -262,7 +272,7 @@ int main (int argc, char **argv) bkgd = (fscanf(lockfp,"%d %d", &pid, &st) == 2); if (kill(pid, 0) == -1) { - fprintf(stderr,"fetchmail: removing stale lockfile\n"); + fprintf(stderr,_("fetchmail: removing stale lockfile\n")); pid = -1; bkgd = FALSE; unlink(lockfile); @@ -272,7 +282,7 @@ int main (int argc, char **argv) /* if no mail servers listed and nothing in background, we're done */ if (!(quitmode && argc == 2) && pid == -1 && querylist == NULL) { - (void)fputs("fetchmail: no mailservers have been specified.\n",stderr); + (void)fputs(_("fetchmail: no mailservers have been specified.\n"),stderr); exit(PS_SYNTAX); } @@ -281,20 +291,20 @@ int main (int argc, char **argv) { if (pid == -1) { - fprintf(stderr,"fetchmail: no other fetchmail is running\n"); + fprintf(stderr,_("fetchmail: no other fetchmail is running\n")); if (argc == 2) exit(PS_EXCLUDE); } else if (kill(pid, SIGTERM) < 0) { - fprintf(stderr,"fetchmail: error killing %s fetchmail at %d; bailing out.\n", - bkgd ? "background" : "foreground", pid); + fprintf(stderr,_("fetchmail: error killing %s fetchmail at %d; bailing out.\n"), + bkgd ? _("background") : _("foreground"), pid); exit(PS_EXCLUDE); } else { - fprintf(stderr,"fetchmail: %s fetchmail at %d killed.\n", - bkgd ? "background" : "foreground", pid); + fprintf(stderr,_("fetchmail: %s fetchmail at %d killed.\n"), + bkgd ? _("background") : _("foreground"), pid); unlink(lockfile); if (argc == 2) exit(0); @@ -309,33 +319,33 @@ int main (int argc, char **argv) if (check_only) { fprintf(stderr, - "fetchmail: can't check mail while another fetchmail to same host is running.\n"); + _("fetchmail: can't check mail while another fetchmail to same host is running.\n")); return(PS_EXCLUDE); } else if (!implicitmode) { fprintf(stderr, - "fetchmail: can't poll specified hosts with another fetchmail running at %d.\n", + _("fetchmail: can't poll specified hosts with another fetchmail running at %d.\n"), pid); return(PS_EXCLUDE); } else if (!bkgd) { fprintf(stderr, - "fetchmail: another foreground fetchmail is running at %d.\n", + _("fetchmail: another foreground fetchmail is running at %d.\n"), pid); return(PS_EXCLUDE); } else if (argc > 1) { fprintf(stderr, - "fetchmail: can't accept options while a background fetchmail is running.\n"); + _("fetchmail: can't accept options while a background fetchmail is running.\n")); return(PS_EXCLUDE); } else if (kill(pid, SIGUSR1) == 0) { fprintf(stderr, - "fetchmail: background fetchmail at %d awakened.\n", + _("fetchmail: background fetchmail at %d awakened.\n"), pid); return(0); } @@ -347,7 +357,7 @@ int main (int argc, char **argv) * SIGUSR1/SIGHUP transmission. */ fprintf(stderr, - "fetchmail: elder sibling at %d died mysteriously.\n", + _("fetchmail: elder sibling at %d died mysteriously.\n"), pid); return(PS_UNDEFINED); } @@ -406,14 +416,14 @@ int main (int argc, char **argv) #endif /* GSSAPI */ && !ctl->password) { -#define PASSWORD_PROMPT "Enter password for %s@%s: " - xalloca(tmpbuf, char *, strlen(PASSWORD_PROMPT) + + char* password_prompt = _("Enter password for %s@%s: "); + + xalloca(tmpbuf, char *, strlen(password_prompt) + strlen(ctl->remotename) + strlen(ctl->server.pollname) + 1); - (void) sprintf(tmpbuf, PASSWORD_PROMPT, + (void) sprintf(tmpbuf, password_prompt, ctl->remotename, ctl->server.pollname); ctl->password = xstrdup((char *)getpassword(tmpbuf)); -#undef PASSWORD_PROMPT } } } @@ -446,7 +456,7 @@ int main (int argc, char **argv) { if (!nodetach) daemonize(run.logfile, termhook); - error( 0, 0, "starting fetchmail %s daemon ", RELEASE_ID); + error( 0, 0, _("starting fetchmail %s daemon "), RELEASE_ID); /* * We'll set up a handler for these when we're sleeping, @@ -506,7 +516,7 @@ int main (int argc, char **argv) if (ctl->wedged) { error(0, -1, - "poll of %s skipped (failed authentication or too many timeouts)", + _("poll of %s skipped (failed authentication or too many timeouts)"), ctl->server.pollname); continue; } @@ -519,7 +529,7 @@ int main (int argc, char **argv) { if (outlevel >= O_VERBOSE) error(0, -1, - "interval not reached, not querying %s", + _("interval not reached, not querying %s"), ctl->server.pollname); continue; } @@ -546,13 +556,13 @@ int main (int argc, char **argv) { write_saved_lists(querylist, run.idfile); if (outlevel >= O_DEBUG) - error(0, 0, "saved UID List"); + error(0, 0, _("saved UID List")); } #endif /* POP3_ENABLE */ } else if (!check_only && ((querystatus!=PS_NOMAIL) || (outlevel==O_DEBUG))) - error(0, 0, "Query status=%d", querystatus); + error(0, 0, _("Query status=%d"), querystatus); #if defined(linux) && !INET6 if (ctl->server.monitor) @@ -608,12 +618,12 @@ int main (int argc, char **argv) unwedged++; if (!unwedged) { - error(0, -1, "All connections are wedged. Exiting."); + error(0, -1, _("All connections are wedged. Exiting.")); exit(PS_AUTHFAIL); } if (outlevel >= O_VERBOSE) - error(0, -1, "fetchmail: sleeping at %s", rfc822timestamp()); + error(0, -1, _("fetchmail: sleeping at %s"), rfc822timestamp()); /* * With this simple hack, we make it possible for a foreground @@ -708,9 +718,9 @@ int main (int argc, char **argv) || ((run.poll_interval && !getuid()) && lastsig == SIGHUP)) { #ifdef SYS_SIGLIST_DECLARED - error(0, 0, "awakened by %s", sys_siglist[lastsig]); + error(0, 0, _("awakened by %s"), sys_siglist[lastsig]); #else - error(0, 0, "awakened by signal %d", lastsig); + error(0, 0, _("awakened by signal %d"), lastsig); #endif } } @@ -721,13 +731,13 @@ int main (int argc, char **argv) signal(SIGHUP, SIG_IGN); if (outlevel >= O_VERBOSE) - error(0, -1, "awakened at %s", rfc822timestamp()); + error(0, -1, _("awakened at %s"), rfc822timestamp()); } } while (run.poll_interval); if (outlevel >= O_VERBOSE) - error(0, -1, "normal termination, status %d", + error(0, -1, _("normal termination, status %d"), successes ? PS_SUCCESS : querystatus); termhook(0); @@ -854,7 +864,7 @@ static int load_params(int argc, char **argv, int optind) { /* Is this correct? */ if(predeclared) - fprintf(stderr,"Warning: multiple mentions of host %s in config file\n",argv[optind]); + fprintf(stderr,_("Warning: multiple mentions of host %s in config file\n"),argv[optind]); ctl->active = TRUE; predeclared = TRUE; } @@ -962,7 +972,7 @@ static int load_params(int argc, char **argv, int optind) if (ctl->localnames && ctl->localnames->next && ctl->server.dns) { ctl->server.dns = FALSE; - fprintf(stderr, "fetchmail: warning: no DNS available to check multidrop fetches from %s\n", ctl->server.pollname); + fprintf(stderr, _("fetchmail: warning: no DNS available to check multidrop fetches from %s\n"), ctl->server.pollname); } #endif /* !HAVE_GETHOSTBYNAME || !HAVE_RES_SEARCH */ @@ -1001,7 +1011,7 @@ static int load_params(int argc, char **argv, int optind) free(ctl->server.via); ctl->server.via = xstrdup(hes_p->po_host); } else { - error(0, errno, "couldn't find HESIOD pobox for %s", + error(0, errno, _("couldn't find HESIOD pobox for %s"), ctl->remotename); } } @@ -1027,7 +1037,7 @@ static int load_params(int argc, char **argv, int optind) if (namerec == (struct hostent *)NULL) { error(0, errno, - "couldn't find canonical DNS name of %s", + _("couldn't find canonical DNS name of %s"), ctl->server.pollname); exit(PS_DNS); } @@ -1051,14 +1061,14 @@ static int load_params(int argc, char **argv, int optind) if (ctl->server.port < 0) { (void) fprintf(stderr, - "%s configuration invalid, port number cannot be negative\n", + _("%s configuration invalid, port number cannot be negative\n"), ctl->server.pollname); exit(PS_SYNTAX); } if (ctl->server.protocol == P_RPOP && ctl->server.port >= 1024) { (void) fprintf(stderr, - "%s configuration invalid, RPOP requires a privileged port\n", + _("%s configuration invalid, RPOP requires a privileged port\n"), ctl->server.pollname); exit(PS_SYNTAX); } @@ -1078,7 +1088,7 @@ static int load_params(int argc, char **argv, int optind) #endif /* INET6 */ { (void) fprintf(stderr, - "%s configuration invalid, LMTP can't use default SMTP port\n", + _("%s configuration invalid, LMTP can't use default SMTP port\n"), ctl->server.pollname); exit(PS_SYNTAX); } @@ -1143,7 +1153,7 @@ static void termhook(int sig) */ if (sig != 0) - error(0, 0, "terminated with signal %d", sig); + error(0, 0, _("terminated with signal %d"), sig); else /* terminate all SMTP connections cleanly */ for (ctl = querylist; ctl; ctl = ctl->next) @@ -1203,7 +1213,7 @@ static int query_host(struct query *ctl) time_t now; time(&now); - error(0, -1, "fetchmail: %s querying %s (protocol %s) at %s", + error(0, -1, _("fetchmail: %s querying %s (protocol %s) at %s"), RELEASE_ID, ctl->server.pollname, showproto(ctl->server.protocol), ctime(&now)); } @@ -1222,7 +1232,7 @@ static int query_host(struct query *ctl) #ifdef POP2_ENABLE return(doPOP2(ctl)); #else - error(0, -1, "POP2 support is not configured.\n"); + error(0, -1, _("POP2 support is not configured.\n")); return(PS_PROTOCOL); #endif /* POP2_ENABLE */ break; @@ -1232,7 +1242,7 @@ static int query_host(struct query *ctl) #ifdef POP3_ENABLE return(doPOP3(ctl)); #else - error(0, -1, "POP3 support is not configured.\n"); + error(0, -1, _("POP3 support is not configured.\n")); return(PS_PROTOCOL); #endif /* POP3_ENABLE */ break; @@ -1244,24 +1254,24 @@ static int query_host(struct query *ctl) #ifdef IMAP_ENABLE return(doIMAP(ctl)); #else - error(0, -1, "IMAP support is not configured.\n"); + error(0, -1, _("IMAP support is not configured.\n")); return(PS_PROTOCOL); #endif /* IMAP_ENABLE */ break; case P_ETRN: #ifndef ETRN_ENABLE - error(0, -1, "ETRN support is not configured.\n"); + error(0, -1, _("ETRN support is not configured.\n")); return(PS_PROTOCOL); #else #ifdef HAVE_GETHOSTBYNAME return(doETRN(ctl)); #else - error(0, -1, "Cannot support ETRN without gethostbyname(2).\n"); + error(0, -1, _("Cannot support ETRN without gethostbyname(2).\n")); return(PS_PROTOCOL); #endif /* HAVE_GETHOSTBYNAME */ #endif /* ETRN_ENABLE */ default: - error(0, 0, "unsupported protocol selected."); + error(0, 0, _("unsupported protocol selected.")); return(PS_PROTOCOL); } } @@ -1273,19 +1283,19 @@ static void dump_params (struct runctl *runp, struct query *ctl; if (runp->poll_interval) - printf("Poll interval is %d seconds\n", runp->poll_interval); + printf(_("Poll interval is %d seconds\n"), runp->poll_interval); if (runp->logfile) - printf("Logfile is %s\n", runp->logfile); + printf(_("Logfile is %s\n"), runp->logfile); if (strcmp(runp->idfile, IDFILE_NAME)) - printf("Idfile is %s\n", runp->idfile); + printf(_("Idfile is %s\n"), runp->idfile); #if defined(HAVE_SYSLOG) if (runp->use_syslog) - printf("Progress messages will be logged via syslog\n"); + printf(_("Progress messages will be logged via syslog\n")); #endif if (runp->invisible) - printf("Fetchmail will masquerade and will not generate Received\n"); + printf(_("Fetchmail will masquerade and will not generate Received\n")); if (runp->postmaster) - printf("Fetchmail will forward misaddressed multidrop messages to %s.\n", + printf(_("Fetchmail will forward misaddressed multidrop messages to %s.\n"), runp->postmaster); for (ctl = querylist; ctl; ctl = ctl->next) @@ -1293,20 +1303,20 @@ static void dump_params (struct runctl *runp, if (!ctl->active || (implicit && ctl->server.skip)) continue; - printf("Options for retrieving from %s@%s:\n", + printf(_("Options for retrieving from %s@%s:\n"), ctl->remotename, visbuf(ctl->server.pollname)); if (ctl->server.via && (ctl->server.protocol != P_ETRN)) - printf(" Mail will be retrieved via %s\n", ctl->server.via); + printf(_(" Mail will be retrieved via %s\n"), ctl->server.via); if (ctl->server.interval) - printf(" Poll of this server will occur every %d intervals.\n", + printf(_(" Poll of this server will occur every %d intervals.\n"), ctl->server.interval); if (ctl->server.truename) - printf(" True name of server is %s.\n", ctl->server.truename); + printf(_(" True name of server is %s.\n"), ctl->server.truename); if (ctl->server.skip || outlevel >= O_VERBOSE) - printf(" This host will%s be queried when no host is specified.\n", - ctl->server.skip ? " not" : ""); + printf(_(" This host %s be queried when no host is specified.\n"), + ctl->server.skip ? _("will not") : _("will")); /* * Don't poll for password when there is one or when using the ETRN * or IMAP-GSS protocol @@ -1316,14 +1326,14 @@ static void dump_params (struct runctl *runp, && (ctl->server.protocol != P_IMAP_GSS) #endif /* GSSAPI */ ) - printf(" Password will be prompted for.\n"); + printf(_(" Password will be prompted for.\n")); else if (outlevel >= O_VERBOSE) if (ctl->server.protocol == P_APOP) - printf(" APOP secret = \"%s\".\n", visbuf(ctl->password)); + printf(_(" APOP secret = \"%s\".\n"), visbuf(ctl->password)); else if (ctl->server.protocol == P_RPOP) - printf(" RPOP id = \"%s\".\n", visbuf(ctl->password)); + printf(_(" RPOP id = \"%s\".\n"), visbuf(ctl->password)); else - printf(" Password = \"%s\".\n", visbuf(ctl->password)); + printf(_(" Password = \"%s\".\n"), visbuf(ctl->password)); if (ctl->server.protocol == P_POP3 #if INET6 && !strcmp(ctl->server.service, KPOP_PORT) @@ -1332,121 +1342,121 @@ static void dump_params (struct runctl *runp, #endif /* INET6 */ && (ctl->server.preauthenticate == A_KERBEROS_V4 || ctl->server.preauthenticate == A_KERBEROS_V5)) - printf(" Protocol is KPOP with Kerberos %s authentication", + printf(_(" Protocol is KPOP with Kerberos %s authentication"), ctl->server.preauthenticate == A_KERBEROS_V5 ? "V" : "IV"); else - printf(" Protocol is %s", showproto(ctl->server.protocol)); + printf(_(" Protocol is %s"), showproto(ctl->server.protocol)); #if INET6 if (ctl->server.service) - printf(" (using service %s)", ctl->server.service); + printf(_(" (using service %s)"), ctl->server.service); if (ctl->server.netsec) - printf(" (using network security options %s)", ctl->server.netsec); + printf(_(" (using network security options %s)"), ctl->server.netsec); #else /* INET6 */ if (ctl->server.port) - printf(" (using port %d)", ctl->server.port); + printf(_(" (using port %d)"), ctl->server.port); #endif /* INET6 */ else if (outlevel >= O_VERBOSE) - printf(" (using default port)"); + printf(_(" (using default port)")); if (ctl->server.uidl && (ctl->server.protocol != P_ETRN)) - printf(" (forcing UIDL use)"); + printf(_(" (forcing UIDL use)")); putchar('.'); putchar('\n'); if (ctl->server.preauthenticate == A_KERBEROS_V4) - printf(" Kerberos V4 preauthentication enabled.\n"); + printf(_(" Kerberos V4 preauthentication enabled.\n")); if (ctl->server.preauthenticate == A_KERBEROS_V5) - printf(" Kerberos V5 preauthentication enabled.\n"); + printf(_(" Kerberos V5 preauthentication enabled.\n")); if (ctl->server.timeout > 0) - printf(" Server nonresponse timeout is %d seconds", ctl->server.timeout); + printf(_(" Server nonresponse timeout is %d seconds"), ctl->server.timeout); if (ctl->server.timeout == CLIENT_TIMEOUT) - printf(" (default).\n"); + printf(_(" (default).\n")); else printf(".\n"); if (ctl->server.protocol != P_ETRN) { if (!ctl->mailboxes->id) - printf(" Default mailbox selected.\n"); + printf(_(" Default mailbox selected.\n")); else { struct idlist *idp; - printf(" Selected mailboxes are:"); + printf(_(" Selected mailboxes are:")); for (idp = ctl->mailboxes; idp; idp = idp->next) printf(" %s", idp->id); printf("\n"); } - printf(" %s messages will be retrieved (--all %s).\n", - ctl->fetchall ? "All" : "Only new", + printf(_(" %s messages will be retrieved (--all %s).\n"), + ctl->fetchall ? _("All") : _("Only new"), ctl->fetchall ? "on" : "off"); - printf(" Fetched messages will%s be kept on the server (--keep %s).\n", - ctl->keep ? "" : " not", + printf(_(" Fetched messages %s be kept on the server (--keep %s).\n"), + ctl->keep ? _("will") : _("will not"), ctl->keep ? "on" : "off"); - printf(" Old messages will%s be flushed before message retrieval (--flush %s).\n", - ctl->flush ? "" : " not", + printf(_(" Old messages %s be flushed before message retrieval (--flush %s).\n"), + ctl->flush ? _("will") : _("will not"), ctl->flush ? "on" : "off"); - printf(" Rewrite of server-local addresses is %sabled (--norewrite %s).\n", - ctl->rewrite ? "en" : "dis", + printf(_(" Rewrite of server-local addresses is %s (--norewrite %s).\n"), + ctl->rewrite ? _("enabled") : _("disabled"), ctl->rewrite ? "off" : "on"); - printf(" Carriage-return stripping is %sabled (stripcr %s).\n", - ctl->stripcr ? "en" : "dis", + printf(_(" Carriage-return stripping is %s (stripcr %s).\n"), + ctl->stripcr ? _("enabled") : _("disabled"), ctl->stripcr ? "on" : "off"); - printf(" Carriage-return forcing is %sabled (forcecr %s).\n", - ctl->forcecr ? "en" : "dis", + printf(_(" Carriage-return forcing is %s (forcecr %s).\n"), + ctl->forcecr ? _("enabled") : _("disabled"), ctl->forcecr ? "on" : "off"); - printf(" Interpretation of Content-Transfer-Encoding is %sabled (pass8bits %s).\n", - ctl->pass8bits ? "dis" : "en", + printf(_(" Interpretation of Content-Transfer-Encoding is %s (pass8bits %s).\n"), + ctl->pass8bits ? _("disabled") : _("enabled"), ctl->pass8bits ? "on" : "off"); - printf(" MIME decoding is %sabled (mimedecode %s).\n", - ctl->mimedecode ? "en" : "dis", + printf(_(" MIME decoding is %s (mimedecode %s).\n"), + ctl->mimedecode ? _("enabled") : _("disabled"), ctl->mimedecode ? "on" : "off"); - printf(" Nonempty Status lines will be %s (dropstatus %s)\n", - ctl->dropstatus ? "discarded" : "kept", + printf(_(" Nonempty Status lines will be %s (dropstatus %s)\n"), + ctl->dropstatus ? _("discarded") : _("kept"), ctl->dropstatus ? "on" : "off"); if (NUM_NONZERO(ctl->limit)) { if (NUM_NONZERO(ctl->limit)) - printf(" Message size limit is %d bytes (--limit %d).\n", + printf(_(" Message size limit is %d bytes (--limit %d).\n"), ctl->limit, ctl->limit); else if (outlevel >= O_VERBOSE) - printf(" No message size limit (--limit 0).\n"); + printf(_(" No message size limit (--limit 0).\n")); if (run.poll_interval > 0) - printf(" Message size warning interval is %d seconds (--warnings %d).\n", + printf(_(" Message size warning interval is %d seconds (--warnings %d).\n"), ctl->warnings, ctl->warnings); else if (outlevel >= O_VERBOSE) - printf(" Size warnings on every poll (--warnings 0).\n"); + printf(_(" Size warnings on every poll (--warnings 0).\n")); } if (NUM_NONZERO(ctl->fetchlimit)) - printf(" Received-message limit is %d (--fetchlimit %d).\n", + printf(_(" Received-message limit is %d (--fetchlimit %d).\n"), ctl->fetchlimit, ctl->fetchlimit); else if (outlevel >= O_VERBOSE) - printf(" No received-message limit (--fetchlimit 0).\n"); + printf(_(" No received-message limit (--fetchlimit 0).\n")); if (NUM_NONZERO(ctl->batchlimit)) - printf(" SMTP message batch limit is %d.\n", ctl->batchlimit); + printf(_(" SMTP message batch limit is %d.\n"), ctl->batchlimit); else if (outlevel >= O_VERBOSE) - printf(" No SMTP message batch limit (--batchlimit 0).\n"); + printf(_(" No SMTP message batch limit (--batchlimit 0).\n")); if (ctl->server.protocol == P_IMAP) if (NUM_NONZERO(ctl->expunge)) - printf(" Deletion interval between expunges is %d (--expunge %d).\n", ctl->expunge, ctl->expunge); + printf(_(" Deletion interval between expunges is %d (--expunge %d).\n"), ctl->expunge, ctl->expunge); else if (outlevel >= O_VERBOSE) - printf(" No expunges (--expunge 0).\n"); + printf(_(" No expunges (--expunge 0).\n")); } if (ctl->bsmtp) - printf(" Messages will be appended to %s as BSMTP\n", visbuf(ctl->bsmtp)); + printf(_(" Messages will be appended to %s as BSMTP\n"), visbuf(ctl->bsmtp)); else if (ctl->mda && (ctl->server.protocol != P_ETRN)) - printf(" Messages will be delivered with \"%s\".\n", visbuf(ctl->mda)); + printf(_(" Messages will be delivered with \"%s\".\n"), visbuf(ctl->mda)); else { struct idlist *idp; - printf(" Messages will be %cMTP-forwarded to:", ctl->listener); + printf(_(" Messages will be %cMTP-forwarded to:"), ctl->listener); for (idp = ctl->smtphunt; idp; idp = idp->next) { printf(" %s", idp->id); if (!idp->val.status.mark) - printf(" (default)"); + printf(_(" (default)")); } printf("\n"); if (ctl->smtpaddress) - printf(" Host part of MAIL FROM line will be %s\n", + printf(_(" Host part of MAIL FROM line will be %s\n"), ctl->smtpaddress); } if (ctl->server.protocol != P_ETRN) @@ -1455,27 +1465,27 @@ static void dump_params (struct runctl *runp, { struct idlist *idp; - printf(" Recognized listener spam block responses are:"); + printf(_(" Recognized listener spam block responses are:")); for (idp = ctl->antispam; idp; idp = idp->next) printf(" %d", idp->val.status.num); printf("\n"); } else if (outlevel >= O_VERBOSE) - printf(" Spam-blocking disabled\n"); + printf(_(" Spam-blocking disabled\n")); } if (ctl->preconnect) - printf(" Server connection will be brought up with \"%s\".\n", + printf(_(" Server connection will be brought up with \"%s\".\n"), visbuf(ctl->preconnect)); else if (outlevel >= O_VERBOSE) - printf(" No pre-connection command.\n"); + printf(_(" No pre-connection command.\n")); if (ctl->postconnect) - printf(" Server connection will be taken down with \"%s\".\n", + printf(_(" Server connection will be taken down with \"%s\".\n"), visbuf(ctl->postconnect)); else if (outlevel >= O_VERBOSE) - printf(" No post-connection command.\n"); + printf(_(" No post-connection command.\n")); if (ctl->server.protocol != P_ETRN) { if (!ctl->localnames) - printf(" No localnames declared for this host.\n"); + printf(_(" No localnames declared for this host.\n")); else { struct idlist *idp; @@ -1485,11 +1495,11 @@ static void dump_params (struct runctl *runp, ++count; if (count > 1 || ctl->wildcard) - printf(" Multi-drop mode: "); + printf(_(" Multi-drop mode: ")); else - printf(" Single-drop mode: "); + printf(_(" Single-drop mode: ")); - printf("%d local name(s) recognized.\n", count); + printf(_("%d local name(s) recognized.\n"), count); if (outlevel >= O_VERBOSE) { for (idp = ctl->localnames; idp; idp = idp->next) @@ -1503,37 +1513,37 @@ static void dump_params (struct runctl *runp, if (count > 1 || ctl->wildcard) { - printf(" DNS lookup for multidrop addresses is %sabled.\n", - ctl->server.dns ? "en" : "dis"); + printf(_(" DNS lookup for multidrop addresses is %s.\n"), + ctl->server.dns ? _("enabled") : _("disabled")); if (ctl->server.dns) { - printf(" Server aliases will be compared with multidrop addresses by "); + printf(_(" Server aliases will be compared with multidrop addresses by ")); if (ctl->server.checkalias) - printf("IP address.\n"); + printf(_("IP address.\n")); else - printf("name.\n"); + printf(_("name.\n")); } if (ctl->server.envelope == STRING_DISABLED) - printf(" Envelope-address routing is disabled\n"); + printf(_(" Envelope-address routing is disabled\n")); else { - printf(" Envelope header is assumed to be: %s\n", - ctl->server.envelope ? ctl->server.envelope:"Received"); + printf(_(" Envelope header is assumed to be: %s\n"), + ctl->server.envelope ? ctl->server.envelope:_("Received")); if (ctl->server.envskip > 1 || outlevel >= O_VERBOSE) - printf(" Number of envelope header to be parsed: %d\n", + printf(_(" Number of envelope header to be parsed: %d\n"), ctl->server.envskip); if (ctl->server.qvirtual) - printf(" Prefix %s will be removed from user id\n", + printf(_(" Prefix %s will be removed from user id\n"), ctl->server.qvirtual); else if (outlevel >= O_VERBOSE) - printf(" No prefix stripping\n"); + printf(_(" No prefix stripping\n")); } if (ctl->server.akalist) { struct idlist *idp; - printf(" Predeclared mailserver aliases:"); + printf(_(" Predeclared mailserver aliases:")); for (idp = ctl->server.akalist; idp; idp = idp->next) printf(" %s", idp->id); putchar('\n'); @@ -1542,7 +1552,7 @@ static void dump_params (struct runctl *runp, { struct idlist *idp; - printf(" Local domains:"); + printf(_(" Local domains:")); for (idp = ctl->server.localdomains; idp; idp = idp->next) printf(" %s", idp->id); putchar('\n'); @@ -1552,27 +1562,27 @@ static void dump_params (struct runctl *runp, } #ifdef linux if (ctl->server.interface) - printf(" Connection must be through interface %s.\n", ctl->server.interface); + printf(_(" Connection must be through interface %s.\n"), ctl->server.interface); else if (outlevel >= O_VERBOSE) - printf(" No interface requirement specified.\n"); + printf(_(" No interface requirement specified.\n")); if (ctl->server.monitor) - printf(" Polling loop will monitor %s.\n", ctl->server.monitor); + printf(_(" Polling loop will monitor %s.\n"), ctl->server.monitor); else if (outlevel >= O_VERBOSE) - printf(" No monitor interface specified.\n"); + printf(_(" No monitor interface specified.\n")); #endif if (ctl->server.plugin) - printf(" Server connections will be mode via plugin %s (--plugin %s).\n", ctl->server.plugin, ctl->server.plugin); + printf(_(" Server connections will be mode via plugin %s (--plugin %s).\n"), ctl->server.plugin, ctl->server.plugin); else if (outlevel >= O_VERBOSE) - printf(" No plugin command specified.\n"); + printf(_(" No plugin command specified.\n")); if (ctl->server.plugout) - printf(" Listener connections will be mode via plugout %s (--plugout %s).\n", ctl->server.plugout, ctl->server.plugout); + printf(_(" Listener connections will be mode via plugout %s (--plugout %s).\n"), ctl->server.plugout, ctl->server.plugout); else if (outlevel >= O_VERBOSE) - printf(" No plugout command specified.\n"); + printf(_(" No plugout command specified.\n")); if (ctl->server.protocol > P_POP2 && (ctl->server.protocol != P_ETRN)) if (!ctl->oldsaved) - printf(" No UIDs saved from this host.\n"); + printf(_(" No UIDs saved from this host.\n")); else { struct idlist *idp; @@ -1581,14 +1591,14 @@ static void dump_params (struct runctl *runp, for (idp = ctl->oldsaved; idp; idp = idp->next) ++count; - printf(" %d UIDs saved.\n", count); + printf(_(" %d UIDs saved.\n"), count); if (outlevel >= O_VERBOSE) for (idp = ctl->oldsaved; idp; idp = idp->next) printf("\t%s\n", idp->id); } if (ctl->properties) - printf(" Pass-through properties \"%s\".\n", + printf(_(" Pass-through properties \"%s\".\n"), visbuf(ctl->properties)); } } diff --git a/getpass.c b/getpass.c index 4d0a75f7..31ba2a7d 100644 --- a/getpass.c +++ b/getpass.c @@ -9,6 +9,8 @@ description: getpass() replacement which allows for long passwords. This version hacked by Wilfred Teiken, allowing the password to be piped to fetchmail. + + i18n by Arnaldo Carvalho de Melo 7-Nov-1998 ***********************************************************************/ @@ -21,6 +23,7 @@ #include #endif #include "fetchmail.h" +#include "i18n.h" #define INPUT_BUF_SIZE PASSWORDLEN @@ -67,7 +70,7 @@ char *prompt; char *getpass(); return getpass(prompt); #else - fputs("ERROR: no support for getpassword() routine\n",stderr); + fputs(_("ERROR: no support for getpassword() routine\n"),stderr); exit(1); #endif #else @@ -189,7 +192,7 @@ static void restore_tty_state(void) static RETSIGTYPE sigint_handler(int signum) { restore_tty_state(); - error(1, 0, "\nCaught signal... bailing out."); + error(1, 0, _("\nCaught signal... bailing out.")); } /* getpass.c ends here */ diff --git a/imap.c b/imap.c index 4d6874c2..be92cbc2 100644 --- a/imap.c +++ b/imap.c @@ -3,6 +3,8 @@ * * Copyright 1997 by Eric S. Raymond * For license terms, see the file COPYING in this directory. + * + * i18n by Arnaldo Carvalho de Melo 7-Nov-1998 */ #include "config.h" @@ -14,6 +16,7 @@ #endif #include "fetchmail.h" #include "socket.h" +#include "i18n.h" #ifdef KERBEROS_V4 #ifdef KERBEROS_V5 @@ -141,7 +144,7 @@ static int do_otp(int sock, struct query *ctl) return rval; if ((i = from64tobits(challenge, buffer)) < 0) { - error(0, -1, "Could not decode initial BASE64 challenge"); + error(0, -1, _("Could not decode initial BASE64 challenge")); return PS_AUTHFAIL; }; @@ -157,14 +160,14 @@ static int do_otp(int sock, struct query *ctl) return rval; if ((i = from64tobits(challenge, buffer)) < 0) { - error(0, -1, "Could not decode OTP challenge"); + error(0, -1, _("Could not decode OTP challenge")); return PS_AUTHFAIL; }; rval = opiegenerator(challenge, !strcmp(ctl->password, "opie") ? "" : ctl->password, response); if ((rval == -2) && !run.poll_interval) { char secret[OPIE_SECRET_MAX+1]; - fprintf(stderr, "Secret pass phrase: "); + fprintf(stderr, _("Secret pass phrase: ")); if (opiereadpass(secret, sizeof(secret), 0)) rval = opiegenerator(challenge, secret, response); memset(secret, 0, sizeof(secret)); @@ -240,7 +243,7 @@ static int do_rfc1731(int sock, char *truename) len = from64tobits(challenge1.cstr, buf1); if (len < 0) { - error(0, -1, "could not decode initial BASE64 challenge"); + error(0, -1, _("could not decode initial BASE64 challenge")); return PS_AUTHFAIL; } @@ -290,13 +293,13 @@ static int do_rfc1731(int sock, char *truename) } if (strcmp(tktuser, user) != 0) { - error(0, -1, "principal %s in ticket does not match -u %s", tktuser, + error(0, -1, _("principal %s in ticket does not match -u %s"), tktuser, user); return PS_AUTHFAIL; } if (tktinst[0]) { - error(0, 0, "non-null instance (%s) might cause strange behavior", + error(0, 0, _("non-null instance (%s) might cause strange behavior"), tktinst); strcat(tktuser, "."); strcat(tktuser, tktinst); @@ -362,14 +365,14 @@ static int do_rfc1731(int sock, char *truename) len = from64tobits(buf2, buf1); if (len < 0) { - error(0, -1, "could not decode BASE64 ready response"); + error(0, -1, _("could not decode BASE64 ready response")); return PS_AUTHFAIL; } des_ecb_encrypt((des_cblock *)buf2, (des_cblock *)buf2, schedule, 0); memcpy(challenge2.cstr, buf2, 4); if (ntohl(challenge2.cint) != challenge1.cint + 1) { - error(0, -1, "challenge mismatch"); + error(0, -1, _("challenge mismatch")); return PS_AUTHFAIL; } @@ -442,13 +445,13 @@ static int do_gssauth(int sock, char *hostname, char *username) maj_stat = gss_import_name(&min_stat, &request_buf, gss_nt_service_name, &target_name); if (maj_stat != GSS_S_COMPLETE) { - error(0, -1, "Couldn't get service name for [%s]", buf1); + error(0, -1, _("Couldn't get service name for [%s]"), buf1); return PS_AUTHFAIL; } else if (outlevel >= O_DEBUG) { maj_stat = gss_display_name(&min_stat, target_name, &request_buf, &mech_name); - error(0, 0, "Using service name [%s]",request_buf.value); + error(0, 0, _("Using service name [%s]"),request_buf.value); maj_stat = gss_release_buffer(&min_stat, &request_buf); } @@ -464,13 +467,13 @@ static int do_gssauth(int sock, char *hostname, char *username) sec_token = GSS_C_NO_BUFFER; context = GSS_C_NO_CONTEXT; if (outlevel >= O_VERBOSE) - error(0,0,"Sending credentials"); + error(0,0,_("Sending credentials")); do { maj_stat = gss_init_sec_context(&min_stat, GSS_C_NO_CREDENTIAL, &context, target_name, NULL, 0, 0, NULL, sec_token, NULL, &send_token, &cflags, NULL); if (maj_stat!=GSS_S_COMPLETE && maj_stat!=GSS_S_CONTINUE_NEEDED) { - error(0, -1,"Error exchanging credentials"); + error(0, -1,_("Error exchanging credentials")); gss_release_name(&min_stat, &target_name); /* wake up server and await NO response */ SockWrite(sock, "\r\n", 2); @@ -506,16 +509,16 @@ static int do_gssauth(int sock, char *hostname, char *username) maj_stat = gss_unwrap(&min_stat, context, &request_buf, &send_token, &cflags, &quality); if (maj_stat != GSS_S_COMPLETE) { - error(0,-1,"Couldn't unwrap security level data"); + error(0,-1,_("Couldn't unwrap security level data")); gss_release_buffer(&min_stat, &send_token); return PS_AUTHFAIL; } if (outlevel >= O_DEBUG) - error(0,0,"Credential exchange complete"); + error(0,0,_("Credential exchange complete")); /* first octet is security levels supported. We want none, for now */ server_conf_flags = ((char *)send_token.value)[0]; if ( !(((char *)send_token.value)[0] & GSSAUTH_P_NONE) ) { - error(0,-1,"Server requires integrity and/or privacy"); + error(0,-1,_("Server requires integrity and/or privacy")); gss_release_buffer(&min_stat, &send_token); return PS_AUTHFAIL; } @@ -524,11 +527,11 @@ static int do_gssauth(int sock, char *hostname, char *username) /* we don't care about buffer size if we don't wrap data */ gss_release_buffer(&min_stat, &send_token); if (outlevel >= O_DEBUG) { - error(0,0,"Unwrapped security level flags: %s%s%s", + error(0,0,_("Unwrapped security level flags: %s%s%s"), server_conf_flags & GSSAUTH_P_NONE ? "N" : "-", server_conf_flags & GSSAUTH_P_INTEGRITY ? "I" : "-", server_conf_flags & GSSAUTH_P_PRIVACY ? "C" : "-"); - error(0,0,"Maximum GSS token size is %ld",buf_size); + error(0,0,_("Maximum GSS token size is %ld"),buf_size); } /* now respond in kind (hack!!!) */ @@ -541,12 +544,12 @@ static int do_gssauth(int sock, char *hostname, char *username) maj_stat = gss_wrap(&min_stat, context, 0, GSS_C_QOP_DEFAULT, &request_buf, &cflags, &send_token); if (maj_stat != GSS_S_COMPLETE) { - error(0,-1,"Error creating security level request"); + error(0,-1,_("Error creating security level request")); return PS_AUTHFAIL; } to64frombits(buf1, send_token.value, send_token.length); if (outlevel >= O_DEBUG) { - error(0,0,"Requesting authorisation as %s", username); + error(0,0,_("Requesting authorisation as %s"), username); error(0,0,"IMAP> %s",buf1); } SockWrite(sock, buf1, strlen(buf1)); @@ -558,10 +561,10 @@ static int do_gssauth(int sock, char *hostname, char *username) if (strstr(buf1, "OK")) { /* flush security context */ if (outlevel >= O_DEBUG) - error(0, 0, "Releasing GSS credentials"); + error(0, 0, _("Releasing GSS credentials")); maj_stat = gss_delete_sec_context(&min_stat, &context, &send_token); if (maj_stat != GSS_S_COMPLETE) { - error(0, -1, "Error releasing credentials"); + error(0, -1, _("Error releasing credentials")); return PS_AUTHFAIL; } /* send_token may contain a notification to the server to flush @@ -608,20 +611,20 @@ int imap_getauth(int sock, struct query *ctl, char *greeting) { imap_version = IMAP4rev1; if (outlevel >= O_DEBUG) - error(0, 0, "Protocol identified as IMAP4 rev 1"); + error(0, 0, _("Protocol identified as IMAP4 rev 1")); } else { imap_version = IMAP4; if (outlevel >= O_DEBUG) - error(0, 0, "Protocol identified as IMAP4 rev 0"); + error(0, 0, _("Protocol identified as IMAP4 rev 0")); } } else if (ok == PS_ERROR) { imap_version = IMAP2; if (outlevel >= O_DEBUG) - error(0, 0, "Protocol identified as IMAP2 or IMAP2BIS"); + error(0, 0, _("Protocol identified as IMAP2 or IMAP2BIS")); } else return(ok); @@ -632,7 +635,7 @@ int imap_getauth(int sock, struct query *ctl, char *greeting) if ((ctl->server.protocol == P_IMAP) && strstr(capabilities, "AUTH=X-OTP")) { if (outlevel >= O_DEBUG) - error(0, 0, "OTP authentication is supported"); + error(0, 0, _("OTP authentication is supported")); if (do_otp(sock, ctl) == PS_SUCCESS) return(PS_SUCCESS); }; @@ -644,13 +647,13 @@ int imap_getauth(int sock, struct query *ctl, char *greeting) if (ctl->server.protocol == P_IMAP_GSS) { if (outlevel >= O_DEBUG) - error(0, 0, "GSS authentication is supported"); + error(0, 0, _("GSS authentication is supported")); return do_gssauth(sock, ctl->server.truename, ctl->remotename); } } else if (ctl->server.protocol == P_IMAP_GSS) { - error(0,-1, "Required GSS capability not supported by server"); + error(0,-1, _("Required GSS capability not supported by server")); return(PS_AUTHFAIL); } #endif /* GSSAPI */ @@ -659,7 +662,7 @@ int imap_getauth(int sock, struct query *ctl, char *greeting) if (strstr(capabilities, "AUTH=KERBEROS_V4")) { if (outlevel >= O_DEBUG) - error(0, 0, "KERBEROS_V4 authentication is supported"); + error(0, 0, _("KERBEROS_V4 authentication is supported")); if (ctl->server.protocol == P_IMAP_K4) { @@ -676,7 +679,7 @@ int imap_getauth(int sock, struct query *ctl, char *greeting) } else if (ctl->server.protocol == P_IMAP_K4) { - error(0,-1, "Required KERBEROS_V4 capability not supported by server"); + error(0,-1, _("Required KERBEROS_V4 capability not supported by server")); return(PS_AUTHFAIL); } #endif /* KERBEROS_V4 */ @@ -684,7 +687,7 @@ int imap_getauth(int sock, struct query *ctl, char *greeting) #ifdef __UNUSED__ /* The Cyrus IMAP4rev1 server chokes on this */ /* this handles either AUTH=LOGIN or AUTH-LOGIN */ if ((imap_version >= IMAP4rev1) && (!strstr(capabilities, "LOGIN"))) { - error(0,-1, "Required LOGIN capability not supported by server"); + error(0,-1, _("Required LOGIN capability not supported by server")); return PS_AUTHFAIL; }; #endif /* __UNUSED__ */ @@ -738,7 +741,7 @@ static int imap_getrange(int sock, count = -1; if (ok || gen_transact(sock, "NOOP")) { - error(0, 0, "re-poll failed"); + error(0, 0, _("re-poll failed")); return(ok); } else if (count == -1) /* no EXISTS response to NOOP */ @@ -755,7 +758,7 @@ static int imap_getrange(int sock, ok = gen_transact(sock, "EXAMINE %s", folder ? folder : "INBOX"); if (ok != 0) { - error(0, 0, "mailbox selection failed"); + error(0, 0, _("mailbox selection failed")); return(ok); } } diff --git a/interface.c b/interface.c index cb42e8be..392fa8d2 100644 --- a/interface.c +++ b/interface.c @@ -6,6 +6,8 @@ * * Copyright (c) 1996,1997 by George M. Sipe - ALL RIGHTS RESERVED * + * i18n by Arnaldo Carvalho de Melo 7-Nov-1998 + * * This is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; version 2, or (at your option) any later version. @@ -29,6 +31,7 @@ #include #include "config.h" #include "fetchmail.h" +#include "i18n.h" typedef struct { struct in_addr addr, dstaddr, netmask; @@ -167,7 +170,7 @@ void interface_parse(char *buf, struct hostdata *hp) /* find and isolate just the IP address */ if (!(cp1 = strchr(buf, '/'))) - (void) error(PS_SYNTAX, 0, "missing IP interface address"); + (void) error(PS_SYNTAX, 0, _("missing IP interface address")); *cp1++ = '\000'; /* find and isolate just the netmask */ @@ -179,9 +182,9 @@ void interface_parse(char *buf, struct hostdata *hp) /* convert IP address and netmask */ hp->interface_pair = (struct interface_pair_s *)xmalloc(sizeof(struct interface_pair_s)); if (!inet_aton(cp1, &hp->interface_pair->interface_address)) - (void) error(PS_SYNTAX, 0, "invalid IP interface address"); + (void) error(PS_SYNTAX, 0, _("invalid IP interface address")); if (!inet_aton(cp2, &hp->interface_pair->interface_mask)) - (void) error(PS_SYNTAX, 0, "invalid IP interface mask"); + (void) error(PS_SYNTAX, 0, _("invalid IP interface mask")); /* apply the mask now to the IP address (range) required */ hp->interface_pair->interface_address.s_addr &= hp->interface_pair->interface_mask.s_addr; @@ -217,7 +220,7 @@ void interface_note_activity(struct hostdata *hp) } #ifdef ACTIVITY_DEBUG - (void) error(0, 0, "activity on %s -noted- as %d", + (void) error(0, 0, _("activity on %s -noted- as %d"), hp->monitor, hp->monitor_io); #endif } @@ -231,7 +234,7 @@ int interface_approve(struct hostdata *hp) if (hp->interface) { /* get interface info */ if (!get_ifinfo(hp->interface, &ifinfo)) { - (void) error(0, 0, "skipping poll of %s, %s down", + (void) error(0, 0, _("skipping poll of %s, %s down"), hp->pollname, hp->interface); return(FALSE); } @@ -240,7 +243,7 @@ int interface_approve(struct hostdata *hp) hp->interface_pair->interface_mask.s_addr) != hp->interface_pair->interface_address.s_addr) { (void) error(0, 0, - "skipping poll of %s, %s IP address excluded", + _("skipping poll of %s, %s IP address excluded"), hp->pollname, hp->interface); return(FALSE); } @@ -251,14 +254,14 @@ int interface_approve(struct hostdata *hp) return(TRUE); #ifdef ACTIVITY_DEBUG - (void) error(0, 0, "activity on %s checked as %d", + (void) error(0, 0, _("activity on %s checked as %d"), hp->monitor, hp->monitor_io); #endif /* if monitoring, check link for activity if it is up */ if (get_ifinfo(hp->monitor, &ifinfo) && hp->monitor_io == ifinfo.rx_packets + ifinfo.tx_packets) { - (void) error(0, 0, "skipping poll of %s, %s inactive", + (void) error(0, 0, _("skipping poll of %s, %s inactive"), hp->pollname, hp->monitor); return(FALSE); } diff --git a/netrc.c b/netrc.c index 6d3a645f..494a3c96 100644 --- a/netrc.c +++ b/netrc.c @@ -2,6 +2,8 @@ Copyright (C) 1996, Free Software Foundation, Inc. Gordon Matzigkeit , 1996 + i18n by Arnaldo Carvalho de Melo 7-Nov-1998 + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -26,6 +28,7 @@ #include "config.h" #include "fetchmail.h" #include "netrc.h" +#include "i18n.h" #ifdef STANDALONE /* Normally defined in xstrdup.c. */ @@ -226,7 +229,7 @@ parse_netrc (file) premature_token); #else fprintf (stderr, - "%s:%d: warning: found \"%s\" before any host names\n", + _("%s:%d: warning: found \"%s\" before any host names\n"), file, ln, premature_token); #endif premature_token = NULL; @@ -262,7 +265,7 @@ parse_netrc (file) else { - fprintf (stderr, "%s:%d: warning: unknown token \"%s\"\n", + fprintf (stderr, _("%s:%d: warning: unknown token \"%s\"\n"), file, ln, tok); } } diff --git a/options.c b/options.c index df473b3c..4f770d02 100644 --- a/options.c +++ b/options.c @@ -2,6 +2,8 @@ * options.c -- command-line option processing * * For license terms, see the file COPYING in this directory. + * + * i18n by Arnaldo Carvalho de Melo 7-Nov-1998 */ #include "config.h" @@ -19,6 +21,7 @@ #include "getopt.h" #include "fetchmail.h" +#include "i18n.h" #define LA_HELP 1 #define LA_VERSION 2 @@ -157,7 +160,7 @@ static int xatoi(char *s, int *errflagptr) /* any invalid chars in string? */ if ( (endptr == s) || (*endptr != '\0') ) { - (void) fprintf(stderr, "String '%s' is not a valid number string.\n", s); + (void) fprintf(stderr, _("String '%s' is not a valid number string.\n"), s); (*errflagptr)++; return 0; } @@ -166,8 +169,8 @@ static int xatoi(char *s, int *errflagptr) if ( (((value == LONG_MAX) || (value == LONG_MIN)) && (errno == ERANGE)) || (value > INT_MAX) || (value < INT_MIN)) { - (void) fprintf(stderr, "Value of string '%s' is %s than %d.\n", s, - (value < 0) ? "smaller": "larger", + (void) fprintf(stderr, _("Value of string '%s' is %s than %d.\n"), s, + (value < 0) ? _("smaller"): _("larger"), (value < 0) ? INT_MIN : INT_MAX); (*errflagptr)++; return 0; @@ -201,7 +204,7 @@ static int xatoi(char *s, int *errflagptr) /* check for trailing garbage */ if (i != len) { - (void) fprintf(stderr, "String '%s' is not a valid number string.\n", s); + (void) fprintf(stderr, _("String '%s' is not a valid number string.\n"), s); (*errflagptr)++; return 0; } @@ -341,7 +344,7 @@ struct query *ctl; /* option record to be initialized */ else if (strcasecmp(optarg,"etrn") == 0) ctl->server.protocol = P_ETRN; else { - fprintf(stderr,"Invalid protocol `%s' specified.\n", optarg); + fprintf(stderr,_("Invalid protocol `%s' specified.\n"), optarg); errflag++; } break; @@ -372,7 +375,7 @@ struct query *ctl; /* option record to be initialized */ else if (strcmp(optarg, "kerberos_v4") == 0) ctl->server.preauthenticate = A_KERBEROS_V4; else { - fprintf(stderr,"Invalid preauthentication `%s' specified.\n", optarg); + fprintf(stderr,_("Invalid preauthentication `%s' specified.\n"), optarg); errflag++; } break; @@ -490,7 +493,7 @@ struct query *ctl; /* option record to be initialized */ #if NET_SECURITY ctl->server.netsec = (void *)optarg; #else - fprintf(stderr, "fetchmail: network security support is disabled\n"); + fprintf(stderr, _("fetchmail: network security support is disabled\n")); errflag++; #endif /* NET_SECURITY */ break; @@ -545,60 +548,60 @@ struct query *ctl; /* option record to be initialized */ if (errflag || ocount > 1) { /* squawk if syntax errors were detected */ #define P(s) fputs(s, stderr) - P("usage: fetchmail [options] [server ...]\n"); - P(" Options are as follows:\n"); - P(" -?, --help display this option help\n"); - P(" -V, --version display version info\n"); - - P(" -c, --check check for messages without fetching\n"); - P(" -s, --silent work silently\n"); - P(" -v, --verbose work noisily (diagnostic output)\n"); - P(" -d, --daemon run as a daemon once per n seconds\n"); - P(" -N, --nodetach don't detach daemon process\n"); - P(" -q, --quit kill daemon process\n"); - P(" -L, --logfile specify logfile name\n"); - P(" --syslog use syslog(3) for most messages when running as a daemon\n"); - P(" --invisible don't write Received & enable host spoofing\n"); - P(" -f, --fetchmailrc specify alternate run control file\n"); - P(" -i, --idfile specify alternate UIDs file\n"); - P(" --postmaster specify recipient of last resort\n"); + P(_("usage: fetchmail [options] [server ...]\n")); + P(_(" Options are as follows:\n")); + P(_(" -?, --help display this option help\n")); + P(_(" -V, --version display version info\n")); + + P(_(" -c, --check check for messages without fetching\n")); + P(_(" -s, --silent work silently\n")); + P(_(" -v, --verbose work noisily (diagnostic output)\n")); + P(_(" -d, --daemon run as a daemon once per n seconds\n")); + P(_(" -N, --nodetach don't detach daemon process\n")); + P(_(" -q, --quit kill daemon process\n")); + P(_(" -L, --logfile specify logfile name\n")); + P(_(" --syslog use syslog(3) for most messages when running as a daemon\n")); + P(_(" --invisible don't write Received & enable host spoofing\n")); + P(_(" -f, --fetchmailrc specify alternate run control file\n")); + P(_(" -i, --idfile specify alternate UIDs file\n")); + P(_(" --postmaster specify recipient of last resort\n")); #if defined(linux) && !INET6 - P(" -I, --interface interface required specification\n"); - P(" -M, --monitor monitor interface for activity\n"); + P(_(" -I, --interface interface required specification\n")); + P(_(" -M, --monitor monitor interface for activity\n")); #endif - P(" --plugin specify external command to open connection\n"); - P(" --plugout specify external command to open smtp connection\n"); - - P(" -p, --protocol specify retrieval protocol (see man page)\n"); - P(" -U, --uidl force the use of UIDLs (pop3 only)\n"); - P(" -P, --port TCP/IP service port to connect to\n"); - P(" -A, --auth authentication type (password or kerberos)\n"); - P(" -t, --timeout server nonresponse timeout\n"); - P(" -E, --envelope envelope address header\n"); - P(" -Q, --qvirtual prefix to remove from local user id\n"); - - P(" -u, --username specify users's login on server\n"); - P(" -a, --all retrieve old and new messages\n"); - P(" -K, --nokeep delete new messages after retrieval\n"); - P(" -k, --keep save new messages after retrieval\n"); - P(" -F, --flush delete old messages from server\n"); - P(" -n, --norewrite don't rewrite header addresses\n"); - P(" -l, --limit don't fetch messages over given size\n"); - P(" -w, --warnings interval between warning mail notification\n"); + P(_(" --plugin specify external command to open connection\n")); + P(_(" --plugout specify external command to open smtp connection\n")); + + P(_(" -p, --protocol specify retrieval protocol (see man page)\n")); + P(_(" -U, --uidl force the use of UIDLs (pop3 only)\n")); + P(_(" -P, --port TCP/IP service port to connect to\n")); + P(_(" -A, --auth authentication type (password or kerberos)\n")); + P(_(" -t, --timeout server nonresponse timeout\n")); + P(_(" -E, --envelope envelope address header\n")); + P(_(" -Q, --qvirtual prefix to remove from local user id\n")); + + P(_(" -u, --username specify users's login on server\n")); + P(_(" -a, --all retrieve old and new messages\n")); + P(_(" -K, --nokeep delete new messages after retrieval\n")); + P(_(" -k, --keep save new messages after retrieval\n")); + P(_(" -F, --flush delete old messages from server\n")); + P(_(" -n, --norewrite don't rewrite header addresses\n")); + P(_(" -l, --limit don't fetch messages over given size\n")); + P(_(" -w, --warnings interval between warning mail notification\n")); #if NET_SECURITY - P(" -T, --netsec set IP security request\n"); + P(_(" -T, --netsec set IP security request\n")); #endif /* NET_SECURITY */ - P(" -S, --smtphost set SMTP forwarding host\n"); - P(" -D, --smtpaddress set SMTP delivery domain to use\n"); - P(" -Z, --antispam, set antispam response values\n"); - P(" -b, --batchlimit set batch limit for SMTP connections\n"); - P(" -B, --fetchlimit set fetch limit for server connections\n"); - P(" -e, --expunge set max deletions between expunges\n"); - P(" --mda set MDA to use for forwarding\n"); - P(" --bsmtp set output BSMTP file\n"); - P(" --lmtp use LMTP (RFC2033) for delivery\n"); - P(" -r, --folder specify remote folder name\n"); + P(_(" -S, --smtphost set SMTP forwarding host\n")); + P(_(" -D, --smtpaddress set SMTP delivery domain to use\n")); + P(_(" -Z, --antispam, set antispam response values\n")); + P(_(" -b, --batchlimit set batch limit for SMTP connections\n")); + P(_(" -B, --fetchlimit set fetch limit for server connections\n")); + P(_(" -e, --expunge set max deletions between expunges\n")); + P(_(" --mda set MDA to use for forwarding\n")); + P(_(" --bsmtp set output BSMTP file\n")); + P(_(" --lmtp use LMTP (RFC2033) for delivery\n")); + P(_(" -r, --folder specify remote folder name\n")); #undef P return(-1); } diff --git a/pop3.c b/pop3.c index 9930679d..150dd3a2 100644 --- a/pop3.c +++ b/pop3.c @@ -2,6 +2,8 @@ * pop3.c -- POP3 protocol methods * * For license terms, see the file COPYING in this directory. + * + * i18n by Arnaldo Carvalho de Melo 7-Nov-1998 */ #include "config.h" @@ -18,6 +20,7 @@ #include "fetchmail.h" #include "socket.h" +#include "i18n.h" #if OPIE #include @@ -177,7 +180,7 @@ int pop3_getauth(int sock, struct query *ctl, char *greeting) i = opiegenerator(challenge, !strcmp(ctl->password, "opie") ? "" : ctl->password, response); if ((i == -2) && !run.poll_interval) { char secret[OPIE_SECRET_MAX+1]; - fprintf(stderr, "Secret pass phrase: "); + fprintf(stderr, _("Secret pass phrase: ")); if (opiereadpass(secret, sizeof(secret), 0)) i = opiegenerator(challenge, secret, response); memset(secret, 0, sizeof(secret)); @@ -203,7 +206,7 @@ int pop3_getauth(int sock, struct query *ctl, char *greeting) for (start = greeting; *start != 0 && *start != '<'; start++) continue; if (*start == 0) { - error(0, -1, "Required APOP timestamp not found in greeting"); + error(0, -1, _("Required APOP timestamp not found in greeting")); return(PS_AUTHFAIL); } @@ -211,7 +214,7 @@ int pop3_getauth(int sock, struct query *ctl, char *greeting) for (end = start; *end != 0 && *end != '>'; end++) continue; if (*end == 0 || end == start + 1) { - error(0, -1, "Timestamp syntax error in greeting"); + error(0, -1, _("Timestamp syntax error in greeting")); return(PS_AUTHFAIL); } else @@ -233,7 +236,7 @@ int pop3_getauth(int sock, struct query *ctl, char *greeting) break; default: - error(0, 0, "Undefined protocol request in POP3_auth"); + error(0, 0, _("Undefined protocol request in POP3_auth")); ok = PS_ERROR; } @@ -241,7 +244,7 @@ int pop3_getauth(int sock, struct query *ctl, char *greeting) { /* maybe we detected a lock-busy condition? */ if (ok == PS_LOCKBUSY) - error(0, 0, "lock busy! Is another session active?"); + error(0, 0, _("lock busy! Is another session active?")); return(ok); } @@ -349,8 +352,8 @@ pop3_slowuidl( int sock, struct query *ctl, int *countp, int *newp) try_id--; } } else { - error(0,0,"Messages inserted into list on server. " - "Cannot handle this."); + error(0,0,_("Messages inserted into list on server. " + "Cannot handle this.")); return -1; } } @@ -423,7 +426,7 @@ static int pop3_getrange(int sock, { if (sscanf(buf, "%d", &last) == 0) { - error(0, 0, "protocol error"); + error(0, 0, _("protocol error")); return(PS_ERROR); } *newp = (*countp - last); @@ -436,7 +439,7 @@ static int pop3_getrange(int sock, /* don't worry, yet! do it the slow way */ if((ok = pop3_slowuidl( sock, ctl, countp, newp))!=0) { - error(0, 0, "protocol error while fetching UIDLs"); + error(0, 0, _("protocol error while fetching UIDLs")); return(PS_ERROR); } } @@ -660,7 +663,7 @@ int doPOP3 (struct query *ctl) { #ifndef MBOX if (ctl->mailboxes->id) { - fprintf(stderr,"Option --remote is not supported with POP3\n"); + fprintf(stderr,_("Option --remote is not supported with POP3\n")); return(PS_SYNTAX); } #endif /* MBOX */ diff --git a/report.c b/report.c index d2f12348..2e4cfeaa 100644 --- a/report.c +++ b/report.c @@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ * Bludgeoned into submission for SunOS 4.1.3 by * Chris Cheyney . * Now it works even when the return from vprintf is unreliable. + * + * i18n by Arnaldo Carvalho de Melo 7-Nov-1998 */ #ifdef HAVE_CONFIG_H @@ -52,9 +54,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ void exit (); #endif -#ifndef _ -# define _(String) String -#endif +#include "i18n.h" #include "fetchmail.h" #define MALLOC(n) xmalloc(n) @@ -137,7 +137,7 @@ error (status, errnum, message, va_alist) if (partial_message_size_used != 0) { partial_message_size_used = 0; - error (0, 0, "%s (log message incomplete)", partial_message); + error (0, 0, _("%s (log message incomplete)"), partial_message); } #if defined(HAVE_SYSLOG) @@ -233,7 +233,7 @@ error (status, errnum, message, va_alist) fprintf (stderr, ": %s", tmps); } else { - fprintf (stderr, ": Error %d", errnum); + fprintf (stderr, _(": Error %d"), errnum); } } putc ('\n', stderr); @@ -337,7 +337,7 @@ error_build (message, va_alist) if (partial_message_size_used >= partial_message_size) { partial_message_size_used = 0; - error (PS_UNDEFINED, 0, "partial error message buffer overflow"); + error (PS_UNDEFINED, 0, _("partial error message buffer overflow")); } #endif va_end (args); @@ -365,7 +365,7 @@ error_build (message, va_alist) if ((partial_message_size_used = strlen (partial_message)) >= partial_message_size) { partial_message_size_used = 0; - error (PS_UNDEFINED, 0, "partial error message buffer overflow"); + error (PS_UNDEFINED, 0, _("partial error message buffer overflow")); } #endif #endif @@ -439,7 +439,7 @@ error_complete (status, errnum, message, va_alist) if (partial_message_size_used >= partial_message_size) { partial_message_size_used = 0; - error (PS_UNDEFINED, 0, "partial error message buffer overflow"); + error (PS_UNDEFINED, 0, _("partial error message buffer overflow")); } #endif va_end (args); @@ -467,7 +467,7 @@ error_complete (status, errnum, message, va_alist) if ((partial_message_size_used = strlen (partial_message)) >= partial_message_size) { partial_message_size_used = 0; - error (PS_UNDEFINED, 0, "partial error message buffer overflow"); + error (PS_UNDEFINED, 0, _("partial error message buffer overflow")); } #endif #endif diff --git a/rpa.c b/rpa.c index e404e6aa..646a5002 100644 --- a/rpa.c +++ b/rpa.c @@ -9,6 +9,8 @@ The sole entry point is POP3_auth_rpa() + i18n by Arnaldo Carvalho de Melo 7-Nov-1998 + ***********************************************************************/ #include "config.h" @@ -22,6 +24,7 @@ #include "socket.h" #include "fetchmail.h" #include "md5.h" +#include "i18n.h" #ifdef TESTMODE extern unsigned char line1[]; @@ -110,10 +113,10 @@ int POP3_auth_rpa (unsigned char *userid, unsigned char *passphrase, int socket) unsigned char buf [POPBUFSIZE]; unsigned char *bufp; int status,aulin,kuslin; - char* stdec[4] = { "Success" , - "Restricted user (something wrong with account)" , - "Invalid userid or passphrase" , - "Deity error" }; + char* stdec[4] = { N_("Success") , + N_("Restricted user (something wrong with account)") , + N_("Invalid userid or passphrase") , + N_("Deity error") }; /* Initiate RPA authorisation */ @@ -166,7 +169,7 @@ int POP3_auth_rpa (unsigned char *userid, unsigned char *passphrase, int socket) if ((rxlen = DecBase64(buf)) == 0) { if (outlevel > O_SILENT) - error(0, 0, "RPA token 2: Base64 decode error\n"); + error(0, 0, _("RPA token 2: Base64 decode error\n")); return(PS_RPA); } bufp = buf; @@ -177,13 +180,13 @@ int POP3_auth_rpa (unsigned char *userid, unsigned char *passphrase, int socket) verh = *(bufp++); verl = *(bufp++); if (outlevel >= O_DEBUG) - error(0, 0, "Service chose RPA version %d.%d\n",verh,verl); + error(0, 0, _("Service chose RPA version %d.%d\n"),verh,verl); Csl = *(bufp++); memcpy(Cs, bufp, Csl); bufp += Csl; if (outlevel >= O_DEBUG) { - error(0, 0, "Service challenge (l=%d):",Csl); + error(0, 0, _("Service challenge (l=%d):"),Csl); for (i=0; i= O_DEBUG) - error(0, 0, "Service timestamp %s\n",Ts); + error(0, 0, _("Service timestamp %s\n"),Ts); rll = *(bufp++) << 8; rll = rll | *(bufp++); if ((bufp-buf+rll) != rxlen) { if (outlevel > O_SILENT) - error(0, 0, "RPA token 2 length error\n"); + error(0, 0, _("RPA token 2 length error\n")); return(PS_RPA); } if (outlevel >= O_DEBUG) - error(0, 0, "Realm list: %s\n",bufp); + error(0, 0, _("Realm list: %s\n"),bufp); if (SetRealmService(bufp) != 0) { if (outlevel > O_SILENT) - error(0, 0, "RPA error in service@realm string\n"); + error(0, 0, _("RPA error in service@realm string\n")); return(PS_RPA); } @@ -242,7 +245,7 @@ int POP3_auth_rpa (unsigned char *userid, unsigned char *passphrase, int socket) if ((rxlen = DecBase64(buf)) == 0) { if (outlevel > O_SILENT) - error(0, 0, "RPA token 4: Base64 decode error\n"); + error(0, 0, _("RPA token 4: Base64 decode error\n")); return(PS_RPA); } bufp = buf; @@ -253,7 +256,7 @@ int POP3_auth_rpa (unsigned char *userid, unsigned char *passphrase, int socket) aulin = *(bufp++); if (outlevel >= O_DEBUG) { - error(0, 0, "User authentication (l=%d):",aulin); + error(0, 0, _("User authentication (l=%d):"),aulin); for (i=0; i= O_DEBUG) - error(0, 0, "RPA status: %02X\n",status); + error(0, 0, _("RPA status: %02X\n"),status); } else status = 0; if ((bufp - buf) != rxlen) { if (outlevel > O_SILENT) - error(0, 0, "RPA token 4 length error\n"); + error(0, 0, _("RPA token 4 length error\n")); return(PS_RPA); } if (status != 0) { if (outlevel > O_SILENT) if (status < 4) - error(0, 0, "RPA rejects you: %s\n",stdec[status]); + error(0, 0, _("RPA rejects you: %s\n"),_(stdec[status])); else - error(0, 0, "RPA rejects you, reason unknown\n"); + error(0, 0, _("RPA rejects you, reason unknown\n")); return(PS_AUTHFAIL); } if (Aul != aulin) { - error(0, 0, "RPA User Authentication length error: %d\n",aulin); + error(0, 0, _("RPA User Authentication length error: %d\n"),aulin); return(PS_RPA); } if (Kusl != kuslin) { - error(0, 0, "RPA Session key length error: %d\n",kuslin); + error(0, 0, _("RPA Session key length error: %d\n"),kuslin); return(PS_RPA); } if (CheckUserAuth() != 0) { if (outlevel > O_SILENT) - error(0, 0, "RPA _service_ auth fail. Spoof server?\n"); + error(0, 0, _("RPA _service_ auth fail. Spoof server?\n")); return(PS_AUTHFAIL); } if (outlevel >= O_DEBUG) { - error(0, 0, "Session key established:"); + error(0, 0, _("Session key established:")); for (i=0; i O_SILENT) - error(0, 0, "RPA authorisation complete\n"); + error(0, 0, _("RPA authorisation complete\n")); return(PS_SUCCESS); } @@ -363,7 +366,7 @@ int socket; int sockrc; if (outlevel >= O_DEBUG) - error(0, 0, "Get response\n"); + error(0, 0, _("Get response\n")); #ifndef TESTMODE sockrc = gen_recv(socket, buf, sizeof(buf)); #else @@ -393,7 +396,7 @@ int socket; else ok = PS_SOCKET; if (outlevel >= O_DEBUG) - error(0, 0, "Get response return %d [%s]\n", ok, buf); + error(0, 0, _("Get response return %d [%s]\n"), ok, buf); buf[sockrc] = 0; return(ok); } @@ -455,7 +458,7 @@ int rxlen; save = *pptr; if (**pptr != HDR) { - if (outlevel > O_SILENT) error(0, 0, "Hdr not 60\n"); + if (outlevel > O_SILENT) error(0, 0, _("Hdr not 60\n")); return(0); } (*pptr)++; @@ -476,18 +479,18 @@ int rxlen; if (len==0) { if (outlevel>O_SILENT) - error(0, 0, "Token length error\n"); + error(0, 0, _("Token length error\n")); } else if (((*pptr-save)+len) != rxlen) { if (outlevel>O_SILENT) - error(0, 0, "Token Length %d disagrees with rxlen %d\n",len,rxlen); + error(0, 0, _("Token Length %d disagrees with rxlen %d\n"),len,rxlen); len = 0; } else if (memcmp(*pptr,MECH,11)) { if (outlevel > O_SILENT) - error(0, 0, "Mechanism field incorrect\n"); + error(0, 0, _("Mechanism field incorrect\n")); len = 0; } else (*pptr) += 11; /* Skip mechanism field */ @@ -524,7 +527,7 @@ unsigned char *bufp; else if ( ch=='+' ) new = 62; else if ( ch=='/' ) new = 63; else { - error(0, 0, "dec64 error at char %d: %x\n", inp - bufp, ch); + error(0, 0, _("dec64 error at char %d: %x\n"), inp - bufp, ch); return(0); } part=((part & 0x3F)*64) + new; @@ -539,7 +542,7 @@ unsigned char *bufp; } if (outlevel >= O_MONITOR) { - error(0, 0, "Inbound binary data:\n"); + error(0, 0, _("Inbound binary data:\n")); for (i=0; i= O_MONITOR) { - error(0, 0, "Outbound data:\n"); + error(0, 0, _("Outbound data:\n")); for (i=0; i O_SILENT) - error(0, 0, "RPA String too long\n"); + error(0, 0, _("RPA String too long\n")); *plen = 0; } if (outlevel >= O_DEBUG) { - error(0, 0, "Unicode:"); + error(0, 0, _("Unicode:")); for (i=0; i<(*plen); i++) { error_build("%02X ",buf[i]); @@ -710,11 +713,11 @@ int len; devrandom = fopen("/dev/urandom","rb"); if (devrandom == NULL && outlevel > O_SILENT) { - error(0, 0, "RPA Failed open of /dev/urandom. This shouldn't\n"); - error(0, 0, " prevent you logging in, but means you\n"); - error(0, 0, " cannot be sure you are talking to the\n"); - error(0, 0, " service that you think you are (replay\n"); - error(0, 0, " attacks by a dishonest service are possible.)\n"); + error(0, 0, _("RPA Failed open of /dev/urandom. This shouldn't\n")); + error(0, 0, _(" prevent you logging in, but means you\n")); + error(0, 0, _(" cannot be sure you are talking to the\n")); + error(0, 0, _(" service that you think you are (replay\n")); + error(0, 0, _(" attacks by a dishonest service are possible.)\n")); } for(i=0; i= O_DEBUG) { - error(0, 0, "User challenge:"); + error(0, 0, _("User challenge:")); for (i=0; i= O_DEBUG) { - error(0, 0, "MD5 being applied to data block:\n"); + error(0, 0, _("MD5 being applied to data block:\n")); for (i=0; i= O_DEBUG) { - error(0, 0, "MD5 result is: "); + error(0, 0, _("MD5 result is: ")); for (i=0; i<16; i++) { error_build("%02X ",out[i]); diff --git a/sink.c b/sink.c index f05e3802..d21a10b3 100644 --- a/sink.c +++ b/sink.c @@ -8,6 +8,8 @@ * * Copyright 1998 by Eric S. Raymond * For license terms, see the file COPYING in this directory. + * + * i18n by Arnaldo Carvalho de Melo 7-Nov-1998 */ #include "config.h" @@ -33,6 +35,7 @@ #include "fetchmail.h" #include "socket.h" #include "smtp.h" +#include "i18n.h" /* BSD portability hack...I know, this is an ugly place to put it */ #if !defined(SIGCHLD) && defined(SIGCLD) @@ -159,7 +162,7 @@ static int smtp_open(struct query *ctl) ctl->destaddr = ctl->smtpaddress ? ctl->smtpaddress : ( ctl->smtphost ? ctl->smtphost : "localhost"); if (outlevel >= O_DEBUG && ctl->smtp_socket != -1) - error(0, 0, "forwarding to %s", ctl->smtphost); + error(0, 0, _("forwarding to %s"), ctl->smtphost); return(ctl->smtp_socket); } @@ -301,7 +304,7 @@ int open_sink(struct query *ctl, struct msgblk *msg, if (ferror(sinkfp)) { - error(0, -1, "BSMTP file open or preamble write failed"); + error(0, -1, _("BSMTP file open or preamble write failed")); return(PS_BSMTP); } } @@ -422,7 +425,7 @@ int open_sink(struct query *ctl, struct msgblk *msg, if (outlevel >= O_DEBUG) - error(0, 0, "about to deliver with: %s", before); + error(0, 0, _("about to deliver with: %s"), before); #ifdef HAVE_SETEUID /* @@ -445,7 +448,7 @@ int open_sink(struct query *ctl, struct msgblk *msg, if (!sinkfp) { - error(0, 0, "MDA open failed"); + error(0, 0, _("MDA open failed")); return(PS_IOERR); } @@ -459,7 +462,7 @@ int open_sink(struct query *ctl, struct msgblk *msg, /* build a connection to the SMTP listener */ if ((smtp_open(ctl) == -1)) { - error(0, errno, "%cMTP connect to %s failed", + error(0, errno, _("%cMTP connect to %s failed"), ctl->listener, ctl->smtphost ? ctl->smtphost : "localhost"); return(PS_SMTP); @@ -538,7 +541,7 @@ int open_sink(struct query *ctl, struct msgblk *msg, * an error when the return code is less specific. */ if (smtperr >= 400) - error(0, -1, "%cMTP error: %s", + error(0, -1, _("%cMTP error: %s"), ctl->listener, smtp_response); @@ -577,7 +580,7 @@ int open_sink(struct query *ctl, struct msgblk *msg, default: /* retry with postmaster's address */ if (SMTP_from(ctl->smtp_socket,run.postmaster,options)!=SM_OK) { - error(0, -1, "%cMTP error: %s", + error(0, -1, _("%cMTP error: %s"), ctl->listener, smtp_response); return(PS_SMTP); /* should never happen */ @@ -607,7 +610,7 @@ int open_sink(struct query *ctl, struct msgblk *msg, (*bad_addresses)++; idp->val.status.mark = XMIT_ANTISPAM; error(0, 0, - "%cMTP listener doesn't like recipient address `%s'", + _("%cMTP listener doesn't like recipient address `%s'"), ctl->listener, addr); } } @@ -621,7 +624,7 @@ int open_sink(struct query *ctl, struct msgblk *msg, if (SMTP_rcpt(ctl->smtp_socket, addr) != SM_OK) { - error(0, 0, "can't even send to %s!", run.postmaster); + error(0, 0, _("can't even send to %s!"), run.postmaster); SMTP_rset(ctl->smtp_socket); /* required by RFC1870 */ return(PS_SMTP); } @@ -674,7 +677,7 @@ int close_sink(struct query *ctl, flag forward) signal(SIGCHLD, sigchld); if (rc) { - error(0, -1, "MDA exited abnormally or returned nonzero status"); + error(0, -1, _("MDA exited abnormally or returned nonzero status")); return(FALSE); } } @@ -686,7 +689,7 @@ int close_sink(struct query *ctl, flag forward) fclose(sinkfp); if (ferror(sinkfp)) { - error(0, -1, "Message termination or close of BSMTP file failed"); + error(0, -1, _("Message termination or close of BSMTP file failed")); return(FALSE); } } @@ -695,7 +698,7 @@ int close_sink(struct query *ctl, flag forward) /* write message terminator */ if (SMTP_eom(ctl->smtp_socket) != SM_OK) { - error(0, -1, "SMTP listener refused delivery"); + error(0, -1, _("SMTP listener refused delivery")); return(FALSE); } @@ -722,10 +725,10 @@ int close_sink(struct query *ctl, flag forward) * comply. */ if (atoi(smtp_response) == 503) - error(0, -1, "LMTP delivery error on EOM"); + error(0, -1, _("LMTP delivery error on EOM")); else error(0, -1, - "Unexpected non-503 response to LMTP EOM: %s", + _("Unexpected non-503 response to LMTP EOM: %s"), smtp_response); /* diff --git a/socket.c b/socket.c index 5710796c..31620013 100644 --- a/socket.c +++ b/socket.c @@ -2,6 +2,8 @@ * socket.c -- socket library functions * * For license terms, see the file COPYING in this directory. + * + * i18n by Arnaldo Carvalho de Melo 7-Nov-1998 */ #include "config.h" @@ -29,6 +31,7 @@ #endif #include "socket.h" #include "fetchmail.h" +#include "i18n.h" #ifdef HAVE_RES_SEARCH /* some versions of FreeBSD should declare this but don't */ @@ -51,7 +54,7 @@ static int handle_plugin(const char *host, int fds[2]; if (socketpair(AF_UNIX,SOCK_STREAM,0,fds)) { - error(0, 0, "fetchmail: socketpair failed: %s(%d)",strerror(errno),errno); + error(0, 0, _("fetchmail: socketpair failed: %s(%d)"),strerror(errno),errno); return -1; } if (!fork()) @@ -59,9 +62,9 @@ static int handle_plugin(const char *host, dup2(fds[0],0); dup2(fds[0],1); if (outlevel >= O_VERBOSE) - error(0, 0, "running %s %s %s", plugin, host, service); + error(0, 0, _("running %s %s %s"), plugin, host, service); execlp(plugin,plugin,host,service,0); - error(0, 0, "execl(%s) failed: %s (%d)", + error(0, 0, _("execl(%s) failed: %s (%d)"), plugin, strerror(errno), errno); exit(0); } @@ -86,7 +89,7 @@ int SockOpen(const char *host, const char *service, const char *options, req.ai_socktype = SOCK_STREAM; if (i = getaddrinfo(host, service, &req, &ai)) { - error(0, 0, "fetchmail: getaddrinfo(%s.%s): %s(%d)", host, service, gai_strerror(i), i); + error(0, 0, _("fetchmail: getaddrinfo(%s.%s): %s(%d)"), host, service, gai_strerror(i), i); return -1; }; @@ -164,7 +167,7 @@ int SockOpen(const char *host, int clientPort, const char *options, if(hp->h_length != 4 && hp->h_length != 8) { h_errno = errno = 0; - error(0, 0, "fetchmail: illegal address length received for host %s"); + error(0, 0, _("fetchmail: illegal address length received for host %s")); return -1; } /* diff --git a/specgen.sh b/specgen.sh index c72b0c6f..195829c9 100755 --- a/specgen.sh +++ b/specgen.sh @@ -11,6 +11,7 @@ Packager: Eric S. Raymond URL: http://www.tuxedo.org/~esr/fetchmail Source: %{name}-%{version}.tar.gz Group: Applications/Mail +Group(pt_BR): Aplicações/Correio Eletrônico Copyright: GPL Icon: fetchmail.gif Requires: smtpdaemon @@ -18,6 +19,7 @@ BuildRoot: /var/tmp/%{name}-%{version} Summary: Full-featured POP/IMAP mail retrieval daemon Summary(fr): Collecteur (POP/IMAP) de courrier électronique Summary(de): Program zum Abholen von E-Mail via POP/IMAP +Summary(pt_BR): Busca mensagens de um servidor usando POP ou IMAP %description fetchmail is a free, full-featured, robust, and well-documented remote @@ -46,6 +48,12 @@ der lokalen Client-Maschine weiter, damit sie dann von normalen MUAs gelesen werden kann. Ein interaktiver GUI-Konfigurator auch gut geeignet zum Gebrauch durch Endbenutzer wird mitgeliefert. +%description -l pt_BR +fetchmail é um programa que é usado para recuperar mensagens de um +servidor de mail remoto. Ele pode usar Post Office Protocol (POP) +ou IMAP (Internet Mail Access Protocol) para isso, e entrega o mail +através do servidor local SMTP (normalmente sendmail). + %prep %setup @@ -76,6 +84,7 @@ rm -rf \$RPM_BUILD_ROOT /usr/lib/rhs/control-panel/fetchmailconf.xpm /usr/lib/rhs/control-panel/fetchmailconf.init /etc/X11/wmconfig/fetchmailconf +/usr/share/locale/*/LC_MESSAGES/fetchmail.mo %defattr (644, root, man) /usr/man/man1/*.1.gz %defattr (755, root, root) diff --git a/xmalloc.c b/xmalloc.c index 0ce09053..481f8180 100644 --- a/xmalloc.c +++ b/xmalloc.c @@ -2,6 +2,8 @@ * xmalloc.c -- allocate space or die * * For license terms, see the file COPYING in this directory. + * + * i18n by Arnaldo Carvalho de Melo 7-Nov-1998 */ #include "config.h" @@ -12,6 +14,7 @@ #include #endif #include "fetchmail.h" +#include "i18n.h" #if defined(HAVE_VOIDPOINTER) #define XMALLOCTYPE void @@ -26,7 +29,7 @@ xmalloc (int n) p = (XMALLOCTYPE *) malloc(n); if (p == (XMALLOCTYPE *) 0) - error(PS_UNDEFINED, errno, "malloc failed"); + error(PS_UNDEFINED, errno, _("malloc failed")); return(p); } @@ -37,7 +40,7 @@ xrealloc (XMALLOCTYPE *p, int n) return xmalloc (n); p = (XMALLOCTYPE *) realloc(p, n); if (p == (XMALLOCTYPE *) 0) - error(PS_UNDEFINED, errno, "realloc failed"); + error(PS_UNDEFINED, errno, _("realloc failed")); return p; } -- cgit v1.2.3