Allow other fields that specify recipients, not just "to"#520
Allow other fields that specify recipients, not just "to"#520jc00ke merged 1 commit intosidekiq:masterfrom
Conversation
There was a problem hiding this comment.
Can an email be sent if the to isn't set? Looks like msg.deliver would fire w/ msg.cc or msg.bcc but w/o msg.to
|
Yes, I've tested sending emails through this code without anything but BCC set and it works fine. Also, I get emails all of the time without a to:, just BCC. I also tested sending bcc only emails using my normal email client and they go through fine. Finally, I'm not quite sure why this check is even here. If it returns an error because ActionMailer complains, IMO it shouldn't just fail silently. |
|
SMTP-wise, it's all still RCPT TO:, but "cc" and "to" are actually message headers, which are optional. Check out 7.2 in RFC2821 for more details. |
Allow other fields that specify recipients, not just "to"
|
Looks good to me. Thanks for explaining the |
We had some code that BCCs everyone instead of putting them in the "to:" field. The ActionMailer extension won't actually call the deliver method though unless "to" is specified. This fixes it so that any of the recipient-specifying methods should be delivered.