Mailfromd |
|
General-Purpose Mail Filter |
Sergey Poznyakoff |
Mailfromd Manual (split by node): | ? |
mailfromd
. The idea of the utility appeared in 2005, and its first version
appeared soon afterward. Back then it was a simple implementation of
Sender Address Verification (see section Sender Address Verification.) for ‘Sendmail’ (hence
its name – mailfromd
) with rudimentary tuning
possibilities.
After a short run on my mail servers, I discovered that the utility was not flexible enough. It took less than a month to implement a configuration file that allowed to control program and data flow during the ‘envfrom’ SMTP state. The new version, 1.0, appeared in June, 2005.
The next major release, 1.2 (1.1 contained mostly bugfixes), appeared two months later, which introduced mail sending rate control (see section Controlling Mail Sending Rate.).
The program evolved during the next year, which led to the
release of version 2.0 in September, 2006. This version was a major
change in the main idea of the program. Configuration file become a
flexible filter script allowing to control almost all SMTP
states. The program supplied in the script file
was compiled into a pseudo-code at startup, this code being subsequently
evaluated each time the filter was invoked. This caused a considerable
speed-up in comparison with the previous versions, where the run-time
evaluator was traversing the parse tree. This version also introduced
(implicitly, at the time), two separate data types for the entities
declared in the script, which also played its role in the speed
improvement (in the previous versions all data were considered
strings). Lots of improvements were made in the filter language
(MFL, see section Mail Filtering Language) itself, such as user-defined functions,
switch
statement, catch
statement that allows to handle
run-time errors, etc. The set of built-in functions extended
considerably. A testsuite (using DejaGNU) was introduced in this version.
During this initial development period the limitations
imposed by libmilter
implementation became obvious. Finally,
I felt they were stopping further development, and decided
that mailfromd
should use its own ‘Milter’
implementation. This new library, libgacopyz
was the main
new feature of the 3.0 release, that was released in November, 2006.
Another major feature was the ‘--dump-macros’ option and
‘macros’ to rc.mailfromd
script, that were intended
to facilitate the configuration on ‘Sendmail’ side.
The development of 3.x (more properly, 3.1.x) series concentrated mainly on bug-fixes, while the main development was done on the next branch.
The version 4.0 appeared on May 12, 2007. The full
list of changes in this release is more than 500 lines long, so it is
impractical to list them here. In particular, this version introduced
lots of new features in MFL syntax and the
library of useful MFL functions. The runtime engine was
also improved, in particular, stack space become expandable which
eliminated many run-time errors. This version also introduced the
beginnings of the MFL module system. The code generation
was re-implemented to facilitate the introduction of object files in
future versions. Another new features in this release include
SPF support and mtasim
utility, an MTA
simulator designed for testing mailfromd
scripts
(see section mtasim
— a testing tool). The test suite in this version was made portable by
rewriting it in Autotest.
Another big leap forward was the 5.0 release, which appeared on December 26, 2008. It largely enriched a set of available functions (61 new functions were introduced, which amounts to 41% of all the available functions in 5.0 release) and introduced several improvements in the MFL itself. Among others, function aliases and optional arguments in user-defined functions were introduced in this release. The new “run operation mode” allowed to execute arbitrary MFL functions from the command line. This release also raised the Mailutils version requirements to at least 2.0.
Version 6.0 introduces a full-fledged modular system, akin to that of Python, and quite a few improvements to the language. such as explicit type casts, concatenation operator, static variables, etc.
Mailfromd Manual (split by node): | ? |
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.