I'm trying to create an account-level filter that will match any email where the from address and the to address are the same. My approach was to check if the from header matched the to header using the exim variable $header_to. I created this through the web interface and tested it and it didn't work. After some experimenting and research I found that the filter that is created that way is actually in /etc/vfilters/<domain>. Looking at that file I found that the '$' is escaped by '\\', which is not what I want. I can modify that file by removing the '\\' and the filter works as I expect, however that file will be overwritten. Is there a way to do it so that the '$' is not escaped?
Here is what is put in the file by the cPanel interface:
Here is what works the way that I want:
Here is what is put in the file by the cPanel interface:
Code:
#Test
if
$header_from: contains "\\$header_to"
then
if error_message then save "/dev/null" 660 else fail "Don't send email to myself" endif
endif
Code:
#Test
if
$header_from: contains "$header_to"
then
if error_message then save "/dev/null" 660 else fail "Don't send email to myself" endif
endif