> On Jan 8, 2025, at 00:51, OlivaFN88 <felipe.n...@gmail.com> wrote:
> 
> In your example, when envelope match with the first filter inside the chain, 
> it will reject the message without pass for the second one.
> 
> I need an “and” between the two conditions, not “or”.

You are right. I misunderstood your requirement before.

So you want to reject any email sent to t...@domain.com 
<mailto:t...@domain.com>, unless it's sent by allo...@domain.com 
<mailto:allo...@domain.com>.

Theoretically, "reject (to test and !from allowed)" should be equivalent to 
"(accept !to test) or (accept from allowed)". Considering that MAIL FROM comes 
before RCPT TO in SMTP, a reorder would be better, so we have "(accept from 
allowed) or (reject to test)”.

In this case, maybe the "bypass" action would be helpful, though I have no 
experience in using it.

    filter check-from phase mail-from match mail-from { "allo...@domain.com 
<mailto:allo...@domain.com>" } bypass
    filter check-rcpt phase rcpt-to match rcpt-to { "t...@domain.com 
<mailto:t...@domain.com>” } reject "550 Permission Denied"
    filter check-both chain { check-from, check-rcpt }

-- 
Ziqin


Reply via email to