Policy Configuration
Create custom rules to control email flow based on senders, recipients, and conditions.
Understanding Policies
Policies are rules that determine how SecZim handles each email. Each policy consists of:
- Conditions: What to match (sender, recipient, domain, IP)
- Action: What to do when conditions match (ACCEPT, REJECT, DEFER)
- Priority: Order in which policies are evaluated (higher = first)
Policy Actions
| Action | Description | SMTP Code |
|---|---|---|
| ACCEPT | Allow the email through | 250 |
| REJECT | Permanently reject the email | 550 |
| DEFER | Temporarily reject (retry later) | 450 |
| DUNNO | Continue to next policy | - |
Creating a Policy
In the dashboard, go to Policies → Add Policy:
- Enter a descriptive name
- Set the priority (1-100, higher evaluated first)
- Define conditions (sender, recipient, etc.)
- Choose the action
- Optionally add a custom rejection message
- Save and enable the policy
Pattern Matching
Policies support wildcards and patterns:
| Pattern | Matches |
|---|---|
| user@example.com | Exact email address |
| @example.com | Any address at example.com |
| *@example.com | Same as above (wildcard) |
| user@* | This user at any domain |
Common Policy Examples
Block a Specific Sender
Name: Block Spammer
Sender: spammer@malicious.com
Action: REJECT
Message: Sender blocked by policy
Whitelist a Domain
Name: Whitelist Partner
Sender: @trusted-partner.com
Action: ACCEPT
Priority: 90 (high, to override other rules)
Block External to Internal-Only Address
Name: Protect Internal Address
Recipient: internal-only@yourdomain.com
Sender: NOT @yourdomain.com
Action: REJECT
Message: This address only accepts internal mail
Policy Evaluation Order
- Policies are sorted by priority (highest first)
- First matching policy with ACCEPT/REJECT/DEFER stops evaluation
- DUNNO continues to the next policy
- If no policy matches, default action is ACCEPT
Important
Be careful with high-priority REJECT policies. A misconfigured policy can block legitimate emails. Test new policies thoroughly.
Disabling a Policy
You can disable a policy without deleting it by toggling the "Active" switch in the dashboard. This is useful for testing or temporary changes.
Policy Logs
View which policies triggered for each email in Logs → Session Tracking. The log shows the policy name and action taken.