aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-05-13 15:21:02 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-05-13 15:21:02 +0000
commit113cb4b143f63e18f2cbab9f0abec0ef453fbbd8 (patch)
tree8d8ccc1d6196e5570953033cbed3189a8111196a
parent06aae065b5b5ccf3ae1e4350f97d0ed0a2658501 (diff)
downloadmailfromd-113cb4b143f63e18f2cbab9f0abec0ef453fbbd8.tar.gz
mailfromd-113cb4b143f63e18f2cbab9f0abec0ef453fbbd8.tar.bz2
Mailfromd goes international
git-svn-id: file:///svnroot/mailfromd/trunk@1428 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r--ChangeLog20
-rw-r--r--Makefile.am2
-rw-r--r--bootstrap102
-rw-r--r--configure.ac8
-rw-r--r--gacopyz/Makefile.am1
-rw-r--r--gacopyz/gacopyz.c204
-rw-r--r--gacopyz/gacopyz_priv.h23
-rw-r--r--gacopyz/io.c56
-rw-r--r--gacopyz/proc.c14
-rw-r--r--gacopyz/server.c136
-rw-r--r--gacopyz/smfi.c2
-rw-r--r--po/LINGUAS1
-rw-r--r--po/POTFILES.in74
-rw-r--r--po/pl.po2536
-rw-r--r--src/Makefile.am5
-rw-r--r--src/bi_db.m430
-rw-r--r--src/bi_dns.m424
-rw-r--r--src/bi_io.m418
-rw-r--r--src/bi_ipaddr.m44
-rw-r--r--src/bi_mail.m412
-rw-r--r--src/bi_other.m412
-rw-r--r--src/bi_poll.m48
-rw-r--r--src/bi_sa.m448
-rw-r--r--src/bi_string.m411
-rw-r--r--src/cache.c10
-rw-r--r--src/db.c32
-rw-r--r--src/debug.cin6
-rw-r--r--src/dnsbase.c6
-rw-r--r--src/dnscache.c12
-rw-r--r--src/drivers.c54
-rw-r--r--src/engine.c70
-rw-r--r--src/gram.y228
-rw-r--r--src/lex.l43
-rw-r--r--src/mailfromd.h26
-rw-r--r--src/main.c106
-rw-r--r--src/mf-status.mfi2
-rw-r--r--src/mtasim.c94
-rw-r--r--src/mu_dbm.c30
-rw-r--r--src/openat-die.c4
-rw-r--r--src/optab.opc2
-rw-r--r--src/prog.c83
-rw-r--r--src/rate.c6
-rw-r--r--src/snarf.m46
-rw-r--r--src/spf.c2
-rw-r--r--src/symtab.c17
-rw-r--r--tests/invcidr.at2
-rw-r--r--tests/invcidr2.at2
-rw-r--r--tests/shadow.at4
48 files changed, 3521 insertions, 677 deletions
diff --git a/ChangeLog b/ChangeLog
index 8651cdf0..c95294c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2007-05-13 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * src/symtab.c, src/lex.l, src/mu_dbm.c, src/engine.c,
+ src/snarf.m4, src/dnscache.c, src/gram.y, src/debug.cin,
+ src/drivers.c, src/bi_string.m4, src/bi_poll.m4, src/dnsbase.c,
+ src/mailfromd.h, src/db.c, src/openat-die.c, src/spf.c,
+ src/bi_dns.m4, src/cache.c, src/optab.opc, src/prog.c,
+ src/bi_ipaddr.m4, src/bi_sa.m4, src/mf-status.mfi, src/bi_io.m4,
+ src/main.c, src/Makefile.am, src/bi_other.m4, src/bi_mail.m4,
+ src/mtasim.c, src/rate.c, src/bi_db.m4, tests/shadow.at,
+ tests/invcidr.at, tests/invcidr2.at, configure.ac, gacopyz/smfi.c,
+ gacopyz/gacopyz_priv.h, gacopyz/proc.c, gacopyz/server.c,
+ gacopyz/io.c, gacopyz/Makefile.am, gacopyz/gacopyz.c,
+ bootstrap: Add i18n framework
+
+ * po: New directory
+ * po/POTFILES.in: New file
+ * po/LINGUAS: New file
+ * po/pl.po: New translation
+
2007-05-12 Sergey Poznyakoff <gray@gnu.org.ua>
-= Release 4.0 =-
diff --git a/Makefile.am b/Makefile.am
index 22784b4a..09b28270 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,7 +17,7 @@
# MA 02110-1301 USA
AUTOMAKE_OPTIONS = gnits 1.8.5 std-options
-SUBDIRS = lib gacopyz src mflib etc doc tests
+SUBDIRS = lib gacopyz src mflib po etc doc tests
ACLOCAL_AMFLAGS = -I m4
distuninstallcheck_listfiles = find . -type f -not -name 'mailfromd.rc' -print
diff --git a/bootstrap b/bootstrap
index fc2a8d0d..279699e7 100644
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,11 @@
#! /bin/sh
+############################
+## Configuration
+############################
+
MODLIST="argp\
fprintftime\
+ gettext\
malloc\
memrchr\
mkdtemp\
@@ -11,7 +16,98 @@ MODLIST="argp\
snprintf\
strtok_r\
version-etc"
-
+
+# Other locale categories that need message catalogs.
+EXTRA_LOCALE_CATEGORIES=
+
+NLS_MARKERS="\
+ MF_THROW:2\
+ MF_ASSERT:3\
+ parse_error:1\
+ parse_error_locus:2\
+ mu_error:1\
+ gacopyz_io_log:3\
+ gacopyz_logmsg:2\
+ gacopyz_log:3"
+
+# Additional xgettext options to use. Use "\\\newline" to break lines.
+XGETTEXT_OPTIONS='\\\
+ --flag=_:1:pass-c-format\\\
+ --flag=N_:1:pass-c-format\\\
+ --flag=error:3:c-format --flag=error_at_line:5:c-format\\\
+'
+
+COPYRIGHT_HOLDER="Sergey Poznyakoff"
+
+# Translation Project URL, for the registry of all projects
+# and for the translation-team master directory.
+# (for future use)
+#TP_URL='http://www.iro.umontreal.ca/translation/registry.cgi?domain='
+#TP_PO_URL='http://www.iro.umontreal.ca/translation/teams/PO/'
+
+# Currently here
+TP_URL=ftp://download.gnu.org.ua/pub/users/gray/po/mailfromd/
+
+############################
+## Implementation
+############################
+
+extract_package_name='
+ /^AC_INIT(/{
+ /.*,.*,.*,/{
+ s///
+ s/[][]//g
+ p
+ q
+ }
+ s/AC_INIT(\[*//
+ s/]*,.*//
+ s/^GNU //
+ y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+ s/[^A-Za-z0-9_]/-/g
+ p
+ }
+'
+package=`sed -n "$extract_package_name" configure.ac` || exit
+echo "$0: Bootstrapping $package"
+
+echo "$0: Importing gnulib files ..."
gnulib-tool --import --avoid xalloc-die --avoid openat-die $MODLIST
-test -f lib/daemon.c || ln src/daemon.c lib/
-autoreconf -i -f -s
+
+# Create gettext configuration.
+echo "$0: Creating po/Makevars from po/Makevars.template ..."
+rm -f po/Makevars
+
+if [ -n "$NLS_MARKERS" ]; then
+ XGETTEXT_OPTIONS="$XGETTEXT_OPTIONS "`echo $NLS_MARKERS | tr ' ' '\n' | sed 's/.*/ --flag=&:pass-c-format\\\\\\\\\\\\/'`"
+"
+fi
+
+sed '
+ 1i\
+# -*- buffer-read-only: t -*- vi: set ro:\
+# DO NOT EDIT! GENERATED AUTOMATICALLY!
+
+ /^COPYRIGHT_HOLDER *=/s/=.*/= '"$COPYRIGHT_HOLDER"'/
+ /^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
+ /^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
+ /^XGETTEXT_OPTIONS *=/{
+ s/$/ \\/
+ a\
+ '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
+ }
+' po/Makevars.template >po/Makevars
+
+echo "$0: Reconfiguring ..."
+
+for command in \
+ 'aclocal --force -I m4' \
+ 'autoconf --force' \
+ 'autoheader --force' \
+ 'automake --add-missing --copy --force-missing';
+do
+ echo "$0: $command ..."
+ $command || exit
+done
+
+echo "$0: done. Now you can run './configure'."
diff --git a/configure.ac b/configure.ac
index 73e8361f..d207fd26 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,6 +110,11 @@ AH_BOTTOM([#ifndef HAVE_ARGCV_UNESCAPE_CHAR
#endif
])
+# Gettext.
+AM_GNU_GETTEXT([external], [need-formatstring-macros])
+AM_GNU_GETTEXT_VERSION([0.16])
+
+# Syslog
AC_ARG_ENABLE([syslog-async],
AC_HELP_STRING([--enable-syslog-async],
[enable non-blocking version of syslog]),
@@ -539,7 +544,8 @@ AC_CONFIG_FILES([Makefile
lib/Makefile
gacopyz/Makefile
src/Makefile
- mflib/Makefile
+ mflib/Makefile
+ po/Makefile.in
etc/Makefile
doc/Makefile])
AC_OUTPUT
diff --git a/gacopyz/Makefile.am b/gacopyz/Makefile.am
index fa793e82..8747d0c6 100644
--- a/gacopyz/Makefile.am
+++ b/gacopyz/Makefile.am
@@ -33,6 +33,7 @@ libgacopyz_a_SOURCES = \
EXTRA_DIST=trans.tab trans.awk
BUILT_SOURCES=trans.h
+INCLUDES=-I$(top_srcdir)/lib
trans.h: ${top_srcdir}/gacopyz/trans.tab ${top_srcdir}/gacopyz/trans.awk
$(AWK) -f ${top_srcdir}/gacopyz/trans.awk \
diff --git a/gacopyz/gacopyz.c b/gacopyz/gacopyz.c
index 81ed394d..05a25e6f 100644
--- a/gacopyz/gacopyz.c
+++ b/gacopyz/gacopyz.c
@@ -20,10 +20,10 @@
#define TRACE(conn,cmd,size,buf) do { \
gacopyz_log(conn, SMI_LOG_DEBUG, \
- "send header: size=%lu, cmd=%c", \
+ _("send header: size=%lu, cmd=%c"),\
size, cmd); \
gacopyz_logdump(conn, SMI_LOG_DEBUG, \
- "send data", buf, size); \
+ _("send data"), buf, size); \
} while (0)
int
@@ -37,8 +37,8 @@ gacopyz_init(gacopyz_conn_t *pconn, struct smfiDesc *desc)
len = strlen(name);
if (desc->xxfi_version != SMFI_VERSION) {
gacopyz_logmsg(SMI_LOG_ERR,
- "smfi_register: %s: version mismatch; "
- "application %d != implementation %d",
+ _("smfi_register: %s: version mismatch; "
+ "application %d != implementation %d"),
name, desc->xxfi_version, SMFI_VERSION);
return MI_FAILURE;
}
@@ -47,7 +47,8 @@ gacopyz_init(gacopyz_conn_t *pconn, struct smfiDesc *desc)
if (!conn) {
gacopyz_logmsg(SMI_LOG_ERR,
- "smfi_register: %s: not enough memory", name);
+ "smfi_register: %s: %s", name,
+ strerror(errno));
return MI_FAILURE;
}
@@ -130,7 +131,7 @@ parse_connection(gacopyz_conn_t conn,
int rc = gacopyz_parse_connection(cstr, pproto, pport, ppath);
if (rc)
gacopyz_log(conn, SMI_LOG_ERR,
- "parse_connection: not enough memory");
+ "parse_connection: %s", strerror(ENOMEM));
return rc;
}
@@ -140,7 +141,7 @@ cleanup_unix_socket(gacopyz_conn_t conn, void *data)
{
if (unlink(data) && errno != ENOENT)
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: %s: cannot unlink: %s",
+ _("%s: %s: cannot unlink: %s"),
conn->desc.xxfi_name, (char*)data,
strerror(errno));
free(data);
@@ -166,8 +167,8 @@ do_connect(gacopyz_conn_t conn,
if (port) {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: invalid connection type: %s; "
- "port is meaningless for UNIX sockets",
+ _("%s: invalid connection type: %s; "
+ "port is meaningless for UNIX sockets"),
conn->desc.xxfi_name, cstr);
return -1;
}
@@ -175,7 +176,7 @@ do_connect(gacopyz_conn_t conn,
if (strlen(path) > sizeof addr.sun.sun_path) {
errno = EINVAL;
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: %s: UNIX socket name too long",
+ _("%s: %s: UNIX socket name too long"),
conn->desc.xxfi_name, path);
return -1;
}
@@ -190,22 +191,22 @@ do_connect(gacopyz_conn_t conn,
conn->cleanup_data = strdup(path);
} else {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: %s: cannot stat socket: %s",
- conn->desc.xxfi_name, path,
- strerror(errno));
+ _("%s: %s: cannot stat socket: %s"),
+ conn->desc.xxfi_name, path,
+ strerror(errno));
return -1;
}
} else {
/* FIXME: Check permissions? */
if (!S_ISSOCK(st.st_mode)) {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: %s: not a socket",
- conn->desc.xxfi_name, path);
+ _("%s: %s: not a socket"),
+ conn->desc.xxfi_name, path);
return -1;
}
if (rmsocket && unlink(path)) {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: %s: cannot unlink: %s",
+ _("%s: %s: cannot unlink: %s"),
conn->desc.xxfi_name, path,
strerror(errno));
return -1;
@@ -222,9 +223,9 @@ do_connect(gacopyz_conn_t conn,
if (!port) {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: invalid connection type: %s; "
- "missing port number",
- conn->desc.xxfi_name, cstr);
+ _("%s: invalid connection type: %s; "
+ "missing port number"),
+ conn->desc.xxfi_name, cstr);
return -1;
}
@@ -232,8 +233,8 @@ do_connect(gacopyz_conn_t conn,
if (*p == 0) {
if (num != pnum) {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: invalid connection type: %s; "
- "bad port number",
+ _("%s: invalid connection type: %s; "
+ "bad port number"),
conn->desc.xxfi_name, cstr);
return -1;
}
@@ -242,8 +243,8 @@ do_connect(gacopyz_conn_t conn,
struct servent *sp = getservbyname(path, "tcp");
if (!sp) {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: invalid connection type: %s; "
- "unknown port name",
+ _("%s: invalid connection type: %s; "
+ "unknown port name"),
conn->desc.xxfi_name, cstr);
return -1;
}
@@ -256,8 +257,8 @@ do_connect(gacopyz_conn_t conn,
struct hostent *hp = gethostbyname(path);
if (!hp) {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: Unknown host name %s",
- conn->desc.xxfi_name, path);
+ _("%s: Unknown host name %s"),
+ conn->desc.xxfi_name, path);
return -1;
}
addr.sa.sa_family = hp->h_addrtype;
@@ -269,15 +270,15 @@ do_connect(gacopyz_conn_t conn,
default:
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: invalid connection type: %s; "
- "unsupported address family",
+ _("%s: invalid connection type: %s; "
+ "unsupported address family"),
conn->desc.xxfi_name, cstr);
return -1;
}
}
} else {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: unsupported protocol: %s",
+ _("%s: unsupported protocol: %s"),
conn->desc.xxfi_name, proto);
return -1;
}
@@ -285,16 +286,16 @@ do_connect(gacopyz_conn_t conn,
fd = socket(addr.sa.sa_family, SOCK_STREAM, 0);
if (fd == -1) {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: Unable to create new socket: %s",
- conn->desc.xxfi_name, strerror(errno));
+ _("%s: Unable to create new socket: %s"),
+ conn->desc.xxfi_name, strerror(errno));
return -1;
}
if ((flags = fcntl(fd, F_GETFD, 0)) == -1 ||
fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1) {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: Cannot set close-on-exec: %s",
- conn->desc.xxfi_name, strerror(errno));
+ _("%s: Cannot set close-on-exec: %s"),
+ conn->desc.xxfi_name, strerror(errno));
close(fd);
return -1;
}
@@ -303,7 +304,7 @@ do_connect(gacopyz_conn_t conn,
&& setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *) &yes,
sizeof(yes)) == -1) {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: set reuseaddr failed (%s)",
+ _("%s: set reuseaddr failed (%s)"),
conn->desc.xxfi_name, strerror(errno));
close(fd);
return -1;
@@ -311,16 +312,16 @@ do_connect(gacopyz_conn_t conn,
if (bind(fd, &addr.sa, socklen) < 0) {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: Cannot bind to port %s: %s",
- conn->desc.xxfi_name, cstr, strerror(errno));
+ _("%s: Cannot bind to port %s: %s"),
+ conn->desc.xxfi_name, cstr, strerror(errno));
close(fd);
return -1;
}
if (listen(fd, backlog)) {
gacopyz_log(conn, SMI_LOG_ERR,
- "%s: Cannot listen on port %s: %s",
- conn->desc.xxfi_name, cstr, strerror(errno));
+ _("%s: Cannot listen on port %s: %s"),
+ conn->desc.xxfi_name, cstr, strerror(errno));
close(fd);
return -1;
}
@@ -338,14 +339,14 @@ gacopyz_open(gacopyz_conn_t conn, const char *cstr, int backlog, int rmsocket)
if (!conn) {
gacopyz_logmsg(SMI_LOG_ERR,
- "empty or missing socket information");
+ _("Empty or missing socket information"));
errno = EINVAL;
return MI_FAILURE;
}
gacopyz_log(conn, SMI_LOG_DEBUG,
- "%s: opening listen socket on %s",
- conn->desc.xxfi_name, cstr);
+ _("%s: opening listen socket on %s"),
+ conn->desc.xxfi_name, cstr);
if (parse_connection(conn, cstr, &proto, &port, &path)) {
errno = ENOENT;
return MI_FAILURE;
@@ -485,7 +486,8 @@ ctx_read(SMFICTX *ctx, char *buf, size_t size)
if (res == 0) {
gacopyz_log(ctx->conn,
SMI_LOG_ERR,
- "ctx_read: connection timed out");
+ _("%s: connection timed out"),
+ "ctx_read");
errno = ETIMEDOUT;
rc = MI_FAILURE;
break;
@@ -497,8 +499,9 @@ ctx_read(SMFICTX *ctx, char *buf, size_t size)
} else if (rc > 0) {
if (FD_ISSET(ctx->sd, &xset)) {
gacopyz_log(ctx->conn,
- SMI_LOG_ERR,
- "ctx_read: exception on control fd");
+ SMI_LOG_ERR,
+ _("%s: exception on control fd"),
+ "ctx_read");
rc = MI_FAILURE;
break;
}
@@ -508,15 +511,17 @@ ctx_read(SMFICTX *ctx, char *buf, size_t size)
res = read(ctx->sd, buf, size);
if (res == -1) {
gacopyz_log(ctx->conn,
- SMI_LOG_ERR,
- "read failed: %s",
- strerror(errno));
+ SMI_LOG_ERR,
+ _("%s: read failed: %s"),
+ "ctx_read",
+ strerror(errno));
rc = MI_FAILURE;
break;
} else if (res == 0) {
gacopyz_log(ctx->conn,
SMI_LOG_ERR,
- "ctx_read: end of file");
+ _("%s: end of file"),
+ "ctx_read");
rc = MI_FAILURE;
break;
}
@@ -549,7 +554,8 @@ ctx_write(SMFICTX *ctx, char *buf, size_t size)
if (res == 0) {
gacopyz_log(ctx->conn,
SMI_LOG_ERR,
- "ctx_write: connection timed out");
+ _("%s: connection timed out"),
+ "ctx_write");
errno = ETIMEDOUT;
rc = MI_FAILURE;
break;
@@ -561,8 +567,9 @@ ctx_write(SMFICTX *ctx, char *buf, size_t size)
} else if (rc > 0) {
if (FD_ISSET(ctx->sd, &xset)) {
gacopyz_log(ctx->conn,
- SMI_LOG_ERR,
- "ctx_write: exception on control fd");
+ SMI_LOG_ERR,
+ _("%s: exception on control fd"),
+ "ctx_write");
rc = MI_FAILURE;
break;
}
@@ -572,15 +579,17 @@ ctx_write(SMFICTX *ctx, char *buf, size_t size)
res = write(ctx->sd, buf, size);
if (res == -1) {
gacopyz_log(ctx->conn,
- SMI_LOG_ERR,
- "write failed: %s",
- strerror(errno));
+ SMI_LOG_ERR,
+ _("%s: write failed: %s"),
+ "ctx_write",
+ strerror(errno));
rc = MI_FAILURE;
break;
} else if (res == 0) {
gacopyz_log(ctx->conn,
SMI_LOG_ERR,
- "ctx_write: wrote 0 bytes");
+ _("%s: wrote 0 bytes"),
+ "ctx_write");
rc = MI_FAILURE;
break;
}
@@ -616,7 +625,7 @@ get_command(SMFICTX *ctx, unsigned char *cmd, size_t *pcount,
char *p = realloc(*pbuf, size + 1);
if (!p) {
gacopyz_log(ctx->conn,
- SMI_LOG_ERR, "not enough memory");
+ SMI_LOG_ERR, "%s", strerror(errno));
return MI_FAILURE;
}
*pbuf = p;
@@ -624,15 +633,15 @@ get_command(SMFICTX *ctx, unsigned char *cmd, size_t *pcount,
}
gacopyz_log(ctx->conn, SMI_LOG_DEBUG,
- "read header: size=%lu, cmd=%c",
- size, header.hdr.cmd);
+ _("Read header: size=%lu, cmd=%c"),
+ size, header.hdr.cmd);
if ((rc = ctx_read(ctx, *pbuf, size)) != MI_SUCCESS)
return rc;
(*pbuf)[size] = 0;
gacopyz_logdump(ctx->conn, SMI_LOG_DEBUG,
- "read data", *pbuf, size);
+ _("read data"), *pbuf, size);
*pcount = size;
*cmd = header.hdr.cmd;
return MI_SUCCESS;
@@ -888,8 +897,9 @@ shan_connect(SMFICTX *ctx, union state_arg *arg, unsigned char *cmd)
case SMFIA_UNIX:
if (len >= sizeof sockaddr.sunix.sun_path) {
gacopyz_log(ctx->conn, SMI_LOG_ERR,
- "%s: shan_connect: path too long: %lu",
+ "%s: shan_connect: %s: %lu",
ctx->conn->desc.xxfi_name,
+ _("path too long"),
(unsigned long) len);
return sret_abort;
}
@@ -901,9 +911,9 @@ shan_connect(SMFICTX *ctx, union state_arg *arg, unsigned char *cmd)
if (inet_aton(s,
(struct in_addr *) &sockaddr.sin.sin_addr) != 1) {
gacopyz_log(ctx->conn, SMI_LOG_ERR,
- "%s: shan_connect: inet_aton(%s) failed",
- ctx->conn->desc.xxfi_name,
- s);
+ _("%s: shan_connect: inet_aton(%s) failed"),
+ ctx->conn->desc.xxfi_name,
+ s);
return sret_abort;
}
sockaddr.sa.sa_family = AF_INET;
@@ -913,9 +923,9 @@ shan_connect(SMFICTX *ctx, union state_arg *arg, unsigned char *cmd)
case SMFIA_INET6:
default:
gacopyz_log(ctx->conn, SMI_LOG_ERR,
- "%s: shan_connect: unknown family %d",
- ctx->conn->desc.xxfi_name,
- family);
+ _("%s: shan_connect: unknown family %d"),
+ ctx->conn->desc.xxfi_name,
+ family);
return sret_abort;
}
}
@@ -988,10 +998,10 @@ shan_optneg(SMFICTX *ctx, union state_arg *arg, unsigned char *cmd)
if (arg->ints[0] < ctx->conn->desc.xxfi_version) {
gacopyz_log(ctx->conn, SMI_LOG_ERR,
- "%s: shan_optneg: version mismatch; "
- "MTA: %ld < milter: %d",
- ctx->conn->desc.xxfi_name,
- arg->ints[0], ctx->conn->desc.xxfi_version);
+ _("%s: shan_optneg: version mismatch; "
+ "MTA: %ld < milter: %d"),
+ ctx->conn->desc.xxfi_name,
+ arg->ints[0], ctx->conn->desc.xxfi_version);
return sret_abort;
}
@@ -1000,10 +1010,10 @@ shan_optneg(SMFICTX *ctx, union state_arg *arg, unsigned char *cmd)
val = SMFI_V1_ACTS;
if ((val & ctx->conn->desc.xxfi_flags) != ctx->conn->desc.xxfi_flags) {
gacopyz_log(ctx->conn, SMI_LOG_ERR,
- "%s: shan_optneg: flags %#x do not match "
- "actions requirements %#x",
- ctx->conn->desc.xxfi_name, val,
- ctx->conn->desc.xxfi_flags);
+ _("%s: shan_optneg: flags %#x do not match "
+ "actions requirements %#x"),
+ ctx->conn->desc.xxfi_name, val,
+ ctx->conn->desc.xxfi_flags);
return sret_abort;
}
@@ -1012,8 +1022,8 @@ shan_optneg(SMFICTX *ctx, union state_arg *arg, unsigned char *cmd)
val = SMFI_V1_PROT;
if ((val & ctx->flags) != ctx->flags) {
gacopyz_log(ctx->conn, SMI_LOG_ERR,
- "%s: shan_optneg: flags %#x do not match "
- "protocol requirement %#x",
+ _("%s: shan_optneg: flags %#x do not match "
+ "protocol requirement %#x"),
ctx->conn->desc.xxfi_name, val,
ctx->flags);
return sret_abort;
@@ -1244,7 +1254,7 @@ gacopyz_context_loop(gacopyz_conn_t conn, int fd)
transtab[st_eohs][st_skip] = !!(ctx.flags & SMFIP_NOEOH);
transtab[st_body][st_skip] = !!(ctx.flags & SMFIP_NOBODY);
- gacopyz_log(conn, SMI_LOG_DEBUG, "begin context loop");
+ gacopyz_log(conn, SMI_LOG_DEBUG, _("Begin context loop"));
while (!stop
&& (rc = get_command(&ctx, &cmd, &size, &buffer, &bufsize))
@@ -1256,11 +1266,11 @@ gacopyz_context_loop(gacopyz_conn_t conn, int fd)
if (sd == NULL) {
gacopyz_log(conn, SMI_LOG_ERR,
- "unknown command: %c",
- cmd);
+ _("Unknown command: %c"),
+ cmd);
gacopyz_logdump(conn, SMI_LOG_ERR,
- "buffer",
- buffer, size);
+ _("buffer"),
+ buffer, size);
rc = MI_FAILURE;
break;
}
@@ -1270,10 +1280,10 @@ gacopyz_context_loop(gacopyz_conn_t conn, int fd)
if (next_state != st_none && !trans_ok(state, next_state)) {
gacopyz_log(conn, SMI_LOG_DEBUG,
- "transition from state %s to %s is "
- "prohibited",
- STATE_NAME(state),
- STATE_NAME(next_state));
+ _("Transition from state %s to %s is "
+ "prohibited"),
+ STATE_NAME(state),
+ STATE_NAME(next_state));
if (ST_IN_MAIL(state) && ctx.conn->desc.xxfi_abort)
ctx.conn->desc.xxfi_abort(&ctx);
@@ -1290,9 +1300,9 @@ gacopyz_context_loop(gacopyz_conn_t conn, int fd)
if (parse_state_arg(&arg, sd->arg_type, buffer, size)) {
gacopyz_log(conn, SMI_LOG_ERR,
- "argument parsing failed");
+ _("Argument parsing failed"));
gacopyz_logdump(conn, SMI_LOG_ERR,
- "buffer",
+ _("buffer"),
buffer, size);
rc = MI_FAILURE;
break;
@@ -1322,14 +1332,14 @@ gacopyz_context_loop(gacopyz_conn_t conn, int fd)
case sret_fail:
gacopyz_log(conn, SMI_LOG_DEBUG,
- "%s handler returned failure",
- sd->name);
+ _("%s handler returned failure"),
+ sd->name);
break;
case sret_abort:
gacopyz_log(conn, SMI_LOG_DEBUG,
- "%s handler returned abort",
- sd->name);
+ _("%s handler returned abort"),
+ sd->name);
rc = MI_FAILURE;
}
@@ -1337,7 +1347,7 @@ gacopyz_context_loop(gacopyz_conn_t conn, int fd)
break;
}
- gacopyz_log(conn, SMI_LOG_DEBUG, "end context loop: %d", rc);
+ gacopyz_log(conn, SMI_LOG_DEBUG, _("End context loop: %d"), rc);
if (rc != MI_SUCCESS && ST_IN_MAIL(state)
&& ctx.conn->desc.xxfi_abort)
@@ -1365,7 +1375,7 @@ gacopyz_handle_connection(gacopyz_conn_t conn)
if (errno == EINTR)
return MI_SUCCESS;
gacopyz_log(conn, SMI_LOG_ERR,
- "accept failed: %s", strerror(errno));
+ _("accept failed: %s"), strerror(errno));
return MI_FAILURE;
}
@@ -1373,7 +1383,7 @@ gacopyz_handle_connection(gacopyz_conn_t conn)
pid_t pid = fork();
if (pid == -1) {
gacopyz_log(conn, SMI_LOG_ERR,
- "fork() failed: %s",
+ _("fork()