LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-04-2003, 11:54 AM   #1
Pcghost
Senior Member
 
Registered: Feb 2003
Location: The Real Washington
Distribution: Debian, Android
Posts: 1,819

Rep: Reputation: 46
Question Can Spamassassin be tied to a particular users email?


I would like to put our spamassassin/postfix server through some tests before using it system-wide. I was wondering if anyone knew how to tie the spam filter to say 3 users instead of all the incoming mail for the company?
 
Old 06-04-2003, 01:29 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,360
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
If it's tied in with procmail like it gets it's stdin from a pipe in a central /etc/procmailrc (like I saw in the peregrinehw docs), then it would be easy to modify the recipe. If it's hooked up somewhere else, then I wouldn't know...
An example recipe could be this: grep for inclusive addresses,
then add a tag (easier to pinpoint mail when you expect filter rot),
then pipe to sa as the docs say:

SA_ADDR_FILE=/path/to/addresses_to_filter_for_file
:0
* ? (formail -x To: | | fgrep -iqf $SA_ADDR_FILE)
{
:0 f
| formail -A "X-Passed-Tru: SA Tagger"

:0
| pipe_to_sa_here_like_docs_say
}

I never used SA, so YMMV(VM).
 
Old 06-04-2003, 02:25 PM   #3
Pcghost
Senior Member
 
Registered: Feb 2003
Location: The Real Washington
Distribution: Debian, Android
Posts: 1,819

Original Poster
Rep: Reputation: 46
Thanks Unspawn. The only problem is I'm not running procmail. I am using spamassassin attached to Postfix, which is acting as a mail gateway for a domino server on the lan. Boy this stuff is confusing. I think I have it all set up to filter all mail coming in but I am a little worried about interrupting legitimate mail to the company because a dumb newb (that's me :-) ) messed up a conf file..
 
Old 06-04-2003, 02:55 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,360
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
I am using spamassassin attached to Postfix
Ok, so then your'e probably using a postfixfilter to drop mail to?
Maybe that's tweakable...
 
Old 06-04-2003, 03:47 PM   #5
Pcghost
Senior Member
 
Registered: Feb 2003
Location: The Real Washington
Distribution: Debian, Android
Posts: 1,819

Original Poster
Rep: Reputation: 46
That's correct, it is a postfix filter. I had to add an entry to master.cf to refer to spamassassin so the mail would be routed through it. There has to be a way to limit what mail gets sent through the filter, I am just not seeing it...
 
Old 06-04-2003, 06:42 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,360
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
How about restricting SA's filtering using it's "whitelist_to"? That should override SA to see mail to the "To" addresses as spam, right?
 
Old 06-05-2003, 01:34 AM   #7
Pcghost
Senior Member
 
Registered: Feb 2003
Location: The Real Washington
Distribution: Debian, Android
Posts: 1,819

Original Poster
Rep: Reputation: 46
Thumbs up

Genius!! I will whitelist all users except the three I need to filter. That is it! You Rule.. I can't wait to get to work in the morning (I know I am sick, but they pay me to play with Linux ). I just want to show my boss why my Linux servers will always be superior to his NT4 servers.

Just call me /dev/

Thanks Unspawn..
 
Old 06-05-2003, 12:43 PM   #8
Pcghost
Senior Member
 
Registered: Feb 2003
Location: The Real Washington
Distribution: Debian, Android
Posts: 1,819

Original Poster
Rep: Reputation: 46
Unhappy So close, but not quite there...

Doh! The whitelist only applies to senders. There is a feature known as All_spam_to in the conf files, but that would require me to add all 125 users four times a piece (we have four legitimate domains here). There has got to be an easier way to tell postfix to send just the three users (IT staff) email to spamassassin and send the rest direct to the domino server. Our users change to frequently to maintain a all_spam_to list that large.

I swear email servers are soooo much harder to configure than proxy servers and firewalls...

?? What about the transport map? Could I say enter the three addresses specifically in the transport map aiming them at the localhost on whatever port spamassassin uses? I wonder if that is possible. I thought only domains could be specified, anyone know if that is the case?


Last edited by Pcghost; 06-05-2003 at 12:49 PM.
 
