Yesterday I worked on the email server that I have. As a prerequisite to understanding email and email server management an understanding of how much time it takes to do anything with an email server is “LARGE”. So I was thinking to myself that I should work on the spam filter so that it could be detecting Ham and Spam according to the user account. In my head I was thinking that the change wouldn’t take too long which is an error thinking according to the second sentence. So I proceeded and I had to read up on how to get spamassassin to start detecting according to the user. My first attempt I read a little article on the old Gentoo wiki archive website and attempted to implement. My first failure because the bayes algorithm didn’t load. So then I had to keep reading documentation and after about an hour of doing more poking around in the documentation I learned that I actually needed to get a file to setup the database tables. So I looked for the particular file on my computer with no luck. I then searched the Internet and found the file at the repositories for Apache. I then run the SQL script to create the tables. Now I started up spamassassin and the result was good except now spamassassin didn’t know what user account each email belonged to. Spamassassin was sending all of the emails to be learned to the “mail” account which is not how I wanted that to work.
The most frusting part of the whole email changes includes creating the regexp for getting the user account. To get the email account information I needed to do a search and find just the username which was embedded in a bunch of directory stuff. I got the regexp to work and find just what I wanted on the command line and I thought to myself, “victory!” I couldn’t have been so wrong because as soon as I attempted to put the regexp into the script, “failure!” Now I spent two hours poking around trying to get the regexp to work inside the script. I finally did succeed without learning a lot of bashisms. Well I was able to get the changes into the two scripts that run each night to learn Spam that is in the Spam folder and learn Ham that is in the Ham folder. When I was making the changes to the two scripts to learn Spam and Ham I noticed that they hadn’t been learning new Ham and Spam for the past three or four years. The scripts were written back when the server was setup for Qmail and then after a couple of years I decided to move to Courier as the email server. Courier changed the folder which the email was located in and I had missed that particular change when I had to make the other changes to the scripts. Now the Ham and Spam scripts correctly read the Ham and Spam folders which is nice. I then had to modify the maildroprc file to make the incoming email to learn correctly according to the user account. Maildrop, I feel is not documented in the clearest fashion available. I spent two hours trying to figure out what the predefined variables were and what their assignment was. I figured out their assignment and essentially implemented the same filter that I used in the scripts. Now Spam and Ham were being learned correctly and getting inserted into the database.
I was still left with the web email clients not working correctly. I had Horde installed but I figured that I would install a second client called Squirrelmail. The logic is that if one breaks the other will still be working. I was able to get Squirrelmail installed fairly easily and setup. I then needed to modify my website for the changes to the email options. Making the website changes took me a little bit because I didn’t completely remember how to do the tables. I coded the website myself but I had forgotten how the XML was setup. I also wanted stylesheets so that I could do fancy things with my tables. After I got that to work with the website I went and turned off the PHP warnings and that fixed both Horde and Squirrelmail. Now there is a choice and the email filtering is working correctly.
With the Ham and Spam scripts working I won’t be getting the busty babes in my email box. I won’t be missing them at all, shucks. I really don’t like Spam anyway because it adds so much noise to the email box. No more online diplomas or bank transfers too.