Zimbra Distribution List from CLI
I wanted to create a distribution list named testlist@mydomain.net
Create the list
zmprov cdl testlist@mydomain.net
Set the reply-to as feedback@mydomain.net, the reply-to display name as Feedback. Force approval for subscriptions and unsubscriptions and hide the list in the GAL
zmprov mdl testlist@mydomain.net zimbraPrefReplyToEnabled TRUE zimbraPrefReplyToAddress feedback@mydomian.net zimbraPrefReplyToDisplay Feedback zimbraDistributionListSubscriptionPolicy APPROVAL zimbraDistributionListUnsubscriptionPolicy APPROVAL zimbraHideInGal TRUE
Set the list owner (needed for subscription and unsubscription messages) to be hostmaster@mydomain.net. To do so, we must have the zimbraId of the list owner (not the email address)
zmprov ga hostmaster@mydomain.net zimbraId | grep zimbraId | awk -F "zimbraId: " {'print "zmprov mdl testlist1@sepb.net +zimbraACE \""$2" usr ownDistList\""'} | bash
Now, prohibit everyone in the world from sending to the list, then permit only a selected user to send
zmprov grr dl testlist@mydomain.net all -sendToDistList zmprov grr dl testlist1@mydomain.net usr customerservice@mydomain sendToDistList zmprov grr dl testlist1@mydomain.net usr customerservice@mydomain sendAsDistList zmmilterctl restart
Add members to the list
zmprov adlm testlist@mydomain.net user1@mydomain.net
Other useful commands
Remove members to the list
zmprov rdlm testlist@mydomain.net user1@mydomain.net
list all the parameters in the distribution list
zmprov gdl testlist@mydomain.net
list only distribution list members
zmprov gdlm testlist@mydomain.net
if need be – rename it
zmprov rdl testlist@mydomain.net somelist@mydomain.net
And in case you dont need it any more – delete it
zmprov ddl testlist@mydomain.net
Get all distribution lists
zmprov gadl
Tested with zimbra 8.8.10 GA