Old 06-05-2003, 03:01 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,360
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
Hrrmmm. Are you sure it only applies to senders?
I'm talking about whitelist_to:

whitelist_to add@ress.com
If the given address appears in the "To:" or "Cc:" headers, mail will be whitelisted. Useful if you're deploying SpamAssassin system-wide, and don't want some users to have their mail filtered.
Same format as "whitelist_from".

There are three levels of To-whitelisting, "whitelist_to", "more_spam_to" and "all_spam_to". Users in the first level may still get some spammish mails blocked, but users in "all_spam_to" should never get mail blocked.


...but then again remember I'm no Postfix user.
Whitelist_to is able to take on domain wildcards, so you would only need to add the rest of the users in the testusers domain.
If you are able to lay your hands on a list of users in that domain, writing a cronnable script to update the local.cf is, erm, trivial?
 
Old 06-05-2003, 03:10 PM   #10
Pcghost
Senior Member
 
Registered: Feb 2003
Location: The Real Washington
Distribution: Debian, Android
Posts: 1,819

Original Poster
Rep: Reputation: 46
I work directly for the net admin so I can get a listing of all users. The only whitelisting I found in the documentation was a whitelist_from but I may have missed it. I will definantly give it a shot as whitelist_to:. I wonder if it will allow me to make a file (db) to contain all whitelist_to entries. I could then update it using cron as you suggested. I will give this a shot... Thanks again..
 
Old 06-05-2003, 03:30 PM   #11
Pcghost
Senior Member
 
Registered: Feb 2003
Location: The Real Washington
Distribution: Debian, Android
Posts: 1,819

Original Poster
Rep: Reputation: 46
Cool. I found the section on whitelist_to and all_spam_to in more detail. Now, my understanding is that spamassassin uses rules in the order that they appear. If that is true, I just need to figure out if this type of scripting accepts negatives the way iptables does ie..

whitelist_to: ! ITguy1@foo.com

If it accepts the "!" symbol, or any other negative then I am set. The above rule would only filter mail to ITguy1@foo.com correct?

I feel like I am getting very close to figuring this out.
 
Old 06-06-2003, 11:37 AM   #12
Pcghost
Senior Member
 
Registered: Feb 2003
Location: The Real Washington
Distribution: Debian, Android
Posts: 1,819

Original Poster
Rep: Reputation: 46
Bump! Does anyone how to specify "everything but" in spamassassins local.cf file? I am looking for the equivalent of

all_spam_to ! joeshmoe@foo.com

so that the only mail filtered is mail addressed to joeshmoe@foo.com.

Any ideas?
 
Old 06-13-2003, 06:46 PM   #13
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,360
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
Just checking... Did you find a fix for this yet?
 
Old 06-16-2003, 09:28 PM   #14
Pcghost
Senior Member
 
Registered: Feb 2003
Location: The Real Washington
Distribution: Debian, Android
Posts: 1,819

Original Poster
Rep: Reputation: 46
No I sure haven't. It strikes me as odd that postfix is this cool, but has virtually no decent documentation or tutorials online. I am stumbling through this postfix install one problem at a time. I am almost ready to just take the machine live company wide, but a pesky mail loop (see software forum) has me stuck 3 inches from the finish line. :-(
 
Old 06-16-2003, 09:51 PM   #15
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,360
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
"It strikes me as odd that postfix is this cool, but has virtually no decent documentation or tutorials online."
Hmm. And you ain't gonna grab your own bait? :-]
cuz what the world needs now,
is docs sweet docs,
it's the only thing
that there's just too little of...

Ahhh. Well. Hmm. This wasn't even on my playlist.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How To: Setup Spamassassin on RedHat Firewall with earthlink email? abcampa Linux - Software 2 08-23-2005 11:02 AM
Email and spam in different folders using spamassassin tensigh Linux - Software 3 08-11-2005 11:21 AM
ARRRRRRRGGHHH Email Relay with SpamAssassin Filtering... vallois Linux - Software 5 07-16-2004 12:47 PM
Where can I find out about setting up email/spamassassin? sloanthrasher Linux - Newbie 5 03-04-2004 09:48 PM
good email setup? fetchmail -> procmail -> spamassassin -> evolution xmnemonic Linux - Software 0 10-12-2003 05:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration