LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 06-10-2008, 11:59 PM   #1
linuxmaveric
Member
 
Registered: Aug 2007
Location: Southern California
Distribution: Ubuntu 8.04 for my desktop & FreeBSD 7.0 for my server blade.
Posts: 31

Rep: Reputation: 15
Need help with .procmailrc & regular expressions


How do I setup .procmailrc
to delete spam mail that comes from any addresses that end in .ch (.ch = email from china) and with the Subject "stocks or Stocks with a capital). Can someone help me out here with a critique and suggestions. Thanks.

I have here a sample procmail recipe that i came up with: Will this do the job or am I missing something?

:0
* ^From:.*.ch
* ^Subject:.*[Ss]tocks
/dev/null
 
Old 06-11-2008, 04:01 PM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 1,332

Rep: Reputation: 294Reputation: 294Reputation: 294
Code:
* ^From:.*.ch
I think this will match any address at least 3 letters long with a "ch" in it. You probably want
Code:
* ^From:.*\.ch\>
I also think you will be better off using a spam filter instead of trying to write procmail rules to block spam for you.
 
Old 06-11-2008, 05:43 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 20,982
Blog Entries: 44

Rep: Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread should be closed because it is a duplicate of http://www.linuxquestions.org/questi...mailrc-648414/ never mind the slightly different thread title.
 
Old 06-11-2008, 05:43 PM   #4
linuxmaveric
Member
 
Registered: Aug 2007
Location: Southern California
Distribution: Ubuntu 8.04 for my desktop & FreeBSD 7.0 for my server blade.
Posts: 31

Original Poster
Rep: Reputation: 15
Cool Need help with .procmailrc & regular expressions

Thanks "ntubski"

I tried out your code sample and it worked. I think your right a spam filter would probably be easier. Thanks for your suggestions.
RR
 
Old 06-11-2008, 05:48 PM   #5
linuxmaveric
Member
 
Registered: Aug 2007
Location: Southern California
Distribution: Ubuntu 8.04 for my desktop & FreeBSD 7.0 for my server blade.
Posts: 31

Original Poster
Rep: Reputation: 15
Unhappy Need help with .procmailrc & regular expressions

Sorry "unSpawn"

I did not mean to place the same post in 2 different sections. I was not getting any help in the "server section," so I placed my post here in programmers section. No need to get testy. Please remove my entry in the servers section if you wish. I would do it myself but I'm not sure if I can. I have been a member here for a while and I certainly am not trying to get myself kicked off.
RR.
 
Old 06-11-2008, 06:06 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 20,982
Blog Entries: 44

Rep: Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236
Apology excepted. Next time just keep it at one thread and sit it out, OK?

Quote:
Originally Posted by linuxmaveric View Post
I have been a member here for a while and I certainly am not trying to get myself kicked off.
No, you won't be kicked *that* hard for something minor as this.

Last edited by unSpawn; 06-11-2008 at 06:10 PM.
 
  


Reply

Tags
procmail


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Regular expressions & search patterns LXer Syndicated Linux News 0 09-23-2007 03:51 AM
Regular Expressions markjuggles Programming 2 05-05-2005 12:39 PM
Regular expressions aromes Linux - General 1 10-15-2003 01:29 PM
regular expressions? alaios Linux - General 2 06-11-2003 04:51 PM
how to use expressions with pattern? .procmailrc realos Linux - Software 4 11-14-2002 11:06 AM


All times are GMT -5. The time now is 08:05 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration