In the world of modern email management, simply "receiving" mail isn't enough. We want our inbox to work for us—automatically sorting receipts, notifying us of urgent tasks, and protecting us from sensitive data leaks.
If you are using our mail services, you have access to one of the most powerful automation engines in the industry: Stalwart Sieve.
Where to Find Your Filters
You don't need to be a command-line expert to use these tools. You can access your Sieve filters through two main interfaces:
Option 1: Roundcube Webmail (Standard Users)
For most users, the easiest way to manage filters is directly within webmail:
- Log in to Roundcube.
- Navigate to Settings (the gear icon).
- Click on Filters in the sidebar.
- Here, you can use the graphical builder to create new filter sets or click "Actions > Edit Filterset" to edit the raw scripts.
Option 2: Stalwart UI (Administrators & Power Users)
If you have access to the Stalwart management console, you can manage scripts globally or for specific accounts:
- Log in to your Stalwart UI.
- Navigate to Management > Scripts in the left-hand menu.
- Under the Sieve tab, you can view, create, and activate scripts across the server.
- You can also assign specific scripts to domains or users under the Accounts or Domains settings.
What Can You Actually Do?
Because our server uses Stalwart, we support advanced capabilities that go far beyond "if subject contains X, move to folder Y." Here are some real-world examples of how you can level up your inbox.
1. Intelligent Sorting with Variables
Instead of creating dozens of rules, use variables to handle patterns. You can even use Unicode characters (like symbols) to flag specific projects.
require ["variables", "encoded-character"];
set "project" "PROJ-2024";
# Looking for a Subject with the project name and a copyright symbol
if header :contains "Subject" "${project} ${unicode:00A9}" {
fileinto "Projects/Active";
}
2. The "VIP" Notification System
Want to know the second a VIP emails you without checking your phone? Use the enotify capability to send an external alert.
require ["enotify", "envelope", "extlists"];
# Check if the sender is in our server-side 'VIP' list
if envelope :extlist "from" "tag/vip" {
notify "mailto:your-phone-gateway@sms.com" "URGENT: VIP Email Received!";
}
3. Data Protection & Security
You can write scripts that scan for sensitive information, such as credit card patterns, and block them before they are stored or forwarded.
require ["regex", "reject"];
# Block emails containing 16-digit sequences (potential credit cards)
if body :regex "[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}" {
reject "Security Policy: Do not send sensitive card data via email.";
}
4. Precision Auto-Responders
Unlike standard filters that only let you set an "Out of Office" for days at a time, Stalwart allows sub-hour precision. Perfect for when you're just stepping into a 30-minute meeting.
require ["vacation-seconds"];
if header :contains "Subject" "Urgent" {
vacation :seconds 1800 "I'm in a brief meeting. I'll get back to you in 30 minutes!";
}
5. Managing Attachments Like a Pro
Tired of manually saving PDFs? You can tell the server to loop through every part of an email and file it away based on the file type.
require ["mime", "foreverypart", "fileinto"];
foreverypart {
if header :mime :contenttype "application/pdf" {
fileinto "Archive/PDFs";
}
}
Ready to Experiment?
The beauty of Sieve is that it runs on the server. This means your rules work even when your phone is off and your computer is closed.
Whether you prefer the simplicity of Roundcube or the control of Stalwart UI, head over to your settings today and start building your own personal assistant!