Skip to main content

Integrate Bitdefender for Mail Servers with CommuniGate Pro

This section describes how to fully integrate Bitdefender for Mail Servers with CommuniGate Pro server.

The Bitdefender Security for Mail Servers product offers support for the CommuniGate Pro server, but in certain special cases the integration might not work entirely out of the box. The following information explains the additional steps that need to be followed in order to fully integrate Bitdefender with CommuniGate.

First, when Bitdefender is installed, the MTA with which you want to integrate with must be CommuniGate Pro. If such a product is already installed on the server, the Bitdefender installer will automatically detect it and display it as default option for MTA integration.

If Bitdefender is already installed and integrated with another MTA, for example Sendmail, you can change it by disabling the milter integration and activating the CommuniGate Pro one:

# cd /opt/Bitdefender/bin
# ./bdsafe agent disable milter
# ./bdsafe agent enable cgate
# ./bdsafe agent configure cgate basedir /var/CommuniGate ( please note that this path is the default one, and may be different on heavily customized CGate setups )
# ./bdsafe agent configure cgate timeout 120 ( the value is in seconds )

The second step is to add some lines in the Mail.settings file of the CommuniGate Pro server, located in /var/CommuniGate/Settings.

Use your favorite editor to edit the Main.settings file (do not forget to make a backup of it first, in case something goes wrong). Add the following lines somewhere in the configuration file, between the first ‘{’ and the last ‘}’ that already exist in the file

(if you already a section named ExternalFilters, you only have to add also the Bitdefender filter without creating another ExternalFilters section):

ExternalFilters = 
({Enabled = YES;
LogLevel = 5;
Name = Bitdefender;
ProgramName = "/opt/BitDefender/bin/bdcgated";
RestartPause = 1m;Timeout = 2m;

After this, modify the Rules.settings file (again, make a backup first) and add a rule for the Bitdefender filter:

(("Message Size", "greater than", 1)),
((ExternalFilter, Bitdefender))

Another way and the recommended one to enable the Bitdefender integration, is to use the CommuniGate management web interface (by default it listens on http://:8010):

  1. Go to Settings > General (you will be required to login);

  2. Go to the Helpers tab and look at Content Filtering;

  3. For the CommuniGate Pro version less than 5 do the following actions:

    1. Check the Use Filter box;

    2. Enter Bitdefender in the text box;

    3. Set the Log list to Problems;

    4. Set Timeout to 2 minutes;

    5. In the Program Path, enter /opt/Bitdefender/bin/bdcgated.

    For CommuniGate Pro version 5 and above, the method is slightly different:

    1. Enable the filter using the drop-down combo box;

    2. Enter Bitdefender in the corresponding text box;

    3. Set the Log Level to Problems;

    4. Set Timeout to 2 minutes;

    5. In the Program Path text box, enter /opt/Bitdefender/bin/bdcgated;

    6. Set Auto-Restart to 5 seconds;

    7. Click Update.

  4. Go to the Settings > Mail > Rules tab;

  5. Enter Bitdefender and click Create New or Add Rule, in version 5;

  6. Click the Edit button next to the Bitdefender filter. Do the following:

    1. Look at the Data list and set it to Message Size;

    2. Set Operation to greater than;

    3. Set Parameter to 1;

    4. Look at the Action list and set it to External Filter;

    5. Enter Bitdefender in the Parameters box;

    6. Click Update.

  7. Restart the Bitdefender services;

  8. Restart the CommuniGate Pro server.

Bitdefender will now start scanning your incoming messages.

With the latest update, Bitdefender Security for Mail Servers can provide some additional information to CommuniGate Pro server, in order to mark spam messages and to deliver them in the designated folder (Junk), depending on the digital range bar score from the email headers. In order to enable this feature, do the following:

# cd /opt/Bitdefender/bin
# ./bdsafe group configure mygroup antispam cgatecompat Y
# ./bdsafe reloadsettings

Change mygroup with the name of your group. If you have a default installation, mygroup is default (bdsafe group configure default antispam cgatecompat Y).

From this moment on, Bitdefender will add a new header, which looks something like this: X-Junk-Score: 92 [XXXX]. The number of X-s is given by the value of the spam level, so the digital score bar range will look like this:

0 []
1-39 [X]
40-80 [XX]
81-90 [XXX]
91-95 [XXXX]
96-99 [XXXXX]
100 [XXXXXX]

If the email is not spam, the value is ‘0 []‘, if the value increases, the range bar will do the same, ‘1-39 [X]‘ and so on.

The administrator of the CommuniGate Pro server can set the actions for this kind of emails. From Settings>Users>Domains, the Junk Mail control can set the action for spam e-mails. For example, High probability->Store in junk, Medium probability->Mark as Junk, Low priority->Mark as junk.

If the user receives an e-mail that is marked as spam (X-Junk-Score: 100 [XXXXXX]), this mail will be moved in the Junk directory. Using this header, the administrator of the CommuniGate Pro server can filter the e-mails delivered to the users.

For more information, read the Bitdefender user guide and this chapter on CommuniGate Server flags.