Skip to main content
Version: 1.1

Rules tester

The Rules Tester lets you simulate the mail flow and verify how your configured rules behave - without sending any real emails. Provide a sample message with a sender, recipients, subject, and other attributes, and the application will process it through your rules exactly as it would during live operation. The results show which rules matched, which conditions were evaluated, and what actions would be applied.

The list keeps the test messages you have sent, with their sent date, sender, recipients, subject and status. Click a message to see its processing details, use Reply... to compose a reply to it, and Remove selected or Remove All to clean up the list.

The tester follows the switches of the rules processing page as they are saved, as the milter does: while processing is switched off, a test message passes through unchanged, and a rule type that is switched off is skipped.

The New test message form, with From, To, Subject and body fields and Message, Details, Attachments, Headers and Scripts tabs

New message​

The New message menu offers:

  • Random incoming..., Random internal..., Random outgoing... - pre-fill a test message of the given direction with random data, using addresses from the synced directory.
  • Custom... - start with an empty message.

Test message compose​

The form has five tabs: Message, Details, Attachments, Headers and Scripts.

Message​

  • From - the sender's email address. Use the User... button to pick from existing users.
  • To - recipient email addresses. Multiple recipients can be added. Use the User... button to select from existing users.
  • Subject - the message subject.
  • Body - the message body, written as Text or as Html, with basic formatting options for Html.

The address fields take name@domain or "Name" <name@domain>, several separated by commas or semicolons. A comma or semicolon inside a quoted name belongs to the name, so "Chan, Matthew" <matthew.chan@example.com> is one recipient. A list pasted from Outlook, such as Doe, John <john@example.com>; Roe, Jane <jane@example.com>, is read as two recipients with their names, and a pasted column of addresses, one per line, is read too.

A message written as Text is sent as plain text only - a single text/plain body, or multipart/mixed with the text and the attachments - so rules for plain-text mail can be tried. A message written as Html carries both the Html and a text alternative.

Details​

  • Sent date - the date and time the message is considered to be sent.
  • Cc, Bcc - further recipients, in the same form as To.
  • Protection - sends the test message as signed or encrypted: None, Signed (S/MIME), Signed (PGP/MIME), Signed, opaque (S/MIME), Encrypted (S/MIME) or Encrypted (PGP/MIME). The message gets the MIME structure of such mail with placeholder bytes instead of a real signature or ciphertext, which is all the rules look at, so the Message type condition with Signed or Encrypted and the actions that leave protected mail alone (signature, disclaimer, add, strip and remove attachments) can be tried without keys or certificates. For an opaque signature or an encrypted message the body and the attachments cannot be edited: they would be inside the ciphertext, where rules cannot see them either.

Attachments​

Files to attach to the test message, for testing attachment-related conditions and actions. The test message carries the uploaded file itself, so conditions that look into attachments - Archive content, Attachment encrypted, External script - give the same answer as in the milter, and the Before and After .eml files hold the file too. A test attachment can be up to 10 MB, like the stored attachments; a larger file is not added and the tester says so.

Headers​

Custom message headers to add to the test message.

Scripts​

The tester does not run the scripts of External script conditions; they get the Simulated script exit code (0 by default) and Simulated script output given here instead. Tick Run the scripts on this server instead to run them for real with the test message - available only when the web app was started with a scripts directory, which is the case unless SCRIPTS_DIR is empty.

Send​

Once the message is ready, click Send to run it through the rules engine and see the results. Send checks the address fields first and marks one whose entry is not an address - for example a name without angle brackets, "Chan, Matthew" matthew.chan@example.com - with the format to use, or an empty From.

Test message details​

Click a sent message to see its details: the sender, recipients and subject, with its protection shown under the subject, the processing trace, and the message before and after processing. The body shows only the formats the message has, so a text-only message opens on its Text view. A sent Text message opens as Text again in Reply....

Html preview​

The Html view of a test message is a preview drawn by the Rules Tester, not by a mail client, and a line above it says so. Mail clients render Html differently: Outlook on the desktop uses the Word engine, webmail clients rewrite and wrap the body and may drop styles, phone apps rescale the message, dark mode changes colours and remote images stay blocked until the recipient allows them. A signature or disclaimer that looks broken, or perfect, in the preview can therefore look different in the mailbox. The preview is shown inside the web page, whose own styles can also affect it. To check the final look, send a real message through the server to a Zimbra, Outlook and Gmail mailbox, and open it on a phone as well. The Text view shows the plain text exactly as it is sent.