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

Nextcloud address book #1227

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

akhil1508
Copy link

@akhil1508 akhil1508 commented Aug 3, 2023

@akhil1508
Copy link
Author

akhil1508 commented Aug 3, 2023

@the-djmaze Perhaps we can have an option for admins like "Integrate nextcloud contacts fully"

  • If that option is ticked, we disable snappymail PDO contacts and suggestions
  • Along with that we disable the option in the right side menu

The UX will then be very similar to the attachments integration for nextcloud, where you can browse files in your cloud and attach them. Your contacts will be saved into your cloud and you can browse your contacts from your cloud app.

@cm-schl
Copy link

cm-schl commented Aug 4, 2023

Hi,
I'm very happy to see that you've intention to work on this as this would make SnappyMail a lot better when working together with Nextcloud 🙂.
I would be happy to help testing this - when you're at a good point just let me know.

@akhil1508
Copy link
Author

@the-djmaze What do you think about this change?

  • Suggestions come from the plugin for contact suggestions and are handled separately in the main-fabrica hook anyway so no changes there
  • Since IncFrec is the only function used to insert new contacts when an email is sent, I add logic only here to add/update into the cloud address book
  • I choose a uri 'webmail' by default; maybe in the future we can implement as an option for users the choice of address book to save too
  • To disable the contacts UI in snappymail, I add a new parameter called contactsExternal for frontend to understand if external provider or not and method called IsExternal for the address book to announce whether it is internal/external

@cm-schl

@akhil1508 akhil1508 changed the title Draft: Nextcloud address book Nextcloud address book Aug 31, 2023
@cm-schl
Copy link

cm-schl commented Aug 31, 2023

Hi,
sorry I tried to test you changes, but I don't get it to work on my test instance of Nextcloud. A question: what is the best way to get the changes to a working Nextcloud installation with SnappyMail installed? To patch the files manually seams wrong - there is surly a better way 🙂.

  • Disabling the default contacts UI seams ok to me, but somehow the administrator has to be informed about this in the Adminpanel -> Contacts. Otherwise we would create a situation where an Admin sets the flag to activate the contacts UI there and then the Nextcloud plugin overwrites this setting.

  • There should surly exist a option to let the user / admin choose where the contacts get saved. For example a company could use Thunderbird on their computers with for example the addon Cardbook. There you can choose an address book where new contacts should be saved. Therefore also SnappyMail in such a situation would have to use the same address book for this...

@the-djmaze
Copy link
Owner

I will come back later to this. 😉

@stepcellwolf
Copy link

I would love to have this as well. Any solution yet? Let me know if del is needed, testing, dev, anything.

@akhil1508
Copy link
Author

akhil1508 commented Sep 27, 2023

@stepcellwolf I do get back to you, got a bit busy in between.

I mostly need some dev to deal with the points raised by @cm-schl in #1227 (comment)

  • Mainly, let the admin know that this one overrides the main contacts UI and
  • Let the user choose the addressbook from the list of addressbooks in cloud

and ofc some testing..

@the-djmaze
Copy link
Owner

A good example of multiple address books is the people around you.
You ask a friend/colleague/etc. for someone his contact details, and they transfer the data to you and you put it in an address book.

Your phone only has "contacts" and you categorize them by any tag needed (family, friends, coworker, client, etc.)
The need for multiple address books is there, and there's not. Because some people are family & coworker or friend & client.

The biggest issue is GDPR where client data should not leave the building and yet, it is on your phone 😛

To support multiple address books, SnappyMail needs some big changes.
Currently i don't see the benefit vs all coding hours to get something nice.

Maybe someone already has a very bright idea?

@akhil1508
Copy link
Author

akhil1508 commented Oct 3, 2023

To support multiple address books, SnappyMail needs some big changes.
Currently i don't see the benefit vs all coding hours to get something nice.

@the-djmaze We can continue with a single address book but allow nextcloud admins to choose which one to activate(the SnappyMail one or full integration with nextcloud), wdyt?

I have already deployed a patched version if this PR to servers with a good amount of usage and this address book does over-ride the pdo address book of SnappyMail correctly.

@cm-schl
Copy link

cm-schl commented Oct 3, 2023

@the-djmaze We can continue with a single address book but allow nextcloud admins to choose which one to activate(the SnappyMail one or full integration with nextcloud), wdyt?

I too don't see it necessary to support multiple address books 👍.
Having the possibility to choose the destination of "collected addresses" would perfectly integrate into Nextcloud because there is also a automatically generated address book called "last contacted". As said for company use the option to choose the destination would be crucial when having different mail clients following the same logic (saving the new addresses into a specific address book).

