Author: Exim Mailing List Date: To: exim-users Subject: Re: [exim] BCC filtering in system_filter.exim
On Mon, Nov 24, 2008 at 11:04:40AM +0000, Ian Eiloart wrote: > > I have an email alias staff@??? that contains all the staff member
> > email addresses of the company. However, only the company bosses
> > eric@??? and john@??? are allowed to send email to
> > staff@???.
> >
> > if $h_to:,$h_Cc: matches "staff@???" and ($h_from does not match
> > "eric|john@???") then
> > fail text "You are not allowed to send mail to this address"
> > endif
> >
> > It works fine for rejecting normal staff members from sending messages to
> > staff@??? using TO or CC. However if a normal staff sends email to
> > staff@??? using BCC, my filter failed to work.
> >
> > Is there a way to stop people sending to staff@??? using BCC?
>
> You can use $local_part and $domain. The message headers don't necessarily
> bear any relationship to the message recipients.
Well, you can't use $local_part or $domain in a system filter, since
it's a per-message filter, not per-recipient.
But you can do something like this instead:
if foranyaddress $recipients ($thisaddress is "staff@???") and
($h_from does not match "eric|john@???")
then
fail text "You are not allowed to send mail to this address"
endif