Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  25 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ralph  
View profile  
 More options May 27 2008, 12:43 pm
From: Ralph <rfas...@g.risd.edu>
Date: Tue, 27 May 2008 09:43:23 -0700 (PDT)
Local: Tues, May 27 2008 12:43 pm
Subject: Distribution Lists
How does one create a set of distribution (email lists). I'm looking
to set up a number of different lists.. .for say freshman,
sophomores....etc...
How can I accomplish this?

Thanks
Ralph Fasano
RISD
"just a beginner"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
techlover  
View profile  
 More options May 28 2008, 7:05 am
From: techlover <2silverp...@gmail.com>
Date: Wed, 28 May 2008 04:05:37 -0700 (PDT)
Local: Wed, May 28 2008 7:05 am
Subject: Re: Distribution Lists
Hello Ralph,

This Google help page will give you the details for Email Lists:
http://www.google.com/support/a/bin/answer.py?hl=en&answer=33329

Larry (Power Poster)

On May 27, 10:43 am, Ralph <rfas...@g.risd.edu> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ariel  
View profile  
 More options Jun 4 2008, 12:31 pm
From: Ariel <lionof...@gmail.com>
Date: Wed, 4 Jun 2008 09:31:30 -0700 (PDT)
Local: Wed, Jun 4 2008 12:31 pm
Subject: Re: Distribution Lists
Larry,

Distribution lists are also important for my school. When looking at
the documentation, it seems that I would need to add each person
manually, one-by-one. Is this correct? Is there a way to important a
csv list of a hundred users at once? There really needs to be this
option! Thanks.

Ariel
"not yet converted"

On May 28, 6:05 am, techlover <2silverp...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
techlover  
View profile  
 More options Jun 4 2008, 10:24 pm
From: techlover <2silverp...@gmail.com>
Date: Wed, 4 Jun 2008 19:24:48 -0700 (PDT)
Local: Wed, Jun 4 2008 10:24 pm
Subject: Re: Distribution Lists
Hello Ariel,

With GApps APIs (Education and Premier Editions), you can use the
Provisioning APIs to do all operations on email lists, e.g. created,
add users, delete users, etc. Although mosts operations deal with one
list or one email address at a time, the APIs can be used in loops to
do bulk updates.  See the following Help page for more about APIs and
email lists. This particular example is in java, but php libraries are
also available.
http://code.google.com/apis/apps/gdata_provisioning_api_v2.0_referenc...

For an overview of APIs, visit this page:
http://code.google.com/apis/apps/gdata_provisioning_api_v2.0_referenc...

Larry (Power Poster)

On Jun 4, 10:31 am, Ariel <lionof...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
martyw  
View profile  
 More options Jun 9 2008, 9:19 am
From: martyw <mw...@mogschool.com>
Date: Mon, 9 Jun 2008 06:19:15 -0700 (PDT)
Local: Mon, Jun 9 2008 9:19 am
Subject: Re: Distribution Lists
Larry,

I'm new to Google Apps Educational Version too and we also rely on
email lists heavily.  I've been looking into the API's and I'm not
able to find help in getting started either other than being told
where the code is. I guess one has to be pretty proficient in
programming to make sense of it all.   If you find a solution I'd be
grateful if you'd share it with me.
Marty Wild

On Jun 4, 12:31 pm, Ariel <lionof...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ariel  
View profile  
 More options Jun 10 2008, 2:41 pm
From: Ariel <lionof...@gmail.com>
Date: Tue, 10 Jun 2008 11:41:04 -0700 (PDT)
Local: Tues, Jun 10 2008 2:41 pm
Subject: Re: Distribution Lists
I'm with Marty. I don't do the programming around here, but even my
guy who does is not familar with all this API stuff and is having
trouble finding the "first step" on the pages you linked. Is there a
Google Labs app that will do the email lists, so we dont' have to
write our own code? Please help. Thanks.

Ariel

On Jun 9, 8:19 am, martyw <mw...@mogschool.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gabe Cohen  
View profile  
 More options Jun 12 2008, 11:07 am
From: Gabe Cohen <gaco...@gmail.com>
Date: Thu, 12 Jun 2008 08:07:57 -0700 (PDT)
Local: Thurs, Jun 12 2008 11:07 am
Subject: Re: Distribution Lists
Hi Ariel,

I feel your pain, so I wrote you a script which uploads mailing list
data from csv files. If you can get your mailing list content into the
right format csv, you should be set. Copy and paste the source below
into a file called 'misterlist.py', then follow the instructions in
the script.

#!/usr/bin/python2.5
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#                       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
instructions:

0) activate the provisioning API for your domain here
https://www.google.com/a/cpanel/<yourdomainhere.com>/Users
1) get python 2.4 or 2.5 from http://python.org/download/ and install
it
2) get the gdata python library from http://code.google.com/p/gdata-python-client/downloads/list
3) extract the library and place the 'atom' and 'gdata' source
directories in the same directory as this script
4) specify a list csv of format
                listname (not list email address), user email address
                e.g.

                list1,b...@foo.com
                list1,al...@foo.com
                list2,f...@foo.com

5) run the script, using your google apps admin account
        'python misterlist.py -f csvfilename.csv -u ad...@domain.com -p
adminpass'

6) enjoy your mailing lists!
"""

from gdata.apps.service import AppsService
from gdata.apps.service import AppsForYourDomainException

import sys
import getopt
import logging

# logging.getLogger().setLevel(logging.DEBUG)

def parse_csv(filename):

        """
          specify csv of format
                listname (not list email address), user email address
                e.g.

                list1,b...@foo.com
                list1,al...@foo.com
                list2,f...@foo.com

        """
        results = {}
        f = open(filename)
        while True:
                line = f.readline()
                if not line:
                        break
                listname, user = line.strip().split(",")
                userlist = []
                if not results.has_key(listname):
                        userlist = [ user ]
                        results[listname] = userlist
                else:
                        userlist = results[listname]
                        userlist.append(user)
        logging.debug(results)

        return results

def upload_list_data(data, username, password, domain):
        try:
                service = AppsService(domain = domain)
                service.ClientLogin(username = username, password = password)
                for list in data.keys():
                        addlist = data[list]

                        #create list
                        logging.debug("trying to creating list " + list)
                        existing_list = None
                        try:
                                existing_list = service.RetrieveEmailList(list)
                        except Error:
                                pass
                        if existing_list:
                                print "list " + list + " already exists, updating..."
                        else:
                                service.CreateEmailList(list)
                                logging.debug("created list " + list)

                        # add users
                        for user in addlist:
                                logging.debug("creating user " + user)
                                service.AddRecipientToEmailList(user, list)

        except AppsForYourDomainException, e:
                print e

def main(argv):
        logging.debug(argv)
        try:
                opts, args = getopt.getopt(argv, "f:u:p:")
        except getopt.GetoptError:
                sys.exit(2)
        filename = None
        username = None
        password = None
        for o, a in opts:
                if o == "-f":
                        filename = a
                elif o == "-u":
                        username = a
                elif o == "-p":
                        password = a
                else:
                        print "unhandled option " + o

        results = parse_csv(filename.strip())
        print "Importing " + str(len(results.keys())) + " lists ... "
        upload_list_data(results,username.strip(),password.strip(),
(username.strip().split("@"))[1])
        print "Done!"

if __name__ == "__main__":
    main(sys.argv[1:])

On Jun 10, 2:41 pm, Ariel <lionof...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ChrisRyall  
View profile  
 More options Jun 12 2008, 6:07 pm
From: ChrisRyall <ch...@ryall.info>
Date: Thu, 12 Jun 2008 15:07:39 -0700 (PDT)
Local: Thurs, Jun 12 2008 6:07 pm
Subject: Re: Distribution Lists

Thank you Gabe that has saved me countless hours - and given me a
chance to learn how to run python scripts - thank you!

A few gotchas that I overcame:

1. Had to remove an odd line break from line 13 so it reads in full,
(no break before implied)
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.

2. Email list should be created first (otherwise I got errors, from
lines 133, 19 & 91) - might just be me?

3. MS Excel saved csv with " around text values - boo hiss! - check
and remove in text editor if necessary.

4. Worked on PC, but when using an eeePC (they're great!) 900 - had to
run script using python2.5 instead of python (eee has python 2.5
installed but defaults to running python 2.4 minimal version instead)
- so change first word of command from python to python2.5

Those problems might just have been me, but it might help someone out
there.

Thanks again Gabe.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gabe Cohen  
View profile  
 More options Jun 12 2008, 7:19 pm
From: Gabe Cohen <gaco...@gmail.com>
Date: Thu, 12 Jun 2008 16:19:02 -0700 (PDT)
Local: Thurs, Jun 12 2008 7:19 pm
Subject: Re: Distribution Lists
Hi Chris,

You shouldn't have to create the lists first... Can you post the full
error information you're seeing? I'll try and reproduce myself and
share an update.

On Jun 12, 3:07 pm, ChrisRyall <ch...@ryall.info> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gabe Cohen  
View profile  
 More options Jun 12 2008, 7:24 pm
From: Gabe Cohen <gaco...@gmail.com>
Date: Thu, 12 Jun 2008 16:24:53 -0700 (PDT)
Local: Thurs, Jun 12 2008 7:24 pm
Subject: Re: Distribution Lists
whoops, replace the word Error with Exception in my code, and it
solves the uncreated list problem:

#!/usr/bin/python2.5
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#                       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
instructions:

0) activate the provisioning API for your domain here
https://www.google.com/a/cpanel/<yourdomainhere.com>/Users
1) get python 2.4 or 2.5 from http://python.org/download/ and install
it
2) get the gdata python library from http://code.google.com/p/gdata-python-client/downloads/list
3) extract the library and place the 'atom' and 'gdata' source
directories in the same directory as this script
4) specify a list csv of format
                listname (not list email address), user email address
                e.g.

                list1,b...@foo.com
                list1,al...@foo.com
                list2,f...@foo.com

5) run the script, using your google apps admin account
        'python misterlist.py -f csvfilename.csv -u ad...@domain.com -p
adminpass'

6) enjoy your mailing lists!
"""

from gdata.apps.service import AppsService
from gdata.apps.service import AppsForYourDomainException

import sys
import getopt
import logging

# logging.getLogger().setLevel(logging.DEBUG)

def parse_csv(filename):

        """
          specify csv of format
                listname (not list email address), user email address
                e.g.

                list1,b...@foo.com
                list1,al...@foo.com
                list2,f...@foo.com

        """
        results = {}
        f = open(filename)
        while True:
                line = f.readline()
                if not line:
                        break
                listname, user = line.strip().split(",")
                userlist = []
                if not results.has_key(listname):
                        userlist = [ user ]
                        results[listname] = userlist
                else:
                        userlist = results[listname]
                        userlist.append(user)
        logging.debug(results)

        return results

def upload_list_data(data, username, password, domain):
        try:
                service = AppsService(domain = domain)
                service.ClientLogin(username = username, password = password)
                for list in data.keys():
                        addlist = data[list]

                        #create list
                        logging.debug("trying to creating list " + list)
                        existing_list = None
                        try:
                                existing_list = service.RetrieveEmailList(list)
                        except Exception:
                                pass
                        if existing_list:
                                print "list " + list + " already exists, updating..."
                        else:
                                service.CreateEmailList(list)
                                logging.debug("created list " + list)

                        # add users
                        for user in addlist:
                                logging.debug("creating user " + user)
                                service.AddRecipientToEmailList(user, list)

        except AppsForYourDomainException, e:
                print e

def main(argv):
        logging.debug(argv)
        try:
                opts, args = getopt.getopt(argv, "f:u:p:")
        except getopt.GetoptError:
                sys.exit(2)
        filename = None
        username = None
        password = None
        for o, a in opts:
                if o == "-f":
                        filename = a
                elif o == "-u":
                        username = a
                elif o == "-p":
                        password = a
                else:
                        print "unhandled option " + o

        results = parse_csv(filename.strip())
        print "Importing " + str(len(results.keys())) + " lists ... "
        upload_list_data(results,username.strip(),password.strip(),
(username.strip().split("@"))[1])
        print "Done!"

if __name__ == "__main__":
    main(sys.argv[1:])

On Jun 12, 4:19 pm, Gabe  Cohen <gaco...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mplotsker@gmail.com  
View profile  
 More options Jun 13 2008, 12:08 am
From: "mplots...@gmail.com" <mplots...@gmail.com>
Date: Thu, 12 Jun 2008 21:08:01 -0700 (PDT)
Local: Fri, Jun 13 2008 12:08 am
Subject: Re: Distribution Lists
help. i am getting the following errors.

C:\Documents and Settings\MPlotsker\Desktop\gdata.py-1.1.0\src>python
misterlist
.py -f grade9.csv -u mplots...@mdyhs.net -p password
Traceback (most recent call last):
  File "misterlist.py", line 42, in ?
    from gdata.apps.service import AppsService
  File "C:\Documents and Settings\MPlotsker\Desktop\gdata.py-1.1.0\src