Talking from a company perspective I would have to add something: for single users a simple dialog to choose the destination for new contacts would be enough. For an administrator it would be nice to have the possibility to preset this destination address book for all users.
Example: in Thunderbird you can preset this by MCD by a string like "https://<SERVER>/remote.php/dav/addressbooks/users/" + getenv("USERNAME") + "/<ADDRESS_BOOK_NAME>/".
It may be to much at the moment, but i definitely see a use case for larger installs 🙂. Maybe some provider would like to add SnappyMail to its Nextcloud for all users. Then a definition for a default destination would prevent to mess up the "normal" address book of the users with collected addresses...

Signed-off-by: Akhil <akhil@e.email>
@the-djmaze
Copy link
Owner

the-djmaze commented Feb 8, 2024

I just had an epiphany:

Address books like mailbox view.

Left side: all address books (hidden when only 1)
Middle: list of contacts inside the selected book
Right/bottom side: the selected contact (with edit mode active unless read-only)

Options:

  • Create contact in current address book
  • Delete contact from current address book
  • Drag/drop (copy) (multiple) contacts from address book to other (writable) address book
  • Select which address book is the default/main one

URI scope paths:

  • /#/contacts
  • /#/contacts/{address-book-name-uid}
  • /#/contacts/{address-book-name-uid}/{contact-name-uid}

(As /#/mailbox for mail and /#/settings for the settings)

Would that make this PR awesome?

@randolf
Copy link

randolf commented Feb 8, 2024

To support multiple address books, SnappyMail needs some big changes. Currently i don't see the benefit vs all coding hours to get something nice.

If so, then hopefully CardDAV will also be supported so that users of CardDAV servers (e.g., Radicale) can add automatic configuration options into the domain-specific configuration files (like we already do with SMTP and IMAP4 servers).

@the-djmaze
Copy link
Owner

the-djmaze commented Feb 9, 2024

@randolf it already (partially) supports that as seen with the Kolab plugin.
Kolab stores the vcards inside IMAP, see #385

@akhil1508
Copy link
Author

akhil1508 commented Aug 22, 2024

@the-djmaze For me, things are really simplified if this plugin's scope is to be used with:

  1. Nextcloud
  2. Nextcloud Contacts https://github.com/nextcloud/contacts/ which most Nextcloud installations actually do provide

If the nextcloud contacts app is already installed, then there need not be a second UI for contacts in snappymail. See for e.g. Google Drive's UX where in gmail you get recommendations from contacts.google.com but then you manage your contacts in contacts.google.com. Nextcloud Contacts supports multiple addressbooks very well already.

I believe we need to cover the following points and can move forward on this PR:

In the admin settings section:

  • A disclaimer saying that this setting is recommended to be used with nextcloud contacts
  • A setting for admins to disable/enable contacts integration with nextcloud
  • A setting for admins to choose the name and description of the default addressbook for users (this will be created if it doesn't exist)
  • A setting for admins to disable the contacts UI inside snappymail (defaulting to true)

In the personal settings section for contacts:

  • A dropdown setting allowing user to set their preferred nextcloud addressbook to save contacts into

In the main UI:

  • Disable the contacts UI inside snappymail based on admin setting (users will use nextcloud contacts to manage contacts)

@the-djmaze
Copy link
Owner

Good ideas and if changes are required in the SnappyMail core, then we will

@fahim44
Copy link

fahim44 commented Sep 3, 2024

@the-djmaze @akhil1508 this is ready to be reviewed.

@akhil1508
Copy link
Author

@the-djmaze So we have the following functionality now:

  1. Setting for user to choose their addressbook
  2. Settings for admins to set:
  • Default addressbook uri
  • Default Addressbook description
  • Disable inbuilt contacts UI so users can use nextcloud contacts
  • Enable NC addressbook so users' contacts can save to NC contacts
  1. Save contact to NC addressbook on send if it is not a new contact (no duplicates)

cc @fahim44


## Nextcloud Addressbook for recipients

This plugin can let user to choose which nextcloud addressbook to use save recipients. This is opt-in feature (enabled by admin). After admin enable this, user will find a dropdown in his/her SnappyMail's `Contacts` section, containing all his/her addressbook.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fahim44 Could be nice to mention that it works best with Nextcloud Contacts where contacts app is used as the frontend for contacts(browsing, editing etc) and SnappyMail seamlessly integrates with it to provide email autocomplete suggestions when drafting emails (not in this PR) and save emails to Nextcloud Contacts upon sending.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akhil1508 updated the README

NC contacts app is just frontend for contacts & addressbook of NC
server. Nextcloud plugin `auto save recipients on addressbook` feature used to depends on contacts app directly. This commit update that logic.
@fahim44 fahim44 force-pushed the dev/sync-nextcloud-addressbook branch from 7223a19 to cf870df Compare September 5, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants