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.

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
- On the PRO Rules tab, click New rule… and name it “Supplier invoices”.
- Under Which emails, click Add a condition and add the invoices: “invoice” in the subject, or the account finance@contoso.com.
- 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. - Leave Picks on Emails that pass the checks.
- Under Save, save the attachments to
\\fileserver\Finance\Invoices.

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.
- Under Save, choose The email only and a folder such as
D:\Finance\Review, so the reviewer has a copy. - 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.
- 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.


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.


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.

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
- Email security conditions: features
- Invoice emails to your invoice processing software
- Filters in PRO Rules
- Process e-invoices from email: ZUGFeRD, Factur-X, XRechnung
- Why did my rule not download the attachment or email?
Questions about this post? Contact us.





















![The Upload to cloud step in the Rule Editor of a rule named Supplier invoices: Cloud connection Invoices archive, Destination acme-invoices › Suppliers, Run For each saved file, Subfolders {DATE[yyyy]}/{DATE[MM]}, File name {FROM}_{FILENAME}{EXT}, If the name is taken Keep both (add a number), and the Test upload and Diagnostics buttons](https://i0.wp.com/gearmage.com/assets/images/4.0-cloud-upload.jpg?w=840&ssl=1)























![The Convert all files to a single PDF window: the two steps it adds, What happens to the original files? with Keep them and Delete them, the merged PDF's name {SAVE_PATH}\{DATE[yyyy-MM-dd]}_{SUBJECT}_{ID}.pdf and Put the email's text last](https://i0.wp.com/gearmage.com/assets/images/4.0-convert-single-pdf.jpg?w=840&ssl=1)
