# Automatically file invoices from email and forward them

> File invoices from email into a folder automatically and forward them to QuickBooks: Gmail filters, Outlook rules, an agent, sender checks and common errors.

Updated: 2026-10-30 · Fact-checked: 2026-10-30 · Canonical: https://commandmail.app/en/guides/file-invoices-from-email-automatically · Deutsch: https://commandmail.app/de/anleitungen/rechnungen-aus-e-mails-automatisch-ablegen.md

Getting invoices out of your inbox automatically means solving two jobs. The email should land in its own folder, and the receipt or bill should reach your bookkeeping. Gmail filters, Outlook rules or an agent in Command Mail handle the first job[^5][^8]. QuickBooks Online handles the second with a forwarding address at `@assist.intuit.com`, which extracts dates, amounts and the vendor from what you send[^10].

Automatic forwarding adds its own setup requirements. QuickBooks accepts receipts only from the sign-in address of a permitted user, Gmail asks for a verification click in the receiving account, and Microsoft 365 blocks external forwarding in many organizations[^7][^9][^10]. This guide walks through both jobs and points out which hurdle sits where. Command Mail is our product; it recognises, files and passes on invoices, and it creates no bookkeeping entries.

## The short version

1. Find your invoices with a search, in Gmail for example `has:attachment filename:pdf subject:invoice`[^6].
2. File them automatically: in Gmail through Show search options → Create filter → Apply the label[^5], in Outlook on the web through Settings → Mail → Rules → Add new rule[^8], in Command Mail with a folder rule that names the kind Invoice.
3. Create the forwarding address in QuickBooks under All apps → Accounting → Receipts → Forward from email[^10].
4. Send invoices there from an address QuickBooks accepts, through a forwarding rule or through an agent in Command Mail that forwards or prepares a draft for your approval[^10].
5. Test with one invoice and check that it appears under Receipts.

## What you need

Filing works with the mailbox you already have. For forwarding to QuickBooks you need an active QuickBooks Online subscription and the Business view[^10]. An administrator creates the forwarding address; each user who sends receipts needs at least standard user permissions with vendor access and must be allowed to forward[^10]. Each user can register only one email address for the company[^10].

For the Command Mail route you need an account and an agent that speaks MCP, such as Claude, ChatGPT or Codex. Filing already works on the free plan with one mailbox and the last 90 days. Forwarding and sending start with Pro, which costs €19 per month for the first 100 paying Pro accounts as long as the subscription runs, and €29 per month after that[^2].

New mailboxes start on the level Suggest, or on Read only if that is your account default. Keep in mind that `mail:read` reads every mailbox in your account; the level only limits what the agent may change in each mailbox.

## Which route fits?

| Route | Files in the inbox | Passes the invoice on | Typical hurdle |
|---|---|---|---|
| Gmail filter | Yes, as a label[^5] | Only to verified forwarding addresses[^7] | Someone has to click the verification link at the destination[^7] |
| Outlook rule | Yes, into a folder[^8] | Yes, inbox rules can forward[^9] | External forwarding often blocked (5.7.520)[^9] |
| QuickBooks forwarding address | No | Creates a receipt from each file[^10] | Sender must be a permitted user's sign-in address[^10] |
| Command Mail with an agent | Yes, folder rule for invoices | Agent forwards or drafts[^2] | Passing on needs Pro; for forwarded addresses only the SMTP route sends as your address |

## Step 1: Find your invoices

Before you automate anything, run the search your filter will use and look at what it catches. Gmail finds messages with attachments with `has:attachment`, PDF files with `filename:pdf`, words in the subject with `subject:`, and one sender with `from:`[^6]. A search such as `from:billing@shop.example has:attachment` hits exactly one vendor.

A search for the word invoice alone also catches newsletters that mention it and invoices that are fake. Start with the vendors who bill you every month and add new ones on purpose.

## Step 2: File invoices into a folder automatically

**Gmail.** In the search box at the top, click Show search options, enter your criteria and check them with Search. At the bottom of the search window, click Create filter, choose what the filter should do, for example apply a label, and click Create filter again[^5]. A label called Invoices behaves like a folder in Gmail.

**Outlook on the web.** Select Settings, then Mail, then Rules, and select Add new rule. Every rule needs a name, a condition and an action, for example Subject contains and Move the item to folder[^8]. The option Stop processing more rules is on by default, so only the first matching rule applies to a message[^8]. If you also want to forward later, put both actions into the same rule with Add an action, or turn that option off[^8].

