Add Multiple Email ...
 
Notifications
Clear all

[Solved] Add Multiple Email addresses to a Distribution List With CLI

3 Posts
2 Users
2 Reactions
253 Views
(@omiazad)
Joined: 5 years ago
Posts: 10
Topic starter  

Hi,
I have 200+ email addresses in a domain. I want to add that specific domain's email addresses to a Distribution list. Can anyone please suggest how can I do that simply without adding one by one in the GUI?

For the record, I have 5 domains added to my Carbonio CE, but i need to add only one domain's emails to a DL not all domain's emails. Hope this is more specific. 


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

@omiazad

Hi,

You can simply do this:

let's say, your domain is example.com and you have a distribution list dl_support@example.com

$ for i in $(carbonio prov -l gaa example.com); do carbonio prov adlm dl_support@example.com $i; echo $i added to the dl_support@oldserver.xyz; done

As it includes everything including the system addresses (spam, ham, virus, galsync, etc.) into the distribution list, you may need to manually remove them from the distribution list to avoid inconveniences. 

 Sample output would be:

zextras@mail:~$ for i in $(carbonio prov -l gaa oldserver.xyz); do carbonio prov adlm dl_support@oldserver.xyz $i; echo $i added to Distribution List dl_support@oldserver.xyz; done
zextras@oldserver.xyz added to Distribution List dl_support@oldserver.xyz
spam.suarp8pz0@oldserver.xyz added to Distribution List dl_support@oldserver.xyz
ham.94bki7e40@oldserver.xyz added to Distribution List dl_support@oldserver.xyz
virus-quarantine.qfqs7tau@oldserver.xyz added to Distribution List dl_support@oldserver.xyz
galsync.ko4i_29rl@oldserver.xyz added to Distribution List dl_support@oldserver.xyz
arman@oldserver.xyz added to Distribution List dl_support@oldserver.xyz
sharif@oldserver.xyz added to Distribution List dl_support@oldserver.xyz
flaminia@oldserver.xyz added to Distribution List dl_support@oldserver.xyz
irene@oldserver.xyz added to Distribution List dl_support@oldserver.xyz
suman@oldserver.xyz added to Distribution List dl_support@oldserver.xyz
zextras@mail:~$

Hope it helps.

Regards,

Sharif


   
omiazad reacted
ReplyQuote
(@omiazad)
Joined: 5 years ago
Posts: 10
Topic starter  

@sharif 

Many thanks for your kind help. 🙏

You made small mistake with the domain name in echo section. But I got it. 🙂


   
ReplyQuote