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

Doesn't support cc or bcc? #98

Open
hkirsman opened this issue Jun 16, 2016 · 26 comments
Open

Doesn't support cc or bcc? #98

hkirsman opened this issue Jun 16, 2016 · 26 comments

Comments

@hkirsman
Copy link

I don't get any e-mails that are in the cc or bcc in the header. When I removed mailhog, cc works. E-mail gets sent properly.

@ian-kent
Copy link
Member

ian-kent commented Jul 7, 2016

It's sort of an oversight...

If it's just a Cc or Bcc header in the SMTP message, this will be ignored entirely since MailHog doesn't attempt to do anything based off the SMTP message body. It only acts on RCPT TO SMTP commands.

Assuming your mail client is sending the RCPT TO commands for each cc/bcc recipient, MailHog should see those recipients (if you check the MailHog log output), but the message only gets returned once via the API, and is only stored once in the storage backend. Strictly speaking, MailHog doesn't store the 'delivery' of a message, it stores the raw incoming SMTP conversation.

The MailHog API should be returning all of the message recipients (e.g. in the .To and .Raw.To fields), but that gets ignored by MailHog UI.

I'm not really sure what expected behaviour would be - it's not something I ever considered, but storing the message only once regardless of the number of recipients naturally fell out of the way MailHog is built.

The obvious options would be storing the message multiple times (one per recipient), or making the information visible in the UI somehow.

How would you like it to work? 😄

@huglester
Copy link

Hello,

I personally used to see all messages. If for example there is 1 recipient and 2x BCC recipients, then I see 3 emails in my inbox. I understand that when testing something, there could be hundrends of emails in the inbox - but I can't see any downsides of this.

Also, if there would appear 'release' button someday, then we could even deliver 1 on these messages (like sometimes customers while testing wanna see how email looks like).

Jaroslav

@hkirsman
Copy link
Author

Well I would like to see all the e-mails otherwise, as a developer, I would be confused why my my app is not working. Which was the case :)

@ian-kent
Copy link
Member

I'm happy to add something, just struggling a bit with how the UI (or API?) would handle that - listing the message multiple times (or, storing it multiple times) could be problematic, e.g. if the recipient list is a few hundred addresses.

The CC/BCC headers should be available in the UI, though they are hidden by default - perhaps making them visible by default instead might help? Or displaying the EHLO/RCPT/MAIL/DATA values somewhere in the UI too?

MailHog was designed as a tool to test the SMTP conversations, which is why each outgoing e-mail is only currently stored/displayed once regardless of the number of recipients. The API and UI are returning data captured from the EHLO/RCPT/MAIL/DATA commands, and just happens to make it available via a UI which looks vaguely like a mail client.

Making it display a single SMTP conversation multiple times (once per recipient) suggests a subtly different use-case to MailHog's original purpose, but not necessarily one we can't support 👍

I don't get any e-mails that are in the cc or bcc in the header. When I removed mailhog, cc works. E-mail gets sent properly.

I'm not sure it's relevant to this, but it just occurred to me - the values of the CC/BCC headers don't actually matter for SMTP delivery, the message is only delivered to the recipients in RCPT commands.

@jankonas
Copy link

The CC/BCC headers should be available in the UI, though they are hidden by default - perhaps making them visible by default instead might help?

How can I configure the UI to show Cc/Bcc headers? I can't find this in the docs.

I am attaching screenshot (made by modifying the page in a browser) how would I like to have Cc/Bcc displayed (in message detail).

Mailhog UI

@ghost
Copy link

ghost commented Mar 29, 2017

I'm having the same issue and would also like to know if there is an option to turn on CC and BCC display in the UI? If so, how? I'm unable to find documentation for this.

@ian-kent
Copy link
Member

@jankonas @eymclueles you can't currently make the UI always display CC/BCC data, but it's there if you click the Show Headers button on the right

I'll update the UI to display CC/BCC headers automatically, which should partially resolve this

@wallevy
Copy link

wallevy commented Jun 12, 2017

@ian-kent Which release can I display the CC/BCC in the Web UI?

@ghost
Copy link

ghost commented Jun 12, 2017

@amymengfan This issue is still open, so I don't think BCC/CC has been implemented yet.

@wallevy
Copy link

wallevy commented Jun 19, 2017

@eymclueles OK, thank you. I will wait, or maybe try to fix it and rebuild the app.

@Lewiscowles1986
Copy link