**Command Mail.** Command Mail adds markers such as Invoice, Deadline and Security to incoming mail[^1]. According to our app code, a message is marked as an invoice when it states a code such as “Invoice no.: RE-123”, its subject starts with Invoice, Rechnung or Gutschrift, also after “Your”, “Ihre” or “Deine”, or it carries a PDF whose file name contains one of those words. Recognition only uses these patterns and can miss invoices.

Rules come from your spam clicks, from suggestions you switch on and from instructions to your agent. Tell it, for instance: "File invoices from shop.example into the folder Invoices." A rule covers one sender or one sender domain, optionally only one kind of mail, and the agent applies it to existing mail as one undoable step of up to 200 conversations[^4]. Shared providers such as Gmail or Outlook are refused as rule domains[^4].

Invoices are a protected kind. A rule files them only when it names exactly the kind Invoice, and when Command Mail also recognises a deadline, the rule only creates a suggestion[^4]. According to our app code, a deadline is a sentence with words such as “due by”, “due date” or “deadline”, so an invoice that says “due by November 15” stays in the inbox until you decide; “payable within 14 days” is not recognised as a deadline.

Whether the rule acts at once depends on the mailbox's autonomy level. On Suggest, a rule from your agent becomes a suggestion that you switch on under Automation & rules; on Confirmed rules and Limited filing it applies to new mail by itself. Filing by agents and rules shows up in the activity log and can be undone there; sent emails cannot be recalled that way[^1].

## Step 3: Create the QuickBooks forwarding address

In QuickBooks Online, go to All apps, then Accounting, then Receipts, and select Forward from email. Enter a name for the address, which will end in `@assist.intuit.com`, select Next, confirm with Looks good and select Done[^10]. You must be an administrator for this step[^10].

Then select Manage forwarding email and turn on the toggle for every user who may forward receipts and bills[^10]. Those users must send from the address they use to sign in to QuickBooks[^10].

QuickBooks accepts PDF, JPEG, JPG, GIF and PNG files, each between 46 KB and 20 MB, and each file should contain only one receipt[^10]. You can send several receipts in one email[^10].

## Step 4: Pass invoices on to QuickBooks

**From Gmail.** QuickBooks notes that Gmail users can automatically send incoming bills and receipts to the forwarding address, and that Gmail addresses with a plus sign may not register[^10]. Gmail itself sends a verification link to every new forwarding address, and forwarding starts only after someone clicks it in that account[^7]. The QuickBooks article does not say where that verification email shows up, so plan a test before you rely on it[^10].

To set it up, go to Settings → See all settings → Forwarding and POP/IMAP, click Add a forwarding address and complete the verification[^7]. Leave forwarding of all mail switched off; then create your invoice filter, click Forward it in the list of filter options, select the address and click Create filter[^7]. Gmail applies a new forwarding filter only to new messages[^5].

**From Outlook or Microsoft 365.** Inbox rules can forward messages to external addresses automatically[^9]. If the message comes back with "5.7.520 Access denied, Your organization does not allow external forwarding", an outbound spam filter policy blocks it[^9]. Microsoft writes that the default setting changed in 2021 to off for new organizations, and that turning forwarding off disables inbox rules that redirect messages externally; an administrator can turn it on[^9].

**With an agent in Command Mail.** A Command Mail rule only files mail; forwarding is not one of its actions. A connected agent can pass invoices on in two ways, with or without your approval. You set up regular runs in the agent itself[^1].

With approval, the agent saves a new message to the QuickBooks forwarding address as a draft, not a reply draft, and attaches the invoice from the original message, at most five files of up to 5 MiB each according to our app code. That needs `mail:draft` and, because the agent copies a file out of the mailbox, `mail:read`; nothing leaves until you approve exactly that version, which an agent with `mail:send-approved` can then send[^2]; on Read only you send the approved version yourself. For a handful of invoices a month, this is the careful route.

Without approval, the agent forwards the message with its attachments. It needs `mail:read` and `mail:send`, and the mailbox must be on Limited filing (`auto`)[^2]. Every forward needs its own sendKey, counts against the daily limit (50 by default) and may address at most 20 recipients[^1][^2]. According to our app code, a single forwarded message carries at most five attachments of up to 5 MiB each; a forwarded conversation can carry more files, within the same size limits.

Agents do not write on their own to automated senders, mailing lists or no-reply addresses[^2]. If the forwarding address has only ever sent you automatic mail, Command Mail refuses the forward with `automated_sender` and sends nothing. In that case, have the agent save a new message to that address as a draft for your approval.

For addresses that reach Command Mail by forwarding, such as Gmail or your own domain, the sending route decides which sender QuickBooks sees. Through your provider's SMTP server, Command Mail sends with your address as sender and as SMTP MAIL FROM, according to our app code; that matches QuickBooks only if it is your QuickBooks sign-in address[^10]. Through the relay, the sender is a Command Mail address with your address as Reply-To, which does not match[^10].

## What happens to your invoices at Command Mail

Invoices carry bank details and amounts. Command Mail is operated by FYN Labs LLC in the United States; the app and database run on Cloudflare, and attachments are stored in Cloudflare's EU region[^3]. To assess spam and phishing, the sender, recipients, subject, attachment names and up to 4,000 characters of text of incoming mail go to the service provider TypeSafe[^3].

According to our app code, the sender's display name and, with automatic labels, their names and rules go along as well. Opening the agent panel of a message in the web app sends the sender with display name, recipients, cleaned subject and up to 4,000 characters of text to TypeSafe; the list of similar messages sends the original and up to 30 candidates with sender, subject and up to 1,000 characters of text. Details are in [Privacy of AI email assistants](https://commandmail.app/en/learn/ai-email-assistant-privacy). If your agent uses a hosted model, its provider also reads what the agent reads.

## Did it work?

Test with a real PDF invoice from a sender your rule covers; for a test address of your own, set up a separate, narrow test rule. In QuickBooks, the receipt appears under Receipts, where you review it, categorize it or match it to an existing transaction[^10]. It can take a few minutes to arrive[^10].

In Command Mail, check that your test invoice is marked as an invoice before you switch a rule on. The daily overview your agent fetches lists recognised invoices from the inbox with invoice numbers and amounts, according to our app code, though not mail that is already filed. After that, every filing by a rule appears in the activity log as filed into a folder by rule, and you can undo it there[^1].

## Common problems

**QuickBooks shows nothing.** Check that the arriving sender is the sign-in address of a user with permission, and that each file is a supported type between 46 KB and 20 MB[^10].

**Outlook bounces with 5.7.520.** Your organization blocks automatic external forwarding[^9]. Ask your administrator to allow it for this mailbox or user[^9].

**Gmail does not offer the address in the filter.** The forwarding address is not verified yet[^7]. Add it under Settings → See all settings → Forwarding and POP/IMAP and complete the verification first[^7].

**Command Mail does not file an invoice.** If Command Mail recognises a deadline, the rule only creates a suggestion[^4]. If the Invoice marker is missing, Command Mail did not recognise the message as an invoice, and the invoice rule does not apply. File such messages by hand; according to our app code, a rule without a kind only covers routine mail such as newsletters and notifications.

**The agent may not forward.** If the mailbox is below Limited filing or `mail:send` is missing, Command Mail refuses the send; the agent can save a draft for your approval instead[^2]. If it reports `automated_sender`, the address counts as a machine and only the draft route remains[^2]. Check level and permissions under Automation & rules.

## Real invoice or bait?

Fake invoices arrive by email too, and an automatic forward carries them straight into your receipt review queue. Command Mail scores every message for spam, fraud and phishing in percent, without opening links or attachments[^1]. A marker is still no proof that an invoice is genuine[^4].

