Plain-English email rules for your own mail server or custom domain

Connect any IMAP mailbox to MailRules, including your own server or a custom-domain host: what it asks for, what the server needs and how folders are found.

Your own mail server settings
IMAP server
Your server's host name
Port
993
Security
TLS on 993, or STARTTLS on 143
App password
Whatever your server accepts

Any server that speaks IMAP

The other guides cover providers whose settings MailRules already knows. For everything else, there is Other IMAP server. It suits a server you run yourself, such as Dovecot, or a custom domain at a hosting company. You give MailRules the host, port, security and sign-in, and it does the rest over IMAP.

What MailRules checks before it saves

The wizard connects with your details first. It lists the folders, works out which ones are Junk, Trash and Archive, and checks whether the server can move mail safely. Nothing is saved until that test passes.

Same folders in every client

MailRules moves mail on your server, so webmail, phone and desktop clients all show the same result.

01

Connect it in MailRules

  1. In MailRules, open the connect wizard and choose Other IMAP server.
  2. Enter the email address or username you sign in with, and your server's IMAP host name.
  3. Choose TLS (port 993) or STARTTLS (port 143). The port is filled in for you; change it if your server uses another.
  4. Enter the password. If your host uses two-step sign-in, create an app password there and use that.
  5. MailRules tests the connection before it saves anything, and shows the folders it found and whether it can move mail.
  6. Pick starter rules or write your own in plain English, check the preview, then go live.

Good to know about your own mail server

  • MailRules moves mail with the IMAP MOVE command. If the server lacks it, MailRules copies the email, marks that one email deleted and expunges only it, which needs the UIDPLUS extension. On a server with neither, rules can only flag email and mark it read, and the connection test says so.
  • MailRules never sends a plain EXPUNGE, so mail another app has marked deleted is left alone.
  • With IDLE, new mail is picked up as it arrives. Without it, MailRules checks for new mail every 60 seconds.
  • Junk, Trash, Archive, Sent and Drafts are found from the server's special-use flags. If the server does not report them, MailRules looks for common names such as Spam, Deleted Items or Archives, ignoring case.
  • MailRules never creates an Archive or Junk folder. Trashed mail goes to a folder called MailRules Trash, which it creates, unless you switch that setting off.
  • It watches INBOX, and sorts mail that arrives after you connect.

Sources

Checked on 8 October 2026.

Questions

Does it work with a custom domain at a hosting company?

Yes, if the host gives you IMAP access. Use the IMAP host name, port and security from your host's mail settings.

Does my server need Sieve or any plugin?

No. MailRules works over plain IMAP from the outside. It needs no server-side filters, plugins or admin access.

Which username do I enter?

Whatever your server expects at sign-in. For many hosts that is the full email address; some want only the part before the @.

Can I run MailRules on the same machine as my mail server?

Yes. MailRules is one Go binary with SQLite, so it can run next to the server or anywhere that can reach its IMAP port.

Tell your inbox what to do. Then stop thinking about it.

Self-host free from GitHubJoin the cloud waitlist