From: MIMEDefang [mailto:[email protected]] On Behalf
Of Javier Kohan
Sent: Thursday, July 14, 2016 3:21 PM
To: [email protected]
Subject: [Mimedefang] add_recipient and delete_recipient
Hello, Im trying to use those functions in filter_recipient and they
seem not to work, at least in the way I use them.
The inteded use is to check incoming mail for some particular users in a
border gateway and in case they match, rewrite their domain so
sendmail, via mailertable, can send to another server instead.
Schematically
filter_recipient {
...
if( $recipient meets some condition ) {
# change [email protected] to [email protected].
# change_domain() is checked to work
$newrec=change_domain($recipient) ;
add_recipient($newrec);
delete_recipient($recipient) # $recipient is the unmodified
argument of filter_recipient
}
....
return ( 'CONTINUE', 'ok' );
}
I checked via md_syslog in various places: the match, the values of
$recipient and $newrec, but sendmail logs shows the address unmodified
and sends it to domain1`s server
Is there anything wrong on how I assume those functions do work ?. Are
they restricted to only some filter_* and don“t work in
filter_recipient, or anything else I can be missing ?
Thanks
Javier
I know that I am coming to the conversation late, but FWIW I do a similar
process to redirect spam mail.
I am using FreeBSD, Sendmail, SpamAssassin 3.4.1 and mimedefang 2.78. I have
been using this for some time so the versions should not be relevant.
Since my redirection is after the spam is detected, the code is in sub
filter_end rather than filter_recipient.
if ($hits >= $req
or $Recipients[0] meets some condition
) {
md_graphdefang_log('spam', $hits, $RelayAddr);
action_change_header("X-Spam-Score", "$hits ($score)
$names");
# add the SA report
action_add_part($entity, "text/plain", "-suggest",
"$report\n",
"SpamAssassinReport.txt", "inline");
# then modify envelope to divert msg to the spam folder
# these are envelope procs & do not modify msg headers
my($spamfolder) = "<spam.mail\@example.net>";
delete_recipient($Recipients[0]);
add_recipient("$spamfolder");
} else {
And the virtusertable entry for Sendmail is:
[email protected] review+spam_mail
JJ
_______________________________________________
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 [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang