Server-wide per-account email filter?
Does anyone know if this is possible? I would like to deliver mail with specific keywords in the subject link to the "Junk" folder relative to the account. So if an email with the keyword "spam" in the subject is sent to bob@somewebsite.com then it is automatically filtered into the INBOX/Junk folder. I can setup a filter to do this on every account manually, but I'm curious to know if this can be done at a server level. Any thoughts?
I did some searching and I am not the first to pose this question, but I do not want to simply nullify the message and I'm not sure how to sort it to be relative to the account it's being delivered to.
-
Hello :) You can find information on using a system-wide filter on the following thread: System Level Filtering Thank you. 0 -
[quote="cPanelMichael, post: 1694002">Hello :) You can find information on using a system-wide filter on the following thread: System Level Filtering Thank you.
Thanks! This is the direction I needed to get started but it only answers half my question. Let's say I do this:# Spam Subject if $header_subject: contains "{Spam" then # Save to "junk" folder? save "/dev/null" 660 endif
Instead of nul-routing the email, how can I save it to the folder relevant to the account it's being delivered to? I still want to deliver the email, but in this case I want to deliver it to a specific folder. Is this possible?0 -
One way to learn how to write filter rules is to create an account level filter in cPanel similar to what you want to do in a system filter, and then view the rule directly in: /etc/vfilters/$domain.com This will help show you how to write a filter rule. Thank you. 0 -
Alright, thank you. :) 0 -
Okay, so if I create a account level filter, then I get something like this: #{Spam?} if $header_subject: contains "{Spam?}" then save "$home/mail/domain.com/user/.Junk/" 660 endif
How can I get the "domain.com/user" part dynamically so it goes into the correct users folder? This is the part I'm stuck on. Any assistance would really be appreciated. Is this even possible? Is there documentation on this somewhere? Edit: Found this:save "$home/mail/$domain/$local_part/.Junk/" 660
Source:0 -
Were you able to verify if that rule worked as you intended?
Actually, no.. it didn't work. It apparently didn't do anything after I enabled the rule from WHM in the exim config. I just tried sending an email with "{Spam?}" in the subject and it went right to my inbox.https://dl.dropboxusercontent.com/u/147879/2015-09-09_1041.png
0 -
You may want to post to the Exim users mailing list for input from other users about potential alternatives for the filter you require. Thank you. 0
Please sign in to leave a comment.
Comments
8 comments