On 2006-07-01 11:32:02 -0500, Larry Nedry wrote: > My current problem is, in what order do the plugins need to be listed in > the config/plugins file? How is this determined? I've managed to find > example config files that have been helpful and sometimes a plugin's docs > will say where it should be in the list but not in all cases. > This raises a bigger question for me. As I understand this, certain [...] > plugins have to be executed before or after certain others. I suspect, for > example, that if I placed check_earlytalker last in the list, it either > wouldn't work or it would make qpsmtpd much less efficient.
In many cases it doesn't matter:
* If two plugins use different hooks, the order in the file is
irrelevant because each will only called by the appropriate hook.
* If the plugins use the same hook, but perform independent actions, it
doesn't matter, either - but you may want to invoke cheaper tests
first for better performance.
The remaining case is where plugins use the same hook and depend on each
other in some way. In this case order is important. For example, I have
written a plugin (aliases_check) which doesn't only check if the address
is an alias (as the name implies) but also reads some per-recipient
configuration and stores them in a transaction note. Some other plugins
check for this configuration. Obviously they have to be called after
aliases_check - if they are called before, their configuration hasn't
been read yet. Another, less obvious example is the rcpt_accept plugin
in contrib, which simply returns OK for every recipient. After that, no
other plugin will be called in the rcpt hook, since the recipient has
already been accepted. So this plugin must be the last plugin which
registers for the rcpt hook.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | [EMAIL PROTECTED] | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
pgpDHsm2XAClm.pgp
Description: PGP signature
