diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-03-10 13:43:22 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-03-10 13:43:22 +0000 |
commit | 18ebe7bb829772d7bf1df49d23a2c9dd53a2afcd (patch) | |
tree | 51b017fdad8d712f2aa4f7a5d505032acc2e9185 | |
parent | 9fe06f87591f813fce7f9068f19246c8d933fc6a (diff) | |
download | mailfromd-18ebe7bb829772d7bf1df49d23a2c9dd53a2afcd.tar.gz mailfromd-18ebe7bb829772d7bf1df49d23a2c9dd53a2afcd.tar.bz2 |
* src/mailfromd.h (enum mf_status_code): Add a comma and a count
definition, needed for make check-exceptions in docs.
* src/status.mfi (m4_ifdef): Use OLD_EXCEPTION_CODES instead of
COMPAT_4_3.
* src/main.c: New command line options: -D (--define), and -U
(--undefine).
* mflib/match_dnsbl.mf (match_dnsbl): Use LAZY_MATCH_RBL instead of
COMPAT_4_3.
Throw e_invip if address is invalid.
* mflib/match_rhsbl.mf (match_rhsbl): Use LAZY_MATCH_RBL instead
of COMPAT_4_3.
* doc/mailfromd.texi: Document variable shadowing and new
features.
* doc/Makefile.am (check-exceptions): Update the rule.
* NEWS: Update.
git-svn-id: file:///svnroot/mailfromd/branches/release_4_3_patches@1630 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r-- | ChangeLog | 22 | ||||
-rw-r--r-- | NEWS | 62 | ||||
-rw-r--r-- | doc/Makefile.am | 2 | ||||
-rw-r--r-- | doc/mailfromd.texi | 402 | ||||
-rw-r--r-- | mflib/match_dnsbl.mf | 4 | ||||
-rw-r--r-- | mflib/match_rhsbl.mf | 2 | ||||
-rw-r--r-- | src/mailfromd.h | 4 | ||||
-rw-r--r-- | src/main.c | 65 | ||||
-rw-r--r-- | src/status.mfi | 2 |
9 files changed, 534 insertions, 31 deletions
@@ -1,3 +1,21 @@ | |||
1 | 2008-03-10 Sergey Poznyakoff <gray@gnu.org.ua> | ||
2 | |||
3 | * src/mailfromd.h (enum mf_status_code): Add a comma and a count | ||
4 | definition, needed for make check-exceptions in docs. | ||
5 | * src/status.mfi (m4_ifdef): Use OLD_EXCEPTION_CODES instead of | ||
6 | COMPAT_4_3. | ||
7 | * src/main.c: New command line options: -D (--define), and -U | ||
8 | (--undefine). | ||
9 | * mflib/match_dnsbl.mf (match_dnsbl): Use LAZY_MATCH_RBL instead of | ||
10 | COMPAT_4_3. | ||
11 | Throw e_invip if address is invalid. | ||
12 | * mflib/match_rhsbl.mf (match_rhsbl): Use LAZY_MATCH_RBL instead | ||
13 | of COMPAT_4_3. | ||
14 | * doc/mailfromd.texi: Document variable shadowing and new | ||
15 | features. | ||
16 | * doc/Makefile.am (check-exceptions): Update the rule. | ||
17 | * NEWS: Update. | ||
18 | |||
1 | 2008-03-09 Sergey Poznyakoff <gray@gnu.org.ua> | 19 | 2008-03-09 Sergey Poznyakoff <gray@gnu.org.ua> |
2 | 20 | ||
3 | Fix the test suite. The file status.mfh now contains m4 statements, | 21 | Fix the test suite. The file status.mfh now contains m4 statements, |
@@ -69,6 +87,10 @@ | |||
69 | tests/etc/catch01.rc: Use new exception codes. | 87 | tests/etc/catch01.rc: Use new exception codes. |
70 | 88 | ||
71 | 2008-03-01 Sergey Poznyakoff <gray@gnu.org.ua> | 89 | 2008-03-01 Sergey Poznyakoff <gray@gnu.org.ua> |
90 | |||
91 | -= Release 4.3.1 =- | ||
92 | |||
93 | 2008-03-01 Sergey Poznyakoff <gray@gnu.org.ua> | ||
72 | 94 | ||
73 | * src/prog.c, src/prog.h (advance_pc): Fix type of the 2nd | 95 | * src/prog.c, src/prog.h (advance_pc): Fix type of the 2nd |
74 | argument. | 96 | argument. |
@@ -1,4 +1,4 @@ | |||
1 | Mailfromd NEWS -- history of user-visible changes. 2008-03-09 | 1 | Mailfromd NEWS -- history of user-visible changes. 2008-03-10 |
2 | Copyright (C) 2005, 2006, 2007, 2008 Sergey Poznyakoff | 2 | Copyright (C) 2005, 2006, 2007, 2008 Sergey Poznyakoff |
3 | See the end of file for copying conditions. | 3 | See the end of file for copying conditions. |
4 | 4 | ||
@@ -7,6 +7,66 @@ Please send mailfromd bug reports to <bug-mailfromd@gnu.org.ua> | |||
7 | 7 | ||
8 | Version 4.3.90 (SVN) | 8 | Version 4.3.90 (SVN) |
9 | 9 | ||
10 | * The --domain option is withdrawn. | ||
11 | |||
12 | This option was declared as deprecated in version 4.0. Now it is | ||
13 | withdrawn and its short version (-D) is reused for another purpose | ||
14 | (see -D option, below). | ||
15 | |||
16 | * New command line options -D and -U | ||
17 | |||
18 | Both options work like their m4 counterpars: the `-D' command line | ||
19 | option defines a preprocessor symbol, the `-U' option undefines it. | ||
20 | |||
21 | * Constant vs. variable shadowing | ||
22 | |||
23 | In previous versions of mailfromd name clashes between constants and | ||
24 | variables went unnoticed, which sometimes lead to hard-to-diagnose | ||
25 | errors. This bug is fixed in this version. If a constant is defined | ||
26 | which has the same name as a previously defined variable (the constant | ||
27 | "shadows" the variable), the compiler prints the following diagnostic | ||
28 | message: | ||
29 | |||
30 | <file>:<line>: Warning: Constant name `name' clashes with a variable name | ||
31 | <file>:<line>: Warning: This is the location of the previous definition | ||
32 | |||
33 | A similar diagnostics is issued if a variable is defined whose name | ||
34 | coincides with a previously defined constant (the variable "shadows" | ||
35 | the constant). | ||
36 | |||
37 | In any case, the %NAME notation refers to the last defined symbol, be | ||
38 | it variable or constant. | ||
39 | |||
40 | If a variable shadows a constant, the scope of the shadowing depends | ||
41 | on the storage class of the variable. For automatic variables and | ||
42 | function parameters, it ends with the final `done' closing the | ||
43 | function. For global variables, it lasts up to the end of input. | ||
44 | |||
45 | * Exception names. | ||
46 | |||
47 | To minimize chances of name clashes, all symbolic exception codes has | ||
48 | been renamed by prefixing them with the `e_', thus, e.g. `divzero' | ||
49 | became `e_divzero', etc. The `ioerr' exception code is renamed to | ||
50 | `e_io'. | ||
51 | |||
52 | For consistency, the following most often used codes are available without | ||
53 | the `e_' previx: success, not_found, failure, temp_failure. | ||
54 | |||
55 | The use of old exception codes is still possible by defining a | ||
56 | preprocessor symbol OLD_EXCEPTION_CODES, for example: | ||
57 | |||
58 | mailfromd -DOLD_EXCEPTION_CODES | ||
59 | |||
60 | * match_dnsbl and match_rhsbl | ||
61 | |||
62 | Both functions malfunctioned in versions from 4.0 up to 4.3.1 due to a | ||
63 | name clash between the exception code `range' and their third | ||
64 | argument. This is fixed. | ||
65 | |||
66 | Additionally, previous versions of match_dnsbl silently ignored | ||
67 | invalid first argument. Now, the e_invip exception is signalled in | ||
68 | this case. | ||
69 | |||
10 | 70 | ||
11 | Version 4.3.1, 2008-03-01 | 71 | Version 4.3.1, 2008-03-01 |
12 | 72 | ||
diff --git a/doc/Makefile.am b/doc/Makefile.am index 2ac69c35..10cbd2b9 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am | |||
@@ -76,7 +76,7 @@ check-mflib: | |||
76 | 76 | ||
77 | check-exceptions: | 77 | check-exceptions: |
78 | @check-docs.sh exceptions \ | 78 | @check-docs.sh exceptions \ |
79 | '/typedef enum mf_status_code {/,/^};/s/[ \t]*mf_\(.*\),.*/\1/p' \ | 79 | '/typedef enum mf_exception_code {/,/^};/s/[ \t]*mfe_\(.*\),.*/e_\1/p;/typedef enum mf_status_code {/,/^};/s/[ \t]*mf_\(.*\),.*/\1/p' \ |
80 | 's/@cindex \([^,][^,]*\), exception type/\1/p' \ | 80 | 's/@cindex \([^,][^,]*\), exception type/\1/p' \ |
81 | $(top_srcdir)/src/mailfromd.h -- \ | 81 | $(top_srcdir)/src/mailfromd.h -- \ |
82 | $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \ | 82 | $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \ |
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index 27ff4c46..9cf4871e 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi | |||
@@ -184,6 +184,7 @@ Mail Filtering Language | |||
184 | * begin/end:: | 184 | * begin/end:: |
185 | * Functions:: Functions. | 185 | * Functions:: Functions. |
186 | * Expressions:: Expressions. | 186 | * Expressions:: Expressions. |
187 | * Shadowing:: Variable and Constant Shadowing. | ||
187 | * Statements:: | 188 | * Statements:: |
188 | * Conditionals:: Conditional Statements. | 189 | * Conditionals:: Conditional Statements. |
189 | * Loops:: Loop Statements. | 190 | * Loops:: Loop Statements. |
@@ -270,6 +271,7 @@ Command Line Options. | |||
270 | 271 | ||
271 | * Operation Modifiers:: | 272 | * Operation Modifiers:: |
272 | * General Settings:: | 273 | * General Settings:: |
274 | * Preprocessor Options:: | ||
273 | * Timeout Control:: | 275 | * Timeout Control:: |
274 | * Logging and Debugging Options:: | 276 | * Logging and Debugging Options:: |
275 | * Informational Options:: | 277 | * Informational Options:: |
@@ -1001,7 +1003,31 @@ the corresponding section below. | |||
1001 | @node 43x-440 | 1003 | @node 43x-440 |
1002 | @section Upgrading from 4.3.x to 4.4 | 1004 | @section Upgrading from 4.3.x to 4.4 |
1003 | @cindex Upgrading from 4.3.x to 4.4 | 1005 | @cindex Upgrading from 4.3.x to 4.4 |
1004 | @UNREVISED{} | 1006 | |
1007 | The deprecated @option{--domain} command line option has been | ||
1008 | withdrawn. The short option @option{-D} now defines a preprocessor | ||
1009 | symbol (@pxref{Preprocessor Options}). | ||
1010 | |||
1011 | This version correctly handles name clashes between constants and | ||
1012 | variables, which remained unnoticed in previous releases. | ||
1013 | @xref{variable--constant shadowing}, for a detailed description of it. | ||
1014 | |||
1015 | To minimize chances of name clashes, all symbolic exception codes has | ||
1016 | been renamed by prefixing them with the @samp{e_}, thus, e.g. @code{divzero} | ||
1017 | became @code{e_divzero}, etc. The @code{ioerr} exception code is renamed to | ||
1018 | @code{e_io}. @xref{status.mfh}, for a full list of the new exception codes. | ||
1019 | |||
1020 | @cindex @code{OLD_EXCEPTION_CODES}, preprocessor symbol | ||
1021 | For consistency, the following most often used codes are available without | ||
1022 | the @samp{e_} previx: success, not_found, failure, temp_failure. This | ||
1023 | makes most existing user scripts suitable for use with version 4.4 | ||
1024 | without any modification. If your script refers to any exception | ||
1025 | codes other than these four, you can still use it by defining a | ||
1026 | preprocessor symbol @code{OLD_EXCEPTION_CODES}, for example: | ||
1027 | |||
1028 | @smallexample | ||
1029 | $ mailfromd -DOLD_EXCEPTION_CODES | ||
1030 | @end smallexample | ||
1005 | 1031 | ||
1006 | @node 420-43x | 1032 | @node 420-43x |
1007 | @section Upgrading from 4.2 to 4.3.x | 1033 | @section Upgrading from 4.2 to 4.3.x |
@@ -3322,7 +3348,7 @@ done | |||
3322 | @end group | 3348 | @end group |
3323 | @end smallexample | 3349 | @end smallexample |
3324 | 3350 | ||
3325 | The intent was obviously to reject any mail if it comes from an | 3351 | The intent was obviously to reject any mail that came from an |
3326 | address without a proper @code{PTR} record (@pxref{hostname | 3352 | address without a proper @code{PTR} record (@pxref{hostname |
3327 | function}). There is a serious error, however: @code{hostname} is not | 3353 | function}). There is a serious error, however: @code{hostname} is not |
3328 | a built-in function as it used to be in previous releases@footnote{Up to | 3354 | a built-in function as it used to be in previous releases@footnote{Up to |
@@ -3396,6 +3422,54 @@ echo sprintf ('Mail from %s', $f) | |||
3396 | This does not limit the functionality, since there is no need to fall | 3422 | This does not limit the functionality, since there is no need to fall |
3397 | back to variable interpretation in format strings. | 3423 | back to variable interpretation in format strings. |
3398 | 3424 | ||
3425 | @anchor{variable--constant clashes} | ||
3426 | Yet another dangerous feature of the language is the way to refer to | ||
3427 | variable and constant names within literal strings. To expand a | ||
3428 | variable or a constant the same notation is used: %@var{name} | ||
3429 | (@xref{Variables}, and @pxref{Constants}). Now, lets consider the | ||
3430 | following code: | ||
3431 | |||
3432 | @smallexample | <