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

10.3 Developing Modules

If aegee-milter considers a symbol to be loaded as module, it extracts and executes a function called ’init’ from the dlpreopened object. If this function exists, and returns a SoModule object, then the module is loaded and added to AegeeMilter::so_modules.

Modules are executed for each recipient in the order they are loaded by aegee-milter and the order of loading depends on the order modules are appended to aegee-milter during linking.

Each module derives from the SoModule class.

aegee-milter offers a module to store data per SMTP session, per transaction and per recipient.

When a method from a module is called, the first passed argument is of type Privdata.

To compare, whether for two recipients a module will have the same results, on the SMTP transaction (accept/reject/reject stating the mesage was quarantiened), the core calls for the second recipient on the Equal method with two recipients as parameter. If it returns true, then the core executes that module only once, for the first recipient, and the result of the execution is applied to both recipients.

Note, that if Equals() returns false, the implications are not only increased run-time needs. Depending on the mode of aegee-milter, this can segment the message, in one way or another imposing delivery delays.

aegee-milter calls the Run method of the modules at these stages:

To see at which stage a module is called, it can execute