Home     Sign in    
The Spam Stops Here
9/28/2003
By Simbey

Anymore, I have lost interest in just about everything.  This isn't new to anyone who knows me, as it's well known I have so little passion for anything in life.  But the spam has been marching relentlessly into my inbox, taunting me, teasing me, insulting me.

There has been no end to the spam, and it has only gotten worse.  Just this past week, I was unable to connect to mail.olynet.com for almost two days, and as soon as I could, I had 36 new messages to download.  Only one was legitimate.

So my only passion in life has been to end the spam.  God knows I have no other purpose in this dreary existence.

I've spoken of my plans for spam before, so let me give a little history on the E-Mail server I've been writing.

SimbeyMail

The E-Mail server project was started May 3rd, 2001.  Back then it started as just a POP3 box for injecting messages into Outlook Express.  Sometimes I would receive e-greeting cards or whatever, and the actual message would be on a website, but I wanted to save the message as an E-Mail.  So I would copy the text into my "server," and Outlook Express would "download" the message as if it were just another E-Mail like all the others.  It seemed pretty ingenious, and it worked great!

SMTP came later.  After college I found myself without a direct connection to the Internet to my computer.  But I still wanted to use Outlook Express on my computer to send and receive E-Mail from the Internet.

Now it got more interesting.  I was using DirectConsole to download my E-Mail as .EML files from the family computer, and I would take them by floppy to my computer and inject them using the trick I mentioned already.  All I had to do was figure out how to send E-Mail.

So I added SMTP to the server.  Now Outlook Express would send E-Mail to my server, which would then copy the messages to a floppy disk.  I took the messages downstairs and used a remailer (yes, I wrote that too) to actually send them!

When I got hooked up at OlyNet with a server for Simbey.com, I wanted to run my E-Mail server.  Up to that point it had pretty much been used just as an intermediate point between a mail client and a separate connection to the Internet.  Obviously my server had no ability to look up MX records and send mail at all.  I didn't even know about MX records yet, but I did put together some code for relaying messages to another SMTP server.  The thought was to just relay to Microsoft's built-in SMTP service.  And it worked!

Well, it worked for a little while.  I remember getting one message from Kyle through that server, but the whole system was a mess.  It would run forever on my Win98 machine, but after a day or two it would crash on Win2K.  And let's not forget the server was running as a GUI, so the machine had to be logged in as administrator for it to even run!  Obviously the server needed to be rewritten.

In early March, 2002, I learned how to write Win32 services.  Somewhere in that same month I found some code that would resolve MX records, and suddenly I had all I needed to put together a professional-quality E-Mail server!  On the 31st of that same month, I began the second version of the E-Mail server, from scratch!

I took a new approach to the server this time (not too mention that I used C++ rather than just C as well).  The actual server itself, the core as I sometimes cal it, resides in a DLL.  It does nothing on its own, so it needs a wrapper application to load it and execute it.  From there, the core does all the E-Mail POP3/SMTP processing and mail relays, and the wrapper manages the core and handles startups and shutdowns.  In effect, the wrapper abstracts the core away from the OS and the implementation.

I Hate Spam

I have worked hard much of this year fine tuning the E-Mail server.  I decided a long time ago that if something were to be done about spam, I would have to do it.  I can't help everyone, but at least I can help myself.  All I know is the US government isn't going to help anyone...

So how do you stop spam?

When I first began writing the revised server, I asked myself that question.  Just about every piece of spam has two things in common: it's a piece of junk asking me to seek out its sender and kill him, and the sender's address is fake.  At the moment, I'm only interested with the second point.

So...  Whenever someone sends mail to my server directly, my server checks the E-Mail address.  It actually looks up the MX, connects to the host, and tries to send a message to that address.  If the RCPT command fails for me, then it also fails for the sender.  How simple is that?!

But direct mail isn't the problem...  My OlyNet address is invaded daily with some 20 pieces of crap!

Now we get to the proxy!  I don't even remember when this was added, but it was sometime this year.  SimbeyMail will download my mail from OlyNet and add it to my box with all the direct mail.  All I had to do was figure out a rejection scheme for the proxied E-Mail.

I tried filtering.  Several prominent antispam websites argue against filtering, and they're right.  But I had to try it.  And while I was set on filtering, I ran into some problems.  Many spammers send their entire message in base 64, so I had to compensate for that.  If that weren't enough, dozens of these idiots are breaking up key words in their messages with bogus HTML tags.  The message shows up fine on screen, but the underlying text looks like a jungle!  But I was able to compensate for that too.

Finally, what made me give up on filtering was that so many of these spammers are just sending one great big image as their message.  Can't exactly parse text out of a message on the fly like that, so forget it - filtering doesn't work.

Goodbye, Spammers!

I've played with blocked lists before.  And I know how much fun my sister has had trying to block every spammer reaching her Hotmail inbox.  Blocking doesn't work either, of course.

But what about the opposite of blocking?  What about a list of addresses or domains that are safe?  And only messages with senders on that list would be accepted!

It works!  Yesterday I finished the system, and I haven't gotten a single piece of junk E-Mail in nearly two days!  My server reads the messages from OlyNet and then checks the senders of each message.  If they don't match up, they get discarded, and a rejection notice is sent to that address.  The server only tries to send the notice once (since it will fail for spammers anyway), but if anyone does receive it who is a real person, at least he knows he should contact me some other way to be put on the safe list.

So after all this time and all this energy, I win!  Goodbye, spammers!  You will never reach me again!


Track Backs: The trackback URL for this entry is:
http://www.simbey.com/viewpage.asp?TrackBack=100
© 2001-2010 Simbey.com