Install SpamAssassin on Mac OSX 10.6
I had an interesting conversation with a colleague of mine today. You see, we are working with a company that is going to do some marketing for us. The issue we are facing is their IT guy is a Microsoft kool-aide drinker. He knows just enough to get himself in trouble, but couldn’t code his way out of a paper bag. But we have to work through him to get any email sent. We are being blocked because he looks at the content we want to send and says, “There is not enough content, it will be marked as spam. We need more content.”
Someone please correct me if I am wrong, but spam filtering does not necessarily only look at the quantity of the content, but the quality and specific words the contained within it. For example, spamassassin uses filtering that will check the content and apply a score based on multiple things like: relays, headers, subject line, dates, etc. So the first question I asked was, “How can this Microsoft loving IT guy eyeball the content and be able to tell it will be marked as spam?”
Clearly he cannot. But because he is the resident geek at this organization, he is in control. This led me to realize, I need to get hard data. In order to combat his nonsensical approach to spam checking (by using his eyeballs), I figured I need something a little more concrete. So I set out to install SpamAssassin on my MacBookPro. Would it work? I didn’t know but I had to try. Not only because I needed something to run spam scores against, but it sounded challenging and fun at the same time.
Easy? So it seems
I did some searching on the web, and there was not a lot about HOW to get it installed on a Mac. So I did a little more digging and came across an article written in back in 2007 that lead me down the right path. My Linux knowledge started ti kick in again and before you know it, I am in business. I now have spamd (and spamc) running on my Mac. Here is what I did.
The Install
First, you need a handful of perl modules to meet the dependencies for Mail::SpamAssassin. I used the following command from the terminal:
perl -MCPAN -e shell
This brought up the cpan> prompt. I tried running install Mail::SpamAssassin which failed because of the dependencies. But I paid attention to the output and pulled down the list and installed the dependencies one by one from the span shell.
NetAddr::IP
Mail::SPF
IP::Country
Razor2
Net::Ident
Mail::DKIM
Encode::Detect
A few things to note. First, Razors2 is not found in cpan. I have to download it from sourceforge and install it by hand. Once I downloaded it, I uncompressed it, went to the uncompressed directory in terminal, and ran the following:
perl Makefile.PL && make
sudo make install
Second, once all of the dependencies were installed, I then ran the install for SpamAssassin from the cpan shell:
install Mail::SpamAssassin
The problem is, I got some errors. I did what came natural to me and decided to go into the actual directory ~/.cpan/build/{spamassassin} and run the same perl Makefile… commands. Wouldn’t you know it worked?
Did It Really Work?
What do you know, from the same terminal I ran spamd & and guess what? SpamAssassin is running on my Mac! I now have the ability to test spam scores for email messages. So now, on the command line I can run:
spamc -R < {emailfile}
Now all I need to do is write my custom PHP script to pass email files to spamc via the exec() and I am good to go. In the meantime, I plan on combating evil Microsoft fanboy by showing him sctual spam scores to compare with his eyeball by running them manually in my terminal. Question is, will be pull a Microsoft and try to change the standard from spam score to evil eyeball of said IT fanboy? We will soon find out.









>
Follow Me (digitally you stalker)