So I tried this:

            $SpamBox = 'essenz_spam@localhost';

            if ($hits < $req) {
                action_change_header("X-NoSpam-Score", "$hits ($score) $names");
            }
            if ($hits >= $req && $hits < 15) {
                action_change_header("X-Spam-Score", "$hits ($score) $names");
                delete_recipient('j...@essenz.com');
                add_recipient($SpamBox);
            }
            if ($hits >= 15) {
                action_discard();
            }

And it appears to work. But I am concerned about spammers trying to use 
alternate means of delivery, like my username @ FQDN, which is 
ess...@bjork.essenz.com not j...@essenz.com which is done in Sendmail’s 
virtusertable. 

If I call delete_recipient(); with no argument, does it act as a catch-all and 
delete “ALL” recipients?

Or do have do something like:

foreach(@Recipients)
{
delete_recipient($_);
}

Then

add_recipient($SpamBox);

Or could I just null the @Recipients array (@Recipients = (); 
add_recipient($SpamBox);)

It is a current Sendmail, and this server only serves one email user, me…

-John

> On Oct 18, 2018, at 9:30 AM, Dianne Skoll <dia...@skoll.ca> wrote:
> 
> Hi,
> 
>>            if ($hits >= $req) {
>>                action_change_header("X-Spam-Score", "$hits ($score) $names");
>>                resend_message($SpamBox);
>>                action_discard();
>>            } 
> 
> Rather than using resend_message to resend the message, if you have
> a new-enough version of Sendmail you can use delete_recipient to delete all
> of the original recipients and then add_recipient to add $SpamBox as
> a recipient.  You have to loop over @Recipients to delete all the
> original recipients.
> 
> Otherwise, you could add a magical header to the message and look for
> it the next time around.  You have to be careful to (1) delete the
> magical header before letting the mail go out if it's not being
> redirected, and (2) only trust it if the mail does originate from
> localhost.
> 
> Regards,
> 
> Dianne.
> _______________________________________________
> NOTE: If there is a disclaimer or other legal boilerplate in the above
> message, it is NULL AND VOID.  You may ignore it.
> 
> Visit http://www.mimedefang.org and http://www.roaringpenguin.com
> MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to