Create email rules with AI: describe what you want, test it, save it

Create email rules with AI: say in plain words which emails to save and what to do, and Mail Attachment Downloader writes the rule for you to test.

To create email rules with AI, open the AI Assistant tab in Mail Attachment Downloader and say in plain words which emails to pick and what to do with them. The AI writes the PRO rule, with its conditions, save folder and steps, and shows it as a tree you can read. You test it on your own emails and save it.

The examples use Contoso’s mailbox finance@contoso.com and invoices from Acme and Fabrikam.

What can the AI Assistant write?

Everything a rule in the Rule Editor has:

  • Which emails: the sender, words in the subject or body, attachment names, dates, the account or mailbox folder.
  • Save: the attachments, the email, or both, and the folder, such as D:\Finance\Invoices.
  • Then: the steps after saving, in order: convert to PDF, upload to SharePoint, send a notification to Slack or Teams, move the email to a folder, and more.
  • If something fails: what to do when a step goes wrong.

Some things people ask for:

  • “Save the PDF invoices from acme.example into D:\Finance\Invoices and tell the finance team on Slack.”
  • “Put statements from Fabrikam in a folder for each year and month, and move the email to Processed.”
  • “Upload signed contracts to the Finance SharePoint, only from the last 3 months.”

What you need

  • The edition: anyone can try the AI Assistant, with the free edition too. There, Apply to my filters… puts what Free can do into the account’s own settings. To save the result as a PRO rule you need PRO Rules Client or PRO Rules Server. The preview marks a step that needs more, such as “Needs PRO Server”.
  • An AI: the built-in AI model (a one-time download of about 2 GB), your own AI server, or a cloud AI with your own account. More on that below.
  • An email account: Gmail, Microsoft 365, Exchange or any IMAP mailbox, so the rule can be tested on real emails.

How to create an email rule with AI

1. Set up the AI once

Click the AI Assistant (beta) tab, the first tab under the Account box. Click Download to get the built-in model, or Use my own AI… for your own server or a cloud AI. The line at the top says which AI answers, such as “AI: Built-in AI model, on this computer”.

2. Describe the rule

Type what you want under Your message and click Send. Write it the way you would tell a colleague. If the AI needs something only you know, such as who to notify or which mailbox folder, it asks, with the channels and folders you have set up as buttons to pick from.

3. Check the rule it wrote

The rule appears on the right as a tree: Which emails, Fields to find, Save, Then and If something fails, the same outline the Rule Editor shows. The AI also says in one sentence what the rule does. Prefer words? Show as text.

Create email rules with AI in the AI Assistant tab of Mail Attachment Downloader: the request to save the PDF invoices from acme.example into D:\Finance\Invoices and tell the finance team on Slack, and the rule Supplier invoices with From acme.example, Attachment name pdf, Save the attachments, Then Convert documents and Send notification
One sentence in, one rule out: conditions, save folder and steps, ready to test.

Not quite right? Say what to change: “only the last 3 months”, “also save the email”. Each change is a new version, and the arrows next to the version go back to an earlier one.

4. Test it on your emails

Click Test it…. The rule runs on emails you pick, without saving or changing anything. Under Test results you see which emails it matched. Where a result is wrong, change the tick in Should match and click Fix from my ticks: the AI changes the rule so it picks the right ones.

Mail Attachment Downloader's AI Assistant with the built-in AI on this computer: the request to save supplier PDF invoices to \\fileserver\Finance\Invoices and mark them read, the rule it wrote, and Test results: 4 of 5 emails match, with Should match ticks and Fix from my ticks
Test it shows which emails the rule picks; tick the ones it should, and Fix from my ticks asks the AI to correct the rule.

5. Save the rule

Click Open in Rule Editor (advanced), check the rule’s name and click Save. It is now on the PRO Rules tab and runs with each download. Later changes in the AI Assistant go over it with Save changes (you see what changes first), or into a copy with Save as a new rule….

If the rule changes emails on the mail server, such as moving or deleting them, the AI Assistant asks you to review it in the Rule Editor before it is saved.

Change a saved rule with AI

A saved rule can be changed in words too. In the Rule Editor, click Edit using AI. The AI pane opens beside the rule: describe the change, such as “Also save the invoices from Fabrikam”, and the AI makes it. What it changed is highlighted in the rule and listed under the conversation, and Undo puts the rule back as it was.

Edit using AI in the Rule Editor of Mail Attachment Downloader: the AI pane beside the rule Supplier invoices, the request Also save the invoices from Fabrikam, the new condition From fabrikam.example highlighted, and the Undo button
Edit using AI: the AI adds the condition, highlights it, and Undo takes it back.

Other ways in: on the PRO Rules tab, pick a rule and choose Edit using AI (or tick Always edit using AI); the arrow next to New rule… has Create using AI…; and the AI Assistant tab’s Open a rule carries on the conversation about a rule where it was.

AI email automation inside your rules

The AI can also do work in the rule itself, as a step. Find fields with AI reads values such as the invoice number, due date and total out of each saved file, for the steps after it (PRO Rules Client). Run an AI prompt runs your own prompt on each email and saves the answer (PRO Rules Server). See extract data from emails and attachments.

AI email automation in a PRO rule: the Rule Editor with the rule Scanned invoices, Make PDFs searchable (OCR), then Find fields with AI reading INVOICE_NUMBER, DUE_DATE and TOTAL_INCLUDING_TAX with the built-in AI model, then Save to a database, Web hook, Upload to cloud and Send notification
A rule with an AI step: the fields it finds go to a database, a web hook and SharePoint.

Built-in AI or your own provider?

You choose which AI writes your rules, in the AI Assistant tab’s AI settings…:

  • The built-in AI model: runs on your own system with limited rights, after a one-time download. Nothing you type or test is sent anywhere, and it costs nothing.
  • Your own AI server: Ollama, LM Studio or another OpenAI-style server, on your network or elsewhere.
  • A cloud AI service with your own account: OpenAI, Anthropic Claude, Google Gemini or Microsoft Azure OpenAI, with your own key. You pay the service for what you use.

Keys are kept encrypted on your system, one for each provider. They are also in Settings › Sources › AI Providers, where Test provider checks a key and Make this the default AI picks the AI the rules’ AI steps use.

Use your own AI provider for email automation: the AI provider OpenAI window in Mail Attachment Downloader with a Key box, An API key from the OpenAI platform, not a ChatGPT subscription, the Default model, Make this the default AI and Test provider
Your own OpenAI key: the window says where the text goes and whose terms apply.

Cloud AI is never used without asking

Nothing goes to a cloud service until you pick it and say yes to a question that names the service and says what is sent. It asks again if you change the service or its address, and the built-in model is always the way back. What goes:

  • Always: what you type, and the names the AI needs to write the rule: your accounts’ addresses, mailbox folder names, cloud connection and notification channel names.
  • Only if you allow it: the senders, subjects and attachment names of recent emails (Also send the senders, subjects and attachment names of recent emails, off for cloud services), and of the emails you test the rule on.
  • Never: the text of your emails or the files.

Questions people ask

Can I automate email with ChatGPT?

Yes, through OpenAI, the company behind ChatGPT. Pick OpenAI and enter an API key from the OpenAI platform (platform.openai.com). A ChatGPT subscription doesn’t include one. The same goes for Claude: an API key from the Anthropic Console.

Does the AI read my emails?

Not their text. The built-in model runs on your own system, so nothing leaves it. With a cloud AI, only what’s listed above goes, and only after you say yes.

What if the AI gets the rule wrong?

Nothing runs until you save it. Test it first, fix it with your ticks or a sentence, or go back a version. You can also open it in the Rule Editor and change it by hand.

Do I have to use the AI to make rules?

No. Every rule can be made and changed in the Rule Editor without AI. The AI Assistant is a faster way to start.

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 about this post? Contact us.

Detect spoofed invoice emails with SPF, DKIM, DMARC and look-alike domain checks

Detect spoofed invoice emails automatically: check SPF, DKIM and DMARC results and look-alike domains, save invoices that pass and flag the rest.

To detect spoofed invoice emails automatically, check who really sent each one before its invoice is saved. Mail Attachment Downloader’s Email security condition reads the SPF, DKIM and DMARC results your mail server wrote into the email, and spots look-alike domains such as acrne.example for acme.example. A rule then saves only the invoices that pass, and sends the rest to a review folder with a notification.

Fake invoices and “our bank details have changed” emails are a common way to steal money from a business. They look like they come from a supplier you know. This post shows how to stop them from slipping into your invoice folder, spreadsheet or accounting system unseen. The examples use Contoso’s mailbox finance@contoso.com and invoices from Acme, Northwind and Fabrikam.

What does the Email security condition check?

