> Johannes russek wrote:
> > i'm still rewriting some plugins for our demands and i
> wondered, if there is
> > a hook qpsmtpd calls for a plugin to do some initialisation, ie read in
> > configuration data and store that stuff in memory ($self) so
> that isnt done
> > each time a mail comes in?
> > is that pre_connection?
>
> Did you see README.plugins? Specifically the sections on register() and
> init(). You should also see if there is a plugin that already does
> something like what you are doing and see how that plugin does is (i.e.,
> if you are writing a connect plugin, take a look at all of the
> hook_connect() subs).
>
> John
>
hi john,
yes i already found that register() is the method i've been searching for.
i'm done with that patch and it's check_content_type by Peter J. Holzer.
i removed the dynamic sub and replaced it by a parser that transforms the
regular expression (if it isnt just a pattern) into a pattern which than
gets precompiled via qr/pattern/. although, that hole parsing precompiling
is done at plugin initialisation (in the register() function), while the
precompiled regular expressions are used during the mailprocessing.
basically, that should really speed up things while mailprocessing.
it has some flaws, though: you can't use code evaluation (like (?{}) or
(??{})) in a match in the config, and nested delimiters won't work. though,
both are things that are rather unlikely in a config file for
check_content_type :)
if you like, i will be happy to send my patch within the next few hours, or
maybe tomorrow.
regards, johannes