SpamAssassin for Multiple Users

apps

#1

I recently installed SpamAssassin 3.10 on my account (using the excellent instructions on unsaturated.com). SpamAssassin has been working great so far, but I have two questions about extending its usability that I haven’t been able to find good answers to on the web.

  1. What’s the best way to enable SpamAssassin for all users on my account? It seems like my options are either installing a copy of SpamAssassin for each user, or having all incoming mail first go to one, SpamAssassin-protected account and then forwarding the scanned messages to the correct users from there. Does one of these options trump the other? Is there a third option I’m overlooking?

  2. I have one mail address, domain@domain.com, set–via the Dreamhost control panel–to forward to my account and not deliver to any other mailboxes. Messages sent to the domain@domain.com address aren’t scanned by SpamAssassin, even after they are forwarded to my account. Is there an easy way to fix this?

Thanks for any help anyone can provide!


#2

I use symlinks so that all the users share the same copy of SpamAssassin.


#3

this sounds like a good way to make it work without having to install it for each user. can you describe how you went about making it work?


#4

There’s not much to it. You basically want to replicate the first SpamAssassin installation in each users home directory, except that instead of copying the files use a symlink (ln -sf … command). I did a quick and dirty shell script that does this, but my environment is different than the document you mentioned.

There’s nothing wrong with copying files (especially with all the disk space DH gives you) but it will be faster to use a symlink and if you update SA all the users will get the update at once.


#5

For those of us who are real linux n00bies could you give us hand held instuctions/help. If it is to difficult to write out instructions perhaps you could contact me directly and I could give you access to my account and I could get you to do it?


#6

can you still check “suspected” spam through squirel mail? I’m looking for a solution for my end users.

dittos on the newbie request. I like them hand holding directions for installing stuff

Thanks for the info.


#7

As long as you don’t tell SpamAssassin to auto-delete messages scoring above a certain threshold on the spam scale, and you do tell it to forward all messages marked as spam to a certain folder, you can still check suspected spam in whatever email client you use.

I tell SpamAssassin to forward all suspected spams to my Trash folder, then check that folder every so often to make sure I don’t have any false positives. I’ve been very happy with this system so far (well over 90% reduction in spam I have to see).


#8

Ok, next newbie question, if I use the directions on unsaturated.com, is that not installing SA for all the users on my domain.com?


#9

I’m pretty sure the directions on unsaturated.com only install SpamAssassin for one user at a time. Turning on spam protection via the DreamHost control panel will affect all users on domain.com, although it is not as configurable as installing your own copy of SA.


#10

Ok, that is what I kind of thought, I just wanted to make sure that is what I understood.

Anyone have any ideas of DreamHost is eventually planning to update to a newer version of what they have currently installed?

I’m still having a lot slip through.


#11

Ok, I’ve been going through the directions on unsaturated, and here are my newbie questions.

  1. “Log in to the account that will be using SpamAssassin.” – that would be my username and not e-mail, correct?

  2. If #1 is correct, how/where do you tell it which e-mail address (account) that it should be installed on. I currently only have one user on my server, but have multiple e-mail accounts.


#12

That’s what I do, except I use an IMAP client to manage the spam mailboxes. But SquirrelMail would work just as well.

I also have a 2-stage system: if the score is 8+ it goes into a Spam folder and if it is 5-8 it goes into a SuspectSpam folder. (Originally I used 10+.) The rare false positive has always ended up in SuspectSpam, and since the number of messages there is much smaller it is easier to manage. Pretty much anything that scores 8 (10) or more is definitely spam.

The way to do this is to write a procmail rule that matches the right number of ‘*’; something like:

score >8 goes directly to Spam

:0

  • ^X-Spam-Level: ********
    .Spam/

Dump all tagged spam into separate folder

:0

  • ^X-Spam-Status: Yes
    .SuspectSpam/

If there are 8+ plus stars, it is definitely spam, otherwise it is only suspect.


#13

“There’s not much to it. You basically want to replicate the first SpamAssassin installation in each users home directory”

I have the first install done, but where do I find the other users’s home directory? Maybe I’m confused, but shouldn’t I be looking for something that looks like “m???” that is the same as their e-mail account?


#14

mNNNNNNN email accounts don’t have home directories that you can access. If you want to use a custom install of spamassassin, you have to create a user with shell access. If the user name is “myuser” then ~myuser can be used to access that user’s home directory.

But if you originally install SA in user1’s home directory, and want to share that installation with user2, you probably will have to login as user2 and then link to user1’s files. (This is because of the way the permissions work.)

I started using SA before the nice set of instructions was published, so I don’t have the same setup. It looks like that if you follow the instructions you ends up with 2 directories in user1’s home: sausr and saetc. So to share the installation with user2, log in as user2 and do:

ln -sf ~user1/sausr .
ln -sf ~user1/saetc .

This will make a symbolic link from user1’s SA code to user2’s home using the same names. (That’s a period at the end of the command; it means “put the sym link in the currect directory, using the same name as the original”.)

This should replace steps 1-6 of the instructions (ie, downloading and building SA). It may be possible to replace some of the other steps with symbolic links, if you wanted to have all users share the same spam rules, etc. Otherwise, you can just continue with step 7.

As I said, I rolled my own SA installation before the instructions were published, so I haven’t tried this myself. I would experiment with this on a non-critical user and make sure mail is being handled properly before applying it to other users.


#15

Thanks for the help and explaination.

ahhh, that makes more sense on why I couldn’t find the mNNNN accounts :slight_smile:

So I would have to create users for all of my e-mail accounts then… that may be more work than it is worth, with staff turn over…

If I wanted to uninstalled SA, what would you recommend doing?


#16

If you have a log of mNNNNN mailboxes, then you may want to use DH’s mail filtering.

Deinstalling SpamAssassin should be a matter of undoing the installation steps and removing the code. The key thing is to reset procmail to not filter incoming messages. (I haven’t done this either, since I prefer using my own SA installation.)


#17

Just wanted to say thanks for the excellent advice; using symlinks worked beautifully.