TrekMail TrekMail
Business Email

Mail Filters, Auto-Reply, and Sieve: Server-Side Email Rules Are Here

By Alexey Bulygin
Mail Filters, Auto-Reply, and Sieve Editor — visual overview of conditions, actions, and server-side scripting in TrekMail

Until today, TrekMail handled forwarding as all-or-nothing: every email either forwards or it does not. That is useful, but it does not cover the cases where you want to forward some emails, sort others into folders, and ignore the rest.

That changes now. We shipped three features that give you full control over incoming email — without touching a terminal or writing code.

What is new

When you open Settings on any mailbox, you now see four tabs:

  • Forwarding — the same unconditional forwarding you already know.
  • Filters — rules that automatically sort, forward, flag, or discard emails based on conditions you set.
  • Auto-Reply — vacation responder with custom subject, message, start and end dates.
  • Sieve — a raw script editor for writing custom server-side filtering logic (Agency plan).

Every tab is visible on every plan. Free and Starter users can configure everything in advance — settings activate the moment you upgrade.

Filters: sort your inbox without lifting a finger

A filter has two parts: a condition (what to look for) and an action (what to do about it).

Conditions you can match on:

  • Who sent the email (From)
  • Who it was sent to (To)
  • Words in the subject line
  • Words in the message body
  • Email size (over or under a threshold)

Actions you can take:

  • Move to folder — sort newsletters, invoices, or client emails into their own folders. Folders are created automatically if they do not exist.
  • Forward a copy — send a copy to another address (your accountant, your team) while keeping the original.
  • Forward without copy — redirect the email entirely.
  • Flag as important — mark emails that need attention.
  • Discard silently — delete unwanted emails before they reach your inbox.
  • Reject with message — bounce the email back with a custom rejection message.

You can combine multiple conditions with AND or OR logic, and chain multiple actions on a single filter. Filters run in order — first match wins. You can drag to reorder.

Spam is caught before your filters run, so you will never accidentally sort junk into a work folder.

Real examples

Here are filters that real users would set up:

  1. Forward invoices to your accountant. If Subject contains "invoice" → Forward a copy to accounting@yourcompany.com.
  2. Sort newsletters into a folder. If From contains "newsletter" → Move to Newsletters.
  3. Flag emails from your biggest client. If From contains "@importantclient.com" → Mark as flagged.
  4. Discard a known spammer. If From is exactly "spam@annoyingcompany.com" → Discard silently.
  5. Auto-sort by project. If Subject contains "Project Alpha" → Move to folder Project-Alpha.

Each filter takes about 10 seconds to create. No scripting needed.

Auto-Reply: let people know you are away

The Auto-Reply tab gives you a vacation responder in seconds:

  1. Enable auto-reply.
  2. Write your subject and message.
  3. Optionally set start and end dates — the reply turns on and off automatically.
  4. Check "Do not reply to mailing lists" to avoid responding to newsletters.

Each sender gets your auto-reply at most once every seven days. This prevents the annoying situation where someone emails you three times in a week and gets three identical replies.

If you set dates, the auto-reply activates and deactivates on schedule. If you leave dates blank, it stays on until you manually turn it off.

Sieve Editor: full scripting control

The visual filter builder covers most cases. But if you need regular expressions, complex conditional logic, or multi-step sequences, the Sieve tab lets you write raw scripts directly.

The editor has line numbers, live syntax checking, and blocks dangerous extensions. Dovecot validates your script before activating it — syntax errors are caught before anything goes live.

This is an Agency plan feature, but the editor is visible on all plans so you can explore and prepare scripts before upgrading.

API and MCP: automate everything

Every filter, auto-reply, and Sieve feature is available through the REST API and MCP server. TrekMail now exposes 69 tools that let AI agents manage your entire email infrastructure conversationally.

New API endpoints:

  • Create, read, update, delete, and reorder mail filters
  • Get and set auto-reply settings
  • Upload and retrieve raw Sieve scripts

New API scopes: mailboxes:rules:read, mailboxes:rules:write, mailboxes:auto-reply:read, mailboxes:auto-reply:write.

Plan availability

FeatureFreeStarterProAgency
Filters3 (inactive)3 (inactive)10 per mailbox50 per mailbox
Auto-ReplyConfigure (inactive)Configure (inactive)ActiveActive
Sieve EditorView onlyView onlyView onlyFull access

Free and Starter users can set up filters and auto-reply settings in advance. Everything activates the moment you upgrade — no re-configuration needed.

Getting started

Open your mailbox list, click Settings on any mailbox, and start with the Filters tab. The documentation walks through every condition, action, and edge case.

If you are on the API, the scopes reference has the full endpoint list.

Share this article

We use cookies for essential functionality. No ads, no ad tracking.

or
or

Reset email sent

If an account exists for this email, we've sent password reset instructions.

By continuing, you agree to TrekMail's Terms and Privacy Policy.