Gmail – How to setup a catch all email address in Gmail Google Apps that works the same as the old catch-all feature

gmailgoogle-apps

Google Apps for Domains used to have a catch-all feature. Now the docs say:

If you’re using another G Suite edition, the Email routing setting with the Route to catch-all address control is no longer supported. Instead, you use the Routing setting to configure catch-all addresses and routing.

but they don't actually have any instructions on how to do it.

Specifically I want to replicate the old behavior which is that if someone sends a message to unknownname@mydomain.com it gets forwarded to catchall@mydomain.com in such a way that catchall@mydomain.com can setup accounts in Gmail and can reply to the messages as unknownname@mydomain.com.

If I check my legacy Google Apps for Your Domain emails and check the headers of a message sent to unknownname@mylegacydomain.com I see absolutely nothing in the header that suggests it was forwarded to catchall@mylegacydomain.com and yet the mails show up in the inbox for catchall@mylegacydomain.com. This is important because when I reply, if I've added the unknownname@mylegacydomain.com to my accounts under Settings>Accounts->Send Mail As… then I'm able to reply as unknownname@mylegacydomain.com and not as catchall@mylegacydomain.com. For this to continue to work I assume the mail still has to be marked as to: unknownname@mylegacydomain.com and not to: catchall@mylegacydomain.com.

Best Answer

This is just a guess but,

Under Apps > G Suite > Settings for GMail > Advanced Settings I added picked "Add Setting" with the following settings

  1. Specify envelope recipients to match: All Recipients
  2. If the envelope recipient matches the above, do the following

    • Modify message
    Headers
    • Add X-Gm-Original-To header
    Envelope recipient
    • catchall @ existing-domain
  3. Options

    • Perform this action only on non-recognized addresses

and it kind of works although it leaks catchall@mydomain.com when replying with the following headers

spf=pass (google.com: domain of catchall@mydomain.com designates ????:????:????:????::???? as permitted sender) smtp.mailfrom=catchall@mydomain.com
Return-Path: <catchall@mydomain.com>
Received: from mail-yb0-x22e.google.com (mail-yb0-x22e.google.com. [????:????:????:????::????])
        by mx.google.com with ESMTPS id y66si667532ybc.27.2017.06.15.00.51.39
        for <test@otherdomain.com>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 15 Jun 2017 00:51:39 -0700 (PDT)
Received-SPF: pass (google.com: domain of catchall@mydomain.com designates ????:????:????:????::???? as permitted sender) client-ip=????:????:????:????::????;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@mydomain-com.20150623.gappssmtp.com header.b=aFbgG/RI;
       spf=pass (google.com: domain of catchall@mydomain.com designates ????:????:????:????::???? as permitted sender) smtp.mailfrom=catchall@mydomain.com
...
From: Admin <unknownname@mydomain.com>
To: Test <test@othermain.com>

which I'd like to avoid