Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: it4sohoPosted on 2009-09-30 at 09:59:28ID: 25460866
There is an easier solution...
r.com" -- so long as the last part is .spammer.com. Thus, bill@not-a-spammer.com does NOT match (it doesn't match the first rule, and there is not a . in front of spammer.com, so it doesn't match the 2nd either)
Standard QMail includes a file in /var/qmail/control called "badmailfrom"
Simply add the domains you want to block in that file and you're set... for example:
.*\ @.*
!.*@.*\..*
.*%.*
@spammer.com
The first line says you won't accept mail from domains with a SPACE in the domain name (clearly illegal)
The next line says you won't accept mail from domains with both a ! and @ in them (a common old-time hack)
The 3rd line says you won't accept mail from domains or users with a % in them (also illegal)
The LAST line says you won't accept mail from anyone at spammer.com (substitute your own spam-source domain)
NOTE: the first 3 should be in ALL QMail installs... the last has one problem... if they say the mail is from bob@mail.spammer.com, your rule won't match. Now, the first attempt to fix this might be to make the line say just:
spammer.com
But in that case, you'll also block an e-mail from bill@not-a-spammer.com... so here's the BEST way.... (using 2 lines!):
@spammer.com
.*@.*\.spammer.com
which says you block anything that ends in @spammer.com, then you ALSO block anything that is of the form "somebody@something.spamme
Probably WTMI... but now you know how to block messages!
BTW: there is also a badmailto file -- so you can likewise block messages from EVER going to specific places.
The DEFAULT entries should look like:
[\(\)]
[\{\}]
@.*@
[\%]
[\!]
Line 1: No parens
Line 2: No braces
Line 3: No brackets
Line 4: No double-@'s
Line 5: No %
Line 6: No !
The latter two FORCE your users to use the more modern (and more globally accepted "name@domain" format, as opposed to the older (and depreciated) domain!user)... and QMail has special-uses for the otherwise illegal character of %
So, to disallow ANY messages going from your server to hotmail.com, just add
@hotmail.com
to the bottom of badmailto and voila --
I hope this helps... in spite of the WTMI!
Dan
IT4SOHO
WTMI = "Way Too Much Information"