XMPP Instant Messaging - Group Rosters: Difference between revisions

No edit summary
No edit summary
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
NOTE: Okay, so this doesn't actually appear to work on my (original poster) server. It seems like it should, but it doesn't. If anyone has suggestions on how to make it work, please share! -Jeremy.
{{Archive}}{{Unsupported}}{{Article Infobox|{{admin}}|{{ZCS 6.0}}||}}NOTE: I have tested this on 6.0.6GA. The 'zimbraPrefFromDisplay' attribute was not present in the output of the 'zmmailbox' command, so instead I used the 'username' part of the email address the display name. Not ideal, but it works. - switch007
 
As of ZCS 6.0, it's not possible to create group rosters (where the IM Buddy List is pre-populated with all the members of a group) through the admin web interface. This functionality is slated for ZCS 7.0. However, it is possible to do so via the IM SOAP API.  
As of ZCS 6.0, it's not possible to create group rosters (where the IM Buddy List is pre-populated with all the members of a group) through the admin web interface. This functionality is slated for ZCS 7.0. However, it is possible to do so via the IM SOAP API.  


Line 10: Line 10:
if [ "$#" == "1" ]
if [ "$#" == "1" ]
then
then
     members=$(zmsoap --type admin --verbose --zadmin \
     members=$(zmsoap --type admin --verbose --zadmin \
               GetDistributionListRequest/dl="$1" @by="name" | \
               GetDistributionListRequest/dl="$1" @by="name" | \
               grep dlm | sed -e 's/.*<dlm>\(.*\)<\/dlm>/\1/g')
               grep dlm | sed -e 's/.*<dlm>\(.*\)<\/dlm>/\1/g')
     for member in $members
     for member in $members
     do
     do
        for target in $members
      for target in $members
         do
         do
             if [ $member != $target ]
             if [ $member != $target ]
             then
             then
                 uname=$(zmmailbox -z -m $target gid -v | \
                 username=$(echo $target|cut -d@ -f1)
                        grep zimbraPrefFromDisplay | \
                        sed -e 's/.*: "\(.*\)",/\1/')
                 zmsoap --type im --verbose --zadmin \
                 zmsoap --type im --verbose --zadmin \
                 --mailbox $member IMSubscribeRequest \
                 --mailbox $member IMSubscribeRequest \
                 @addr=$target @name="$uname" @op="add"
                 @addr=$target @name="$username" @op="add"


                 zmsoap --type im --verbose --zadmin \
                 zmsoap --type im --verbose --zadmin \
Line 32: Line 28:
                 @addr=$member @authorized="true"
                 @addr=$member @authorized="true"
             fi
             fi
        done
done
     done
     done



Revision as of 17:38, 24 March 2015

Admin Article

Article Information

This article applies to the following ZCS versions.

ZCS 6.0 Article ZCS 6.0

NOTE: I have tested this on 6.0.6GA. The 'zimbraPrefFromDisplay' attribute was not present in the output of the 'zmmailbox' command, so instead I used the 'username' part of the email address the display name. Not ideal, but it works. - switch007

As of ZCS 6.0, it's not possible to create group rosters (where the IM Buddy List is pre-populated with all the members of a group) through the admin web interface. This functionality is slated for ZCS 7.0. However, it is possible to do so via the IM SOAP API.

The following bash script, which should be run from the CLI as the zimbra user, will reciprocally add all members of a Distribution List (defined in the admin web interface). It's not elegant, but it works.

#!/bin/bash

if [ "$#" == "1" ]
then
    members=$(zmsoap --type admin --verbose --zadmin \
              GetDistributionListRequest/dl="$1" @by="name" | \
              grep dlm | sed -e 's/.*<dlm>\(.*\)<\/dlm>/\1/g')
    for member in $members
    do
      	for target in $members
        do
            if [ $member != $target ]
            then
                username=$(echo $target|cut -d@ -f1)
                zmsoap --type im --verbose --zadmin \
                --mailbox $member IMSubscribeRequest \
                @addr=$target @name="$username" @op="add"

                zmsoap --type im --verbose --zadmin \
                --mailbox $target IMAuthorizeSubscribeRequest \
                @addr=$member @authorized="true"
            fi
	done
    done

else
    echo "$0 usage: $0 group@zimbra.domain.edu"
fi


Verified Against: ZCS 6.0 Date Created: 1/15/1010
Article ID: https://wiki.zimbra.com/index.php?title=XMPP_Instant_Messaging_-_Group_Rosters Date Modified: 2015-03-24



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search