[Mimedefang] talking to and changing mimedefang in real-time...
David F. Skoll
dfs at roaringpenguin.com
Tue Sep 3 09:48:01 EDT 2002
On Monday 02 September 2002 10:15, Tony Nugent wrote:
> Exactly what constitutes a "suspicious" message (or part)?
It depends on the virus scanner. I have no idea. :-)
> Is there an easy way to trigger a function call based on a date or
> timeout alarm? (It doesn't need to interrupt anything, just flag
> that the alarm/timeout has occurred when its status is next checked
> and then reset in the filter).
No, but it's probably cheap enough to do something like this in
your filter:
$LastDidTimerJob = 0;
$JobInterval = 86400; /* Once per day */
sub filter_begin {
if (time() - $LastDidTimerJob > 86400) {
$LastDidTimerJob = time();
DoTimerJob();
}
#...
}
However, it's probably unnecessary on machines which get a decent volume
of e-mail, because the Perl processes get killed after 100 messages anyway.
It's probably simpler to do one-shot initializations right in the filter
rules, outside any subroutine.
> What I have done allows me to change the runtime behaviour of the
> filter by literally sending it a message...
This is rather dangerous, unless you have a strong method of authentication
like gnupg.
> As for getting mimedefang to do cron jobs, all that is needed is to
> set up the action and a tigger in the filter, and periodically
> generate emails that make happen whatever you may want defang to do.
That's pretty cool...
> Another example use: for some reason you might want to have
> defang deny relay to/from certain places/users and at specific
> times, with the timing and actions controlled from a cron job or
> manually with an administrative email.
As someone else wrote earlier, you can just do a "mimedefang reread"
to force the filter rules to be reloaded. If you only do it a few times
a day, the performance hit is not too bad.
> Magic indeed... I have mimedefang doing all sorts of amazing things
> for me with the email here, it all works exactly as advertised :)
Thanks! :-)
Regards,
David.
More information about the MIMEDefang
mailing list