Next: , Previous: , Up: MFL   [Contents][Index]


4.15 Initialization and Cleanup Handlers

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).