🤖 Teach your AI coding agent how to send email with Postmark Skills
x
How to process generated email addresses with G Suite (Google Apps) and Postmark | Postmark

How to process generated email addresses with G Suite (Google Apps) and Postmark

If your app generates unique email addresses for each user—like user-123@yourdomain.com—you've probably run into a problem: those addresses don't actually exist as mailboxes, so emails sent to them bounce.

The fix is to use Google Workspace's catch-all routing to funnel all unrecognized addresses into a single real mailbox. From there, you can process them however you need to—whether that's Postmark's Inbound webhook, a custom script, or a Google Group.

This guide walks you through setting it up so emails sent through Postmark (or any other service) land where they're supposed to.

Why generated addresses bounce #

When Postmark delivers an email to anything@yourdomain.com, Google Workspace checks whether that address belongs to a real user, alias, or group. If it doesn't recognize the address, Google rejects the message with a 550 NoSuchUser error before your routing rules ever get a chance to run.

That's the expected behavior. Google is protecting you from spam to nonexistent addresses. But it means you need to explicitly tell Google what to do with mail for addresses it doesn't recognize.

What you'll need #

  • Admin access to your Google Admin console
  • A real mailbox that will act as the catch-all destination (e.g., catchall@yourdomain.com). This can be a regular user account or a Google Group configured to accept external mail.
  • A verified sending domain in Postmark with SPF, DKIM, and DMARC configured

Step 1: Create your catch-all destination #

If you don't already have one, create the mailbox where all unrecognized emails will land.

Option A: A dedicated user account Create a user like catchall@yourdomain.com in your Google Admin console under Directory → Users.

Option B: A Google Group Create a group like catchall@yourdomain.com under Directory → Groups. If you go this route, make sure the group's posting permissions allow External senders—otherwise Google will reject emails from Postmark before the routing rule can process them.

Step 2: Set up the routing rule #

  1. In the Google Admin console, go to Apps → Google Workspace → Gmail → Routing.
  2. In the Routing section, click Configure (or Add another rule if you already have rules).
  3. Give the rule a descriptive name, like "Catch-all routing for generated addresses."
  4. Under Email messages to affect, check both:
    • Inbound
    • Internal - Receiving
  5. Under For the above types of messages, do the following, select Modify message.
  6. Under Headers, check Add X-Gm-Original-To header. This preserves the original recipient address so you can identify which generated address was used.
  7. Under Envelope recipient, check Change envelope recipient, then select Replace recipient and enter your catch-all address (e.g., catchall@yourdomain.com).
  8. Click Show options at the bottom.
  9. Under B. Account types to affect, check:
    • Users
    • Groups
    • Unrecognized / Catch-all
  10. Click Save.

Important: Why you need "Internal - Receiving"

This is the step most people miss. When you've set up DMARC alignment for your sending domain (which you should—here's how), Google Workspace recognizes that Postmark is an authorized sender for your domain. Google then treats these emails as internal traffic rather than inbound. If your routing rule only targets "Inbound" messages, Google will skip right past it for DMARC-authenticated mail and bounce the message. Checking "Internal - Receiving" ensures the catch-all rule applies regardless of how Google classifies the traffic.

Step 3: Handle alias domains #

If you use domain aliases in Google Workspace (e.g., your primary domain is yourdomain.com but you also send to addresses at youralias.io), the routing rule you just created should cover all of them.

However, if you're still seeing bounces on an alias domain after completing Step 2, create a duplicate routing rule specifically scoped to that alias domain. Google Workspace occasionally treats alias domains differently when it comes to catch-all behavior.

Step 4: Verify it works #

Send a test email through Postmark to a nonexistent address on your domain—something like test-12345@yourdomain.com. Then check:

  1. Postmark Activity: Does the message show as "Delivered" (not "Bounced")?
  2. Your catch-all mailbox: Did the email arrive?
  3. The X-Gm-Original-To header: Open the message, view the full headers, and confirm the original generated address is preserved.

If the message still bounces, double-check that:

  • Your routing rule includes both Inbound and Internal - Receiving
  • Unrecognized / Catch-all is checked under Account types to affect
  • Your catch-all destination (if it's a Google Group) allows external posting

Step 5: Process the emails #

Once emails are flowing to your catch-all, you have a few options for processing them:

Use Postmark's Inbound processing Set up an Inbound webhook and forward your catch-all mailbox to your Postmark Inbound address. Postmark will parse each message and POST the details (including the original recipient from the X-Gm-Original-To header) to your app's webhook URL.

Process directly in Google Workspace Use Google Apps Script or a connected service to monitor the catch-all mailbox, read the X-Gm-Original-To header, and route messages accordingly within your app logic.

Troubleshooting #

Emails bounce with 550 NoSuchUser This almost always means Google is rejecting the recipient at the SMTP gateway before your routing rule runs. Verify that your rule's "Account types to affect" includes Unrecognized / Catch-all, and that you've checked Internal - Receiving in addition to Inbound.

Routing works from Gmail but not from Postmark If you can send to a generated address from a personal Gmail account and it arrives, but the same address bounces when sent through Postmark, the issue is likely DMARC classification. Postmark sends with proper DMARC alignment, which causes Google to treat the message as internal. Add Internal - Receiving to your rule.

Alias domain bounces but primary domain works Try creating a separate routing rule scoped to the alias domain. Also confirm that if your catch-all is a Google Group, external posting is enabled.

Messages arrive but the original address is lost Make sure Add X-Gm-Original-To header is checked in your routing rule. Without it, the envelope recipient gets rewritten and you lose track of which generated address was originally used.

 

Ka Wai Cheung

Ka Wai Cheung

Ka Wai is the creator and co-founder of DoneDone, an issue tracking and customer support tool, and the author of The Developer's Code, a book on the lessons he's learned since he began writing code in the late 90s. A midwesterner at heart, he currently lives in San Francisco with his wife and two kids.