[Mimedefang] Question about resend_message() (Sendmail)

John Von Essen john at quonix.net
Thu Oct 18 09:57:40 EDT 2018


So I tried this:

            $SpamBox = 'essenz_spam at 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('john at 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 essenz at bjork.essenz.com not john at 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 <dianne at 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 at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang





More information about the MIMEDefang mailing list