[Mimedefang] Using Spamassassin's spamd/c

jmiller at purifieddata.net jmiller at purifieddata.net
Mon Oct 14 14:51:01 EDT 2002


Haven't looked into spamd/c much... but I commented on whitelisting...

On Mon, 14 Oct 2002 listuser at neo.pittstate.edu wrote:

> I couldn't find a search ability for the archives but I did check the more
> recent ones and didn't see anything that answer my question.
>
> I'm trying to figure out how to make mimedefang use SA's spamd/spamc.  I
> really like MD's configuration ability for the headers/report/subject
> line.  I don't like the fact that it appears to spawn a SA process for
> each incoming message (this is what it appears to be doing).  I tried a
> spamd/spamc setup with procmail today and liked the way it conserved
> resources.  I also liked the ability to do DNSBl and razor checks.  I
> really need the reporting and conditional subject editing that MD gives me
> though.  Can anyone tell me how to use spamd with MD, specifically MD's
> multiplexor?
>
> I understand that using SA with MD prevents a lot of SA features from
> working.  The way I understand it, no SA config files are read when SA is
> run for MD and the MD SA config files are greatly limited in what actually
> works.  If any one can speak to this, I'd appreciate it.  I'm not sure
> what all I'm missing out on.
>
> Finally, my last question is about whitelisting local users, ie SPAMFRIEND
> users that don't want filtered mail.  In the procmail setup, I was going
> to either look for a $HOME/.nospamfilter in the user's home directory or
> refer to a text file of userids that want unfiltered mail.  The text file
> would be built from Sendmail's access list of SPAMFRIEND (or the 8.12
> syntax) users.  Is there a way to make MD also check for either of these
> possibilities?
>
> Thanks
>  Justin
>

The short answer on whitelisting, yes, mimedefang can do it.

I haven't used the default filter, so I'm not sure if it's already got a
provision for this in it, but I added something similar to the following
above where I do my spamassassin checks. It'll open two different files
(each with one e-mail address per line), one for recipients, one for
senders, and if it finds a match, it won't run spamassassin on the
message. Please note, though this code should work, it doesn't have all
the extra fancy data integrity checks in it, or even checks to make sure
it can open the whitelist files. I tried to keep it short so it'd be
easier to understand.

my $whitelisted;
open(RWL,"< /etc/mail/recipient_whitelist");
RWLLOOP: while(<RWL>) {
	chomp;
	foreach my $recipient (@Recipients) {
		$recipient =~ s/[<>]//g; # braces not desireable
		if ($recipient =~ /$_/i) {
			whitelisted++; last RWLLOOP;
		}
	}
}
close(RWL);
unless ($whitelisted) {
	open(SWL,"< /etc/mail/sender_whitelist");
	while (<SWL>) {
		chomp;
		if ($Sender =~ /$_/i) {
			$whitelisted++; last;
		}
	}
	close(RWL);
}
if ( (! $whitelisted) && $Features{SpamAssassin} ) {
	# ... do spam checks
} else {
	syslog('warning',"$MsgID: Whitelisted");
}


--
Josh I.




More information about the MIMEDefang mailing list