Skip to content
mybox Help Center

Help sections

  • Getting Started
  • Account & Billing
  • Domains & DNS
  • Hosting & Servers
  • Email
  • Security & SSL
  • WordPress & CMS
  • Grow Online
mybox.com All services operational
/

Language

  • English
  • Română
  • mybox panel
  • Webmail
Start free
/
  • Getting Started
  • Account & Billing
  • Domains & DNS
  • Hosting & Servers
  • Email
  • Security & SSL
  • WordPress & CMS
  • Grow Online
  • Help Center
  • mybox.com
  • English
  • Română
All services operational Start free
  1. Help Center
  2. Email
  3. WebMail mail.mybox.com
Explainer Email

Overview of Sieve Filter Rules

Updated June 9, 2026 2 min read
On this page
  1. Basic Elements of a Sieve Script
  2. Comments
  3. Required Extensions
  4. Conditions
  5. Common Sieve Conditions
  6. header
  7. address
  8. size
  9. body
  10. Common Sieve Actions
  11. fileinto
  12. redirect
  13. discard
  14. keep
  15. reject
  16. Example Sieve Script
  17. Practical Uses for Sieve Filters
  18. Summary

Sieve is a mail filtering language used by email servers to automatically process incoming messages. It allows users to create rules that sort, move, forward, reject, or delete emails based on specific conditions.

By using Sieve filters, you can automate mailbox management and reduce the time spent organizing messages manually.

Basic Elements of a Sieve Script

Comments

Comments are ignored by the Sieve interpreter and are useful for documenting your rules.

# This is a comment

Required Extensions

Most Sieve scripts begin by declaring the extensions that will be used.

require ["fileinto", "reject"];

These extensions enable additional actions such as moving messages to folders or rejecting messages.

Conditions

Conditions determine when a specific action should be performed.

if header :contains "Subject" "important" {
    # actions
}

In this example, the rule checks whether the email subject contains the word “important”.

Common Sieve Conditions

header

Checks the value of specific email headers.

if header :contains "From" "example@example.com" {
    # actions
}

This rule examines the sender address.

address

Checks email addresses found in message headers.

if address :domain :is "From" "example.com" {
    # actions
}

This example matches any sender from the example.com domain.

size

Filters messages based on their size.

if size :over 500K {
    # actions
}

This condition matches messages larger than 500 KB.

body

Checks the content of the email body.

if body :contains "unsubscribe" {
    # actions
}

This rule triggers when the specified text appears within the message content.

Common Sieve Actions

fileinto

Moves a message to a selected mailbox folder.

if header :contains "Subject" "project" {
    fileinto "Projects";
}

Messages matching the condition will be moved to the “Projects” folder.

redirect

Automatically forwards a message to another email address.

if address :is "To" "old@example.com" {
    redirect "new@example.com";
}

discard

Silently deletes a message without notifying the sender.

if header :contains "Subject" "spam" {
    discard;
}

keep

Leaves the message in the Inbox.

if header :contains "Subject" "important" {
    keep;
}

reject

Rejects the message and returns an error notification to the sender.

if size :over 10M {
    reject "Message too large";
}

Example Sieve Script

The following example demonstrates several common filtering actions:

require ["fileinto", "reject"];

# Move project-related emails
if header :contains "Subject" "project" {
    fileinto "Projects";
}

# Forward messages from a specific sender
if address :is "From" "boss@example.com" {
    redirect "manager@example.com";
}

# Reject oversized messages
if size :over 10M {
    reject "Message too large";
}

# Remove unwanted messages
if header :contains "Subject" "spam" {
    discard;
}

# Keep all remaining messages
keep;

Practical Uses for Sieve Filters

Sieve can be used to automate many common email management tasks, including:

  • Sorting invoices into a dedicated folder
  • Separating work and personal emails
  • Automatically forwarding messages to another address
  • Blocking unwanted senders
  • Filtering newsletters and mailing lists
  • Rejecting oversized attachments
  • Organizing support requests into specific mailboxes

Summary

Sieve provides a powerful and flexible way to automate email management directly on the mail server. By combining conditions and actions, you can create advanced filtering rules that keep your mailbox organized and ensure important messages are handled exactly as intended.

Whether you want to sort incoming mail, block unwanted messages, or automate forwarding, Sieve offers a reliable server-side solution that continues to work even when your email client is offline.

Was this article helpful?

Didn't find an answer?

Our support team is here for you 24/7 – write to us and we will help you sort it out.

Helpdesk 24/7 Open a ticket in the mybox panel mybox panel Log in and manage your services

On this page

  1. Basic Elements of a Sieve Script
  2. Comments
  3. Required Extensions
  4. Conditions
  5. Common Sieve Conditions
  6. header
  7. address
  8. size
  9. body
  10. Common Sieve Actions
  11. fileinto
  12. redirect
  13. discard
  14. keep
  15. reject
  16. Example Sieve Script
  17. Practical Uses for Sieve Filters
  18. Summary

Related articles

All in WebMail mail.mybox.com
How-to WebMail mail.mybox.com How do I set up two-step verification in Webmail? Security is a priority today, and two-step verification, which requires not only knowing and providing a password, but also a one-time code,… 2 min read How-to WebMail mail.mybox.com How to change your email password in WebMail The mailbox password can be changed directly in webmail at mail.mybox.com — without accessing the mybox panel. This is useful when the… 1 min read Explainer WebMail mail.mybox.com What Is Webmail? Webmail is a web-based interface that allows users to access, send, receive, and manage email messages directly through a web browser without… 2 min read
mybox

Modular web hosting – free out of the box, modular to grow.

Help sections

  • Getting Started
  • Account & Billing
  • Domains & DNS
  • Hosting & Servers
  • Email
  • Security & SSL
  • WordPress & CMS
  • Grow Online

mybox

  • mybox.com
  • mybox panel
  • Webmail
  • Helpdesk 24/7
© 2026 mybox 1,680 articles