Rules

Rules

File, label or forward new email as it arrives.

On this page
  1. rules list
  2. rules add
  3. rules update
  4. rules remove
  5. rules reorder
  6. rules test
  7. rules apply
  8. rules import

mailset rules list

List the rules on your mailboxes, in the order they run.

Flags

  • --mailbox<mailbox>optional

    Only this mailbox’s rules.

Returns

With --json it prints a list of Rule objects.

In the API: POST /v1/rules.list

Usage
mailset rules list [--mailbox <mailbox>]
Example
mailset rules list --mailbox moc.elpmaxe@ana

mailset rules add

Add a rule.

Passkey

Flags

  • --mailbox<mailbox>required

    The mailbox the rule runs on.

  • --name<name>optional

    A name for the rule, up to 120 characters.

  • --from<from>optional

    Mail from this sender: an address, a domain or a name.

  • --to<to>optional

    Mail sent to this address.

  • --subject<subject>optional

    Mail with these words in its subject.

  • --has-words<has-words>optional

    Mail with these words anywhere in it.

  • --doesnt-have<doesnt-have>optional

    Mail without these words.

  • --has-attachmentflagoptional

    Mail that carries a file.

  • --larger<larger>optional

    Mail larger than this: bytes, or 5M, 500K.

  • --smaller<smaller>optional

    Mail smaller than this: bytes, or 5M, 500K.

  • --skip-inboxflagoptional

    Archive it as it arrives.

  • --mark-readflagoptional

    Mark it read.

  • --starflagoptional

    Star it.

  • --label<label>optional

    Put this label on it, by name.

  • --forward<forward>optional

    Forward it to this address. Asks for a passkey.

  • --deleteflagoptional

    Move it to Trash.

  • --never-junkflagoptional

    Never send it to Junk.

  • --importantflagoptional

    Mark it important.

  • --never-importantflagoptional

    Never mark it important. Beats important.

  • --tabenumoptional

    File it in this inbox tab.

    One ofprimaryupdatesnewsletterspromotions

  • --apply-existingflagoptional

    Also run it over the conversations already here.

It can ask for your passkey. It prints “This needs your passkey. Open <link>”, then waits until the link is approved or refused. Read its output as it comes: through head or tail, the link shows only after the wait.

Returns

With --json it prints the Rule object.

In the API: POST /v1/rules.add

Usage
mailset rules add --mailbox <mailbox> [--name <name>] [--from <from>] [--to <to>] [--subject <subject>] [--has-words <has-words>] [--doesnt-have <doesnt-have>] [--has-attachment] [--larger <larger>] [--smaller <smaller>] [--skip-inbox] [--mark-read] [--star] [--label <label>] [--forward <forward>] [--delete] [--never-junk] [--important] [--never-important] [--tab primary|updates|newsletters|promotions|] [--apply-existing]
Example
mailset rules add --mailbox moc.elpmaxe@ana --from stripe.com --label Finance --skip-inbox

mailset rules update

Change a rule.

Passkey

Flags

  • <id>argumentrequired

    The rule’s id, from rules list.

  • --name<name>optional

    A name for the rule, up to 120 characters.

  • --from<from>optional

    Mail from this sender: an address, a domain or a name.

  • --to<to>optional

    Mail sent to this address.

  • --subject<subject>optional

    Mail with these words in its subject.

  • --has-words<has-words>optional

    Mail with these words anywhere in it.

  • --doesnt-have<doesnt-have>optional

    Mail without these words.

  • --has-attachmentflagoptional

    Mail that carries a file.

  • --larger<larger>optional

    Mail larger than this: bytes, or 5M, 500K.

  • --smaller<smaller>optional

    Mail smaller than this: bytes, or 5M, 500K.

  • --skip-inboxflagoptional

    Archive it as it arrives.

  • --mark-readflagoptional

    Mark it read.

  • --starflagoptional

    Star it.

  • --label<label>optional

    Put this label on it, by name.

  • --forward<forward>optional

    Forward it to this address. Asks for a passkey.

  • --deleteflagoptional

    Move it to Trash.

  • --never-junkflagoptional

    Never send it to Junk.

  • --importantflagoptional

    Mark it important.

  • --never-importantflagoptional

    Never mark it important. Beats important.

  • --tabenumoptional

    File it in this inbox tab.

    One ofprimaryupdatesnewsletterspromotions

  • --apply-existingflagoptional

    Also run it over the conversations already here.

It can ask for your passkey. It prints “This needs your passkey. Open <link>”, then waits until the link is approved or refused. Read its output as it comes: through head or tail, the link shows only after the wait.

Returns

With --json it prints the Rule object.

In the API: POST /v1/rules.update

