1 Reply Latest reply: Jun 2, 2012 8:41 PM by OoO_Bailey_OoO
OoO_Bailey_OoO Level 1 Level 1 (0 points)

Recently, I've set up some server-side mail rules on a Mac Lion Server. I've had some issues though:

 

  1. I have a rule that filters on recipients, but I've noticed that emails still make it through the filter where my address has been cc'd. Does anyone know how I can filter on all recipients, "cc" addresses included and not just "To" field addresses?
  2. Can or should I put multiple recipient addresses in one field with commas or should it be one address per recipient filter rule?
  3. I just want to make sure, but can the "[...]" filter be used for any field type? And how do I know what the proper field names are (e.g. "body" for the message body)? I can't find any documentation on this setting.

 

Thanks!


Mac mini, Mac OS X (10.7.4), Mid-2010
  • 1. Re: Server-side Mail Filter Questions
    OoO_Bailey_OoO Level 1 Level 1 (0 points)

    Ok so I did some digging and picked up some things. Namely, sieve and the ability to download/upload rules to Mac Lion Server's webmail filter section.

     

    1. So the "Recipient" selection only generates "To:" in the sieve rules. If you download the filter set and edit the text file, expand that "To:" to read "["To","Cc","Bcc"]" if you want to cover all recipient fields

     

    2. If you want to list multiple addresses from the web interface, it's best to add a separate rule for each; otherwise, the web interface will generate as one long string to check against and won't work (e.g. "email@address1.com, email@address2.com").

     

    Alternatively, edit the sieve text file to read "["email@address1.com","email@address2.com"]" and upload the filter set again.

     

    3. After uploading edits like #1, you'll notice the web interface uses the "[...]" setting and lists "To,Cc,Bcc" in the next field. Basically, this setting allows you to enter any header-relevant area to check against.

     

    The message body cannot be filtered on from the web interface with this setting so that reason. The body is a separate area from the header.

     

    According to the documentation I found (see links), a statement in the sieve text file like this should work:

    require ["body", "fileinto"];

     

            # Save messages mentioning the project schedule in the

            # project/schedule folder.

            if body :text :contains "project schedule" {

                    fileinto "project/schedule";

            }

     

    I haven't gotten this to work yet though as the upload strips it out. I also tried "body :content "text"", but same result. I don't think you can filter on the message body in Mac Lion Server rules.

     

    Links:

    https://help.apple.com/advancedserveradmin/mac/10.7/#apd064E313D-D961-441E-82C4- C023BDD9E3CA

    https://en.wikipedia.org/wiki/Sieve_%28mail_filtering_language%29

    https://tools.ietf.org/html/rfc5173