Hello,
I'm the systems administrator at the ISP Derrik.Hansen works at. I wanted to throw a few more questions out there and clarify a few things. Hopefully someone on this list has some suggestions.
Our smarthost (lithium.sunwave.net - 208.98.210.10) has been blacklisted a few times over the past few days. The spam has not originated from our smarthost, it has simply been the relay for systems on our network that are permitted to relay through our smarthost.
The first instance was from an exchange box that had been configured to relay through us some time ago, but just this week, their antispam filter died. The result was exchange doing asynchronus bouncing and the bounced spam messages being relayed through our smarthost.... The problem was identified and the customer was asked not to send their email on their own rather than through us. They took a little too long to comply (got us blacklisted again) and I ended up blacklisting them - they are now sending their own mail

The second instance was from a host that got infected with a bot and began relaying through our smarthost. This has happened in the past and I always have to quickly identify the culprit, have one of our support guys shut them down and then we start sending delist requests to the blacklists we have found ourselves on.
So, that's what we have been dealing with. I have two questions:
1 - Does spamcop intend to block ISP smarthosts?
I was reading through the spamcop faq today and saw this faq entry
http://www.spamcop.net/fom-serve/cache/99.htmlIt suggests that relays shouldn't get blacklisted, that this is "relay rape". I fail to see why that would be; if my relay is forwarding spam, the only way to block the spam using a RBL is to block the relay. Seems fair to me. However, if spamcop doesn't intend to block relays and there is some way that I can reconfigure the system to take advantage of that, I will.... No sense in making myself go grey if someone hands me a get out of jail free card

