What Xem does
Every managed message carries aFeedback-ID header: <campaign, newsletter or email id>:<team id>:<kind>:xem. Gmail reports a spam rate for each field on its own, so Xem maps the reported IDs back to a workspace. Unknown IDs are ignored.
For the newest day Google has published (each day is acted on once):
Owner and admin emails need
SERVICE_NOTIFICATIONS_ENABLED=true, like other sending alerts. The check runs every 6 hours from the task scheduler because Google publishes each day late.
Without the four GOOGLE_POSTMASTER_* variables, or before a superadmin connects, nothing runs.
Setup
- At postmaster.google.com, add and verify the shared DKIM domain that managed mail is signed with.
- In a Google Cloud project, enable the Gmail Postmaster Tools API.
-
Configure the OAuth consent screen with the scope
https://www.googleapis.com/auth/postmaster.readonlyand publish it to production. While the app is in “Testing”, Google expires refresh tokens after 7 days and the sync stops. -
Create an OAuth client of type Web application. Add the redirect URI
https://<your API host>/api/v1/sending/postmaster/callback. -
Set on the API server and restart it:
-
Signed in as a superadmin, ask the API for Google’s consent link and open it in the browser with the Google account that owns the domain in Postmaster Tools:
The response is
{"url": "..."}. After you approve, Google redirects to the callback, which shows “Google Postmaster Tools is connected”. The link works once and expires after 10 minutes.
