View Full Version : new spamassassin question

09-04-2003, 04:49 PM
I have questions as to when one uses user_prefs in the .spamassassin folder or one uses the local.cf file in etc/mail/spamassassin.

In general, under our 2.0 situation, why do we need both local.cf and user_prefs?

I want to whitelist and black list urls. Which file should I use?

I want to accept english emails only. Where should this be placed?

I have some local rules. These I have placed in local.cf (per Fayez who is very knowledgeable) but it seems that sometimes they work and sometimes they don't. Is there anything special about local rules?



09-04-2003, 07:56 PM
Hi Charlie,

Thanks for the compliment ;) I believe local.cf is for global configuration - what you place in that file should theoretically affect all incoming mail across all POP3s for your account. Also, it is the "privilaged" file in that you can more or less use any configuration option in there and it will (or should) work, and finally, some options that you place in there are meant to be there to override users' custom settings. For example if you don't want to allow them the ability to create their own tests.

In response to your white- and blacklisting question, it depends if other people are using POP3s on your account. If they would like those particular addresses/hosts blocked too, then you should definitely put those rules in local.cf - this would also save you from having to put it in each .spamassassin/user_prefs file for each POP3/mail account. The same applies to you wanting to accept English e-mails only. However, I would not suggest using it as I have found it to be extremely unreliable - marking 99% of mail as of a foreign language when in fact it isn't. You may find different results though, so no harm in trying.

Just keep in mind that whatever you put in local.cf will force your "secondary" users to "un-do" each configuration option in it that they don't want applied to them (e.g. if they don't want a particular URL blacklisted for them which you added in local.cf).

You said it only works occassionally - have you been able to work out why? What test(s) in particular are you talking about? It might be because of 2.0. I'd be willing to test it on my (still) 1.0 account to see if it is indeed 2.0 related.

Oh and it is a little confusing, but "local rules" would be those in .spamassassin/user_prefs while the "global rules" would be those in local.cf (or at least that is how one should think of it)!

Hope that helps.

09-04-2003, 08:05 PM

I need to digest and then go to work with what you have said.

Thanks for the advice and help. I may take you up on the rule testing. First I want to get everything in the "right" place.


09-04-2003, 08:07 PM
Good post design64 makes me want to dig in and play with my spamassasin. I had always shied away from it because I was not sure of it.

If I FTP into my site where would I find the local.cf file.... I know you do not have 2.0 yet but maybe someone else knows.... I am still haveing a bit of trouble understanding all those new files and directories... I get the feeling I am going to have to do some reading.

It was the one thing about the old system... I could blindly ignore some of the behind the scenes things... time to learn :)

Opps just noticed the paths at the top of the post... :oops: I really must start retaining what I read.

09-04-2003, 08:19 PM
You're welcome Charlie. Let me know when you want to do the testing. It should be in the next few days though, since it looks like 2.0 problems are being resolved and everyone will be migrated to it soon ;) Let me know if you have any other questions.

Thanks for the compliment, Shawn. Glad you found it helpful. If you are fed up with spam then SpamAssassin is really the only (and best) way to go. Along with Procmail, you can really scrub your mailbox squeaky clean (I'm down to 5 spam mails a week from more than 30 daily)! Procmail is amazing if you get those Worm.Klez/Sobig e-mails as well... You can set it up to delete them without you having to lift a finger.

09-05-2003, 10:26 AM

Can you (or anyone) point me to an easy-to-understand primer on Procmail. At this spot I know nothing.

Also I think I solved why I had a rule that seemed to intermittantly work.
I had:
/(abc | def)/i
The apparent fix:
/(abc|def)/i #no spaces

Why this makes a difference is beyond me - I'm not a Perl programmer but I thought Perl was free form.


09-05-2003, 11:46 AM

You're in luck. I've written (what I think is) a pretty comprehensive (but newbie-friendly) "intro" on getting Procmail working on WestHost servers: http://forums.westhost.com/phpBB2/viewtopic.php?t=151 Look for it about halfway down the page. There are lots of external links on that page as well. And, I am always here if you need my help. Note: with 2.0, the root mail account's home directory is / and not /home/username "Secondary" accounts' home directories are /home/username

About the rule, that is correct... abc | def would match abc and then a space, but probably not just abc. It is the same when you use Procmail - just keep that in mind ;) If you would like me to suggest some helpful sites on regexp's let me know.

09-05-2003, 12:40 PM

I took at quick look at some of the info you referred to. It looks daunting but I'll give it a try.

I would like some help on a header rule.
Example: email is from John Smith xzy@abc.com
I would like to filter out on John Smith because the xyz@abc.com is false.
Hope you can help.
Also I would like some links on regex examples as you mentioned in your previous post.



09-05-2003, 01:01 PM
Charlie, it is really not that bad at all. Especially now that you have played with some Perl regexp's as well. All you have to do is understand the concept behind it and the format/layout of conditions. Don't go by the answers on the first URL Chris recommended. That one really is terrible. If you have a specific thing you want to try with Procmail, let me know and I will post the code for you - it'll probably be not more than 4 or 5 lines.