diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-03-09 16:20:50 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-03-09 16:20:50 +0000 |
commit | 67f891b804218ca7b42318fadeedfeec9243a0d6 (patch) | |
tree | 8b6b14e31236a91108865b85241b02f069a30b0e | |
parent | 14cc2f2806c7b66992ca4a41d6f8da6020931194 (diff) | |
download | mailfromd-67f891b804218ca7b42318fadeedfeec9243a0d6.tar.gz mailfromd-67f891b804218ca7b42318fadeedfeec9243a0d6.tar.bz2 |
Prefix all exception codes with `e_'.
* src/mfstat.awk: Look for mf_exception_code/mf_exception_count.
* src/lex.l (variable_or_const): Add type cast.
* src/mailfromd.h (enum mf_status_code): Retain only first four proper
status codes.
(enum mf_exception_code): New type.
(mf_status_to_exception): New macro
(mf_exception_str,string_to_exception): New functions
(mf_status_str): Rewrite as macro.
(string_to_stat): Remove.
* src/mf-status.mfi: Prefix codes with e_
* src/status.mfi: Prefix exception codes with e_. Retain
succes, not_found, failure, and temp_failure for backward
compatibility.
Retain old exception names if m4 symbol COMPAT_4_3 is defined.
* src/gram.y, src/snarf.m4, src/bi_poll.m4, src/bi_string.m4,
src/drivers.c, src/bi_dns.m4, src/bi_system.m4, src/bi_spf.m4,
src/prog.c, src/bi_ipaddr.m4, src/bi_sa.m4, src/bi_io.m4,
src/bi_sieve.m4, src/bi_vars.m4, src/bi_other.m4, src/bi_mail.m4,
src/bi_gettext.m4, src/bi_db.m4, : Use new exception names.
* configure.ac (MF_VERSION_PATCH): Set to 90
* doc/mailfromd.texi: Document changes.
git-svn-id: file:///svnroot/mailfromd/branches/release_4_3_patches@1628 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r-- | ChangeLog | 24 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | doc/mailfromd.texi | 128 | ||||
-rw-r--r-- | src/bi_db.m4 | 22 | ||||
-rw-r--r-- | src/bi_dns.m4 | 22 | ||||
-rw-r--r-- | src/bi_gettext.m4 | 4 | ||||
-rw-r--r-- | src/bi_io.m4 | 16 | ||||
-rw-r--r-- | src/bi_ipaddr.m4 | 6 | ||||
-rw-r--r-- | src/bi_mail.m4 | 14 | ||||
-rw-r--r-- | src/bi_other.m4 | 14 | ||||
-rw-r--r-- | src/bi_poll.m4 | 18 | ||||
-rw-r--r-- | src/bi_sa.m4 | 52 | ||||
-rw-r--r-- | src/bi_sieve.m4 | 13 | ||||
-rw-r--r-- | src/bi_spf.m4 | 2 | ||||
-rw-r--r-- | src/bi_string.m4 | 8 | ||||
-rw-r--r-- | src/bi_system.m4 | 2 | ||||
-rw-r--r-- | src/bi_vars.m4 | 2 | ||||
-rw-r--r-- | src/drivers.c | 6 | ||||
-rw-r--r-- | src/gram.y | 12 | ||||
-rw-r--r-- | src/lex.l | 2 | ||||
-rw-r--r-- | src/mailfromd.h | 54 | ||||
-rw-r--r-- | src/mf-status.mfi | 12 | ||||
-rw-r--r-- | src/mfstat.awk | 8 | ||||
-rw-r--r-- | src/prog.c | 28 | ||||
-rw-r--r-- | src/snarf.m4 | 2 | ||||
-rw-r--r-- | src/status.mfi | 8 |
26 files changed, 267 insertions, 214 deletions
@@ -2,2 +2,26 @@ + Prefix all exception codes with `e_'. + + * src/mfstat.awk: Look for mf_exception_code/mf_exception_count. + * src/lex.l (variable_or_const): Add type cast. + * src/mailfromd.h (enum mf_status_code): Retain only first four proper + status codes. + (enum mf_exception_code): New type. + (mf_status_to_exception): New macro + (mf_exception_str,string_to_exception): New functions + (mf_status_str): Rewrite as macro. + (string_to_stat): Remove. + * src/mf-status.mfi: Prefix codes with e_ + * src/status.mfi: Prefix exception codes with e_. Retain + succes, not_found, failure, and temp_failure for backward + compatibility. + Retain old exception names if m4 symbol COMPAT_4_3 is defined. + * src/gram.y, src/snarf.m4, src/bi_poll.m4, src/bi_string.m4, + src/drivers.c, src/bi_dns.m4, src/bi_system.m4, src/bi_spf.m4, + src/prog.c, src/bi_ipaddr.m4, src/bi_sa.m4, src/bi_io.m4, + src/bi_sieve.m4, src/bi_vars.m4, src/bi_other.m4, src/bi_mail.m4, + src/bi_gettext.m4, src/bi_db.m4, : Use new exception names. + * configure.ac (MF_VERSION_PATCH): Set to 90 + * doc/mailfromd.texi: Document changes. + Name clashes between constants and variables went unnoticed by the diff --git a/configure.ac b/configure.ac index 6b55d68d..c76eae46 100644 --- a/configure.ac +++ b/configure.ac @@ -19,3 +19,3 @@ m4_define([MF_VERSION_MAJOR], 4) m4_define([MF_VERSION_MINOR], 3) -m4_define([MF_VERSION_PATCH], 1) +m4_define([MF_VERSION_PATCH], 90) AC_INIT([mailfromd], diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index e4b456d1..27ff4c46 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi @@ -135,2 +135,3 @@ Building the Package +* 43x-440:: Upgrading from 4.3.x to 4.4 * 420-43x:: Upgrading from 4.2 to 4.3.x @@ -989,2 +990,3 @@ the corresponding section below. @menu +* 43x-440:: Upgrading from 4.3.x to 4.4 * 420-43x:: Upgrading from 4.2 to 4.3.x @@ -998,2 +1000,7 @@ the corresponding section below. +@node 43x-440 +@section Upgrading from 4.3.x to 4.4 +@cindex Upgrading from 4.3.x to 4.4 +@UNREVISED{} + @node 420-43x @@ -3169,3 +3176,3 @@ done Another common case are undefined Sendmail macros. In this case the -@code{macroundef} exception is generated: +@code{e_macroundef} exception is generated: @@ -5388,3 +5395,3 @@ starting at @var{start}. If @var{length} is omitted, the rest of If @var{length} is greater than the actual length of the string, the -@code{range} exception is signalled. +@code{e_range} exception is signalled. @@ -5522,3 +5529,3 @@ By default, the arguments are used in the order given, where each insufficiently many arguments are given, @code{sprintf} raises -@samp{range} exception. One can also specify explicitly which +@samp{e_range} exception. One can also specify explicitly which argument is taken, at each place where an argument is required, by @@ -5659,3 +5666,3 @@ arguments: If the function is unable to encode the string, it raises the -exception @code{failure}. +exception @code{e_failure}. @@ -5676,3 +5683,3 @@ message_header_encode(%string, "ISO-8859-1") 2047. The function returns the decoded string. If the decoding fails, -it raises @code{failure} exception. The optional argument +it raises @code{e_failure} exception. The optional argument @var{charset} specifies the character set to use (default -- @@ -5736,3 +5743,3 @@ cache database and does not fall back to polling @acronym{MX} servers if the main poll tempfails. The function can throw one of the following -exceptions: @code{failure}, @code{temp_failure}. +exceptions: @code{e_failure}, @code{e_temp_failure}. @end deftypefn @@ -5748,3 +5755,3 @@ not use cache database and does not fall back to polling the @var{ip} if the poll fails. The function can throw one of the following -exceptions: @code{failure}, @code{temp_failure}. +exceptions: @code{e_failure}, @code{e_temp_failure}. @end deftypefn @@ -5757,3 +5764,3 @@ exceptions: @code{failure}, @code{temp_failure}. Returns 0 or 1 depending on the result of the test. Can raise one of -the following exceptions: @code{failure}, @code{temp_failure}. +the following exceptions: @code{e_failure}, @code{e_temp_failure}. @@ -5875,3 +5882,3 @@ inet_ntoa(len_to_netmask(7)) @result{} 254.0.0.0 -If @var{n} is greater than 32 the function raises @code{range} +If @var{n} is greater than 32 the function raises @code{e_range} exception. @@ -6033,3 +6040,3 @@ Sendmail variable @samp{client_addr}. If there is no @samp{PTR} record for @var{ip}, @code{primitive_hostname} -raises the exception @code{not_found}. +raises the exception @code{e_not_found}. @@ -6068,3 +6075,3 @@ records for the @var{domain}. If @var{domain} has no @samp{MX} records, @code{primitive_ismx} raises -exception @code{not_found}. +exception @code{e_not_found}. @@ -6092,3 +6099,3 @@ returns the @acronym{IP} address for the host name specified by @var{host} argument. If @var{host} has no A records, the function raises the -exception @code{not_found}. +exception @code{e_not_found}. @@ -6314,3 +6321,3 @@ expiration interval for that format. @FIXME{How to obtain negative expiration??} Otherwise, @code{db_expire_interval} raises the -@code{not_found} exception. +@code{e_not_found} exception. @end deftypefn @@ -6321,3 +6328,3 @@ expiration??} Otherwise, @code{db_expire_interval} raises the for that format. If @var{fmtid} does not match any known format, -@code{db_name} raises the @code{not_found} exception. +@code{db_name} raises the @code{e_not_found} exception. @end deftypefn @@ -6329,3 +6336,3 @@ for that format. If @var{fmtid} does not match any known format, is currently enabled. If @var{fmtid} does not match any known format, -@code{db_name} raises the @code{not_found} exception. +@code{db_name} raises the @code{e_not_found} exception. @end deftypefn @@ -6403,3 +6410,3 @@ reading. - The @code{open} function will signal exception @code{failure} if it + The @code{open} function will signal exception @code{e_failure} if it is unable to open the resource or get the required access to it. @@ -6412,3 +6419,3 @@ resource and deallocates any memory associated with it. - @code{close} will signal @code{range} exception if @var{rd} lies + @code{close} will signal @code{e_range} exception if @var{rd} lies outside of allowed range of resource descriptors. @FIXME{More info on it} @@ -6427,4 +6434,4 @@ the @var{size} argument is given, writes this number of bytes. - The function will signal @code{range} exception if @var{rd} lies -outside of allowed range of resource descriptors, and @code{ioerr} + The function will signal @code{e_range} exception if @var{rd} lies +outside of allowed range of resource descriptors, and @code{e_io} exception if an @acronym{I/O} error occurs. @@ -6438,3 +6445,3 @@ removed from the return value. The function will signal @code{range} exception if @var{rd} lies -outside of allowed range of resource descriptors, and @code{ioerr} +outside of allowed range of resource descriptors, and @code{e_io} exception if an @acronym{I/O} error occurs. @@ -6693,4 +6700,4 @@ message. The @code{sa} function can signal the following exceptions: -@code{failure} if the connection fails, @code{url} if the supplied -@acronym{URL} is invalid and @code{range} if the supplied port number +@code{e_failure} if the connection fails, @code{e_url} if the supplied +@acronym{URL} is invalid and @code{e_range} if the supplied port number is out of the range 1--65535. @@ -6751,4 +6758,4 @@ done The @code{clamav} function can signal the following exceptions: -@code{failure} if connection failed, @code{url} if the supplied -@acronym{URL} is invalid and @code{range} if the supplied port number +@code{e_failure} if connection failed, @code{e_url} if the supplied +@acronym{URL} is invalid and @code{e_range} if the supplied port number is out of the range 1--65535. @@ -6783,3 +6790,3 @@ explanation. - The function @code{greylist} can signal @code{dbfailure} exception. + The function @code{greylist} can signal @code{e_dbfailure} exception. @end deftypefn @@ -8300,3 +8307,3 @@ match the globbing pattern @var{y}. Both @code{mx matches} and @code{mx fnmatches} can signal the -following exceptions: @code{temp_failure}, @code{failure}. +following exceptions: @code{e_temp_failure}, @code{e_failure}. @@ -9049,4 +9056,4 @@ following table summarizes all the exception types implemented by @table @code -@cindex dbfailure, exception type -@item dbfailure +@cindex e_dbfailure, exception type +@item e_dbfailure General database failure. For example, the database cannot be @@ -9055,8 +9062,10 @@ any @acronym{DBM} database. -@cindex divzero, exception type -@item divzero +@cindex e_divzero, exception type +@item e_divzero Division by zero. +@cindex e_failure, exception type @cindex failure, exception type -@item failure +@item e_failure +@itemx failure A general failure has occurred. In particular, this exception is @@ -9066,4 +9075,4 @@ This exception can be signaled by any @acronym{DNS}-related function -@cindex invcidr, exception type -@item invcidr +@cindex e_invcidr, exception type +@item e_invcidr Invalid @acronym{CIDR} notation. This is signaled by @code{match_cidr} function @@ -9071,4 +9080,4 @@ when its second argument is not a valid @acronym{CIDR}. -@cindex invip, exception type -@item invip +@cindex e_invip, exception type +@item e_invip Invalid @acronym{IP} address. This is signaled by @code{match_cidr} function @@ -9076,4 +9085,4 @@ when its first argument is not a valid @acronym{IP} address. -@cindex invtime, exception type -@item invtime +@cindex e_invtime, exception type +@item e_invtime Invalid time interval specification. It is signaled by @@ -9082,4 +9091,4 @@ when its first argument is not a valid @acronym{IP} address. -@cindex ioerr, exception type -@item ioerr +@cindex e_io, exception type +@item e_io An error occurred during the input-output operation. @xref{I/O @@ -9088,8 +9097,8 @@ exception. -@cindex macroundef, exception type -@item macroundef +@cindex e_macroundef, exception type +@item e_macroundef A Sendmail macro is undefined. -@cindex noresolve, exception type -@item noresolve +@cindex e_noresolve, exception type +@item e_noresolve The argument of a @acronym{DNS}-related function cannot be resolved to host @@ -9098,4 +9107,4 @@ this exception. -@cindex range, exception type -@item range +@cindex e_range, exception type +@item e_range The supplied argument is outside the allowed range. This is @@ -9103,4 +9112,4 @@ signalled, for example, by @code{substring} function (@pxref{substring}). -@cindex regcomp, exception type -@item regcomp +@cindex e_regcomp, exception type +@item e_regcomp Regular expression cannot be compiled. This can happen when a @@ -9110,4 +9119,4 @@ invalid regex. -@cindex ston_conv, exception type -@item ston_conv +@cindex e_ston_conv, exception type +@item e_ston_conv String-to-number conversion failed. This can be signaled when a @@ -9128,4 +9137,6 @@ cannot be converted to a number. +@cindex e_temp_failure, exception type @cindex temp_failure, exception type -@item temp_failure +@item e_temp_failure +@itemx temp_failure A temporary failure has occurred. This can be signaled by @@ -9133,4 +9144,4 @@ cannot be converted to a number. -@cindex url, exception type -@item url +@cindex e_url, exception type +@item e_url The supplied @acronym{URL} is invalid. @xref{Interfaces to @@ -9142,3 +9153,5 @@ Third-Party Programs}. @cindex success, exception type +@cindex e_success, exception type @cindex not_found, exception type +@cindex e_not_found, exception type In addition to these, two symbols are defined that are not exception @@ -9149,3 +9162,4 @@ meaning that the required entity (e.g. domain name or email address) was not found. @xref{figure-poll-wrapper}, for an illustration on -how these can be used. +how these can be used. For consistency with other exception codes, +these can be spelled as @code{e_success} and @code{e_not_found}. @@ -9181,4 +9195,4 @@ all exceptions, is allowed as well. The @var{handler-body} is the list of statements comprising the handler body. For example, the code below -installs a handler for exceptions 2 (@samp{failure}) and 3 -(@samp{temp_failure}): +installs a handler for exceptions 2 (@samp{e_failure}) and 3 +(@samp{e_temp_failure}): @@ -9206,3 +9220,3 @@ above code snippet will look like: -catch failure or temp_failure +catch e_failure or e_temp_failure do @@ -9257,3 +9271,3 @@ prog envfrom do - catch failure or temp_failure + catch e_failure or e_temp_failure do diff --git a/src/bi_db.m4 b/src/bi_db.m4 index f366008f..024337e7 100644 --- a/src/bi_db.m4 +++ b/src/bi_db.m4 @@ -31,3 +31,3 @@ dbmap_lookup(eval_environ_t env, char *dbname, const char *keystr, if (mu_dbm_open(dbname, &db, MU_STREAM_READ, 0, NULL)) - MF_THROW(mf_dbfailure, + MF_THROW(mfe_dbfailure, _("mu_dbm_open(%s) failed: %s"), @@ -93,3 +93,3 @@ MF_DEFUN(dbput, VOID, STRING dbname, STRING keystr, STRING value, if (mu_dbm_open(dbname, &db, MU_STREAM_RDWR, 0640, NULL)) - MF_THROW(mf_dbfailure, + MF_THROW(mfe_dbfailure, _("mu_dbm_open(%s) failed: %s"), @@ -110,3 +110,3 @@ MF_DEFUN(dbput, VOID, STRING dbname, STRING keystr, STRING value, MF_ASSERT(rc == 0, - mf_dbfailure, + mfe_dbfailure, _("Failed to insert data to %s: %s %s: %s"), @@ -125,3 +125,3 @@ MF_DEFUN(dbdel, VOID, STRING dbname, STRING keystr, OPTIONAL, NUMBER null) if (mu_dbm_open(dbname, &db, MU_STREAM_RDWR, 0640, NULL)) - MF_THROW(mf_dbfailure, + MF_THROW(mfe_dbfailure, _("mu_dbm_open(%s) failed: %s"), @@ -137,3 +137,3 @@ MF_DEFUN(dbdel, VOID, STRING dbname, STRING keystr, OPTIONAL, NUMBER null) MF_ASSERT(rc == 0, - mf_dbfailure, + mfe_dbfailure, _("Failed to delete data `%s' from `%s': %s"), @@ -194,3 +194,3 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval) &readonly); - MF_ASSERT(rc == 0, mf_dbfailure, _("mu_dbm_open(%s) failed: %s"), + MF_ASSERT(rc == 0, mfe_dbfailure, _("mu_dbm_open(%s) failed: %s"), greylist_format->dbname, mu_dbm_strerror()); @@ -207,3 +207,3 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval) MF_ASSERT(MU_DATUM_SIZE(contents) == sizeof timestamp, - mf_dbfailure, + mfe_dbfailure, _("Greylist database %s has wrong data size"), @@ -281,3 +281,3 @@ MF_DEFUN(db_name, STRING, STRING fmtid) MF_ASSERT(fmt != NULL, - mf_not_found, + mfe_not_found, _("No such db format: %s"), fmtid); @@ -291,3 +291,3 @@ MF_DEFUN(db_get_active, NUMBER, STRING fmtid) MF_ASSERT(fmt != NULL, - mf_not_found, + mfe_not_found, _("No such db format: %s"), fmtid); @@ -301,3 +301,3 @@ MF_DEFUN(db_set_active, VOID, STRING fmtid, NUMBER active) MF_ASSERT(fmt != NULL, - mf_not_found, + mfe_not_found, _("No such db format: %s"), fmtid); @@ -311,3 +311,3 @@ MF_DEFUN(db_expire_interval, NUMBER, STRING fmtid) MF_ASSERT(fmt != NULL, - mf_not_found, + mfe_not_found, _("No such db format: %s"), fmtid); diff --git a/src/bi_dns.m4 b/src/bi_dns.m4 index 7e92c964..ad09ee1b 100644 --- a/src/bi_dns.m4 +++ b/src/bi_dns.m4 @@ -1,3 +1,3 @@ /* This file is part of mailfromd. -*- c -*- - Copyright (C) 2006, 2007 Sergey Poznyakoff + Copyright (C) 2006, 2007, 2008 Sergey Poznyakoff @@ -28,3 +28,3 @@ MF_DEFUN(primitive_hostname, STRING, STRING string) MF_ASSERT(stat == mf_success, - stat, + mf_status_to_exception(stat), _("Cannot resolve IP %s"), @@ -45,3 +45,3 @@ MF_DEFUN(primitive_resolve, STRING, STRING string, OPTIONAL, STRING domain) MF_ASSERT(stat == mf_success, - stat, + mf_status_to_exception(stat), _("Cannot resolve %s.%s"), string, domain); @@ -50,3 +50,3 @@ MF_DEFUN(primitive_resolve, STRING, STRING string, OPTIONAL, STRING domain) MF_ASSERT(stat == mf_success, - stat, + mf_status_to_exception(stat), _("Cannot resolve %s"), string); @@ -119,3 +119,3 @@ MF_DEFUN(dns_getname, STRING, STRING ipstr) MF_ASSERT(inet_aton(ipstr, &addr), - mf_invip, + mfe_invip, _("Invalid IP: %s"), ipstr); @@ -162,3 +162,3 @@ MF_DEFUN(primitive_hasmx, NUMBER, STRING string) MF_ASSERT(mxstat == mf_success || mxstat == mf_not_found, - mxstat, + mf_status_to_exception(mxstat), _("Cannot get MX records for %s"), @@ -184,3 +184,3 @@ MF_DEFUN(getmx, STRING, STRING domain, OPTIONAL, NUMBER resolve) MF_ASSERT(mxstat == mf_success || mxstat == mf_not_found, - mxstat, + mf_status_to_exception(mxstat), _("Cannot get MX records for %s"), domain); @@ -222,5 +222,5 @@ resolve_host(const char *string, unsigned long *ip) if (rc == 0) { - mu_error(_("INTERNAL ERROR at %s:%lu: resolve_hostname returned " + mu_error(_("INTERNAL ERROR at %s:%d: resolve_hostname returned " "invalid IP address: %s"), - __FILE__, __FILE__, ipstr); + __FILE__, __LINE__, ipstr); return 1; @@ -239,3 +239,3 @@ MF_DEFUN(primitive_ismx, NUMBER, STRING domain, STRING ipstr) - MF_ASSERT(resolve_host(ipstr, &ip) == 0, mf_noresolve, + MF_ASSERT(resolve_host(ipstr, &ip) == 0, mfe_noresolve, _("Cannot resolve host name %s"), ipstr); @@ -245,3 +245,3 @@ MF_DEFUN(primitive_ismx, NUMBER, STRING domain, STRING ipstr) MF_ASSERT(mxstat == mf_success, - mxstat, + mf_status_to_exception(mxstat), _("Cannot get MXs for %s"), domain); diff --git a/src/bi_gettext.m4 b/src/bi_gettext.m4 index aeb008cb..f97b2387 100644 --- a/src/bi_gettext.m4 +++ b/src/bi_gettext.m4 @@ -1,3 +1,3 @@ /* This file is part of mailfromd. -*- c -*- - Copyright (C) 2007 Sergey Poznyakoff + Copyright (C) 2007, 2008 Sergey Poznyakoff @@ -20,3 +20,3 @@ MF_DEFUN(bindtextdomain, STRING, STRING domain, STRING dirname) MF_ASSERT(s != NULL, - mf_failure, + mfe_failure, "bindtextdomain failed: %s", mu_strerror(errno)); diff --git a/src/bi_io.m4 b/src/bi_io.m4 index 17303a92..40810a08 100644 --- a/src/bi_io.m4 +++ b/src/bi_io.m4 @@ -1,3 +1,3 @@ /* This file is part of mailfromd. -*- c -*- - Copyright (C) 2006, 2007 Sergey Poznyakoff + Copyright (C) 2006, 2007, 2008 Sergey Poznyakoff @@ -228,3 +228,3 @@ MF_DEFUN(open, NUMBER, STRING name) MF_ASSERT(i < NSTREAMS, - mf_failure, + mfe_failure, _("No more files available")); @@ -258,3 +258,3 @@ MF_DEFUN(open, NUMBER, STRING name) MF_ASSERT(rc == 0, - mf_failure, + mfe_failure, _("Cannot open stream %s: %s"), name, @@ -271,3 +271,3 @@ MF_DEFUN(close, VOID, NUMBER fd) MF_ASSERT(fd >= 0 && fd < NSTREAMS, - mf_range, + mfe_range, _("Invalid file descriptor")); @@ -284,3 +284,3 @@ MF_DEFUN(write, VOID, NUMBER fd, STRING str, OPTIONAL, NUMBER n) MF_ASSERT(fd >= 0 && fd < NSTREAMS && OFD(iotab[fd]), - mf_range, + mfe_range, _("Invalid file descriptor")); @@ -288,3 +288,3 @@ MF_DEFUN(write, VOID, NUMBER fd, STRING str, OPTIONAL, NUMBER n) MF_ASSERT(n == rc, - mf_ioerr, + mfe_io, _("Write error on %s: %s"), @@ -300,3 +300,3 @@ MF_DEFUN(getline, STRING, NUMBER fd) MF_ASSERT(fd >= 0 && fd < NSTREAMS && IFD(iotab[fd]), - mf_range, + mfe_range, _("Invalid file descriptor")); @@ -304,3 +304,3 @@ MF_DEFUN(getline, STRING, NUMBER fd) MF_ASSERT(rc == 0, - mf_ioerr, + mfe_io, _("Read error on %s: %s"), diff --git a/src/bi_ipaddr.m4 b/src/bi_ipaddr.m4 index 44b5b104..8a34a254 100644 --- a/src/bi_ipaddr.m4 +++ b/src/bi_ipaddr.m4 @@ -1,3 +1,3 @@ /* This file is part of mailfromd. -*- c -*- - Copyright (C) 2007 Sergey Poznyakoff + Copyright (C) 2007, 2008 Sergey Poznyakoff @@ -53,3 +53,3 @@ MF_DEFUN(inet_aton, NUMBER, STRING s) MF_ASSERT(inet_aton(s, &addr), - mf_invip, + mfe_invip, _("Invalid IP address (%s)"), @@ -74,3 +74,3 @@ MF_DEFUN(len_to_netmask, NUMBER, NUMBER x) - MF_ASSERT(n <= 32, mf_range, + MF_ASSERT(n <= 32, mfe_range, _("Invalid netmask: %lu"), n); diff --git a/src/bi_mail.m4 b/src/bi_mail.m4 index 8b106d8e..01fc37b5 100644 --- a/src/bi_mail.m4 +++ b/src/bi_mail.m4 @@ -1,3 +1,3 @@ /* This file is part of mailfromd. -*- c -*- - Copyright (C) 2006, 2007 Sergey Poznyakoff + Copyright (C) 2006, 2007, 2008 Sergey Poznyakoff @@ -31,3 +31,3 @@ _send(eval_environ_t env, destroy(ptr); - MF_THROW(mf_failure, + MF_THROW(mfe_failure, _("Cannot create mailer `%s': %s"), @@ -39,3 +39,3 @@ _send(eval_environ_t env, mu_mailer_destroy(&mailer); - MF_THROW(mf_failure, + MF_THROW(mfe_failure, _("Bad recipient address `%s': %s"), @@ -51,3 +51,3 @@ _send(eval_environ_t env, destroy(ptr); - MF_THROW(mf_failure, + MF_THROW(mfe_failure, _("Bad sender address `%s': %s"), @@ -63,3 +63,3 @@ _send(eval_environ_t env, destroy(ptr); - MF_THROW(mf_failure, + MF_THROW(mfe_failure, _("Opening mailer `%s' failed: %s"), @@ -73,3 +73,3 @@ _send(eval_environ_t env, destroy(ptr); - MF_ASSERT(status == 0, mf_failure, + MF_ASSERT(status == 0, mfe_failure, _("Cannot send message: %s"), @@ -301,3 +301,3 @@ MF_DEFUN(send_dsn, VOID, STRING to, MF_ASSERT(status == 0, - mf_failure, + mfe_failure, _("Cannot create DSN: %s"), diff --git a/src/bi_other.m4 b/src/bi_other.m4 index d9a51db8..68facb02 100644 --- a/src/bi_other.m4 +++ b/src/bi_other.m4 @@ -1,3 +1,3 @@ /* This file is part of mailfromd. -*- c -*- - Copyright (C) 2006, 2007 Sergey Poznyakoff + Copyright (C) 2006, 2007, 2008 Sergey Poznyakoff @@ -35,3 +35,3 @@ valid_user_p(eval_environ_t env, const char *name) case EAGAIN: - MF_THROW(mf_temp_failure, + MF_THROW(mfe_temp_failure, _("Temporary failure querying for username %s"), @@ -41,3 +41,3 @@ valid_user_p(eval_environ_t env, const char *name) default: - MF_THROW(mf_failure, + MF_THROW(mfe_failure, _("Failure querying for username %s"), @@ -68,3 +68,3 @@ MF_DEFUN(interval, NUMBER, STRING str) MF_ASSERT(parse_time_interval(str, &t, &endp) == 0, - mf_invtime, + mfe_invtime, _("Unrecognized time format (near `%s')"), endp); @@ -80,3 +80,3 @@ MF_DEFUN(rate, NUMBER, STRING key, NUMBER interval, OPTIONAL, NUMBER mincnt) MF_ASSERT(get_rate(key, &rate, MF_OPTVAL(mincnt)) == mf_success, - mf_dbfailure, + mfe_dbfailure, _("Cannot get rate for %s"), key); @@ -92,3 +92,3 @@ MF_DEFUN(debug_level, NUMBER, OPTIONAL, STRING modname) MF_ASSERT(debug_module_level(MF_OPTVAL(modname, NULL), &level) == 0, - mf_range, + mfe_range, _("Invalid module name: %s"), modname); @@ -106,3 +106,3 @@ MF_DEFUN(debug_spec, STRING, OPTIONAL, STRING modnames) MF_ASSERT(rc == 0, - mf_failure, + mfe_failure, "%s", mu_strerror(rc)); diff --git a/src/bi_poll.m4 b/src/bi_poll.m4 index 979ffd8a..8f0f4e3d 100644 --- a/src/bi_poll.m4 +++ b/src/bi_poll.m4 @@ -1,3 +1,3 @@ /* This file is part of mailfromd. -*- c -*- - Copyright (C) 2006, 2007 Sergey Poznyakoff + Copyright (C) 2006, 2007, 2008 Sergey Poznyakoff @@ -48,4 +48,4 @@ MF_DEFUN(stdpoll, NUMBER, STRING email, STRING ehlo, STRING mailfrom) rc = method_standard(env, email, ehlo, mailfrom); - MF_ASSERT(mf_resolved(rc), rc, - _("Unhandled exception %s"), mf_status_str(rc)); + MF_ASSERT(mf_resolved(rc), mf_status_to_exception(rc), + _("Unhandled exception %s"), mf_exception_str(rc)); @@ -68,4 +68,4 @@ MF_DEFUN(strictpoll, NUMBER, STRING host, STRING email, STRING ehlo, rc = method_strict(env, email, host, ehlo, mailfrom); - MF_ASSERT(mf_resolved(rc), rc, - _("Unhandled exception %s"), mf_status_str(rc)); + MF_ASSERT(mf_resolved(rc), mf_status_to_exception(rc), + _("Unhandled exception %s"), mf_exception_str(rc)); @@ -89,4 +89,4 @@ MF_DEFUN(_pollhost, NUMBER, STRING host, STRING email, STRING ehlo, - MF_ASSERT(mf_resolved(rc), rc, - _("Unhandled exception %s"), mf_status_str(rc)); + MF_ASSERT(mf_resolved(rc), mf_status_to_exception(rc), + _("Unhandled exception %s"), mf_exception_str(rc)); @@ -109,4 +109,4 @@ MF_DEFUN(_pollmx, NUMBER, STRING domain, STRING email, STRING ehlo, - MF_ASSERT(mf_resolved(rc), rc, - _("Unhandled exception %s"), mf_status_str(rc)); + MF_ASSERT(mf_resolved(rc), mf_status_to_exception(rc), + _("Unhandled exception %s"), mf_exception_str(rc)); diff --git a/src/bi_sa.m4 b/src/bi_sa.m4 index 3bd5cad1..af769821 100644 --- a/src/bi_sa.m4 +++ b/src/bi_sa.m4 @@ -1,3 +1,3 @@ /* This file is part of mailfromd. -*- c -*- - Copyright (C) 2006, 2007 Sergey Poznyakoff + Copyright (C) 2006, 2007, 2008 Sergey Poznyakoff @@ -37,3 +37,3 @@ spamd_connect_tcp(eval_environ_t env, mu_stream_t *stream, int rc = mu_tcp_stream_create(stream, host, port, 0); - MF_ASSERT(rc == 0, mf_failure, + MF_ASSERT(rc == 0, mfe_failure, "mu_tcp_stream_create: %s", @@ -41,3 +41,3 @@ spamd_connect_tcp(eval_environ_t env, mu_stream_t *stream, rc = mu_stream_open(*stream); - MF_ASSERT(rc == 0, mf_failure, + MF_ASSERT(rc == 0, mfe_failure, "mu_stream_open: %s", @@ -55,3 +55,3 @@ spamd_connect_socket(eval_environ_t env, mu_stream_t *stream, char *path) fd = socket(PF_UNIX, SOCK_STREAM, 0); - MF_ASSERT(fd >= 0, mf_failure, + MF_ASSERT(fd >= 0, mfe_failure, "socket: %s", mu_strerror(errno)); @@ -64,3 +64,3 @@ spamd_connect_socket(eval_environ_t env, mu_stream_t *stream, char *path) close(fd); - MF_THROW(mf_failure, "connect: %s", mu_strerror(errno)); + MF_THROW(mfe_failure, "connect: %s", mu_strerror(errno)); } @@ -71,3 +71,3 @@ spamd_connect_socket(eval_environ_t env, mu_stream_t *stream, char *path) fclose(fp); - MF_THROW(mf_failure, + MF_THROW(mfe_failure, "mu_stdio_stream_create: %s", @@ -80,3 +80,3 @@ spamd_connect_socket(eval_environ_t env, mu_stream_t *stream, char *path) fclose(fp); - MF_THROW(mf_failure, + MF_THROW(mfe_failure, "mu_stream_open: %s", @@ -245,3 +245,3 @@ open_connection(eval_environ_t env, char *urlstr, int *isfile, char **phost) if (rc) - MF_THROW(mf_failure, + MF_THROW(mfe_failure, _("Cannot create URL from `%s': %s"), @@ -251,3 +251,3 @@ open_connection(eval_environ_t env, char *urlstr, int *isfile, char **phost) mu_url_destroy(&url); - MF_THROW(mf_url, + MF_THROW(mfe_url, _("%s: error parsing URL: %s"), @@ -258,3 +258,3 @@ open_connection(eval_environ_t env, char *urlstr, int *isfile, char **phost) mu_url_destroy(&url); - MF_THROW(mf_url, + MF_THROW(mfe_url, _("%s: cannot get scheme: %s"), @@ -267,3 +267,3 @@ open_connection(eval_environ_t env, char *urlstr, int *isfile, char **phost) if (rc = mu_url_get_path(url, NULL, 0, &size)) { - MF_THROW(mf_url, + MF_THROW(mfe_url, _("%s: cannot get path: %s"), @@ -283,3 +283,3 @@ open_connection(eval_environ_t env, char *urlstr, int *isfile, char **phost) mu_url_destroy(&url); - MF_THROW(mf_url, + MF_THROW(mfe_url, _("%s: cannot get port: %s"), @@ -290,3 +290,3 @@ open_connection(eval_environ_t env, char *urlstr, int *isfile, char **phost) mu_url_destroy(&url); - MF_THROW(mf_range, + MF_THROW(mfe_range, _("Port out of range: %ld"), @@ -297,3 +297,3 @@ open_connection(eval_environ_t env, char *urlstr, int *isfile, char **phost) mu_url_destroy(&url); - MF_THROW(mf_url, + MF_THROW(mfe_url, _("%s: cannot get host: %s"), @@ -308,3 +308,3 @@ open_connection(eval_environ_t env, char *urlstr, int *isfile, char **phost) } else - MF_THROW(mf_url, + MF_THROW(mfe_url, _("Invalid URL: %s"), buffer); @@ -368,3 +368,3 @@ MF_DEFUN(sa, NUMBER, STRING urlstr, NUMBER prec) spamd_destroy(&ostr); - MF_THROW(mf_failure, _("Remote side has closed connection")); + MF_THROW(mfe_failure, _("Remote side has closed connection")); } @@ -373,3 +373,3 @@ MF_DEFUN(sa, NUMBER, STRING urlstr, NUMBER prec) spamd_destroy(&ostr); - MF_THROW(mf_failure, + MF_THROW(mfe_failure, _("spamd responded with bad string '%s'"), @@ -381,3 +381,3 @@ MF_DEFUN(sa, NUMBER, STRING urlstr, NUMBER prec) spamd_destroy(&ostr); - MF_THROW(mf_failure, + MF_THROW(mfe_failure, _("Unsupported SPAMD version: %s"), @@ -390,3 +390,3 @@ MF_DEFUN(sa, NUMBER, STRING urlstr, NUMBER prec) spamd_destroy(&ostr); - MF_THROW(mf_failure, + MF_THROW(mfe_failure, _("spamd responded with bad Spam header '%s'"), @@ -437,3 +437,3 @@ MF_DEFUN(clamav, NUMBER, STRING urlstr) spamd_destroy(&cstr); - MF_THROW(mf_failure, + MF_THROW(mfe_failure, _("Bad response from clamav: expected `PORT' but found `%s'"), @@ -449,3 +449,3 @@ MF_DEFUN(clamav, NUMBER, STRING urlstr) spamd_destroy(&cstr); - MF_THROW(mf_failure, + MF_THROW(mfe_failure, "mu_tcp |