Skip to content

Creating your first rule

A rule checks incoming email and runs actions when it matches. Much gets done this way before you even open the inbox.

Goal: all newsletters from one sender get a tag and move to their own folder. Create the tag “Newsletter” beforehand, because in the rule editor you only pick existing tags.

  1. Open Settings → Automations.
  2. Choose New Rule.
  3. Enter a name under Rule name, say “Sort newsletters”.
  4. Under Conditions there is already a first condition. Change it to field From, comparison contains, value newsletter@example.com.
  5. Under Actions there is already Move to mailbox. Pick your newsletter folder as the target.
  6. Add a second action with + add action: Add tag with the tag “Newsletter”.
  7. Confirm with Add rule.

The rule takes effect from the next incoming mail of that sender.

It is quicker to start from the mail itself, without the detour via the settings:

  • In the mail list: right-click the mail, then Create rule and one of the presets: Messages from … (exactly this sender), Messages from @… (all senders of this domain) or Messages with this subject…. This also works with several selected mails, as long as they all come from the same sender and the same account; the subject preset is offered for exactly one mail only.
  • In the open mail: right-click an address in the mail header, then Create rule. Sender and reply-to address offer Messages from … and Messages from @…, recipients Messages to …. Alternatively, click the address and choose Create rule in the contact card; the editor then opens straight away with the preset for exactly this address.

The rule editor then opens already filled in: with the chosen preset and, in addition, the Mail account condition set to this mail’s account, so the rule only acts there. Move to mailbox is ready as the action, you only pick the target. Everything else can be changed as usual.

At the bottom of the editor you decide what happens to existing mail:

  • Only for new messages: the rule acts from the next incoming mail on.
  • Also apply to this message now (preselected): YouniqMail runs the new rule once right away on the mail it was created from. With several selected mails the option reads Also apply to the … selected messages now. Other rules do not run again. For a great many mails, the next option is the better choice.
  • Also apply to all matching messages in “…”: the rule runs over the whole mailbox of this mail, as described under Apply a rule to a mailbox.

Mails in local folders are left untouched.

For big freemail providers such as Gmail or Outlook.com, the preset for the whole domain is missing, because it would hit the mail of any number of unrelated senders. In Drafts and Sent the mail list’s menu does not offer the entry; the address menu and the contact card work everywhere.

Rules act as new email arrives, and in every folder YouniqMail syncs, not just the inbox. If they should only act there, add the Mailbox / folder condition. With Mail account you limit a rule to individual accounts.

Rules run in YouniqMail on your computer, not on the mail server. Mail that arrives while the app is closed is handled at the next sync.

The Trash, Drafts and Sent folders are left out, so rules never act on mail you send yourself. In the spam folder rules run only when you switch on Run rules in the spam folder too under Settings → Automations, below the list of rules; it is off by default. The sender of a spam mail is often forged, and a rule would treat it as genuine.

Mail from senders under Settings → Blocked Contacts goes straight to its folder; no rule acts on it.

If you move a mail into the inbox, the archive or a folder of your own on another device or in webmail, it arrives there anew for YouniqMail, and the rules run again. The Mailbox / folder condition guards against this.

If you move an email out of the spam folder yourself in YouniqMail, the rules do not run on it afterwards. If a rule should still take it, use Apply….

A rule acts on mail that is already there only when you trigger it explicitly: when creating it from a mail or at any time with Apply…. In addition, rules run during the first sync of a new account for the most recent mails whose content comes along right away.

The Body condition (Pro) checks the text of the mail and the addresses its links point to, not the formatting behind them. When a new mail arrives without its text, for example a very large or an encrypted one, its rules wait until the text is there. If it cannot be read, no rule that asks about the body acts on it. The Raw headers condition (Pro) works for new mail only, because YouniqMail does not keep the headers of stored mail.

For one-off cleanups without a rule, use search instead: open the results, select all, run the desired action.

A rule can also be applied afterwards to all messages that are already in a mailbox:

  1. Open Settings → Automations.
  2. Choose Apply… on the rule.
  3. Pick the Mailbox and confirm with Continue.

YouniqMail first counts how many messages match and asks before anything changes. The rule then runs in the background. A notice shows the progress, and you can also cancel the run from there. The run cannot be undone. Apply… needs a connection to the server, and only one such run goes at a time. If the rule is paused for lack of a license, YouniqMail shows the Pro offer instead.

Rules with an integration, a copy or a move into another account work through the messages one by one. After Cancel, only the message in progress is then finished. All other rules work in blocks of up to 500 messages and still finish the current block. Until then the notice says Cancelling…. A webhook that is waiting to try again is not tried again.

Keep in mind:

  • In-app notice and Play sound are skipped, they only make sense for new mail.
  • Integrations such as webhooks, scripts, calendar, Trello, Asana or Notion run separately for each matching message. The confirmation points this out specifically.
  • If an integration cannot be reached five times in a row, for example because the server does not answer or the sign-in fails, the run stops calling it for the remaining messages. If it only turns single messages away, such as a script that ends with its own error code, the run keeps calling it until it has turned 25 messages in a row away. The other actions keep running, and the final notice says how many calls were left out.
  • Rules with the Raw headers condition cannot be applied, because YouniqMail does not keep the headers of stored mail. Neither can rules that are turned off or use a missing folder; the button is greyed out then.
  • Local folders are excluded.
  • A rule with the Body condition leaves out messages whose text is not loaded yet or cannot be read. The confirmation says how many.

How several conditions work together is set by the Mode field:

  • All conditions match (default)
  • Any condition matches
  • Exactly one condition matches
  • No condition matches

A rule for “invoices from two different senders” therefore needs just two conditions on From and the mode Any condition matches.

YouniqMail first checks all active rules against the incoming mail and then runs the actions of every matching rule one after another, in the order the rules were created. If two rules move the same mail, the one created last wins.

The order cannot be changed. To keep any further rule from acting after a rule, turn on Stop after this rule in it.

The conditions see the mail as it arrived. What another rule changes, such as a tag, a flag or the folder, is not seen by any rule.

Each rule has its own switch in the list to turn it off temporarily, plus Duplicate and Delete.

If you delete a folder in webmail or in another program, it also disappears from YouniqMail at the next sync. A folder renamed there disappears too and shows up under its new name as a new folder. The same applies when you delete a folder in YouniqMail. If you rename it in YouniqMail instead, your rules take over the new name and keep running.

YouniqMail pauses rules that use such a folder as a target or in a condition. They then do not run at all, not even their other actions. This way a rule does not recreate the folder under its old name, and no mail is only half processed, such as marked as read but not moved.

  • In the list under Settings → Automations the rule carries the label Needs changes and names the missing folder.
  • In the rule editor the folder shows with the suffix “(not found)”. Choose another folder, and the rule can be saved again.
  • If the folder comes back, the rule runs again by itself.

When a folder disappears that was used by a rule, a smart folder, the counter on the app icon or the search exclusions, YouniqMail tells you so once with a notice. Open rules takes you straight to the list.

If a rule immediately moves an incoming mail away, say into a folder, the archive or the trash, YouniqMail suppresses its sound and notification. Otherwise you would be alerted about mail you never get to see in the inbox. This happens on its own; there is no setting for it. If the target folder itself is set up for notifications, it announces the mail there.

That also explains why a missing email sometimes vanishes without any trace. See My emails are not arriving for details.

For rules that move or delete, an intermediate step pays off: create the rule with only the Add tag action at first. After a few days, the tag shows which mail would have been affected. If the selection is right, add the real action. It then applies to all mail arriving from that point on.

The free plan allows 10 rules. If you have more, for example from the trial, they keep running and stay editable. Only New Rule, Duplicate and Create rule from a mail are locked until there is room again.

Advanced automation covers the conditions Body, Raw headers, Attachment filename, Attachment MIME type and Attachment file extension, the comparison matches regex on every field and the actions for integrations. They require Pro. Without a license they are greyed out in the editor and carry the suffix “(Pro)”.

Rules using Pro components are paused without a license rather than deleted. In the list they then carry the label Paused (requires Pro), and they resume unchanged after activation.

A complete list of everything available lives under All conditions and actions.