Roundcube filters: sort your email automatically
Roundcube filters are powerful rules that automatically sort, forward or edit your email. Instead of organizing every message by hand, you let filters do the work. In this article, we explain how to set up filters and get the most out of them.
What are Roundcube filters?
Filters are "if-then" rules:
- If a message meets certain conditions
- Then perform an action
For example:
- If sender = nieuwsbrief@bol.com → Move to folder "Newsletters"
- If subject contains "Invoice" → Mark as important
- If message is larger than 10MB → Move to folder "Large files"
Filters run automatically on the server. They also work when you're not logged in.
Setting up filters in Roundcube
Step 1: open the filter settings
- Log in to Roundcube webmail
- Click "Settings" (gear icon)
- Select "Filters" in the left menu
You now see an overview of your existing filters (or an empty list).
Step 2: create a new filter
- Click the "+" icon or "Add filter"
- Give the filter a recognizable name
- Set the conditions ("If")
- Set the action ("Then")
- Click "Save"
Filter conditions ("If")
You can filter on:
Sender (From)
- is equal to - Exact match (newsletter@company.nl)
- is not equal to - Everything except this address
- contains - Part of the address (@company.nl)
- not contains - Excludes a domain
Recipient (To)
Handy if you have multiple email addresses:
- Mail to support@yourdomain.nl → folder "Support"
- Mail to invoices@yourdomain.nl → folder "Accounting"
Subject
- contains - Keyword in the subject ("Invoice", "Order")
- is equal to - Exact subject line
- matches - Regex pattern (advanced)
Size
- greater than - Messages above a certain size
- less than - Messages below a certain size
Handy for separating messages with large attachments.
Date
- older than - Messages from more than X days ago
- newer than - Recent messages
Headers (advanced)
Filter on technical headers:
- X-Spam-Score: for spam filtering
- X-Priority: for urgent messages
- List-Unsubscribe: for mailing lists
Combining conditions
You can combine multiple conditions:
"All conditions must be true" (AND)
- Sender contains @webshop.nl AND subject contains "Order"
- Both must match
"One of the conditions must be true" (OR)
- Sender is newsletter1@company.nl OR newsletter2@company.nl
- One must match
Filter actions ("Then")
Move to folder
The most commonly used action. Automatically moves a message to a folder.
Examples:
- Newsletters → folder "Newsletters"
- Messages from your boss → folder "Important"
- Messages with "ticket" → folder "Support"
Copy to folder
Makes a copy in another folder; the original stays in your inbox.
Handy for:
- Backups of important messages
- Messages that belong in multiple folders
Delete
Delete immediately (to the trash) or delete permanently.
Be careful! Permanently deleted mail can't be recovered.
Mark as read
Automatically mark as read. Handy for:
- Automated notifications you don't need to read
- Newsletters you only archive
Mark with a flag
Adds a flag/star. Handy for:
- Messages that need attention
- Messages from important contacts
Forward
Automatically forwards a message to another address.
Examples:
- Forwarding support messages to a colleague
- A copy to a CRM system
Note: Some hosting providers limit forwarding to prevent spam.
Reply with a message
Send an automatic reply. Handy for:
- Vacation autoresponder
- Confirmation of receipt
Use sparingly - automatic replies can look like spam.
Stop processing
Stops filter processing after this rule. Important if you have multiple filters that may overlap.
Practical filter examples
Sorting newsletters
Name: Newsletters Condition: Sender contains "newsletter" OR sender contains "nieuwsbrief" OR header "List-Unsubscribe" exists Action: Move to folder "Newsletters"
Archiving invoices
Name: Invoices Condition: Subject contains "invoice" OR subject contains "factuur" OR subject contains "payment" Action: Move to folder "Accounting/Invoices", Mark with a flag
Blocking spam from known spammers
Name: Spam block Condition: Sender is spam@example.com OR sender contains "lottery" Action: Delete (permanently)
VIP treatment
Name: Important contacts Condition: Sender is equal to boss@company.nl OR sender is equal to big-client@partner.nl Action: Mark with a flag, Move to folder "Priority"
Large attachments separately
Name: Large files Condition: Size greater than 5MB Action: Move to folder "Large files"
Mail from a specific customer
Name: Customer ABC Condition: Sender contains "@customerabc.nl" Action: Move to folder "Customers/ABC"
Filter order and priority
Filters run in order from top to bottom. This matters:
- Spam filter - Deletes spam
- VIP filter - Flags important mail
- Sorting - Moves messages to folders
If a message matches multiple filters, all actions are performed (unless you use "Stop processing").
Changing the order
In the filter overview, you can drag filters up or down to change the order.
Sieve: the technical foundation
Roundcube filters use Sieve, a standard scripting language for mail filtering. If you see the "Edit filter set" option, you can write Sieve code directly.
Example Sieve script:
require ["fileinto", "imap4flags"];
if address :contains "from" "@newsletter.nl" {
fileinto "Newsletters";
stop;
}
if header :contains "subject" "invoice" {
addflag "\\Flagged";
fileinto "Accounting";
stop;
}
For most users, the graphical interface is enough.
Theory7 email supports all Sieve capabilities plus SpamAssassin integration. Combine automatic spam filtering with your own rules.
See email hosting →
Testing filters
After creating a filter, test it:
- Send a test message that meets the conditions
- Wait 1-2 minutes
- Check whether the message was processed correctly
- Adjust the filter if needed
Troubleshooting
Filter doesn't work
Check:
- Is the filter active? (the checkbox must be on)
- Is the condition exactly right? (Watch out for capitalization with "is equal to")
- Is the filter high enough in the list?
- Does your server support Sieve?
Mail disappears
If mail doesn't arrive:
- Check your Spam/Junk folder
- Check the folders your filters move mail to
- Check that no "Delete" filter is active
Filters aren't executed
This can mean:
- Sieve isn't active on the server
- There's a server error
- Contact your hosting provider
Filters vs. spam filter
Roundcube filters are for manual rules. The spam filter (SpamAssassin) at the server level works automatically.
Use filters for:
- Sorting legitimate mail
- VIP treatment
- Archiving
Let the spam filter:
- Detect and delete spam
- Block phishing
You can combine both: the spam filter catches spam, then your filters sort the rest.
Frequently asked questions
Do filters also work on my phone? Yes! Filters run on the server, so they work no matter how you read your mail.
Can I export/import filters? Not by default in Roundcube. If you edit the Sieve source, you can copy the code and paste it elsewhere.
How many filters can I have? This depends on your hosting provider. Usually dozens of filters are no problem.
Can I filter by attachment name? This requires advanced Sieve extensions that aren't available everywhere. Check with your provider.
0 van 0 vonden dit nuttig