Configure VERP to handle bouncing e-mails

Setting up bounces handling

Discourse uses the Variable envelope return path (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

replies+%{reply_key}@discourse.example.com

… works fine. If you are using your own or your company’s email server, then, that’s it :tada:

Your discourse instance must be able to receive email sent to this address. This should work via POP, but we highly recommend Direct-delivery incoming email for self-hosted sites

If, however, you are using a third party email service, you will need to enable VERP, or activate their webhooks as follows:

MailGun

  1. Log in to MailGun and go to your dashboard; look in the left column for the Sending → Webhooks page.
  2. Select the Configuration tab and copy the HTTP signing key
  3. In your Discourse site, set the Mailgun API key site setting with your HTTP signing key
  4. Back in Mailgun, click the Add webhook button (selecting Domain-level) and set the HTTP post URL to https://your.discourse/webhooks/mailgun. Test this.
  5. Select both Permanent Failure and Temporary failure, double check the Domain, and then Create Webhook.

SendGrid

  • 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 http://your.discourse/webhooks/sendgrid
  • make sure you selected the following 3 actions: Dropped, Deferred and Bounced
  • save your changes by clicking the :white_check_mark:

MailJet

  • Log in to MailJet and go to event tracking
  • check the bounce event
  • set the endpoint URL to http://your.discourse/webhooks/mailjet
  • check the :white_medium_square: in the group events column
  • click the save button

SparkPost

  • 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. Discourse Forum
  • Enter a Target URL as http://your.discourse/webhooks/sparkpost
  • Select Add Webhook.

Amazon Simple Email Service (AWS SES)

  • On Discourse:
    • set reply by email enabled and reply by email address as per the top of OP
    • set manual polling enabled
  • On AWS:
    • create an SNS Topic
    • create an SNS Subscription for the created Topic as HTTPS pointing to https://your.discourse/webhooks/aws
    • go to SES > Verified Identities, select your site domain, and go to the Notifications tab. Edit your Feedback Notifications. Set the Bounce feedback and Complaint feedback to the SNS Topic you just created

Postmark

  • 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 http://your.discourse/webhooks/postmark
  • Under, Which events should we send?, check Delivery and Spam complaint
  • Scroll down and click Save webhook

Testing Bounces

To ensure that everything is working, do this:

  1. Sign up for a new account on your site with an obviously incorrect email, of the form bademail@obviously-invalid-domain.com or clearly.nobody.has.this.email.address@gmail.com
  2. 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)
  3. Check /admin/email/bounced on 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.

Configuring Bounces

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

Last Reviewed by @SaraDev on 2022-07-19T20:00:00Z

Last edited by @nathank 2026-03-18T23:42:58Z

Check documentPerform check on document:
51개의 좋아요
Does Discourse use Mailgun's validations feature?
VERP bounce replies ignored when using Mailgun
Postmark bounce support?
Email-in replies thread wrongly
Amazon SES/SNS email complaints not received, bounces missing information
Confused about VERP, email bounces & additional setup on Discourse
What mail service do you recommend?
Goodbye Sparkpost
Reply-by-Email was working, now broken
Mailgun "temporarily disabled due to high bounce rate"
"Discourse::NotFound" error when click "Email Type" field on admin/email/bounced
Bounced Email Info Not Found
Fix AWS SNS Bounce
How to block outgoing emails to at anon.forumurl?
Mailgun api key check backward (no API key should be required if bounces handled by mail receiver)
Switching from SMTP to oAuth
Is handling bouncing emails optional, or is it something I definitely need to set up?
Moving from Mailgun to Amazon SES as an amateur
Flush bouncing user mail address
Surface data about users with too many bounces
User Spam - automatic account deletions and domain blacklist
Configure direct-delivery incoming email for self-hosted sites with Mail-Receiver
Mailgun api key, what is it for?
Question about the mail-receiver
Mandrill bounce handling: supported in core but (AFAICT) undocumented
Migrated forum with many invalid (bouncing) emails
Amazon SES API - How to setup?
Zero entries in bounced email list
Email suppression list handling
Email suppression list handling
How hard is it to handle Discourse after installation
Set up mail-receiver, but now site won't send any emails?
Installation by the book
Too many user emails domains not working lead to mailgun domain disabled: what to do?
Mailgun huge dropped subscriber
Configuring AWS SES for outgoing, bounce, and incoming email
Notes on Silencing or Deleting users
Retrying bounced emails?
Discourse Mailgun Routes
"Discourse::NotFound" error when click "Email Type" field on admin/email/bounced
How to deactive account of those users who're not receiving emails
"Discourse::NotFound" error when click "Email Type" field on admin/email/bounced
"Discourse::NotFound" error when click "Email Type" field on admin/email/bounced

