allabtweb

Registered
Dec 19, 2020
1
0
1
Delhi
cPanel Access Level
Root Administrator
Hi,
Need help in below condition.
if
$header_from: contains "[email protected]"
or $header_from: contains "[email protected]"
then
if ("$h_to:, $h_cc:, $h_bcc:" contains "@client.pw")
or ("$h_to:, $h_cc:, $h_bcc:" contains "[email protected]")
or ("$h_to:, $h_cc:, $h_bcc:" contains "[email protected]")
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. [email protected]
can send email to [email protected] or anyemail of @client.pw
can receive email from [email protected] or anyemail of @client.pw
can not send email to any body else like [email protected], [email protected]
can no receive email from any body else like [email protected], [email protected]

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

[email protected], [email protected]

its also getting passed because we are checking contains [email protected] and thats making cndition true , we want if anyting else come aparts from [email protected], [email protected] and @client.pw this should be false.
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
3,145
397
243
cPanel Access Level
Root Administrator
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.
 

keat63

Well-Known Member
Nov 20, 2014
1,899
253
113
cPanel Access Level
Root Administrator
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 "[email protected]")
or ("$h_to:, $h_cc:, $h_bcc:"does not contain "[email protected]")

Then fail
 
Last edited:
  • Like
Reactions: cPRex