mail
mail copied to clipboard
If using contact groups emails are send to all e-mail adresses of the members
Hello everyone,
first the facts:
- Nextcloud Version: 17.0.2
- Mail Version: 1.0.0
- Contacts Version: 3.1.6
- Browser: Firefox 72.0.1 on Win 10 Pro 1909
- Server: apache2 hosted on Ubuntu 18.04 with php7.3
Now the problem:
When sending an e-mail to a contact group, the mail will be send to all saved e-mail adresses of the contacts, not only to the main one.
This is kinda critical, because if i want to send to the business adresses to my colleagues, maybe the personal adresses will be leaked too if i saved some of them in the contacts.
Not sure how to debug that better. The contact groups are fine, when i send from thunderbird to the synced contact groups (CardBook) the mail is only send to the main e-mail address.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
I see the problem. But could we detect the "main one"?
In Thunderbird (CardBook) i can set the "preference tag" in the contact menu. So this is a thing that carddav can handle, in the VCARD there is "type=pref"
EMAIL;type=INTERNET;type=WORK;type=pref:[email protected] EMAIL;type=INTERNET;type=HOME:[email protected]
But currently as i see the contacts app doesn't have the option to define which e-mail is main. Maybe @skjnldsv has an idea to solve this.
For the mail app there could be a limit kind of "one mail per contact" and somewhere should be documented that always the "first" e-mail top-down would be chosen?
For the mail app there could be a limit kind of "one mail per contact" and somewhere should be documented that always the "first" e-mail top-down would be chosen?
But how would you know what the "first" contact is. You could only tell this from the vcard. But any UI might sort the addresses in different orders, hence it's anything but clear.
:+1: on the pref tag. However, as you pointed out it doesn't seem to be used everywhere.
Maybe something like this as a first step: "IF pref-tag=true THEN one-email ELSE all other e-mail addresses too"
And the contacts team could as second part implement the button that you can set this for your contacts?
There is a long lasting issue in the contacts repo, hast sadly the label "low". https://github.com/nextcloud/contacts/issues/202
Maybe something like this as a first step: "IF pref-tag=true THEN one-email ELSE all other e-mail addresses too"
And the contacts team could as second part implement the button that you can set this for your contacts?
That makes a lot of sense! @bfritscher do you remember if we have access to that property?
I only created and tested with the contacts app. So in my tests I received either one string or an array of string, which contained the emails. No guarantee that the first is the preferred one.
Ai. Thanks for the info.
The data might be present differently if that flag is set. Needs debugging.
I don't have time to look into this right now. But if anyone wants to look into this please let me know :)
I had a look and found https://github.com/nextcloud/server/blob/12bdb95c1a40170652570decef7f466e4b97aa65/apps/dav/lib/CardDAV/AddressBookImpl.php#L117
So currently as long as we don't pass ['types' => true] to contactManger->search we receive only emails. So at least there is no bug.
But this means that vCard2Array https://github.com/nextcloud/server/blob/12bdb95c1a40170652570decef7f466e4b97aa65/apps/dav/lib/CardDAV/AddressBookImpl.php#L247
has to be changed to support the pref tag, then we can change the group integration code. Also Pref is an integer 1 to 100 https://tools.ietf.org/html/rfc6350#section-5.3
Nice finding. Mind submitting a PR to server?