[Mimedefang] skip MD for one user?
    David F. Skoll 
    dfs at roaringpenguin.com
       
    Mon Aug 19 21:02:00 EDT 2002
    
    
  
On Mon, 19 Aug 2002, Douglas J Hunley wrote:
> I've got MD installed and working beautifully (nice product!
> kudos!), but one of my users is adamant that *he* be the one to
> determine what mail is junk and what attachments are harmful. How
> can I alter my filter to *entirely* skip processing of mail for this
> one user? TIA.
It's a little complicated because an incoming SMTP mail can be for
more than one user.  So:
- Make sure you're running Sendmail 8.12.5
- Make sure locally-submitted e-mail goes via SMTP and is scanned by MIMEDefang
- Then, assuming the user is called "smartaleck at mydomain.net", do this:
sub filter_begin {
	my($recip);
	foreach $recip (@Recipients) {
		# Remove angle-brackets; convert to lower-case
		$recip =~ tr/<>//d;
		$recip = lc($recip);
		if ($recip eq 'smartaleck at mydomain.net') {
			if (stream_by_recipient()) {
				return
			}
		}
	}
	# At this point, if smartaleck at mydomain.net was in the list of
	# recipients, the mail is re-sent one time for each recipient.
	# From here on in, we need test $Recipients[0] only.
}
sub filter {
	my($entity, $fname, $ext, $type) = @_;
	return action_accept() if ($Recipients[0] eq 'smartaleck at mydomain.net');
	# Rest of filter for non-smart-alecks...
}
sub filter_multipart {
	my($entity, $fname, $ext, $type) = @_;
	return action_accept() if ($Recipients[0] eq 'smartaleck at mydomain.net');
	# Rest of filter_multipart for non-smart-alecks...
}
Regards,
David.
    
    
More information about the MIMEDefang
mailing list