Allow reply-to individual instead of topic/forum (mailing list feature)

Thanks Tarek!

Can you remove the reply all button change?

My second point is just that there is no reply to sender functionality. If I were to hit reply it would go to discourse, not directly to the sender by email, bypassing diacourse. Make sense?

try editing this file:

https://github.com/tareko/discourse-replyto-individual/blob/master/config/locales/client.en.yml

thanks, tarek! what about the second point? if I’m right then there’s no need for me even to have this plugin turned on. Mailing list mode seems to not be affected.

I’ll watch it for a few days and let you know what happens. :rocket:

I’m not sure how that comes to pass for you. For me, obviously it works as advertised. Did you perhaps not enable the plugin? settings > plugins > replyto-individual enabled

yep - it’s enabled.

does the plugin work with mailing list mode turned on?

Yes. Not sure what’s happening on your installation there.

ok - we’ll let it play out for a few days. it’s a quiet, new forum and there haven’t been any posts since I enabled your plugin.

I did update just now to change them as follows - but the topic button still says “reply all” not “reply”.

Hello all,

For those using this plugin, it is currently known to be broken. I’m working on fixing it at the moment.

4 Likes

Did it break a while ago, or did 2.1.2 break it? Wondering if I should hold off upgrading.

It broke in ~ August. It’s now fixed, so go ahead.

The plugin is now working again. Here’s the issue if for some reason one is bored and interested:

https://github.com/tareko/discourse-replyto-individual/issues/1

1 Like

I spoke too soon about this bug being fixed. For some reason, I cannot get a “Reply-To” header added into my email properly.

The current lines in question are these:

      if allow_reply_by_email?
        result[ALLOW_REPLY_BY_EMAIL_HEADER] = true
        if @opts[:private_reply] == true
          result['Reply-To'] = reply_by_email_address
        else
          p = Post.find_by_id @opts[:post_id]
          result['Reply-To'] = "#{p.user.name} <#{p.user.email}>"
          result['CC'] = reply_by_email_address
        end
      else
        result['Reply-To'] = from_value
end

This section is taken from the Email::MessageBuilder class.

If I leave the Reply-To set to its default ( reply_by_email_address), then all is well. However, if it is set to anything else (even “test@test.com”, then it will simply disappear from the end email headers. Similarly, if I replace Reply-To with something else like CC, then for some reason it does not build, and instead displays: replies+%{reply_key}@emlondon.ca (note, the %{reply_key} is correctly fixed in the Reply-To.

I really have no idea a) why this behaviour is happening; and b) Why it’s happening now after working for so long - what am I missing here in the API?

1 Like

I managed to fix the problem with the reply_key not being substituted using this commit, which modifies the set_reply_key method in the Email::Sender class. However, I still can’t figure out why Reply-To becomes null when I change it to anything but ‘reply_by_email_address’. It is set correctly at the end of the header_args method, but I can’t figure out where it is unset.

Any thoughts? I think @featheredtoast is the staff member I see with the most recent edits to Email::MessageBuilder

Edit: After some debugging, this appears to happen somewhere in lib/mail/sender.rb before line 86, though not sure exactly where…

Edit #2: After further debugging, I found the problem to be the following line in the Email::Sender::set_reply_key method:

      @message.header['Reply-To'] =
        header_value('Reply-To').gsub!("%{reply_key}", reply_key)

This method was causing a Reply-To without a reply_key to be wiped. I added a simple if statement to exclude the function if there was no “reply_key” in it. As of this moment, the plugin is back to fully working status.

1 Like

I suppose a recent Discourse upgrade broke the plugin. replies-xyz@example.com is no longer being cc’ed. I created an issue.

Apologies for the delay seeing this - I haven’t gotten notifications for some reason. I’ll follow this up on the github.

1 Like

This is now fixed in the github. The essence is that there were some changes in the way message_builder.rb and sender.rb did their thing that killed the plugins’ changes. For one, gsub! was used instead of gsub for reply_key replacement, which killed the ‘to’ header. Also, for some reason CC was getting killed by self.custom_headers for being 2 characters. Maybe a security feature somewhere? But I disabled it to get the module working. New version is on github. Thanks for the bug reporting!

1 Like