newsmailfromd -- a general-purpose milter - News: Version 3.1 available

 
 
Show feedback again
Latest News
Mailfromd Version 9.0 posted by gray, Mon Jan 8 21:05:21 2024 - 0 replies
Version 8.17.1 posted by gray, Thu Jul 20 09:46:22 2023 - 0 replies
Version 8.17 posted by gray, Fri Jul 7 11:04:32 2023 - 0 replies
Version 8.16 posted by gray, Mon May 1 12:58:15 2023 - 0 replies
Version 8.15 posted by gray, Sun Dec 11 09:36:34 2022 - 0 replies
[Submit News]
[53 news in archive]

Version 3.1 available

Item posted by Sergey Poznyakoff <gray> on Thu Dec 7 12:55:35 2006.

Version 3.1 is available for download.

Changes in this version:

  • Incompatible changes.

For detailed instructions on how to upgrade from version 3.0, please see http://mailfromd.software.gnu.org.ua/upgrade.html

1. The package refuses to compile without DBM

2. The command line option --config-file (-c) is no longer supported. To use an alternative filter script, give its name as an argument in the command line, e.g.

mailfromd my-script.rc

For backward compatibility, the invocation `mailfromd --config-file my-script.rc' still works but produces a warning message.

The semantics of `-c' will change in the next release.

3. The function `dbmap' takes an optional third argument. If it is 1, then the length of the lookup key will include the terminating null character.

In previous versions dbmap always counted the terminating null character in the key length. So, you should add the non-zero third argument to the calls to dbmap to preserve their functionality.

4. Variables, implicitly declared within a function, are automatic. Previous versions created them as global.

  • Language changes
    • Hex and octal constants

Usual C notation (0xNNN for hex and 0NNN for octal) is accepted.

    • Bitwise operators: &, |, ^ (logical and, or, xor) and ~ (twos-complement)
    • Search path for include files

The `#include' statement handles its argument the same way C preprocessor does: the argument is searched in the include file path, if enclosed in angle brackets (<>), and in the current working directory first and then in the include file path, if it is enclosed in double quotes. The default include file path is

/usr/share/mailfromd/include:/usr/local/share/mailfromd/include

plus $prefix/share/mailfromd/include if $prefix is not `/usr' or
`/usr/local'.

The command line option -I (--include) adds the named directory in front of the default include path.

    • Code optimization

Parse tree is optimized before code generation. This can be controlled using -Olevel option, where `level' is the optimization level. Currently implemented levels are 0 (no optimization) and 1 (full optimization), which is the default.

    • All variables are now strongly typed.

The declaration of the variable has the form: `TYPE NAME', where TYPE is one of `string' or `number', and NAME is the variable name. For compatibility with the previous versions, the declaration is optional. If it is absent, the first assignment to the variable defines its type. Subsequent assignments will implicitly cast the value being assigned to the type of the variable.

    • New style of function declarations. Named parameters.

Functions should be defined as:

func NAME (PARAM-LIST) returns TYPE

where TYPE is as described in the previous paragraph and PARAM-LIST is a comma-separated list of parameter declarations in the form TYPE NAME. Consequently, instead of the positional notation, parameters can be referenced by their names:

func sum(number a, number b) returns number
do
return %a + %b
done

Within the function body, the named parameters can be handled the same way as other variables, in particular they can be assigned new values using `set' instruction.

For compatibility with the previous version, old type of function declarations is supported as well.

    • Automatic variables

Automatic variables are defined within a function or handler. Their scope of visibility ends with the terminating `done' statement. Automatic variables are declared and referenced the same way as global ones. To declare an automatic variable, use `TYPE NAME' notation. Variable declarations can be intermixed with executable statements.

The following example defines two automatic variables for the function `foo':

func foo()
do
number a
string s
...

If a variable is declared implicitly within a function or handler, it is declared automatic.

See the documentation for the detailed description and examples.

    • New functions:
      • I/O functions: open, close, write, getline

See http://mailfromd.software.gnu.org.ua/manual/bi/io.html

      • Time functions: time, strftime

See http://mailfromd.software.gnu.org.ua/manual/bi/system.html

      • System functions: system

See http://mailfromd.software.gnu.org.ua/manual/bi/system.html

      • DBM functions: dbput, dbdel

See http://mailfromd.software.gnu.org.ua/manual/bi/db.html

      • String functions: substr, index, rindex

See http://mailfromd.software.gnu.org.ua/manual/bi/string.html

      • Debugging functions: debug, cancel_debug, program_trace,

cancel_program_trace
See http://mailfromd.software.gnu.org.ua/manual/bi/debug.html

      • Mail sending functions: send_mail, send_text, send_dsn

See http://mailfromd.software.gnu.org.ua/manual/bi/mail.html

    • The legacy function numrcpt() has been withdrawn

Use %rcpt_count instead.

    • Built-in macros

Built-in macros have names beginning and ending with double underscore. As their name implies, the macros are expanded to constant values. The following built-in macros are defined:

1. _file_ expands to the name of the current source file.
2. _line_ expands to the number of line in the current source file.
3. _function_ expands to the name of the current lexical context, i.e. the function or handler name.
4. _package_ expands to the string containing package name ("mailfromd")
5. _version_ expands to the textual representation of the program version (e.g. "3.0.90")
6. _major_ expands to the major version number
7. _minor_ expands to the minor version number
8. _patch_ expands to the version patch level, or 0 if it is not defined.

Built-in macros can be used in variable context. For example, to use them within a string or here-document, prepend them with % as if they were regular variables, e.g.:

echo "%__file__:%__line__: Checkpoint"

  • The envfrom and envrcpt handlers print entire argument array in the debugging output.
  • New DNS caching scheme.

All DNS lookups are cached on global basis, as opposed to the per-session basis in previous versions. The cache is stored in the DBM database `dns'. It can be listed and otherwise operated upon using usual mailfromd commands.

If a lookup gives a positive result, the TTL from the DNS record is used as the record expiration interval. For negative lookups, the default interval of 3600 seconds is used. It can be altered by the following pragmatic comment:

#pragma database dns negative-expire-interval N

  • New command line option --xref

Produces a cross-reference listing of global variables.

  • Fuller SMTP timeout control

In order to more fully control SMTP transactions, new timeout value is introduced: initial-response-timeout. This is the maximum time to wait for the remote to issue the initial SMTP response. This value is especially useful for dealing with the servers that impose a delay before the initial reply (most notably "CommuniGate Pro" ones"). The default value is 30 seconds which should be enough for most normal servers. See the documentation, node "SMTP Timeouts" for the detailed discussion.

  • No more `retry' options.

The `retry' options and pragmas have been removed. The new timeout control scheme warrants that the polling will take at most the given interval of time. In particular, that affects:

    • Command line option `--retry'
    • Pragma options io-retry and connect-retry
  • Bugfixes
    • Switch statements without the default branch produced incorrect code (the very first branch was used as the default one). This is fixed.
    • Fix handling of escape sequences at the beginning of a string and before the beginning of an interpreted sequence within the string.
    • Fix the declarations of the built-in functions `toupper' and `tolower'.
    • Fix storing the macro values obtained from Sendmail
    • Collect zombie subprocesses as soon as possible
    • Fix arithmetical expression syntax in rc.mailfromd
    • Fix multiple from address handling
    • Fix race condition when using GDBM

Comments:

No messages in Version 3.1 available

 

Show feedback again

Back to the top


Powered by Savane 3.1-cleanup+gray