You turn on the checks you want. An email passes when it passes all of them:

  • Authenticated: the SPF, DKIM and DMARC results. Choose SPF, DKIM or DMARC passes, or one of them alone: DMARC passes, DKIM passes or SPF passes.
  • Display name: Must not show a different address than the real sender. This catches “billing@acme.example” written in the name of an email that really comes from somewhere else.
  • Reply-To: Must be on the same domain as the sender. A reply to a fake invoice shouldn’t go to a stranger’s mailbox.
  • Look-alikes: the domains you trust, separated by commas. A sender whose domain looks like one of them does not pass: letters swapped, dropped or added, “rn” for “m”, or a zero for an “o”.

The program doesn’t redo the mail server’s checks: it reads the results the receiving server wrote into the email’s headers. A pass shows the sending domain is genuine, not that the email is safe.

Mail Attachment Downloader's Email security condition on the rule Supplier invoices: Authenticated DMARC passes, the display name must not show a different address, Reply-To on the sender's domain, and the trusted domains acme.example, northwind.example and fabrikam.example for the look-alike check
The Email security condition: DMARC, display name, Reply-To and look-alike domains in one place.

Which result should you ask for: DMARC, DKIM or SPF?

DMARC passes is the strictest. DMARC ties the check to the domain in the From address you see, which is the one a fraudster fakes. Ask for it when your suppliers’ domains publish a DMARC policy.

SPF, DKIM or DMARC passes is the default and the safer start: a supplier without DMARC still passes when SPF or DKIM does. Add Look-alikes to it, because a fraudster can make SPF and DKIM pass for a look-alike domain they own.

What you need

  • PRO Rules Client for the Email security condition and moving emails on the mail server.
  • PRO Rules Server for the Send notification step and running as a Windows service.
  • Windows: Windows 10 or later, 64-bit, on a PC, a server or a cloud VM.

Step 1: Save invoices only from senders that pass

  1. On the PRO Rules tab, click New rule… and name it “Supplier invoices”.
  2. Under Which emails, click Add a condition and add the invoices: “invoice” in the subject, or the account finance@contoso.com.
  3. Click Add a condition again and choose Email security. Set Authenticated, tick Display name and Reply-To, and type your suppliers’ domains in Look-alikes: acme.example, northwind.example, fabrikam.example.
  4. Leave Picks on Emails that pass the checks.
  5. Under Save, save the attachments to \\fileserver\Finance\Invoices.
The Rule Editor's Which emails section with the Add a condition button and conditions such as Mailbox folder, Received on or after, Received before, Account and an Any of these group of From and Subject
Which emails: add the Email security condition with Add a condition, beside the rule’s other conditions.

No result decides what happens to an email whose headers have no SPF, DKIM or DMARC result. Some accounts, such as POP3 accounts, don’t add any. For invoices keep Count the email as not passed, so an unchecked email goes to review instead of straight through. Tick Subdomains must match too if a Reply-To on another subdomain of the sender’s domain should fail as well.

Step 2: Send failures to a review folder and a notification

Make a second rule, “Suspicious invoices”, with the same conditions, but set Picks to Emails that do not pass the checks. The two rules never pick the same email.

  1. Under Save, choose The email only and a folder such as D:\Finance\Review, so the reviewer has a copy.
  2. Under Then, click Add a step…, open Email and add Move or copy the email. Pick the Account and a Folder such as “Invoice review”. The email leaves the inbox, so nobody pays it by mistake.
  3. Add Send notification from Notify, and pick a channel: Microsoft Teams, Slack, email or another one set up under Settings › Sources › Notification Channels. Put {FROM} and {SUBJECT} in the message so the team sees which email it is.
The Move or copy the email step in the Rule Editor: account ap@contoso.example, folder Processed invoices, Leave a copy in the original folder ticked, Run Once per email, and List the folders
Move or copy the email moves an email to another folder of its mailbox. For a review folder, untick Leave a copy.
The Add a step window with Notify chosen: Send notification, which tells you in Teams, in Slack, by email or through a web hook
Add a step › Notify › Send notification tells the team about a suspicious invoice email.

Test the checks before you trust them

Click Test this rule… and Run test. The rule runs on your recent emails without changing anything, and each email that fails says why, such as Skipped: not authenticated or Skipped: look-alike domain.

Have a suspicious email saved as a file? Test an email file… tries the rule’s Email security conditions on an .eml or .msg file, with no mailbox, and shows each check as passed or not. Use the email file as it was received: an email forwarded as an attachment has usually lost its authentication results.

The Test rule window: accounts and folders of ap@contoso.com, a list of tested emails from Acme Billing, Northwind Traders and Fabrikam Purchasing with their results, the reasons for the selected email, and the buttons Run test, Open in trace viewer and Test an email file
Test this rule shows what the rule would pick and why. Test an email file… tries the Email security checks on a saved email.
Test rule Supplier invoices: three invoices Matched, one from billing@acrne.example Skipped: look-alike domain, one Skipped: not authenticated, and the trace showing acrne.example resembles acme.example
Test the rule first: the look-alike sender acrne.example is skipped, and the trace says why.

Once the rules run, tick Rule tracing under the PRO Rules tab’s Diagnostics to record each check of each email.

More invoice fraud protection: checks on the invoice itself

A genuine supplier’s mailbox can be broken into, and then its emails pass every sender check. So check the invoice too. With the Parser (PRO Parser and up), reading invoices from email, add these on its Checks step:

  • Duplicates: tick The same, pick the invoice number and the supplier, and choose Skip it and note it or send it to review. The same invoice sent twice isn’t paid twice.
  • Bank details you don’t know: give the IBAN field the check In a list, with the IBANs your suppliers gave you, written as the invoices show them, and Send to review under If it fails. An invoice asking you to pay a new account waits for a person.
  • Unusual amounts: give the total a range with Between.

An invoice that fails waits in Needs you, and nothing is written, sent or moved for it until someone approves it. E-invoices (Factur-X, ZUGFeRD, XRechnung) carry the IBAN in their own data; for PDFs, build an IBAN field by highlighting it on a sample.

The Parser's Checks step for supplier invoices: a Between 0.01 and 100000 check on the total that sends it to review, the sum checks, a duplicate check on invoice_number + supplier set to Skip it and note it, and the review queue settings, with 3 samples passing
Parser checks against invoice fraud: a range for the total and the duplicate-invoice check. An IBAN field takes the In a list check the same way.

For suppliers that bill on a schedule, Expected emails (PRO Rules Client and up) also tells you when an invoice that should have come hasn’t.

What it doesn’t do

  • It isn’t a spam filter or a virus scanner. It decides what your rules save and where, by who really sent the email.
  • It reads the authentication results your mail server added; it doesn’t look up SPF or DMARC records itself.
  • It doesn’t replace a call to the supplier. When an email asks you to change bank details, confirm on a phone number you already have.

Questions people ask

How do I check the DMARC result of an incoming email?

Your mail server writes it into the email’s Authentication-Results header as dmarc=pass or dmarc=fail. The Email security condition reads that header for you, and Test an email file… shows it for a single saved email.

What is a look-alike domain?

A domain made to be mistaken for a real one, such as acrne.example for acme.example, or acme.co for acme.example. Fraudsters register them so that SPF and DKIM pass. The Look-alikes check compares the sender’s domain with the domains you trust.

Can a spoofed invoice pass SPF, DKIM and DMARC?

Yes, when it is sent from the supplier’s own hacked mailbox, or from a look-alike domain the fraudster owns. That’s why the look-alike check and the Parser’s checks on the invoice belong next to the authentication check.

What if my emails have no authentication results?

Then No result decides. Count them as not passed to send them to review, or as passed and rely on the display name, Reply-To and look-alike checks.

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 about this post? Contact us.

Alert if email not received: know when an expected email doesn’t arrive

Alert if email not received on time: Mail Attachment Downloader learns when invoices, statements and reports arrive and tells Slack, Teams or email.

A missing email is easy to miss: nothing arrives, so nothing tells you. Mail Attachment Downloader can. Turn on Expected emails for a rule, and it learns when that rule’s emails normally arrive, shows any that are late, and sends an alert to Slack, Microsoft Teams or email when one is not received.

The examples use Contoso’s mailbox finance@contoso.com, invoices from Acme and Northwind, and the channels Finance team (Slack) and Operations (Teams).

Which missing emails are worth an alert?

Any email you count on that comes on a rhythm:

  • Supplier invoices: Acme bills between the 1st and the 3rd of each month. A missing invoice means a late payment or a missed discount.
  • Bank statements: on the first business day of the month, for the month-end close.
  • Daily reports: the sales report that a system emails every weekday at 7:00.
  • Backups that email a log: a server backup that sends “Backup completed” each night. If the email doesn’t come, the backup may not have run.
  • Orders and files from partners: a weekly order list or price file from Northwind.