According to our app code, a message loses the Invoice marker only when it is recognised as certain bait; when it is merely suspicious, the marker stays with a warning next to it. Tell your agent explicitly not to forward messages flagged as suspected phishing. How to spot fakes yourself is covered in [How to spot phishing emails](https://commandmail.app/en/learn/spot-phishing-emails).

## Next steps

Start with two or three vendors who bill you regularly, and widen the setup only once the test invoices arrive cleanly. For sorting the rest of your mail, see [Sort Gmail automatically](https://commandmail.app/en/guides/sort-gmail-automatically) and [Sort Outlook email automatically](https://commandmail.app/en/guides/sort-outlook-email-automatically).

[Start Command Mail for free](https://commandmail.app/login?signup=1), forward one address and connect your agent.

## Sources and date

As of 2026-10-30. All help pages and Command Mail's public pages were accessed on that day. Statements about invoice recognition, the bait case, draft attachments, the daily overview, and the sender and MAIL FROM for SMTP and relay also rest on the app code at commit `d9ab36c` (`mail-signals.ts`, `mail-rules.ts`, `file-transfers.ts`, `mail-insight.ts`, `smtp-provider.ts`, `outbox.ts`). We have not tested forwarding to a real QuickBooks address[^10].

## Frequently asked questions

### Can a Gmail filter forward invoices to another address?

Yes, if you have added and verified that address as a forwarding address. Gmail first sends a verification link to it, which someone has to click in that account. A filter then forwards only new messages that match its search.

### Why does QuickBooks not pick up my forwarded receipt?

QuickBooks accepts receipts at the forwarding address from users with permission, who must send from the email address they use to sign in to QuickBooks. Check which sender address actually arrives, and that the file is a PDF, JPEG, JPG, GIF or PNG between 46 KB and 20 MB.

### Does Command Mail forward invoices by itself?

No. Command Mail rules move mail to spam, the archive, a folder or the trash; forwarding is not one of their actions. A connected agent can forward an invoice or prepare a draft to your bookkeeping address if you give it the permissions and run it regularly.

### Why does my Microsoft 365 rule fail with 5.7.520?

Your organization blocks automatic forwarding to external recipients. Microsoft documents this message for blocked forwarding; an administrator can allow external forwarding in the outbound spam filter policy.

### Does Command Mail recognise every invoice?

No. According to the app code, a message counts as an invoice when it states a code such as “Invoice no.: RE-123”, its subject starts with Invoice, Rechnung or Gutschrift, also after “Your”, “Ihre” or “Deine”, or it carries a PDF with one of those words in the file name. Recognition can miss invoices; without the marker an invoice rule does not apply.

## Sources

1. [Command Mail: documentation, sections forwarding, answering on its own, activity log and risk assessment](https://commandmail.app/en/docs), accessed 2026-10-30
2. [Command Mail: plans and agent permissions](https://commandmail.app/llms.txt), accessed 2026-10-30
3. [Command Mail: privacy policy (as of 2026-10-28)](https://commandmail.app/privacy), accessed 2026-10-30
4. [Command Mail: agent guide to organizing and archiving](https://commandmail.app/skills/commandmail-organize/SKILL.md), accessed 2026-10-30
5. [Gmail Help: Create rules to filter your emails](https://support.google.com/mail/answer/6579?hl=en), accessed 2026-10-30
6. [Gmail Help: Search operators you can use with Gmail](https://support.google.com/mail/answer/7190?hl=en), accessed 2026-10-30
7. [Gmail Help: Automatically forward Gmail messages to another account](https://support.google.com/mail/answer/10957?hl=en), accessed 2026-10-30
8. [Microsoft Support: Manage email messages by using rules in Outlook](https://support.microsoft.com/en-us/outlook/mail/manage-email-messages-by-using-rules-in-outlook), accessed 2026-10-30
9. [Microsoft Learn: Control automatic external email forwarding](https://learn.microsoft.com/en-us/defender-office-365/outbound-spam-policies-external-email-forwarding), accessed 2026-10-30
10. [QuickBooks Help: Email receipts and bills](https://quickbooks.intuit.com/learn-support/en-us/help-article/accounts-payable/email-receipts-bills-quickbooks-online/L7r2LAQ7C_US_en_US), accessed 2026-10-30

[^1]: [Command Mail: documentation, sections forwarding, answering on its own, activity log and risk assessment](https://commandmail.app/en/docs), accessed 2026-10-30
[^2]: [Command Mail: plans and agent permissions](https://commandmail.app/llms.txt), accessed 2026-10-30
[^3]: [Command Mail: privacy policy (as of 2026-10-28)](https://commandmail.app/privacy), accessed 2026-10-30
[^4]: [Command Mail: agent guide to organizing and archiving](https://commandmail.app/skills/commandmail-organize/SKILL.md), accessed 2026-10-30
[^5]: [Gmail Help: Create rules to filter your emails](https://support.google.com/mail/answer/6579?hl=en), accessed 2026-10-30
[^6]: [Gmail Help: Search operators you can use with Gmail](https://support.google.com/mail/answer/7190?hl=en), accessed 2026-10-30
[^7]: [Gmail Help: Automatically forward Gmail messages to another account](https://support.google.com/mail/answer/10957?hl=en), accessed 2026-10-30
[^8]: [Microsoft Support: Manage email messages by using rules in Outlook](https://support.microsoft.com/en-us/outlook/mail/manage-email-messages-by-using-rules-in-outlook), accessed 2026-10-30
[^9]: [Microsoft Learn: Control automatic external email forwarding](https://learn.microsoft.com/en-us/defender-office-365/outbound-spam-policies-external-email-forwarding), accessed 2026-10-30
[^10]: [QuickBooks Help: Email receipts and bills](https://quickbooks.intuit.com/learn-support/en-us/help-article/accounts-payable/email-receipts-bills-quickbooks-online/L7r2LAQ7C_US_en_US), accessed 2026-10-30

---

Command Mail: one inbox for you and your AI agent. Start free: https://commandmail.app/login?signup=1 · Connect your agent: https://commandmail.app/en/agents · MCP: https://commandmail.app/mcp
