New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Bcc header missing with emails from conductor and test helpers #35992
Conversation
@@ -28,6 +28,9 @@ def new_mail | |||
end | |||
|
|||
def create_inbound_email(mail) | |||
# Bcc header is not encoded by default | |||
mail[:bcc].include_in_headers = true if mail[:bcc] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this line isn't in create_and_extract_message_id!
will that mean Action Mailbox can't capture any BCC fields in emails?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an option we can pass to Mail.new
in new_mail
instead? Besides new_mail
seems like the more suitable place for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look @kaspth!
Since this line isn't in create_and_extract_message_id! will that mean Action Mailbox can't capture any BCC fields in emails?
The only reason this is a problem in these two places is because a Mail
object is initialized and then serialized with to_s
before passing it along, that doesn't occur with the other services afaik since the raw data forwarded by the service is stored without creating a Mail
object first (I only tested with Mailgun which included the Bcc
header correctly).
Is there an option we can pass to Mail.new in new_mail instead? Besides new_mail seems like the more suitable place for this.
The only reference I found to include_in_headers
is within the Bcc
field itself so I don't think it can be passed through Mail.new
. Putting this in new_mail
does seem suitable, I'll update the PR with that change.
@kaspth are there any other changes that I should make to this before it can be merged? |
@rafaelfranca I just rebased and pushed it up. I think the commit you referenced updated tests so if you want me to drop the tests I added as well let me know. |
Fix Bcc header missing with emails from conductor and test helpers
Summary
Bcc
header was not being included with emails created by the actionmailbox conductor or thecreate_inbound_email_from
test helpers. This change marks theBcc
header to be included when the email is encoded in both of those cases, using theinclude_in_headers
features from the mail gem found here