Download from multiple email accounts with multiple rules

Download from several email accounts in one run and give each kind of email its own folder, file name and steps with PRO Rules.

The PRO Rules tab with Use PRO Rules for every account ticked and a list of rules in the order they run

The Free edition of Mail Attachment Downloader downloads from one email account per run. Each account has one rule: the Account rule tab says which emails it downloads, which files it keeps and where it saves them.

This post shows how the PRO editions go further: several accounts in one run, and many rules, each with its own folder, file names and follow-up steps. It is written for version 4.0.

The Account rule tab of the Free edition, on its Filters page, for the account ap@contoso.example
Free edition: one Account rule per account, with its Search, Filters and Folders and file names pages.

Multiple email accounts

In the Free edition you pick an account in the Account box and click Connect and Download. To download from another account, you pick it and run again.

In the PRO editions one run can take several accounts:

  1. Add each account on its own first, with Add account › Email account…, and check it with Test Connection.
  2. Pick <multiple@multiple> in the Account box. The Settings… button next to it changes to Choose accounts….
  3. Click Choose accounts…, tick the accounts, for example finance@contoso.com and ap@contoso.com, and click Validate and use selected. Each account is checked: it must sign in, and its save folders must be writable. Every problem is listed at once.
  4. Click Connect and Download. The accounts run one after another. If one fails, for example because its sign-in expired, the others still run.
The Select accounts window with two accounts ticked and the Validate and use selected button
Tick the accounts, then click “Validate and use selected”.

How many accounts run together depends on the edition: PRO Backup up to 3, PRO Parser up to 5, and PRO Rules Client and PRO Rules Server as many as you have. See the plans and prices.

<multiple@multiple> has no settings of its own. Each account downloads with its own settings. To change them, pick that account in the Account box.

After the run, the Downloads tab shows what each account did: the emails, the files, any errors, and which rule saved each file. Each run names its account. An account that can’t run until you fix something is listed under Action required.

New in 4.0: each account has a History. It remembers the emails it has seen, so nothing is downloaded twice, and a step that failed is tried again on its own.

Several accounts in the background

With PRO Rules Server the program can run as a Windows service, on a PC, a server or a cloud VM, even when nobody is signed in. Open Schedule › Service schedule, pick <multiple@multiple> in Install the service for, click Select accounts…, tick the accounts and click Validate and use selected. Then click Install service.

The Service schedule page of the Schedule tab, with the Install the service for box and the Install service button
Schedule › Service schedule: choose the accounts, then install the service.

The service keeps the copy of your settings it got when it was installed. When you change a setting or a rule later, the page shows Reinstall to apply changes: click Reinstall…. See the PRO Rules Server how-to.

Multiple email rules

The Account rule gives each account one set of choices. For example, on the Search page you set a start date, and on the Filters page you keep only emails whose subject has “invoice”. All of that account’s matching files go to one folder, named one way.

But what if invoices from Acme should go to one folder, purchase orders from Northwind to another, and Word files should also be turned into PDFs?

That is what PRO Rules are for (PRO Rules Client and PRO Rules Server). In version 3.x this tab was called Global filters. Each rule has its own conditions, its own save folder and file names, and its own steps that run after saving.

The PRO Rules tab with Use PRO Rules for every account ticked and a list of rules in the order they run
The PRO Rules tab: the rules, in the order they run.

How PRO Rules work

  • Turn them on: tick Use PRO Rules for every account at the top of the PRO Rules tab. The rules then decide what each account downloads, instead of each account’s Search, Filters and Folders and file names pages.
  • Dates: on the Search scope page of the PRO Rules tab, Only emails from and Only emails up to apply to every account, and override each account’s own dates. On the same page, choose whether Each account decides what it searches (new mail or all mail) or it is The same for all accounts.
  • Every account, or one: a new rule is for all accounts. To make a rule for one account only, add an Account condition to it (more below).
  • Order matters: rules run from the top of the list. Each file is saved by the first rule that matches it, so the rules below it never see that file. The next file of the same email starts again from the top. Drag a rule up or down to change the order.
  • Moving from Account rules: when you turn PRO Rules on, the program offers to move your Account rules to PRO Rules too. Each account’s Search, Filters and folder settings become a rule of its own, and you see each rule first.

Make your first rule

