[Mimedefang] RE: MDLOG Problem

Yizhar Hurwitz yizhar at mail.com
Wed Jul 25 16:31:57 EDT 2007


HI.

> From: "Mike Carlson" <mike at mcarlson.net>
>
> How would I tweak it so that it writes a line for mail_in when its a good 
> message and spam when its been tagged? 
>
>   

You can add a "return" command, like this:

            if ($hits >= $req) {
                #action_change_header("X-Spam-Score", "$hits ($score) 
$names");
                action_change_header("Subject", "(SPAM) $hits $Subject");
                md_graphdefang_log('spam', $hits, $RelayAddr);

                # If you find the SA report useful, add it, I guess...
                action_add_part($entity, "text/plain", "-suggest",
                                "$report\n",
                                "SpamAssassinReport.txt", "inline");
		return;
            } else {

 


If on the other hand you plan to use "else" statements as other suggested,
you need to make sure that you don't miss any situation because of the 
nested if statements.

For example:

if (condition1) {
    run spamassassin check;
    if (condition2) {
        actionA;
     } else {
        actionB;
    }
}

Oops, I missed the situation where condition1 is false, and I need an 
additional "else" statement at the end.

As much as your if statements are nested, this can be confusing.

Yizhar Hurwitz,
http://yizhar.mvps.org





More information about the MIMEDefang mailing list