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

If using contact groups emails are send to all e-mail adresses of the members #2514

Open
markuswochnik opened this issue Jan 20, 2020 · 11 comments

Comments

@markuswochnik
Copy link

markuswochnik commented Jan 20, 2020

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.

@ChristophWurst
Copy link
Member

I see the problem. But could we detect the "main one"?

@markuswochnik
Copy link
Author

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?

@ChristophWurst
Copy link
Member

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.

👍 on the pref tag. However, as you pointed out it doesn't seem to be used everywhere.

@markuswochnik
Copy link
Author

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?

@markuswochnik
Copy link
Author

There is a long lasting issue in the contacts repo, hast sadly the label "low".
nextcloud/contacts#202

@ChristophWurst
Copy link
Member

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?

@bfritscher
Copy link
Contributor

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.

@ChristophWurst
Copy link
Member

Ai. Thanks for the info.

The data might be present differently if that flag is set. Needs debugging.

@ChristophWurst
Copy link
Member

I don't have time to look into this right now. But if anyone wants to look into this please let me know :)

@bfritscher
Copy link
Contributor

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

@ChristophWurst
Copy link
Member

Nice finding. Mind submitting a PR to server?

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

4 participants