[techtalk] re: Send Mail or just Mail in General

Telsa Gwynne hobbit at aloss.ukuu.org.uk
Thu May 11 15:05:54 EST 2000


On Thu, May 11, 2000 at 07:45:50AM -0700 or thereabouts, Allen Heinecke wrote:
> I have question on mail. 
> 
> How do I block or autodelete all mail from a specific domain or email
> address?
> 
> Any help would be greatly appreciated.
> 
> Thank you in advance :)
> 
> -Lone

For MTAs:

If you are using exim, it's dead easy (which was wonderful when I
suddenly had to learn this immediately to stop a barrage of 
unwanted email shooting down my modem..):

sender_net_reject_recipients = IP address or range.
sender_host_reject_recipients = FQDN.

You can glob the latter: I have *.somesiteIhate.com in mine :)
Once you've changed that in /etc/exim/configure or whereever,
restart exim. Those will stop the machine even accepting email 
from that site.

If you are using sendmail, postfix or something, I have no idea but 
I expect there's a way.

Or you can use procmail, I expect: a friend uses a .procmailrc for
his personal email that drops anything from a range of addresses,
anything containing a Word file, anything from a list of known spam
relays... I only know how to use procmail for individual user accounts,
though. I don't know how you make it run for all mail arriving for
any user.

The rules would be something like (from said friend's _copious_
examples): 

:0:
* ^From: .*@aol\.com
/dev/null

:0 B:
* ^Content-Type: text/x-vcard
/dev/null

:0 B:
* [Ww][Ii][Nn][Mm][Aa][Ii][Ll]\.[Dd][Aa][Tt]
/dev/null

The disadvantage with this one is that you still accept the email,
and if the problem is massive amounts of unwanted mail clogging 
your system, you probably want to mess with the MTA itself. As I 
said, I was delighted to find how simple it was with exim. I haven't
dared look with sendmail! 

Telsa





More information about the Techtalk mailing list