Exim Filter Conditions
Hi,
Need help in below condition.
if
$header_from: contains "harish@dot.com"
or $header_from: contains "ravish@dot.com"
then
if ("$h_to:, $h_cc:, $h_bcc:" contains "@client.pw")
or ("$h_to:, $h_cc:, $h_bcc:" contains "harish@dot.com")
or ("$h_to:, $h_cc:, $h_bcc:" contains "ravish@dot.com")
then
finish
else
if error_message then save "/dev/null" 660 else fail "Messages from this domain or email are blocked." endif
endif
endif
the idea is my domain is dot.com and we want 2 users from this domain dot.com (harish and ravish) should be able to communicate and can send and receive emails to client.pw
example. harish@dot.com
can send email to ravish@dot.com or anyemail of @client.pw
can receive email from ravish@dot.com or anyemail of @client.pw
can not send email to any body else like xyz@dot.com, abc@gmail.com
can no receive email from any body else like xyz@dot.com, abc@gmail.com
which is working fine from above script when we enter one email is to or cc, issues come when we enter 2 emails in 2, one is authorized and one is un-authorized
ravish@dot.com, abc@gmail.com
its also getting passed because we are checking contains ravish@dot.com and thats making cndition true, we want if anyting else come aparts from harish@dot.com, ravish@dot.com and @client.pw this should be false.
-
Hey there! I see what you're saying for sure, but I am not sure of a good way to use the "header_from" value if the messages has multiple addresses. This might be a good question for the official Exim Users List, or possibly another user (@keat63 ?) has some ideas of another way to go about this. 0 -
I'm struggling to comprehend the end result if i'm being honest I asssume client.pw is a fixed domain ? Rather than condensing this into one rule, would splitting it into two rules work any better. also what about does not contain. if ("$h_to:, $h_cc:, $h_bcc:" does not contain "@client.pw") or ("$h_to:, $h_cc:, $h_bcc:" does not contain "harish@dot.com") or ("$h_to:, $h_cc:, $h_bcc:"does not contain "ravish@dot.com") Then fail 0
Please sign in to leave a comment.
Comments
2 comments