#!/usr/bin/env python from commands import getstatusoutput for l in open('pwlist'): [pw,key,us] = l.split() uc = 'userdb "%s" set home=/var/mail/torontoisa.org '\ 'mail=/var/mail/torontoisa.org/%s uid=5000 gid=5000'\ % (us, us) up = 'echo -e "%s\\n%s\\n" | userdbpw -md5 | userdb "%s" set systempw'\ % (pw,pw,us) # print uc # print up # import sys # sys.exit(0) # print 'Testing mail forwarding for <%s@torontoisa.org>. Email for this address should be delivered to .' % us # print # print 'The new mail system also allows you to check mail online at [http://webmail.torontoisa.org/], this will not replace the forwarding which currently happens. This is probably going to be more useful if you want to send out mail from the <%s@torontoisa.org> and don\'t want to reconfigure your current mail client. It might also be useful as a backup. It might be completely useless, but it didn\'t take very long to setup. The credentials are:' % us # print ' user "%s"; pass "%s" pronunciation key %s' % (us,pw,key) # print # print 'Please test the webmail login, and respond to this message. Also, sorry for making this an automated email but I have 21 of these to send out.' # print # print 'Thanks,' # print 'Aly' # print # print # print '---------------------------------------------------------------' # print print 'Webmail has been setup for .' print print 'Please login to:\n http://webmail.torontoisa.org/\nThe credentials are:' print ' user "%s"; pass "%s"' % (us,pw) print print 'The webmail system will not replace the mail forwarding system which is' print 'currently in place. This system will be useful if you want to send out' print 'email from the sportsfest2007 account.' print print 'Please test the webmail login, and respond to this message.' print print 'Thanks,' print 'Aly' print print print '---------------------------------------------------------------' print