I have a feeling I'm just misinterpreting what was stated in that faq, which brings me to my next question.
2 - What can be done about bots relaying through a smarthost?
I have given this particular issue a great deal of thought and actually have a plan for dealing with the problem, I just need to find time to implement my plan. However, if anyone in this forum has any fresh ideas that I may have missed, I'd love to hear them. I'd also welcome any debate concerning problems with my plan.
So, here's the plan:
--------------------------
Note:
We have very effective inbound filtering through Postini, so, as you'll note in the plan, I don't waste any CPU cycles on inbound spam filtering on our mailserver.
I'm going to start implementing the following steps. It's quite a big list and I expect that I'll implement everything up to step 8, but beyond that I'm not sure. I'll almost certainly implement step 12 on our dynamic networks, but I'll leave our business networks alone. Step 13 is already done. Feedback from this list may help me decide what steps I skip.
1 - Setup new mail server with 2 instances of the latest postfix (2.3)
http://www.advosys.ca/papers/postfix-instance.html Also check out the
postfix docs, I seem to remember code being added to make the dual
instance setup much easier to implement
- one for inbound connections from the net and one for outbound
connections from our customers.
- inbound will do basic postfix UCE checks, but nothing fancy -
absolutely no SA/ClamAV filtering
- well, maybe I could be convinced to do a little bit of SA
on inbound. This ruleset would be so nice to have and
couldn't do any harm to legit email
http://www.timj.co.uk/linux/bogus-virus-warnings.cf - outbound will be much more intensive (see below for details)
- change our MXes to point to lithium.sunwave.net (new IP)
- have all clients point at mail.sunwave.net (current IP) for
outbound smtp and pop3/imap
- this will make it much easier to have different filter rules and SA
configs for inbound vs outbound mail. As well, this makes it a bit
easier to break the mail system into two hosts, in the future, if
need be (likely due to scanning software overhead or imap overhead)
- having a separate postfix instance for outbound (on it's own IP) also
makes it easier to buy myself some time, by just switching IPs if we
get blacklisted again (this is what Telus does)
2 - Install local authoritative and caching name servers so that RBL
checks are much faster. As well, this will ensure that DNS changes
for domains we host are seen by the mail server immediately.
3 - Implement postfix *outbound* rate limiting controls on a per client
basis
http://www.postfix.org/anvil.8.html /etc/postfix/samples/sample-rate.cf
- intention is to slow down bot spam so that the inline scanner
doesn't have to work so hard and we also reduce the risk of
getting black listed
4 - Tighten up postfix a fair bit - especially outbound!
-
http://jimsun.linxnet.com/misc/postfix-anti-UCE.txt - Do what is realistic using postfix native UCE controls so that less
load need be placed on the inline scanner.
- I would love to do this
http://www.postfix.org/postconf.5.html#smt...unlisted_sender but then we would have the problem of non local users being
rejected by our relay. Is there a way around this?
- Could I enforce strict_rfc821_envelopes or would this break some
clients? Try using a warn_if_reject to see.
5 - publish spf records for all our domains (sunwave, sunlite, shuswap)
- start simple and conservative
http://spf.pobox.com/wizard.html sunwave.net. IN TXT "v=spf1 ip4:64.141.16.1/27 mx a:lithium a:mail ?all"
lithium.sunwave.net. IN TXT "v=spf1 a -all"
mail.sunwave.net. IN TXT "v=spf1 a -all"
- put in some logging so that I can see who is using servers
other than what I have specified
Page 15 -
http://spf.pobox.com/whitepaper.pdf - test them
http://spf.pobox.com/faq.html#checkers6 - Implement inline transparent spam filters on *OUTBOUND* mail
Use spampd or smtpprox and spamassassin - return an error code and
message
I think that spampd is probably the better option
http://www.postfix.org/SMTPD_PROXY_README.htmlhttp://www.worlddesign.com/Content/rd/mta/...xspecific_notes Don't forget to use XFORWARD!!!
If for some reason, spampd is not logging the client IP, then consider
either patching it or using smptpprox (patching should be dead easy as
spampd uses the same code as a base as smtpprox)
http://bent.latency.net/smtpprox/index.html - this is going to take a fair bit of tuning to get right, because
we will be focusing on outbound rather than inbound; this is a non
standard approach. Because we are focusing on outbound, I think
that we can give more points to matches from the blacklists (see
below for RBLs to lean on). I'm sure there will also be other
settings that will make sense to lean heavier on due to the
outbound approach (perhaps spf?)
7 - Implement post queue antivirus scanning on *OUTBOUND* mail
Use amavisd-new and clam - drop viruses on the floor with no
notifications
Perfect! -
http://workaround.org/articles/ispmail-sarge/#amavis8 - Implement Intra domain routing through postini
http://www.postini.com/admindoc/intra_domain.html - this setup increases the effectiveness of postini for user to user
and gives us free user to user email virus scanning!
- basically, don't let the outbound smtp server think it's
authoritative for local domains
9 - Start generating outbound usage stats so that I can see/be
notified of suspicious trends. Specifically on a per user basis.
- Parse the outbound server's logs looking for:
- lots of blocks by spampd/spamassassin
- lots of blocks by amavisd-new/clamav
- # of connections / recipeints per min
- probably be good to do this every 5-15min or so
- statistically large increases in mail output from a given
IP (would require software that tracks over much longer
periods of time) # if software exists, great, if not,
then don't go here, we don't have the time for this sort
of thing
- If the parser sees something that looks nasty, it will send an
email to the ticket system and the ticket system will email the
customer. This should allow me to better tune anvil as well.
10 - Optimize postfix to make it more friendly to our customers
- Protect customers against "back scatter"
http://www.postfix.org/BACKSCATTER_README.html - create useful error responses
- look in the /etc/postfix/samples directory for lots of great
ideas
http://www.mailsbroadcast.com/email.bolts&...codes.error.htm - run postfix 2.3 so that I can do DSN
http://www.postfix.org/DSN_README.html http://archives.neohapsis.com/archives/pos...05-03/2016.html11 - Tune amavis/clam/spamassassin performance
http://wiki.apache.org/spamassassin/FasterPerformance http://wiki.apache.org/spamassassin/SitewideServerSpec http://www.ijs.si/software/amavisd/README.performance12 - Ingress/Egress port 25 block
- for all dynamic networks
- leave static networks alone
13 - Change our reverse dns so that dynamic ranges are clearly identified
http://www.onlymyemail.com/company/press_m...Threat_RBL.html http://www.spamhaus.org/faq/answers.lasso?...am%20Issues#129 - ex - 64-141-16-142.dialup.dynamic.sunwave.net
- ex - 64-141-19-234.cable.dynamic.sunwave.net
- ex - 64-141-18-234.business.static.sunwave.net
14 - SMTP AUTH
http://spamlinks.net/prevent-secure-relay-auth.htm http://postfix.state-of-mind.de/patrick.ko...auth/index.html use port 587, tls and any auth method
or port 465, no tls with crammd5
14.5 - SMTP AUTH would be hard as it would require us to contact all customers
and have them change their outgoing mail settings (have you heard the term
"kicking dead whales down the beach"? - it would apply.....
So, rather than go with SMTP AUTH, I could setup something like camram,
TMDS, or another challenge response tool (I hate challenge response, but
this might work). Again, this would be for outbound traffic only - not inbound.
Now, rather than just set the challenge response tool loose, I would preload
the tool with all our valid customer addresses. That means that the only
people that will get challenges will be those that are our customers, are using
our smarthost, but do not have an email address on our system. This should
be fairly pain free.
15 - Address security for all hosts on the network for all services, not
just mail
- Create an automated lepper colony that tosses known infected
users into it and directs all traffic to a webpage, sends
them an email
- start doing regular vulnerability scans of the network using
nessus or better yet setup ossim. Create a monthly top 10
report and have TSRs contact people and try to educate them
- use adaptive response on the shaper to create tickets for users
that have constant socks traffic
- Do the big media blitz and get people up to speed with the big
four defences - firewall, anti-virus, anti-spyware, windows
updates. Get as many people as possible to upgrade to XP SP2,
- move people to firefox and thunderbird. Also encourage people
to tell their friends.
- seriously look at tools such as the fortinet appliance
- focus on antispyware
- consider other near term gateway approaches such as using the
new spyware RBL that someone at bleeding snort is working on. Or
start blocking known spyware user-agent strings at our cache or
shaper.
--
Mason Schmitt