Bulk import certain...
 
Notifications
Clear all

Bulk import certain contacts from internal directory to address book

4 Posts
2 Users
0 Reactions
216 Views
(@jolmir)
Joined: 10 years ago
Posts: 18
Topic starter  

Sorry, I'm using Google Translate. I have Carbonio Core 23.11.0 installed with more than 1,200 accounts. A user asks me to create an address book called Directors with 12 contacts and another one named Personal with the rest. The question is, which one would be the best? way to create the address book and add the email addresses from the GAL from the CLI, via the website I could not find how to do it other than creating each contact but, I ensure that they are internal contacts of the own domain, thanks in advance


   
Quote
(@sharif)
Admin
Joined: 2 years ago
Posts: 591
 

@jolmir

Hi,

You can take a look at this script.You can use it be slightly modifying it or use some specific command from the script.

Remarks:

Fix the permission before executing it.
Make sure you are executing it as zextras user.

#!/bin/bash

# Define user email
USER_EMAIL="user@example.com"

# Create Address Books
zmmailbox -z -m $USER_EMAIL cf /Directors
zmmailbox -z -m $USER_EMAIL cf /Personal

# Add Directors Contacts
zmmailbox -z -m $USER_EMAIL cct /Directors "Director1" email=director1@example.com
zmmailbox -z -m $USER_EMAIL cct /Directors "Director2" email=director2@example.com
zmmailbox -z -m $USER_EMAIL cct /Directors "Director3" email=director3@example.com
zmmailbox -z -m $USER_EMAIL cct /Directors "Director4" email=director4@example.com
zmmailbox -z -m $USER_EMAIL cct /Directors "Director5" email=director5@example.com
zmmailbox -z -m $USER_EMAIL cct /Directors "Director6" email=director6@example.com
zmmailbox -z -m $USER_EMAIL cct /Directors "Director7" email=director7@example.com
zmmailbox -z -m $USER_EMAIL cct /Directors "Director8" email=director8@example.com
zmmailbox -z -m $USER_EMAIL cct /Directors "Director9" email=director9@example.com
zmmailbox -z -m $USER_EMAIL cct /Directors "Director10" email=director10@example.com
zmmailbox -z -m $USER_EMAIL cct /Directors "Director11" email=director11@example.com
zmmailbox -z -m $USER_EMAIL cct /Directors "Director12" email=director12@example.com


# Export all contacts
zmmailbox -z -m $USER_EMAIL gaf > all_contacts.csv

#Manually edit CSV file (all_contacts.csv) to remove the 12 directors' contacts

# Now Import remaining contacts to Personal Address Book
zmmailbox -z -m $USER_EMAIL ict /Personal personal_contacts.csv

 

Let us know if it helps.

Regards,

Sharif

This post was modified 5 months ago by Md. Shariful Islam

   
ReplyQuote
(@jolmir)
Joined: 10 years ago
Posts: 18
Topic starter  

excellent thanks
Now I have a question, can I send an email to an entire address book? Or would I have to do the same process but instead of an address book it would be to enter the contacts into a distribution list?


   
ReplyQuote
(@sharif)
Admin
Joined: 2 years ago
Posts: 591
 

@jolmir 

Hi,

Thank s for your followup question.

But if you look closely, address books are just a name; not a fully formed email address just like distribution list or personal contact group. Therefore, your composer will not accept the name of the address book as a To: address.

In that case, either you can create a Distribution List/Personal contact group to send the email.

But do not restrict your creativity and imagination to my answer.

Feel free to try and test to achieve what you are looking for.

Regards,

Sharif


   
ReplyQuote