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.

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:FinanceInvoices 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

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.