You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by "Dan Mahoney, System Admin" <da...@prime.gushi.org> on 2004/09/16 01:13:23 UTC
Rule Suggestion
Guys,
Given that some spammers like to just slam mail at everyone at an entire
domain, is there an option to "greylist" these addresses?
For example, my father's wife peggy has the domain peggytaggart.com, she
ONLY gives out the peggy@ email address for this.
For some unknown reason, the whole domain is popular with spammers. I've
added a global rule in my virtusertable to just drop anything not-destined
for peggy:
Sep 15 04:07:37 prime sm-mta[42929]: i8F87Mn1042929:
<su...@peggytaggart.com>... please fuck off and die,spammer
Sep 15 04:07:37 prime sm-mta[42929]: i8F87Mn1042929:
<ti...@peggytaggart.com>... please fuck off and die,spammer
Sep 15 04:07:37 prime sm-mta[42929]: i8F87Mn1042929:
<st...@peggytaggart.com>... please fuck off and die,spammer
Sep 15 04:07:37 prime sm-mta[42929]: i8F87Mn1042929:
<st...@peggytaggart.com>... please fuck off and die,spammer
Sep 15 04:07:37 prime sm-mta[42929]: i8F87Mn1042929:
<sp...@peggytaggart.com>... please fuck off and die,spammer
Sep 15 04:07:37 prime sm-mta[42929]: i8F87Mn1042929:
<st...@peggytaggart.com>... please fuck off and die,spammer
Sep 15 04:07:37 prime sm-mta[42929]: i8F87Mn1042929:
<ss...@peggytaggart.com>... please fuck off and die,spammer
Sep 15 04:07:37 prime sm-mta[42929]: i8F87Mn1042929:
from=<Si...@americanemail.net>, size=0, class=0, nrcpts=0, proto=ESMTP,
daemon=MTA, relay=email.emailacct.com [69.150.223.63] (may be forged)
(What's really annoying is that sendmail doesn't log the ip of the remote
connection until it's done (if you're blocking them) -- I'd love to be
able to create an RBL on this and nip it in the bud).
However, while spamassassin seems to have whitelist_to (and I could
whitelist_to peggy@herdomain), this defeats any other spamassassin
tactics. I could also do blacklist_to herdomain.com but this would
effectively LIMIT her real mail. I guess what I'm looking to know is if
there's any way for users who get all the mail for a specific domain (like
she does) to list which ones are "real" (but still may get spam), and
which ones aren't (so they're likely definitely spam).
For example, I personally use ebay@, paypal@, sales@, etc to not only
sort, but to isolate where the address is being gleaned from. I've
recommended this procedure for a while.
Also, wouldn't it be a good idea for SpamAssassin to start going off on
multiple emails to the same domain from the same address/ip?
-Dan
--
"there is no loyalty in the business, so we stay away from things that piss people off"
-The Boss, November 12, 2002
--------Dan Mahoney--------
Techie, Sysadmin, WebGeek
Gushi on efnet/undernet IRC
ICQ: 13735144 AIM: LarpGM
Site: http://www.gushi.org
---------------------------
Re: Rule Suggestion
Posted by "Jack L. Stone" <ja...@sage-american.com>.
At 10:39 AM 9.16.2004 -0400, Ryan Moore wrote:
>Dan Mahoney, System Admin wrote:
>> Guys,
>>
>> Given that some spammers like to just slam mail at everyone at an entire
>> domain, is there an option to "greylist" these addresses?
>>
>> For example, my father's wife peggy has the domain peggytaggart.com, she
>> ONLY gives out the peggy@ email address for this.
>>
>> For some unknown reason, the whole domain is popular with spammers.
>> I've added a global rule in my virtusertable to just drop anything
>> not-destined for peggy:
>>
>
>I'm not sure if this would work given your setup, but worth mention
>perhaps. There is a milter designed to find out of the rcpt of a message
>is valid if the rcpt isn't local (ie: you gateway mail down to another
>box). Milter-ahead is the name, I use it sorta, I actually use
>milter-sender which has the same features of milter-ahead plus much
>more. You can get it from: http://www.milter.info
>
>
>
>Ryan Moore
>----------
Ryan: Did you compile a Berkely DB3 or better into sendmail?
I would like to use milter-sender, but no luck yet. Figured it was the DB2
in the base system sendmail-8.12.11.
Best regards,
Jack L. Stone,
Administrator
Sage American
http://www.sage-american.com
jacks@sage-american.com
Re: Rule Suggestion
Posted by "Dan Mahoney, System Admin" <da...@prime.gushi.org>.
On Wed, 15 Sep 2004, Kelson wrote:
> Dan Mahoney, System Admin wrote:
>> Yes, I know this. I actually wrote something to create a RBL based on
>> virus senders. I'd just like to be able to drop (or maybe teergrube) the
>> connection in the BEGINNING instead of after the hangup.
>
> Look into the sendmail config option BAD_RCPT_THROTTLE. The value is the max
> number of allowed invalid recipients after which sendmail starts delaying
> responses to sender. (Basically after each RCPT it sleeps before sending
> "user unknown.")
The "user unknown" response is the exception rather than the rule,
unfortunately. Normally all mail goes through unblocked. Unless I start
running sendmail as a milter, which I believe would remove any ability to
do user_prefs.
-Dan
--
"It's buttery kettle ASS corn!"
-Dan Mahoney, Ezzi Computers,
10/22/03, 2AM
--------Dan Mahoney--------
Techie, Sysadmin, WebGeek
Gushi on efnet/undernet IRC
ICQ: 13735144 AIM: LarpGM
Site: http://www.gushi.org
---------------------------
Re: Rule Suggestion
Posted by Kelson <ke...@speed.net>.
Dan Mahoney, System Admin wrote:
> Yes, I know this. I actually wrote something to create a RBL based on
> virus senders. I'd just like to be able to drop (or maybe teergrube)
> the connection in the BEGINNING instead of after the hangup.
Look into the sendmail config option BAD_RCPT_THROTTLE. The value is
the max number of allowed invalid recipients after which sendmail starts
delaying responses to sender. (Basically after each RCPT it sleeps
before sending "user unknown.")
Unfortunately the delay is (was) hardcoded to 1 second, but it'll at
least slow them down a little.
--
Kelson Vibber
SpeedGate Communications <www.speed.net>
Re: Rule Suggestion
Posted by "Dan Mahoney, System Admin" <da...@prime.gushi.org>.
On Wed, 15 Sep 2004, Matt Kettler wrote:
> At 07:13 PM 9/15/2004, Dan Mahoney, System Admin wrote:
>> For example, my father's wife peggy has the domain peggytaggart.com, she
>> ONLY gives out the peggy@ email address for this.
>>
>> For some unknown reason, the whole domain is popular with spammers. I've
>> added a global rule in my virtusertable to just drop anything not-destined
>> for peggy:
>>
>> Sep 15 04:07:37 prime sm-mta[42929]: i8F87Mn1042929:
>> <su...@peggytaggart.com>...
>
> Not just spammers, but viruses now do this kind of thing, purely automated,
> common as dirt.
>
>> (What's really annoying is that sendmail doesn't log the ip of the remote
>> connection until it's done (if you're blocking them) -- I'd love to be
>> able to create an RBL on this and nip it in the bud).
>
> Yeah, but it's not really that hard to parse it.. Find an "unknown user"
> message, grab the SMTP ID find the relay line with the same SMTP id.
Yes, I know this. I actually wrote something to create a RBL based on
virus senders. I'd just like to be able to drop (or maybe teergrube)
the connection in the BEGINNING instead of after the hangup.
> Simple example using grep:
>
> # grep "User unknown" /var/log/maillog:
> Sep 14 09:10:03 xanadu sendmail[14940]: i8EDA3Cw014940:
> <cu...@evi-inc.com>... User unknown
> <snip>
>
> # grep "i8EDA3Cw014940" /var/log/maillog
>
> Sep 14 09:10:03 xanadu milter-greylist: i8EDA3Cw014940: testmode: skipping
> greylist for recipient "<cu...@evi-inc.com>"
> Sep 14 09:10:03 xanadu sendmail[14940]: i8EDA3Cw014940:
> <cu...@evi-inc.com>... User unknown
> Sep 14 09:10:04 xanadu sendmail[14940]: i8EDA3Cw014940:
> from=<pl...@optonline.net>, size=0, class=0, nrcpts=0,
> proto=SMTP, daem
> on=MTA, relay=66.49.69.146.nw.nuvox.net [66.49.69.146]
>
>
>> Also, wouldn't it be a good idea for SpamAssassin to start going off on
>> multiple emails to the same domain from the same address/ip?
>
> IMO, not really.. this is so much better handled by properly configuring your
> MTA layer tools so you don't accept mail for unknown users.
Viruses, I handle for them, I am sure they don't want them. Email, I
don't know about. I don't know at a given moment which email addresses
(on a server hosting ~450 domains) are "good" or not. I leave it to my
users to take procmail by the horns and handle this themselves. Still,
something other than BLACK or WHITE is a good thing. A list of actually
EXPECTED email addresses for spamassassin is what I'm looking for.
Beyond that, a quick procmail rule to check for the x-spam-report that
this rule hits on could be used to submit the ip to a checking program and
a further blacklist.
I'm pretty forgiving about blocking IP ranges (I let spamassassin
Peggy was a unique case because she was able to tell me "YES I ONLY USE
peggy@" with complete certainty. None of my other users can tell me that,
and I'm not quite in the mood to edit /etc/mail/virtusertable everytime
each of 400 users decides to change it.
I'm running with local_procmail, so there's no real ability to have
sendmail do an unknown bit.
Although I'm sure I could write a settings file that culled this on an
hourly basis or something -- the idea is that the email address is already
created. Users are filling out a web-form on (say) survey.org, and it
wants their email address. Fine. survey@theirdomain.com. If spam starts
coming in, they can shut it off.
> A milter which auto-detects dictionary attacks by watching the unknown user
> errors and greylists the offending IP for 24 hours would be a great tool.
>
> Having spamassassin track this kind of thing and add points based on it is a
> bit of a stretch..
Possibly not adding points, but definitely reporting it somewhere
centrally is a good thing. Unfortunately, this would take an interesting
amount of code that I'm not ready to write yet.
> It could be effective, but only for domains that don't have proper tables set
> up so they only accept email for valid users (ie: secondary MX servers
> without a call-ahead or ldap check milter). However, on my primary MX it
> would be useless, as any unknown users instantly bounce with a 500 user
> unknown and SA will never see it.
Heh. Almost makes me want to set up a bogus secondary MX for the purpose
of trapping all this shit. Maybe we can make spammers give us the
secondary MX'es back. Eh, I won't hold my breath.
--
"...Somebody fed you sugar. Shit!"
--Tracy, after noticing Gatorade on my desk.
Ezzi Computers, October 18th 2003
Approx 11PM
--------Dan Mahoney--------
Techie, Sysadmin, WebGeek
Gushi on efnet/undernet IRC
ICQ: 13735144 AIM: LarpGM
Site: http://www.gushi.org
---------------------------
Re: Rule Suggestion
Posted by Matt Kettler <mk...@evi-inc.com>.
At 07:13 PM 9/15/2004, Dan Mahoney, System Admin wrote:
>For example, my father's wife peggy has the domain peggytaggart.com, she
>ONLY gives out the peggy@ email address for this.
>
>For some unknown reason, the whole domain is popular with spammers. I've
>added a global rule in my virtusertable to just drop anything not-destined
>for peggy:
>
>Sep 15 04:07:37 prime sm-mta[42929]: i8F87Mn1042929:
><su...@peggytaggart.com>...
Not just spammers, but viruses now do this kind of thing, purely automated,
common as dirt.
>(What's really annoying is that sendmail doesn't log the ip of the remote
>connection until it's done (if you're blocking them) -- I'd love to be
>able to create an RBL on this and nip it in the bud).
Yeah, but it's not really that hard to parse it.. Find an "unknown user"
message, grab the SMTP ID find the relay line with the same SMTP id.
Simple example using grep:
# grep "User unknown" /var/log/maillog:
Sep 14 09:10:03 xanadu sendmail[14940]: i8EDA3Cw014940:
<cu...@evi-inc.com>... User unknown
<snip>
# grep "i8EDA3Cw014940" /var/log/maillog
Sep 14 09:10:03 xanadu milter-greylist: i8EDA3Cw014940: testmode: skipping
greylist for recipient "<cu...@evi-inc.com>"
Sep 14 09:10:03 xanadu sendmail[14940]: i8EDA3Cw014940:
<cu...@evi-inc.com>... User unknown
Sep 14 09:10:04 xanadu sendmail[14940]: i8EDA3Cw014940:
from=<pl...@optonline.net>, size=0, class=0, nrcpts=0,
proto=SMTP, daem
on=MTA, relay=66.49.69.146.nw.nuvox.net [66.49.69.146]
>Also, wouldn't it be a good idea for SpamAssassin to start going off on
>multiple emails to the same domain from the same address/ip?
IMO, not really.. this is so much better handled by properly configuring
your MTA layer tools so you don't accept mail for unknown users.
A milter which auto-detects dictionary attacks by watching the unknown user
errors and greylists the offending IP for 24 hours would be a great tool.
Having spamassassin track this kind of thing and add points based on it is
a bit of a stretch..
It could be effective, but only for domains that don't have proper tables
set up so they only accept email for valid users (ie: secondary MX servers
without a call-ahead or ldap check milter). However, on my primary MX it
would be useless, as any unknown users instantly bounce with a 500 user
unknown and SA will never see it.
Re: Rule Suggestion
Posted by "Dan Mahoney, System Admin" <da...@prime.gushi.org>.
On Thu, 16 Sep 2004, Ryan Moore wrote:
> Dan Mahoney, System Admin wrote:
>> Guys,
>>
>> Given that some spammers like to just slam mail at everyone at an entire
>> domain, is there an option to "greylist" these addresses?
>>
>> For example, my father's wife peggy has the domain peggytaggart.com, she
>> ONLY gives out the peggy@ email address for this.
>>
>> For some unknown reason, the whole domain is popular with spammers. I've
>> added a global rule in my virtusertable to just drop anything not-destined
>> for peggy:
>>
>
> I'm not sure if this would work given your setup, but worth mention perhaps.
> There is a milter designed to find out of the rcpt of a message is valid if
> the rcpt isn't local (ie: you gateway mail down to another box). Milter-ahead
> is the name, I use it sorta, I actually use milter-sender which has the same
> features of milter-ahead plus much more. You can get it from:
> http://www.milter.info
No, because the "next hop" gateway is procmail, which by default delivers
everything. I *suppose* it could be heavily modified to see if a given
message would be sent by procmail to /dev/null, but that involves running
every check procmail would, and some of those (including spamassassin)
would only be known once the message was accepted.
Not a perfect fit, but the offer is appreciated.
-Dan Mahoney
--
"I can feel it, comin' back again...Like a rolling thunder chasin' the
wind..."
-Dan Mahoney, JS, JB & SL, May 10th, 1997, Approx 1AM
--------Dan Mahoney--------
Techie, Sysadmin, WebGeek
Gushi on efnet/undernet IRC
ICQ: 13735144 AIM: LarpGM
Site: http://www.gushi.org
---------------------------
Re: Rule Suggestion
Posted by Ryan Moore <ry...@perigee.net>.
Dan Mahoney, System Admin wrote:
> Guys,
>
> Given that some spammers like to just slam mail at everyone at an entire
> domain, is there an option to "greylist" these addresses?
>
> For example, my father's wife peggy has the domain peggytaggart.com, she
> ONLY gives out the peggy@ email address for this.
>
> For some unknown reason, the whole domain is popular with spammers.
> I've added a global rule in my virtusertable to just drop anything
> not-destined for peggy:
>
I'm not sure if this would work given your setup, but worth mention
perhaps. There is a milter designed to find out of the rcpt of a message
is valid if the rcpt isn't local (ie: you gateway mail down to another
box). Milter-ahead is the name, I use it sorta, I actually use
milter-sender which has the same features of milter-ahead plus much
more. You can get it from: http://www.milter.info
Ryan Moore
----------
Perigee.net Corporation
704-849-8355 (sales)
704-849-8017 (tech)
www.perigee.net
Re: Rule Suggestion
Posted by "Dan Mahoney, System Admin" <da...@prime.gushi.org>.
On Thu, 16 Sep 2004, David B Funk wrote:
> On Wed, 15 Sep 2004, Dan Mahoney, System Admin wrote:
>
>> Guys,
>>
>> Given that some spammers like to just slam mail at everyone at an entire
>> domain, is there an option to "greylist" these addresses?
>>
>> For example, my father's wife peggy has the domain peggytaggart.com, she
>> ONLY gives out the peggy@ email address for this.
> [snip..]
>> (What's really annoying is that sendmail doesn't log the ip of the remote
>> connection until it's done (if you're blocking them) -- I'd love to be
>> able to create an RBL on this and nip it in the bud).
>
> This is a sendmail config issue. Just up the "LogLevel" a few notches.
> Then it will add log entries for every connection opening (as well
> as other stuff).
>
>> However, while spamassassin seems to have whitelist_to (and I could
>> whitelist_to peggy@herdomain), this defeats any other spamassassin
>> tactics. I could also do blacklist_to herdomain.com but this would
>> effectively LIMIT her real mail. I guess what I'm looking to know is if
>> there's any way for users who get all the mail for a specific domain (like
>> she does) to list which ones are "real" (but still may get spam), and
>> which ones aren't (so they're likely definitely spam).
>
> Just write a custom rule, so that if the 'To:' contains
> "@peggytaggart.com" but isn't "peggy@peggytaggart.com" then hit.
>
>
>> Also, wouldn't it be a good idea for SpamAssassin to start going off on
>> multiple emails to the same domain from the same address/ip?
>
> Potentially really bad idea. For example our central admin likes to send
> out periodic notices to groups of students (one message, one source,
> thousands of recipients). They would -not- be amused if it were
> tagged by SA.
Which is where whitelist_from_recvd would come in. Your central admin,
I'm sure, is within your mail sphere, and you would probably want to
accept mail from him, even *if* he's sending out an email about generic
viagra. However, this would also not apply in the situation I'm talking
about, because the preference I'm looking for is per-user:
I have a header inserted, the X-Envelope-To: header, that makes it
apparent where mail is being sent. Spamassassin could check this and work
on it. It doesn't even have to be a scoring rule, it could simply work to
report the ip, for future refusal by sendmail.
I'm not saying that this is a good rule for everyone, but I've always
believed rulesets, much like bayes databases, are isomorphic.
This is a rule that would best suit those people who receive mail for an
entire domain. Since procmail runs as *them*, it would have to keep a
table of recipients, and source ip addresses in the same way it maintains
their bayes databases.
-Dan
--
"Your future hasn't been written yet; no one's has. So make it a good
one!"
-"Doc" Emmet L. Browne, Back to the Future III
--------Dan Mahoney--------
Techie, Sysadmin, WebGeek
Gushi on efnet/undernet IRC
ICQ: 13735144 AIM: LarpGM
Site: http://www.gushi.org
---------------------------
Re: Rule Suggestion
Posted by David B Funk <db...@engineering.uiowa.edu>.
On Wed, 15 Sep 2004, Dan Mahoney, System Admin wrote:
> Guys,
>
> Given that some spammers like to just slam mail at everyone at an entire
> domain, is there an option to "greylist" these addresses?
>
> For example, my father's wife peggy has the domain peggytaggart.com, she
> ONLY gives out the peggy@ email address for this.
[snip..]
> (What's really annoying is that sendmail doesn't log the ip of the remote
> connection until it's done (if you're blocking them) -- I'd love to be
> able to create an RBL on this and nip it in the bud).
This is a sendmail config issue. Just up the "LogLevel" a few notches.
Then it will add log entries for every connection opening (as well
as other stuff).
> However, while spamassassin seems to have whitelist_to (and I could
> whitelist_to peggy@herdomain), this defeats any other spamassassin
> tactics. I could also do blacklist_to herdomain.com but this would
> effectively LIMIT her real mail. I guess what I'm looking to know is if
> there's any way for users who get all the mail for a specific domain (like
> she does) to list which ones are "real" (but still may get spam), and
> which ones aren't (so they're likely definitely spam).
Just write a custom rule, so that if the 'To:' contains
"@peggytaggart.com" but isn't "peggy@peggytaggart.com" then hit.
> Also, wouldn't it be a good idea for SpamAssassin to start going off on
> multiple emails to the same domain from the same address/ip?
Potentially really bad idea. For example our central admin likes to send
out periodic notices to groups of students (one message, one source,
thousands of recipients). They would -not- be amused if it were
tagged by SA.
--
Dave Funk University of Iowa
<dbfunk (at) engineering.uiowa.edu> College of Engineering
319/335-5751 FAX: 319/384-0549 1256 Seamans Center
Sys_admin/Postmaster/cell_admin Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{
Re: Rule Suggestion
Posted by Kelson <ke...@speed.net>.
Dan Mahoney, System Admin wrote:
> (What's really annoying is that sendmail doesn't log the ip of the
> remote connection until it's done (if you're blocking them) -- I'd love
> to be able to create an RBL on this and nip it in the bud).
We use a variation of rumplekiller.pl for exactly this purpose:
http://bignosebird.com/notebook/rumplekill.shtml
The script as written just blackholes the IP address, but it's easy
enough to change what it runs when it catches one.
We used to get 10+ each day, but in the last few months it's gone down
to 2 or 3.
--
Kelson Vibber
SpeedGate Communications <www.speed.net>