LinuxQuestions.org
Visit Jeremy's Blog.
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 07-19-2006, 09:32 AM   #1
barn63
Member
 
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152

Rep: Reputation: 17
Procmail filter help.


I have been searcing this site and google for a simple answer to a rather simple problem. I have an employee who wants his procmail filter to only allow emails from the domain wiu.edu and the rest to be deleted as they come in. I wrote a .procmailrc file as fillows.

Code:
MAILDIR=$HOME/Mail
:0:
* ^From.*wiu.edu
$DEFAULT

:0:
/dev/null
The problem is that alot of email is filtered but there are some that still end up in the inbox. Is there a better way to achive this or is what I have all wrong. I am rather new to filtering with procmail so I based what I have off what I have seen elsewhere. Any help would be great. So I need to send all email form wiu.edu to the inbox and everything else from anyone outside the university needs to be deleted. Thanks.
 
Old 07-19-2006, 09:56 AM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Can you show at least one depersonalized header (e.g., some spam includes receiver name in header - remove it)? Maybe you need to tell procmail that no @ is allowed until eol.
 
Old 07-20-2006, 02:01 PM   #3
barn63
Member
 
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152

Original Poster
Rep: Reputation: 17
What exactly are you wanting?
 
Old 07-20-2006, 03:13 PM   #4
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
You have some filter. Something wrong goes through. I want an example of what has gone through (but shouldn't have), surely headers-only, with every occurence of your employee's username/real name replaced by thename.

Note that it's very hard to filter spam which forges From: to be a valid email address (yes, I mean existing) from target's domain.
 
Old 07-21-2006, 09:54 AM   #5
barn63
Member
 
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152

Original Poster
Rep: Reputation: 17
After looking at a bunch of headers they do throw in a wiu.edu before the @ symbol for the username. If I change "* ^From.*wiu.edu" to "* ^From.*@wiu.edu" would that help any?
 
Old 07-21-2006, 10:01 AM   #6
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
I guess that will make flow smaller. Also think about ^From:.*@wiu.edu[^@]*$
 
Old 07-21-2006, 10:53 AM   #7
barn63
Member
 
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152

Original Poster
Rep: Reputation: 17
what does [^@]*$ tell the filter to do?
 
Old 07-21-2006, 12:31 PM   #8
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
after edu there are no '@' until end-of-line ($).
 
Old 07-25-2006, 01:07 PM   #9
barn63
Member
 
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152

Original Poster
Rep: Reputation: 17
Well I tried what you suggested and now it filters out all email from wiu.edu also.
 
Old 07-25-2006, 01:54 PM   #10
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Eh.. How does the false positive's header look like (surely not asking to show me real username, replace by root..)
 
Old 07-25-2006, 02:38 PM   #11
barn63
Member
 
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152

Original Poster
Rep: Reputation: 17
Do you want the header information from an email that wasn't suposed to be filtered?
 
Old 07-25-2006, 02:44 PM   #12
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Yes. And anything that is recognized wrong..
 
  


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
Problem with mail delivery procmail>cyrus imap (using sendmail,procmail,cyrus,imap) bwana Linux - Software 2 03-24-2005 07:01 PM
Spam filter to external mail filter deadlock Linux - Software 1 06-16-2004 02:28 AM
procmail help markehb Linux - Software 0 05-20-2004 09:23 AM
MS Security Virus Email bypasses Procmail Filter lewt Linux - Security 3 09-24-2003 06:32 PM
Procmail or other filter for outgoing mail gabriele_101 Linux - Software 3 08-18-2003 05:35 PM

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

All times are GMT -5. The time now is 10:42 PM.

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
Open Source Consulting | Domain Registration