Multiple Domains on Google Workspace with Exclaimer Cloud Signatures
How to run Exclaimer Cloud Signatures across multiple domains on a single Google Workspace tenant: routing rules, aliases, DMARC and the bits that bite.
Introduction
Google Workspace and Exclaimer Cloud Signatures together give you a centralised email-signature system you can deploy across a company in an afternoon. It gets interesting when one tenant has several email domains (also known as aliases) and you want a different signature per domain: different branding, different disclaimer, different banner.
The walkthrough below shows how to do it. The video covers the same ground with chapter markers if you’d rather watch than read.
Full walkthrough; chapter markers in the YouTube description.
We’re one of the top Exclaimer resellers globally. If you’d rather have us set this up, walk you through a 30-day trial, or sort out discounted licensing, email paul@osh.co.za.
Emailing through Exclaimer
Out of the box, Exclaimer applies the first signature you’ve defined, regardless of which alias you sent the email from. There’s no rule yet to pick a different signature for osh.co.za vs doiing.digital, so everything gets the doiing.digital template.
To fix that, we need to know what your outbound mail actually looks like to Exclaimer, specifically the From: header, so we can write a regular expression to match it. Send a test email from each of your aliases to an external address, then open it in your Sent folder.
In the top-right of the message, click the three dots and choose Show Original.
In the raw message, find the section that shows the From-address Workspace stamped on the email.
For my two aliases, the full lines look like:
From: Paul Ogier <paul@doiing.digital>
From: Paul Ogier <paul@osh.co.za>
Next we turn those lines into a regular expression that matches every user in the company.
Breaking down the regular expression
This is the regex for the osh.co.za domain (test it on regex101):
^From:\s[A-Za-z]+\s[A-Za-z]+(\s[A-Za-z]+)?(\s[A-Za-z]+)?\s<[A-Za-z]+@osh\.co\.za>
Piece by piece:
^: start of the line.From:: literal match. The line has to start with the word From followed by a colon.\s: a single space.[A-Za-z]+: one word of letters (upper or lower case). The+means “keep matching until you hit something that isn’t a letter”, so it stops at the next space.- That pattern repeats:
\s[A-Za-z]+matches the second name. (\s[A-Za-z]+)?(\s[A-Za-z]+)?: two optional extra names (some people have three or four). The?after each group makes it optional.\s<[A-Za-z]+@osh\.co\.za>: a space, then the literal<, the local part of the address, the@, and the domain. The\.escapes the dot, because in regex a bare.matches any character.
Two more examples you can copy-paste:
FirstName.Surname@domain.com (regex101):
^From:\s[A-Za-z]+\s[A-Za-z]+(\s[A-Za-z]+)?(\s[A-Za-z]+)?\s<[A-Za-z]+\.[A-Za-z]+@domain\.com>
FirstNameMiddleNameSurname@domain.com (regex101):
^From:\s[A-Za-z]+\s[A-Za-z]+(\s[A-Za-z]+)?(\s[A-Za-z]+)?\s<[A-Za-z]+@domain\.com>
If your email format doesn’t match any of these, email me on paul@osh.co.za and I’ll build the regex for you.
Setting the content compliance rule
Now wire Workspace up so the regex actually does something.
Go to Apps > Google Workspace > Gmail > Advanced settings in the Admin Console. (If you have Exclaimer already set up, this is the same screen where its existing routing lives.)
Scroll down to Content compliance. With Exclaimer in place you’ll see something like this:
Setting the pattern match
Edit the content compliance rule. After the existing X-ExclaimerHostedSignatures-MessageProcessed expression, add a new expression. Drop your regex into the Regexp field, hit Test expression to confirm it matches your sample From-line, then Save.
Prepend a custom subject
Still on the same rule, configure it to Prepend custom subject. This adds a small marker string to the start of the subject line for any message that matches your regex. Exclaimer will see that marker and use it to pick the right signature.
That’s the Workspace side done. Save everything before you leave the Admin Console.
Exclaimer Cloud rules
Nearly there.
In the Exclaimer portal, hover over the signature you want to fire for the first domain and click Signature Rules.
In the rules panel:
- Toggle Apply this signature on.
- Toggle Only add this signature if the subject contains on, and paste in the custom subject string you prepended in Workspace.
- Toggle Remove this text from the subject on so the recipient never sees the marker; Exclaimer strips it on the way out.
Repeat for every domain. Each one gets: its own regex in Workspace, its own prepended subject, its own Exclaimer signature rule keyed off that subject.
Wrapping up
Wiring multiple aliases on a single Google Workspace tenant to their own Exclaimer signatures isn’t simple, but it is logical. Workspace tags the mail with a marker based on a regex; Exclaimer matches the marker and picks the right template.
Once you’ve proven the pattern, the same technique covers scenarios no out-of-the-box signature system handles: different signatures per department, by surname initial, by mailing list. The matching engine doesn’t care. If you can describe the condition with a regex, you can route a signature to it.
If your setup doesn’t fit neatly into the examples above, email me on paul@osh.co.za and we’ll work out the regex and rule together.