All emails skipped with reason [Sender] 553, when update to 1.6beta4


(Helperhaps) #1

branch: test-passed

Recently, I installed a plugin. Discourse updated to 1.6beta4 from beta1 when i rebuild docker. And then, user can not get their emails.

Opened /admin/email/skipped in chrome, i got

[Sender] 553 Mail from must equal authorized user

and in the lib/email/sender.rb:119

if SiteSetting.reply_by_email_address.present? && SiteSetting.reply_by_email_address["+"]
  email_log.bounce_key = SecureRandom.hex

  # WARNING: RFC claims you can not set the Return Path header, this is 100% correct
  # however Rails has special handling for this header and ends up using this value
  # as the Envelope From address so stuff works as expected
  @message.header[:return_path] = SiteSetting.reply_by_email_address.sub("%{reply_key}", "verp-#{email_log.bounce_key}")
end

remove the code listed, email works just well. So what this line use for? what can i do with this?


(Régis Hanol) #2

Is the email you’re using for replies different from the one you use in your POP3 credentials by any chances?


(Helperhaps) #3

It can’t be. As you can see, it works well with 1.6beta1. And it works well with 1.6beta4 while commenting metioned code.

So, that code is a new feature or something?

it is not working as expected :sob:


(Régis Hanol) #4

Can you tell me what you’re using for these site settings

  • reply by email address
  • pop3 polling username

(Helperhaps) #5

So Sorry

JUST TEST in /admin/email ,got Skipped 553

And user can not sign up, because they will not get the activation mail.


(Erick Guan) #6

Return-Path is included in the email. Mailgun is fine with that. But in this case, the email service seems dropping the email. I can’t be sure about this reason. May also related with the support of +address.

I asked @helperhaps for the log. Hope this can be tracked down soon. For the record, the email service appears to be 163. Part of their services don’t respect the +address at all.


(Erick Guan) #7
#<Mail::Message:70296731686780, Multipart: true, 
Headers: <Return-Path: replies+verp-randomkey@jcommunity.cn>,
         <From: 极光社区 <no-reply@jpush.cn>>, 
         <Reply-To: 极光社区 <no-reply@jpush.cn>>, 
         <To: xxxxxxxx@qq.com>, 
         <Message-ID: <1ef9804a-0b0b-4e18-9814-cd095d1dd87d@localhost>>, 
         <Subject: Test Email>, 
         <Mime-Version: 1.0>, 
         <Content-Type: multipart/alternative; boundary=--==_mimepart_5735e648986b3_d53fef468d7e74354d3>, 
         <Auto-Submitted: auto-generated>
>

Return-Path and From have different domain name. I guess Rails didn’t change the domain at all?

POP3 and SMTP seems to be configured in different domains for some historical reasons here.

UPDATE: @helperhaps said removing + appears to solve the problem. I didn’t change the code. Is the information enough for you? Or those site settings are needed?

UPDATE2:

In such additional Return-Path (or verp-) bumps the 553.