\gdata\__i
nit__.py", line 27, in ?
    import atom
  File "C:\Documents and Settings\MPlotsker\Desktop\gdata.py-1.1.0\src
\atom\__in
it__.py", line 56, in ?
    from elementtree import ElementTree
ImportError: No module named elementtree

On Jun 12, 7:24 pm, Gabe  Cohen <gaco...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mplotsker@gmail.com  
View profile  
 More options Jun 13 2008, 12:53 am
From: "mplots...@gmail.com" <mplots...@gmail.com>
Date: Thu, 12 Jun 2008 21:53:11 -0700 (PDT)
Local: Fri, Jun 13 2008 12:53 am
Subject: Re: Distribution Lists
was using activepython 4. uninstalled that. now using python2.5.
still getting these errors
thanks
michael

C:\Python25>python misterlist.py -f grade9.csv -u mplots...@mdyhs.net -
p password
Traceback (most recent call last):
  File "misterlist.py", line 132, in <module>
    main(sys.argv[1:])
  File "misterlist.py", line 125, in main
    results = parse_csv(filename.strip())
  File "misterlist.py", line 66, in parse_csv
    listname, user = line.strip().split(",")
ValueError: too many values to unpack

On Jun 13, 12:08 am, "mplots...@gmail.com" <mplots...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mplotsker@gmail.com  
View profile  
 More options Jun 13 2008, 8:20 am
From: "mplots...@gmail.com" <mplots...@gmail.com>
Date: Fri, 13 Jun 2008 05:20:42 -0700 (PDT)
Local: Fri, Jun 13 2008 8:20 am
Subject: Re: Distribution Lists
fixed the issue. i had some trailing commas in my csv file that were
causing the error. cleaned it up and viola, 4 sweet lists.

thanks gabe for your hard work.
michael

On Jun 13, 12:53 am, "mplots...@gmail.com" <mplots...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ariel  
View profile  
 More options Jun 17 2008, 2:22 pm
From: Ariel <lionof...@gmail.com>
Date: Tue, 17 Jun 2008 11:22:34 -0700 (PDT)
Local: Tues, Jun 17 2008 2:22 pm
Subject: Re: Distribution Lists
I just wanted to say thanks Gabe. My programmer is starting to figure
this stuff out because of your help, though he is just starting to
learn python.

We are now trying to figure out how to import personal distribution
lists into gmail address "groups" for people from their old Pegasus
accounts. If you have any tips for that (or how to only allow certain
people to send to the global mailing lists), let me know. Thanks!

Ariel

On Jun 12, 6:24 pm, Gabe  Cohen <gaco...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
averyp  
View profile  
 More options Jun 17 2008, 5:35 pm
From: averyp <peejav...@gmail.com>
Date: Tue, 17 Jun 2008 14:35:14 -0700 (PDT)
Local: Tues, Jun 17 2008 5:35 pm
Subject: Re: Distribution Lists
Gabe, thank you so much for all your help. I am "Ariel's" programmer.

I have never written a line of Python until today. Using a little of
yours and learning some from Google, I have come up with a script
which will import users from a CSV file to a specific account's
Contacts. However, I have not seen anything about how to create
groups, or assign people to groups.

Any clues?

====================
#!/usr/bin/python2.5

import sys
import getopt
import getpass
import atom
import gdata.contacts
import gdata.contacts.service

def main(argv):
  # handle all the parameters
  try:
    opts, args = getopt.getopt(argv, "f:u:p:")
  except getopt.GetoptError:
    sys.exit("Invalid parameters")

  for o, a in opts:
    if o == "-f":
      filename = a
    elif o == "-u":
      username = a
    elif o == "-p":
      password = a
    else:
      print "Ignored parameter " + o

  # process the login
  try:
    gd_client = gdata.contacts.service.ContactsService()
    gd_client.email = username
    gd_client.password = password
    gd_client.source = "faith.edu-contacts-1"
    gd_client.ProgrammaticLogin()
    print "Logged in"
  except Exception:
    sys.exit("Error: Could not login")
    pass

  # read the csv file
  # format: name, e-mail, notes
  f = open(filename)
  while True:
    line = f.readline()
    if not line:
      break
    name, email, notes = line.strip().split(",")

    # create new contact
    try:
      new_contact =
