An 11-person insurance brokerage called us after a near miss. Someone in accounts received a message that read exactly like a client, asking for the next payment to go to a different bank account. It was caught because that person picked up the phone, not because anything in the mail system stopped it. The owner's reaction is the one we hear every time: turn on whatever blocks this.
Google Workspace has three settings that can refuse, hold or mark a message on the way in or out: Attachment compliance, Content compliance and Objectionable content. All three sit in the Admin console under Apps, then Google Workspace, then Gmail, then Compliance. They work, and they are also the fastest way we have seen a small business break its own mail. A rule written in five minutes on a Friday is still quietly rejecting a client's quotes in March, and by then nobody remembers it exists. We treat this as a design job, not a reaction to the last scare.
Start with what Gmail already does, before you write a rule
Every message is scanned for malware whatever you configure, and a published list of file types is refused outright, renamed or zipped. We covered the bounce that produces, 552 5.7.0, on its own.
Above that floor sits the Safety section, under Apps, then Google Workspace, then Gmail, then Safety. It holds detection you could not write yourself: encrypted attachments that cannot be scanned, attachment types that are uncommon for your domain, links and external images, and spoofing and authentication checks. For these, the default action Google lists is to keep the message in the inbox and show a warning, and you can escalate a setting to spam or to quarantine instead. The same page notes that new recommended settings for links or for spoofing and authentication are turned on by default (checked 18 November 2026).
Two things follow. Most of what the brokerage owner wanted was already running, and these toggles are the cheapest protection you will configure, because there is no pattern to maintain and no false positive that is yours.
Attachment, content or objectionable: which setting you actually need
The three compliance settings are not interchangeable, and the real difference is what each one can see. Pick the row that matches the thing you are trying to catch, not the one with the strongest-sounding name.
| Setting | What it matches on | What it will not do | When we use it |
|---|---|---|---|
| Attachment compliance | File type, name, size or format of an attachment | Read inside a password-protected file or archive | Inbound file types this business never legitimately receives |
| Content compliance, simple match | Words and phrases, behaving like a Gmail search | Match an exact string; word order and extra matches are not under your control | A first look at traffic, never as the final rule |
| Content compliance, advanced match | An exact string in a part of the message you choose, including text pulled out of attachments | Evaluate several recipients at once, it compares one at a time | A known pattern: an account-number format, a document footer, a specific sender |
| Objectionable content | Single complete words from a list, not case sensitive, in subject, body and text attachments | Match part of a word, or a bracketed term, without a regular expression | A short list of words that must never leave the domain |
| Safety settings | Gmail's own signals: encrypted and uncommon attachments, links, spoofing | Anything you define yourself | Always, before any rule you write |
One constraint decides several rules for you. Google's documentation says most advanced Gmail settings, Content compliance, Objectionable content and Attachment compliance among them, apply to users and not to mailing lists. If your support or billing address is a Google Group, a rule aimed at it will not fire the way you expect, and the group's own settings are where to fix it.
The rules we set on a small business tenant
Four, usually. Not a wall of them.
- Inbound attachment compliance on the file types this business never receives. For a brokerage, that is installers, disk images and script files. Executable types are refused automatically, so the value here is the long tail. If you enter custom extensions, separate them with commas and tick the option to also match files based on file format; without it the match is on the filename only, and a renamed file walks straight through.
- One outbound content compliance rule for the pattern that would actually hurt. Advanced match, on a client-file naming convention or an account-number format. For the first month the action is to add a custom header, not to reject. That gives you something searchable and no angry phone calls while you learn how often it fires.
- An inbound rule that marks payment-change language from outside the domain. Content compliance, scoped to inbound only with the envelope filter set to external senders, and the action is to prepend a short prefix to the subject. The person reading the message sees the warning before they read the request. We do not reject here, because the same wording turns up in real mail.
- A short objectionable content list, with a date to re-read it. Matching is on single complete words and is not case sensitive, across subject, body and text attachments. A rule for one word does not catch a longer word that contains it, and a term inside square brackets is not supported directly: Google's page gives a regular expression such as
(?i)\[(BAD)\]for that case. Changes to this setting can take up to an hour to apply, so test it, then wait before you decide it does not work.
What we do not set: a broad keyword list that rejects, a filename-only block presented to the owner as security, and anything built on predefined detectors before we have checked the edition. Those detectors, the credit-card and identity-number patterns, are edition-gated: Google's page on data loss prevention for Gmail lists which editions include them, and Enterprise Standard and Enterprise Plus are the two every version of that page agrees on, so read it against your own plan first.
Pick the action before you write the pattern
This is the step that gets skipped, and it decides whether the rule is safe. Each rule ends in one of three outcomes.
Reject refuses the message. Google's documentation is explicit that when a reject rule matches, no other routing or compliance rules are applied, and Gmail adds an SMTP rejection code such as 550 5.7.1. The sender sees either a default line, along the lines of the message being rejected due to a policy associated with the sender, or the custom text you typed when you created the rule. Write that text. A bounce that says what to do next is the difference between a client phoning you and a client giving up.
A custom rule is identifiable in the bounce itself. Google's SMTP errors page shows the shape of it:
550 5.7.1 This message violates example.com email policy.
- gcdp <sessionid> - gsmtp
Quarantine holds the message for a person to decide. Only a super administrator can create a quarantine, under Apps, then Google Workspace, then Gmail, then Manage quarantines, and your account already has a default one that catches anything a rule does not name explicitly. The deadline nobody plans for: a quarantined message with no decision is permanently deleted after 30 days, and after that neither an admin nor the user can recover it, unless the message is also held in additional storage such as Vault. If the people who should review it are not super admins, build a custom admin role with the Access Admin Quarantine privilege instead of handing out the top role. We wrote up the review itself, including the release decision you cannot undo.
Modify delivers the message and changes it: a prefix on the subject, a custom header, a different route. For a rule you have just written, this is almost always the right first action, and often the right permanent one.
Whichever you pick, confirm it from a real message rather than from the console. A custom header, or the rejection tag above, tells you which rule fired. The console only tells you which rules exist.
Where these rules quietly do not apply
- Inside password-protected files. Gmail cannot open or inspect a password-protected file or archive, so a content rule cannot see in. The Safety setting for encrypted attachments exists for exactly this gap.
- Past the scanning limits. For converted files over 1 MB, only the first 1 MB is scanned, and files over 10 MB are not converted or scanned at all (checked 18 November 2026).
- On username punctuation. Gmail strips dots and plus signs from usernames during delivery, so an address pattern written with them will not match. Leave them out of the pattern.
- Across multiple recipients. An advanced content match compares one recipient at a time, so a rule meant for a message addressed to several people has to match on full headers instead. Headers and body covers headers, body and attachments with MIME parts decoded; full headers excludes the body and attachments.
What we check in the month after
A compliance rule is a commitment to review it, not a setting you finish. Three things go on a schedule.
Someone opens the quarantine at least twice a week, because the 30-day clock is silent and nothing reminds you. Every rule gets one line in a shared document: who asked for it, what it is for, and the date it should be re-read. And after any change we send a real message down the path the rule covers, from outside the domain, and read the headers when it lands. That last step catches the classic simple-match surprise: simple matching behaves like a Gmail search rather than an exact comparison, so a rule written for a phrase can match messages that only hold those words in another order.
One decision belongs in the same conversation: who can change any of this. Compliance rules need the Gmail settings privilege and quarantines need more, which is a good reason to keep admin roles tight.
How Guanacos Tech helps
We design the rule set with you, write the custom bounce text so a blocked sender knows what to do, keep the first month on quarantine or modify rather than reject, and hand over a one-page record of what each rule does and when to re-read it. If you inherited an account with rules nobody can explain, we start by finding out which ones are firing. That is first-week work for our Google Workspace consultants. Bring your current compliance settings to a 30-minute call and we will tell you which ones are protecting you and which are quietly deleting your mail.
Sources
- Google Workspace Admin Help: Filter messages with attachments (attachment compliance)
- Google Workspace Admin Help: Set up rules for advanced email content filtering (content compliance)
- Google Workspace Admin Help: Objectionable content setting
- Google Workspace Admin Help: Set up email quarantine
- Google Workspace Admin Help: Manage quarantined messages
- Google Workspace Admin Help: Message bounced due to a policy rule
- Google Workspace Admin Help: Gmail SMTP errors and codes
- Google Workspace Admin Help: Advanced phishing and malware protection
- Google Workspace Admin Help: About DLP for Gmail