Huu Phan | Blog Linux operating system | Linux operating system -Blog Huu Phan | www.huuphan.com
huuphan.com. Powered by Blogger.

Explore the world of seamless email management with Zimbra Mail on Linux! Our blog delves into a step-by-step guide on harnessing the potential of Linux commands, providing easy-to-follow how-tos, and unlocking the magic of Bash scripting. Simplify your email administration journey and enhance your skills with our insightful tips and tricks.

How to zimbra add account to distribution list


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 add account to distribution list

The syntax, create distribution lists command line from root account
su - 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 DL
echo -n "Input distribute name, pls (Ex: [email protected]): "
read DL
echo -n "Input account add to distribute name, pls (Ex: [email protected]): "
read AC
Check_Member_DL=$(su - zimbra -c "zmprov gdl $DL | grep '\b$AC'")
if [ $? == 0 ]
then
       echo "$AC member exists in $DL"
else
       echo "Add member $AC to $DL Distribute List"
       su - zimbra -c "zmprov adlm $DL $AC"
fi

The result, running bash script from root account
How to zimbra add account to distribution list

Conclusion

Thought the article, To help you can auto add account to distribution list from bash script. If you any question then comment below.

post new :

Huu Phan | Blog Linux operating system | Huu Phan ~ Zimbra Mail Server,linux,bash script,centos,linux command | www.huuphan.com

This Blog is protected by DMCA.com