So long as headers contain CC and BCC (testable via API?), that should be more than sufficient for testing that an email was sent with those headers. The idea of testing a server that is not controllable via application beyond following specification is confusing to me.

@dmsmidt
Copy link

dmsmidt commented Feb 22, 2018

It seems to me that Mailhog also doesn't support BCC only mails (empty TO), has anybody experience with that?

Mail error: 550 Invalid syntax in RCPT command

Error explanation: https://www.inmotionhosting.com/support/email/bounceback-errors/550-invalid-address

This error is coming from the destination server, so there is nothing you or your hosting provider as a sender can do.

@dronavallisrichandra
Copy link

@ian-kent
Could you please provide the steps to enable then CC functionality in Mail trap ?, i don't see show header option ?

@iant-ee
Copy link

iant-ee commented Oct 5, 2018

Conceptually I think of the Mailhog inbox as being the combination of everyone's inbox, so it would make sense to me for messages to show multiple times if they were sent to multiple people.

This limitation of Mailhog has contributed to a serious bug in making it to production in our application. Our application sends some emails with TO, and some with BCC. We've discovered an edge case that can cause it to send an email with the correct TO, but an additional, incorrect BCC. There's no way to spot that by looking at the mail in Mailhog, because it just shows the TO.

@roelmagdaleno
Copy link

I think this BCC functionality doesn't work yet, and is required for my client and me on a dev environment. How can we make this work?

@ghost
Copy link

ghost commented Oct 17, 2018

The code is open source. You could add the BCC functionality and recompile for your purposes if you need it for your environment.

@g13013
Copy link

g13013 commented Jan 31, 2019

I think that the UI exposing the list of the multiple RCPT TO addresses and showing the CC and BCC headers is enough

@latiosu
Copy link

latiosu commented Feb 7, 2019

It seems that BCC and CC email headers do appear when the Show Headers section is open.
Although it is dependent on whether the email client drops the BCC header or not from the message.
For example, Sendmail doesn't drop the BCC header whereas PHPMailer's SMTP client does:

Email sent via Sendmail
sendmail

Email sent via PHPMailer SMTP
phpmailer

So whether the BCC header is sent or not is dependent on the email client's implementation. The reasoning for this can be found in RFC5322 in section 3.6.3 and paragraph about the BCC field.

@g13013
Copy link

g13013 commented Feb 12, 2019

The difference between BCC and CC is that the CC email addresses are included in the email’s MIME (in > the "CC" header field).
BCC addresses do not appear in the MIME source of the email, hence the recipient cannot see the BCC > list. The BCC addresses are, however, passed in "RCPT TO" commands to the SMTP server when sending the email. (and so are the To and CC addresses.)
source: internet

adding RCPT TO list to the UI should be enough

@tyndyll tyndyll added ui and removed question labels Feb 19, 2019
@ParadoxalManiak
Copy link

Any update on this ? I want to see BCCs and CCs from all methods of mailing either in headers or somewhere else. This is a needed feature and it's being asked for since 2016.

@amenk
Copy link

amenk commented Jan 9, 2020

How much effort would it take to implement that? Are there technical complications? Would funding through something like BountySource make sense here?

@eexit
Copy link

eexit commented Dec 28, 2020

See #261

@msde
Copy link

msde commented Oct 6, 2021

I'm concerned that mailhog/data#8 doesn't have visibility since it's not in the main mailhog/MailHog repo. It appears to fix the bcc issue, but I'd prefer to find a way to get support into the official docker images.

@formikaio
Copy link

+1

@RCheesley
Copy link

RCheesley commented Nov 23, 2022

This is a big challenge for us with Mautic - we use Mailhog for our testing images so when users are checking if the correct things are being set by Mautic when emails are being sent, they don't see the BCC or CC fields. Would love to see an implementation :)

@asentner
Copy link

asentner commented Feb 3, 2023

When using symfony/mailer package to send mail, the cc and bcc are not in the headers in mailgun. But using that same library if I send through Mailgun, it shows the cc and bcc in the headers in my Gmail? Any thoughts on that? There may still be a bug here somewhere on the display of the cc and bcc in the headers.

When looking at the logs, two messages are generated however, one for the RCPT TO, and one for the CC. One message is delivered to mailhog, the other remains in the mailer queue. Looking at the raw message in the queue shows the CC in the headers.

I personally like that the CC does not come in to the inbox, that can get annoying after a while but it would be great to see it in the headers. I get it if it's the mailer dropping it, but again, for symfony/mailer that does not seem to be the case.

Hope this helps!

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

No branches or pull requests