What you need

  • The edition: Expected emails is part of PRO Rules (PRO Rules Client, PRO Rules Server).
  • A rule for the emails: the rule that picks them, such as invoices from acme.example. Most people already have one that saves the attachments.
  • History on for the account: how often the emails arrive is read from History, so the rule needs some emails behind it to learn from.

How to get an alert if an email is not received

1. Open the rule

On the PRO Rules tab, pick the rule, such as “Supplier invoices”, and click Edit. New to rules? Save emails and attachments to folders walks through a first one.

2. Turn on Check for missing emails

In the Rule Editor, click Expected emails and tick Check for missing emails. The rule shows what it learned, for example “Monthly, days 1 to 3, about 9:00 AM. Learned from 11 emails.”

  • Split by: Sender, Sender’s domain, Folder or a field. One rule for all supplier invoices then tracks Acme and Northwind each on their own, since they send at different times.
  • Late after (minutes): how long after its usual time an email may come before it counts as late, such as 30.

Click Save. Nothing is done for emails that were due before you turned it on.

Expected emails in the Rule Editor of Mail Attachment Downloader for the rule Supplier invoices: Check for missing emails ticked, Monthly, days 1 to 3, about 9:00 AM learned from 11 emails, Split by Sender, Late after 30 minutes, and If an email is missing with 3 steps
Expected emails: the rule learned that Acme’s invoices come on days 1 to 3 of the month.

3. Choose what happens if an email is missing

Click If an email is missing. A missing email is always shown in the Downloads tab. Up to three steps can do more, each a number of minutes after the email is late (Minutes after it is late; 0 runs it at once):

  • Send a notification: a message to a channel, such as Finance team (Slack), Operations (Teams) or a mailbox.
  • Call a web address: tells another system, such as your ticket system, or a script that waits for web calls.
  • Email the sender: asks the sender to send it, from the rule’s mail account. Draft the email with AI writes the subject and message for you to read and change.

A typical set: notify Slack as soon as Acme’s invoice is late, email Acme a day later, and tell Teams if it still hasn’t come. A title or message can use {RULE}, {SENDER}, {DUE} and {LAST}; left empty, the step says the plain facts.

The program doesn’t nag. A sender whose emails have stopped is acted on for three emails in a row, an email to the same sender goes at most once every few days, and never while a rule is still learning.

Mail Attachment Downloader's Rule Editor on If an email is missing for the rule Supplier invoices: first a notification to the Finance team channel at once, then an email to the sender after 1440 minutes asking for the invoice, then a notification to Operations after 2880 minutes
If an email is missing: up to three steps, each a number of minutes after the email is late.

How does it know when an email is late?

It learns from the emails the rule has already handled: which days and about what time they come. Until it has seen enough, the rule shows Learning. Under More options you can also say it yourself:

  • How often: Use what was learned, Every day, Weekdays, Every week, Monthly, on days of the month, Monthly, on a business day from the start or Monthly, on the last business day, with a Usual time (hh:mm).
  • Holiday calendar: days the sender’s country keeps aren’t expected (United States, United Kingdom, Canada, Germany or Australia).
  • Days not expected: a supplier’s summer closing, for example.
  • Pause until: nothing is expected before a date.
  • Suggest with AI: describe the rhythm in words, such as “Invoices arrive on the second business day of the month”, and the AI suggests the pattern.

The defaults for every rule, such as when an email counts as late and how often senders may be emailed, are on the Schedule tab › Expected items.

Where you see a missing email

At the top of the Downloads tab, a notice says how many expected emails are missing and from which rules. Click See them for the list: the rule, who it was Expected from, when it was due, when the last one came, and what was done so far. For each one you can:

  • Search the mailbox now: runs the account at once, in case the email came late.
  • Received elsewhere: it came another way, such as by post. Nothing more is done.
  • Not expected that day: that day becomes a day off for the rule.
  • Stop expecting: a supplier you no longer use.
Missing email notification in the Downloads tab of Mail Attachment Downloader: 3 expected emails are missing, from the rules Supplier invoices (2) and Weekly sales report (1), with a See them link
The Downloads tab shows missing emails, rule by rule.

On the PRO Rules tab, the Expected column shows Late or Missing next to the rule.

The Missing list in the Downloads tab: three expected emails missing, from Acme Billing and Northwind Traders for the rule Supplier invoices and the Weekly sales report, with what was done so far and the buttons Search the mailbox now, Received elsewhere, Not expected that day, Stop expecting and Open the rule
The Downloads tab lists each missing email, what was done about it, and what you can do next.

Set up Slack, Teams or email notifications

Channels are set up once and shared by missing-email alerts, run summaries and error alerts. Open Settings › Run summary and click Configure Channels…. The Notifications window takes nine kinds: Slack, Microsoft Teams, Discord, Google Chat, Telegram, ntfy, Pushover, a custom webhook and email. Give each a name, paste its webhook address or fill in its details, and click Send test message.

The Notifications window of Mail Attachment Downloader with nine notification channels for missing email alerts: Finance team (Slack), Operations (Teams), Telegram, Discord, Google Chat, ntfy, Pushover, a custom webhook and Finance mailbox (email), with Send test message
Notification channels: set up once, used for alerts and run summaries.

Expected emails tells you what didn’t come. A Run summary tells you what did: after each download, how many emails and files were saved and what went wrong, sent always, or only when there were problems. Together, you hear about both. See Run summaries.

Run summary settings: send a summary when a run ends Always, to Finance team (Slack) and Operations (Teams) as Short and Finance mailbox (email) as Detailed, for 2 of 3 accounts
Run summaries: a short report to Slack or Teams after each download.

Missing files, too

A rule of a watch works the same way with Check for missing files. If the backup writes its log to a folder or a network share instead of emailing it, watch that folder and be told when tonight’s file doesn’t appear.

Questions people ask

Can I get an alert if an email is not received by a certain time?

Yes. Set a Usual time (hh:mm) and Late after (minutes). With a usual time of 07:00, Late after 30 and a notification at 0 minutes, you hear about it at about 7:30.

Does it work with Gmail and Microsoft 365?

Yes. It works with the accounts the program downloads from with History on: Gmail and Google Workspace, Microsoft 365 and Outlook.com, Exchange, and other IMAP mailboxes.

Does the program have to be running?

The checks are made by Mail Attachment Downloader, so keep it running. To check around the clock, even when nobody is signed in, install the Windows service of PRO Rules Server.

What if the sender changes the day?

With Use what was learned, the rule keeps learning from new emails. Or set the day yourself under How often.

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 about this post? Contact us.

Customizing file names or email data using fields

Build folder and file names from email fields such as {FILENAME}, {ID}, the sender and the date, with date formats and examples.

Mail Attachment Downloader names the files it saves from fields: short names in curly braces, such as {SUBJECT} or {DATE[yyyy-MM-dd]}, that are filled in from each email. This post lists the fields of version 4.0, shows how to change their output, and gives a few examples.

Where you can use fields

  • A rule’s folder and file name (PRO Rules Client and PRO Rules Server): the Save folder and File name boxes of the rule’s Save part, in the Rule Editor.
  • The text of a rule’s steps: for example the file and columns of Save metadata, the subject and text of Send an email, or the file name of Merge PDFs.
  • The Parser’s output (PRO Parser and up): its folder and file name can use the values the Parser reads, such as {SUPPLIER}\{INVOICE_NUMBER}_{FILENAME}{EXT}. See folders and file names.

The Free edition and PRO Backup name files with tick boxes instead: on the Account rule tab, the Folders and file names page has Saved file name with Filename, From, Subject, Date and ID, to make each name unique.

How to open the field list

Click the Fields… button next to a box. The Fields window lists each field, what it holds, and its value for a sample email. Type in the search box (for example “date” or “sender”) to find a field, then click Insert to put it where the cursor is. Fields: help explains more.

The Fields window open under a rule's File name box: a search box, the columns Field, Holds and For a sample email, {EMAIL_FROM} selected and the Insert button
Fields…: every field the box can use, with its value for a sample email.

The list only offers the fields that make sense in that box. A rule’s File name can’t use the saved file’s own fields, such as {SAVE_PATH}, because the file isn’t saved yet.

The default file name: {FILENAME}_{ID}{EXT}

A new rule starts with this file name:

{FILENAME}_{ID}{EXT}

  • {FILENAME}: the file’s name, without its extension.
  • {ID}: the message’s ID with the part number, so each file’s name is different.
  • {EXT}: the file’s extension, with the dot, such as .pdf.

So invoice.pdf is saved as something like invoice_00000_1.2.pdf. Keep {ID} in your file names: two emails often send files with the same name (invoice.pdf, scan.pdf), and {ID} keeps them apart. Use {FILENAMEEXT} for the name with its extension, but not together with {FILENAME} and {EXT}, or part of the name comes twice.

