Welcome to MSH Zimbra Rules
MSH Zimbra Rules is a server-side mail processing application for Zimbra Collaboration Suite. It automatically appends user signatures to both text and HTML emails, ensuring consistent branding across all messages. It can add disclaimers to outgoing messages based on your organization's compliance requirements. It sends automated replies when certain conditions are met, helping you maintain communication even when you are unavailable. Additionally, it manages policy rules that intelligently filter messages based on multiple criteria, giving you complete control over your email flow.
Because everything happens on the server, no client-side plugins or per-device configuration are needed - rules apply to every message regardless of which mail client or device sent it.
How the application works
The application integrates with the Postfix MTA bundled with Zimbra Collaboration Suite using the standardized milter protocol. This protocol enables applications running outside the Mail Transfer Agent (MTA) to inspect and modify mail content, covering both headers and body. All inspection and processing occurs before the message enters the mail queue, ensuring real-time email handling.
The architecture consists of two main components working together.
The core component, msh-zr-milter, communicates directly with Zimbra's Postfix and
handles all mail processing operations. The second component, msh-zr-web, is the
Administrator Panel - a web application served at https://<host>:7081 that acts as your
central management console where you configure all settings and define processing rules.
Features
Four rule families
-
Signature Rules - Automatically append personalized, HTML-rich signatures to outgoing emails, with flexible positioning (under reply text or at a fixed marker).
-
Disclaimer Rules - Append compliance text to messages with configurable placement (top or bottom), duplicate detection, and sensitivity tuning.
-
Autoresponder Rules - Send automated replies when conditions are met, with rate limiting, duplicate prevention, and control over subject, sender, and whether the original message is included.
-
Policy Rules - A powerful rule engine that inspects and manipulates email flow before messages enter the queue; rules can be organized into named groups.
Templates and variables
-
Template System - Create and reuse HTML/text templates for signatures and disclaimers, with a visual designer, raw HTML editing, live preview, and user-attribute substitution.
-
Template Variables - Insert per-user data (name, title, phone, photo, etc.) and message metadata as placeholders into templates and rule fields, resolved at send time. Conditional blocks and string helpers let a single template adapt to each sender.
-
Zimbra Directory Integration - Import users, groups, and domains from Zimbra's built-in LDAP directory, and use them in rule conditions and template variables.
Rule conditions and management
-
Rule Conditions & Exceptions - All rule types share a rich condition set: message direction, type (new/reply/forward, signed, encrypted), sender, recipient, headers, subject/body content, attachment properties, message size, recipient count, and rate-based message counting.
-
Archive Inspection - Look inside ZIP, 7z, RAR and TAR attachments, nested archives included, and match on the files they hold - or catch password protected archives, the usual way to get malware past antivirus scanning.
-
External Scripts - Run your own script from the server's scripts directory as a condition and match on its exit code or output, for virus scans, lookups in your own systems and other custom checks.
-
Rules Processing Switch - Switch all rules, or the rules of one type, off and on without touching the rules themselves, optionally until a set time, with the reason shown to every administrator.
-
Rule Scheduling - Activate any rule only during specified time windows, enabling time-based email policies.
-
Domain Management - The domains your server handles are discovered from the Zimbra directory, so messages are automatically classified as incoming, outgoing, or internal, and domains can be used in rule conditions.
Message flow control
-
Message Blocking - Discard, reject, or tempfail messages with custom SMTP response codes and enhanced status codes.
-
Subject Rewriting - Prepend, append, replace, or regex-rewrite the subject line of matching messages.
-
Recipient Management - Add recipients (To, Cc, or Bcc), remove specific recipients, or move all recipients to Bcc in a single action.
-
Header Management - Add, modify, or remove message headers with support for advanced dynamic variables.
-
Message Format Conversion - Convert the message body between plain text and Html: styled Html from text mail, or clean text from Html mail, with attachments kept.
Attachment management
-
Attachment Filtering - Remove attachments by name, MIME type, or size using exact match, wildcards, or regular expressions.
-
Attachment Compression - Compress attachments inline, with options to skip files by name or type.
-
Adding Attachments - Attach a file from the mail server to matching messages.
-
Saving Attachments - Save attachments from matching messages to a folder on the mail server.
-
Stripping Attachments - Remove attachments, save them to a folder on the mail server, and insert a template into the message body in their place.
Automated messaging and integration
-
Message Forwarding - Forward matching messages to another recipient, with a template inserted at the top of the body.
-
New Messages - Send a brand-new email from a template when a rule matches, with its own recipients, subject, attachments and headers.
-
External Programs - Run a program from the server's scripts directory when a rule matches, optionally passing message details as arguments, without a shell and with a cleaned environment.
Administration and monitoring
-
Web Administrator Panel - Manage everything from a browser: rules, templates, domains, directory synchronization, licensing, and access control for administrator accounts.
-
Message Events History - Review the actions performed on processed messages, with a complete per-message processing trace when diagnostic logging is enabled.
-
Rules Tester - Simulate the mail flow with a sample message, signed or encrypted if you like, and see which rules match and what actions would be applied - without sending any real email.
-
Backup & Restore - Export the installation into a zip and import it back, into the same installation or another one, section by section.