Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email blocking question

Status
Not open for further replies.

SoonerIra

MIS
Dec 8, 2000
45
US
I am using sendmail as part of MailScanner an open source spam and virus scanning system. FYI, I also have an Exchange server behind this (not that it affects this problem.)

I need to block email sent from carl@internaluser.com to joe@dontwantemail.com.

Yes, it is a strange situation but it's too long to explain here.

I need to know how to do this through either sendmail or through Mailscanner. I can easily block everything from or to someone but to block based on from: AND to: is what I can't figure out how to do....
 
Have you tried setting up resipes in procmailrc? It allows for the ANDing of rule sets. In fact most spam control is done through procmail.

 
create a procmailrc file in your /etc folder with the following:

LOGFILE=/var/log/pm.log
LOG="
"
VERBOSE=yes
SHELL=/bin/sh

# Remove ## when debugging; set to no if you want minimal logging
##LOGABSTRACT=yes

#MAILDIR=$HOME/mail

#Recipe 10
# to Joe from Carl
:0
* ^From:.*carl@internaluser\.com
* ^To.*joe@dontwantemail\.com
{
LOG = "Carl Spam "
:0
/dev/null
}

That should do it, but you should do a google on procmail recipes to get an understanding.

Keith
 
Looks like it will work. Now I'm just trying to figure out how to make sendmail invoked by MailScanner use it.
 
Just create the /etc/procmailrc file. Ownership is mail user & root group. Permissions are 0644.

Your Sendmail/Mailscanner should automatically process it as soon as you drop it in - shouldn't have to restart Mailscanner.

Check your /var/log/ folder for the pm.log to view activity. As you eventually add recipes to procmailrc, you'll want to rotate the pm.log.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top