Click New rule… in the PRO Rules tab. The Rule Editor opens. Give the rule a name in Rule name:, for example “Acme invoices 2026 Q1”. The rule has these parts, top to bottom: Which emails, Fields to find, Save, Then and If something fails.

Which emails: the conditions

Click Add a condition and pick what to match: From, Subject, Attachment name, Mailbox folder, Received on or after, Account and more. Put several conditions in an Any of these or All of these group to combine them with OR or AND.

To match on the subject, add a Subject condition and type what to look for:

  • Text in quotes: 'invoice' matches any subject that has “invoice” anywhere in it.
  • AND, OR and NOT: ('invoice' OR 'bill') AND NOT 'reminder'. Use parentheses to group them.
  • A whole value: = before a value matches only that exact text.
  • A regular expression: !! before a .NET regular expression.

Click Test the expression… to try it on a sample text before you save. Conditions match the text exactly as you type it: they don’t fill in fields such as {DATE}.

The Test an expression window: the expression 'invoice' OR 'bill' tried on a sample sentence, with the result It matches
“Test the expression…” shows whether a condition matches.

One account only: add an Account condition and choose the account, for example finance@contoso.com. Without it, the rule runs for every account.

The Rule Editor with conditions for a mailbox folder, received dates, an account, and an Any of these group with From and Subject
Conditions of a rule, with an Account condition and an “Any of these” group.

Save: what, where and how it’s named

Click Save in the rule’s outline:

  • What to save: The attachments, The email and its attachments, or The email only (as an .eml file). Emails without attachments are saved too when the email is part of what you save.
  • Save folder: for example \\fileserver\Finance\Invoices. For a network folder, use a \\server\share path, not a mapped drive letter: the Windows service can’t see mapped drives.
  • File name: build it from fields. Click Fields… to pick them. For example {DATE_LOCAL[yyyy-MM-dd]}_{FILENAME}_{ID}{EXT}.
  • Only files of these types: keep only documents, pictures or the types you list, such as .pdf, .xlsx.

A field in the save folder makes a folder for each value. For example, \\fileserver\Finance\Invoices\{EMAIL_FROM} makes a folder for each sender’s address. Missing folders are made for you.

Keep {ID} in the file name. It is the message’s ID with the part number, so each file’s name is different, even when two emails send a file called invoice.pdf.

The Save part of a rule: What to save, Save folder, File name with fields, and Only files of these types
The Save part: what is saved, where, and how the files are named.

Fields to find: values from the email

A rule can also read values, such as an invoice number, and use them in folder names, file names and steps. For values you read from many similar emails, the Parser (PRO Parser and up) is the better way: highlight the value in a sample, or describe it in plain words. A parser is saved as a PRO rule, so you can add your own steps after it.

Then: steps after saving

Steps run after the file is saved, in order. Click Add a step…, find the step and click Add.

Say Acme sends Word documents and you want PDFs. Add the Convert documents step, click Add… and choose the conversion. Tick Delete the originals after converting them if you only want the PDFs.

The Convert documents step in the Then part of a rule, with the Add, Edit and Remove buttons
A Convert documents step under “Then”.

Other steps move or delete the email on the server, upload to the cloud, add a spreadsheet row and much more. Some steps need PRO Rules Server: PRO Rules Client converts to PDF only, and sending email, unzipping, databases and scripts are Server steps. See chained rules and actions.

Test and save the rule

Click Test this rule… to try it on emails you pick. Nothing is changed: files go to a temporary folder, and steps such as moving, deleting or sending are not done. Then click Save. That’s your first rule.

Make as many rules as you need, each with its own conditions, folders and steps. Before the first real run, use Rule settings › Test all rules… to see which rule saves each file, and Check rule order… to find rules that never save anything because a rule above them takes their files.

Points to remember

  • Rules run for each attachment, and for the email itself when a rule saves it.
  • A rule without an Account condition runs for every account.
  • Rules run from the top down. The first rule that matches a file saves it, and the rules below don’t see that file.
  • Steps under Then run after a file is saved. Steps under If something fails run when a step above fails.
  • Using the service? After changing a rule, click Reinstall… on Schedule › Service schedule.
  • Don’t want to build a rule by hand? Describe it to the AI Assistant and it writes the rule for you to check.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

Questions or suggestions about this post? Contact us.