Email spoofing and phishing attacks are major cybersecurity threats for businesses. One effective way to mitigate these risks is by implementing an External Email Warning Banner in Microsoft 365 and Gmail (Google Workspace). This feature alerts users when an email originates from outside the organization, reducing the likelihood of falling for malicious links or attachments.
This guide covers two methods for implementing external email warnings in Microsoft 365:
Manual setup via the Microsoft 365 Admin Center
Automated deployment using PowerShell
Additionally, we cover how to configure external email warnings in Gmail (Google Workspace).
Log in to the Microsoft 365 Admin Center.
Navigate to Exchange Admin Center (https://admin.exchange.microsoft.com).
In the left menu, go to Mail Flow > Rules.
Click + Add a Rule and select Create a new rule.
Name the rule: External Email Warning.
Under Apply this rule if…, select The sender is located… > Outside the organization.
Under Do the following…, select Prepend the subject with… and enter [External]
.
(Optional) To add a banner in the email body:
Choose Apply disclaimer to the message.
Add the following HTML warning message:
<div style="background-color: #ffcc00; padding: 10px; font-weight: bold;">
⚠️ WARNING: This email originated from outside your organization. Do not click links or open attachments unless you recognize the sender.
</div>
(Optional) Exclude Trusted Domains
Click Add Exception > The sender’s domain is….
Enter trusted domains (e.g., @trustedpartner.com
).
Click Save, and the rule will automatically apply to all users.
For organizations managing multiple tenants or wanting a faster, scalable deployment, PowerShell can be used to apply the warning banner.
Open PowerShell as an administrator.
Install the Exchange Online Management module (if not already installed):
Install-Module ExchangeOnlineManagement
Connect to Exchange Online:
Connect-ExchangeOnline -UserPrincipalName youradmin@yourdomain.com
Run the following command to create a rule that applies an external email warning banner:
New-TransportRule -Name "External Email Warning" `
-FromScope NotInOrganization `
-ApplyHtmlDisclaimerText "<div style='background-color: #ffcc00; padding: 10px; font-weight: bold;'>⚠️ WARNING: This email originated from outside your organization. Do not click links or open attachments unless you recognize the sender.</div>" `
-ApplyHtmlDisclaimerLocation Prepend `
-ApplyHtmlDisclaimerFallbackAction Wrap
Navigate to Exchange Admin Center > Mail Flow > Rules.
Ensure the "External Email Warning" rule is active.
Send a test email from an external account to confirm the banner appears.
After configuring the rule, disconnect from Exchange Online:
Disconnect-ExchangeOnline
Google Workspace provides an automatic external sender warning feature that can be enabled in the Admin Console.
Sign in to Google Admin Console (admin.google.com).
Navigate to Apps > Google Workspace > Gmail > Safety.
Enable “Display a warning when receiving messages from external senders”.
Click Save.
For a more customized approach, administrators can manually create a rule to apply a custom warning message to all external emails.
Sign in to Google Admin Console (admin.google.com).
Navigate to Apps > Google Workspace > Gmail > Compliance.
Scroll to Content Compliance and click Add Rule.
Set Conditions:
Under “Email messages to affect”, choose Inbound.
Under “Expressions”, click Add > Advanced content match.
Choose “Sender” > Does not match your domain (e.g., yourcompany.com
).
Apply Warning Message:
Scroll to “Add custom headers or footers”.
Add this warning message in HTML format:
<div style="background-color: #ffcc00; padding: 10px; font-weight: bold;">
⚠️ WARNING: This email is from an external sender. Do not click links or open attachments unless you trust the sender.
</div>
Click Save, and ensure the rule is active.
Feature | Microsoft 365 | Gmail (Google Workspace) |
---|---|---|
Built-in Warning | ✅ Yes (Manual Rule Required) | ✅ Yes (Admin Console) |
Custom Warning Banner | ✅ Yes (Mail Flow Rules) | ✅ Yes (Compliance Rule) |
PowerShell Automation | ✅ Yes | ❌ No (Google Admin Only) |
Trusted Senders Exclusion | ✅ Yes | ✅ Yes |
HTML Formatting | ✅ Yes | ✅ Yes |
Implementing an External Email Warning Banner in Microsoft 365 and Gmail is a simple yet powerful way to protect your organization against phishing and spoofing attacks. Whether you prefer manual configuration or automated deployment, these solutions help employees stay alert when interacting with external emails. For enhanced security, consider combining this with advanced email filtering and endpoint protection solutions.
Related Reading:
Firewalls Vs. Antivirus: Firewalls and antivirus software are both essential tools in cybersecurity, but they serve different purposes. While firewalls block unauthorized network access, antivirus programs detect and remove malware from your system.
Next-Gen Antivirus: A Modern Security Guide: Next-generation antivirus (NGAV) goes beyond signature-based detection by utilizing cloud technologies, behavioral analysis, and machine learning to offer stronger protection. Discover how NGAV keeps businesses secure.