gdata.contacts.ContactEntry(title=atom.Title(text=name.strip()))
      new_contact.content = atom.Content(text=notes.strip())

new_contact.email.append(gdata.contacts.Email(address=email.strip(),
primary="true", rel=gdata.contacts.REL_WORK))
      entry = gd_client.CreateContact(new_contact)
      print "Contact " + name + " created"
    except Exception:
      print "Error: Could not create " + name
      pass

if __name__ == '__main__':
  main(sys.argv[1:])


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
xshadow.hk  
View profile  
 More options Jun 17 2008, 10:32 pm
From: "xshadow.hk" <hkust.is...@gmail.com>
Date: Tue, 17 Jun 2008 19:32:36 -0700 (PDT)
Local: Tues, Jun 17 2008 10:32 pm
Subject: Re: Distribution Lists
From Google's Help Page:
"Email lists are currently limited to 1,000 recipients."
I hope that the limit can be increased.
There are about 1200 students in our school...

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gabe Cohen  
View profile  
 More options Jun 17 2008, 11:04 pm
From: Gabe Cohen <gaco...@gmail.com>
Date: Tue, 17 Jun 2008 20:04:53 -0700 (PDT)
Local: Tues, Jun 17 2008 11:04 pm
Subject: Re: Distribution Lists
Contact groups seem supported by the API but not the client library.
See the reference documentation here -
http://code.google.com/apis/contacts/developers_guide_protocol.html#G....

You might try directing your question to the contacts api support
group for help - http://groups.google.com/group/google-contacts-api.

On Jun 17, 2:35 pm, averyp <peejav...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
averyp  
View profile  
 More options Jun 18 2008, 8:03 am
From: averyp <peejav...@gmail.com>
Date: Wed, 18 Jun 2008 05:03:11 -0700 (PDT)
Local: Wed, Jun 18 2008 8:03 am
Subject: Re: Distribution Lists
Yeah. That is what I mentioned to Ariel, but wanted to make sure that
I was completely correct in my statement.

Thanks again for you time!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
martyw  
View profile  
 More options Jun 18 2008, 9:42 am
From: martyw <mw...@mogschool.com>
Date: Wed, 18 Jun 2008 06:42:51 -0700 (PDT)
Local: Wed, Jun 18 2008 9:42 am
Subject: Re: Distribution Lists
Gabe,

Thanks so much for your help!  I finally got around to playing with
this today and it works great!
My only question to those reading this post then is how to handle
errors, for instance, I get an exception when a domain user doesn't
exist.  How do I report the exception and continue?  Anybody written
the code yet and able to share it?
Thanks!
Marty

On Jun 12, 7:24 pm, Gabe  Cohen <gaco...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
averyp  
View profile  
 More options Jun 18 2008, 10:55 am
From: averyp <peejav...@gmail.com>
Date: Wed, 18 Jun 2008 07:55:24 -0700 (PDT)
Local: Wed, Jun 18 2008 10:55 am
Subject: Re: Distribution Lists
You can just use a try...except statement on the client login section.
If it fails, use sys.exit("Error: could not login to domain.").

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
martyw  
View profile  
 More options Jun 19 2008, 8:45 am
From: martyw <mw...@mogschool.com>
Date: Thu, 19 Jun 2008 05:45:52 -0700 (PDT)
Local: Thurs, Jun 19 2008 8:45 am
Subject: Re: Distribution Lists
Sorry, I wasn't clear in my question....  I meant that I want to add a
domain user to the list but if that user doesn't already exist in the
domain, the script bombs out.  Of course, you can add non-domain users
with no problem.  What happens is I have a list of 200 or 300 email
addresses, and since the list is large it may have an invalid domain
user address (or two) in it.  Basically, I want the script to tell me
if I have any invalid user names it in rather than me having to
manually check each list prior to import.  Thanks is advance.
Marty

On Jun 18, 10:55 am, averyp <peejav...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
martyw  
View profile  
 More options Jun 26 2008, 8:34 am
From: martyw <mw...@mogschool.com>
Date: Thu, 26 Jun 2008 05:34:45 -0700 (PDT)
Local: Thurs, Jun 26 2008 8:34 am
Subject: Re: Distribution Lists
Hi Ariel,

