In this tutorial, How do I use zimbra add account to distribution list by bash script. I’m written bash script for add account to distribution list.
You may reading link as below:
- zimbra some service are not running
- How to install and configure zimbra multi server
- How to Restrict Sending to Distribution list in zimbra mail
Zimbra add account to distribution list
The syntax, create distribution lists command line from root accountsu - zimbra -c "zmprov adlm [email protected] [email protected]"
My bash script for zimbra add account to distribution list as below:
#!/bin/bash#Author: HuuPV#Add member to DLecho -n "Input distribute name, pls (Ex: [email protected]): "read DLecho -n "Input account add to distribute name, pls (Ex: [email protected]): "read ACCheck_Member_DL=$(su - zimbra -c "zmprov gdl $DL | grep '\b$AC'")if [ $? == 0 ]thenecho "$AC member exists in $DL"elseecho "Add member $AC to $DL Distribute List"su - zimbra -c "zmprov adlm $DL $AC"fi
The result, running bash script from root account
Conclusion
Thought the article, To help you can auto add account to distribution list from bash script. If you any question then comment below.Thanks for reading How to zimbra add account to distribution list My blog Zimbra Mail Server,linux,bash script,centos,linux command I hope this is useful.