![]() |
Email filtering using procmail
I don't know why, but I still use Pine as my email client. Anyway, Spam Assassin works pretty well for me, but there are some domains that I'd like to block in my procmailrc file. How would I go about doing so? I tried the following recipe, but it didn't work:
:0: * ^From: *lan.com /dev/null My only guess is that it's some syntax error. Any help would be appreciated! And no, I don't have anything against LAN. I just can't get off their mailing list for some reason. |
Hey- I 99% use Pine, too.
But I think the issue is your leading "*" in your recipe; these aren't "glob"-type expressions, they're full regular expressions, and as such that "*" means "0 or more of the preceding match character", which in your case is the space. I think: Code:
:0: |
Ah! I thought the "*" was a global expression. Alright, I made the change and we'll see if it works. Thanks!
|
Need some more help. So if I want to block a specific email address, is this correct?
:0: * ^From:[email protected] /dev/null The thumbs up is supposed to be a caret by the way! Don't know how to disable that. |
You need something after the From: and before the spammers email address.
Code:
:0:That will only match [email protected] and won't inadvertently match similar email addresses that end with the same string like [email protected] the space tab inside the square brackets followed by the asterisk matches white space, so the expression matches "From:" at the beginning of the line, followed by zero or more white space characters, followed by [email protected] You could use .* instead of the white space expression but that could produce some extra matches. Anyway, try that, see if it works. -David |
If you're using SpamAssassin, you can also use the blacklist_from option in its config file.
Code:
blacklist_from *@lan.comThis works by adding a very large value (100) to the spam score, so it will get filed according to how you're sorting your mail that's tagged as spam. BTW, you can include special characters like ^ or :p without them being translated by checking the "Disable smilies in text" option in the "Additional Options" box below the submit/preview buttons. |
Ah, thanks for the tip on disabling smilies! I was looking for it near the top. Anyway, thanks for all your help! Things appear to be working. Is there a good tutorial on writing rules that you guys could point me towards?
|
.....
|
Originally Posted by Condition One
(Post 19548902)
Is there a good tutorial on writing rules that you guys could point me towards?
there's lots of examples out there. You might need to read up on "regular expressions" also if you really want to learn how to do it. -David |
| All times are GMT -6. The time now is 2:16 pm. |
This site is owned, operated, and maintained by MH Sub I, LLC dba Internet Brands. Copyright © 2026 MH Sub I, LLC dba Internet Brands. All rights reserved. Designated trademarks are the property of their respective owners.