The Save part of a rule with the default file name {FILENAME}_{ID}{EXT} and an example of the saved file's path below it
A new rule’s file name, with an example of the result below the box.

The fields

The email

  • {FROM}, {TO}, {CC}: who sent it, who it was sent to and copied to, with the names.
  • {EMAIL_FROM}, {EMAIL_TO}, {EMAIL_CC}: the addresses only (several are separated by commas).
  • {SUBJECT}: the subject.
  • {IMPORTANCE}: HIGH, NORMAL or LOW.
  • {EMAIL_HEADER[...]}: any header of the email (more below).
  • {MESSAGE_ID}: the message’s ID, without the part number.
  • {ATTACHMENT_COUNT}: how many attachments the email has.

Dates

  • {DATE}, {DATE_LOCAL}, {DATE_UTC}: the email’s date as the email has it, in this computer’s time, or in UTC.
  • {PROCESSED_DATE[...]}, {PROCESSED_DATE_LOCAL[...]}, {PROCESSED_DATE_UTC[...]}: when the email was processed.

The file

  • {FILENAME}, {EXT}, {FILENAMEEXT}: the file’s name, its extension, and both.
  • {ID}: the message’s ID with the part number. {IDS} is the same, but filled even when {ID} is already in the name (then {ID} is empty).
  • {PART_NUM}: the part number of the attachment or the body.

The account and folder

  • {ACCOUNT_EMAIL}: the account it was downloaded from.
  • {MAILBOX_FOLDER}: the mailbox folder’s full path. {MAILBOX_SUB_FOLDER}: the folder’s own name, without its path.
  • {ACCOUNT_FOLDER}, {ACCOUNT_MAILBOX}: the folder’s path in the account, and the mailbox (a shared mailbox or group for Exchange).

Only in steps

  • {SAVE_PATH}, {SAVE_FILE}: the folder the file was saved in, and its full path and name.
  • {OFILENAME}, {OEXT}, {OFILENAMEEXT}: the attachment’s name as it was sent.
  • {CLOUD_URL}, {CLOUD_PATH}, {CLOUD_FILENAME}: for the steps under Upload to cloud: where the file went.
  • {EMAIL_BODY}, {EMAIL_BODY_HTML}, {EMAIL_BODY_SOURCE}: the email’s text or HTML, in boxes such as an email’s text, a web hook or an AI prompt.
  • {ERROR_MESSAGE}: the error, in the steps under If something fails.

Your own fields

Values a rule finds under Fields to find, or the Parser reads, become fields too, such as {INVOICE_NUMBER} or {ORDER_ID}. They show at the end of the field list. See extract data from emails and attachments.

Customizing a field’s output

Most fields are simply filled in. A few take a setting in square brackets.

Date formats: DATE, DATE_LOCAL, DATE_UTC and PROCESSED_DATE

Put a format in square brackets. For example {DATE[yyyy-MM-dd]} gives 2026-04-23: the date only, without hours, minutes and seconds. {DATE_LOCAL[yyyy-MM]} gives the year and month in this computer’s time. The formats are .NET’s custom date and time formats.

For a folder for each year with a folder for each month inside, put two date fields with a \ between them: {DATE_LOCAL[yyyy]}\{DATE_LOCAL[MM]} gives 2026\04. A \ inside the square brackets doesn’t make folders.

{DATE} without a format is the date as the email has it, with commas, colons and the time zone. In names, prefer a format.

EMAIL_HEADER[…]

Put the header’s name in the square brackets: {EMAIL_HEADER[message-id]}, or a header your supplier adds, such as {EMAIL_HEADER[X-Invoice-Number]}.

ATTACHMENT_COUNT[‘.pdf’ OR ‘.xml’]

Counts only the attachments whose names match, such as {ATTACHMENT_COUNT['.pdf' OR '.xml']}. Add the extensions or names you need. To pick emails by the number of attachments, use a condition instead: More attachments than or Fewer attachments than, with Counting only files named:. Conditions don’t fill in fields: they match the text as you type it.

What a name can’t hold

In folder and file names, a field’s value is cleaned up to make a valid name: \ and : become _, / becomes -, and " ? * | # are left out. Only a \ you type makes folders, and so do the folder fields: {SAVE_PATH}, {SAVE_FILE}, {MAILBOX_FOLDER}, {ACCOUNT_FOLDER} and {ACCOUNT_MAILBOX}.

Everywhere else (a database, a CSV file, an email, a web hook or an AI prompt) fields are filled in exactly as the email has them.

Examples

Example 1: a daily log of all files saved

Want a CSV file each day that lists the files saved and the emails they came from? Add a Save metadata step under Then (PRO Rules Client and up):

  • File: \\fileserver\Finance\Logs\{PROCESSED_DATE_LOCAL[yyyy-MM-dd]}.csv. The date has the day only, so every file saved that day goes into the same CSV.
  • Columns: for example {FILENAMEEXT},{EMAIL_FROM},{SUBJECT},{DATE[yyyy-MM-dd]}.
  • Tick Add to the file when it is there (otherwise replace it).

The next day starts a new file. Put the same step in each rule whose files you want in the log.

A Save metadata step in the Rule Editor with a File box, Columns built from fields, and Add to the file when it is there ticked
The Save metadata step: a file name and columns built from fields. Put a date in the file name to start a new log each day.

Example 2: a folder for each month, files named by sender

  • Save folder: \\fileserver\Finance\Invoices\{DATE_LOCAL[yyyy]}\{DATE_LOCAL[MM]}
  • File name: {EMAIL_FROM}_{FILENAME}_{ID}{EXT}

An invoice from ap@acme.example received in April 2026 is saved in \\fileserver\Finance\Invoices\2026\04, with the sender’s address at the start of its name.

Example 3: merge an email’s PDFs into one

The Merge PDFs step (PRO Rules Server) joins an email’s saved PDF files into one, with a File name built from fields, such as {SAVE_PATH}\{DATE[yyyy-MM-dd]}_{SUBJECT}_{ID}.pdf: one PDF for each email, in the folder its files were saved in. Start the name with {SAVE_PATH}\, so the PDF goes there. Emails of the same download that get the same name are joined into one file. A merged file from an earlier download is replaced, not added to, so processing the same emails again gives the same PDF.

The Rule Editor with a Merge PDFs step that joins the email's saved PDF files into one, named from the date, the subject and the ID
A Merge PDFs step, with a file name built from fields.

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

Using version 3.x? See the 3.x version of this guide.

Questions or suggestions about this post? Contact us.

Nesting email rules and actions: shared filters, negative rules and steps inside steps

Chain rules under a shared filter, catch unsaved emails with a negative rule, share steps between rules and nest steps inside steps.

This post shows how to nest rules and steps in PRO Rules, the rules of PRO Rules Client and PRO Rules Server. It is written for version 4.0.

You don’t need nesting for most jobs. One rule with its conditions, its save folder and a few steps does the work. Nesting helps in advanced cases, such as:

  • When no rule saved anything from an email, do something else with it, such as moving it to a folder you check by hand.
  • When the attachments of one email each need different handling.
  • When many rules share the same conditions or the same steps, and you don’t want to type them again in each rule.
  • When a step should work on the result of another step: the files of a zip, or a converted PDF.

New to PRO Rules? Read save emails and attachments to folders first. It walks through a whole rule. In version 3.x the PRO Rules tab was called Global filters.

Nesting rules: the four rule types

Each entry in the PRO Rules tab has a Rule type. You pick it with the arrow next to New rule…, or later with Rule type: in the rule’s Save part.

  • Global rule: the usual rule. It saves what matches its conditions, then runs its steps.
  • Shared filter: only conditions. It saves nothing and runs no steps of its own. Other rules use its conditions, and they show under it in the list.
  • Negative rule: steps for the emails nothing saved. It saves nothing: its steps run for the emails no rule saved anything from.
  • Shared action: steps that other rules run. It saves nothing, and its steps run when another rule runs it.

Shared actions are always listed first. The rules and shared filters below them run in the order of the list, and the rules under a shared filter run right after it.

The PRO Rules tab with a shared action at the top, a Supplier invoices shared filter with two rules under it numbered 1.1 and 1.2, and three more rules
A shared action (S1), listed first, and a shared filter (1) with two rules under it (1.1 and 1.2).

Example: one shared filter, three rules and a shared action

Say Acme, Northwind and Fabrikam send emails with “Invoice ID” in the subject. You want to:

  • save their PDF attachments to \\fileserver\Finance\Invoices\PDF,
  • save their Word attachments to \\fileserver\Finance\Invoices\Word,
  • move an email with neither to an “Issues” folder of the mailbox,
  • and record the email’s details in a database for each saved file.

Turn PRO Rules on first: tick Use PRO Rules for every account at the top of the PRO Rules tab.

