2
SMarterMail Export/Import Content Filtering Rules?
Question asked by Rick Moses - 1/5/2020 at 12:55 PM
Answered
I'm switching domains, and need to transfer the content filtering rulles that I have set up. I can't find anything in the online help to indicate if it's even possible.

1 Reply

Reply to Thread
2
Employee Replied
Employee Post Marked As Answer
Hi Rick,

There is not a way to copy the content filters within the web interface, but you can do this in settings.json.  Before starting you'll want to do a backup of the settings file, at the very least, for the domain you are copying to.  By default you'll find settings.json here: C:\SmarterMail\Domains\DomainName.  

After doing the backup you'll need to stop the SmarterMail service, go to the settings.json file for the domain that already has the content filters.  In the file do a search for "filter" or "content filter", then highlight and copy what you need.  It should looks something similar to this:

"content_filters": [
    {
      "id": 1,
      "execution_order": 0,
      "title": "test",
      "match_type": 0,
      "internal_type": 0,
      "conditions": [
        {
          "field_type": 0,
          "comparison_type": 2,
          "search_arguments": [
            "emily.ward@domain.com",
            "eward@domain.com"
          ]
        }
      ],
      "actions": [
        {
          "action_type": 6,
          "argument": "test"
        }
      ]
    },
    {
      "id": 2,
      "execution_order": 0,
      "title": "test 2",
      "match_type": 0,
      "internal_type": 0,
      "conditions": [
        {
          "field_type": 0,
          "comparison_type": 2,
          "search_arguments": [
            "emily-ward@domain.com"
          ]
        }
      ],
      "actions": [
        {
          "action_type": 2,
          "argument": "brucebanner@crazy.local"
        }
      ]
    }
  ],

You can copy everything down to the line above "signatures".  You'll then go back to C:\SmarterMail\Domains, open the folder for the domain you are copying to, and open the settings.json file for that domain.  Locate the content filter settings, then paste what you just copied, and save the changes.  

Once you've completed this you can start the mail service again.

And just a reminder, please do a backup before starting this.  This is important in case any formatting gets mess up with the copying and pasting.  If you have a test environment I would suggest doing this there first.

Reply to Thread