I was wondering how your programmer is coming along with these
scripts.  Can I contact you off-line (outside this group) about your
development efforts with the APIs?
Marty
mw...@mogschool.com

On Jun 10, 2:41 pm, Ariel <lionof...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
averyp  
View profile  
 More options Jun 27 2008, 10:54 am
From: averyp <peejav...@gmail.com>
Date: Fri, 27 Jun 2008 07:54:03 -0700 (PDT)
Local: Fri, Jun 27 2008 10:54 am
Subject: Re: Distribution Lists
Marty,

I understand you now. Yes, we had the same problem as well. To
overcome it, I wrote the script below.

The list is just a simple CSV file with "list,email" format. Then,
just execute it using "list.py -f list.csv -d domain -u admin_email -p
password"

====================
#!/usr/bin/python2.5

from gdata.apps.service import AppsService
from gdata.apps.service import AppsForYourDomainException

import sys
import getopt

# handle all the parameters
try:
  opts, args = getopt.getopt(sys.argv[1:], "f:d:u:p:")
except getopt.GetoptError:
  sys.exit("Invalid parameters")

for o, a in opts:
  if o == "-f":
    filename = a
  elif o == "-d":
    domain = a
  elif o == "-u":
    username = a
  elif o == "-p":
    password = a
  else:
    print "Ignored parameter " + o

# process the login
try:
  service = AppsService(domain = domain)
  service.ClientLogin(username = username, password = password)
except Exception:
  sys.exit("Error: Could not login")
  pass

# read the csv file
f = open(filename)
while True:
  line = f.readline()
  if not line:
    break
  list, email = line.strip().split(",")
  list = list.strip()
  email = email.strip()

  # create list if it doesn't exist
  existing_list = None
  try:
    existing_list = service.RetrieveEmailList(list)
  except Exception:
    pass
  if not existing_list:
    service.CreateEmailList(list)
    print "e-mail list \"" + list + "\" created"

  # add e-mail to the list
  try:
    service.AddRecipientToEmailList(email, list)
    print email + " added to " + list + " list"
  except Exception:
    pass
    print "Cannot add " + email + " to " + list + " list"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ecampbellrc  
View profile  
 More options Jul 11 2008, 10:20 am
From: ecampbellrc <ecampbel...@gmail.com>
Date: Fri, 11 Jul 2008 07:20:58 -0700 (PDT)
Local: Fri, Jul 11 2008 10:20 am
Subject: Re: Distribution Lists
Just a note, we use the api at the user login through our portal
rather than loading list.  This way as user logs in to our portal,
changes are made in google apps (eg freshman to sophomore or even
student to employee).  This also helps when they change their password
and apps account creation.  Currently I'm waiting for moderator
capability  to be added to Distribution list, can't really have
students blitzing all employees a message!  Also waiting to
incorporate Distribution list within sites and docs, so that we can
utilize sites more effectively (departments, committees, and project
teams).

On Jun 27, 10:54 am, averyp <peejav...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
sysadminlfs  
View profile  
 More options Aug 19 2008, 4:20 am
From: sysadminlfs <sysad...@lfs.edu.sg>
Date: Tue, 19 Aug 2008 01:20:00 -0700 (PDT)
Subject: Re: Distribution Lists
Hi

Thank you for your experience share on these email list scripts.
Unfortunately, when I try each of the two scripts proposed, it makes
two different errors.

1. Gabe Cohen script
It seems to block when it checks the username of the csv line.
***
Importing 1 lists ...
Traceback (most recent call last):
  File "C:\dev\misterlist\misterlist.py", line 84, in <module>
    main(sys.argv[1:])
  File "C:\dev\misterlist\misterlist.py", line 80, in main
    (username.strip().split("@"))[1])
  File "C:\dev\misterlist\misterlist.py", line 42, in upload_list_data
    except Error:
NameError: global name 'Error' is not defined
***

2. averyp script
It seems to block at the Email List creation in gdata service.
***
Traceback (most recent call last):
  File "C:\dev\misterlist\list.py", line 52, in <module>
    service.CreateEmailList(list)
  File "C:\Program Files\Google\google_appengine\misterlist\gdata\apps
\service.py", line 220, in CreateEmailList
    raise AppsForYourDomainException(e.args[0])
gdata.apps.service.AppsForYourDomainException: ('status', 'body',
'reason')
***

If you already tried those scripts or understand those errors,
I would be very interrested by your feedback

Paul.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »