discourse/spec
Martin Brennan 632942e697
FIX: Ensure group SMTP and message builder always uses from address for Reply-To when IMAP is enabled (#11037)
There is a site setting reply_by_email_enabled which when combined with reply_by_email_address creates a Reply-To header in emails in the format "test+%{reply_key}@test.com" along with a PostReplyKey record, so when replying Discourse knows where to route the reply.

However this conflicts with the IMAP implementation. Since we are sending the email for a group via SMTP and from their actual email account, we want all replys to go to that email account as well so the IMAP sync job can pick them up and put them in the correct place. So if the group has IMAP enabled and configured, then the reply-to header will be correct.

This PR also makes a further fix to 64b0b50 by using the correct recipient user for the PostReplyKey record. If the post user is used we encounter this error:

if destination.user_id != user.id && !forwarded_reply_key?(destination, user)
  raise ReplyUserNotMatchingError, "post_reply_key.user_id => #{destination.user_id.inspect}, user.id => #{user.id.inspect}"
end
This is because the user above is found from the from_address, but the destination which is the PostReplyKey is made by the post.user, which will be different people.
2020-10-28 07:01:58 +10:00
..
components FIX - don't hide tags if user has correct permissions (#11046) 2020-10-27 14:17:13 -04:00
fabricators FIX: Pass user to Email::Sender to avoid broken reply key for group_smtp email (#10978) 2020-10-22 10:49:08 +10:00
fixtures FIX - don't attempt to optimized animated images (#11031) 2020-10-26 15:10:19 -04:00
helpers Simplify theme and color scheme seeding (#10872) 2020-10-14 10:18:02 -04:00
import_export FEATURE: Rake task to export groups (#9450) 2020-04-17 14:59:54 -07:00
initializers FIX: We need to skip users with associated reviewables when auto-approving (#9080) 2020-03-02 14:33:52 -05:00
integration PERF: we don't need to use a huge image to test thumbnails (#11025) 2020-10-27 12:39:52 +11:00
integrity DEV: Check English locale for errors in CI 2020-06-03 21:54:58 +02:00
jobs FIX: Ensure group SMTP and message builder always uses from address for Reply-To when IMAP is enabled (#11037) 2020-10-28 07:01:58 +10:00
lib FIX - don't attempt to optimized animated images (#11031) 2020-10-26 15:10:19 -04:00
mailers FIX: Ensure group SMTP and message builder always uses from address for Reply-To when IMAP is enabled (#11037) 2020-10-28 07:01:58 +10:00
models FIX: Ensure group SMTP and message builder always uses from address for Reply-To when IMAP is enabled (#11037) 2020-10-28 07:01:58 +10:00
multisite DEV: Clean up S3 specs, stubs, and helpers 2020-09-28 12:02:25 +01:00
requests DEV: Add api docs for invite and group update endpoint (#11019) 2020-10-26 08:55:22 -06:00
script/import_scripts FIX: improve Vanilla importing (#10478) 2020-08-24 16:19:57 -04:00
serializers FIX: Only include last_posted_at if there's a topic_user object. (#11011) 2020-10-23 11:31:59 -03:00
services Simplify theme and color scheme seeding (#10872) 2020-10-14 10:18:02 -04:00
support Tag groups can belong to groups (#10854) 2020-10-14 13:15:54 -04:00
tasks DEV: Clean up S3 specs, stubs, and helpers 2020-09-28 12:02:25 +01:00
views/omniauth_callbacks FEATURE: Use full page redirection for all external auth methods (#8092) 2019-10-08 12:10:43 +01:00
rails_helper.rb DEV: Clean up S3 specs, stubs, and helpers 2020-09-28 12:02:25 +01:00
swagger_helper.rb DEV: Add rswag to aid in api documention (#9546) 2020-04-27 16:40:07 -06:00