This article describes how you can use the debugging tools to create log files for the analysis of high processor loads, which can then be evaluated by NoSpamProxy Support.

First install the Windows debugging tools on the server under high processor load. You can download them at https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/

Then, enter the following command into the command line:

cdb.exe -pv -pn NetatWorkMailGatewayGatewayRole.exe -c ".load C:\Windows\Microsoft.NET\Framework64\v4.0.30319\SOS.dll;!EEStack -ee;qd" > NoSpamProxyStack_%date:~-4.4%%date:~-7.2%%date:~-10.2%_%time:~0.2%%time:~3.2%%time:~6.2%.log


If necessary, replace the NetatWorkMailGatewayGatewayRole.exe process with the process that causes the high processor load. Execute the command several times and then send the resulting log files in zipped form to NoSpamProxy Support.

This article describes how to disable the LoopbackCheck of the Windows server. This is necessary whenever the Web Portal and the Gateway Role or Intranet Role are installed on the same server and the connection from the Gateway Role to the Web Portal is to be established using the FQDN.

To do this, proceed as follows:

  1. Click Start, click Run, type regedit, then click OK.
  2. Click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  3. Right-click Lsa, point to New, and then click the DWORD value.
  4. Type DisableLoopbackCheck, and then press [ENTER].
  5. Right-click DisableLoopbackCheck. Then click Change.
  6. In the Value box, type 1, and then click OK.
  7. Exit Registry Editor.
  8. Restart your computer for the change to take effect.

Alternatively, you can share individual host headers. You can find instructions here: http://www.techtask.com/sharepoint2010/loopback-check-in-sharepoint-2010-ausschalten-disableloopbackcheck/

Starting with NoSpamProxy 9.2, header-based routing is available. The setting is only configurable via the configuration file itself. In order to use header-based routing, proceed as follows:

  1. Create a connector for the respective emails.
  2. Edit the files “Intranet Role.config” and “Gateway Role.config” in the directory “C:\ProgramData\Net at Work Mail Gateway\Configuration\” as explained in steps 3 to 5.
  3. In the respective files, search for the connector that you created in the first step.
  4. In the connector settings, find the following tag:
    <headerMatches comparisonMode="Or" />
  5. Modify the tag to look like this:
    <headerMatches comparisonMode="Or">
    <match headerName="name" value="value" />
    </headerMatches>

Now you can make the appropriate settings. You can also search for several header values and combine the search function with an AND operator. The entry will look as follows:
<headerMatches comparisonMode="And">
<match headerName="name" value="value" />
<match headerName="name" value="value" />
<match headerName="name" value="value" />
</headerMatches>

Also make this change in the “Gateway Role.config” file.

IMPORTANT
Before you save the configuration file, you must stop the corresponding service. Only then can you save the configuration file properly.

If you want to run NoSpamProxy, or parts of it, in a virtual machine in a Microsoft Azure environment, you need an IP address that will be retained even after the machine restarts. To achieve this, you must set up a Reserved IP Address. If you fail to do this, there is a very good chance that a different IP address will be assigned after the machine restarts.

To set up a Reserved IP address, please use the information in the following Microsoft article:
http://azure.microsoft.com/blog/2014/05/14/reserved-ip-addresses/

This article describes how you can customize the templates for the design of the system emails of NoSpamProxy (including the PDF mails) starting with NoSpamProxy 11.x so that different designs are used based on the sender domain. NoSpamProxy uses the template engine for .NET “Razor” as basis for the dynamic change.

The CSHTML files to be edited are located in the directory %Program Files%\Net at Work Mail Gateway\Intranet Role\Templates. After the change, the files are automatically replicated to all connected gateway roles.

IMPORTANT
You need at least rudimentary HTML knowledge in order to make the adjustments.

Adaptation of the template files

You are welcome to request prefabricated sample files with different designs from NoSpamProxy Support. This file can only be used as of NoSpamProxy 11.0. In this example two different designs are used for the sender domains netatwork.de and nospamproxy.de. You can extend or reduce the number of domains at any time.

After downloading, unpack the ZIP file into a temporary folder. It contains the following files:

  • CommonMailTemplate.cshtml
  • CommonMailTemplateNaw.cshtml
  • CommonMailTemplateNsp.cshtml
  • ConvertMailContentToPdfAttachmentActionPdfHeader.cshtml
  • ConvertMailContentToPdfAttachmentActionTeaser.cshtml
  • EncryptedMailNotificationTemplate.cshtml

Start with the files that begin with “CommonMailTemplate”. Here you determine the appearance of all emails that are required for the PDF Mail. Make sure that you store the standard design in the CommonMailTemplate.cshtml. Customize the style sheets in the respective files according to your needs. The corresponding logos will also be included in these files. In later live operation, the logo files with the correct name must also be available in the Templates folder.

