mail procmail
Sorry for digging up an old thread, but it asks / answers almost what I'd like to do. Instead of matching exact addresses, I'd like to filter if the email address contains a string
* ^from:.*(domain | someotherthing | yetanotherdomain | someone@ )
So similar to the above - but it could be any person at one of various domains, including if the TLD is different (randomperson@domiantofilter.randomtld), or a name at a particular domain (nametomatch@randomdomain)
Thanks!
Fab, thanks Sean - I've added it in and will see how it plays out in the next few days.
How big can this procmail file with white list be ? I have a white list that's about 45kb to start with.
- Edited
So I changed a procmail file I'm using to something like this:
:0:
* ^From:.*(name1@domain.tld1|name2@domain2.tld2|name3@domain3.tld3).*
./
:0:
* ^From:.*
.Junk/
I would expect that any email that doesn't come from one of the email addresses in the first filter would be moved into the junk folder but this is not the case. Since the list of addresses in the first filter is actually some 45kb I've set LINEBUF=65536.
What am I missing ?
Axel Hi Axel, I believe the second rule is overriding the first. If you use the E flag in the second, it should only execute if the previous conditions do not match.
- Edited
nick It seems to me that if the second rule would be overriding the first, all email would end up in the junk folder, which is not happening. Also note that in my actual procmail file there are a number of other rules preceding the two that I listed. All the rules are tested on the email until there is one that applies. If nothing applies the email is delivered to the inbox, which is what is happening. So I have to conclude that the second rule is somehow not applied or is never applicable to any email. But why ?
- Edited
Axel Okay, my earlier suggestion may not be helpful in this instance. I suggest opening a support ticket with all the relevant details so we can enable logging on the procmail rule file to see what may be going on.