"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "doc/mailfromd.info-1" between
mailfromd-8.10.tar.xz and mailfromd-8.11.tar.xz

About: Mailfromd is a general-purpose mail filtering daemon for Sendmail, Postfix and MeTA1 (interfaces with the MTA using Milter or PMilter protocols).

mailfromd.info-1  (mailfromd-8.10.tar.xz):mailfromd.info-1  (mailfromd-8.11.tar.xz)
File: mailfromd.info, Node: Top, Next: Preface, Up: (dir) File: mailfromd.info, Node: Top, Next: Preface, Up: (dir)
Mailfromd Mailfromd
********* *********
This edition of the 'Mailfromd Manual', last updated 15 February 2021, This edition of the 'Mailfromd Manual', last updated 15 February 2021,
documents 'mailfromd' Version 8.10. documents 'mailfromd' Version 8.11.
* Menu: * Menu:
* Preface:: Short description of this manual; brief * Preface:: Short description of this manual; brief
history and acknowledgments. history and acknowledgments.
* Intro:: Introduction to Mailfromd. * Intro:: Introduction to Mailfromd.
* Building:: Building the Package. * Building:: Building the Package.
* Tutorial:: Mailfromd Tutorial. * Tutorial:: Mailfromd Tutorial.
* MFL:: The Mail Filtering Language. * MFL:: The Mail Filtering Language.
* Library:: The MFL Library Functions. * Library:: The MFL Library Functions.
skipping to change at line 597 skipping to change at line 597
This manual is written using Texinfo, the GNU documentation formatting This manual is written using Texinfo, the GNU documentation formatting
language. The same set of Texinfo source files is used to produce both language. The same set of Texinfo source files is used to produce both
the printed and online versions of the documentation. This section the printed and online versions of the documentation. This section
briefly documents the typographical conventions used in this manual. briefly documents the typographical conventions used in this manual.
Examples you would type at the command line are preceded by the Examples you would type at the command line are preceded by the
common shell primary prompt, '$'. The command itself is printed 'in common shell primary prompt, '$'. The command itself is printed 'in
this font', and the output it produces 'in this font', for example: this font', and the output it produces 'in this font', for example:
$ mailfromd --version $ mailfromd --version
mailfromd (mailfromd 8.10) mailfromd (mailfromd 8.11)
In the text, the command names are printed 'like this', command line In the text, the command names are printed 'like this', command line
options are displayed in 'this font'. Some notions are emphasized _like options are displayed in 'this font'. Some notions are emphasized _like
this_, and if a point needs to be made strongly, it is done *this way*. this_, and if a point needs to be made strongly, it is done *this way*.
The first occurrence of a new term is usually its "definition" and The first occurrence of a new term is usually its "definition" and
appears in the same font as the previous occurrence of "definition" in appears in the same font as the previous occurrence of "definition" in
this sentence. File names are indicated like this: '/path/to/ourfile'. this sentence. File names are indicated like this: '/path/to/ourfile'.
The variable names are represented LIKE THIS, keywords and fragments The variable names are represented LIKE THIS, keywords and fragments
of program text are written in 'this font'. of program text are written in 'this font'.
skipping to change at line 823 skipping to change at line 823
B. GNU adns library, version 1.5.1 or newer. B. GNU adns library, version 1.5.1 or newer.
GNU adns is an advanced DNS client library. The recent GNU adns is an advanced DNS client library. The recent
version can be downloaded from version can be downloaded from
<http://www.chiark.greenend.org.uk/~ian/adns/adns.tar.gz>. <http://www.chiark.greenend.org.uk/~ian/adns/adns.tar.gz>.
Visit <http://www.gnu.org/software/adns>, for more Visit <http://www.gnu.org/software/adns>, for more
information. information.
C. A DBM library. 'Mailfromd' is able to link with any flavor of C. A DBM library. 'Mailfromd' is able to link with any flavor of
DBM supported by GNU mailutils. As of version 8.10 it will DBM supported by GNU mailutils. As of version 8.11 it will
refuse to build without DBM. By default, 'configure' will try refuse to build without DBM. By default, 'configure' will try
to find the best implementation installed on your machine to find the best implementation installed on your machine
(preference is given to Berkeley DB) and will use it. You (preference is given to Berkeley DB) and will use it. You
can, however, explicitly specify which implementation you want can, however, explicitly specify which implementation you want
to use. To do so, use the '--with-dbm' configure option. Its to use. To do so, use the '--with-dbm' configure option. Its
argument specifies the "type" of database to use. It must be argument specifies the "type" of database to use. It must be
one of the types supported by GNU mailutils. At the time of one of the types supported by GNU mailutils. At the time of
this writing, these are: this writing, these are:
bdb bdb
skipping to change at line 906 skipping to change at line 906
Main daemon. *Note mailfromd: Invocation. Main daemon. *Note mailfromd: Invocation.
'PREFIX/etc/mailfromd.mf' 'PREFIX/etc/mailfromd.mf'
Default main filter script file. It is installed only if it Default main filter script file. It is installed only if it
is not already there. Thus, if you are upgrading to a newer is not already there. Thus, if you are upgrading to a newer
version of 'mailfromd', your old script file will be preserved version of 'mailfromd', your old script file will be preserved
with all your changes. with all your changes.
*Note MFL::, for a description of the mail filtering language. *Note MFL::, for a description of the mail filtering language.
'PREFIX/share/mailfromd/8.10/*.mf' 'PREFIX/share/mailfromd/8.11/*.mf'
MFL modules. *Note Modules::. MFL modules. *Note Modules::.
'PREFIX/info/mailfromd.info*' 'PREFIX/info/mailfromd.info*'
Documentation files. Documentation files.
'PREFIX/bin/mtasim' 'PREFIX/bin/mtasim'
MTA simulator program for testing 'mailfromd' scripts. *Note MTA simulator program for testing 'mailfromd' scripts. *Note
mtasim::. mtasim::.
'PREFIX/sbin/pmult' 'PREFIX/sbin/pmult'
skipping to change at line 2203 skipping to change at line 2203
Some 'mailfromd' functions use DBM databases to save their persistent Some 'mailfromd' functions use DBM databases to save their persistent
state data. Each database has a unique "identifier", and is assigned state data. Each database has a unique "identifier", and is assigned
several pieces of information for its maintenance: the database "file several pieces of information for its maintenance: the database "file
name" and the "expiration period", i.e. the time after which a record name" and the "expiration period", i.e. the time after which a record
is considered expired. is considered expired.
To obtain the list of available databases along with their To obtain the list of available databases along with their
preconfigured settings, run 'mailfromd --show-defaults'. You will see preconfigured settings, run 'mailfromd --show-defaults'. You will see
an output similar to this: an output similar to this:
version: 8.10 version: 8.11
script file: /etc/mailfromd.mf script file: /etc/mailfromd.mf
preprocessor: /usr/bin/m4 -s preprocessor: /usr/bin/m4 -s
user: mail user: mail
statedir: /var/run/mailfromd statedir: /var/run/mailfromd
socket: unix:/var/run/mailfromd/mailfrom socket: unix:/var/run/mailfromd/mailfrom
pidfile: /var/run/mailfromd/mailfromd.pid pidfile: /var/run/mailfromd/mailfromd.pid
default syslog: blocking default syslog: blocking
supported databases: gdbm, bdb supported databases: gdbm, bdb
default database type: bdb default database type: bdb
optional features: GeoIP optional features: GeoIP
skipping to change at line 2240 skipping to change at line 2240
* Database Formats:: * Database Formats::
* Basic Database Operations:: * Basic Database Operations::
* Database Maintenance:: * Database Maintenance::
File: mailfromd.info, Node: Database Formats, Next: Basic Database Operations, Up: Databases File: mailfromd.info, Node: Database Formats, Next: Basic Database Operations, Up: Databases
3.15.1 Database Formats 3.15.1 Database Formats
----------------------- -----------------------
The version 8.10 runs the following database types (or "formats"): The version 8.11 runs the following database types (or "formats"):
'cache' 'cache'
"Cache database" keeps the information about external emails, "Cache database" keeps the information about external emails,
obtained using sender verification functions (*note Checking Sender obtained using sender verification functions (*note Checking Sender
Address::). The key entry to this database is an email address or Address::). The key entry to this database is an email address or
EMAIL:SENDER-IP string, for addresses checked using strict EMAIL:SENDER-IP string, for addresses checked using strict
verification. The data its stores for each key are: verification. The data its stores for each key are:
1. Address validity. This field can be either 'success' or 1. Address validity. This field can be either 'success' or
'not_found', meaning the address is confirmed to exists or it 'not_found', meaning the address is confirmed to exists or it
skipping to change at line 3175 skipping to change at line 3175
RUNTIME ERROR near FILE:LINE: TEXT RUNTIME ERROR near FILE:LINE: TEXT
where FILE:LINE indicates approximate source file location where the where FILE:LINE indicates approximate source file location where the
error occurred and TEXT gives the textual description of the error. error occurred and TEXT gives the textual description of the error.
Fatal runtime errors Fatal runtime errors
-------------------- --------------------
Fatal runtime errors are caused by a condition that is impossible to fix Fatal runtime errors are caused by a condition that is impossible to fix
at run time. For version 8.10 these are: at run time. For version 8.11 these are:
Not enough memory Not enough memory
There is not enough memory for the execution of the program. Try There is not enough memory for the execution of the program. Try
to make more memory available for 'mailfromd' or to reduce its to make more memory available for 'mailfromd' or to reduce its
memory requirements by rewriting your filter script. memory requirements by rewriting your filter script.
Out of stack space; increase #pragma stacksize Out of stack space; increase #pragma stacksize
Heap overrun; increase #pragma stacksize Heap overrun; increase #pragma stacksize
memory chunk too big to fit into heap memory chunk too big to fit into heap
These errors are reported when there is not enough space left on These errors are reported when there is not enough space left on
skipping to change at line 3398 skipping to change at line 3398
prog envfrom prog envfrom
do do
echo "X is %x" echo "X is %x"
done done
Does '%x' in 'echo' refers to the variable or to the constant? The Does '%x' in 'echo' refers to the variable or to the constant? The
correct answer is 'to the variable'. When executed, this code will correct answer is 'to the variable'. When executed, this code will
print 'X is X'. print 'X is X'.
As of version 8.10, 'mailfromd' will always print a diagnostic As of version 8.11, 'mailfromd' will always print a diagnostic
message whenever it stumbles upon a variable having the same name as a message whenever it stumbles upon a variable having the same name as a
previously defined constant or vice versa. The resolution of such name previously defined constant or vice versa. The resolution of such name
clashes is described in detail in *Note variable--constant shadowing::. clashes is described in detail in *Note variable--constant shadowing::.
Future versions of the program may provide a non-ambiguous way of Future versions of the program may provide a non-ambiguous way of
referring to variables and constants from literal strings. referring to variables and constants from literal strings.
File: mailfromd.info, Node: MFL, Next: Library, Prev: Tutorial, Up: Top File: mailfromd.info, Node: MFL, Next: Library, Prev: Tutorial, Up: Top
4 Mail Filtering Language 4 Mail Filtering Language
skipping to change at line 3491 skipping to change at line 3491
The quotes around FILE in the second form quotes are optional. The quotes around FILE in the second form quotes are optional.
Both forms are equivalent if FILE is an absolute file name. Both forms are equivalent if FILE is an absolute file name.
Otherwise, the first form will look for FILE in the "include search Otherwise, the first form will look for FILE in the "include search
path". The second one will look for it in the current working directory path". The second one will look for it in the current working directory
first, and, if not found there, in the include search path. first, and, if not found there, in the include search path.
The default include search path is: The default include search path is:
1. 'PREFIX/share/mailfromd/8.10/include' 1. 'PREFIX/share/mailfromd/8.11/include'
2. 'PREFIX/share/mailfromd/include' 2. 'PREFIX/share/mailfromd/include'
3. '/usr/share/mailfromd/include' 3. '/usr/share/mailfromd/include'
4. '/usr/local/share/mailfromd/include' 4. '/usr/local/share/mailfromd/include'
Where PREFIX is the installation prefix. Where PREFIX is the installation prefix.
New directories can be appended in front of it using '-I' New directories can be appended in front of it using '-I'
('--include') command line option, or 'include-path' configuration ('--include') command line option, or 'include-path' configuration
statement (*note include-path: conf-base.). statement (*note include-path: conf-base.).
For example, invoking For example, invoking
$ mailfromd -I/var/mailfromd -I/com/mailfromd $ mailfromd -I/var/mailfromd -I/com/mailfromd
creates the following include search path creates the following include search path
1. '/var/mailfromd' 1. '/var/mailfromd'
2. '/com/mailfromd' 2. '/com/mailfromd'
3. 'PREFIX/share/mailfromd/8.10/include' 3. 'PREFIX/share/mailfromd/8.11/include'
4. 'PREFIX/share/mailfromd/include' 4. 'PREFIX/share/mailfromd/include'
5. '/usr/share/mailfromd/include' 5. '/usr/share/mailfromd/include'
6. '/usr/local/share/mailfromd/include' 6. '/usr/local/share/mailfromd/include'
Along with '#include', there is also a special form '#include_once', Along with '#include', there is also a special form '#include_once',
that has the same syntax: that has the same syntax:
#include_once <FILE> #include_once <FILE>
#include_once "FILE" #include_once "FILE"
skipping to change at line 4137 skipping to change at line 4137
File: mailfromd.info, Node: Built-in constants, Up: Constants File: mailfromd.info, Node: Built-in constants, Up: Constants
4.8.1 Built-in constants 4.8.1 Built-in constants
------------------------ ------------------------
Several constants are built into the MFL compiler. To discern them from Several constants are built into the MFL compiler. To discern them from
user-defined ones, their names start and end with two underscores user-defined ones, their names start and end with two underscores
('__'). ('__').
The following constants are defined in 'mailfromd' version 8.10: The following constants are defined in 'mailfromd' version 8.11:
-- Built-in constant: string __file__ -- Built-in constant: string __file__
Expands to the name of the current source file. Expands to the name of the current source file.
-- Built-in constant: string __function__ -- Built-in constant: string __function__
Expands to the name of the current lexical context, i.e. the Expands to the name of the current lexical context, i.e. the
function or handler name. function or handler name.
-- Built-in constant: string __git__ -- Built-in constant: string __git__
This built-in constant is defined for alpha versions only. Its This built-in constant is defined for alpha versions only. Its
skipping to change at line 4341 skipping to change at line 4341
* Menu: * Menu:
* Predefined variables:: * Predefined variables::
File: mailfromd.info, Node: Predefined variables, Up: Variables File: mailfromd.info, Node: Predefined variables, Up: Variables
4.9.1 Predefined Variables 4.9.1 Predefined Variables
-------------------------- --------------------------
Several variables are predefined. In 'mailfromd' version 8.10 these Several variables are predefined. In 'mailfromd' version 8.11 these
are: are:
-- Variable: Predefined Variable number cache_used -- Variable: Predefined Variable number cache_used
This variable is set by 'stdpoll' and 'strictpoll' built-ins (and, This variable is set by 'stdpoll' and 'strictpoll' built-ins (and,
consequently, by the 'on poll' statement). Its value is '1' if the consequently, by the 'on poll' statement). Its value is '1' if the
function used the cached data instead of directly polling the host, function used the cached data instead of directly polling the host,
and '0' if the polling took place. *Note SMTP Callout functions::. and '0' if the polling took place. *Note SMTP Callout functions::.
You can use this variable to make your reject message more You can use this variable to make your reject message more
informative for the remote party. The common paradigm is to define informative for the remote party. The common paradigm is to define
skipping to change at line 5223 skipping to change at line 5223
return 0 return 0
fi fi
fi fi
# never reached # never reached
done done
---------- Footnotes ---------- ---------- Footnotes ----------
(1) Notice that these are intended for educational purposes and do (1) Notice that these are intended for educational purposes and do
not necessarily coincide with the actual definitions of these functions not necessarily coincide with the actual definitions of these functions
in Mailfromd version 8.10. in Mailfromd version 8.11.
File: mailfromd.info, Node: Expressions, Next: Shadowing, Prev: Functions, U p: MFL File: mailfromd.info, Node: Expressions, Next: Shadowing, Prev: Functions, U p: MFL
4.14 Expressions 4.14 Expressions
================ ================
Expressions are language constructs, that evaluate to a value, that can Expressions are language constructs, that evaluate to a value, that can
subsequently be echoed, tested in a conditional statement, assigned to a subsequently be echoed, tested in a conditional statement, assigned to a
variable or passed to a function. variable or passed to a function.
skipping to change at line 5845 skipping to change at line 5845
Header Actions Header Actions
.............. ..............
Header manipulation actions provide basic means to add, delete or modify Header manipulation actions provide basic means to add, delete or modify
the message RFC 2822 headers. the message RFC 2822 headers.
'add NAME STRING' 'add NAME STRING'
Add the header NAME with the value STRING. E.g.: Add the header NAME with the value STRING. E.g.:
add "X-Seen-By" "Mailfromd 8.10" add "X-Seen-By" "Mailfromd 8.11"
(notice argument quoting) (notice argument quoting)
'replace NAME STRING' 'replace NAME STRING'
The same as 'add', but if the header NAME already exists, it will The same as 'add', but if the header NAME already exists, it will
be removed first, for example: be removed first, for example:
replace "X-Last-Processor" "Mailfromd 8.10" replace "X-Last-Processor" "Mailfromd 8.11"
'delete NAME' 'delete NAME'
Delete the header named NAME: Delete the header named NAME:
delete "X-Envelope-Date" delete "X-Envelope-Date"
These actions impose some restrictions. First of all, their first These actions impose some restrictions. First of all, their first
argument must be a literal string (not a variable or expression). argument must be a literal string (not a variable or expression).
Secondly, there is no way to select a particular header instance to Secondly, there is no way to select a particular header instance to
delete or replace, which may be necessary to properly handle multiple delete or replace, which may be necessary to properly handle multiple
skipping to change at line 6193 skipping to change at line 6193
* Catch and Throw:: * Catch and Throw::
File: mailfromd.info, Node: Built-in Exceptions, Next: User-defined Exceptions , Up: Exceptions File: mailfromd.info, Node: Built-in Exceptions, Next: User-defined Exceptions , Up: Exceptions
4.19.1 Built-in Exceptions 4.19.1 Built-in Exceptions
-------------------------- --------------------------
The first 20 exception numbers are reserved for "built-in exceptions". The first 20 exception numbers are reserved for "built-in exceptions".
These are declared in module 'status.mf'. The following table These are declared in module 'status.mf'. The following table
summarizes all built-in exception types implemented by 'mailfromd' summarizes all built-in exception types implemented by 'mailfromd'
version 8.10. Exceptions are listed in lexicographic order. version 8.11. Exceptions are listed in lexicographic order.
'e_badmmq' 'e_badmmq'
The called function cannot finish its task because an uncompatible The called function cannot finish its task because an uncompatible
message modification function was called at some point before it. message modification function was called at some point before it.
For details, *note MMQ and dkim_sign::. For details, *note MMQ and dkim_sign::.
'e_dbfailure' 'e_dbfailure'
General database failure. For example, the database cannot be General database failure. For example, the database cannot be
opened. This exception can be signaled by any function that opened. This exception can be signaled by any function that
queries any DBM database. queries any DBM database.
skipping to change at line 6227 skipping to change at line 6227
'e_failure' 'e_failure'
'failure' 'failure'
'e_failure' 'e_failure'
A general failure has occurred. In particular, this exception is A general failure has occurred. In particular, this exception is
signaled by DNS lookup functions when any permanent failure occurs. signaled by DNS lookup functions when any permanent failure occurs.
This exception can be signaled by any DNS-related function This exception can be signaled by any DNS-related function
('hasmx', 'poll', etc.) or operation ('mx matches'). ('hasmx', 'poll', etc.) or operation ('mx matches').
'e_format' 'e_format'
Invalid input format. This exception is signaled if input data to Invalid input format. This exception is signaled if input data to
a function are improperly formatted. In version 8.10 it is a function are improperly formatted. In version 8.11 it is
signaled by 'message_burst' function if its input message is not signaled by 'message_burst' function if its input message is not
formatted according to RFC 934. *Note Message digest functions::. formatted according to RFC 934. *Note Message digest functions::.
'e_invcidr' 'e_invcidr'
Invalid CIDR notation. This is signaled by 'match_cidr' function Invalid CIDR notation. This is signaled by 'match_cidr' function
when its second argument is not a valid CIDR. when its second argument is not a valid CIDR.
'e_invip' 'e_invip'
Invalid IP address. This is signaled by 'match_cidr' function when Invalid IP address. This is signaled by 'match_cidr' function when
its first argument is not a valid IP address. its first argument is not a valid IP address.
skipping to change at line 7003 skipping to change at line 7003
Disables the external preprocessor. Disables the external preprocessor.
'--preprocessor=COMMAND' '--preprocessor=COMMAND'
Use COMMAND as external preprocessor. Be especially careful with Use COMMAND as external preprocessor. Be especially careful with
this option, because 'mailfromd' cannot verify whether COMMAND is this option, because 'mailfromd' cannot verify whether COMMAND is
actually some kind of a preprocessor or not. actually some kind of a preprocessor or not.
---------- Footnotes ---------- ---------- Footnotes ----------
(1) It is usually located in (1) It is usually located in
'/usr/local/share/mailfromd/8.10/include/pp-setup'. '/usr/local/share/mailfromd/8.11/include/pp-setup'.
(2) This is similar to GNU m4 '--prefix-builtin' options. This (2) This is similar to GNU m4 '--prefix-builtin' options. This
approach was chosen to allow for using non-GNU 'm4' implementations as approach was chosen to allow for using non-GNU 'm4' implementations as
well. well.
File: mailfromd.info, Node: Filter Script Example, Next: Reserved Words, Prev : Preprocessor, Up: MFL File: mailfromd.info, Node: Filter Script Example, Next: Reserved Words, Prev : Preprocessor, Up: MFL
4.23 Example of a Filter Script File 4.23 Example of a Filter Script File
==================================== ====================================
skipping to change at line 7233 skipping to change at line 7233
Any keyword beginning with a 'm4_' prefix is a reserved preprocessor Any keyword beginning with a 'm4_' prefix is a reserved preprocessor
symbol. symbol.
File: mailfromd.info, Node: Library, Next: Using MFL Mode, Prev: MFL, Up: To p File: mailfromd.info, Node: Library, Next: Using MFL Mode, Prev: MFL, Up: To p
5 The MFL Library Functions 5 The MFL Library Functions
*************************** ***************************
This chapter describes library functions available in Mailfromd version This chapter describes library functions available in Mailfromd version
8.10. For the simplicity of explanation, we use the word 'boolean' to 8.11. For the simplicity of explanation, we use the word 'boolean' to
indicate variables of numeric type that are used as boolean values. For indicate variables of numeric type that are used as boolean values. For
such variables, the term 'False' stands for the numeric 0, and 'True' such variables, the term 'False' stands for the numeric 0, and 'True'
for any non-zero value. for any non-zero value.
* Menu: * Menu:
* Macro access:: * Macro access::
* String transformation:: * String transformation::
* String manipulation:: * String manipulation::
* String formatting:: * String formatting::
skipping to change at line 8119 skipping to change at line 8119
prog eom prog eom
do do
header_prefix_pattern("X-Spamd-*", "X-") header_prefix_pattern("X-Spamd-*", "X-")
done done
File: mailfromd.info, Node: Body Modification Functions, Next: Message modific ation queue, Prev: Header modification functions, Up: Library File: mailfromd.info, Node: Body Modification Functions, Next: Message modific ation queue, Prev: Header modification functions, Up: Library
5.9 Body Modification Functions 5.9 Body Modification Functions
=============================== ===============================
Body modification is an experimental feature of MFL. The version 8.10 Body modification is an experimental feature of MFL. The version 8.11
provides only one function for that purpose. provides only one function for that purpose.
-- Built-in Function: void replbody (string TEXT) -- Built-in Function: void replbody (string TEXT)
Replace the body of the message with TEXT. Notice, that TEXT must Replace the body of the message with TEXT. Notice, that TEXT must
not contain RFC 822 headers. See the previous section if you want not contain RFC 822 headers. See the previous section if you want
to manipulate message headers. to manipulate message headers.
Example: Example:
replbody("Body of this message has been removed by the mail filter." ) replbody("Body of this message has been removed by the mail filter." )
 End of changes. 20 change blocks. 
20 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)