roundcube / roundcubemail

The Roundcube Webmail suite
https://roundcube.net
GNU General Public License v3.0
5.88k stars 1.64k forks source link

Mail headers getting changed after sending mail #7987

Closed rahulnikumbhe closed 3 years ago

rahulnikumbhe commented 3 years ago

while sending mail, if we keep "To" as empty and userids in "Cc" then after sending mail all "Cc" userids gets reflect in "To" and "Cc" headers get removed. any help would be appreciated.

alecpl commented 3 years ago

As intended. Why it would be a problem?

rahulnikumbhe commented 3 years ago

As intended. Why it would be a problem?

we want gmail like behavior. it would be great if we can achieve this. any help would be appreciated.

alecpl commented 3 years ago

Sorry, this works this way since forever. Without a good reason we'll not change that. The code is in https://github.com/roundcube/roundcubemail/blob/18b980cfb1d89ff0360272803ed93559b5f0f61f/program/include/rcmail_sendmail.php#L109

thomascube commented 3 years ago

And what exactly "gmail like behavior"?

Technically there's no difference between To and Cc and thus Roundcube moves all Cc into To if the latter is empty. The result is still the same: all recipients get the message and can see the other recipients. If you intend to send the message to a number of recipient and don't want to disclose the addresses to all, then use Bcc and leave To empty.

mjnewton commented 3 years ago

Technically there's no difference between To and Cc and thus Roundcube moves all Cc into To if the latter is empty.

I consider this behaviour to be wrong. Internal Mail standards have for a long time (eg RFC 733 from 1977 but expanded somewhat less ambiguously by RFC822 in 1982) intended for the To and Cc fields to represent different recipient classes - even if they are handled in technically the same way by the transport system.

Specifically, To: addresses are 'primary' recipients and Cc: addresses are 'secondary (informational)' recipients. A common example of where such differentiation is implemented is in a business setting where To: recipients are expected to action the contents whereas Cc: recipients can regard it as information only.

Automatically moving Cc: addresses into the To: field represents a promotion of class and may not represent what the sender intends/expects. If this action is being taken because of potential issues relating to an empty To: field then it would perhaps be better to pop up a warning saying so and advising the sender puts at least one address (even their own) in the To: field (not dissimilar to how a warning is provided if the Subject: field is left empty.)

Just my 2p worth, and probably overpriced at that. ;-)

alecpl commented 3 years ago

You cannot be secondary if there's no primary. So, I think that from a UX perspective, sending an email with empty To: and non-empty Cc: is wrong. That being said, I don't really care. However, I'm pretty sure we don't need another warning.

ps. Thunderbird does not try to be smart, and happily sends emails with empty To: and non-empty Cc:.

mjnewton commented 3 years ago

I think that from a UX perspective, sending an email with empty To: and non-empty Cc: is wrong.

Completely agree, and it wouldn't surprise me if some sensitive spam filters might raise an eyebrow too.

Whilst I might not have reached the bar of a 'good reason' to change the behaviour I just wanted to point out that To: and Cc: recipients are (or at least can be) different and why silently changing one to another might be less than desirable - even if you're only doing it in a very specific case.

That being said, I don't really care. However, I'm pretty sure we don't need another warning.

I think we all need protecting from ourselves sometimes when doing something we might not be intending to do, and I personally would prefer a warning rather than a silent unexpected modification of my message. The lesser of two evils you could say.

ps. Thunderbird does not try to be smart, and happily sends emails with empty To: and non-empty Cc:.

Sounds reasonable. You're often on a hiding to nothing second-guessing user's intent.