You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by aubreyL <au...@emailacs.com> on 2006/12/07 18:01:34 UTC

forwarding email

OS - slackware 11.0
MDA - sendmail 8.13.8
mimedefang version 2.58
SpamAssassin version 3.1.7
  running on Perl version 5.8.8


I have one user that has to get email forwarded from an old account to 
the server that I administer.  I have spam going to a spamdrop via 
MiMEDefang.  So I added this little bit into mimedefang-filter....


    # Spam checks if SpamAssassin is installed
    if ($Features{"SpamAssassin"}) {
        if (-s "./INPUTMSG" < 100*1024) {
            # Only scan messages smaller than 100kB.  Larger messages
            # are extremely unlikely to be spam, and SpamAssassin is
            # dreadfully slow on very large messages.
            my($hits, $req, $names, $report) = spam_assassin_check();
            my($score);
            if ($hits >= req) {
            #   action_discard();

                # Remove original recipients
                # Add a header with original recipients, just for info
                action_add_header("X-Orig-Rcpts", join(", ", @Recipients));

                # Remove original recipients
                foreach $recip (@Recipients) {
                delete_recipient($recip);
                }

                # Send to spam address
                add_recipient('spamdrop@mydomain.com');
                }

This works great, except for that email that is getting forwarded.  
Maybe 1 out of 45 messages are ham, the rest, spam.  The problem I have 
is the messages that are ham are getting sent to the spamdrop as well.  
All of the messages that get tagged as spam, get the spamassassin report 
attached.  But the ham messages that should not go to the spamdrop *do 
not* get a spamassassin report, or score.  If I take the message(s) out 
of the spamdrop, and run them through spamassassin, then they do not 
score high enough to get filtered.

Does anyone know why this is, or ever had an issue like this?

TIA
-Aubrey

Re: forwarding email

Posted by aubreyL <au...@emailacs.com>.
Jonas Eckerman wrote:
> This really would be more on topic on the MIMEDefang list, but here goes...
>
> You have a small but significant typo in your code:
>
>   
>>             if ($hits >= req) {
>>     
>
> You forgot the "$" in "$req".
>
> The effect of the above comparison is that all mail that scores above 0 (zero) are considered spam.
>
> Regards
> /Jonas
>   
omg  .....how embarrassing.  I'll go through my spamdrop now, and must 
be left alone for hours.  Thanks Jonas.

-=Aubrey=-

Re: forwarding email

Posted by Jonas Eckerman <jo...@frukt.org>.
This really would be more on topic on the MIMEDefang list, but here goes...

You have a small but significant typo in your code:

>             if ($hits >= req) {

You forgot the "$" in "$req".

The effect of the above comparison is that all mail that scores above 0 (zero) are considered spam.

Regards
/Jonas
-- 
Jonas Eckerman, FSDB & Fruktträdet
http://whatever.frukt.org/
http://www.fsdb.org/
http://www.frukt.org/