Skip to content
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

add_bcc_recipient #146

Closed
Mask-K opened this issue Nov 23, 2023 · 8 comments
Closed

add_bcc_recipient #146

Mask-K opened this issue Nov 23, 2023 · 8 comments

Comments

@Mask-K
Copy link

Mask-K commented Nov 23, 2023

so I'm trying to send a message to several users like this:

msg->add_bcc_recipient(mailio::mail_address("Customer", recipient1));
msg->add_bcc_recipient(mailio::mail_address("Customer", recipient2));

but the problem is that recipients can see each others email addresses. Checked on gmail and outlook

@karastojko
Copy link
Owner

Let me debug it.

@karastojko
Copy link
Owner

I am not able to reproduce it. Can you please give me the full example with the mangled sensitive data?

@Mask-K
Copy link
Author

Mask-K commented Nov 27, 2023

  auto msg = std::make_shared<mailio::message>();
  msg->header_codec(mailio::message::header_codec_t::BASE64);
  msg->from(mailio::mail_address("My name", m_config->smtp->email));
  msg->content_transfer_encoding(mailio::mime::content_transfer_encoding_t::QUOTED_PRINTABLE);
  msg->content_type(mailio::message::media_type_t::TEXT, "html", "utf-8");
  msg->add_bcc_recipient(mailio::mail_address("Customer", "mail1@gmail.com"));
  msg->add_bcc_recipient(mailio::mail_address("Customer", "mail2@gmail.com"));
  msg->add_bcc_recipient(mailio::mail_address("Customer", "mail3@gmail.com"));


  msg->subject("New goods in the store!");
  msg->content("");
  m_connection->submit(*msg);

image

@karastojko
Copy link
Owner

Thanks @Mask-K for the example, I was able to reproduce it.

Can you please try the quick fix and let me know does it work for you?

@Mask-K
Copy link
Author

Mask-K commented Nov 28, 2023

image
Yep, that works!
But is there a way for each user to see his email in field to whom and not see other users'?

@karastojko
Copy link
Owner

I think mailio could be changed in that way, but I believe it would be against the specification. I will check for that, also I am not sure whether the undisclosed-recipients is specified.

@karastojko
Copy link
Owner

The RFC 5322/3.6.3 allows that the Bcc users see their own addresses in the Bcc field (others are hidden of course). The To and Cc recipients remain where they are. Is it acceptable to you?

@karastojko
Copy link
Owner

Fixed with the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants