How to change or add sieve scripts in SecurityGateway

How to change or add sieve scripts in SecurityGateway

This article explains how to configure SecurityGateway's sieve scipts system, including adding a new script for processing of incoming mail, or to change the order in which scripts are processed, if you wish to run a certain script before another.

From the Dashboard, after logging in:

  1. Click on Security in the lower-left corner.
  2. Click on Sieve Scripts, under the Advanced sub-section, on the left.

You will then see SecurityGateway's Sieve Scripts list, with a number of default scripts corresponding to the various security processes that are run on incoming messages. The list is divided into multiple categories, depending on what event of the incoming session they pertain to:

  • IP, for scripts relating to checking the connecting IP address, or host.
  • HELO, for scripts related to checking the information given in the connecting host's HELO/EHLO command.
  • AUTH, for scripts related to SMTP authentication, if the connecting host either elect to authenticate or not.
  • MAIL, for scripts related to the address given in the MAIL FROM command.
  • RCPT, for scripts related to the address given in the RCPT TO command.
  • DATA, for scripts related to the DATA command, and on the message sent to the server.

There are also a number of columns, describing information about the scripts:

  • Enabled, which shows if the script is currently being used or not. This can be checked on or off to determine status. Note that the default scripts cannot be enabled or disabled via the sieve scripts list, and must be changed from their corresponding section.
  • Scope, which shows if the script affects all connections coming into the server, or only ones for specific domains. Note that only RCPT and DATA sieve scripts can have a specific domain scope.
  • Order, which allows you to change the order in which SecurityGateway runs the scripts for that particular category. Click on the up-arrow or down-arrow to move the script up or down the list as you choose. Note that script at the very top, or very bottom, will have the up-arrow and down-arrow greyed out, respectively.
  • Script Name, which is the name of the particular script.
  • Script, denoted by an icon which looks like a magnifying glass which when hovered over will display he script's code.

To add a new rule, click on the New button along the top to bring up the Rule Editor window, and specify the name of the rule, which event during the connection process that it applies to, and choose either a global scope to affect the entire server, or a specific domain. Choosing Domain will bring up a fourth option to specify which domain it applies to. Once you are done, click on Save and Close to close the window.

To edit a rule, select the rule in question you wish to edit, and click on Edit along the top to bring up the Rule Editor window. Make any changes to it you wish, then click on Save and Close to close out the window. Note that system defined scripts (scripts created automatically by SecurityGateway by changing settings) cannot be edited directly.

More information on how to create new sieve-rules can be found in the SecurityGateway helpfile, which can be opened by clicking the 'Help' link in the upper-right corner of the SecurityGateway window.

    • Related Articles

    • Adding the Abusix Mail Intelligence blocklists to SecurityGateway

      Abusix Mail Intelligence is a set of blocklists that are designed to help protect mail servers from spam, malware, phishing and ransom attacks. You can sign up for a free 14-day trial of Abusix Mail Intelligence at https://abusix.com/. The trial will ...
    • Addressing problems with the SecurityGateway database

      SecurityGateway uses a Firebird database and this database type is not prone to corruption, but there are circumstances where it will envitably encounter problems such as where there is direct interaction by 3rd Party software (eg. 3rd party ...
    • Determining the global administrator account in SecurityGateway

      Open an elevated command prompt. Enter the command net stop securitygateway Change directories to the App folder in SecurityGateway (Default location is \Program Files\MDaemon Technologies\SecurityGateway\App). Enter the command cd \Program ...
    • Deploy SecurityGateway in your network

      SecurityGateway Deployment Options SecurityGateway can be configured to filter both your inbound and outbound email traffic and can be deployed in a several different ways dependent upon your requirements. Below you'll find the most comon deployment ...
    • Updating the directory paths used by SecurityGateway

      How To: Click on Setup/Users Locate the System section Click on Directories You are then presented with directories that SecurityGateway uses to store information. You can change the path for any one of those values from this screen. The directory ...