1. The shared filter

Click the arrow next to New rule… and pick Shared filter – filters only, no actions. Name it “Invoice ID emails”. Click Add a condition, choose Subject and type 'Invoice ID'. Click Save.

The shared filter decides which emails the rules under it see. It saves nothing by itself.

2. A rule under it for the PDFs

Open the shared filter’s menu (its + button, or right-click it) and choose Add a rule under this shared filter › Global rule – filters and actions. The new rule gets a Use a shared filter condition for “Invoice ID emails”, so it only runs for the emails that filter matches.

  • Name it “Invoice PDFs”.
  • Add an Attachment name condition with '.pdf', so only PDF files match.
  • In Save, pick The attachments and set the Save folder to \\fileserver\Finance\Invoices\PDF.
  • Under Then, click Add a step… and add Mark as read. You could add Move or copy the email instead.

3. A second rule for the Word files

Do the same again: Add a rule under this shared filter › Global rule – filters and actions. Name it “Invoice Word files”, use '.doc' (it also matches .docx) in the Attachment name condition, and save to \\fileserver\Finance\Invoices\Word.

The PRO Rules tab now shows the shared filter as 1, with the two rules under it as 1.1 and 1.2.

4. A negative rule as the catch-all

From the shared filter’s menu, choose Add a rule under this shared filter › Negative rule. Name it “Invoice ID emails with no files”. A negative rule saves nothing, so you only give it steps.

Under Then, add Move or copy the email and pick the “Issues” folder of the mailbox. Now an “Invoice ID” email from which no rule saved anything is moved there for you to look at.

5. A shared action for the database

Click the arrow next to New rule… and pick Shared action. Name it “Save email details to the database”. Under Then, add Save to a database and set it up. See save emails and attachments to a database; we won’t repeat that here. Save to a database needs PRO Rules Server. With PRO Rules Client, use a step such as Upload to cloud or Copy file in the shared action instead.

Now let the two rules run it. Select “Invoice PDFs” and “Invoice Word files” in the list, then choose Rule settings › Shared filters and actions › Add ‘Shared action’ to selected, and pick the shared action. Another way: open the shared action’s menu and use Make a rule run it.

Each rule now has a Run another rule step under Then. It runs the shared action’s steps there, for the same email and file. You can also add that step yourself with Add a step….

What you have

  • The shared filter picks the emails with “Invoice ID” in the subject.
  • Its two rules save the PDF and Word attachments to their own folders, mark the email as read, and run the shared action.
  • The shared action records the email’s details in the database for each saved file.
  • The negative rule moves an “Invoice ID” email to “Issues” when no rule saved anything from it.

Before the first real run, click Rule settings › Test all rules…. It runs the rules that are on, on emails you pick, and shows which rule saves each file. Nothing is changed: files go to a temporary folder, and moving, marking as read and other outside steps are only described.

The PRO Rules tab: shared action S1 Save email details to the database, shared filter 1 Invoice ID emails with the rules 1.1 Invoice PDFs, 1.2 Invoice Word files and the negative rule 1.3 under it, and the shared filter's menu at Add a rule under this shared filter
The example in the PRO Rules tab: a shared action, and a shared filter with three rules under it.

Nesting steps: steps inside steps

Steps under Then run in order, from the top. A step can also hold steps of its own. The steps inside it work on its result: the files of a zip, the PDF a conversion made, the fields an AI found.

Steps that can hold steps include Unzip, Convert documents, Make PDFs searchable (OCR), Find fields with AI, Copy file, Upload to cloud, Save to a database and Web hook.

To put a step inside another one:

  1. In the Rule Editor’s outline, select the step that should hold it, for example Unzip.
  2. Click Add a step….
  3. In the Add it: box, choose Inside “Unzip”. The other choices are after the selected step, At the end of Then and At the end of If something fails.
  4. Pick the step and click Add.

To move a step, drag its row: drop it between two rows, or on a group, If a field… or For files named… to put it inside. Move up (Alt+Up) and Move down (Alt+Down) work too.

The Rule Editor with Make PDFs searchable (OCR) under Then, Find fields with AI inside it, and Save to a database, Web hook, Upload to cloud and Send notification inside that, then Move or copy the email and an If something fails part
Steps inside steps: OCR, then fields found by AI, then four steps that use those fields.

In the picture, Make PDFs searchable (OCR) reads each scanned PDF. Find fields with AI, inside it, reads the searchable PDF and fills {INVOICE_NUMBER}, {DUE_DATE} and {TOTAL_INCLUDING_TAX}. The four steps inside that use those fields. Move or copy the email is back at the top level of Then, after the OCR step and everything inside it.

Another example: Unzip a zip of invoices, then Convert documents inside it to make a PDF of each file, then Save to a database and Run a command line inside that. See unzip, convert to PDF and run a script for that one, step by step. OCR, Unzip, databases, web hooks and command lines need PRO Rules Server.

Decide inside a rule

The Decide and repeat kind of steps in Add a step… lets part of a rule run only sometimes, while the rest goes on as usual:

  • If a field… runs the steps under it only when a field is empty, not empty, or matches. For example, upload only when an invoice number was found.
  • For files named… runs the steps under it for the saved files whose names match, such as only the PDFs.
  • Group of steps keeps steps together, in order.
  • Run another rule runs a shared action’s steps here.

When the files go to the same folder and only their steps differ, For files named… can replace a shared filter with two rules: one rule saves the attachments, then runs one set of steps for the PDFs and another for the Word files.

The Add a step window on the Decide and repeat kind: If a field..., For files named..., Group of steps and Run another rule
Add a step… › Decide and repeat.

If something fails

Below Then, each rule has If something fails. Its steps run when a step above fails. Use the {ERROR_MESSAGE} field to say what went wrong.

  • With PRO Rules Client: Move or copy the email, Delete the email or Mark as read.
  • With PRO Rules Server, also: Send an email, Send notification, the database steps, Run a script and Run a command line.

New in 4.0: a step that fails is tried again by itself, after a wait, and a failed step holds back the steps below it until it works. By default the steps under If something fails run once the program has given up on the step. Change that, and the number of tries, in Settings › Retries, or for one rule with the Retries… button in its Save part.

Points to remember

  • Rules run from the top of the list. The first rule that matches a file saves it, and the rules below it don’t see that file.
  • Shared filters, negative rules and shared actions save nothing. Only global rules save files.
  • Test with Test this rule… in the Rule Editor, or Test all rules…, before you rely on a rule.

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.

Why did my rule not download the attachment or email? Troubleshooting PRO Rules

Why a rule didn’t save an attachment or email, and how to find out: Downloads, History, Test this rule, Check rule order and rule tracing.

This post goes through the steps to find out why a rule didn’t download an attachment or an email, and how to fix it. It is written for version 4.0.

It covers PRO Rules, the rules of PRO Rules Client and PRO Rules Server. In version 3.x the PRO Rules tab was called Global filters. Using the Free edition, or a PRO edition without PRO Rules? Each account then has one rule, in the Account rule tab: see the how-to page.

New to PRO Rules? Read save emails and attachments to folders first: it walks through the parts of a rule. For rule order and the catch-all rule, see rule order, the catch-all rule, and turning rules on and off.

Version 4.0 has much better tools for this than 3.x had. Use them in this order.

1. Use the latest build

Many problems are already fixed. The build you have is shown at the top of the main window, next to the edition, for example “PRO Rules Server 4.0 · build 1080″. See get the latest build. Your settings and rules are kept when you update.

2. Look at the Downloads tab

After a run, open the Downloads tab. With Emails picked at the bottom, each email has a State that says what happened to it, such as how many files were saved. Click the arrow at the start of a row to see the email’s details: which rule saved each file, and, when nothing was saved, why. For example:

  • “Nothing saved: no rule took its attachment (the rules’ file types, sizes or filters leave it out)”.
  • “Nothing saved: its only file is an inline image (a picture inside the text), and no rule took it”.
  • “Nothing to save: this email has no attachments or inline images, only its text.”

Pick Files to see each saved file, its folder and the rule that saved it. The filters show one Rule, or Failures only. Runs shows one run at a time, and History all of them. If you use the Windows service, set View to The service to see its work.

An account that can’t run until you fix something, for example because its sign-in expired, is listed under Action required.

The Downloads tab after a run: Runs, This run, a list of invoice and purchase order emails with their State, Saved 1 file, and the Emails and Files buttons
The Downloads tab: each email and what was saved from it.

3. Was the email already processed?

New in 4.0: each account has a History. It remembers each email the account has seen, so nothing is downloaded or processed twice, even when you search All mail.

