-
Notifications
You must be signed in to change notification settings - Fork 22
Add support for BCC #8
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
base: master
Are you sure you want to change the base?
Conversation
I built a docker image as a preview with the cc/bcc support added by this pull requests. You can find it at delbertooo/mailhog-bcc. |
I needed exactly this yesterday, and the supplied docker image worked as expected. |
Hello, can this be merged please ? it is very much needed 😞 |
Another +1 for merging this, or else doing something else like it. The current behaviour of ignoring bcc can very easily be mistaken for a bug on the mail sender's side. I had to do a little digging to realise that we were setting the bcc correctly, it just doesn't show up in mailhog. |
Please merge this. As a developer, this is a very useful feature. |
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.
LGTM: code and functional review
Hi, the TO and CC parts are shown in the headers. IMO the BCC should not be shown in the headers unless the sending server explicitly sent it as a header. Here is why: If the sending server is sending BCC as a header that is technically wrong or at least unusual. It's wrong(ish) because the receiver could simply inspect the mail source (e.g. in Gmail or Thunderbird) and see which people were receiving BCC. This invalidates the whole purpose of BCC.
From this debugging perspective, I would rather not like to see a somehow modified version of the source parts of the original email. But I'm open to further discussions on this point. |
@delbertooo Thanks a lot for the explanation. I agree with you |
As mailhog is primarily a debugging tool we want to validate the correctness of bcc and cc as well.
See #98, #261
Possible solutions
Duplicating emails won't help debugging and may make it even worse. So we went for the "show in preview" option.
Implementation
Bcc should not be contained in the mail source. Otherwise it wouldn't be a "blind" copy as the recipients could see the blind copy recipients. Every recipient (to, cc, bcc) should be part of the
RCPT
though. So from my understanding and the insight of this Mailtrap article bcc should beallRecipients - to - cc
. This calculated bcc is what I implemented and added to theMessage
struct.On the GUI side I decided to follow the suggestion of
jankonas and show cc and bcc alongside with "from" and "subject". Cc and bcc are only shown if they have content. This way the user can easily debug who should've received the mail.