On 13-03-2024 17:36, Ralph Seichter via dovecot wrote:
* Lev Serebryakov:

I need to match all messages sent from some specific domain and all
its sub-domains.

I prefer using regular expressions for this kind of tests:

   if address :regex "From" "[@.]example\.(com|org)$" {...}

This will match all addresses for example.com, example.org and their
respective subdomains.


Or in readable sieve:

if anyof (
    address :domain :is "From" "example.org",
    address :domain :contains "From" ".example.org"
) { keep; }

Which might match "subdomain.example.org.gotcha.com", but how often would that happen?

Kind regards,

Tom
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to