Short answer: one of your attachments is a file type that email security blocks outright, often a macro-enabled Office file such as .docm, or a script, installer or disk image. Save the document in a normal format (for example .docx instead of .docm) or share it as a OneDrive or SharePoint link, then send again.
An accounts and payroll officer at a stone and benchtop business asked us why her emails to the company’s Victorian branch kept bouncing. Every email she sent with attachments came back as “Undeliverable” with error 550 5.0.350, so she assumed the Victorian mailbox or the attachments’ size was the problem. A message trace showed something narrower: only emails that included one macro-enabled Word policy document were rejected. Every other attachment, including PDFs, Word and Excel files, went through. Here is what we found and how to fix it.
Fixed and written up by Elliot Munro, CISO at GCIT.
Symptoms
Shortly after you send an email with attachments, Microsoft 365 returns an Undeliverable message (a non-delivery report or NDR). The top says Your message to [recipient] couldn’t be delivered and Policy violation or system error. Under Error Details you see:
550 5.0.350 One or more of the attachments in your email is of a file type that is NOT allowed by the recipient’s organization.

The NDR text talks about “the receiving email server outside Office 365” and the “recipient’s organization”, which is misleading. In our case the recipient was a mailbox in the same Microsoft 365 organisation as the sender. You may also see this described as “email bounced because of attachment”, “attachment type not allowed”, “5.0.350 attachment blocked” or “email with attachments undeliverable to one address”.
Clues that point to this cause:
- The same email goes through when you remove one particular attachment.
- Emails to the same person with other attachments deliver normally.
- Forwarding an older email that contains the file also bounces.
Affected Software
- Application: Any email client sending through Microsoft 365 (Outlook for Windows, Mac, web and mobile)
- Platform: Exchange Online Protection and Microsoft Defender for Office 365
- Related Services: Anti-malware policy, common attachments filter
Cause
Every Microsoft 365 organisation has an anti-malware policy with a common attachments filter. It blocks file types that are rarely needed in email and often used to deliver malware, without even scanning them. By default a matching email is rejected with an NDR, which is exactly the message above.
Microsoft’s default blocked list includes macro-enabled .docm Word documents and .ppam PowerPoint add-ins, along with programs and scripts such as .exe, .msi, .bat, .cmd and .vbs files, shortcut (.lnk) files, and disk images and archives such as .iso, .img, .cab and .arj. Your administrator may have added more, for example .xlsm or .zip.
The filter checks the real file type, not just the name, so renaming a .docm to .docx does not get it through. In our case, the message trace detail showed the failure came from the common attachment filter agent, triggered by a single file named “Policy and Procedures - Version 3.0 ALL COMPANIES.docm”. An email with ten attachments was rejected because one of them was that .docm.
Resolution
For the person sending the email
- Open the NDR and note the attachments on the original email. Look for macro-enabled Office files (names ending in m, such as .docm, .xlsm or .pptm), programs, scripts, shortcuts, disk images or archives.
- If it is a Word document that does not need macros, open it in Word, select File > Save As, change Save as type to Word Document (*.docx) and save. Do the same in Excel or PowerPoint with the standard .xlsx or .pptx type.
- Attach the new copy and send the email again.
- If the file must stay as it is, upload it to OneDrive or SharePoint and send a sharing link instead of an attachment.
- If you share the file with others often, replace the master copy with the standard format so nobody else hits the same bounce.
For administrators
- Confirm the cause with a message trace. In the Exchange admin centre go to Mail flow > Message trace, or in PowerShell run
Get-MessageTraceV2for the sender and thenGet-MessageTraceDetailV2for the failed message. A Fail event with 550 5.0.350 from the common attachment filter confirms it. - To see which file types your policy blocks, open the Microsoft Defender portal and go to Email & collaboration > Policies & rules > Threat policies > Anti-malware, then open the policy that applies to the recipient. In PowerShell,
Get-MalwareFilterPolicy | Format-List Name,EnableFileFilter,FileTypeAction,FileTypesshows the same. - Prefer fixing the file over changing the policy. A policy document, letter or form almost never needs macros.
- If a team genuinely must email a blocked type, create a narrow custom anti-malware policy for those recipients rather than editing the default policy for everyone, and record why.
Important Notes
- This is protection working as designed. Macro-enabled documents are one of the most common ways ransomware gets into small businesses. Removing .docm from the block list for the whole organisation is rarely a good trade.
- It is not winmail.dat. The message in our case was in rich text (TNEF) format, but that was incidental. Turning off TNEF for remote domains would not have helped, because the block was the file type.
- Zipping it may not work. Some organisations also block archive files such as .zip or .7z. A sharing link is the more reliable option.
- Other organisations have their own rules. If the NDR names a server outside Microsoft 365, the block belongs to the recipient’s email security. Only their IT team can change it, so a link is usually the quickest fix.
Related Resources
- Microsoft Learn: Anti-malware protection and the common attachments filter
- Microsoft Learn: Configure anti-malware policies
- Microsoft Learn: Email non-delivery reports and SMTP errors in Exchange Online
- Fix: “Action Blocked” When Opening Email Attachments in Outlook
- How to fix the Office 365 WINMAIL.DAT attachment issue
- Fix: Emails Bouncing to Yahoo with “554 Message Not Allowed”
- Microsoft 365 support and management from GCIT
If emails keep bouncing and you are not sure whether your email security is set up the right way, get in touch with our team.