Apart from the milter handlers described in the previous section, MFL provides several special handlers, that serve as hooks, allowing the programmer to insert code in certain important points of the control flow.
Syntactically, special handlers are similar to milter state handlers, i.e. they are defined as:
prog handler do ... done
(handler being the handler name).
Special handlers can be subdivided into three groups.
The first group are begin
and end
handlers. These
are run at the beginning and before the end of each SMTP session and
are used to provide a session-specific initialization and cleanup
routines.
The second group are startup
and shutdown
handlers,
which provide global initialization and cleanup routines. These
handlers are invoked exactly once: startup
when
mailfromd
has started up, but hasn’t yet begun to serve
milter requests, and shutdown
when mailfromd
is about
to terminate.
Finally, the action
handler is run before executing each
reply action (see reply actions).
• begin/end | Session ‘begin’ and ‘end’ special handlers. | |
• startup/shutdown | Global startup and shutdown handlers. | |
• action hook | Action hook handler. |