누군가 이 내용을 테스트해 보고 정상 작동하는지 확인해 주신다면, 원본 게시물(OP)에 추가하겠습니다.

Mailgun 웹훅 생성


[wrap=placeholder key=“mg_api_key” description=“Mailgun API 키”[/wrap]
[wrap=placeholder key=“mg_region” description=“EU를 사용하는 경우 ‘eu.’ 입력”[/wrap]

for event_type in 'permanent_fail' 'temporary_fail'; do
curl -s --user 'api:'=mg_api_key= \
          https://api=mg_region=.mailgun.net/v3/domains/$discourse_hostname/webhooks \
          -F id="$event_type" \
          -F url="https://=discourse_hostname=/webhooks/mailgun"
done

Mailgun UI가 조금 변경되었으므로 Mailgun 섹션을 업데이트했습니다:

4개의 좋아요

현재 VERP를 사용하여 이메일 클레임을 자동으로 처리하는 간단한 방법이 있을까요? 구독을 해지하지 않고 단순히 이메일을 스팸으로 표시하는 사용자들을 위한 경우입니다. 클레임을 제기한 사람들에게 더 이상 이메일을 보내지 않는 것이 매우 중요합니다.

2개의 좋아요

저급한 스킬을 가진 분들을 위해 참고로 말씀드리면: SES 부분은 제 생각에 상당히 구식입니다.

FIFO가 추천되어도 선택하지 마세요 :man_facepalming:

1개의 좋아요

@pfaffman 님, 공유해 주셔서 감사합니다. 다만 간단한 질문이 있습니다.

위 목록에 없는 다른 이메일 제공사를 사용 중이라면, 그래도 가능한가요?

2개의 좋아요

로그에서 webhooks/mailjet 엔드포인트가 다음과 같은 경고를 생성했습니다:

Mailjet 웹훅을 수신했지만 토큰이 구성되지 않았습니다. 이는 안전하지 않은 동작이며, 향후에는 허용되지 않을 것입니다.

/admin/site_settings/category/email?filter=mailjet 경로에는 “Mailjet webhook token” 필드가 있지만, 이를 올바르게 설정하는 방법에 대한 설명은 없습니다.

저는 https://app.mailjet.com/account/triggers로 이동하여 Endpoint URL 필드에 https://discourse.example.org/webhooks/mailjet?t=[your_token]을 추가했습니다.

그 후 [your_token]을 Token Generator에서 생성한 값으로 교체하고, 동일한 값을 /admin/site_settings/category/email?filter=mailjet의 “Mailjet webhook token” 필드에 입력했습니다.

이렇게 하자 로그 경고가 사라진 것으로 보입니다.

1개의 좋아요

AWS SES의 스팸 불만이 complaints@email-abuse.amazonses.com에서 ‘이메일로 답장 주소’(Discourse 설정 내)로 전송되며, 현재 표준 VERP 구성(SNS 웹훅 없이)을 통해 Discourse에서 하드 바운스로 처리된다는 것을 확인했습니다.

다음과 같은 내용을 발견했는데, SES를 사용하는 분들께 유용할 수 있습니다(‘메일박스 시뮬레이터 사용’ 섹션 참고):

Discourse 관리자 화면의 ‘테스트 이메일 보내기’ 기능을 사용하여 특정 주소로 이메일을 보내면, 발신 평판을 해치지 않으면서 바운스(bounce)나 불만(complaint)과 같은 상황을 시뮬레이션할 수 있습니다.

예:

bounce@simulator.amazonses.com
complaint@simulator.amazonses.com

위 링크에서 다른 테스트 주소도 확인할 수 있습니다.

1개의 좋아요

사정이 조금 더 바뀌어서(더 좋아진 방향으로!) Mailgun 섹션을 업데이트했습니다.

AWS SES 섹션을 편집하여, https://meta.discourse.org/t/how-do-i-configure-aws-sns-topic-arn-allowlist/406853에 설명된 대로 aws_sns_topic_arn_allowlist 매개변수에 SNS 토픽을 추가하는 것이 필수적임을 언급해야 한다고 생각합니다.

2개의 좋아요