[Mimedefang] add_recipient and delete_recipient

Javier Kohan jktmp01 at gmail.com
Mon Jul 18 19:52:50 EDT 2016


El 18/7/2016 a las 19:13, J.J. Day escribió:
> 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:
> spam.mail at example.net		review+spam_mail

As you are using virtusertable, spam.mail at example.net is a local
address. Are the rest of the recipients (ie $Recipìents[0] ) also local
to the machine running mimedefang ?. That could be a difference, rather
than invoking those functions from filter_end. 

In my case, as a gateway server, the recipients are not local and
instead have to be routed to another server. If Dianne is reading:
should it work in my configuration regardless of that ?

Thank you both.

Regards

Javier





More information about the MIMEDefang mailing list