call a file in exim filter

danone

Member
Feb 26, 2014
8
0
1
cPanel Access Level
Root Administrator
Hi I have hundreds of exim filter conditions as below. each condition block has 2 white listed domain as @safedomain1.com and @safedomain2.com. I want to be able to create a file e.g /etc/whitelisteddomains and call this file from each exim conditions so I don't have to add a new safedomain.com for all conditions. How can I call a file in exim filter condition ?
/etc/whitelisteddomains file contain

"@safedomain1.com" and $sender_address does not matches
"@safedomain2.com" and $sender_address does not matches
"@safedomain3.com" and $sender_address does not matches
CURRENT FILTER
if
# body message spam
$sender_address does not end ".au" and $sender_address does not matches "@safedomain1.com" and $sender_address does not matches "@safedomain2.com" and
$message_body: contains "sxx" then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered. error code 101"
seen finish
endif

if
# body message spam
$sender_address does not end ".au" and $sender_address does not matches "@safedomain1.com" and $sender_address does not matches "@safedomain2.com" and
$message_body: contains "p0rn"
then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered. error code 102"
seen finish
endif
DESIRED FILTER
if
# body message spam
$sender_address does not end ".au" and $sender_address does not matches file:/etc/whitelisteddomains and
$message_body: contains "sxx" then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered. error code 101"
seen finish
endif

if
# body message spam
$sender_address does not end ".au" and $sender_address does not matches file:/etc/whitelisteddomains and
$message_body: contains "p0rn"
then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered. error code 102"
seen finish
endif
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,297
1,259
313
Houston