[Mimedefang] New to MIMEDefang, a question or two
David F. Skoll
dfs at roaringpenguin.com
Tue Jul 30 17:30:01 EDT 2002
On Tue, 30 Jul 2002, Jim McCullars wrote:
> Hi, I'm in the process of installing MD and reading all the docs to get a
> handle on how it works. One thing I'm curious about - the man page says
> that any return value from filter_begin is ignored, and that most of the
> dispositions can be called only from filter - not filter_begin or
> filter_end. But the sample filter seems to violate this by calling
> action_quarantine_entire_message and action_discard from filter_begin. Is
> this allowed?
Yes; I need to clarify the man page. Any action which requires an
$entity argument can only be called from filter (or sometimes
filter_end). Likewise, any action which is specific to a part (like
action_drop, etc) can only be called from filter. Actions which affect
the entire message can be called from filter_begin, filter or filter_end.
> My second question is, I can see variables that refer to
> some header values, but is the body of the message readily available to
> the filter script?
Yes; you have to open the file "./INPUTMSG" for input.
> There are some catch phrases that appear in a lot of
> the spam I get that I may want to reject on. If this is possible, could
> someone provide a small code sample? Thanks!
if (open(IN, "<./INPUTMSG")) {
while(<IN>) {
if (/spam_phrase/i) {
# handle it
}
}
close(IN);
}
This is not foolproof. You're better off using SpamAssassin for spam
checks.
Regards,
David.
More information about the MIMEDefang
mailing list