Univention Bugzilla – Attachment 1921 Details for
Bug 15220
Mailquota in UGS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Adds listener module
univention-mail-cyrus-kolab2-mailquota.patch (text/plain), 3.34 KB, created by
Tim Petersen
on 2009-10-21 11:16:06 CEST
(
hide
)
Description:
Adds listener module
Filename:
MIME Type:
Creator:
Tim Petersen
Created:
2009-10-21 11:16:06 CEST
Size:
3.34 KB
patch
obsolete
>Index: debian/rules >=================================================================== >--- debian/rules (Revision 13073) >+++ debian/rules (Arbeitskopie) >@@ -69,6 +69,7 @@ > install -m 0755 usr/sbin/univention-cyrus-set-foldertype-shared ${D}/usr/sbin/univention-cyrus-set-foldertype-shared > > install -m 0755 cyrus.py ${D}/usr/lib/univention-directory-listener/system/ >+ install -m 0755 mailMailQuota.py ${D}/usr/lib/univention-directory-listener/system/ > install -m 0755 cyrus-sieve.py ${D}/usr/lib/univention-directory-listener/system/ > install -m 0755 cyrus-shared-folder.py ${D}/usr/lib/univention-directory-listener/system/ > >Index: mailMailQuota.py >=================================================================== >--- mailMailQuota.py (Revision 0) >+++ mailMailQuota.py (Revision 0) >@@ -0,0 +1,75 @@ >+#!/usr/bin/python2.4 >+# -*- coding: utf-8 -*- >+# >+# Univention mailMailQuota >+# Univention Listener Module >+# >+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Univention GmbH >+# >+# http://www.univention.de/ >+# >+# All rights reserved. >+# >+# This program is free software; you can redistribute it and/or modify >+# it under the terms of the GNU General Public License version 2 as >+# published by the Free Software Foundation. >+# >+# Binary versions of this file provided by Univention to you as >+# well as other copyrighted, protected or trademarked materials like >+# Logos, graphics, fonts, specific documentations and configurations, >+# cryptographic keys etc. are subject to a license agreement between >+# you and Univention. >+# >+# This program is distributed in the hope that it will be useful, >+# but WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with this program; if not, write to the Free Software >+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA >+ >+name='mailMailQuota' >+description='sets MailQuota from LDAP Entry' >+filter='(objectClass=univentionMail)' >+attributes=['mailMailQuota', 'mailPrimaryAddress'] >+ >+import os, string, pwd, grp, sys, ldap, tempfile, posix >+import listener >+import univention_baseconfig >+import univention.debug >+ >+def handler(dn, new, old): >+ >+ mail = new['mailPrimaryAddress'][0] >+ quota = new['mailMailQuota'][0] >+ quota = quota + "000" >+ cyrus_user = 'cyrus' >+ hostname = 'localhost' >+ >+ baseConfig = univention_baseconfig.baseConfig() >+ baseConfig.load() >+ >+ try: >+ if quota != '0': >+ password=open('/etc/cyrus.secret').read() >+ if password[-1] == '\n': >+ password=password[0:-1] >+ >+ if baseConfig.has_key('mail/cyrus/murder/backend/hostname') and baseConfig['mail/cyrus/murder/backend/hostname']: >+ hostname = baseConfig['mail/cyrus/murder/backend/hostname'] >+ >+ child = spawn('/usr/bin/cyradm -u %s %s' % (cyrus_user, hostname)) >+ i=0 >+ while not i == 3: >+ i = child.expect(['IMAP Password:', '>', 'cyradm: cannot connect to server', EOF], timeout=60) >+ if i == 0: >+ child.sendline(password) >+ elif i == 1: >+ child.sendline('setquota user/%s %s' % (mail, quota)) >+ child.sendline('disc') >+ child.sendline('exit') >+ elif i == 2: >+ sys.exit(1) >+ except: >+ univention.debug.debug(univention.debug.LISTENER, univention.debug.ERROR, "MailQuota could not be set")
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 15220
: 1921 |
1922
|
1923
|
1924
|
1925