Then adjust the file “ConvertMailContentToPdfAttachmentActionPdfHeader.cshtml”. This file determines the layout of the PDF file as such. In contrast to the CommonMail template files, you only need one file here to define the exceptions. The adjustments take place in the upper part. An example for three different designs is included. What is important is that you specify the design for the different domains. If NoSpamProxy does not find the corresponding sender domain during live operation, it uses the default design, which you can define with the template editor in the admin GUI.

When all files are adjusted, copy all CSHTML files into the Templates folder of your program version. Make a backup of all contained files beforehand!
Please note that the files will be overwritten when patching or upgrading. After a version upgrade, please do not copy the older, modified files over the newer ones, but modify them again. Otherwise there is a risk that new, necessary information will be missing in the template files.

Overview of available template files

The following list provides an overview of the function of the individual files:

ApplySymmetricEncryptionPasswordNotice.cshtml

If a user sends an email as PDF Mail, he will receive a notification of the password used, or information that the password was sent to the recipient by SMS or that the creation of the PDF Mail failed. The text of the respective notification is in this file. The appearance regarding colors and logo is defined via the CommonMailTemplate.

AttachmentManager.cshtml

If a file is removed from an email using the content filter rules, the recipient receives information about it. The attachment can either be removed and deleted, it can be uploaded to the Web Portal, and it can be uploaded to the Web Portal and assigned an admin share. A separate text is available for each of the three actions, which can be edited in this file. The appearance regarding colors and logo is defined via the CommonMailTemplate.

AttachmentManagerNotificationForBlockedAttachmentsModel.cshtml

If emails with certain file attachments are rejected via the content filter rules, the sender receives information about the rejection. The content of this message can be defined in this file. The appearance regarding colors and logo is defined via the CommonMailTemplate.

AttachmentQuarantine.cshtml

If a file is moved to the Web Portal using the content filter rules and assigned an admin share, the administrator receives an info mail about it. The content of this email is defined in this file. The appearance with regard to colors and logo is determined via the CommonMail template.

AttachmentQuarantineApproval.cshtml

If a file is moved to the Web Portal using the content filter rules, assigned an admin release, and then released by the administrator, the actual recipient of the file receives information about the release. The content of this email is defined in this file. The appearance with regard to colors and logo is determined by the CommonMail template.

CommonMailTemplate.cshtml

This file defines the general appearance of notifications. Here, for example, the colors and the logos to be used are stored as HTML tags. All other files except the “ConvertMailContentToPdfAttachmentActionPdfHeader.cshtml” contain only the text modules.

ConvertMailContentToPdfAttachmentActionPdfHeader.cshtml

The appearance of the PDF file is defined in this file. Colors and logos must be defined here again.

ConvertMailContentToPdfAttachmentActionTeaser.cshtml

This file contains the text for the carrier email of the PDF file. The recipient of a PDF Mail is informed that the actual content of the email is in the attached PDF document. The appearance is defined via the CommonMailTemplate.

ConvertOfficeDocumentToPdfPreface.cshtml

With the “ConvertOfficeDocumentToPDF” action, it is possible to convert Office documents to PDF to provide the recipient with a preview without active content. Information is placed in front of the generated PDF document. The content of this information is defined with this file.

DeliveryNotificationReport.cshtml

This is the content of the send report if a user has requested it in Outlook. The appearance is defined via the CommonMailTemplate.

DeMailConnectorIssueEscalationMail.cshtml

If NoSpamProxy cannot retrieve or send De-Mail repeatedly, an administrator will be notified. The content of this message can be defined here.

EncryptedMailNotificationTemplate.cshtml

If a user marks an email as “Automatically encrypt” and enQsig does not have a cryptographic key, the recipient will be informed. This info mail states which options he has. The content of this email is recorded in this template. The appearance is defined via the CommonMailTemplate.

EncryptionDelayedNotificationForSender.cshtml

If a user marks an email as “Automatically encrypt” and enQsig does not have a cryptographic key, the sender is informed about the delay. The content of the delay message is defined here. The appearance is defined via the CommonMailTemplate.

EncryptionFailureNotificationForSender.cshtml

If a user marks an email as “Automatically encrypt” and an encryption error occurs, the sender is informed. The content of this message can be found here. The appearance is defined via the CommonMailTemplate.

EncryptionSucceededNotificationForSender.cshtml

If a user marks an email as “Automatically encrypt”, he will receive a notification as soon as the email has been encrypted. The appearance is defined via the CommonMailTemplate.

