"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "doc/mailfromd.info" between
mailfromd-8.11.tar.xz and mailfromd-8.12.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  (mailfromd-8.11.tar.xz):mailfromd.info  (mailfromd-8.12.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 23 July 2021,
documents 'mailfromd' Version 8.11. documents 'mailfromd' Version 8.12.
* 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 178 skipping to change at line 178
* scope of visibility:: * scope of visibility::
* import:: Require and Import * import:: Require and Import
The MFL Library Functions The MFL Library Functions
* Macro access:: * Macro access::
* String transformation:: * String transformation::
* String manipulation:: * String manipulation::
* String formatting:: * String formatting::
* Character Type:: * Character Type::
* I/O functions::
* Filtering functions::
* Email processing functions:: * Email processing functions::
* Envelope modification functions:: * Envelope modification functions::
* Header modification functions:: * Header modification functions::
* Body Modification Functions:: * Body Modification Functions::
* Message modification queue:: * Message modification queue::
* Mail header functions:: * Mail header functions::
* Mail body functions:: * Mail body functions::
* EOM Functions:: * EOM Functions::
* Current Message Functions:: * Current Message Functions::
* Mailbox functions:: * Mailbox functions::
* Message functions:: * Message functions::
* Quarantine functions:: * Quarantine functions::
* SMTP Callout functions:: * SMTP Callout functions::
* Compatibility Callout functions:: * Compatibility Callout functions::
* Internet address manipulation functions:: * Internet address manipulation functions::
* DNS functions:: * DNS functions::
* Geolocation functions:: * Geolocation functions::
* Database functions:: * Database functions::
* I/O functions::
* System functions:: * System functions::
* Passwd functions:: * Passwd functions::
* Sieve Interface:: * Sieve Interface::
* Interfaces to Third-Party Programs:: * Interfaces to Third-Party Programs::
* Rate limiting functions:: * Rate limiting functions::
* Greylisting functions:: * Greylisting functions::
* Special test functions:: * Special test functions::
* Mail Sending Functions:: * Mail Sending Functions::
* Blacklisting Functions:: * Blacklisting Functions::
* SPF Functions:: * SPF Functions::
* DKIM:: * DKIM::
* Sockmaps:: * Sockmaps::
* NLS Functions:: * NLS Functions::
* Syslog Interface:: * Syslog Interface::
* Debugging Functions:: * Debugging Functions::
Filtering functions
* Filters::
Message Functions Message Functions
* Header functions:: * Header functions::
* Message body functions:: * Message body functions::
* MIME functions:: * MIME functions::
* Message digest functions:: * Message digest functions::
Interfaces to Third-Party Programs Interfaces to Third-Party Programs
* SpamAssassin:: * SpamAssassin::
skipping to change at line 597 skipping to change at line 602
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.11) mailfromd (mailfromd 8.12)
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 828
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.11 it will DBM supported by GNU mailutils. As of version 8.12 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 911
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.11/*.mf' 'PREFIX/share/mailfromd/8.12/*.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 2208
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.11 version: 8.12
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 2245
* 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.11 runs the following database types (or "formats"): The version 8.12 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 3180
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.11 these are: at run time. For version 8.12 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 3403
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.11, 'mailfromd' will always print a diagnostic As of version 8.12, '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 3496
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.11/include' 1. 'PREFIX/share/mailfromd/8.12/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.11/include' 3. 'PREFIX/share/mailfromd/8.12/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 4142
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.11: The following constants are defined in 'mailfromd' version 8.12:
-- 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 4346
* 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.11 these Several variables are predefined. In 'mailfromd' version 8.12 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 5009 skipping to change at line 5014
function body, the following construct is used: function body, the following construct is used:
$(EXPR) $(EXPR)
where EXPR is any valid MFL expression, evaluating to a number N. This where EXPR is any valid MFL expression, evaluating to a number N. This
construct refers to the value of Nth actual parameter from the variable construct refers to the value of Nth actual parameter from the variable
argument list. Parameters are numbered from '1', so the first variable argument list. Parameters are numbered from '1', so the first variable
parameter is '$(1)', and the last one is '$($# - NM - NO)', where NM and parameter is '$(1)', and the last one is '$($# - NM - NO)', where NM and
NO are numbers of mandatory and optional parameters to the function. NO are numbers of mandatory and optional parameters to the function.
The construct '$(N)' where 1 <= N <= 9 can also be written as '$N'.
For example, the function below prints all its arguments: For example, the function below prints all its arguments:
func pargs (string text, ...) func pargs (string text, ...)
do do
echo "text=%text" echo "text=%text"
loop for number i 1, loop for number i 1,
while i <= $# - 1, while i < $# - @text,
set i i + 1 set i i + 1
do do
echo "arg %i=" . $(i) echo "arg %i=" . $(i)
done done
done done
Note the loop limits. The last variable argument has number '$# - 1', Note how the ordinal number operator is used to compute the upper limit.
because the function takes one mandatory argument.
The FUNCTION-BODY is any list of valid 'mailfromd' statements. In The FUNCTION-BODY is any list of valid 'mailfromd' statements. In
addition to the statements discussed below (*note Statements::) it can addition to the statements discussed below (*note Statements::) it can
also contain the 'return' statement, which is used to return a value also contain the 'return' statement, which is used to return a value
from the function. The syntax of the return statement is from the function. The syntax of the return statement is
return VALUE return VALUE
As an example of this, consider the following code snippet that As an example of this, consider the following code snippet that
defines the function 'sum' to return a sum of its two arguments: defines the function 'sum' to return a sum of its two arguments:
skipping to change at line 5223 skipping to change at line 5229
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.11. in Mailfromd version 8.12.
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 5851
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.11" add "X-Seen-By" "Mailfromd 8.12"
(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.11" replace "X-Last-Processor" "Mailfromd 8.12"
'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 6199
* 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.11. Exceptions are listed in lexicographic order. version 8.12. Exceptions are listed in lexicographic order.
'e_badmmq' -- Exception: 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' -- Exception: 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.
'e_divzero' -- Exception: e_divzero
Division by zero. Division by zero.
'e_exists' -- Exception: e_exists
This exception is emitted by 'dbinsert' built-in if the requested This exception is emitted by 'dbinsert' built-in if the requested
key is already present in the database (*note dbinsert: Database key is already present in the database (*note dbinsert: Database
functions.). functions.).
'e_eof' -- Exception: e_eof
Function reached end of file while reading. *Note I/O functions::, Function reached end of file while reading. *Note I/O functions::,
for a description of functions that can signal this exception. for a description of functions that can signal this exception.
'e_failure' -- Exception: e_failure
'failure' -- Exception: 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' -- Exception: 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.11 it is a function are improperly formatted. In version 8.12 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' -- Exception: e_ilseq
Illegal byte sequence. Signaled when a string cannot be converted
between character sets because a sequence of bytes was encountered
that is not defined for the source character set or cannot be
represented in the destination character set.
*Note MIME decoding::, for details.
-- Exception: 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' -- Exception: 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.
'e_invtime' -- Exception: e_invtime
Invalid time interval specification. It is signaled by 'interval' Invalid time interval specification. It is signaled by 'interval'
function if its argument is not a valid time interval (*note time function if its argument is not a valid time interval (*note time
interval specification::). interval specification::).
'e_io' -- Exception: e_io
An error occurred during the input-output operation. *Note I/O An error occurred during the input-output operation. *Note I/O
functions::, for a description of functions that can signal this functions::, for a description of functions that can signal this
exception. exception.
'e_macroundef' -- Exception: e_macroundef
A Sendmail macro is undefined. A Sendmail macro is undefined.
'e_noresolve' -- Exception: e_noresolve
The argument of a DNS-related function cannot be resolved to host The argument of a DNS-related function cannot be resolved to host
name or IP address. Currently only 'ismx' (*note ismx::) raises name or IP address. Currently only 'ismx' (*note ismx::) raises
this exception. this exception.
'e_range' -- Exception: e_range
The supplied argument is outside the allowed range. This is The supplied argument is outside the allowed range. This is
signalled, for example, by 'substring' function (*note signalled, for example, by 'substring' function (*note
substring::). substring::).
'e_regcomp' -- Exception: e_regcomp
Regular expression cannot be compiled. This can happen when a Regular expression cannot be compiled. This can happen when a
regular expression (a right-hand argument of a 'matches' operator) regular expression (a right-hand argument of a 'matches' operator)
is built at the runtime and the produced string is an invalid is built at the runtime and the produced string is an invalid
regex. regex.
'e_ston_conv' -- Exception: e_ston_conv
String-to-number conversion failed. This can be signaled when a String-to-number conversion failed. This can be signaled when a
string is used in numeric context which cannot be converted to the string is used in numeric context which cannot be converted to the
numeric data type. For example: numeric data type. For example:
set x "10a" set x "10a"
if x / 2 if x / 2
... ...
The 'if' condition will signal 'ston_conv', since '10a' cannot be The 'if' condition will signal 'ston_conv', since '10a' cannot be
converted to a number. converted to a number.
'e_temp_failure' -- Exception: e_temp_failure
'temp_failure' -- Exception: temp_failure
'e_temp_failure'
A temporary failure has occurred. This can be signaled by A temporary failure has occurred. This can be signaled by
DNS-related functions or operations. DNS-related functions or operations.
'e_url' -- Exception: e_url
The supplied URL is invalid. *Note Interfaces to Third-Party The supplied URL is invalid. *Note Interfaces to Third-Party
Programs::. Programs::.
In addition to these, two symbols are defined that are not exception -- Exception: e_success
types in the strict sense of the world, but are provided to make writing -- Exception: success
filter scripts more convenient. These are 'success', meaning successful -- Exception: e_not_found
return from a function, and 'not_found', meaning that the required -- Exception: not_found
entity (e.g. domain name or email address) was not found. *Note Figure In addition to these, two symbols are defined that are not
4.1: figure-poll-wrapper, for an illustration on how these can be used. exception types in the strict sense of the world, but are provided
For consistency with other exception codes, these can be spelled as to make writing filter scripts more convenient. These are
'e_success' and 'e_not_found'. 'success', meaning successful return from a function, and
'not_found', meaning that the required entity (e.g. domain name or
email address) was not found. *Note Figure 4.1:
figure-poll-wrapper, for an illustration on how these can be used.
For consistency with other exception codes, these can be spelled as
'e_success' and 'e_not_found'.
File: mailfromd.info, Node: User-defined Exceptions, Next: Catch and Throw, P rev: Built-in Exceptions, Up: Exceptions File: mailfromd.info, Node: User-defined Exceptions, Next: Catch and Throw, P rev: Built-in Exceptions, Up: Exceptions
4.19.2 User-defined Exceptions 4.19.2 User-defined Exceptions
------------------------------ ------------------------------
You can define your own exception types using the 'dclex' statement: You can define your own exception types using the 'dclex' statement:
dclex TYPE dclex TYPE
skipping to change at line 7003 skipping to change at line 7020
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.11/include/pp-setup'. '/usr/local/share/mailfromd/8.12/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 7250
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.11. For the simplicity of explanation, we use the word 'boolean' to 8.12. 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::
* Character Type:: * Character Type::
* I/O functions::
* Filtering functions::
* Email processing functions:: * Email processing functions::
* Envelope modification functions:: * Envelope modification functions::
* Header modification functions:: * Header modification functions::
* Body Modification Functions:: * Body Modification Functions::
* Message modification queue:: * Message modification queue::
* Mail header functions:: * Mail header functions::
* Mail body functions:: * Mail body functions::
* EOM Functions:: * EOM Functions::
* Current Message Functions:: * Current Message Functions::
* Mailbox functions:: * Mailbox functions::
* Message functions:: * Message functions::
* Quarantine functions:: * Quarantine functions::
* SMTP Callout functions:: * SMTP Callout functions::
* Compatibility Callout functions:: * Compatibility Callout functions::
* Internet address manipulation functions:: * Internet address manipulation functions::
* DNS functions:: * DNS functions::
* Geolocation functions:: * Geolocation functions::
* Database functions:: * Database functions::
* I/O functions::
* System functions:: * System functions::
* Passwd functions:: * Passwd functions::
* Sieve Interface:: * Sieve Interface::
* Interfaces to Third-Party Programs:: * Interfaces to Third-Party Programs::
* Rate limiting functions:: * Rate limiting functions::
* Greylisting functions:: * Greylisting functions::
* Special test functions:: * Special test functions::
* Mail Sending Functions:: * Mail Sending Functions::
* Blacklisting Functions:: * Blacklisting Functions::
* SPF Functions:: * SPF Functions::
skipping to change at line 7839 skipping to change at line 7857
s s
The string argument is written to the output. If a precision is The string argument is written to the output. If a precision is
specified, no more than the number specified of characters are specified, no more than the number specified of characters are
written. written.
% %
A '%' is written. No argument is converted. The complete A '%' is written. No argument is converted. The complete
conversion specification is '%%'. conversion specification is '%%'.
File: mailfromd.info, Node: Character Type, Next: Email processing functions, Prev: String formatting, Up: Library File: mailfromd.info, Node: Character Type, Next: I/O functions, Prev: String formatting, Up: Library
5.5 Character Type 5.5 Character Type
================== ==================
These functions check whether all characters of STR fall into a certain These functions check whether all characters of STR fall into a certain
character class according to the 'C' ('POSIX') locale(1). 'True' (1) is character class according to the 'C' ('POSIX') locale(1). 'True' (1) is
returned if they do, 'false' (0) is returned otherwise. In the latter returned if they do, 'false' (0) is returned otherwise. In the latter
case, the global variable 'ctype_mismatch' is set to the index of the case, the global variable 'ctype_mismatch' is set to the index of the
first character that is outside of the character class (characters are first character that is outside of the character class (characters are
indexed from 0). indexed from 0).
skipping to change at line 7910 skipping to change at line 7928
-- Built-in Function: boolean isxdigit (string STR) -- Built-in Function: boolean isxdigit (string STR)
Checks for hexadecimal digits, i.e. one of '0', '1', '2', '3', Checks for hexadecimal digits, i.e. one of '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'A', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'A',
'B', 'C', 'D', 'E', 'F'. 'B', 'C', 'D', 'E', 'F'.
---------- Footnotes ---------- ---------- Footnotes ----------
(1) Support for other locales is planned for future versions. (1) Support for other locales is planned for future versions.
File: mailfromd.info, Node: Email processing functions, Next: Envelope modific File: mailfromd.info, Node: I/O functions, Next: Filtering functions, Prev: C
ation functions, Prev: Character Type, Up: Library haracter Type, Up: Library
5.6 I/O functions
=================
MFL provides a set of functions for writing to disk files, pipes or
sockets and reading from them. The idea behind them is the same as in
most other programming languages: first you open the resource with a
call to 'open' which returns a "descriptor" i.e. an integer number
uniquely identifying the resource. Then you can write or read from it
using this descriptor. Finally, when the resource is no longer needed,
you can close it with a call to 'close'.
The number of available resource descriptors is limited. The default
limit is 1024. You can tailor it to your needs using the 'max-streams'
runtime configuration statement. *Note max-streams: conf-runtime, for a
detailed description.
-- Built-in Function: number open (string NAME)
The NAME argument specifies the name of a resource to open and the
access rights you need to have on it. The function returns a
descriptor of the opened stream, which can subsequently be used as
an argument to other I/O operations.
First symbols of NAME determine the type of the resource to be
opened and the access mode:
'>'
The rest of NAME is a name of a file. Open the file for
read-write access. If the file exists, truncate it to zero
length, otherwise create the file.
'>>'
The rest of NAME is a name of a file. Open the file for
appending (writing at end of file). The file is created if it
does not exist.
'|'
Treat the rest of NAME as the command name and its arguments.
Run this command and open its standard input for writing. The
standard error is closed before launching the program. This
can be altered by using the following versions of this
construct:
|2>null: COMMAND
Standard error is redirected to '/dev/null'.
|2>file:NAME COMMAND
Execute COMMAND with its standard error redirected to the
file NAME. If the file exists, it will be truncated.
|2>>file:NAME COMMAND
Standard error of the COMMAND is appended to the file
NAME. If file does not exist, it will be created.
The '|2>null:' construct described above is a shortcut
for
|2>>file:/dev/null COMMAND
|2>syslog:FACILITY[.PRIORITY] COMMAND
Standard error is redirected to the given syslog FACILITY
and, optionally, PRIORITY. If the latter is omitted,
'LOG_ERR' is assumed.
Valid values for FACILITY are: 'user', 'daemon', 'auth',
'authpriv', 'mail', and 'local0' through 'local7'. Valid
values for PRIORITY are: 'emerg', 'alert', 'crit', 'err',
'warning', 'notice', 'info', 'debug'. Both FACILITY and
PRIORITY may be given in upper, lower or mixed cases.
Notice, that no whitespace characters are allowed between '|'
and '2>'.
'|<'
Treat the rest of NAME as the command name and its arguments.
Run this command with its stdin closed and stdout open for
reading.
The standard error is treated as described above (see '|').
'|&'
Treat the rest of NAME as the command name and its arguments.
Run this command and set up for two-way communication with it,
i.e writes to the descriptor returned by 'open' will send data
to the program's standard input, reads from the descriptor
will get data from the program's standard output.
The standard error is treated as described above (see '|').
For example, the following redirects it to syslog
'mail.debug':
|&2>syslog:mail.debug COMMAND
'@'
Treat the rest of NAME as the URL of a socket to connect to.
Valid URL forms are described in *note milter port
specification::.
If none of these prefixes is used, NAME is treated as a name of an
existing file and 'open' will attempt to open this file for
reading.
The 'open' function will signal exception 'e_failure' if it is
unable to open the resource or get the required access to it.
-- Built-in Function: number spawn (string CMD [, number IN, number
OUT, number ERR])
Runs the supplied command CMD. The syntax of the CMD is the same
as for the NAME argument to 'open' (see above), which begins with
'|', excepting that the '|' sign is optional. That is:
spawn("/bin/cat")
has exactly the same effect as
open("|/bin/cat")
Optional arguments specify file stream descriptors to be used for
the program standard input, output and error streams,
correspondingly. If supplied, these should be the values returned
by a previous call to 'open' or 'tempfile'. The value '-1' means
no redirection.
The example below starts the 'awk' program with a simple expression
as its argument and redirects the content of the file '/etc/passwd'
to its standard input. The returned stream descriptor is bound to
the command's standard output (see the description of '|<' prefix
above). The standard error is closed:
number fd spawn("<awk -F: '{print $1}'", open("/etc/passwd"))
-- Built-in Function: void close (number RD)
The argument RD is a resource descriptor returned by a previous
call to 'open'. The function 'close' closes the resource and
deallocates any memory associated with it.
'close' will signal 'e_range' exception if RD lies outside of
allowed range of resource descriptors. *Note max-streams:
conf-runtime.
Notice that you are not required to close resources opened by 'open'.
Any unclosed resource will be closed automatically upon the termination
of the filtering program.
-- Built-in Function: void shutdown (number RD, number HOW)
This function causes all or part of a full-duplex connection to be
closed. The RD must be either a socket descriptor (returned by
'open(@...)') or a two-way pipe socket descriptor (returned by
'open(|&...)'), otherwise the call to 'shutdown' is completely
equivalent to 'close'.
The 'how' argument identifies which part of the connection to shut
down:
SHUT_RD
Read connection. All further receptions will be disallowed.
SHUT_WR
Write connection. All further transmissions will be
disallowed.
SHUT_RDWR
Shut down both read and write parts.
-- Built-in Function: number tempfile ([string TMPDIR])
Creates a nameless temporary file and returns its descriptor.
Optional TMPDIR supplies the directory where to create the file,
instead of the default '/tmp'.
-- Built-in Function: void rewind (number RD)
Rewinds the stream identified by RD to its beginning.
-- Built-in Function: number copy (number DST, number SRC)
Copies all data from the stream SRC to DST. Returns number of
bytes copied.
The following functions provide basic read/write capabilities.
-- Built-in Function: void write (number RD, string STR [, number
SIZE])
Writes the string STR to the resource descriptor RD. If the SIZE
argument is given, writes this number of bytes.
The function will signal 'e_range' exception if RD lies outside of
allowed range of resource descriptors, and 'e_io' exception if an
I/O error occurs.
-- Built-in Function: void write_body (number RD, pointer BP , number
SIZE)
Write the body segment of length SIZE from pointer BP to the stream
RD. This function can be used only in 'prog body' (*note body
handler::). Its second and third arguments correspond exactly to
the parameters of the 'body' handler, so the following construct
writes the message body to the resource 'fd', which should have
been open prior to invoking the 'body' handler:
prog body
do
write_body(fd, $1, $2)
done
-- Built-in Function: string read (number RD, number N)
Read and return N bytes from the resource descriptor RD.
The function may signal the following exceptions:
e_range
RD lies outside of allowed range of resource descriptors.
e_eof
End of file encountered.
e_io
An I/O error occurred.
-- Built-in Function: string getdelim (number RD, string DELIM)
Read and return the next string terminated by DELIM from the
resource descriptor RD.
The terminating DELIM string will be removed from the return value.
The function may signal the following exceptions:
e_range
RD lies outside of allowed range of resource descriptors.
e_eof
End of file encountered.
e_io
An I/O error occurred.
-- Built-in Function: string getline (number RD)
Read and return the next "line" from the resource descriptor RD. A
line is any sequence of characters terminated with the default
"line delimiter". The default delimiter is a property of RD, i.e.
different descriptors can have different line delimiters. The
default value is '\n' (ASCII 10), and can be changed using the
'fd_set_delimiter' function (see below).
The function may signal the following exceptions:
e_range
RD lies outside of allowed range of resource descriptors.
e_eof
End of file encountered.
e_io
An I/O error occurred.
-- Built-in Function: void fd_set_delimiter (number FD, string DELIM)
Set new line delimiter for the descriptor FD, which must be in
opened state.
Default delimiter is a newline character (ASCII 10). The following
example shows how to change it to CRLF sequence:
fd_set_delimiter(fd, "\r\n")
-- Built-in Function: string fd_delimiter (number FD)
Returns the line delimiter string for FD.
The following example shows how 'mailfromd' I/O functions can be used
to automatically add IP addresses to an RBL zone:
set nsupdate_cmd
"/usr/bin/nsupdate -k /etc/bind/Kmail.+157+14657.private"
func block_address(string addr)
do
number fd
string domain
set fd open "|%nsupdate_cmd"
set domain revip(addr) . ".rbl.myzone.come"
write(fd, "prereq nxrrset %domain A\n"
"update add %domain 86400 A %addr\n\n"
done
The function 'revip' is defined in *note revip::.
File: mailfromd.info, Node: Filtering functions, Next: Email processing functi
ons, Prev: I/O functions, Up: Library
5.7 Filtering functions
=======================
This section describes functions that transform data using Mailutils
"filter pipes". Filter pipe is a string defining data flow between
several "filters". Each filter takes input, transforms it according to
certain rules and produces the transformed data on its output. As in
shell, multiple filters are connected using pipe characters ('|'). For
example, the 'crlf' filter inserts a carriage return character before
each newline character. A filter doing that kind of transformation is
defined as:
"crlf"
Another filter, 'base64', converts its input to a BASE64 encoded
string. To transform each newline into carriage return + newline pair
and encode the resulting stream in BASE64, one would write:
"crlf | base64"
Some filters take one or more "arguments". These are specified as a
comma-delimited list in parentheses after the filter name. For example,
the 'linelen' filter limits the length of each output line to the given
number of octets. The following filter pipe will limit the length of
base64 lines in the filter above to 62 octets:
"crlf | base64 | linelen(62)"
Many filters operate in two modes: "encode" and "decode". By default
all MFL functions apply filters in encode mode. The desired mode can be
stated explicitly in the filter string by using 'encode()' and
'decode()' functions. They take a filter pipe line as their argument.
For example, the following will decode the stream produced by the
example filter above:
"decode(base64 | crlf)"
*Note Filters::, for a discussion of available filters and their
arguments.
-- Built-in Function: string filter_string (string INPUT, string
FILTER_PIPE)
Transforms the string INPUT using filters in FILTER_PIPE and
returns the result. Example:
set input "test\ninput\n"
filter_string(input, "crlf|base64") => "dGVzdA0KaW5wdXQNCg=="
-- Built-in Function: void filter_fd (number SRC_FD, number DST_FD,
string FILTER_PIPE)
Given two I/O descriptors, reads data from SRC_FD, transforms it
using FILTER_PIPE and writes the result to descriptor DST_FD.
Both descriptors must be obtained using functions described in
*note I/O functions::.
* Menu:
* Filters::
File: mailfromd.info, Node: Filters, Up: Filtering functions
5.7.1 Filters and Filter Pipes
------------------------------
A "filter pipe" is a string consisting of filter invocations delimited
by pipe characters ('|'). Each invocation is a filter name optionally
followed by a comma-separated list of parameters. Most filters can
operate in two modes: "encode" and "decode". Unless specified
otherwise, filters are invoked in encode mode. To change the mode, the
'encode' and 'decode' meta-filters are provided. Argments to these
filters are filter pipes that will be executed in the corresponding
mode.
The following Mailutils filters are available:
-- Filter: 7bit
In encode mode, converts its input into 7-bit ASCII, by clearing
the 8th bit on each processed byte.
In decode mode, it operates exactly as the 8bit filter, i.e.
copies its input to the output verbatim.
The filter takes no arguments.
-- Filter: 8bit
-- Filter: binary
Copies its input to output verbatim.
-- Filter: base64
-- Filter: B
Encodes or decodes the input using the 'base64' encoding.
The only difference between 'BASE64' and 'B' is that, in encode
mode, the former limits each ouput line length to 76 octets,
whereas the latter produces a contiguous stream of base64 data.
In decode mode, both filters operate exactly the same way.
-- Filter: charset (CSET)
-- Filter: charset (CSET, FALLBACK)
A convenience interface to the 'iconv' filter, available for use
only in the 'message_body_to_stream' function. It decodes the part
of a MIME message from its original character set, which is
determined from the value of the 'Content-Type' header, to the
destination character set CSET. Optional FALLBACK parameter
specifies the representation fallback to be used for octets that
cannot be converted between the charater sets. Its use is
described in *Note iconv::.
This filter is normally takes its input from the 'mimedecode'
filter, as in:
message_body_to_stream(fd, msg, 'mimedecode|charset(utf-8)')
*Note mimedecode::, for a detailed discussion.
-- Filter: crlf
-- Filter: rfc822
Converts line separators from LF (ASCII 10) to CRLF (ASCII 13 10)
and vice-versa.
In decode mode, translates each CRLF to LF. Takes no arguments.
In encode mode, translates each LF to CRLF. If an optional argument
'-n' is given, produces a "normalized" output, by preserving each
input CRLF sequence untouched (otherwise such sequences will be are
translated to CR CR LF).
-- Filter: crlfdot
In encode mode, replaces each LF ('\n' or ASCII 10) character with
CRLF ('\r\n', ASCII 13 10), and "byte-stuffs" the output by
producing an additional '.' in front of any '.' appearing at the
beginning of a line in input. Upon end of input, it outputs
additional '.\r\n', if the last output character was '\n', or
'\r\n.\r\n' otherwise.
If supplied the '-n' argument, it preserves each CRLF input
sequence untranslated (see the 'CRLF' above).
In decode mode, the reverse is performed: each CRLF is replaced
with a single LF byte, and additional dots are removed from
beginning of lines. A single dot on a line by itself marks the end
of the stream and causes the filter to return EOF.
-- Filter: dot
In encode mode, "byte-stuffs" the input by outputting an additional
dot ('.') in front of any dot appearing at the beginning of a line.
Upon encountering end of input, it outputs additional '.\n'.
In decode mode, the reverse is performed: additional dots are
removed from beginning of lines. A single dot on a line by itself
(i.e. the sequence '\n.\n') marks the end of the stream and causes
the filter to return EOF.
This filter doesn't take arguments.
-- Filter: from
Performs a traditional UNIX processing of lines starting with a
'From' followed by a space character.
In encode mode, each 'From ' at the beginning of a line is replaced
by '>From '.
In decode mode, the reverse operation is performed: initial
greater-then sign ('>') is removed from any line starting with
'>From '.
The filter takes no arguments.
-- Filter: fromrd
MBOXRD-compatible processing of envelope lines.
In encode mode, each 'From ' optionally preceded by any number of
contiguous '>' characters and appearing at the beginning of a line
is prefixed by another '>' character on output.
In decode mode, the reverse operation is performed: initial
greater-then sign ('>') is removed from any line starting with one
or more '>' characters followed by 'From '.
-- Filter: header
This filter treats its input as a RFC-2822 email message. It
extracts its header part (i.e. everything up to the first empty
line) and copies it to the output. The body of the message is
ignored.
The filter operates only in decode mode and takes no arguments.
-- Filter: iconv (SRC, DST [, FALLBACK])
Converts input from character set SRC to DST. The filter works the
same way in both decode and encode modes.
It takes two mandatory arguments: the names of the input (SRC) and
output (DST) charset. Optional third argument specifies what to do
when an illegal character sequence is encountered in the input
stream. Its possible values are:
'none'
Raise a 'e_ilseq' exception.
'copy-pass'
Copy the offending octet to the output verbatim and continue
conversion from the next octet.
'copy-octal'
Print the offending octet to the output using the C octal
conversion and continue conversion from the next octet.
The default is 'copy-octal'.
The following example creates a 'iconv' filter for converting from
'iso-8859-2' to 'utf-8', raising the 'e_ilseq' exception on the
first conversion error:
iconv(iso-8859-2, utf-8, none)
-- Filter: inline-comment
-- Filter: inline-comment (STR, [options])
In decode mode, the filter removes from the input all lines
beginning with a given "inline comment sequence" STR. The default
comment sequence is ';' (a semicolon).
The following options modify the default behavior:
'-i, STR'
Emit line number information after each contiguous sequence of
removed lines. The argument STR supplies an "information
starter" - a sequence of characters which is output before the
actual line number.
'-r'
Remove empty lines, i.e. the lines that contain only
whitespace characters.
'-s'
Squeeze whitespace. Each sequence of two or more whitespace
characters encountered on input is replaced by a single space
character on output.
'-S'
A "whitespace-must-follow" mode. A comment sequence is
recognized only if followed by a whitespace character. The
character itself is retained on output.
In encode mode the 'inline-comment' filter adds a comment-starter
sequence at the beginning of each line. The default
comment-starter is ';' and can be changed by specifying the desired
comment starter as the first argument.
The only option supported in this mode is '-S', which enables the
whitespace-must-follow mode, in which a single space character
(ASCII 20) is output after each comment sequence.
-- Filter: linecon
-- Filter: linecon (-i, STR)
Implements a familiar UNIX line-continuation facility. The filter
removes from itsinput stream any newline character immediately
preceded by a backslash. This filter operates only in decode mode.
If given the arguments ('-i', STR), enables the "line number
information facility". This facility emits current input line
number (prefixed with STR) after each contiguous sequence of one or
more removed newline characters. It is useful for implementing
parsers which are normally supposed to identify eventual erroneous
lines with their input line numbers.
-- Filter: linelen (N)
Limits the length of each output line to a certain number of
octets. It operates in encode mode only and requires a single
parameter: the desired output length in octets. This filter makes
no attempt to analyze the lexical structure of the input: the
newline caracters are inserted when the length of the output line
reaches a predefined maximum. Any newline characters present in
the input are taken into account when computing the input line
length.
-- Filter: mimedecode
This is a domain-specific filter available for use only with the
'message_body_to_stream' function. It decodes the part of a MIME
message from whatever encoding that was used to store it in the
message to a stream of bytes. *Note mimedecode::.
-- Filter: quoted-printable
-- Filter: Q
Encodes or decodes the input using the "quoted-printable" encoding.
-- Filter: XML
In encode mode, the 'xml' filter converts input stream (which must
contain valid UTF-8 characters) into a form suitable for inclusion
into a XML or HTML document, i.e. it replaces '<', '>', and '&'
with '&lt;', '&gt;', and '&amp;', correspondingly, and replaces
invalid characters with their numeric character reference
representation.
In decode mode, a reverse operation is performed.
The filter does not take arguments.
5.6 Email processing functions. File: mailfromd.info, Node: Email processing functions, Next: Envelope modific
ation functions, Prev: Filtering functions, Up: Library
5.8 Email processing functions.
=============================== ===============================
-- Built-in Function: number email_map (string EMAIL) -- Built-in Function: number email_map (string EMAIL)
Parses EMAIL and returns a bitmap, consisting of zero or more of Parses EMAIL and returns a bitmap, consisting of zero or more of
the following flags: the following flags:
'EMAIL_MULTIPLE' 'EMAIL_MULTIPLE'
EMAIL has more than one email address. EMAIL has more than one email address.
'EMAIL_COMMENTS' 'EMAIL_COMMENTS'
skipping to change at line 7953 skipping to change at line 8550
local and domain parts only. E.g.: local and domain parts only. E.g.:
email_valid("gray@gnu.org") => 1 email_valid("gray@gnu.org") => 1
email_valid("gray") => 0 email_valid("gray") => 0
email_valid('"Sergey Poznyakoff <gray@gnu.org>') => 0 email_valid('"Sergey Poznyakoff <gray@gnu.org>') => 0
This function is defined in 'email.mf' (*note Modules::). This function is defined in 'email.mf' (*note Modules::).
File: mailfromd.info, Node: Envelope modification functions, Next: Header modi fication functions, Prev: Email processing functions, Up: Library File: mailfromd.info, Node: Envelope modification functions, Next: Header modi fication functions, Prev: Email processing functions, Up: Library
5.7 Envelope Modification Functions 5.9 Envelope Modification Functions
=================================== ===================================
Envelope modification functions set sender and add or delete recipient Envelope modification functions set sender and add or delete recipient
addresses from the message envelope. This allows MFL scripts to addresses from the message envelope. This allows MFL scripts to
redirect messages to another addresses. redirect messages to another addresses.
-- Built-in Function: void set_from (string EMAIL [, string ARGS]) -- Built-in Function: void set_from (string EMAIL [, string ARGS])
Sets envelope sender address to EMAIL, which must be a valid email Sets envelope sender address to EMAIL, which must be a valid email
address. Optional ARGS supply arguments to ESMTP 'MAIL FROM' address. Optional ARGS supply arguments to ESMTP 'MAIL FROM'
command. command.
skipping to change at line 7985 skipping to change at line 8582
do do
string alias dbget(aliasdb, $1, "NULL", 1) string alias dbget(aliasdb, $1, "NULL", 1)
if alias != "NULL" if alias != "NULL"
rcpt_delete($1) rcpt_delete($1)
rcpt_add(alias) rcpt_add(alias)
fi fi
done done
File: mailfromd.info, Node: Header modification functions, Next: Body Modifica tion Functions, Prev: Envelope modification functions, Up: Library File: mailfromd.info, Node: Header modification functions, Next: Body Modifica tion Functions, Prev: Envelope modification functions, Up: Library
5.8 Header Modification Functions 5.10 Header Modification Functions
================================= ==================================
There are two ways to modify message headers in a MFL script. First is There are two ways to modify message headers in a MFL script. First is
to use header actions, described in *note Actions::, and the second way to use header actions, described in *note Actions::, and the second way
is to use message modification functions. Compared with the actions, is to use message modification functions. Compared with the actions,
the functions offer a series of advantages. For example, using the functions offer a series of advantages. For example, using
functions you can construct the name of the header to operate upon (e.g. functions you can construct the name of the header to operate upon (e.g.
by concatenating several arguments), something which is impossible when by concatenating several arguments), something which is impossible when
using actions. Moreover, apart from three basic operations (add, modify using actions. Moreover, apart from three basic operations (add, modify
and remove), as supported by header actions, header functions allow to and remove), as supported by header actions, header functions allow to
insert a new header into a particular place. insert a new header into a particular place.
skipping to change at line 8116 skipping to change at line 8713
require 'header_rename' require 'header_rename'
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.11 Body Modification Functions
=============================== ================================
Body modification is an experimental feature of MFL. The version 8.11 Body modification is an experimental feature of MFL. The version 8.12
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." )
skipping to change at line 8171 skipping to change at line 8768
prog eom prog eom
do do
# Use the resulting stream as the stdin to the mailproc # Use the resulting stream as the stdin to the mailproc
# command and read the new body from its standard output. # command and read the new body from its standard output.
rewind(fd) rewind(fd)
replbody_fd(spawn("</usr/bin/mailproc", fd)) replbody_fd(spawn("</usr/bin/mailproc", fd))
done done
File: mailfromd.info, Node: Message modification queue, Next: Mail header func tions, Prev: Body Modification Functions, Up: Library File: mailfromd.info, Node: Message modification queue, Next: Mail header func tions, Prev: Body Modification Functions, Up: Library
5.10 Message Modification Queue 5.12 Message Modification Queue
=============================== ===============================
Message modification functions described in the previous subsections do Message modification functions described in the previous subsections do
not take effect immediately, in the moment they are called. Instead not take effect immediately, in the moment they are called. Instead
they store the requested changes in the internal "message modification they store the requested changes in the internal "message modification
queue". These changes are applied at the end of processing, before queue". These changes are applied at the end of processing, before
'eom' stage finishes (*note Figure 3.1: milter-control-flow.). 'eom' stage finishes (*note Figure 3.1: milter-control-flow.).
One important consequence of this way of operation is that calling One important consequence of this way of operation is that calling
any MTA action (*note Actions::), causes all prior modifications to the any MTA action (*note Actions::), causes all prior modifications to the
skipping to change at line 8243 skipping to change at line 8840
-- Built-in Function: void mmq_purge () -- Built-in Function: void mmq_purge ()
Remove all modification requests from the queue. This function Remove all modification requests from the queue. This function
undoes the effect of any of the following functions, if they had undoes the effect of any of the following functions, if they had
been called previously: 'rcpt_add', 'rcpt_delete', 'header_add', been called previously: 'rcpt_add', 'rcpt_delete', 'header_add',
'header_insert', 'header_delete', 'header_replace', 'replbody', 'header_insert', 'header_delete', 'header_replace', 'replbody',
'quarantine'. 'quarantine'.
File: mailfromd.info, Node: Mail header functions, Next: Mail body functions, Prev: Message modification queue, Up: Library File: mailfromd.info, Node: Mail header functions, Next: Mail body functions, Prev: Message modification queue, Up: Library
5.11 Mail Header Functions 5.13 Mail Header Functions
========================== ==========================
-- Built-in Function: string message_header_encode (string TEXT, -- Built-in Function: string message_header_encode (string TEXT,
[string ENC, string CHARSET]) [string ENC, string CHARSET])
Encode TEXT in accordance with RFC 2047. Optional arguments: Encode TEXT in accordance with RFC 2047. Optional arguments:
ENC ENC
Encoding to use. Valid values are 'quoted-printable', or 'Q' Encoding to use. Valid values are 'quoted-printable', or 'Q'
(the default) and 'base64', or 'B'. (the default) and 'base64', or 'B'.
skipping to change at line 8302 skipping to change at line 8899
(1) For example: (1) For example:
prog header prog header
do do
echo unfold($2) echo unfold($2)
done done
File: mailfromd.info, Node: Mail body functions, Next: EOM Functions, Prev: M ail header functions, Up: Library File: mailfromd.info, Node: Mail body functions, Next: EOM Functions, Prev: M ail header functions, Up: Library
5.12 Mail Body Functions 5.14 Mail Body Functions
======================== ========================
-- Built-in Function: string body_string (pointer TEXT, number COUNT) -- Built-in Function: string body_string (pointer TEXT, number COUNT)
Converts first COUNT bytes from the memory location pointed to by Converts first COUNT bytes from the memory location pointed to by
TEXT into a regular string. TEXT into a regular string.
This function is intended to convert the '$1' argument passed to a This function is intended to convert the '$1' argument passed to a
'body' handler to a regular MFL string. For more information about 'body' handler to a regular MFL string. For more information about
its use, see *note body handler::. its use, see *note body handler::.
skipping to change at line 8328 skipping to change at line 8925
prog body prog body
do do
if body_has_nulls($1, $2) if body_has_nulls($1, $2)
reject reject
fi fi
done done
File: mailfromd.info, Node: EOM Functions, Next: Current Message Functions, P rev: Mail body functions, Up: Library File: mailfromd.info, Node: EOM Functions, Next: Current Message Functions, P rev: Mail body functions, Up: Library
5.13 EOM Functions 5.15 EOM Functions
================== ==================
The following function is available only in the 'eom' handler: The following function is available only in the 'eom' handler:
-- Built-in Function: void progress () -- Built-in Function: void progress ()
Notify the MTA that the filter is still processing the message. Notify the MTA that the filter is still processing the message.
This causes MTA to restart its timeouts and allows additional This causes MTA to restart its timeouts and allows additional
amount of time for execution of 'eom'. amount of time for execution of 'eom'.
Use this function if your 'eom' handler needs additional time for Use this function if your 'eom' handler needs additional time for
processing the message (e.g. for scanning a very big MIME processing the message (e.g. for scanning a very big MIME
message). You may call it several times, if the need be, although message). You may call it several times, if the need be, although
such usage is not recommended. such usage is not recommended.
File: mailfromd.info, Node: Current Message Functions, Next: Mailbox functions , Prev: EOM Functions, Up: Library File: mailfromd.info, Node: Current Message Functions, Next: Mailbox functions , Prev: EOM Functions, Up: Library
5.14 Current Message Functions 5.16 Current Message Functions
============================== ==============================
-- Built-in Function: number current_message () -- Built-in Function: number current_message ()
This function can be used in 'eom' handlers only. It returns a This function can be used in 'eom' handlers only. It returns a
message descriptor referring to the current message. *Note Message message descriptor referring to the current message. *Note Message
functions::, for a description of functions for accessing messages. functions::, for a description of functions for accessing messages.
The functions below access the headers from the current message. The functions below access the headers from the current message.
They are available in the following handlers: 'eoh', 'body', 'eom'. They are available in the following handlers: 'eoh', 'body', 'eom'.
skipping to change at line 8389 skipping to change at line 8986
set s current_header("Received", 2) set s current_header("Received", 2)
Header indices are 1-based. Header indices are 1-based.
All current_header function raise the 'e_not_found' exception if the All current_header function raise the 'e_not_found' exception if the
requested header was not found. requested header was not found.
File: mailfromd.info, Node: Mailbox functions, Next: Message functions, Prev: Current Message Functions, Up: Library File: mailfromd.info, Node: Mailbox functions, Next: Message functions, Prev: Current Message Functions, Up: Library
5.15 Mailbox Functions 5.17 Mailbox Functions
====================== ======================
A set of functions is provided for accessing mailboxes and messages A set of functions is provided for accessing mailboxes and messages
within them. In this subsection we describe the functions for accessing within them. In this subsection we describe the functions for accessing
mailboxes. mailboxes.
A mailbox is opened using 'mailbox_open' function: A mailbox is opened using 'mailbox_open' function:
-- Built-in Function: number mailbox_open (string URL [, string MODE, -- Built-in Function: number mailbox_open (string URL [, string MODE,
string PERMS]) string PERMS])
skipping to change at line 8466 skipping to change at line 9063
Close a mailbox previously opened by 'mailbox_open'. Close a mailbox previously opened by 'mailbox_open'.
-- Built-in Function: void mailbox_append_message (number NMBX, number -- Built-in Function: void mailbox_append_message (number NMBX, number
NMSG) NMSG)
Append message NMSG to mailbox NMBX. The message descriptor NSMG Append message NMSG to mailbox NMBX. The message descriptor NSMG
must be obtained from a previous call to 'mailbox_get_message' or must be obtained from a previous call to 'mailbox_get_message' or
'current_message' (*note current_message::). 'current_message' (*note current_message::).
File: mailfromd.info, Node: Message functions, Next: Quarantine functions, Pr ev: Mailbox functions, Up: Library File: mailfromd.info, Node: Message functions, Next: Quarantine functions, Pr ev: Mailbox functions, Up: Library
5.16 Message Functions 5.18 Message Functions
====================== ======================
The functions described below retrieve information from RFC822 messages. The functions described below retrieve information from RFC822 messages.
The message to operate upon is identified by its "descriptor", an The message to operate upon is identified by its "descriptor", an
integer number returned by the previous call to 'mailbox_get_message' integer number returned by the previous call to 'mailbox_get_message'
(*note mailbox_get_message: Mailbox functions.) or 'current_message' (*note mailbox_get_message: Mailbox functions.) or 'current_message'
(*note current_message::) function. The maximum number of message (*note current_message::) function. The maximum number of message
descriptors is limited by 1024. You can change this limit using the descriptors is limited by 1024. You can change this limit using the
'max-open-messages' runtime configuration statement (*note 'max-open-messages' runtime configuration statement (*note
max-open-messages: conf-runtime.). max-open-messages: conf-runtime.).
skipping to change at line 8545 skipping to change at line 9142
* Menu: * Menu:
* Header functions:: * Header functions::
* Message body functions:: * Message body functions::
* MIME functions:: * MIME functions::
* Message digest functions:: * Message digest functions::
File: mailfromd.info, Node: Header functions, Next: Message body functions, U p: Message functions File: mailfromd.info, Node: Header functions, Next: Message body functions, U p: Message functions
5.16.1 Header functions 5.18.1 Header functions
----------------------- -----------------------
-- Built-in Function: number message_header_size (number NMSG) -- Built-in Function: number message_header_size (number NMSG)
Return the size, in bytes of the headers of message NMSG. See the Return the size, in bytes of the headers of message NMSG. See the
note to the 'message_size', above. note to the 'message_size', above.
-- Built-in Function: number message_header_lines (number NMSG) -- Built-in Function: number message_header_lines (number NMSG)
Return number of lines occupied by headers in message NMSG. Return number of lines occupied by headers in message NMSG.
-- Built-in Function: number message_header_count (number NMSG, [string -- Built-in Function: number message_header_count (number NMSG, [string
skipping to change at line 8594 skipping to change at line 9191
no such header, 'e_range' exception is raised. no such header, 'e_range' exception is raised.
-- Built-in Function: boolean message_has_header (number NMSG, string -- Built-in Function: boolean message_has_header (number NMSG, string
NAME [, number IDX]) NAME [, number IDX])
Return 'true' if message NMSG contains header with the given NAME. Return 'true' if message NMSG contains header with the given NAME.
If there are several headers with the same name, optional parameter If there are several headers with the same name, optional parameter
IDX may be used to select one of them. IDX may be used to select one of them.
File: mailfromd.info, Node: Message body functions, Next: MIME functions, Pre v: Header functions, Up: Message functions File: mailfromd.info, Node: Message body functions, Next: MIME functions, Pre v: Header functions, Up: Message functions
5.16.2 Message body functions 5.18.2 Message body functions
----------------------------- -----------------------------
-- Built-in Function: number message_body_size (number NMSG) -- Built-in Function: number message_body_size (number NMSG)
Return the size, in bytes, of the body of message NMSG. See the Return the size, in bytes, of the body of message NMSG. See the
note to the 'message_size', above. note to the 'message_size', above.
-- Built-in Function: number message_body_lines (number NMSG) -- Built-in Function: number message_body_lines (number NMSG)
Return number of lines in the body of message referred to by Return number of lines in the body of message referred to by
descriptor NMSG. descriptor NMSG.
skipping to change at line 8620 skipping to change at line 9217
function will return the first line from the message body. function will return the first line from the message body.
-- Built-in Function: string message_read_body_line (number NMSG) -- Built-in Function: string message_read_body_line (number NMSG)
Read and return next line from the body of the message NMSG. If Read and return next line from the body of the message NMSG. If
there are no more lines to read, raise the 'eof' exception. there are no more lines to read, raise the 'eof' exception.
Use 'message_body_rewind' (see above) to rewind the body stream and Use 'message_body_rewind' (see above) to rewind the body stream and
read its contents again. read its contents again.
-- Built-in Function: void message_body_to_stream (number FD, number -- Built-in Function: void message_body_to_stream (number FD, number
NMSG; string FILTER_CHAIN) NMSG; string FILTER_PIPE)
Copies the body of the message NSMG to stream descriptor FD. The Copies the body of the message NSMG to stream descriptor FD. The
descriptor must be obtained by a previous call to 'open'. descriptor must be obtained by a previous call to 'open'.
Optional FILTER_CHAIN supplies the name of a "Mailutils filter Optional FILTER_PIPE supplies a sequence of "Mailutils filters",
chain", through which the data will be passed before writing them through which the data will be passed before writing them to FD.
to FD. oSee <http://mailutils.org/wiki/Filter_chain>, for a *Note Filtering functions::, for a discussion of filter pipe
description of filter chains. syntax.
In addition to filters described in *Note Filters::, two special
filters are provided for use with this function: 'mimedecode' and
'charset'. The 'mimedecode' filter instructs the function to
decode the message body by reverting the encoding specified by its
'Content-Transfer-Encoding' header. It is normally used as the
very first filter in chain. The 'charset' filter recodes the
message body from it original charater set to the character set
specified as its argument.
*Note mimedecode::, for a detailed discussion of this feature.
File: mailfromd.info, Node: MIME functions, Next: Message digest functions, P rev: Message body functions, Up: Message functions File: mailfromd.info, Node: MIME functions, Next: Message digest functions, P rev: Message body functions, Up: Message functions
5.16.3 MIME functions 5.18.3 MIME functions
--------------------- ---------------------
-- Built-in Function: boolean message_is_multipart (number NMSG) -- Built-in Function: boolean message_is_multipart (number NMSG)
Return 'true' if message NMSG is a multipart (MIME) message. Return 'true' if message NMSG is a multipart (MIME) message.
-- Built-in Function: number message_count_parts (number NMSG) -- Built-in Function: number message_count_parts (number NMSG)
Return number of parts in message NMSG, if it is a multipart (MIME) Return number of parts in message NMSG, if it is a multipart (MIME)
message. If it is not, return '1'. message. If it is not, return '1'.
Use 'message_is_multipart' to check whether the message is a Use 'message_is_multipart' to check whether the message is a
multipart one. multipart one.
-- Built-in Function: number message_get_part (number nmsg, number N) -- Built-in Function: number message_get_part (number nmsg, number N)
Extract Nth part from the multipart message NMSG. Numeration of Extract Nth part from the multipart message NMSG. Numeration of
parts begins from '1'. Return message descriptor referring to the parts begins from '1'. Return message descriptor referring to the
extracted part. Message parts are regarded as messages, so any extracted part. Message parts are regarded as messages, so any
message functions can be applied to them. message functions can be applied to them.
-- Built-in Function: string message_content_type (number NMSG)
Returns content type for the message NMSG. The returned string is
composed of content type and subtype, delimited by slash.
If NMSG is not a multipart message, the function returns
'text/plain'.
Several functions are provided for decoding multi-part messages.
Such decoding is governed by 'Content-Transfer-Encoding' and
'Content-Type' headers of the message. The 'Content-Transfer-Encoding'
header defines the method used to encode the message. The value of
'Content-Type' header is used to determine the character set the body is
written in.
Basic MIME decoding facilities are provided by the built-in function
'message_body_to_stream', described in the previous subsection. To
instruct it to decode the content, pass it the FILTER_CHAIN argument
beginning with the word 'mimedecode'. The usual sequence is:
set fd open("> outfile")
message_body_to_stream(fd, msg, "mimedecode")
To ensure that the produced stream is represented in a specific
character set, use the 'charset' special filter. Its argument is the
name of the character set to recode the text to:
set fd open("> outfile")
message_body_to_stream(fd, msg, "mimedecode|charset(utf-8)")
The 'charset' filter takes also an optional second argument - a
"fallback" method, specifying what to do when an octet sequence is
encountered that cannot be represented in the requested character set.
Possible values for this argument are:
'none'
Stop further conversion and signal the 'e_ilseq' exception.
'copy-pass'
Copy the offending character to the output verbatim.
'copy-octal'
Represent the offending character as a C octal sequence ('\NNN',
where N is an octal digit). This is the default.
To decode a particular part of the message, first extract it using
the 'message_get_part' function. Recall that message parts are messages
as well, and as such can be passed to 'message_body_to_stream'. For
example, the following code fragment extracts all top-level parts of a
multi-part message to files named 'part.N':
if message_is_multipart(msg)
set n message_count_parts(msg)
loop for set i 1, while i <= n, set i i + 1
do
set fd open("> part.%i")
message_body_to_stream(fd, message_get_part(msg, i), "mimedecode")
close(fd)
done
fi
The 'mime.mf' module provides additional functions for decoding
multi-part messages:
-- Library Function: number message_body_decode (number NMSG; string
CHARSET, string FALLBACK)
Decodes the body of the message (or message part) NMSG, optionally
converting it to the given CHARSET. The FALLBACK argument
specifies what to do if a byte sequence cannot be converted to the
specified character set. *Note iconv fallback::, for a detailed
discussion.
The function returns a descriptor of the I/O stream that contains
the decoded material. *Note I/O functions:: for a discussion of
functions available for reading from it.
-- Library Function: number message_part_decode(number NMSG, number
PART; string CHARSET, string FALLBACK)
Decodes the body of the given part of a MIME message NMSG. The
argument PART is a 1-based index of the part in the message.
Optional arguments CHARSET and FALLBACK have the same meaning as in
'message_body_decode' (see above).
Returns a descriptor of the I/O stream that contains the decoded
material.
This function is equivalent to:
message_body_decode(message_get_part(NMSG, PART, CHARSET,
FALLBACK))
File: mailfromd.info, Node: Message digest functions, Prev: MIME functions, U p: Message functions File: mailfromd.info, Node: Message digest functions, Prev: MIME functions, U p: Message functions
5.16.4 Message digest functions 5.18.4 Message digest functions
------------------------------- -------------------------------
"Message digests" are specially formatted messages that contain certain "Message digests" are specially formatted messages that contain certain
number of mail messages, encapsulated using the method described in RFC number of mail messages, encapsulated using the method described in RFC
934. Such digests are often used in mailing lists to reduce the 934. Such digests are often used in mailing lists to reduce the
frequency of sending mails. Messages of this format are also produced frequency of sending mails. Messages of this format are also produced
by the "forward" function in most MUA's. by the "forward" function in most MUA's.
The usual way to handle a message digest in MFL is to convert it The usual way to handle a message digest in MFL is to convert it
first to a MIME message, and then to use functions for accessing its first to a MIME message, and then to use functions for accessing its
skipping to change at line 8726 skipping to change at line 9424
do do
number part message_get_part(msg, i) number part message_get_part(msg, i)
number out open(sprintf('>%s%02d', stem, i)) number out open(sprintf('>%s%02d', stem, i))
message_to_stream(out, part) message_to_stream(out, part)
done done
message_close(msg) message_close(msg)
done done
File: mailfromd.info, Node: Quarantine functions, Next: SMTP Callout functions , Prev: Message functions, Up: Library File: mailfromd.info, Node: Quarantine functions, Next: SMTP Callout functions , Prev: Message functions, Up: Library
5.17 Quarantine Functions 5.19 Quarantine Functions
========================= =========================
-- Built-in Function: void quarantine (string TEXT) -- Built-in Function: void quarantine (string TEXT)
Place the message to the quarantine queue, using TEXT as Place the message to the quarantine queue, using TEXT as
explanatory reason. explanatory reason.
File: mailfromd.info, Node: SMTP Callout functions, Next: Compatibility Callou t functions, Prev: Quarantine functions, Up: Library File: mailfromd.info, Node: SMTP Callout functions, Next: Compatibility Callou t functions, Prev: Quarantine functions, Up: Library
5.18 SMTP Callout Functions 5.20 SMTP Callout Functions
=========================== ===========================
-- Library Function: number callout_open (string URL) -- Library Function: number callout_open (string URL)
Opens connection to the callout server listening at URL. Returns Opens connection to the callout server listening at URL. Returns
the descriptor of the connection. the descriptor of the connection.
-- Library Function: void callout_close (number FD) -- Library Function: void callout_close (number FD)
Closes the connection. FD is the file descriptor returned by the Closes the connection. FD is the file descriptor returned by the
previous call to 'callout_open'. previous call to 'callout_open'.
skipping to change at line 8804 skipping to change at line 9502
-- Built-in Function: string default_callout_server_url () -- Built-in Function: string default_callout_server_url ()
Returns URL of the default callout server. Returns URL of the default callout server.
-- Library Function: number callout (string EMAIL) -- Library Function: number callout (string EMAIL)
Verifies the validity of the EMAIL using the default callout Verifies the validity of the EMAIL using the default callout
server. server.
File: mailfromd.info, Node: Compatibility Callout functions, Next: Internet ad dress manipulation functions, Prev: SMTP Callout functions, Up: Library File: mailfromd.info, Node: Compatibility Callout functions, Next: Internet ad dress manipulation functions, Prev: SMTP Callout functions, Up: Library
5.19 Compatibility Callout Functions 5.21 Compatibility Callout Functions
==================================== ====================================
The following functions are wrappers over the callout functions The following functions are wrappers over the callout functions
described in the previous section. They are provided for backward described in the previous section. They are provided for backward
compativbility. compativbility.
These functions are defined in the module 'poll.mf', which you must These functions are defined in the module 'poll.mf', which you must
require prior to using any of them. require prior to using any of them.
-- Library Function: boolean _pollhost (string IP, string EMAIL, string -- Library Function: boolean _pollhost (string IP, string EMAIL, string
skipping to change at line 8884 skipping to change at line 9582
cache_used '1' if cached data were used instead of polling, cache_used '1' if cached data were used instead of polling,
'0' otherwise. This variable is set by '0' otherwise. This variable is set by
'stdpoll' and 'strictpoll'. If it equals '1', 'stdpoll' and 'strictpoll'. If it equals '1',
none of the above variables are modified. none of the above variables are modified.
*Note cache_used example::, for an example. *Note cache_used example::, for an example.
Table 5.1: Variables set by polling functions Table 5.1: Variables set by polling functions
File: mailfromd.info, Node: Internet address manipulation functions, Next: DNS functions, Prev: Compatibility Callout functions, Up: Library File: mailfromd.info, Node: Internet address manipulation functions, Next: DNS functions, Prev: Compatibility Callout functions, Up: Library
5.20 Internet address manipulation functions 5.22 Internet address manipulation functions
============================================ ============================================
Following functions operate on IPv4 addresses and CIDRs. Following functions operate on IPv4 addresses and CIDRs.
-- Built-in Function: number ntohl (number N) -- Built-in Function: number ntohl (number N)
Converts the number N, from host to network byte order. The Converts the number N, from host to network byte order. The
argument N is treated as an unsigned 32-bit number. argument N is treated as an unsigned 32-bit number.
-- Built-in Function: number htonl (number N) -- Built-in Function: number htonl (number N)
Converts the number N, from network to host byte order. The Converts the number N, from network to host byte order. The
skipping to change at line 8962 skipping to change at line 9660
The following example will reject the mail if the IP address of the The following example will reject the mail if the IP address of the
sending machine does not belong to the block '10.10.1.0/19': sending machine does not belong to the block '10.10.1.0/19':
if not match_cidr(${client_addr}, "10.10.1.0/19") if not match_cidr(${client_addr}, "10.10.1.0/19")
reject reject
fi fi
File: mailfromd.info, Node: DNS functions, Next: Geolocation functions, Prev: Internet address manipulation functions, Up: Library File: mailfromd.info, Node: DNS functions, Next: Geolocation functions, Prev: Internet address manipulation functions, Up: Library
5.21 DNS Functions 5.23 DNS Functions
================== ==================
MFL offers two sets of functions for querying the Domain Name System. MFL offers two sets of functions for querying the Domain Name System.
The 'dns_query' function and associated 'dns_reply_' functions provide a The 'dns_query' function and associated 'dns_reply_' functions provide a
generalized DNS API. generalized DNS API.
Other functions provide a simplified API. Other functions provide a simplified API.
* Menu: * Menu:
* dns_query:: * dns_query::
* Simplified DNS functions:: * Simplified DNS functions::
File: mailfromd.info, Node: dns_query, Next: Simplified DNS functions, Up: DN S functions File: mailfromd.info, Node: dns_query, Next: Simplified DNS functions, Up: DN S functions
5.21.1 dns_query 5.23.1 dns_query
---------------- ----------------
-- Built-in Function: number dns_query (number TYPE, string DOMAIN; -- Built-in Function: number dns_query (number TYPE, string DOMAIN;
number SORT, number RESOLVE) number SORT, number RESOLVE)
This function looks up the domain name NAME. The TYPE argument This function looks up the domain name NAME. The TYPE argument
specifies type of the query to perform. On success, the function specifies type of the query to perform. On success, the function
returns "DNS reply descriptor", a non-negative integer number returns "DNS reply descriptor", a non-negative integer number
identifying the reply. It can then be passed to any of the identifying the reply. It can then be passed to any of the
'dns_reply_' functions discussed below in order to retrieve the 'dns_reply_' functions discussed below in order to retrieve the
information from it. information from it.
skipping to change at line 9064 skipping to change at line 9762
-- Built-in Function: string dns_reply_string (number RD, number N) -- Built-in Function: string dns_reply_string (number RD, number N)
Returns Nth record from the DNS reply RD. Returns Nth record from the DNS reply RD.
-- Built-in Function: number dns_reply_ip (number RD, number N) -- Built-in Function: number dns_reply_ip (number RD, number N)
Returns Nth record from the DNS reply RD, if the reply contains IP Returns Nth record from the DNS reply RD, if the reply contains IP
addresses. addresses.
File: mailfromd.info, Node: Simplified DNS functions, Prev: dns_query, Up: DN S functions File: mailfromd.info, Node: Simplified DNS functions, Prev: dns_query, Up: DN S functions
5.21.2 Simplified DNS functions 5.23.2 Simplified DNS functions
------------------------------- -------------------------------
These functions are implemented in two layers: "primitive" built-in These functions are implemented in two layers: "primitive" built-in
functions which raise exceptions if the lookup fails, and library calls functions which raise exceptions if the lookup fails, and library calls
that are warranted to always return meaningful value without throwing that are warranted to always return meaningful value without throwing
exceptions. exceptions.
The built-in layer is always available. The library calls become The built-in layer is always available. The library calls become
available after requesting the 'dns' module (*note Modules::): available after requesting the 'dns' module (*note Modules::):
skipping to change at line 9314 skipping to change at line 10012
*Note dns_query::, for details about the 'dns_query' function *Note dns_query::, for details about the 'dns_query' function
and associated 'dns_reply_*' calls. and associated 'dns_reply_*' calls.
2. This interface is semi-deprecated. 2. This interface is semi-deprecated.
It will most probably be removed in future releases, when It will most probably be removed in future releases, when
array data types are implemented. array data types are implemented.
File: mailfromd.info, Node: Geolocation functions, Next: Database functions, Prev: DNS functions, Up: Library File: mailfromd.info, Node: Geolocation functions, Next: Database functions, Prev: DNS functions, Up: Library
5.22 Geolocation functions 5.24 Geolocation functions
========================== ==========================
The "geolocation functions" allow you to identify the country where the The "geolocation functions" allow you to identify the country where the
given IP address or host name is located. These functions are available given IP address or host name is located. These functions are available
only if the 'libmaxminddb' library is installed and 'mailfromd' is only if the 'libmaxminddb' library is installed and 'mailfromd' is
compiled with the 'GeoIP2' support. compiled with the 'GeoIP2' support.
The 'libmaxminddb' library is distributed by 'MaxMind' under the The 'libmaxminddb' library is distributed by 'MaxMind' under the
terms of the 'Apache License' Version 2.0. It is available from terms of the 'Apache License' Version 2.0. It is available from
<https://dev.maxmind.com/geoip/geoip2/downloadable/#MaxMind_APIs>. <https://dev.maxmind.com/geoip/geoip2/downloadable/#MaxMind_APIs>.
skipping to change at line 9447 skipping to change at line 10145
pass pass
done done
') ')
* Menu: * Menu:
* Legacy geoip support:: * Legacy geoip support::
File: mailfromd.info, Node: Legacy geoip support, Up: Geolocation functions File: mailfromd.info, Node: Legacy geoip support, Up: Geolocation functions
5.22.1 Legacy geoip support 5.24.1 Legacy geoip support
--------------------------- ---------------------------
For compatibility with older releases, 'mailfromd' supports the legacy For compatibility with older releases, 'mailfromd' supports the legacy
'GeoIP' library. This support is going to be removed in the next 'GeoIP' library. This support is going to be removed in the next
release, so its use is not recommended. Please use 'GeoIP2' instead. release, so its use is not recommended. Please use 'GeoIP2' instead.
The support for the legacy 'GeoIP' library is available if The support for the legacy 'GeoIP' library is available if
'mailfromd' is compiled with the 'GeoIP' support (the '--with-geoip' 'mailfromd' is compiled with the 'GeoIP' support (the '--with-geoip'
configure option). The 'm4' macro 'WITH_GEOIP' is defined if it is so. configure option). The 'm4' macro 'WITH_GEOIP' is defined if it is so.
skipping to change at line 9489 skipping to change at line 10187
corresponding code blocks conditionally, by testing if the 'WITH_GEOIP' corresponding code blocks conditionally, by testing if the 'WITH_GEOIP'
m4 macro is defined. For example, the following code adds to the m4 macro is defined. For example, the following code adds to the
message the 'X-Originator-Country' header, containing the 2 letter code message the 'X-Originator-Country' header, containing the 2 letter code
of the country where the client machine is located. If 'mailfromd' is of the country where the client machine is located. If 'mailfromd' is
compiled without 'GeoIP' support, it does nothing: compiled without 'GeoIP' support, it does nothing:
m4_ifdef(`WITH_GEOIP',` m4_ifdef(`WITH_GEOIP',`
header_add("X-Originator-Country", geoip_country_code_by_addr($client_add r)) header_add("X-Originator-Country", geoip_country_code_by_addr($client_add r))
') ')
File: mailfromd.info, Node: Database functions, Next: I/O functions, Prev: Ge olocation functions, Up: Library File: mailfromd.info, Node: Database functions, Next: System functions, Prev: Geolocation functions, Up: Library
5.23 Database Functions 5.25 Database Functions
======================= =======================
The functions described below provide a user interface to DBM databases. The functions described below provide a user interface to DBM databases.
Each DBM database is a separate disk file that keeps "key/value Each DBM database is a separate disk file that keeps "key/value
pairs". The interface allows to retrieve the value corresponding to a pairs". The interface allows to retrieve the value corresponding to a
given key. Both 'key' and 'value' are null-terminated character given key. Both 'key' and 'value' are null-terminated character
strings. To lookup a key, it is important to know whether its length strings. To lookup a key, it is important to know whether its length
includes the terminating null byte. By default, it is assumed that it includes the terminating null byte. By default, it is assumed that it
does not. does not.
skipping to change at line 9707 skipping to change at line 10405
Returns 'true' if the string DOMAIN is found in one of relayed Returns 'true' if the string DOMAIN is found in one of relayed
domain files (*note relayed-domain-file: conf-base.). The usual domain files (*note relayed-domain-file: conf-base.). The usual
construct is: construct is:
if relayed(hostname(${client_addr})) if relayed(hostname(${client_addr}))
... ...
which yields 'true' if the IP address from 'Sendmail' variable which yields 'true' if the IP address from 'Sendmail' variable
'client_addr' is relayed by the local machine. 'client_addr' is relayed by the local machine.
File: mailfromd.info, Node: I/O functions, Next: System functions, Prev: Data File: mailfromd.info, Node: System functions, Next: Passwd functions, Prev: D
base functions, Up: Library atabase functions, Up: Library
5.24 I/O functions
==================
MFL provides a set of functions for writing to disk files, pipes or
sockets and reading from them. The idea behind them is the same as in
most other programming languages: first you open the resource with a
call to 'open' which returns a "descriptor" i.e. an integer number
uniquely identifying the resource. Then you can write or read from it
using this descriptor. Finally, when the resource is no longer needed,
you can close it with a call to 'close'.
The number of available resource descriptors is limited. The default
limit is 1024. You can tailor it to your needs using the 'max-streams'
runtime configuration statement. *Note max-streams: conf-runtime, for a
detailed description.
-- Built-in Function: number open (string NAME)
The NAME argument specifies the name of a resource to open and the
access rights you need to have on it. The function returns a
descriptor of the opened stream, which can subsequently be used as
an argument to other I/O operations.
First symbols of NAME determine the type of the resource to be
opened and the access mode:
'>'
The rest of NAME is a name of a file. Open the file for
read-write access. If the file exists, truncate it to zero
length, otherwise create the file.
'>>'
The rest of NAME is a name of a file. Open the file for
appending (writing at end of file). The file is created if it
does not exist.
'|'
Treat the rest of NAME as the command name and its arguments.
Run this command and open its standard input for writing. The
standard error is closed before launching the program. This
can be altered by using the following versions of this
construct:
|2>null: COMMAND
Standard error is redirected to '/dev/null'.
|2>file:NAME COMMAND
Execute COMMAND with its standard error redirected to the
file NAME. If the file exists, it will be truncated.
|2>>file:NAME COMMAND
Standard error of the COMMAND is appended to the file
NAME. If file does not exist, it will be created.
The '|2>null:' construct described above is a shortcut
for
|2>>file:/dev/null COMMAND
|2>syslog:FACILITY[.PRIORITY] COMMAND
Standard error is redirected to the given syslog FACILITY
and, optionally, PRIORITY. If the latter is omitted,
'LOG_ERR' is assumed.
Valid values for FACILITY are: 'user', 'daemon', 'auth',
'authpriv', 'mail', and 'local0' through 'local7'. Valid
values for PRIORITY are: 'emerg', 'alert', 'crit', 'err',
'warning', 'notice', 'info', 'debug'. Both FACILITY and
PRIORITY may be given in upper, lower or mixed cases.
Notice, that no whitespace characters are allowed between '|'
and '2>'.
'|<'
Treat the rest of NAME as the command name and its arguments.
Run this command with its stdin closed and stdout open for
reading.
The standard error is treated as described above (see '|').
'|&' 5.26 System functions
Treat the rest of NAME as the command name and its arguments.
Run this command and set up for two-way communication with it,
i.e writes to the descriptor returned by 'open' will send data
to the program's standard input, reads from the descriptor
will get data from the program's standard output.
The standard error is treated as described above (see '|').
For example, the following redirects it to syslog
'mail.debug':
|&2>syslog:mail.debug COMMAND
'@'
Treat the rest of NAME as the URL of a socket to connect to.
Valid URL forms are described in *note milter port
specification::.
If none of these prefixes is used, NAME is treated as a name of an
existing file and 'open' will attempt to open this file for
reading.
The 'open' function will signal exception 'e_failure' if it is
unable to open the resource or get the required access to it.
-- Built-in Function: number spawn (string CMD [, number IN, number
OUT, number ERR])
Runs the supplied command CMD. The syntax of the CMD is the same
as for the NAME argument to 'open' (see above), which begins with
'|', excepting that the '|' sign is optional. That is:
spawn("/bin/cat")
has exactly the same effect as
open("|/bin/cat")
Optional arguments specify file stream descriptors to be used for
the program standard input, output and error streams,
correspondingly. If supplied, these should be the values returned
by a previous call to 'open' or 'tempfile'. The value '-1' means
no redirection.
The example below starts the 'awk' program with a simple expression
as its argument and redirects the content of the file '/etc/passwd'
to its standard input. The returned stream descriptor is bound to
the command's standard output (see the description of '|<' prefix
above). The standard error is closed:
number fd spawn("<awk -F: '{print $1}'", open("/etc/passwd"))
-- Built-in Function: void close (number RD)
The argument RD is a resource descriptor returned by a previous
call to 'open'. The function 'close' closes the resource and
deallocates any memory associated with it.
'close' will signal 'e_range' exception if RD lies outside of
allowed range of resource descriptors. *Note max-streams:
conf-runtime.
Notice that you are not required to close resources opened by 'open'.
Any unclosed resource will be closed automatically upon the termination
of the filtering program.
-- Built-in Function: void shutdown (number RD, number HOW)
This function causes all or part of a full-duplex connection to be
closed. The RD must be either a socket descriptor (returned by
'open(@...)') or a two-way pipe socket descriptor (returned by
'open(|&...)'), otherwise the call to 'shutdown' is completely
equivalent to 'close'.
The 'how' argument identifies which part of the connection to shut
down:
SHUT_RD
Read connection. All further receptions will be disallowed.
SHUT_WR
Write connection. All further transmissions will be
disallowed.
SHUT_RDWR
Shut down both read and write parts.
-- Built-in Function: number tempfile ([string TMPDIR])
Creates a nameless temporary file and returns its descriptor.
Optional TMPDIR supplies the directory where to create the file,
instead of the default '/tmp'.
-- Built-in Function: void rewind (number RD)
Rewinds the stream identified by RD to its beginning.
-- Built-in Function: number copy (number DST, number SRC)
Copies all data from the stream SRC to DST. Returns number of
bytes copied.
The following functions provide basic read/write capabilities.
-- Built-in Function: void write (number RD, string STR [, number
SIZE])
Writes the string STR to the resource descriptor RD. If the SIZE
argument is given, writes this number of bytes.
The function will signal 'e_range' exception if RD lies outside of
allowed range of resource descriptors, and 'e_io' exception if an
I/O error occurs.
-- Built-in Function: void write_body (number RD, pointer BP , number
SIZE)
Write the body segment of length SIZE from pointer BP to the stream
RD. This function can be used only in 'prog body' (*note body
handler::). Its second and third arguments correspond exactly to
the parameters of the 'body' handler, so the following construct
writes the message body to the resource 'fd', which should have
been open prior to invoking the 'body' handler:
prog body
do
write_body(fd, $1, $2)
done
-- Built-in Function: string read (number RD, number N)
Read and return N bytes from the resource descriptor RD.
The function may signal the following exceptions:
e_range
RD lies outside of allowed range of resource descriptors.
e_eof
End of file encountered.
e_io
An I/O error occurred.
-- Built-in Function: string getdelim (number RD, string DELIM)
Read and return the next string terminated by DELIM from the
resource descriptor RD.
The terminating DELIM string will be removed from the return value.
The function may signal the following exceptions:
e_range
RD lies outside of allowed range of resource descriptors.
e_eof
End of file encountered.
e_io
An I/O error occurred.
-- Built-in Function: string getline (number RD)
Read and return the next "line" from the resource descriptor RD. A
line is any sequence of characters terminated with the default
"line delimiter". The default delimiter is a property of RD, i.e.
different descriptors can have different line delimiters. The
default value is '\n' (ASCII 10), and can be changed using the
'fd_set_delimiter' function (see below).
The function may signal the following exceptions:
e_range
RD lies outside of allowed range of resource descriptors.
e_eof
End of file encountered.
e_io
An I/O error occurred.
-- Built-in Function: void fd_set_delimiter (number FD, string DELIM)
Set new line delimiter for the descriptor FD, which must be in
opened state.
Default delimiter is a newline character (ASCII 10). The following
example shows how to change it to CRLF sequence:
fd_set_delimiter(fd, "\r\n")
-- Built-in Function: string fd_delimiter (number FD)
Returns the line delimiter string for FD.
The following example shows how 'mailfromd' I/O functions can be used
to automatically add IP addresses to an RBL zone:
set nsupdate_cmd
"/usr/bin/nsupdate -k /etc/bind/Kmail.+157+14657.private"
func block_address(string addr)
do
number fd
string domain
set fd open "|%nsupdate_cmd"
set domain revip(addr) . ".rbl.myzone.come"
write(fd, "prereq nxrrset %domain A\n"
"update add %domain 86400 A %addr\n\n"
done
The function 'revip' is defined in *note revip::.
File: mailfromd.info, Node: System functions, Next: Passwd functions, Prev: I
/O functions, Up: Library
5.25 System functions
===================== =====================
-- Built-in Function: boolean access (string PATHNAME, number MODE) -- Built-in Function: boolean access (string PATHNAME, number MODE)
Checks whether the calling process can access the file PATHNAME. Checks whether the calling process can access the file PATHNAME.
If PATHNAME is a symbolic link, it is dereferenced. The function If PATHNAME is a symbolic link, it is dereferenced. The function
returns 'True' if the file can be accessed and 'False' returns 'True' if the file can be accessed and 'False'
otherwise(1). otherwise(1).
Symbolic values for MODE are provided in module 'status': Symbolic values for MODE are provided in module 'status':
skipping to change at line 10129 skipping to change at line 10549
Set the umask to MASK & 0777. Return the previous value of the Set the umask to MASK & 0777. Return the previous value of the
mask. mask.
---------- Footnotes ---------- ---------- Footnotes ----------
(1) _Note_, that the return code is inverted in respect to the system (1) _Note_, that the return code is inverted in respect to the system
function 'access(2)'. function 'access(2)'.
File: mailfromd.info, Node: Passwd functions, Next: Sieve Interface, Prev: Sy stem functions, Up: Library File: mailfromd.info, Node: Passwd functions, Next: Sieve Interface, Prev: Sy stem functions, Up: Library
5.26 System User Database 5.27 System User Database
========================= =========================
-- Built-in Function: string getpwnam (string NAME) -- Built-in Function: string getpwnam (string NAME)
-- Built-in Function: string getpwuid (number UID) -- Built-in Function: string getpwuid (number UID)
Look for the user NAME ('getpwnam') or user ID UID ('getpwuid') in Look for the user NAME ('getpwnam') or user ID UID ('getpwuid') in
the system password database and return the corresponding record, the system password database and return the corresponding record,
if found. If not found, raise the 'e_not_found' exception. if found. If not found, raise the 'e_not_found' exception.
The returned record consists of six fields, separated by colon The returned record consists of six fields, separated by colon
sign: sign:
skipping to change at line 10168 skipping to change at line 10588
Following two functions can be used to test for existence of a key in Following two functions can be used to test for existence of a key in
the user database: the user database:
-- Built-in Function: boolean mappwnam (string NAME) -- Built-in Function: boolean mappwnam (string NAME)
-- Built-in Function: boolean mappwuid (number UID) -- Built-in Function: boolean mappwuid (number UID)
Return 'true' if NAME (or UID) is found in the system user Return 'true' if NAME (or UID) is found in the system user
database. database.
File: mailfromd.info, Node: Sieve Interface, Next: Interfaces to Third-Party P rograms, Prev: Passwd functions, Up: Library File: mailfromd.info, Node: Sieve Interface, Next: Interfaces to Third-Party P rograms, Prev: Passwd functions, Up: Library
5.27 Sieve Interface 5.28 Sieve Interface
==================== ====================
'Sieve' is a powerful mail filtering language, defined in RFC 3028. 'Sieve' is a powerful mail filtering language, defined in RFC 3028.
'Mailfromd' supports an extended form of this language. For a 'Mailfromd' supports an extended form of this language. For a
description of the language and available extensions, see *note Sieve description of the language and available extensions, see *note Sieve
Language: (mailutils)Sieve Language. Language: (mailutils)Sieve Language.
-- Built-in Function: boolean sieve (number MSG, string SCRIPT [, -- Built-in Function: boolean sieve (number MSG, string SCRIPT [,
number FLAGS, string FILE, number LINE]) number FLAGS, string FILE, number LINE])
Compile the Sieve program SCRIPT and execute it over the message Compile the Sieve program SCRIPT and execute it over the message
skipping to change at line 10302 skipping to change at line 10722
__file__, sieve_prog_line) __file__, sieve_prog_line)
discard discard
fi fi
done done
The actual Sieve program begins two lines below the 'sieve_prog_line' The actual Sieve program begins two lines below the 'sieve_prog_line'
constant definition, which is reflected in its initialization. constant definition, which is reflected in its initialization.
File: mailfromd.info, Node: Interfaces to Third-Party Programs, Next: Rate lim iting functions, Prev: Sieve Interface, Up: Library File: mailfromd.info, Node: Interfaces to Third-Party Programs, Next: Rate lim iting functions, Prev: Sieve Interface, Up: Library
5.28 Interfaces to Third-Party Programs 5.29 Interfaces to Third-Party Programs
======================================= =======================================
A set of functions is defined for interfacing with other filters via A set of functions is defined for interfacing with other filters via
TCP. Currently implemented are interfaces with 'SpamAssassin' 'spamd' TCP. Currently implemented are interfaces with 'SpamAssassin' 'spamd'
daemon and with 'ClamAV' anti-virus. daemon and with 'ClamAV' anti-virus.
Both interfaces work much the same way: the remote filter is Both interfaces work much the same way: the remote filter is
connected and the message is passed to it. If the remote filter connected and the message is passed to it. If the remote filter
confirms that the message matches its requirements, the function returns confirms that the message matches its requirements, the function returns
'true'. Notice that in practice that means that such a message _should 'true'. Notice that in practice that means that such a message _should
skipping to change at line 10349 skipping to change at line 10769
The description of the interface functions follows. The description of the interface functions follows.
* Menu: * Menu:
* SpamAssassin:: * SpamAssassin::
* DSPAM:: * DSPAM::
* ClamAV:: * ClamAV::
File: mailfromd.info, Node: SpamAssassin, Next: DSPAM, Up: Interfaces to Thir d-Party Programs File: mailfromd.info, Node: SpamAssassin, Next: DSPAM, Up: Interfaces to Thir d-Party Programs
5.28.1 SpamAssassin 5.29.1 SpamAssassin
------------------- -------------------
-- Built-in Function: boolean spamc (number MSG, string URL, number -- Built-in Function: boolean spamc (number MSG, string URL, number
PREC, number COMMAND) PREC, number COMMAND)
Send the message MSGt to the SpamAssassin daemon ('spamd') Send the message MSGt to the SpamAssassin daemon ('spamd')
listening on the given URL. The COMMAND argument identifies what listening on the given URL. The COMMAND argument identifies what
kind of processing is needed for the message. Allowed values are: kind of processing is needed for the message. Allowed values are:
SA_SYMBOLS SA_SYMBOLS
Process the message and return 1 or 0 depending on whether it Process the message and return 1 or 0 depending on whether it
skipping to change at line 10494 skipping to change at line 10914
COMMAND) COMMAND)
Additional interface to the 'spamc' function, provided for backward Additional interface to the 'spamc' function, provided for backward
compatibility. It is equivalent to compatibility. It is equivalent to
spamc(current_message(), URL, PREC, COMMAND) spamc(current_message(), URL, PREC, COMMAND)
If COMMAND is not supplied, 'SA_SYMBOLS' is used. If COMMAND is not supplied, 'SA_SYMBOLS' is used.
File: mailfromd.info, Node: DSPAM, Next: ClamAV, Prev: SpamAssassin, Up: Int erfaces to Third-Party Programs File: mailfromd.info, Node: DSPAM, Next: ClamAV, Prev: SpamAssassin, Up: Int erfaces to Third-Party Programs
5.28.2 DSPAM 5.29.2 DSPAM
------------ ------------
DSPAM is a statistical spam filter distributed under the terms of the DSPAM is a statistical spam filter distributed under the terms of the
GNU General Public License. It is available from GNU General Public License. It is available from
<http://dspam.sourceforge.net>. <http://dspam.sourceforge.net>.
MFL provides an interface to DSPAM functionality if the 'libdspam' MFL provides an interface to DSPAM functionality if the 'libdspam'
library is installed and 'mailfromd' is linked with it. The 'm4' macro library is installed and 'mailfromd' is linked with it. The 'm4' macro
'WITH_DSPAM' is defined if it is so. 'WITH_DSPAM' is defined if it is so.
skipping to change at line 10626 skipping to change at line 11046
done done
* Menu: * Menu:
* flags-dspam:: DSPAM Operation Modes and Flags. * flags-dspam:: DSPAM Operation Modes and Flags.
* class-dspam:: DSPAM Class and Source Bits. * class-dspam:: DSPAM Class and Source Bits.
* vars-dspam:: DSPAM Global Variables. * vars-dspam:: DSPAM Global Variables.
File: mailfromd.info, Node: flags-dspam, Next: class-dspam, Up: DSPAM File: mailfromd.info, Node: flags-dspam, Next: class-dspam, Up: DSPAM
5.28.2.1 DSPAM Operation Modes and Flags. 5.29.2.1 DSPAM Operation Modes and Flags.
......................................... .........................................
The tables below summarize flags which can be used in the MODE_FLAGS The tables below summarize flags which can be used in the MODE_FLAGS
argument to 'dspam' function. The argument is a bitwise OR of argument to 'dspam' function. The argument is a bitwise OR of
"operation mode", "flags", "tokenizer" and "training mode" bits. Only "operation mode", "flags", "tokenizer" and "training mode" bits. Only
one operation mode bit can be used. Flags, tokenizer and training mode one operation mode bit can be used. Flags, tokenizer and training mode
are optional. Any number of flags, but no more than one tokenizer type are optional. Any number of flags, but no more than one tokenizer type
and one training mode bit are allowed. Missing values will be supplied and one training mode bit are allowed. Missing values will be supplied
from the configuration file. from the configuration file.
skipping to change at line 10671 skipping to change at line 11091
Mode Meaning Mode Meaning
-------------------------------------------------------------------------- --------------------------------------------------------------------------
DST_TEFT Train Everything DST_TEFT Train Everything
DST_TOE Train-on-Error DST_TOE Train-on-Error
DST_TUM Train-until-Mature DST_TUM Train-until-Mature
Table 5.5: DSPAM Training Modes Table 5.5: DSPAM Training Modes
File: mailfromd.info, Node: class-dspam, Next: vars-dspam, Prev: flags-dspam, Up: DSPAM File: mailfromd.info, Node: class-dspam, Next: vars-dspam, Prev: flags-dspam, Up: DSPAM
5.28.2.2 DSPAM Class and Source Bits 5.29.2.2 DSPAM Class and Source Bits
.................................... ....................................
The tables below summarize flags which can be used in the CLASS_SOURCE The tables below summarize flags which can be used in the CLASS_SOURCE
argument to 'dspam' function. The argument is a bitwise OR of argument to 'dspam' function. The argument is a bitwise OR of
"classification" and "source" bits. At most one classification and one "classification" and "source" bits. At most one classification and one
source bit can be given. If not supplied, 'DSR_NONE|DSS_NONE' is used. source bit can be given. If not supplied, 'DSR_NONE|DSS_NONE' is used.
The classification flags are also used as the return code, as shown The classification flags are also used as the return code, as shown
in the following table. in the following table.
skipping to change at line 10702 skipping to change at line 11122
DSS_NONE No classification source (use only with DSS_NONE No classification source (use only with
DSR_NONE) DSR_NONE)
DSS_ERROR Misclassification by libdspam DSS_ERROR Misclassification by libdspam
DSS_CORPUS Message came from a corpus feed DSS_CORPUS Message came from a corpus feed
DSS_INOCULATION Message inoculation DSS_INOCULATION Message inoculation
Table 5.7: DSPAM Source Table 5.7: DSPAM Source
File: mailfromd.info, Node: vars-dspam, Prev: class-dspam, Up: DSPAM File: mailfromd.info, Node: vars-dspam, Prev: class-dspam, Up: DSPAM
5.28.2.3 DSPAM Global Variables 5.29.2.3 DSPAM Global Variables
............................... ...............................
Following global variables affect the behavior of the 'dspam' function: Following global variables affect the behavior of the 'dspam' function:
-- Built-in variable: string dspam_config -- Built-in variable: string dspam_config
Name of the DSPAM configuration file. You must set this variable Name of the DSPAM configuration file. You must set this variable
prior to calling 'dspam'. There is no default value. prior to calling 'dspam'. There is no default value.
-- Built-in variable: string dspam_profile -- Built-in variable: string dspam_profile
Name of the configuration profile to be used. If empty (the Name of the configuration profile to be used. If empty (the
skipping to change at line 10749 skipping to change at line 11169
resulting number. *Note dspam probability and confidence::, for resulting number. *Note dspam probability and confidence::, for
more information and examples. more information and examples.
-- Built-in variable: number dspam_confidence -- Built-in variable: number dspam_confidence
Spam confidence converted to integer using the same algorithm as Spam confidence converted to integer using the same algorithm as
for 'dspam_probability'. *Note dspam probability and confidence::, for 'dspam_probability'. *Note dspam probability and confidence::,
for more information and examples. for more information and examples.
File: mailfromd.info, Node: ClamAV, Prev: DSPAM, Up: Interfaces to Third-Part y Programs File: mailfromd.info, Node: ClamAV, Prev: DSPAM, Up: Interfaces to Third-Part y Programs
5.28.3 ClamAV 5.29.3 ClamAV
------------- -------------
-- Built-in Function: boolean clamav (number MSG, string URL) -- Built-in Function: boolean clamav (number MSG, string URL)
Pass the message MSG to the ClamAV daemon at URL. Return 'true' if Pass the message MSG to the ClamAV daemon at URL. Return 'true' if
it detects a virus in it. Return virus name in 'clamav_virus_name' it detects a virus in it. Return virus name in 'clamav_virus_name'
global variable. global variable.
The 'clamav' function can signal the following exceptions: The 'clamav' function can signal the following exceptions:
'e_failure' if failed to connect to the server, 'e_url' if the 'e_failure' if failed to connect to the server, 'e_url' if the
supplied URL is invalid and 'e_range' if the supplied port number supplied URL is invalid and 'e_range' if the supplied port number
skipping to change at line 10773 skipping to change at line 11193
prog eom prog eom
do do
if clamav(current_message(), "tcp://192.168.10.1:6300") if clamav(current_message(), "tcp://192.168.10.1:6300")
reject 550 5.7.0 "Infected with %clamav_virus_name" reject 550 5.7.0 "Infected with %clamav_virus_name"
fi fi
done done
File: mailfromd.info, Node: Rate limiting functions, Next: Greylisting functio ns, Prev: Interfaces to Third-Party Programs, Up: Library File: mailfromd.info, Node: Rate limiting functions, Next: Greylisting functio ns, Prev: Interfaces to Third-Party Programs, Up: Library
5.29 Rate limiting functions 5.30 Rate limiting functions
============================ ============================
-- Built-in Function: number rate (string KEY, number SAMPLE-INTERVAL, -- Built-in Function: number rate (string KEY, number SAMPLE-INTERVAL,
[number MIN-SAMPLES, number THRESHOLD]) [number MIN-SAMPLES, number THRESHOLD])
Returns the mail sending rate for KEY per SAMPLE-INTERVAL. Returns the mail sending rate for KEY per SAMPLE-INTERVAL.
Optional MIN-SAMPLES, if supplied, specifies the minimal number of Optional MIN-SAMPLES, if supplied, specifies the minimal number of
mails needed to obtain the statistics. The default is 2. Optional mails needed to obtain the statistics. The default is 2. Optional
THRESHOLD controls rate database updates. If the observed rate THRESHOLD controls rate database updates. If the observed rate
(per SAMPLE-INTERVAL seconds) is higher than the THRESHOLD, the hit (per SAMPLE-INTERVAL seconds) is higher than the THRESHOLD, the hit
skipping to change at line 10835 skipping to change at line 11255
For a detailed description of the Token Bucket Algorithm and its For a detailed description of the Token Bucket Algorithm and its
use to limit mail rates, see *note TBF::. use to limit mail rates, see *note TBF::.
---------- Footnotes ---------- ---------- Footnotes ----------
(1) It is made optional in order to provide backward compatibility (1) It is made optional in order to provide backward compatibility
with the releases of mailfromd prior to 5.0.93. with the releases of mailfromd prior to 5.0.93.
File: mailfromd.info, Node: Greylisting functions, Next: Special test function s, Prev: Rate limiting functions, Up: Library File: mailfromd.info, Node: Greylisting functions, Next: Special test function s, Prev: Rate limiting functions, Up: Library
5.30 Greylisting functions 5.31 Greylisting functions
========================== ==========================
-- Built-in Function: boolean greylist (string KEY, number INTERVAL) -- Built-in Function: boolean greylist (string KEY, number INTERVAL)
Returns 'True' if the KEY is found in the greylist database Returns 'True' if the KEY is found in the greylist database
(controlled by 'database greylist' configuration file statement, (controlled by 'database greylist' configuration file statement,
*note conf-database::). The argument INTERVAL gives the *note conf-database::). The argument INTERVAL gives the
greylisting interval in seconds. The function stores the number of greylisting interval in seconds. The function stores the number of
seconds left to the end of greylisting period in the global seconds left to the end of greylisting period in the global
variable 'greylist_seconds_left'. *Note Greylisting::, for a variable 'greylist_seconds_left'. *Note Greylisting::, for a
skipping to change at line 10863 skipping to change at line 11283
the end of greylisting period in the global variable the end of greylisting period in the global variable
'greylist_seconds_left'. 'greylist_seconds_left'.
This function is available only if Con Tassios implementation of This function is available only if Con Tassios implementation of
greylisting is used. *Note greylisting types::, for a discussion greylisting is used. *Note greylisting types::, for a discussion
of available greylisting implementations. *Note greylist::, for a of available greylisting implementations. *Note greylist::, for a
way to switch to Con Tassios implementation. way to switch to Con Tassios implementation.
File: mailfromd.info, Node: Special test functions, Next: Mail Sending Functio ns, Prev: Greylisting functions, Up: Library File: mailfromd.info, Node: Special test functions, Next: Mail Sending Functio ns, Prev: Greylisting functions, Up: Library
5.31 Special Test Functions 5.32 Special Test Functions
=========================== ===========================
-- Library Function: boolean portprobe (string HOST, [number PORT]) -- Library Function: boolean portprobe (string HOST, [number PORT])
-- Library Function: boolean listens (string HOST, [number PORT]) -- Library Function: boolean listens (string HOST, [number PORT])
Returns 'true' if the IP address or host name given by HOST Returns 'true' if the IP address or host name given by HOST
argument listens on the port number PORT (default 25). argument listens on the port number PORT (default 25).
This function is defined in the module 'portprobe'. This function is defined in the module 'portprobe'.
-- Built-in Function: boolean validuser (string NAME) -- Built-in Function: boolean validuser (string NAME)
skipping to change at line 10928 skipping to change at line 11348
HELO_ARGNOIP ARG is in square brackets, but it is not HELO_ARGNOIP ARG is in square brackets, but it is not
an IP address. an IP address.
HELO_ARGINVALID ARG is not an IP address and does not HELO_ARGINVALID ARG is not an IP address and does not
resolve to one. resolve to one.
HELO_MYSERVERIP ARG resolves to our server IP. HELO_MYSERVERIP ARG resolves to our server IP.
HELO_IPMISMATCH ARG does not resolve to the remote client HELO_IPMISMATCH ARG does not resolve to the remote client
IP address. IP address.
File: mailfromd.info, Node: Mail Sending Functions, Next: Blacklisting Functio ns, Prev: Special test functions, Up: Library File: mailfromd.info, Node: Mail Sending Functions, Next: Blacklisting Functio ns, Prev: Special test functions, Up: Library
5.32 Mail Sending Functions 5.33 Mail Sending Functions
=========================== ===========================
The mail sending functions are new interfaces, introduced in version The mail sending functions are new interfaces, introduced in version
3.1. 3.1.
The underlying mechanism for sending mail, called "mailer", is The underlying mechanism for sending mail, called "mailer", is
specified by '--mailer' command line option. This global setting can be specified by '--mailer' command line option. This global setting can be
overridden using the last optional argument to a particular function. overridden using the last optional argument to a particular function.
In any case, the mailer is specified in the form of a URL. In any case, the mailer is specified in the form of a URL.
skipping to change at line 11119 skipping to change at line 11539
Notification text. Notification text.
HEADERS HEADERS
Message headers Message headers
FROM FROM
Sender address. Sender address.
File: mailfromd.info, Node: Blacklisting Functions, Next: SPF Functions, Prev : Mail Sending Functions, Up: Library File: mailfromd.info, Node: Blacklisting Functions, Next: SPF Functions, Prev : Mail Sending Functions, Up: Library
5.33 Blacklisting Functions 5.34 Blacklisting Functions
=========================== ===========================
The functions described in this subsection allow to check whether the The functions described in this subsection allow to check whether the
given IP address is listed in certain "black list" DNS zone. given IP address is listed in certain "black list" DNS zone.
-- Library Function: boolean match_dnsbl (string ADDRESS, string ZONE, -- Library Function: boolean match_dnsbl (string ADDRESS, string ZONE,
string RANGE) string RANGE)
This function looks up ADDRESS in the DNS blacklist zone ZONE and This function looks up ADDRESS in the DNS blacklist zone ZONE and
checks if the return falls into the given RANGE of IP addresses. checks if the return falls into the given RANGE of IP addresses.
skipping to change at line 11184 skipping to change at line 11604
it is '$f') it is '$f')
ZONE ZONE
Domain name of the RHS DNS blacklist zone. Domain name of the RHS DNS blacklist zone.
RANGE RANGE
The range of IP addresses in CIDR notation. The range of IP addresses in CIDR notation.
File: mailfromd.info, Node: SPF Functions, Next: DKIM, Prev: Blacklisting Fun ctions, Up: Library File: mailfromd.info, Node: SPF Functions, Next: DKIM, Prev: Blacklisting Fun ctions, Up: Library
5.34 SPF Functions 5.35 SPF Functions
================== ==================
"Sender Policy Framework", or SPF for short, is an extension to SMTP "Sender Policy Framework", or SPF for short, is an extension to SMTP
protocol that allows to identify forged identities supplied with the protocol that allows to identify forged identities supplied with the
'MAIL FROM' and 'HELO' commands. The framework is explained in detail 'MAIL FROM' and 'HELO' commands. The framework is explained in detail
in RFC 4408 (<http://tools.ietf.org/html/rfc4408>) and on the SPF in RFC 4408 (<http://tools.ietf.org/html/rfc4408>) and on the SPF
Project Site (http://www.openspf.org/). The following description is a Project Site (http://www.openspf.org/). The following description is a
short introduction only, and the users are encouraged to refer to the short introduction only, and the users are encouraged to refer to the
original specification for the detailed description of the framework. original specification for the detailed description of the framework.
skipping to change at line 11461 skipping to change at line 11881
valid SPF macros (see RFC 4408 valid SPF macros (see RFC 4408
(http://tools.ietf.org/html/rfc4408), chapter 8), for example: (http://tools.ietf.org/html/rfc4408), chapter 8), for example:
set spf_explanation_prefix "%{o} explains: " set spf_explanation_prefix "%{o} explains: "
The default value is '""' (an empty string). The default value is '""' (an empty string).
---------- Footnotes ---------- ---------- Footnotes ----------
(1) Although RFC 4408 introduces a special 'SPF' record type for this (1) Although RFC 4408 introduces a special 'SPF' record type for this
purpose, it is not yet widely used. As of version 8.11, MFL does not purpose, it is not yet widely used. As of version 8.12, MFL does not
support 'SPF' DNS records. support 'SPF' DNS records.
File: mailfromd.info, Node: DKIM, Next: Sockmaps, Prev: SPF Functions, Up: L ibrary File: mailfromd.info, Node: DKIM, Next: Sockmaps, Prev: SPF Functions, Up: L ibrary
5.35 DKIM 5.36 DKIM
========= =========
DKIM or "DomainKeys Identified Mail" is an email authentication method DKIM or "DomainKeys Identified Mail" is an email authentication method
that allows recipients to verify if an email was authorized by the owner that allows recipients to verify if an email was authorized by the owner
of the domain that email claims to originate from. It does so by adding of the domain that email claims to originate from. It does so by adding
a digital signature which is verified using a public key published as a a digital signature which is verified using a public key published as a
DNS TXT record. For technical details about DKIM, please refer to RFC DNS TXT record. For technical details about DKIM, please refer to RFC
6376 (<http://tools.ietf.org/html/rfc6376>). 6376 (<http://tools.ietf.org/html/rfc6376>).
MFL provides functions for DKIM signing and verification. MFL provides functions for DKIM signing and verification.
skipping to change at line 11750 skipping to change at line 12170
*Note Message modification queue::, for a discussion of the message *Note Message modification queue::, for a discussion of the message
modification queue. modification queue.
* Menu: * Menu:
* Setting up a DKIM record:: * Setting up a DKIM record::
File: mailfromd.info, Node: Setting up a DKIM record, Up: DKIM File: mailfromd.info, Node: Setting up a DKIM record, Up: DKIM
5.35.1 Setting up a DKIM record 5.36.1 Setting up a DKIM record
------------------------------- -------------------------------
Follow these steps to set up your own DKIM record: Follow these steps to set up your own DKIM record:
1. Generate the key pair Use the 'openssl genrsa' command. Run: 1. Generate the key pair Use the 'openssl genrsa' command. Run:
openssl genrsa -out private.pem 2048 openssl genrsa -out private.pem 2048
The last argument is the size of the private key to generate in The last argument is the size of the private key to generate in
bits. bits.
skipping to change at line 11801 skipping to change at line 12221
recommended. More tags can be added as needed. In particular, recommended. More tags can be added as needed. In particular,
while testing the DKIM support, it is advisable to add the 't=y' while testing the DKIM support, it is advisable to add the 't=y'
tag. tag.
---------- Footnotes ---------- ---------- Footnotes ----------
(1) <https://tools.ietf.org/html/rfc4871> (1) <https://tools.ietf.org/html/rfc4871>
File: mailfromd.info, Node: Sockmaps, Next: NLS Functions, Prev: DKIM, Up: L ibrary File: mailfromd.info, Node: Sockmaps, Next: NLS Functions, Prev: DKIM, Up: L ibrary
5.36 Sockmap Functions 5.37 Sockmap Functions
====================== ======================
Socket map ("sockmap" for short) is a special type of database used in Socket map ("sockmap" for short) is a special type of database used in
Sendmail and MeTA1. It uses a simple server/client protocol over INET Sendmail and MeTA1. It uses a simple server/client protocol over INET
or UNIX stream sockets. The server listens on a socket for queries. or UNIX stream sockets. The server listens on a socket for queries.
The client connects to the server and sends it a query, consisting of a The client connects to the server and sends it a query, consisting of a
"map name" and a "key" separated by a single space. Both map name and "map name" and a "key" separated by a single space. Both map name and
key are sequences of non-whitespace characters. The map name serves to key are sequences of non-whitespace characters. The map name serves to
identify the type of the query. The server replies with a response identify the type of the query. The server replies with a response
consisting of a "status indicator" and "result", separated by a single consisting of a "status indicator" and "result", separated by a single
skipping to change at line 11857 skipping to change at line 12277
close(fd) close(fd)
-- Library Function: string sockmap_single_lookup (string URL, string -- Library Function: string sockmap_single_lookup (string URL, string
MAP, string KEY) MAP, string KEY)
This function connects to the sockmap identified by the URL, This function connects to the sockmap identified by the URL,
queries for KEY in MAP and closes the connection. It is useful queries for KEY in MAP and closes the connection. It is useful
when you need to perform only a single lookup on the sockmap. when you need to perform only a single lookup on the sockmap.
File: mailfromd.info, Node: NLS Functions, Next: Syslog Interface, Prev: Sock maps, Up: Library File: mailfromd.info, Node: NLS Functions, Next: Syslog Interface, Prev: Sock maps, Up: Library
5.37 National Language Support Functions 5.38 National Language Support Functions
======================================== ========================================
The "National Language Support" functions allow you to write your The "National Language Support" functions allow you to write your
scripts in such a way, that any textual messages they display are scripts in such a way, that any textual messages they display are
automatically translated to your native language, or, more precisely, to automatically translated to your native language, or, more precisely, to
the language required by your current locale. the language required by your current locale.
This section assumes the reader is familiar with the concepts of This section assumes the reader is familiar with the concepts of
program "internationalization" and "localization". If not, please refer program "internationalization" and "localization". If not, please refer
to *note The Purpose of GNU 'gettext': (gettext)Why, before reading to *note The Purpose of GNU 'gettext': (gettext)Why, before reading
skipping to change at line 11983 skipping to change at line 12403
the language specified by the current locale, by looking up the the language specified by the current locale, by looking up the
appropriate singular or plural form of the translation in a message appropriate singular or plural form of the translation in a message
catalog, set for the current textual domain. catalog, set for the current textual domain.
*Note Additional functions for plural forms: (gettext)Plural forms, *Note Additional functions for plural forms: (gettext)Plural forms,
for a discussion of the plural form handling in different for a discussion of the plural form handling in different
languages. languages.
File: mailfromd.info, Node: Syslog Interface, Next: Debugging Functions, Prev : NLS Functions, Up: Library File: mailfromd.info, Node: Syslog Interface, Next: Debugging Functions, Prev : NLS Functions, Up: Library
5.38 Syslog Interface 5.39 Syslog Interface
===================== =====================
The basic means for outputting diagnostic messages is the 'echo' The basic means for outputting diagnostic messages is the 'echo'
instruction (*note Echo::), which sends its arguments to the currently instruction (*note Echo::), which sends its arguments to the currently
established logging channel. In daemon mode, the latter is normally established logging channel. In daemon mode, the latter is normally
connected to syslog, so any echoed messages are sent there with the connected to syslog, so any echoed messages are sent there with the
facility selected in mailfromd configuration and priority 'info'. facility selected in mailfromd configuration and priority 'info'.
If you want to send a message to another facility and/or priority, If you want to send a message to another facility and/or priority,
use the 'syslog' function: use the 'syslog' function:
skipping to change at line 12014 skipping to change at line 12434
'LOG_USER', 'LOG_MAIL', 'LOG_DAEMON', 'LOG_AUTH', 'LOG_SYSLOG', 'LOG_USER', 'LOG_MAIL', 'LOG_DAEMON', 'LOG_AUTH', 'LOG_SYSLOG',
'LOG_LPR', 'LOG_NEWS', 'LOG_UUCP', 'LOG_CRON', 'LOG_AUTHPRIV', 'LOG_FTP' 'LOG_LPR', 'LOG_NEWS', 'LOG_UUCP', 'LOG_CRON', 'LOG_AUTHPRIV', 'LOG_FTP'
and 'LOG_LOCAL0' through 'LOG_LOCAL7' and 'LOG_LOCAL0' through 'LOG_LOCAL7'
The declared severity levels are: 'LOG_EMERG', 'LOG_ALERT', The declared severity levels are: 'LOG_EMERG', 'LOG_ALERT',
'LOG_CRIT', 'LOG_ERR', 'LOG_WARNING', 'LOG_NOTICE', 'LOG_INFO' and 'LOG_CRIT', 'LOG_ERR', 'LOG_WARNING', 'LOG_NOTICE', 'LOG_INFO' and
'LOG_DEBUG'. 'LOG_DEBUG'.
File: mailfromd.info, Node: Debugging Functions, Prev: Syslog Interface, Up: Library File: mailfromd.info, Node: Debugging Functions, Prev: Syslog Interface, Up: Library
5.39 Debugging Functions 5.40 Debugging Functions
======================== ========================
These functions are designed for debugging the MFL programs. These functions are designed for debugging the MFL programs.
-- Built-in Function: void debug (string SPEC) -- Built-in Function: void debug (string SPEC)
Enable debugging. The value of SPEC sets the debugging level. Enable debugging. The value of SPEC sets the debugging level.
*Note debugging level specification::, for a description of its *Note debugging level specification::, for a description of its
format. format.
For compatibility with previous versions, this function is also For compatibility with previous versions, this function is also
skipping to change at line 12566 skipping to change at line 12986
Don't use it for anything else but for debugging! Don't use it for anything else but for debugging!
-- server: reuseaddr bool -- server: reuseaddr bool
When set to 'yes', 'mailfromd' will attempt to reuse existing When set to 'yes', 'mailfromd' will attempt to reuse existing
socket addresses. This is the default behavior. socket addresses. This is the default behavior.
If the server TYPE is 'callout', the following statement is also If the server TYPE is 'callout', the following statement is also
allowed: allowed:
-- server: option LIST -- server: option LIST
Configures server options. As of version 8.11 only one option is Configures server options. As of version 8.12 only one option is
defined: defined:
default default
Mark this server as the default one. This means it will be Mark this server as the default one. This means it will be
used by every milter server that doesn't define the used by every milter server that doesn't define the
'callout-url' statement. 'callout-url' statement.
-- server: default bool -- server: default bool
When set to 'yes', this server is marked as a default callout When set to 'yes', this server is marked as a default callout
server for all milter servers declared in the configuration. This server for all milter servers declared in the configuration. This
skipping to change at line 14437 skipping to change at line 14857
* command summary:: * command summary::
* option summary:: * option summary::
File: mailfromd.info, Node: interactive mode, Next: expect commands, Up: mtas im File: mailfromd.info, Node: interactive mode, Next: expect commands, Up: mtas im
12.1 'mtasim' interactive mode mode 12.1 'mtasim' interactive mode mode
=================================== ===================================
If you start 'mtasim' without options, you will see the following: If you start 'mtasim' without options, you will see the following:
220 mtasim (mailfromd 8.11) ready 220 mtasim (mailfromd 8.12) ready
(mtasim) _ (mtasim) _
The first line is an usual RFC 2821 reply. The second one is a The first line is an usual RFC 2821 reply. The second one is a
prompt, indicating that 'mtasim' is in interactive mode and ready for prompt, indicating that 'mtasim' is in interactive mode and ready for
input. The prompt appears only if the package is compiled with GNU input. The prompt appears only if the package is compiled with GNU
Readline and 'mtasim' determines that its standard input is connected to Readline and 'mtasim' determines that its standard input is connected to
the terminal. This is called "interactive mode" and is intended to save the terminal. This is called "interactive mode" and is intended to save
the human user some typing by offering line editing and history the human user some typing by offering line editing and history
facilities (*note Command Line Editing: (readline)Command Line facilities (*note Command Line Editing: (readline)Command Line
Editing.). If the package is compiled without GNU Readline, you will Editing.). If the package is compiled without GNU Readline, you will
see: see:
220 mtasim (mailfromd 8.11) ready 220 mtasim (mailfromd 8.12) ready
_ _
where '_' represents the cursor. Whatever the mode, 'mtasim' will wait where '_' represents the cursor. Whatever the mode, 'mtasim' will wait
for further input. for further input.
The input is expected to consist of valid SMTP commands and special The input is expected to consist of valid SMTP commands and special
'mtasim' statements. The utility will act exactly like a RFC 'mtasim' statements. The utility will act exactly like a RFC
2821-compliant MTA, except that it will not do actual message delivery 2821-compliant MTA, except that it will not do actual message delivery
or relaying. Try typing 'HELP' to get the list of supported commands. or relaying. Try typing 'HELP' to get the list of supported commands.
You will see something similar to: You will see something similar to:
250-mtasim (mailfromd 8.11); supported SMTP commands: 250-mtasim (mailfromd 8.12); supported SMTP commands:
250- EHLO 250- EHLO
250- HELO 250- HELO
250- MAIL 250- MAIL
250- RCPT 250- RCPT
250- DATA 250- DATA
250- HELP 250- HELP
250- QUIT 250- QUIT
250- HELP 250- HELP
250 RSET 250 RSET
You can try a simple SMTP session now: You can try a simple SMTP session now:
220 mtasim (mailfromd 8.11) ready 220 mtasim (mailfromd 8.12) ready
(mtasim) ehlo localhost (mtasim) ehlo localhost
250-pleased to meet you 250-pleased to meet you
250 HELP 250 HELP
(mtasim) mail from: <me@localhost> (mtasim) mail from: <me@localhost>
250 Sender OK 250 Sender OK
(mtasim) rcpt to: <him@domain> (mtasim) rcpt to: <him@domain>
250 Recipient OK 250 Recipient OK
(mtasim) data (mtasim) data
354 Enter mail, end with `.' on a line by itself 354 Enter mail, end with `.' on a line by itself
(mtasim) . (mtasim) .
skipping to change at line 14508 skipping to change at line 14928
specification::, for a short description), or as a full 'sendmail.cf' specification::, for a short description), or as a full 'sendmail.cf'
style 'X' command, in which case it allows to set timeouts as well: style 'X' command, in which case it allows to set timeouts as well:
$ mtasim --port=inet:999@localhost $ mtasim --port=inet:999@localhost
# This is also valid: # This is also valid:
$ mtasim --port='mailfrom, S=inet:999@localhost, F=T, T=C:100m;R:180s' $ mtasim --port='mailfrom, S=inet:999@localhost, F=T, T=C:100m;R:180s'
If the milter is actually listening on this port, 'mtasim' will If the milter is actually listening on this port, 'mtasim' will
connect to it and you will get the following initial prompt: connect to it and you will get the following initial prompt:
220-mtasim (mailfromd 8.11) ready 220-mtasim (mailfromd 8.12) ready
220 Connected to milter inet://localhost:999 220 Connected to milter inet://localhost:999
(mtasim) (mtasim)
Notice, that it makes no difference what implementation is listening Notice, that it makes no difference what implementation is listening
on that port, it may well be some other filter, not necessarily on that port, it may well be some other filter, not necessarily
'mailfromd'. 'mailfromd'.
However, let's return to 'mailfromd'. If you do not want to connect However, let's return to 'mailfromd'. If you do not want to connect
to an existing 'mailfromd' instance, but prefer instead to create a new to an existing 'mailfromd' instance, but prefer instead to create a new
one and run your tests with it (a preferred way, if you already have a one and run your tests with it (a preferred way, if you already have a
skipping to change at line 14535 skipping to change at line 14955
2. Spawn a new instance of 'mailfromd'. The arguments and options for 2. Spawn a new instance of 'mailfromd'. The arguments and options for
that instance may be given in the invocation of 'mtasim' after a that instance may be given in the invocation of 'mtasim' after a
double-dash marker ('--') double-dash marker ('--')
3. Connect to that filter. 3. Connect to that filter.
When 'mtasim' exits, it terminates the subsidiary 'mailfromd' process When 'mtasim' exits, it terminates the subsidiary 'mailfromd' process
and removes the temporary directory it has created. For example, the and removes the temporary directory it has created. For example, the
following command will start 'mailfromd -I. -I../mflib test.rc': following command will start 'mailfromd -I. -I../mflib test.rc':
$ mtasim -Xauto -- -I. -I../mflib test.rc $ mtasim -Xauto -- -I. -I../mflib test.rc
220-mtasim (mailfromd 8.11) ready 220-mtasim (mailfromd 8.12) ready
220 Connected to milter unix:/tmp/mtasim-j6tRLC/socket 220 Connected to milter unix:/tmp/mtasim-j6tRLC/socket
(mtasim) (mtasim)
The '/tmp/mtasim-j6tRLC' directory and any files within it will exist The '/tmp/mtasim-j6tRLC' directory and any files within it will exist
as long as 'mtasim' is running and will be removed when you exit from as long as 'mtasim' is running and will be removed when you exit from
it.(1) You can also instruct the subsidiary 'mailfromd' to use this it.(1) You can also instruct the subsidiary 'mailfromd' to use this
directory as its state directory (*note statedir::). This is done by directory as its state directory (*note statedir::). This is done by
'--statedir' command line option: '--statedir' command line option:
$ mtasim -Xauto --statedir -- -I. -I../mflib test.rc $ mtasim -Xauto --statedir -- -I. -I../mflib test.rc
skipping to change at line 14561 skipping to change at line 14981
especially if used with '-Xauto' and '--statedir'. The 'mailfromd' especially if used with '-Xauto' and '--statedir'. The 'mailfromd'
utility executed by it will switch to privileges of the user given in utility executed by it will switch to privileges of the user given in
its configuration (*note Starting and Stopping::) and will not be able its configuration (*note Starting and Stopping::) and will not be able
to create data in its state directory, because the latter was created to create data in its state directory, because the latter was created
using 'root' as owner. To help in this case, 'mtasim' understands using 'root' as owner. To help in this case, 'mtasim' understands
'--user' and '--group' command line options, that have the same meaning '--user' and '--group' command line options, that have the same meaning
as for 'mailfromd'. as for 'mailfromd'.
Now, let's try 'HELP' command again: Now, let's try 'HELP' command again:
250-mtasim (mailfromd 8.11); supported SMTP commands: 250-mtasim (mailfromd 8.12); supported SMTP commands:
250- EHLO 250- EHLO
250- HELO 250- HELO
250- MAIL 250- MAIL
250- RCPT 250- RCPT
250- DATA 250- DATA
250- HELP 250- HELP
250- QUIT 250- QUIT
250- HELP 250- HELP
250- RSET 250- RSET
250-Supported administrative commands: 250-Supported administrative commands:
skipping to change at line 14662 skipping to change at line 15082
\S inet6 relay.gnu.org.ua 2001:470:1f0a:1be1::2 34567 \S inet6 relay.gnu.org.ua 2001:470:1f0a:1be1::2 34567
Sender socket address can also be configured from the command line Sender socket address can also be configured from the command line
(*note sender-socket: option summary.). (*note sender-socket: option summary.).
Now, let's try a real-life example. Suppose you wish to test the Now, let's try a real-life example. Suppose you wish to test the
greylisting functionality of the filter script described in *note Filter greylisting functionality of the filter script described in *note Filter
Script Example::. To do this, you start 'mtasim': Script Example::. To do this, you start 'mtasim':
$ mtasim -Xauto -- -I. -I../mflib test.rc $ mtasim -Xauto -- -I. -I../mflib test.rc
220-mtasim (mailfromd 8.11) ready 220-mtasim (mailfromd 8.12) ready
220 Connected to milter unix:/tmp/mtasim-ak3DEc/socket 220 Connected to milter unix:/tmp/mtasim-ak3DEc/socket
(mtasim) (mtasim)
The script in 'test.rc' needs to know 'client_addr' macro, so you The script in 'test.rc' needs to know 'client_addr' macro, so you
supply it to 'mtasim': supply it to 'mtasim':
(mtasim) \Dclient_addr=10.10.1.13 (mtasim) \Dclient_addr=10.10.1.13
Now, you try an SMTP session: Now, you try an SMTP session:
skipping to change at line 15117 skipping to change at line 15537
two are combined into a single 'data' stage. This comes unnoticed to two are combined into a single 'data' stage. This comes unnoticed to
mailfromd scripts, because 'pmult' takes care to invoke right Milter mailfromd scripts, because 'pmult' takes care to invoke right Milter
handlers within the single 'data' Pmilter state. Therefore in the handlers within the single 'data' Pmilter state. Therefore in the
discussion that follows we will refer to Mailfromd handlers, rather than discussion that follows we will refer to Mailfromd handlers, rather than
to Pmilter stages. to Pmilter stages.
The most important standard Milter macros are always provided by The most important standard Milter macros are always provided by
'pmult' itself. These are: 'pmult' itself. These are:
client_addr client_addr
The IP address of the SMTP client. As of version 8.11, only IPv4 The IP address of the SMTP client. As of version 8.12, only IPv4
addresses are supported. Defined in all handlers. addresses are supported. Defined in all handlers.
client_port client_port
The port number of the SMTP client. Defined in all handlers. The port number of the SMTP client. Defined in all handlers.
i i
MeTA1 session ID. Defined in all handlers. MeTA1 session ID. Defined in all handlers.
f f
The envelope sender (from) address. Defined in 'envfrom' and The envelope sender (from) address. Defined in 'envfrom' and
subsequent handlers. subsequent handlers.
nbadrcpts nbadrcpts
The number of bad recipients for a single message. Defined in The number of bad recipients for a single message. Defined in
'envfrom' and 'envrcpt' handlers. 'envfrom' and 'envrcpt' handlers.
ntries ntries
The number of delivery attempts. As of version 8.11 it is always The number of delivery attempts. As of version 8.12 it is always
'1'. Defined in 'envfrom' and subsequent handlers. '1'. Defined in 'envfrom' and subsequent handlers.
nrcpts nrcpts
The number of validated recipients for a single message. Defined The number of validated recipients for a single message. Defined
in 'envfrom' and 'envrcpt' handlers. in 'envfrom' and 'envrcpt' handlers.
r r
Protocol used to receive the message. The value of this macro is Protocol used to receive the message. The value of this macro is
always 'SMTP'. Defined in all handlers. always 'SMTP'. Defined in all handlers.
skipping to change at line 15295 skipping to change at line 15715
log-level LEVEL; log-level LEVEL;
}; };
-- Pmult Conf: client [IDENT] { STATEMENTS } -- Pmult Conf: client [IDENT] { STATEMENTS }
Declare a Milter client. Optional IDENT gives the identifier of Declare a Milter client. Optional IDENT gives the identifier of
this client, which will be used in diagnostics messages. this client, which will be used in diagnostics messages.
STATEMENTS are described below. STATEMENTS are described below.
-- Pmult Conf: type TYPESTR -- Pmult Conf: type TYPESTR
This statement is reserved for future use. In version 8.11 it is a This statement is reserved for future use. In version 8.12 it is a
no-op. no-op.
If given, the value of TYPESTR must be 'milter'. If given, the value of TYPESTR must be 'milter'.
In future versions this statement will declare the protocol to be In future versions this statement will declare the protocol to be
used to interact with this client. The syntax for TYPESTR is used to interact with this client. The syntax for TYPESTR is
TYPE [VERSION] TYPE [VERSION]
where TYPE is either 'milter' or 'pmilter', and optional VERSION is where TYPE is either 'milter' or 'pmilter', and optional VERSION is
skipping to change at line 16870 skipping to change at line 17290
(line 6) (line 6)
* #! ... !# initial comment: top-block. (line 31) * #! ... !# initial comment: top-block. (line 31)
* #! shell magic sequence: top-block. (line 6) * #! shell magic sequence: top-block. (line 6)
* #include: Comments. (line 22) * #include: Comments. (line 22)
* #include statement: Comments. (line 22) * #include statement: Comments. (line 22)
* #line: Comments. (line 76) * #line: Comments. (line 76)
* #pragma: Pragmas. (line 6) * #pragma: Pragmas. (line 6)
* #pragma dbprop: Database functions. (line 21) * #pragma dbprop: Database functions. (line 21)
* #pragma statement: Pragmas. (line 6) * #pragma statement: Pragmas. (line 6)
* $#, special construct: Functions. (line 92) * $#, special construct: Functions. (line 92)
* $(N): Functions. (line 135)
* $N: Functions. (line 147)
* (string: DKIM. (line 117) * (string: DKIM. (line 117)
* --prefix, configure option: Building. (line 90) * --prefix, configure option: Building. (line 90)
* --sysconfdir, configure option: Building. (line 136)
* --with-dbm, configure option: Building. (line 27) * --with-dbm, configure option: Building. (line 27)
* -sysconfdir, configure option: Building. (line 136)
* /etc/postfix/main.cf: Postfix. (line 6) * /etc/postfix/main.cf: Postfix. (line 6)
* 7bit: Filters. (line 17)
* 8bit: Filters. (line 26)
* < (left angle bracket), < operator: Relational expressions. * < (left angle bracket), < operator: Relational expressions.
(line 6) (line 6)
* < (left angle bracket), <= operator: Relational expressions. * < (left angle bracket), <= operator: Relational expressions.
(line 6) (line 6)
* = (equals sign), = operator: Relational expressions. * = (equals sign), = operator: Relational expressions.
(line 6) (line 6)
* > (right angle bracket), > operator: Relational expressions. * > (right angle bracket), > operator: Relational expressions.
(line 6) (line 6)
* > (right angle bracket), >= operator: Relational expressions. * > (right angle bracket), >= operator: Relational expressions.
(line 6) (line 6)
skipping to change at line 16938 skipping to change at line 17362
* actions, header manipulation: Actions. (line 89) * actions, header manipulation: Actions. (line 89)
* actions, introduced: Simplest Configurations. * actions, introduced: Simplest Configurations.
(line 29) (line 29)
* actions, using in connect handler: Handlers. (line 56) * actions, using in connect handler: Handlers. (line 56)
* add: Actions. (line 93) * add: Actions. (line 93)
* add action, defined: Actions. (line 93) * add action, defined: Actions. (line 93)
* add in begin: begin/end. (line 60) * add in begin: begin/end. (line 60)
* add in end: begin/end. (line 60) * add in end: begin/end. (line 60)
* adns: Building. (line 19) * adns: Building. (line 19)
* Alan Dobkin: Acknowledgments. (line 44) * Alan Dobkin: Acknowledgments. (line 44)
* alias: Functions. (line 190) * alias: Functions. (line 191)
* aliases: Functions. (line 190) * aliases: Functions. (line 191)
* aliases, looking up: Local Account Verification. * aliases, looking up: Local Account Verification.
(line 49) (line 49)
* all, --all mfdbtool option, introduced: Database Maintenance. * all, --all mfdbtool option, introduced: Database Maintenance.
(line 35) (line 35)
* all, --all mfdbtool option, summary: Invoking mfdbtool. (line 50) * all, --all mfdbtool option, summary: Invoking mfdbtool. (line 50)
* and: Boolean expressions. (line 6) * and: Boolean expressions. (line 6)
* append, --append, mtasim option, described: traces. (line 16) * append, --append, mtasim option, described: traces. (line 16)
* append, --append, mtasim option, summary: option summary. (line 8) * append, --append, mtasim option, summary: option summary. (line 8)
* argument number in the list of arguments: Functions. (line 92) * argument number in the list of arguments: Functions. (line 92)
* arguments, catch: Catch and Throw. (line 79) * arguments, catch: Catch and Throw. (line 79)
* arguments, optional: Functions. (line 84) * arguments, optional: Functions. (line 84)
* as: Polling. (line 160) * as: Polling. (line 160)
* assignment to variable: HELO Domain. (line 27) * assignment to variable: HELO Domain. (line 27)
* assignment, defined: Assignments. (line 6) * assignment, defined: Assignments. (line 6)
* associativity, operators: Precedence. (line 14) * associativity, operators: Precedence. (line 14)
* asynchronous syslog: Logging and Debugging. * asynchronous syslog: Logging and Debugging.
(line 21) (line 21)
* auth-macros: pmult-macros. (line 160) * auth-macros: pmult-macros. (line 160)
* automatic variables: Functions. (line 218) * automatic variables: Functions. (line 219)
* B: Filters. (line 31)
* back reference interpretation: Literals. (line 71) * back reference interpretation: Literals. (line 71)
* back references, in program text: Back references. (line 6) * back references, in program text: Back references. (line 6)
* backlog: conf-server. (line 52) * backlog: conf-server. (line 52)
* backlog <1>: conf-calloutd-server. * backlog <1>: conf-calloutd-server.
(line 51) (line 51)
* backslash interpretation: Literals. (line 24) * backslash interpretation: Literals. (line 24)
* base64: Filters. (line 30)
* begin: begin/end. (line 16) * begin: begin/end. (line 16)
* begin and accept: begin/end. (line 55) * begin and accept: begin/end. (line 55)
* begin and add: begin/end. (line 60) * begin and add: begin/end. (line 60)
* begin and continue: begin/end. (line 55) * begin and continue: begin/end. (line 55)
* begin and delete: begin/end. (line 60) * begin and delete: begin/end. (line 60)
* begin and discard: begin/end. (line 55) * begin and discard: begin/end. (line 55)
* begin and reject: begin/end. (line 55) * begin and reject: begin/end. (line 55)
* begin and replace: begin/end. (line 60) * begin and replace: begin/end. (line 60)
* begin and return: begin/end. (line 53) * begin and return: begin/end. (line 53)
* begin and tempfail: begin/end. (line 55) * begin and tempfail: begin/end. (line 55)
* begin, handler restrictions: begin/end. (line 50) * begin, handler restrictions: begin/end. (line 50)
* begin, special handler: Start Up. (line 50) * begin, special handler: Start Up. (line 50)
* begin, special handler <1>: begin/end. (line 6) * begin, special handler <1>: begin/end. (line 6)
* Ben McKeegan: Acknowledgments. (line 36) * Ben McKeegan: Acknowledgments. (line 36)
* Berkeley DB: Building. (line 27) * Berkeley DB: Building. (line 27)
* binary: Filters. (line 27)
* bindtextdomain: NLS Functions. (line 65) * bindtextdomain: NLS Functions. (line 65)
* body: Handlers. (line 192) * body: Handlers. (line 192)
* body, handler: Start Up. (line 50) * body, handler: Start Up. (line 50)
* body-chunk, --body-chunk, mtasim option, summary: option summary. * body-chunk, --body-chunk, mtasim option, summary: option summary.
(line 12) (line 12)
* body_has_nulls: Mail body functions. (line 14) * body_has_nulls: Mail body functions. (line 14)
* body_string: Mail body functions. (line 6) * body_string: Mail body functions. (line 6)
* break: Loops. (line 38) * break: Loops. (line 38)
* break statement: Loops. (line 38) * break statement: Loops. (line 38)
* Brent Spencer: Acknowledgments. (line 44) * Brent Spencer: Acknowledgments. (line 44)
skipping to change at line 17041 skipping to change at line 17468
* cancel_program_trace: Debugging Functions. (line 100) * cancel_program_trace: Debugging Functions. (line 100)
* case: Conditionals. (line 44) * case: Conditionals. (line 44)
* case, switch statement: Conditionals. (line 44) * case, switch statement: Conditionals. (line 44)
* catch: Catch and Throw. (line 13) * catch: Catch and Throw. (line 13)
* catch arguments: Catch and Throw. (line 79) * catch arguments: Catch and Throw. (line 79)
* catch scope: Catch and Throw. (line 53) * catch scope: Catch and Throw. (line 53)
* catch statement: Catch and Throw. (line 13) * catch statement: Catch and Throw. (line 13)
* catch, accessing variables from: Catch and Throw. (line 131) * catch, accessing variables from: Catch and Throw. (line 131)
* catch, returning from: Catch and Throw. (line 79) * catch, returning from: Catch and Throw. (line 79)
* catch, standalone: Catch and Throw. (line 59) * catch, standalone: Catch and Throw. (line 59)
* charset: Filters. (line 40)
* charset <1>: Filters. (line 41)
* checking SPF host records: SPF Functions. (line 19) * checking SPF host records: SPF Functions. (line 19)
* check_host: SPF Functions. (line 217) * check_host: SPF Functions. (line 217)
* check_host function, introduced: SPF Functions. (line 19) * check_host function, introduced: SPF Functions. (line 19)
* clamav: ClamAV. (line 6) * clamav: ClamAV. (line 6)
* ClamAV: ClamAV. (line 6) * ClamAV: ClamAV. (line 6)
* clamav_virus_name: Predefined variables. * clamav_virus_name: Predefined variables.
(line 38) (line 38)
* clamav_virus_name, global variable: ClamAV. (line 7) * clamav_virus_name, global variable: ClamAV. (line 7)
* cleanup handler: begin/end. (line 6) * cleanup handler: begin/end. (line 6)
* client: pmult-client. (line 27) * client: pmult-client. (line 27)
skipping to change at line 17092 skipping to change at line 17521
* constants, defining: Constants. (line 6) * constants, defining: Constants. (line 6)
* constants, using in literals: Constants. (line 83) * constants, using in literals: Constants. (line 83)
* constants, using in program text: Constants. (line 16) * constants, using in program text: Constants. (line 16)
* continue: Actions. (line 37) * continue: Actions. (line 37)
* continue action, defined: Actions. (line 37) * continue action, defined: Actions. (line 37)
* continue action, introduced: Start Up. (line 18) * continue action, introduced: Start Up. (line 18)
* continue in begin: begin/end. (line 55) * continue in begin: begin/end. (line 55)
* continue in end: begin/end. (line 55) * continue in end: begin/end. (line 55)
* controlling argument, getopt: getopt. (line 131) * controlling argument, getopt: getopt. (line 131)
* copy: I/O functions. (line 174) * copy: I/O functions. (line 174)
* copy-octal: Filters. (line 146)
* copy-pass: Filters. (line 142)
* create_dsn: Mail Sending Functions. * create_dsn: Mail Sending Functions.
(line 173) (line 173)
* crlf: Filters. (line 58)
* crlfdot: Filters. (line 70)
* cross-reference: Testing Filter Scripts. * cross-reference: Testing Filter Scripts.
(line 29) (line 29)
* ctype_mismatch, global variable: Character Type. (line 6) * ctype_mismatch, global variable: Character Type. (line 6)
* current_header: Current Message Functions. * current_header: Current Message Functions.
(line 30) (line 30)
* current_header_count: Current Message Functions. * current_header_count: Current Message Functions.
(line 14) (line 14)
* current_header_nth_name: Current Message Functions. * current_header_nth_name: Current Message Functions.
(line 22) (line 22)
* current_header_nth_value: Current Message Functions. * current_header_nth_value: Current Message Functions.
skipping to change at line 17174 skipping to change at line 17607
* debugging: Echo. (line 6) * debugging: Echo. (line 6)
* debugging level: Logging and Debugging. * debugging level: Logging and Debugging.
(line 100) (line 100)
* debugging the filter script: Testing Filter Scripts. * debugging the filter script: Testing Filter Scripts.
(line 60) (line 60)
* debugging, pmult: pmult-conf. (line 6) * debugging, pmult: pmult-conf. (line 6)
* debug_level: Debugging Functions. (line 16) * debug_level: Debugging Functions. (line 16)
* debug_spec: Debugging Functions. (line 53) * debug_spec: Debugging Functions. (line 53)
* declaring milter state handler: Simplest Configurations. * declaring milter state handler: Simplest Configurations.
(line 6) (line 6)
* decode MIME: Message body functions.
(line 38)
* decode MIME <1>: MIME functions. (line 29)
* default: conf-server. (line 81) * default: conf-server. (line 81)
* default communication port: Building. (line 149) * default communication port: Building. (line 149)
* default communication socket: Building. (line 149) * default communication socket: Building. (line 149)
* default exception handling: Catch and Throw. (line 6) * default exception handling: Catch and Throw. (line 6)
* default expiration interval: Building. (line 165) * default expiration interval: Building. (line 165)
* default syslog facility: Logging and Debugging. * default syslog facility: Logging and Debugging.
(line 49) (line 49)
* default user privileges: Building. (line 77) * default user privileges: Building. (line 77)
* default_callout_server_url: SMTP Callout functions. * default_callout_server_url: SMTP Callout functions.
(line 63) (line 63)
skipping to change at line 17245 skipping to change at line 17681
* dns_getname: Simplified DNS functions. * dns_getname: Simplified DNS functions.
(line 20) (line 20)
* dns_query: dns_query. (line 6) * dns_query: dns_query. (line 6)
* dns_reply_count: dns_query. (line 75) * dns_reply_count: dns_query. (line 75)
* dns_reply_ip: dns_query. (line 83) * dns_reply_ip: dns_query. (line 83)
* dns_reply_release: dns_query. (line 71) * dns_reply_release: dns_query. (line 71)
* dns_reply_string: dns_query. (line 80) * dns_reply_string: dns_query. (line 80)
* do loop: Loops. (line 90) * do loop: Loops. (line 90)
* DomainKeys Identified Mail: DKIM. (line 6) * DomainKeys Identified Mail: DKIM. (line 6)
* domainpart: String manipulation. (line 22) * domainpart: String manipulation. (line 22)
* dot: Filters. (line 86)
* drop: protocol-calloutd. (line 158) * drop: protocol-calloutd. (line 158)
* DSF_NOISE: DSPAM. (line 37) * DSF_NOISE: DSPAM. (line 37)
* DSF_NOISE <1>: flags-dspam. (line 23) * DSF_NOISE <1>: flags-dspam. (line 23)
* DSF_SIGNATURE: DSPAM. (line 31) * DSF_SIGNATURE: DSPAM. (line 31)
* DSF_SIGNATURE <1>: flags-dspam. (line 21) * DSF_SIGNATURE <1>: flags-dspam. (line 21)
* DSF_WHITELIST: DSPAM. (line 37) * DSF_WHITELIST: DSPAM. (line 37)
* DSF_WHITELIST <1>: flags-dspam. (line 24) * DSF_WHITELIST <1>: flags-dspam. (line 24)
* DSM_CLASSIFY: DSPAM. (line 24) * DSM_CLASSIFY: DSPAM. (line 24)
* DSM_CLASSIFY <1>: flags-dspam. (line 16) * DSM_CLASSIFY <1>: flags-dspam. (line 16)
* DSM_PROCESS: DSPAM. (line 24) * DSM_PROCESS: DSPAM. (line 24)
skipping to change at line 17392 skipping to change at line 17829
* expect mode, mtasim: expect commands. (line 6) * expect mode, mtasim: expect commands. (line 6)
* expire, --expire mfdbtool option, introduced: Database Maintenance. * expire, --expire mfdbtool option, introduced: Database Maintenance.
(line 14) (line 14)
* expire, --expire mfdbtool option, summary: Invoking mfdbtool. * expire, --expire mfdbtool option, summary: Invoking mfdbtool.
(line 23) (line 23)
* expire-interval: conf-database. (line 32) * expire-interval: conf-database. (line 32)
* expire-interval, --expire-interval mfdbtool option, summary: Invoking mfdbtool . * expire-interval, --expire-interval mfdbtool option, summary: Invoking mfdbtool .
(line 60) (line 60)
* explicit type casts: Type casting. (line 24) * explicit type casts: Type casting. (line 24)
* expressions: Expressions. (line 6) * expressions: Expressions. (line 6)
* e_badmmq, exception type: Built-in Exceptions. (line 11) * e_badmmq: Built-in Exceptions. (line 11)
* e_dbfailure, exception type: Built-in Exceptions. (line 16) * e_dbfailure: Built-in Exceptions. (line 16)
* e_divzero, exception type: Built-in Exceptions. (line 21) * e_divzero: Built-in Exceptions. (line 21)
* e_eof, exception type: Built-in Exceptions. (line 29) * e_eof: Built-in Exceptions. (line 29)
* e_exists, exception type: Built-in Exceptions. (line 24) * e_exists: Built-in Exceptions. (line 24)
* e_failure, exception type: Built-in Exceptions. (line 33) * e_failure: Built-in Exceptions. (line 33)
* e_format, exception type: Built-in Exceptions. (line 41) * e_format: Built-in Exceptions. (line 40)
* e_invcidr, exception type: Built-in Exceptions. (line 47) * e_ilseq: Built-in Exceptions. (line 46)
* e_invip, exception type: Built-in Exceptions. (line 51) * e_invcidr: Built-in Exceptions. (line 54)
* e_invtime, exception type: Built-in Exceptions. (line 55) * e_invip: Built-in Exceptions. (line 58)
* e_io, exception type: Built-in Exceptions. (line 60) * e_invtime: Built-in Exceptions. (line 62)
* e_macroundef, exception type: Built-in Exceptions. (line 65) * e_io: Built-in Exceptions. (line 67)
* e_noresolve, exception type: Built-in Exceptions. (line 68) * e_macroundef: Built-in Exceptions. (line 72)
* e_not_found, exception type: Built-in Exceptions. (line 106) * e_noresolve: Built-in Exceptions. (line 75)
* e_range, exception type: Built-in Exceptions. (line 73) * e_not_found: Built-in Exceptions. (line 114)
* e_regcomp, exception type: Built-in Exceptions. (line 78) * e_range: Built-in Exceptions. (line 80)
* e_ston_conv, exception type: Built-in Exceptions. (line 84) * e_regcomp: Built-in Exceptions. (line 85)
* e_success, exception type: Built-in Exceptions. (line 106) * e_ston_conv: Built-in Exceptions. (line 91)
* e_temp_failure, exception type: Built-in Exceptions. (line 96) * e_success: Built-in Exceptions. (line 112)
* e_url, exception type: Built-in Exceptions. (line 102) * e_temp_failure: Built-in Exceptions. (line 103)
* e_url: Built-in Exceptions. (line 108)
* f, Sendmail macro: Sendmail. (line 27) * f, Sendmail macro: Sendmail. (line 27)
* Fail, SPF result code: SPF Functions. (line 66) * Fail, SPF result code: SPF Functions. (line 66)
* failure, exception type: Built-in Exceptions. (line 33) * failure: Built-in Exceptions. (line 34)
* FAMILY_INET: Handlers. (line 40) * FAMILY_INET: Handlers. (line 40)
* FAMILY_INET6: Handlers. (line 40) * FAMILY_INET6: Handlers. (line 40)
* FAMILY_STDIO: Handlers. (line 40) * FAMILY_STDIO: Handlers. (line 40)
* FAMILY_UNIX: Handlers. (line 40) * FAMILY_UNIX: Handlers. (line 40)
* fatal runtime errors: Runtime errors. (line 20) * fatal runtime errors: Runtime errors. (line 20)
* FDL, GNU Free Documentation License: Copying This Manual. (line 6) * FDL, GNU Free Documentation License: Copying This Manual. (line 6)
* fd_delimiter: I/O functions. (line 256) * fd_delimiter: I/O functions. (line 256)
* fd_set_delimiter: I/O functions. (line 247) * fd_set_delimiter: I/O functions. (line 247)
* fi: Conditionals. (line 11) * fi: Conditionals. (line 11)
* file: conf-database. (line 26) * file: conf-database. (line 26)
* file, --file mfdbtool option, summary: Invoking mfdbtool. (line 68) * file, --file mfdbtool option, summary: Invoking mfdbtool. (line 68)
* filter pipe: Filters. (line 6)
* filter script, debugging: Testing Filter Scripts. * filter script, debugging: Testing Filter Scripts.
(line 60) (line 60)
* filter script, described: Start Up. (line 42) * filter script, described: Start Up. (line 42)
* filter script, running in test mode: Testing Filter Scripts. * filter script, running in test mode: Testing Filter Scripts.
(line 60) (line 60)
* filter_fd: Filtering functions. (line 51)
* filter_string: Filtering functions. (line 43)
* Finding function definition: Using MFL Mode. (line 51) * Finding function definition: Using MFL Mode. (line 51)
* fnmatches: Special comparisons. (line 9) * fnmatches: Special comparisons. (line 9)
* for loop: Loops. (line 75) * for loop: Loops. (line 75)
* foreground, --foreground calloutd option, summary: invocation-calloutd. * foreground, --foreground calloutd option, summary: invocation-calloutd.
(line 15) (line 15)
* foreground, --foreground mailfromd option, summary: General Settings. * foreground, --foreground mailfromd option, summary: General Settings.
(line 10) (line 10)
* format, --format mfdbtool option, introduced: Basic Database Operations. * format, --format mfdbtool option, introduced: Basic Database Operations.
(line 25) (line 25)
* format, --format mfdbtool option, summary: Invoking mfdbtool. * format, --format mfdbtool option, summary: Invoking mfdbtool.
(line 75) (line 75)
* format, --format mfdbtool option, using with --list: Basic Database Operations . * format, --format mfdbtool option, using with --list: Basic Database Operations .
(line 25) (line 25)
* from: import. (line 24) * from: import. (line 24)
* from <1>: Polling. (line 160) * from <1>: Filters. (line 98)
* from <2>: Polling. (line 160)
* from ... import: import. (line 24) * from ... import: import. (line 24)
* fromrd: Filters. (line 111)
* func statement, function definition: Functions. (line 45) * func statement, function definition: Functions. (line 45)
* function arguments, counting: Functions. (line 92) * function arguments, counting: Functions. (line 92)
* function arguments, getting the number of: Functions. (line 92) * function arguments, getting the number of: Functions. (line 92)
* function calls: Functions and Modules. * function calls: Functions and Modules.
(line 15) (line 15)
* function definition, syntax of: Functions. (line 38) * function definition, syntax of: Functions. (line 38)
* function returning void: Functions. (line 178) * function returning void: Functions. (line 179)
* function, defined: Functions and Modules. * function, defined: Functions and Modules.
(line 6) (line 6)
* F_OK: System functions. (line 14) * F_OK: System functions. (line 14)
* g, -g, mtasim option, summary: option summary. (line 30) * g, -g, mtasim option, summary: option summary. (line 30)
* g, transform flag: String transformation. * g, transform flag: String transformation.
(line 37) (line 37)
* gacopyz-log, --gacopyz-log mailfromd option, summary: Logging and Debugging Op tions. * gacopyz-log, --gacopyz-log mailfromd option, summary: Logging and Debugging Op tions.
(line 68) (line 68)
* gacopyz-log, --gacopyz-log, mtasim option, summary: option summary. * gacopyz-log, --gacopyz-log, mtasim option, summary: option summary.
(line 24) (line 24)
skipping to change at line 17539 skipping to change at line 17982
* handler, described: Start Up. (line 50) * handler, described: Start Up. (line 50)
* handler, initialization: begin/end. (line 6) * handler, initialization: begin/end. (line 6)
* handler, startup: begin/end. (line 6) * handler, startup: begin/end. (line 6)
* hard STMP timeout: SMTP Timeouts. (line 28) * hard STMP timeout: SMTP Timeouts. (line 28)
* hasmx: Simplified DNS functions. * hasmx: Simplified DNS functions.
(line 90) (line 90)
* hasmx, definition of the function: Catch and Throw. (line 102) * hasmx, definition of the function: Catch and Throw. (line 102)
* hasns: Simplified DNS functions. * hasns: Simplified DNS functions.
(line 206) (line 206)
* header: Handlers. (line 173) * header: Handlers. (line 173)
* header <1>: Filters. (line 122)
* header manipulation actions: Actions. (line 89) * header manipulation actions: Actions. (line 89)
* header modification: Header modification functions. * header modification: Header modification functions.
(line 6) (line 6)
* header, handler: Start Up. (line 50) * header, handler: Start Up. (line 50)
* header_add: Header modification functions. * header_add: Header modification functions.
(line 16) (line 16)
* header_add <1>: Header modification functions. * header_add <1>: Header modification functions.
(line 22) (line 22)
* header_delete: Header modification functions. * header_delete: Header modification functions.
(line 41) (line 41)
skipping to change at line 17589 skipping to change at line 18033
* htonl: Internet address manipulation functions . * htonl: Internet address manipulation functions .
(line 12) (line 12)
* htons: Internet address manipulation functions . * htons: Internet address manipulation functions .
(line 20) (line 20)
* i, Sendmail macro: Sendmail. (line 27) * i, Sendmail macro: Sendmail. (line 27)
* i, Sendmail macro in MeTA1: pmult-macros. (line 17) * i, Sendmail macro in MeTA1: pmult-macros. (line 17)
* i, Sendmail macro in Postfix: Postfix. (line 38) * i, Sendmail macro in Postfix: Postfix. (line 38)
* i, transform flag: String transformation. * i, transform flag: String transformation.
(line 41) (line 41)
* i18n: NLS Functions. (line 11) * i18n: NLS Functions. (line 11)
* iconv: Filters. (line 130)
* id: conf-server. (line 29) * id: conf-server. (line 29)
* id <1>: conf-calloutd-server. * id <1>: conf-calloutd-server.
(line 28) (line 28)
* if: Conditionals. (line 11) * if: Conditionals. (line 11)
* ignore-failed-reads, --ignore-failed-reads mfdbtool option, summary: Invoking mfdbtool. * ignore-failed-reads, --ignore-failed-reads mfdbtool option, summary: Invoking mfdbtool.
(line 80) (line 80)
* implicit type casts: Type casting. (line 6) * implicit type casts: Type casting. (line 6)
* import: import. (line 24) * import: import. (line 24)
* importing from modules: import. (line 6) * importing from modules: import. (line 6)
* include search path, introduced: Comments. (line 31) * include search path, introduced: Comments. (line 31)
skipping to change at line 17613 skipping to change at line 18058
* including files: Comments. (line 22) * including files: Comments. (line 22)
* indentation, MFL, default: Using MFL Mode. (line 27) * indentation, MFL, default: Using MFL Mode. (line 27)
* index: String manipulation. (line 29) * index: String manipulation. (line 29)
* index <1>: String manipulation. (line 30) * index <1>: String manipulation. (line 30)
* inet_aton: Internet address manipulation functions . * inet_aton: Internet address manipulation functions .
(line 24) (line 24)
* inet_ntoa: Internet address manipulation functions . * inet_ntoa: Internet address manipulation functions .
(line 39) (line 39)
* infinite loop: Loops. (line 56) * infinite loop: Loops. (line 56)
* initial-response: conf-timeout. (line 54) * initial-response: conf-timeout. (line 54)
* inline-comment: Filters. (line 158)
* inline-comment <1>: Filters. (line 159)
* INPUT_MAIL_FILTER, mc file directive: Sendmail. (line 10) * INPUT_MAIL_FILTER, mc file directive: Sendmail. (line 10)
* internationalization: NLS Functions. (line 11) * internationalization: NLS Functions. (line 11)
* interval: String manipulation. (line 44) * interval: String manipulation. (line 44)
* Invalid back-reference number, runtime error: Runtime errors. * Invalid back-reference number, runtime error: Runtime errors.
(line 74) (line 74)
* Invalid exception number, runtime error: Runtime errors. (line 63) * Invalid exception number, runtime error: Runtime errors. (line 63)
* invocation: Invocation. (line 6) * invocation: Invocation. (line 6)
* io-timeout: conf-timeout. (line 89) * io-timeout: conf-timeout. (line 89)
* isalnum: Character Type. (line 13) * isalnum: Character Type. (line 13)
* isalpha: Character Type. (line 19) * isalpha: Character Type. (line 19)
skipping to change at line 17667 skipping to change at line 18114
* len_to_netmask: Internet address manipulation functions . * len_to_netmask: Internet address manipulation functions .
(line 45) (line 45)
* libdspam: DSPAM. (line 10) * libdspam: DSPAM. (line 10)
* libGeoIP: Legacy geoip support. * libGeoIP: Legacy geoip support.
(line 6) (line 6)
* libmaxminddb: Geolocation functions. * libmaxminddb: Geolocation functions.
(line 6) (line 6)
* library and built-in functions, introduced: Functions and Modules. * library and built-in functions, introduced: Functions and Modules.
(line 34) (line 34)
* line, #line statement: Comments. (line 76) * line, #line statement: Comments. (line 76)
* linecon: Filters. (line 195)
* linecon <1>: Filters. (line 196)
* linelen: Filters. (line 208)
* lint mode: Testing Filter Scripts. * lint mode: Testing Filter Scripts.
(line 9) (line 9)
* lint, --lint mailfromd option, introduced: Testing Filter Scripts. * lint, --lint mailfromd option, introduced: Testing Filter Scripts.
(line 9) (line 9)
* lint, --lint mailfromd option, summary: Logging and Debugging Options. * lint, --lint mailfromd option, summary: Logging and Debugging Options.
(line 49) (line 49)
* list, --list mfdbtool option, described: Basic Database Operations. * list, --list mfdbtool option, described: Basic Database Operations.
(line 9) (line 9)
* list, --list mfdbtool option, summary: Invoking mfdbtool. (line 10) * list, --list mfdbtool option, summary: Invoking mfdbtool. (line 10)
* listen: conf-server. (line 44) * listen: conf-server. (line 44)
* listen <1>: conf-calloutd-server. * listen <1>: conf-calloutd-server.
(line 43) (line 43)
* listen <2>: pmult-conf. (line 9) * listen <2>: pmult-conf. (line 9)
* listens: Special test functions. * listens: Special test functions.
(line 7) (line 7)
* listing a database contents: Basic Database Operations. * listing a database contents: Basic Database Operations.
(line 9) (line 9)
* literal concatenation: Concatenation. (line 11) * literal concatenation: Concatenation. (line 11)
* literals: Literals. (line 6) * literals: Literals. (line 6)
* local state directory: Building. (line 141) * local state directory: Building. (line 141)
* local variables: Functions. (line 218) * local variables: Functions. (line 219)
* localdomain: System functions. (line 47) * localdomain: System functions. (line 47)
* localdomain.mf: System functions. (line 47) * localdomain.mf: System functions. (line 47)
* localization: NLS Functions. (line 11) * localization: NLS Functions. (line 11)
* localpart: String manipulation. (line 62) * localpart: String manipulation. (line 62)
* location-column, --location-column mailfromd option, described: Testing Filter Scripts. * location-column, --location-column mailfromd option, described: Testing Filter Scripts.
(line 19) (line 19)
* location-column, --location-column mailfromd option, summary: Logging and Debu gging Options. * location-column, --location-column mailfromd option, summary: Logging and Debu gging Options.
(line 6) (line 6)
* lock-retry-count: conf-database. (line 60) * lock-retry-count: conf-database. (line 60)
* lock-retry-timeout: conf-database. (line 66) * lock-retry-timeout: conf-database. (line 66)
skipping to change at line 17795 skipping to change at line 18245
* message digest: Message digest functions. * message digest: Message digest functions.
(line 6) (line 6)
* message functions: Message functions. (line 6) * message functions: Message functions. (line 6)
* message modification queue: Message modification queue. * message modification queue: Message modification queue.
(line 6) (line 6)
* Message-ID, exporting: Logging and Debugging. * Message-ID, exporting: Logging and Debugging.
(line 87) (line 87)
* Message-ID, exporting in mc file: Sendmail. (line 27) * Message-ID, exporting in mc file: Sendmail. (line 27)
* Message-ID, using in mailfromd logs: Logging and Debugging. * Message-ID, using in mailfromd logs: Logging and Debugging.
(line 87) (line 87)
* message_body_decode: MIME functions. (line 85)
* message_body_is_empty: Message functions. (line 26) * message_body_is_empty: Message functions. (line 26)
* message_body_lines: Message body functions. * message_body_lines: Message body functions.
(line 10) (line 10)
* message_body_rewind: Message body functions. * message_body_rewind: Message body functions.
(line 14) (line 14)
* message_body_size: Message body functions. * message_body_size: Message body functions.
(line 6) (line 6)
* message_body_to_stream: Message body functions. * message_body_to_stream: Message body functions.
(line 28) (line 28)
* message_burst: Message digest functions. * message_burst: Message digest functions.
(line 16) (line 16)
* message_close: Message functions. (line 32) * message_close: Message functions. (line 32)
* message_content_type: MIME functions. (line 22)
* message_count_parts: MIME functions. (line 9) * message_count_parts: MIME functions. (line 9)
* message_find_header: Header functions. (line 19) * message_find_header: Header functions. (line 19)
* message_from_stream: Message functions. (line 53) * message_from_stream: Message functions. (line 53)
* message_get_part: MIME functions. (line 16) * message_get_part: MIME functions. (line 16)
* message_has_header: Header functions. (line 44) * message_has_header: Header functions. (line 44)
* message_header_count: Header functions. (line 13) * message_header_count: Header functions. (line 13)
* message_header_decode: Mail header functions. * message_header_decode: Mail header functions.
(line 26) (line 26)
* message_header_encode: Mail header functions. * message_header_encode: Mail header functions.
(line 6) (line 6)
* message_header_lines: Header functions. (line 10) * message_header_lines: Header functions. (line 10)
* message_header_size: Header functions. (line 6) * message_header_size: Header functions. (line 6)
* message_is_multipart: MIME functions. (line 6) * message_is_multipart: MIME functions. (line 6)
* message_lines: Message functions. (line 35) * message_lines: Message functions. (line 35)
* message_nth_header_name: Header functions. (line 34) * message_nth_header_name: Header functions. (line 34)
* message_nth_header_value: Header functions. (line 39) * message_nth_header_value: Header functions. (line 39)
* message_part_decode(number: MIME functions. (line 97)
* message_read_body_line: Message body functions. * message_read_body_line: Message body functions.
(line 21) (line 21)
* message_read_line: Message functions. (line 42) * message_read_line: Message functions. (line 42)
* message_rewind: Message functions. (line 49) * message_rewind: Message functions. (line 49)
* message_size: Message functions. (line 15) * message_size: Message functions. (line 15)
* message_to_stream: Message functions. (line 63) * message_to_stream: Message functions. (line 63)
* meta1: MeTA1. (line 6) * meta1: MeTA1. (line 6)
* meta1 macros: pmult-macros. (line 6) * meta1 macros: pmult-macros. (line 6)
* mfdbtool: Basic Database Operations. * mfdbtool: Basic Database Operations.
(line 6) (line 6)
skipping to change at line 17872 skipping to change at line 18325
* milter-socket, --milter-socket mailfromd option, summary: General Settings. * milter-socket, --milter-socket mailfromd option, summary: General Settings.
(line 43) (line 43)
* milter-timeout: conf-milter. (line 6) * milter-timeout: conf-milter. (line 6)
* milter-timeout, --milter-timeout mailfromd option, summary: Timeout Control. * milter-timeout, --milter-timeout mailfromd option, summary: Timeout Control.
(line 8) (line 8)
* milter-timeout, --milter-timeout, mtasim option, summary: option summary. * milter-timeout, --milter-timeout, mtasim option, summary: option summary.
(line 62) (line 62)
* milter-version, --milter-version, mtasim option, summary: option summary. * milter-version, --milter-version, mtasim option, summary: option summary.
(line 47) (line 47)
* miltermacros: miltermacros. (line 6) * miltermacros: miltermacros. (line 6)
* MIME, decoding: Message body functions.
(line 38)
* MIME, decoding <1>: MIME functions. (line 29)
* mime.mf: MIME functions. (line 82)
* mimedecode: Message body functions.
(line 38)
* mimedecode <1>: MIME functions. (line 36)
* mimedecode <2>: Filters. (line 218)
* mmq_purge: Message modification queue. * mmq_purge: Message modification queue.
(line 66) (line 66)
* module: module structure. (line 6) * module: module structure. (line 6)
* module declaration: module structure. (line 6) * module declaration: module structure. (line 6)
* module, defined: Functions and Modules. * module, defined: Functions and Modules.
(line 34) (line 34)
* module, defined <1>: Modules. (line 6) * module, defined <1>: Modules. (line 6)
* MTA: Start Up. (line 6) * MTA: Start Up. (line 6)
* mtasim: mtasim. (line 6) * mtasim: mtasim. (line 6)
* mtasim administrative commands: interactive mode. (line 149) * mtasim administrative commands: interactive mode. (line 149)
skipping to change at line 17927 skipping to change at line 18388
* no-interactive, --no-interactive, mtasim option, summary: option summary. * no-interactive, --no-interactive, mtasim option, summary: option summary.
(line 90) (line 90)
* no-preprocessor, --no-preprocessor mailfromd option, summary: Preprocessor Opt ions. * no-preprocessor, --no-preprocessor mailfromd option, summary: Preprocessor Opt ions.
(line 9) (line 9)
* no-preprocessor, --no-preprocessor mailfromd option, usage: Preprocessor. * no-preprocessor, --no-preprocessor mailfromd option, usage: Preprocessor.
(line 141) (line 141)
* no-site-config, --no-site-config calloutd option, summary: invocation-calloutd . * no-site-config, --no-site-config calloutd option, summary: invocation-calloutd .
(line 122) (line 122)
* non-blocking syslog: Logging and Debugging. * non-blocking syslog: Logging and Debugging.
(line 21) (line 21)
* none: Filters. (line 139)
* None, SPF result code: SPF Functions. (line 47) * None, SPF result code: SPF Functions. (line 47)
* non_smtpd_milters, postfix configuration: Postfix. (line 6) * non_smtpd_milters, postfix configuration: Postfix. (line 6)
* not: Boolean expressions. (line 6) * not: Boolean expressions. (line 6)
* Not enough memory, runtime error: Runtime errors. (line 23) * Not enough memory, runtime error: Runtime errors. (line 23)
* not_found, exception type: Built-in Exceptions. (line 106) * not_found: Built-in Exceptions. (line 115)
* ntohl: Internet address manipulation functions . * ntohl: Internet address manipulation functions .
(line 8) (line 8)
* ntohs: Internet address manipulation functions . * ntohs: Internet address manipulation functions .
(line 16) (line 16)
* number: Predefined variables. * number: Predefined variables.
(line 9) (line 9)
* number of actual arguments: Functions. (line 92) * number of actual arguments: Functions. (line 92)
* N_: Preprocessor. (line 91) * N_: Preprocessor. (line 91)
* OLD_EXCEPTION_CODES, preprocessor symbol: 43x-440. (line 19) * OLD_EXCEPTION_CODES, preprocessor symbol: 43x-440. (line 19)
* on statement: Polling. (line 84) * on statement: Polling. (line 84)
skipping to change at line 17975 skipping to change at line 18437
* pidfile: conf-base. (line 36) * pidfile: conf-base. (line 36)
* pidfile <1>: conf-calloutd-setup. (line 9) * pidfile <1>: conf-calloutd-setup. (line 9)
* pidfile <2>: pmult-conf. (line 17) * pidfile <2>: pmult-conf. (line 17)
* pidfile <3>: Starting and Stopping. * pidfile <3>: Starting and Stopping.
(line 60) (line 60)
* pidfile, --pidfile calloutd option, summary: invocation-calloutd. * pidfile, --pidfile calloutd option, summary: invocation-calloutd.
(line 26) (line 26)
* pidfile, --pidfile mailfromd option, summary: General Settings. * pidfile, --pidfile mailfromd option, summary: General Settings.
(line 50) (line 50)
* pies: pmult. (line 30) * pies: pmult. (line 30)
* pipe: Filters. (line 6)
* pmilter-debug: pmult-debug. (line 46) * pmilter-debug: pmult-debug. (line 46)
* pmult: pmult. (line 6) * pmult: pmult. (line 6)
* pmult debugging: pmult-conf. (line 6) * pmult debugging: pmult-conf. (line 6)
* pmult, described: pmult. (line 6) * pmult, described: pmult. (line 6)
* poll command, standard verification: Polling. (line 148) * poll command, standard verification: Polling. (line 148)
* poll command, strict verification: Polling. (line 154) * poll command, strict verification: Polling. (line 154)
* poll keyword: Polling. (line 137) * poll keyword: Polling. (line 137)
* poll statement, defined: Polling. (line 137) * poll statement, defined: Polling. (line 137)
* poll.mf: Compatibility Callout functions. * poll.mf: Compatibility Callout functions.
(line 10) (line 10)
skipping to change at line 18025 skipping to change at line 18488
* primitive_hasns: Simplified DNS functions. * primitive_hasns: Simplified DNS functions.
(line 202) (line 202)
* primitive_hostname: Simplified DNS functions. * primitive_hostname: Simplified DNS functions.
(line 97) (line 97)
* primitive_ismx: Simplified DNS functions. * primitive_ismx: Simplified DNS functions.
(line 128) (line 128)
* primitive_resolve: Simplified DNS functions. * primitive_resolve: Simplified DNS functions.
(line 152) (line 152)
* printf: Preprocessor. (line 52) * printf: Preprocessor. (line 52)
* probe message: SAV. (line 20) * probe message: SAV. (line 20)
* procedures: Functions. (line 178) * procedures: Functions. (line 179)
* prog: Handlers. (line 6) * prog: Handlers. (line 6)
* program_trace: Debugging Functions. (line 96) * program_trace: Debugging Functions. (line 96)
* progress: EOM Functions. (line 8) * progress: EOM Functions. (line 8)
* prompt, --prompt, mtasim option, summary: option summary. (line 98) * prompt, --prompt, mtasim option, summary: option summary. (line 98)
* ptr_validate: Simplified DNS functions. * ptr_validate: Simplified DNS functions.
(line 193) (line 193)
* public: Variables. (line 52) * public: Variables. (line 52)
* public <1>: Functions. (line 60) * public <1>: Functions. (line 60)
* Q: Filters. (line 225)
* qr: String transformation. * qr: String transformation.
(line 115) (line 115)
* qualifier, function declaration: Functions. (line 60) * qualifier, function declaration: Functions. (line 60)
* qualifiers, variable declaration: Variables. (line 52) * qualifiers, variable declaration: Variables. (line 52)
* quarantine: Quarantine functions. * quarantine: Quarantine functions.
(line 6) (line 6)
* quit: conf-timeout. (line 69) * quit: conf-timeout. (line 69)
* quit <1>: protocol-calloutd. (line 165) * quit <1>: protocol-calloutd. (line 165)
* quoted-printable: Filters. (line 224)
* raising exceptions: Catch and Throw. (line 151) * raising exceptions: Catch and Throw. (line 151)
* rate: Rate limiting functions. * rate: Rate limiting functions.
(line 6) (line 6)
* rate database: Database Formats. (line 27) * rate database: Database Formats. (line 27)
* rateok: Rate limiting functions. * rateok: Rate limiting functions.
(line 26) (line 26)
* rateok.mf: Rate limiting functions. * rateok.mf: Rate limiting functions.
(line 30) (line 30)
* rc.mailfromd: Starting and Stopping. * rc.mailfromd: Starting and Stopping.
(line 71) (line 71)
skipping to change at line 18097 skipping to change at line 18562
* requiring modules: import. (line 6) * requiring modules: import. (line 6)
* reserved words: Reserved Words. (line 6) * reserved words: Reserved Words. (line 6)
* resolv-conf-file, --resolv-conf-file calloutd option, summary: invocation-call outd. * resolv-conf-file, --resolv-conf-file calloutd option, summary: invocation-call outd.
(line 30) (line 30)
* resolv-conf-file, --resolv-conf-file mailfromd option, summary: General Settin gs. * resolv-conf-file, --resolv-conf-file mailfromd option, summary: General Settin gs.
(line 61) (line 61)
* resolve: Simplified DNS functions. * resolve: Simplified DNS functions.
(line 184) (line 184)
* return in begin: begin/end. (line 53) * return in begin: begin/end. (line 53)
* return in end: begin/end. (line 53) * return in end: begin/end. (line 53)
* return statement, defined: Functions. (line 163) * return statement, defined: Functions. (line 164)
* returning from a catch: Catch and Throw. (line 79) * returning from a catch: Catch and Throw. (line 79)
* returning from an exception handler: Catch and Throw. (line 79) * returning from an exception handler: Catch and Throw. (line 79)
* returns statement, function definition: Functions. (line 45) * returns statement, function definition: Functions. (line 45)
* reuseaddr: conf-server. (line 65) * reuseaddr: conf-server. (line 65)
* reuseaddr <1>: conf-calloutd-server. * reuseaddr <1>: conf-calloutd-server.
(line 64) (line 64)
* revip: String manipulation. (line 223) * revip: String manipulation. (line 223)
* revip, definition of: Some Useful Functions. * revip, definition of: Some Useful Functions.
(line 15) (line 15)
* revstr: String manipulation. (line 75) * revstr: String manipulation. (line 75)
* rewind: I/O functions. (line 171) * rewind: I/O functions. (line 171)
* rfc822: Filters. (line 59)
* right angle bracket (>), > operator: Relational expressions. * right angle bracket (>), > operator: Relational expressions.
(line 6) (line 6)
* right angle bracket (>), >= operator: Relational expressions. * right angle bracket (>), >= operator: Relational expressions.
(line 6) (line 6)
* rindex: String manipulation. (line 81) * rindex: String manipulation. (line 81)
* rindex <1>: String manipulation. (line 82) * rindex <1>: String manipulation. (line 82)
* RSET: rset. (line 6) * RSET: rset. (line 6)
* rset: conf-timeout. (line 66) * rset: conf-timeout. (line 66)
* rtrim: String manipulation. (line 157) * rtrim: String manipulation. (line 157)
* run: protocol-calloutd. (line 111) * run: protocol-calloutd. (line 111)
skipping to change at line 18348 skipping to change at line 18814
* string <4>: Predefined variables. * string <4>: Predefined variables.
(line 74) (line 74)
* string_list_iterate: Preprocessor. (line 66) * string_list_iterate: Preprocessor. (line 66)
* strip_domain_part: String manipulation. (line 194) * strip_domain_part: String manipulation. (line 194)
* strip_domain_part, definition of: Some Useful Functions. * strip_domain_part, definition of: Some Useful Functions.
(line 38) (line 38)
* strip_domain_part.mf: String manipulation. (line 199) * strip_domain_part.mf: String manipulation. (line 199)
* substr: String manipulation. (line 96) * substr: String manipulation. (line 96)
* substr <1>: String manipulation. (line 97) * substr <1>: String manipulation. (line 97)
* substring: String manipulation. (line 109) * substring: String manipulation. (line 109)
* success, exception type: Built-in Exceptions. (line 106) * success: Built-in Exceptions. (line 113)
* supplementary groups: Starting and Stopping. * supplementary groups: Starting and Stopping.
(line 6) (line 6)
* switch: Conditionals. (line 44) * switch: Conditionals. (line 44)
* switch statement: Conditionals. (line 44) * switch statement: Conditionals. (line 44)
* syntax check: Testing Filter Scripts. * syntax check: Testing Filter Scripts.
(line 9) (line 9)
* syntax-check, --syntax-check mailfromd option, introduced: Testing Filter Scri pts. * syntax-check, --syntax-check mailfromd option, introduced: Testing Filter Scri pts.
(line 9) (line 9)
* syntax-check, --syntax-check mailfromd option, summary: Logging and Debugging Options. * syntax-check, --syntax-check mailfromd option, summary: Logging and Debugging Options.
(line 136) (line 136)
skipping to change at line 18392 skipping to change at line 18858
(line 71) (line 71)
* tbf database: Database Formats. (line 41) * tbf database: Database Formats. (line 41)
* tbf_rate: Rate limiting functions. * tbf_rate: Rate limiting functions.
(line 43) (line 43)
* tempfail: Actions. (line 28) * tempfail: Actions. (line 28)
* tempfail action, defined: Actions. (line 28) * tempfail action, defined: Actions. (line 28)
* tempfail action, introduced: Start Up. (line 37) * tempfail action, introduced: Start Up. (line 37)
* tempfail in begin: begin/end. (line 55) * tempfail in begin: begin/end. (line 55)
* tempfail in end: begin/end. (line 55) * tempfail in end: begin/end. (line 55)
* tempfile: I/O functions. (line 166) * tempfile: I/O functions. (line 166)
* temp_failure, exception type: Built-in Exceptions. (line 96) * temp_failure: Built-in Exceptions. (line 104)
* test, --test mailfromd option, introduced: Testing Filter Scripts. * test, --test mailfromd option, introduced: Testing Filter Scripts.
(line 60) (line 60)
* test, --test mailfromd option, specifying handler name: Testing Filter Scripts . * test, --test mailfromd option, specifying handler name: Testing Filter Scripts .
(line 99) (line 99)
* test, --test mailfromd option, summary: Operation Modifiers. * test, --test mailfromd option, summary: Operation Modifiers.
(line 17) (line 17)
* Texinfo: Conventions. (line 6) * Texinfo: Conventions. (line 6)
* textdomain: NLS Functions. (line 99) * textdomain: NLS Functions. (line 99)
* Thomas Lynch: Acknowledgments. (line 44) * Thomas Lynch: Acknowledgments. (line 44)
* throw: Catch and Throw. (line 151) * throw: Catch and Throw. (line 151)
skipping to change at line 18515 skipping to change at line 18981
* variable shadowing: Shadowing. (line 76) * variable shadowing: Shadowing. (line 76)
* variable values, setting from the command line: Testing Filter Scripts. * variable values, setting from the command line: Testing Filter Scripts.
(line 72) (line 72)
* variable, --variable mailfromd option, introduced: Testing Filter Scripts. * variable, --variable mailfromd option, introduced: Testing Filter Scripts.
(line 72) (line 72)
* variable, --variable mailfromd option, summary: General Settings. * variable, --variable mailfromd option, summary: General Settings.
(line 84) (line 84)
* variable, assigning a value: Variables. (line 85) * variable, assigning a value: Variables. (line 85)
* variable, precious: rset. (line 13) * variable, precious: rset. (line 13)
* variables, accessing from catch: Catch and Throw. (line 131) * variables, accessing from catch: Catch and Throw. (line 131)
* variables, automatic: Functions. (line 218) * variables, automatic: Functions. (line 219)
* variables, declaring: Variables. (line 35) * variables, declaring: Variables. (line 35)
* variables, defined: Variables. (line 6) * variables, defined: Variables. (line 6)
* variables, introduced: HELO Domain. (line 19) * variables, introduced: HELO Domain. (line 19)
* variables, local: Functions. (line 218) * variables, local: Functions. (line 219)
* variables, precious: Variables. (line 59) * variables, precious: Variables. (line 59)
* variables, predefined: Predefined variables. * variables, predefined: Predefined variables.
(line 6) (line 6)
* variables, referencing: Variables. (line 104) * variables, referencing: Variables. (line 104)
* variadic function: Functions. (line 127) * variadic function: Functions. (line 127)
* verbose, --verbose, mtasim option, summary: option summary. (line 121) * verbose, --verbose, mtasim option, summary: option summary. (line 121)
* verbosity level: Logging and Debugging. * verbosity level: Logging and Debugging.
(line 100) (line 100)
* vercmp: String manipulation. (line 163) * vercmp: String manipulation. (line 163)
* Verifying script syntax: Using MFL Mode. (line 68) * Verifying script syntax: Using MFL Mode. (line 68)
* verp_extract_user: String manipulation. (line 232) * verp_extract_user: String manipulation. (line 232)
* version, --version calloutd option, summary: invocation-calloutd. * version, --version calloutd option, summary: invocation-calloutd.
(line 145) (line 145)
* void functions: Functions. (line 178) * void functions: Functions. (line 179)
* vrfy: protocol-calloutd. (line 26) * vrfy: protocol-calloutd. (line 26)
* VRFY, SMTP statement: conf-callout. (line 27) * VRFY, SMTP statement: conf-callout. (line 27)
* when keyword: Polling. (line 84) * when keyword: Polling. (line 84)
* while: Loops. (line 6) * while: Loops. (line 6)
* while loop: Loops. (line 67) * while loop: Loops. (line 67)
* whitelisting: Greylisting. (line 98) * whitelisting: Greylisting. (line 98)
* WITH_DSPAM: DSPAM. (line 10) * WITH_DSPAM: DSPAM. (line 10)
* WITH_GEOIP: Legacy geoip support. * WITH_GEOIP: Legacy geoip support.
(line 34) (line 34)
* WITH_GEOIP <1>: Legacy geoip support. * WITH_GEOIP <1>: Legacy geoip support.
skipping to change at line 18556 skipping to change at line 19022
(line 111) (line 111)
* WITH_GEOIP2 <1>: Geolocation functions. * WITH_GEOIP2 <1>: Geolocation functions.
(line 6) (line 6)
* write: I/O functions. (line 180) * write: I/O functions. (line 180)
* write-timeout: pmult-client. (line 57) * write-timeout: pmult-client. (line 57)
* write_body: I/O functions. (line 189) * write_body: I/O functions. (line 189)
* W_OK: System functions. (line 20) * W_OK: System functions. (line 20)
* X, -X, mtasim option, summary: option summary. (line 94) * X, -X, mtasim option, summary: option summary. (line 94)
* x, transform flag: String transformation. * x, transform flag: String transformation.
(line 46) (line 46)
* XML: Filters. (line 228)
* xref, --xref mailfromd option, summary: Logging and Debugging Options. * xref, --xref mailfromd option, summary: Logging and Debugging Options.
(line 170) (line 170)
* X_OK: System functions. (line 23) * X_OK: System functions. (line 23)
* Zeus Panchenko: Acknowledgments. (line 29) * Zeus Panchenko: Acknowledgments. (line 29)
 End of changes. 157 change blocks. 
444 lines changed or deleted 912 lines changed or added

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