That matters when you fix a rule. The emails the account has already processed are not run through the changed rule by themselves. To run them again:

  • A few emails: pick them in the Downloads tab and choose Process again…, then The whole email, with the rules as they are now. The rules run again over the email’s stored copy. Files saved before are replaced, and nothing is moved, copied or deleted in the mailbox again.
  • Many emails: click History at the top of the main window and choose Redo…. It downloads or processes again the emails you choose, by dates, folder, rule or state.

A step that failed, such as an upload when the network was down, is tried again by itself after a wait. To try it now, pick the email and choose Try again now, or Process again… › Only the steps that failed. What already worked is not done twice.

4. Test the rule, without changing anything

This is the quickest way to see what a rule does with a given email:

  • In the Rule Editor, click Test this rule…. It runs the rule as you have it, unsaved changes included.
  • In the PRO Rules tab, click Rule settings › Test all rules…. It runs the rules that are on, in the list’s order, as a download does.

Choose the accounts and folders, choose which emails (for example Today’s emails or a date range), click Find items, tick the emails and click Run test. Nothing is changed: files go to a temporary folder, and moving, deleting, marking as read, sending and other outside steps are only described.

The Result column says what happened to each email. Test this rule says Matched, Not matched, Matched, nothing saved, or “Taken by” a rule above it, which saves the file first. Test all rules says which rule saves the files (“Saved by ‘Invoice PDFs'”), or No rule matched. Click an email to see which rule saves what, and which condition didn’t match. Open in trace viewer shows every condition. Have the email as a file? Test an email file… tries the rule on an .eml or .msg file.

Test rule 'All PDFs': five sample emails with the results Taken by 'Invoice PDFs', Matched and Not matched, and the details of invoice INV-2026-0423 below
Test this rule: the invoice is “Taken by” the rule above, so this rule never sees it.

5. Check the rule order

Rules run from the top of the list. Each file is saved by the first rule that matches it, so the rules below that one never see it. This is the most common reason a rule “does nothing”.

Click Rule settings › Check rule order…. It finds the rules that never save anything because a rule above them takes all their files, and offers to move them, for example Move “Northwind statements” above “All PDFs”. Or drag a rule up or down in the list.

The rule order check: Northwind statements never saves anything because All PDFs above it takes its files, with a button to move it above All PDFs
Check rule order: one click moves the rule that never gets a file.

6. Trace a real download

When a test looks right but a real download doesn’t, trace it:

  1. In the PRO Rules tab, open Diagnostics and tick Rule tracing.
  2. Click Connect and Download and let the run finish.
  3. Click Show the traces….
  4. Pick a download session: the time the run started.
  5. Untick “Use the tree view”. Select the email that should have saved something, then the file name in the email, then a rule.
  6. The Matched? column shows each of the rule’s conditions, by their inner names (EMAIL_FILENAME is the attachment name, EMAIL_FROM the sender). If one says No, that condition is why the rule didn’t save the file.

Tracing slows downloads, so untick it when you are done. The traces are kept in memory only, for the last 1000 emails, so read them before you close the program.

The Rule trace viewer: an Acme invoice email picked, its file INV-2026-0423.pdf and the rule Acme invoices, with the file name condition showing Matched? No
The trace shows the one condition that failed: the file name doesn’t contain “invoice”.

Common causes

Most rules that don’t download have one of these causes:

  • PRO Rules aren’t on. Tick Use PRO Rules for every account at the top of the PRO Rules tab. Until then each account’s Account rule decides.
  • The rule is off, or a draft. Check the Enabled column. A draft shows Draft: doesn’t run until you save it as a rule.
  • A rule above takes the file. See step 5.
  • The rule is for another account. An Account condition limits it to one account. A rule under a shared filter also needs that filter’s conditions to match.
  • The email is older than the search. On the PRO Rules tab’s Search scope page, Messages since last download skips older mail, and Only emails from and Only emails up to limit the dates for every account. For emails the account has already seen, use Redo… (step 3).
  • The email is in another folder. The Folders to search pane says which folders are searched, for example “Only the Inbox is searched.” Click Choose other folders…. POP3 accounts have no folders: switch the account to IMAP if your mail server has it.
  • The file is inline. Pictures and some files sit inside the email’s text. Turn on Inline content (slower): on the Search scope page, or in the account’s own settings.
  • The file is inside an attached email. Tick Look inside them too under Attachments that are emails on the Search scope page.
  • The file type is left out. Check Only files of these types in the rule’s Save part, and its Attachment name conditions.
  • The email has no attachment. To save the email itself, What to save must be The email and its attachments or The email only.
  • A field in a condition. Conditions match the text exactly as you type it. A field such as {DATE} in a condition is not filled in, so it never matches. The Rule Editor warns about this.
  • The email never arrived. Turn on Expected emails for the rule and tick Check for missing emails. The program learns when the emails normally arrive and shows Late or Missing when one doesn’t. Steps under If an email is missing can tell you.
The Rule Editor on Expected emails: Check for missing emails ticked, monthly on days 1 to 3 at about 9:00 AM learned from 11 emails, split by sender, late after 30 minutes
Expected emails: know when an email you count on doesn’t arrive.

Using the Windows service?

With PRO Rules Server, the service keeps the copy of your settings and rules it got when it was installed. If a download in the program works but the service doesn’t, you probably changed something since. Open Schedule › Service schedule: it shows Reinstall to apply changes. Click Reinstall…. See service and configuration changes.

To try a rule while the service is installed, use Test this rule… or Test all rules…: they change nothing.

Still stuck?

Open Settings › Logs and support, tick Verbose logging, make the problem happen again, then click Submit a bug report…. Passwords, keys and sign-in tokens are never included. See get help fast.

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.

Save emails and attachments to folders: PRO tips and tricks

PRO tips for saving emails and attachments to folders: how rules work, testing and tracing, multiple accounts, PDFs, databases and nested steps.

Saving emails and attachments to folders is easy with the PRO editions of Mail Attachment Downloader 4.0: PRO Backup, PRO Parser, PRO Rules Client and PRO Rules Server.

The PRO features page lists everything the program can do. This post picks out the tips people ask about most. Follow the links for the details.

PRO Rules and the parts of a rule

The key PRO idea is the rule. In 4.0, rules are in the PRO Rules tab (PRO Rules is the new name of 3.x’s Global filters). Tick Use PRO Rules for every account and the rules decide for all your accounts.

Rules run from the top down, for the email and for each attachment. When a rule takes one, it saves it, reads any values you asked for, then runs its steps. In the Rule Editor, each rule has these parts:

  • Which emails: the conditions that decide whether the rule runs.
  • Fields to find: values read from the email, cleaned up as needed.
  • Save: the attachments, the email or both, in a folder and file name that can use the values you read.
  • Then: the steps that run after saving, to automate the rest of the work.

More: PRO Rules overview and moving to PRO Rules, step by step.

Test and troubleshoot rules like a PRO

Rule not doing what you expected? Try these, in order:

  • Test this rule… in the Rule Editor, or Test all rules… in the PRO Rules tab. They show which rule saves each file, and nothing is moved, deleted or sent.
  • After a download, the Downloads tab shows which rule saved each file.
  • Rule settings › Check rule order… finds rules that a rule above them hides.
  • Rule tracing: in the PRO Rules tab, open Diagnostics, tick Rule tracing and download again. Then click Show the traces… to see, for each email and file, which rules matched and which condition didn’t. Tracing slows downloads, so turn it off when you are done.
The Rule trace viewer in its tree view: an Acme invoice email, the rules Acme invoices and Northwind statements not matched, and All PDFs matched and saving the file
Rule tracing: which rule matched each file of a real download, and which didn’t.

Still stuck? Search the knowledge base, or send us a bug report from the program.

Mail server connection tips

  • Set up your account: click Add account › Email account…, pick your provider, and the settings are filled in from your email address. See recommended settings.
  • Sign in with your browser for Gmail, Google Workspace, Outlook.com and Microsoft 365: no password is stored. See signing in with your browser. Yahoo, iCloud and others need an app password: the setup guide walks you through it.
  • Test Connection before you add rules or schedule downloads.
The account window for ap@contoso.example with Microsoft 365 picked and sign-in in the browser
Pick your provider, then click Test Connection to sign in.

Still having connection or sign-in problems?

  • A firewall, proxy or antivirus can block the connection or the sign-in. Open Connection diagnostics (in Settings › Logs and support): it shows each stage and warns when something inspects the traffic. Then check with your IT support.
  • See connection issues, and search the knowledge base for proxy settings and more.

License activation or moving a license

  • Activate: copy the fields from your license email exactly into the License tab and click Validate. No internet on that system? Use Activate offline….
  • Move to another system: enter your license there. If all its computers are in use, click Free a computer… and pick the one that no longer needs it.

See activate your license, or move it.

Running for multiple accounts

Pick <multiple@multiple> in the Account box, click Choose accounts…, tick the accounts and click Validate and use selected. PRO Backup runs up to 3 accounts together, PRO Parser up to 5, and PRO Rules Client and PRO Rules Server as many as you have. If one account fails, the others still run.

Choosing invoices@acme.example and purchases@acme.example to run together
Tick the accounts to run together, then Validate and use selected.

Read more: multiple email accounts with PRO Rules and download from several accounts at once.

PDF tips: save emails or attachments as PDF

Add Convert documents under Then to turn the email or its attachments into PDF (PRO Rules Client and up). PRO Rules Server converts to 50+ formats, such as multi-page TIFF and Word, and adds Convert all files to a single PDF, Merge PDFs, Split PDF and Make PDFs searchable (OCR).

The Rule Editor with a Merge PDFs step that joins the email's saved PDF files into one named by month
Merge PDFs joins an email’s saved PDFs into one file (PRO Rules Server).

Read more: save emails and attachments as PDF.

Extract data like the invoice number

The Parser tab (PRO Parser and up) reads values out of emails and their attachments. Highlight the invoice number in a sample, or describe it in words and let AI find it. Use it in the folder and file name, such as {SUPPLIER}\{INVOICE_NUMBER}_{FILENAME}{EXT}, or send it to CSV, Excel or Google Sheets.

The Parser with an Acme invoice sample and the invoice number, dates, total and supplier highlighted as fields
Highlight a value once, and the Parser finds it in the next emails.

For a quick field inside a rule, PRO Rules Client adds Find fields with AI. Read more: extract data from emails and attachments and PRO Parser.

Save extracted data to a database

With PRO Rules Server, Save to a database adds a row with the values you read to any ODBC database, such as SQL Server, MySQL or PostgreSQL. Store CSV / SQL loads the rows of Excel or CSV attachments.

A Save to a database step inserting the invoice number, supplier, date, total and saved file into dbo.Invoices
Save to a database: one row for each saved file.

Read more: save emails, files and invoice data to a database and the blog post.

Nest rules and steps like a PRO

Nest steps. Steps under Then run in order, and a step can hold steps that work on its result. For example, Unzip an attachment, then convert each file inside to PDF and save it to a database (PRO Rules Server).

Chain rules (PRO Rules Client and up). One shared filter picks the emails, and the rules under it each do one job with them. You write the condition once instead of repeating it in many rules. A rule can also start another with the Run another rule step.

The PRO Rules tab with a Supplier invoices filter and two rules under it: Upload to SharePoint and Save to the accounting database
A shared filter (1) with two rules under it (1.1 and 1.2).

Read more: chained rules and actions.

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

Using version 3.x? See the 3.x version of this guide.

Filter features in PRO Rules: one account, rule order and catch-all rules

Email rule filters in PRO Rules: rules for every account or one, rule order and first match, catch-all rules, turning rules off and download dates.

PRO Rules let Mail Attachment Downloader handle each kind of email and attachment in its own way. This post answers the questions people ask most about them: which accounts a rule runs for, which rule wins, what happens when no rule matches, and which dates are downloaded. It is written for version 4.0.

New to rules? Start with the complete PRO Rules walkthrough: it shows how to make a rule, step by step.

What are PRO Rules?

PRO Rules are the rules you make in the PRO Rules tab, in PRO Rules Client and PRO Rules Server. In version 3.x this tab was called Global filters. Tick Use PRO Rules for every account at the top of the tab, and the rules decide what each account downloads.

The PRO Rules tab with a list of rules in the order they run; the last rule, Orders to the ERP, is switched off
The PRO Rules tab. Rules run in the order shown; the switch in the Enabled column turns a rule on or off.

Rules apply to every account

A rule runs for every account you download from. To download from several accounts in one run, pick <multiple@multiple> in the Account box and click Choose accounts…. Otherwise the download runs for the one account picked. See multiple email accounts with multiple rules.

When does a rule run?

For each attachment of an email, the program tries the rules from the top of the list down, to see whether one matches that file. When a rule saves the email itself (as an .eml file), the email goes through the rules too.

Make a rule apply to one account

Open the rule in the Rule Editor (select it and click Edit). Under Which emails, click Add a condition, pick Account and choose the account, for example finance@contoso.com. Click Save.

The rule now runs only for that account, and the list’s Account column shows it. To see only the rules of the account picked at the top, click Show only the rules for the picked account above the list. The rules for all accounts stay listed.

Rule order: the first match wins

Rules run from the top of the list down until one matches. The order matters:

  • Once a rule saves a file, no other rule runs for that file.
  • If the email has other attachments, each one starts again from the top.
  • Put narrow rules (Acme’s invoices) above broad ones (all PDFs).

To move a rule, drag it up or down. You can also select one or more rules and use Rule settings › Move in the list, or press Alt+Up and Alt+Down.

Not sure the order is right? Rule settings › Check rule order… finds rules that never save anything because a rule above them takes all their files, and offers to move them. Test all rules… on the same menu shows which rule saves each file of the emails you pick, without changing anything.

A catch-all rule for emails nothing saved

You made rules for the attachments you want. But what if none of them matched an email?

In 4.0 this is a rule type of its own. Make a new rule, click Save in its outline, and set Rule type: to Negative rule (steps for emails nothing saved). A negative rule saves nothing. Its steps run for the emails that no rule saved anything from. It runs after the other rules, wherever it sits in the list.

For example, tell the sender that their email didn’t have what you need:

  1. Give the negative rule a condition so it only answers the right people, for example From 'acme.example' OR 'northwind.example', or a Mailbox folder condition for your Invoices folder. Without one, it would answer every unmatched email, newsletters and spam included.
  2. Under Then, add a Send an email step. Put {EMAIL_FROM} in To: and write a short note, such as “We received your email ‘{SUBJECT}’, but it had no invoice attached.”
  3. Click Test this rule…, then Save.

Send an email needs PRO Rules Server. Steps that work on a saved file can’t be added to a negative rule, since it saves none. With PRO Rules Client, you can still use Move or copy the email to put those emails in a “Needs attention” folder.

A Send an email step in the Rule Editor, with Send from, To, a subject with the SUBJECT field and a text with the FROM field
The Send an email step (PRO Rules Server): fields such as {SUBJECT} are filled in for each email.
The Rule Editor on the rule No invoice attached: Rule type Negative rule (steps for emails nothing saved), and under Then a Send an email step to {EMAIL_FROM} and a move to Needs attention
A negative rule runs its steps for the emails no rule saved anything from.

Waiting for an email that never comes, such as a monthly statement? That is a different job: Expected emails notices when a rule’s regular email is late and runs steps when it is missing.

Turn rules on and off

Each rule has a switch in the Enabled column. Click it to turn the rule off, or right-click the rule and choose Turn off. For several rules at once, select them and use Rule settings › Disable entry or Enable entry.

A rule that is off never runs, and its settings are kept. Type “disabled” in the Search box to find the rules that are off, or use Hide disabled entries to leave them out of the list.

Download dates: the Search scope page

With PRO Rules on, the dates come from the PRO Rules tab, not from each account. Open its Search scope page:

  • Only emails from and Only emails up to apply to every account, and override each account’s own dates.
  • Each account decides (the default) lets each account keep its own choice of what it searches. The same for all accounts sets one choice for all of them: Messages since the last download or All mail.
The PRO Rules tab on Search scope: Each account decides, with three Contoso accounts and their Search in choice, and Date limits (every account) with Only emails from 1/1/2026
Search scope: what each account searches, and date limits for every account.

New in 4.0: each account has a History. It remembers the emails it has seen, so a download takes only the emails it hasn’t seen yet and nothing is downloaded twice. To bring in older emails later, or to process emails again, use Backfill emails….

Tip: before the first download of a large mailbox, set Only emails from, for example to the start of this year, so the first run doesn’t go through years of old mail.

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

Using version 3.x? See the 3.x version of this guide.

Questions or suggestions about this post? Contact us.

Save emails and attachments to folders with PRO Rules: a complete walkthrough

A complete guide to saving emails and attachments to folders with PRO Rules: conditions, folders and file names, steps, rule order and testing.

This post shows how to save emails and attachments to folders with rules, step by step. It is the complete walkthrough of PRO Rules in Mail Attachment Downloader 4.0, the main reference that the other posts link to.

The Free edition saves each account’s attachments, emails or both into one folder, named one way. You set that on the account’s Account rule tab, on its Folders and file names page. The PRO Rules editions, PRO Rules Client and PRO Rules Server, go further: each kind of email can have its own folder, its own file names and its own steps after saving. PRO Rules Server can also run all of this 24×7 as a Windows service, on a PC, a server or a cloud VM, with nobody signed in.

The idea: one rule for each save location

To save different emails to different folders, make one rule for each folder. Each rule says:

  • which emails it takes (its conditions),
  • where it saves them and how the files are named,
  • what happens next (its steps).

For example: invoices from Acme go to \\fileserver\Finance\Invoices\Acme, purchase orders from Northwind go to \\fileserver\Finance\Orders, and scanned receipts are made searchable and uploaded to SharePoint.

PRO Rules: an overview

Rules live in the PRO Rules tab. In version 3.x this tab was called Global filters. Tick Use PRO Rules for every account at the top of the tab: from then on, the rules decide what each account downloads, instead of each account’s Search, Filters and Folders and file names pages. When you turn it on, the program offers to move your Account rules into PRO Rules, one rule per account, and shows you each rule first.

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, with a switch to turn each one on or off.

Rules run from the top of the list down, for each attachment, and for the email itself when a rule saves it. Each rule has five parts, which the Rule Editor shows top to bottom:

  • Which emails: the conditions that decide whether the rule runs. Otherwise the rule is skipped.
  • Fields to find: values read from the email, such as an order number, for the file names and the steps.
  • Save: what is saved, in which folder, and how the files are named. The folder and name can use the values found.
  • Then: the steps that run after saving, in order.
  • If something fails: the steps that run when a step above fails.

Rule tips and common questions

  • One account only: a new rule runs for every account. To keep a rule to one account, add an Account condition to it and pick the account, for example finance@contoso.com.
  • Several accounts in one run: pick <multiple@multiple> in the Account box, click Choose accounts… and tick the accounts. The rules run for each of them. See multiple email accounts with multiple rules.
  • First match wins: each file is saved by the first rule that matches it, and the rules below it never see that file. The next attachment of the same email starts again from the top, so it can go to another rule.
  • Change the order: drag a rule up or down, or select it and use Rule settings › Move in the list (or press Alt+Up and Alt+Down).
  • Similar rules: right-click a rule and choose Duplicate, then change the copy. If many rules share the same conditions, make a Shared filter with those conditions once and add the rules under it (right-click it › Add a rule under this shared filter). See chained rules and actions.

Name your rules well

With many rules, good names save time. Say a rule called “Invoices” runs for one account only, because it has an Account condition. Call it “finance@contoso.com – Invoices” instead. Then type finance@contoso.com in the Search box above the list to see only that account’s rules. The search also finds rules by kind, account and save folder.

Create a rule

Click New rule… in the PRO Rules tab. The Rule Editor opens. Type a name in Rule name: first. The left side shows the rule’s outline: click a part to change it on the right.

The Rule Editor for the rule Scanned invoices: the outline with Which emails, Fields to find, Save, Then and If something fails, and a Find fields with AI step on the right
The Rule Editor: the rule’s outline on the left, the selected part on the right.

Prefer plain words? Pick Create using AI… from the arrow next to New rule…: describe the rule, and the AI writes it for you to test before saving.

Which emails: the conditions

Click Which emails, then Add a condition. You can match on From, To, Subject, Body, Attachment name, Mailbox folder, Account, the received dates, the size, the number of attachments, Email security and more.

Say the rule should save invoices and payment advice. Add a Subject condition and type:

'Payments' OR 'Invoices'

  • OR: the rule runs when the subject has “Payments” or “Invoices” anywhere in it.
  • AND: all the words must be there, anywhere in the subject.
  • NOT: leaves emails out, for example 'Invoices' AND NOT 'reminder'.
  • = before a value matches only that whole value, and !! before a .NET regular expression uses the expression.

To combine conditions, put them in an Any of these group (OR) or an All of these group (AND). Click Test the expression… to try a condition on a sample text before you save. Conditions match the text as you type it: they don’t fill in fields such as {DATE}.

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

Fields to find: values from the email

A rule can read values out of the email, such as an order number, and keep them in a field in curly braces, such as {ORDER_ID}. Find them By pattern, By pointing at it in a sample, or With AI. The folder, the file name and the steps can then use them.

To read values from many similar emails or files, the Parser (PRO Parser and up) is the better way. More in extract data from emails and attachments.

Save: what, where and how it’s named

Click Save in the outline.

  • Rule type: leave it at Global rule (saves, then runs its steps) for a rule that saves files. The other types are for shared filters, shared actions and rules for emails nothing saved: see catch-all rules.
  • What to save: The attachments, The email and its attachments, The email only (an .eml file), or Nothing: back up only.
  • Save folder: for example \\fileserver\Finance\Invoices. Missing folders are made for you.
  • File name: a new rule starts with {FILENAME}_{ID}{EXT}. Click Fields… to add more fields, such as the sender or the date.
  • Only files of these types: keep only documents, pictures or the types you list, such as .pdf, .xlsx.

Important: with the Windows service (PRO Rules Server), use a network path such as \\fileserver\Finance in the save folder, not a mapped drive letter: the service can’t see mapped drives.

The Save part of a rule: Rule type, What to save, a save folder with a field for each sender, and a file name built from the date and the subject
The Save part: what is saved, where, and how the files are named, with an example below.

Folders and file names from fields

Fields fill in values from each email. Some examples:

  • \\fileserver\Finance\Invoices\{EMAIL_FROM} makes a folder for each sender’s address.
  • \\fileserver\Finance\FY2026-Q3\{ORDER_ID} makes a folder for each order number your rule found.
  • {DATE[yyyy-MM-dd]}_{FILENAME}_{ID}{EXT} puts the email’s date in front of each file name.

Keep {ID} in the file name. It is the message’s ID with the part number, so each file gets its own name, even when two emails both send invoice.pdf.

The full list of fields, with date formats and more examples, is in customizing file names and email data with fields.

Two more choices on the same page: Also save the email’s text and HTML parts saves the email’s text as .txt and .html files, and Leave out the pictures inside the text skips logos and signature images.

Then: steps after saving

After a file is saved, the rule can do much more. Click Add a step…, find the step by its group or by searching, and click Add. Steps run in order, and a step can hold steps that work on its result.

The Add a step window with the step groups Files, Email, Other systems, Data and fields, Notify, Decide and repeat and Programs, and the Files steps
Add a step: search, or browse the steps by group.

Some examples:

  • Archive the email: Move or copy the email to a folder on the mail server once its files are saved.
  • Invoice data: Add a row to a spreadsheet (Excel or Google Sheets) with the values found. See invoice processing.
  • Other systems: Upload to cloud (OneDrive, SharePoint, S3 and more) or Send to document management (Laserfiche, M-Files, DocuWare).
  • Databases: Save to a database, or Store CSV / SQL to load the rows of Excel or CSV attachments. See save emails and attachments to a database.
  • PDF and other formats: Convert documents to PDF, and with PRO Rules Server to 50+ formats such as multi-page TIFF, plus Merge PDFs, Split PDF and Make PDFs searchable (OCR).
  • Your own programs: Run a script or Run a command line on each saved file.
  • Tell someone: Send an email, Forward the email or Send notification (Slack, Teams and more) when a certain kind of email arrives.

PRO Rules Client converts to PDF only. Sending email, notifications, Unzip, OCR, Merge PDFs, Split PDF, databases, scripts, web hooks and AI prompts are PRO Rules Server steps. See all PRO features.

Test the rule before it runs

Click Test this rule… in the Rule Editor and pick some emails. Nothing is changed: files go to a temporary folder, and steps such as moving, deleting or sending are only described. Then click Save.

When you have several rules:

  • Rule settings › Test all rules… runs the rules that are on, in the list’s order, and shows which rule saves each file.
  • Rule settings › Check rule order… finds rules that never save anything because a rule above them takes their files, and offers to move them.
  • After a real download, the Downloads tab shows which rule saved each file.
  • Still puzzled? Open Diagnostics in the PRO Rules tab, tick Rule tracing and download again. Show the traces… then shows which condition matched and which didn’t. Turn it off when you are done: it slows downloads.
Test all rules: five sample emails from Acme, Northwind, Fabrikam and Contoso, each saved by 'Invoice PDFs' or 'All PDFs' or matched by no rule, with the details of the Northwind statement
Test all rules: which rule saves each email’s files, without changing anything.

Make a rule for each folder

Repeat this for each kind of email: one rule per save location, each with its own conditions, folder, file name and steps. Then click Connect and Download, or schedule it on the Schedule tab.

Running the Windows service? It keeps the copy of your rules it got when it was installed. After you change a rule, open Schedule › Service schedule and click Reinstall…. See the PRO Rules Server how-to.

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.

Uses and scenarios

Many businesses use “magic folders”: a scanning, capture, OCR, invoice processing or document management product watches a folder and picks up each new file. PRO Rules feed those folders from email, one folder per kind of document, with the names those products expect. Where 4.0 has a direct connector, such as Upload to cloud, Send to document management or a database step, you can skip the folder and send the file straight there.

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

Using version 3.x? See the 3.x version of this guide.

Questions or suggestions about this post? Contact us.

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 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.