Setting up bounces handling
Discourse uses the VERP technique to handle bouncing e-mails.
To enable VERP, set the “
reply by email address” site setting with an email address template that uses the + sign. The default of
… works fine. If you are using your own or your company’s email server, then, that’s it
If, however, you are using a third party email service, you will need to enable VERP, or activate their webhooks as follows:
- Log in to MailGun and go to your dashboard; look in the left column for the Settings → Security & Users page. Then go to the API Security tab.
- In Discourse, set the
mailgun api keysite setting with your HTTP webhook signing key
- Go to the MailGun sending domains list and click the one your Discourse instance is using
- Expand the “Sending” navigation by clicking the disclosure triangle next to it (if it’s not already expanded), then click the Webhooks item in the left navigation
- Click the “Add Webhook” button, set the “Event Type” menu to “Permanent Failure”, and set the URL to
- Repeat the “Add Webhook” portion, choosing “Temporary Failure” as the “Event Type”
- Log in to SendGrid and go to Mail Settings
- expand the Event Webhook setting and enable it if it isn’t already
- click edit to set the HTTP POST URL to
- make sure you selected the following 3 actions:
- save your changes by clicking the
- Log in to MailJet and go to event tracking
- check the bounce event
- set the endpoint URL to
- check the in the group events column
- click the save button
- Login to SparkPost and go to your dashboard.
- Select Account from left menu icons
- Select Webhooks from menu ( SparkPost )
- Select New Webhook.
- Enter a friendly value for Webhook Name e.g.
- Enter a Target URL as
- Select Add Webhook.
- Configure Discourse for VERP, as described at the top of this post
- Log in to the AWS console, and go to Simple Email Service (SES)
- Under Domains, find the one you use for your forum, and click it
- Under the Notifications section, click “Edit Configuration”
- All of the SNS settings can be set to “No SNS Topic”
- Under “Email Feedback Forwarding”, choose Enabled
- Save Config
- Login to Postmark and then select the server that is used for sending Discourse emails
- Select the message stream associated with Discourse emails, typically Default Transactional Stream
- Click Webhooks
- Click Add webhook
- Enter Webhook URL as
- Under, Which events should we send?, check Delivery and Spam complaint
- Scroll down and click Save webhook
To ensure that everything is working, do this:
- Sign up for a new account on your site with an obviously incorrect email, of the form
- Wait a while for the emails to fully bounce (check your provider’s logs, if you want – they will usually be shown under the “warn” or “error” log level)
/admin/email/bouncedon your site to confirm that the bounce was picked up. Bear in mind this may take up to 48 hours depending on how many retries and the particular logic of your email provider.
Bounces handling can be customized using these site settings
- soft bounce score: points added to the user’s “bounce score” when we receive a temporary bounce from their email address
- hard bounce score: points added to the user’s “bounce score” when we receive a permanent (or unknown) bounce from their email address
- reset bounce score after days: number of days during which we must receive no bounce before we can reset the user’s “bounce score” back to 0
- bounce score threshold: score threshold at which point we will stop sending non urgent emails to the user