View Single Post
Old 15 Jul 2017, 11:03 AM   #11
n5bb
Intergalactic Postmaster
 
Join Date: May 2004
Location: Irving, Texas
Posts: 8,925
Quote:
Originally Posted by camner View Post
A followup question related to writing Sieve rules. Currently my sieve rules for discarding mail to known "spammy" targets at my domain looks like this...
I would suggest that rather than use a long list of aliases you want to not accept, you just block those addresses in the aliases table as I described. If you have a large number of these, you might consider removing your wildcard delivery alias and affirmatively add the aliases you want to accept.

If you decide to continue the long sieve script, you should be able to change #1 and #2 as follows. Just add "x-delivered-to" as shown. I tested this and it seems to work correctly.
Code:
       # 1. 'matches' can contain wildcards, 'contains' cannot
         address :matches ["to","from","x-delivered-to"] 
         [
          "adobe@mydomain.com",
          "adobe1@mydomain.com",
          "adobe2@mydomain.com",
          "adbrs1@mydomain.com",
          and about 50 more!
        ],

       # 2. for partial match but cannot contain wildcards
         address :contains ["to","x-delivered-to"]
         [
          "info@mydo",
          "sales@mydo"
         ],
Bill
n5bb is offline   Reply With Quote