​LargeFileDownloadNotification.cshtml

If the recipient of a file that was previously moved to the Web Portal downloads it, the sender is notified. The content of this information is determined by this file.

MailOnHoldExpired.cshtml

If a user marks an email as “Automatically encrypt” and enQsig has no cryptographic key and the recipient of the email does not deposit a cryptographic key within 5 days, the email will be discarded and the sender informed. The content of this message can be found here. The appearance is defined via the CommonMailTemplate.

MailValidationError.cshtml

If a De-Mail cannot be sent via the De-Mail connector, the sender is notified. The content of this message can be found here. The appearance is defined via the CommonMailTemplate.

PolicyFailureNonDeliveryMessage.cshtml

The sender will be notified if an email violates the policy in the rules. The content of this message can be found here. The appearance is defined via the CommonMailTemplate.

QualifiedSignatureIssueEscalationMail.cshtml

If the verification or creation of a qualified signature fails, a notification is sent to a specified address. The content of this message can be found here. The appearance is defined via the CommonMailTemplate.

SampleAutoReply.cshtml

With the action “AutoReply” it is possible to answer e-mails with an automatically generated email. The content of this reply is defined here.

SymmetricPasswordUpdateNotification.cshtml

If an external recipient has stored a password for the PDF mail on the WebPortal, he will be notified of the change. The content of this message can be found here. The appearance is defined via the CommonMailTemplate.

WordFilterMatchNotification.cshtml

The word filter provides the ability to notify any email address when certain words are found in emails. The content of this notification can be defined here.

This article explains how to check database integrity and repair it if necessary.

Microsoft SQL Server Management Studio is required to do this.

    1. Open Microsoft SQL Server Management Studio.
    2. Expand the Databases menu item.
    3. Click on the database “NoSpamProxyDB” and then on New Query in the upper left area. A white window now appears on the right side. To check a suspicious database for errors, you can use the following command in SQL Management Studio:
      DBCC CHECKDB ('NoSpamProxyDB')

    The next command would then correct these errors. You must set the Restrict Access mode from MULTI_USER to SINGLE_USER under Options in the database's Properties before running the command.
    DBCC CHECKDB ('NoSpamProxyDB', REPAIR_REBUILD)

    The success is checked again with the following command.
    DBCC CHECKDB ('NoSpamProxyDB')

    No red error messages should appear in the output now. If the database could not be successfully repaired and red error messages still appear, execute the more aggressive command
    DBCC CHECKDB ('NoSpamProxyDB', REPAIR_ALLOW_DATA_LOSS)

    You should also check the success with the above command afterwards. If the database cannot be repaired, you can also create a new database via the NoSpamProxy interface. The point can be found under the node “Troubleshooting”.

    If problems with the SQL Server occur often, a defect on the SQL Server is likely.

The default settings are as follows:

  • The first attempt takes place after 5 minutes.
  • The second attempt takes place after 10 minutes.
  • The third attempt takes place after 15 minutes.
  • Each additional attempt is made every 30 minutes.
  • The first delivery delay notification is generated after 6 hours.
  • The delivery is stopped after 1 day.
  1. Stop the gateway role. The corresponding settings are saved in the file “Gateway Role.config” in the directory “C:\ProgramData\Net at Work Mail Gateway\Configuration\” on all your installed gateway roles. S
  2. Search for the following line in the file:
    <netatwork.nospamproxy.proxyconfiguration ... >
  3. Add the following entry directly below this line if it does not already exist in a similar form:
    <queueConfiguration firstRetryInterval="00:15:00" secondRetryInterval="00:30:00" thirdRetryInterval="01:00:00" subsequentRetryInterval="04:00:00" expirationTimeout="3.00:00:00" sendDelayNotificationAfter="12:00:00" />
  4. Adjust the values to the desired value and save the file.
  5. Restart the previously stopped gateway role(s).

How to change the SMTP connection properties of the gateway role

This article describes how to change the SMTP connection properties of the Gateway Role. The corresponding settings are made in the file “Gateway Role.config” in the directory “C:\ProgramData\Net at Work Mail Gateway\Configuration\”.

  1. Search for the following line in the file:
    <netatwork.nospamproxy.proxyconfiguration ... >
  2. Add the following entry directly below this line:
    <smtpServicePointConfiguration maxActiveConnectionsPerEndPoint="25" maxConnectionIdleTime="00:01:00" isServicePointRecyclingEnabled="false" maximumMailsPerSession="2" />
  3. Now adjust the values to the desired value.

Please note

Before you save the “Gateway Role.config” file, you must stop the “NoSpamProxy – Gateway Role” service. Only then you can save the configuration file properly.