LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Need help with .procmailrc & regular expressions (https://www.linuxquestions.org/questions/programming-9/need-help-with-procmailrc-and-regular-expressions-648448/)

linuxmaveric 06-10-2008 10:59 PM

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

ntubski 06-11-2008 03:01 PM

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.

unSpawn 06-11-2008 04:43 PM

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.

linuxmaveric 06-11-2008 04:43 PM

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

linuxmaveric 06-11-2008 04:48 PM

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.

unSpawn 06-11-2008 05:06 PM

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

Quote:

Originally Posted by linuxmaveric (Post 3181871)
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.


All times are GMT -5. The time now is 04:17 PM.