Users are encountering an ActionController::InvalidAuthenticityToken error when sending POST requests to the /webhooks/mailgun endpoint, resulting in HTTP 422 responses. This issue, first noticed around mid-May, occurs even on fresh installations without plugins. Wolftallemo confirmed the Mailgun API key is valid and doubts it’s the root cause, noting that invalid keys shouldn’t trigger CSRF errors. znedw reported a similar issue with AWS webhooks on build 99b0578b4ce. The issue was resolved via a pull request from Wolftallemo, which was merged by david with additional commit details available at https://github.com/discourse/discourse/commit/be556ef17b71bf30c95a4622fa1a792e04887b19.
Any post requests to /webhooks/mailgun are returned an HTTP 422, and the server logs show an ActionController::InvalidAuthenticityToken error. This was tested on a new installation with no plugins.