[Mimedefang] Tracing/Debugging MIMEDefang

Michael Sims michaels at crye-leike.com
Wed Feb 25 10:15:54 EST 2004


Peter A. Cole wrote:
> Hi all,
>
> What's the best way to see what actions are happening when
> mimedefang-filter processes spam and/or virii?

If I'm trying to troubleshoot a problem with my filter, I'll do the
following:

(1) After altering the filter, I will tail /var/log/maillog just to make
sure that my filter isn't printing anything to STDERR (happens most
frequently with me with typos).
(2) I'll then add calls to md_syslog to print debug information in my
Mimedefang log file.
(3) Sometimes I'll temporarily use action_add_header() to add debug
information directly into the headers of a message I'm using as a test.

> I have a problem whereby when I receive spam, not only does it get
> sent to my spamdrop mailbox, but it still gets delivered to the
> original recipient.

I looked at your filter.  You need to change this:

foreach $recip (@recipients) {

to this:

foreach $recip (@Recipients) {

Perl variables are case sensitive.  In your filter, @recipients is not
defined so the foreach loop will never be entered.

> And, to add to the confusion, if I send a test spam message from one
> of my local accounts to another local account, it gets delivered
> twice to my spamdrop (once on the way out to my ISP's smarthost and
> once when fetchmail retrieves it) and once to the original recipient.

You may want to consider skipping the spam assassin check (and adding to the
spamdrop) on messages relayed from trusted hosts.  There are lots of
examples in the list archives on how to do this.

HTH...

___________________________________________
Michael Sims
Project Analyst - Information Technology
Crye-Leike Realtors
Office: (901)758-5648  Pager: (901)769-3722
___________________________________________



More information about the MIMEDefang mailing list