I am trying to create a filter where 1 email account is not permitted to send emails outside of its domain. I have tried following script but it has some loopholes.
if $sender_address is "[email protected]"
and ("$h_to:, $h_cc:, $h_bcc:" does not contain "@domain.com")
then
fail text "Sorry one or more of your email recipients is not allowed. Please contact your System Administrator."
finish
endif
Loophole is if i include any other email recipient in to, cc or bcc along with a user from domain.com then this filter fall apart and doesn't work.
Ex: my email message contains following users
to: [email protected]
cc: [email protected]; [email protected]
is there a workaround which i can try ?
Your help is much appreciated.
TIA
if $sender_address is "[email protected]"
and ("$h_to:, $h_cc:, $h_bcc:" does not contain "@domain.com")
then
fail text "Sorry one or more of your email recipients is not allowed. Please contact your System Administrator."
finish
endif
Loophole is if i include any other email recipient in to, cc or bcc along with a user from domain.com then this filter fall apart and doesn't work.
Ex: my email message contains following users
to: [email protected]
cc: [email protected]; [email protected]
is there a workaround which i can try ?
Your help is much appreciated.
TIA