Usage
mailset rules update <id> [--name <name>] [--from <from>] [--to <to>] [--subject <subject>] [--has-words <has-words>] [--doesnt-have <doesnt-have>] [--has-attachment] [--larger <larger>] [--smaller <smaller>] [--skip-inbox] [--mark-read] [--star] [--label <label>] [--forward <forward>] [--delete] [--never-junk] [--important] [--never-important] [--tab primary|updates|newsletters|promotions|] [--apply-existing]
Example
mailset rules update rl_1c7e3a9f5b2d4068e4a9c2f1 --label Invoices --mark-read

mailset rules remove

Delete a rule.

Flags

  • <id>argumentrequired

    The rule’s id, from rules list.

Returns

With --json it prints what the API returns.

In the API: POST /v1/rules.remove

Usage
mailset rules remove <id>
Example
mailset rules remove rl_1c7e3a9f5b2d4068e4a9c2f1

mailset rules reorder

Set the order a mailbox’s rules run in.

Flags

  • --mailbox<mailbox>required

    The mailbox whose rules these are.

  • --ids<a,b,…>required

    Every rule’s id, in the order they should run.

    Or @<path>, to read the JSON from a file.

Returns

With --json it prints a list of Rule objects.

In the API: POST /v1/rules.reorder

Usage
mailset rules reorder --mailbox <mailbox> --ids <a,b,…>
Example
mailset rules reorder --mailbox moc.elpmaxe@ana --ids rl_9a2f6c1e8b4d3057c1e6a3b8,rl_1c7e3a9f5b2d4068e4a9c2f1

mailset rules test

Show what a rule would match, without doing anything.

Flags

  • <id>argumentoptional

    A rule you have, by its id. Left out: the flags describe one.

  • --mailbox<mailbox>optional

    The mailbox to test against, for a rule described by flags.

  • --name<name>optional

    A name for the rule, up to 120 characters.

  • --from<from>optional

    Mail from this sender: an address, a domain or a name.

  • --to<to>optional

    Mail sent to this address.

  • --subject<subject>optional

    Mail with these words in its subject.

  • --has-words<has-words>optional

    Mail with these words anywhere in it.

  • --doesnt-have<doesnt-have>optional

    Mail without these words.

  • --has-attachmentflagoptional

    Mail that carries a file.

  • --larger<larger>optional

    Mail larger than this: bytes, or 5M, 500K.

  • --smaller<smaller>optional

    Mail smaller than this: bytes, or 5M, 500K.

  • --skip-inboxflagoptional

    Archive it as it arrives.

  • --mark-readflagoptional

    Mark it read.

  • --starflagoptional

    Star it.

  • --label<label>optional

    Put this label on it, by name.

  • --forward<forward>optional

    Forward it to this address. Asks for a passkey.

  • --deleteflagoptional

    Move it to Trash.

  • --never-junkflagoptional

    Never send it to Junk.

  • --importantflagoptional

    Mark it important.

  • --never-importantflagoptional

    Never mark it important. Beats important.

  • --tabenumoptional

    File it in this inbox tab.

    One ofprimaryupdatesnewsletterspromotions

Returns

With --json it prints what the API returns.

In the API: POST /v1/rules.test

Usage
mailset rules test [<id>] [--mailbox <mailbox>] [--name <name>] [--from <from>] [--to <to>] [--subject <subject>] [--has-words <has-words>] [--doesnt-have <doesnt-have>] [--has-attachment] [--larger <larger>] [--smaller <smaller>] [--skip-inbox] [--mark-read] [--star] [--label <label>] [--forward <forward>] [--delete] [--never-junk] [--important] [--never-important] [--tab primary|updates|newsletters|promotions|]
Example
mailset rules test --mailbox moc.elpmaxe@ana --from stripe.com

mailset rules apply

Run a rule over the conversations already here, in the background.

Flags

  • <id>argumentrequired

    The rule’s id, from rules list.

Returns

With --json it prints what the API returns.

In the API: POST /v1/rules.apply

Usage
mailset rules apply <id>
Example
mailset rules apply rl_1c7e3a9f5b2d4068e4a9c2f1

mailset rules import

Turn a Gmail mailFilters.xml export into rules.

Passkey

Flags

  • <mailbox>argumentrequired

    The mailbox the rules go on.

  • --file<path>required

    The file to send, read from this machine.

It can ask for your passkey. It prints “This needs your passkey. Open <link>”, then waits until the link is approved or refused. Read its output as it comes: through head or tail, the link shows only after the wait.

Returns

With --json it prints what the API returns.

In the API: POST /v1/rules.import

Usage
mailset rules import <mailbox> --file <path>
Example
mailset rules import moc.elpmaxe@ana --file mailFilters.xml