Projects
Kolab:3.4
pykolab
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 121
View file
pykolab.spec
Changed
@@ -28,7 +28,7 @@ Summary: Kolab Groupware Solution Name: pykolab -Version: 0.7.3 +Version: 0.7.4 Release: 1%{?dist} License: GPLv3+ Group: Applications/System @@ -523,6 +523,9 @@ %attr(0700,%{kolab_user},%{kolab_group}) %dir %{_var}/spool/pykolab/wallace %changelog +* Mon Dec 8 2014 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 0.7.4-1 +- New upstream release + * Fri Oct 31 2014 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 0.7.3-1 - New upstream release
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +pykolab (0.7.4-0~kolab1) unstable; urgency=low + + * New upstream release + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Mon, 8 Dec 2014 01:49:00 +0100 + pykolab (0.7.3-0~kolab2) unstable; urgency=low * pykolab-xml should require python-kolab (#3742)
View file
pykolab-0.7.3.tar.gz/bin/kolab_smtp_access_policy.py -> pykolab-0.7.4.tar.gz/bin/kolab_smtp_access_policy.py
Changed
@@ -37,6 +37,7 @@ from sqlalchemy import MetaData from sqlalchemy import String from sqlalchemy import Table +from sqlalchemy import Sequence from sqlalchemy import create_engine from sqlalchemy.orm import mapper @@ -84,7 +85,7 @@ session = None policy_result_table = Table( 'policy_result', metadata, - Column('id', Integer, primary_key=True), + Column('id', Integer, Sequence('seq_id_result'), primary_key=True), Column('key', String(16), nullable=False), Column('value', Boolean, nullable=False), Column('sender', String(64), nullable=False), @@ -127,7 +128,7 @@ statistic_table = Table( 'statistic', metadata, - Column('id', Integer, primary_key=True), + Column('id', Integer, Sequence('seq_id_statistic'), primary_key=True), Column('sender', String(64), nullable=False), Column('recipient', String(64), nullable=False), Column('date', Date, nullable=False),
View file
pykolab-0.7.3.tar.gz/configure.ac -> pykolab-0.7.4.tar.gz/configure.ac
Changed
@@ -1,4 +1,4 @@ -AC_INIT([pykolab], 0.7.3) +AC_INIT([pykolab], 0.7.4) AC_SUBST([RELEASE], 1) AC_CONFIG_SRCDIR(pykolab/constants.py.in)
View file
pykolab-0.7.3.tar.gz/kolab-cli.py -> pykolab-0.7.4.tar.gz/kolab-cli.py
Changed
@@ -23,7 +23,7 @@ import sys # For development purposes -sys.path.extend(['.', '..']) +sys.path = [ '.' ] + sys.path from pykolab.translate import _ from pykolab.cli import Cli
View file
pykolab-0.7.3.tar.gz/pykolab/auth/__init__.py -> pykolab-0.7.4.tar.gz/pykolab/auth/__init__.py
Changed
@@ -256,8 +256,8 @@ return self.domains - def synchronize(self, mode=0): - self._auth.synchronize(mode=mode) + def synchronize(self, mode=0, callback=None): + self._auth.synchronize(mode=mode, callback=callback) def domain_default_quota(self, domain): return self._auth._domain_default_quota(domain)
View file
pykolab-0.7.3.tar.gz/pykolab/auth/ldap/__init__.py -> pykolab-0.7.4.tar.gz/pykolab/auth/ldap/__init__.py
Changed
@@ -976,7 +976,7 @@ except: log.error(_("Could not update dn %r:\n%r") % (dn, modlist)) - def synchronize(self, mode=0): + def synchronize(self, mode=0, callback=None): """ Synchronize with LDAP """ @@ -1017,6 +1017,9 @@ log.debug(_("Synchronization is searching against base DN: %s") % (base_dn), level=8) + if callback == None: + callback = self._synchronize_callback + try: self._search( base_dn, @@ -1028,7 +1031,7 @@ 'modifytimestamp' ], override_search=override_search, - callback=self._synchronize_callback, + callback=callback, ) except Exception, errmsg: log.error("Exception occurred: %r" % (errmsg)) @@ -1418,13 +1421,19 @@ """ self._change_delete_unknown(entry, change) + def _change_delete_resource(self, entry, change): + pass + + def _change_delete_role(self, entry, change): + pass + def _change_delete_sharedfolder(self, entry, change): pass def _change_delete_unknown(self, entry, change): """ An entry has been deleted, and we do not know of what object type - the entry was - user, group, role or sharedfolder. + the entry was - user, group, resource, role or sharedfolder. """ result_attribute = conf.get('cyrus-sasl', 'result_attribute') @@ -1435,10 +1444,16 @@ return None success = True - for _type in ['user','group','role','sharedfolder']: + for _type in ['user','group','resource','role','sharedfolder']: try: - eval("success = self._change_delete_%s(entry, change)" % (_type)) + success = eval("self._change_delete_%s(entry, change)" % (_type)) + print success except: + if conf.debuglevel > 8: + import traceback + log.error(_("%s") % (traceback.format_exc())) + + print success success = False if success:
View file
pykolab-0.7.3.tar.gz/pykolab/cli/cmd_delete_mailbox.py -> pykolab-0.7.4.tar.gz/pykolab/cli/cmd_delete_mailbox.py
Changed
@@ -40,9 +40,7 @@ Delete mailbox """ - try: - delete_folder = conf.cli_args.pop(0) - except IndexError, e: + if len(conf.cli_args) < 1: print >> sys.stderr, _("No mailbox specified") sys.exit(1) @@ -50,10 +48,18 @@ imap.connect() - delete_folders = imap.list_folders(delete_folder) + delete_folders = [] + while len(conf.cli_args) > 0: + folder = conf.cli_args.pop(0) + folders = imap.list_folders(folder) + + if len(folders) < 1: + print >> sys.stderr, _("No such folder(s): %s") % (folder) + + delete_folders.extend(folders) if len(delete_folders) == 0: - print >> sys.stderr, _("No such folder(s)") + print >> sys.stderr, _("No folders to delete.") sys.exit(1) for delete_folder in delete_folders:
View file
pykolab-0.7.3.tar.gz/pykolab/cli/cmd_set_quota.py -> pykolab-0.7.4.tar.gz/pykolab/cli/cmd_set_quota.py
Changed
@@ -56,12 +56,9 @@ if not imap.has_folder(folder): print >> sys.stderr, _("No such folder %r") % (folder) + sys.exit(1) - else: - imap.set_quota(folder, quota) - - # See if the folder is an INBOX folder - # If yes, edit LDAP (through WAP client) - # If no, edit IMAP + for _folder in imap.lm(folder): + imap.set_quota(_folder, quota) + print >> sys.stdout, "Quota for folder '%s' set to %d" % (_folder, quota) - # Verify the folder actually exists in IMAP
View file
pykolab-0.7.3.tar.gz/pykolab/cli/cmd_sync.py -> pykolab-0.7.4.tar.gz/pykolab/cli/cmd_sync.py
Changed
@@ -19,27 +19,50 @@ import commands +from distutils import version +import multiprocessing + +import sys import time + import pykolab +from pykolab import utils from pykolab.auth import Auth +from pykolab.imap import IMAP from pykolab.translate import _ log = pykolab.getLogger('pykolab.cli') conf = pykolab.getConf() +imap = None +pool = None + def __init__(): commands.register('sync', execute, description="Synchronize Kolab Users with IMAP.") def cli_options(): my_option_group = conf.add_cli_parser_option_group(_("CLI Options")) - my_option_group.add_option( '--resync', - dest = "resync", - action = "store_true", - default = False, - help = _("Resync from the beginning")) + my_option_group.add_option( + '--threads', + dest = "threads", + action = "store", + default = 20, + type = int, + help = _("Synchronize LDAP and IMAP") + ) + + my_option_group.add_option( + '--resync', + dest = "resync", + action = "store_true", + default = False, + help = _("Resync from the beginning") + ) def execute(*args, **kw): + global imap, pool + auth = Auth() log.debug(_("Listing domains..."), level=5) start_time = time.time() @@ -53,17 +76,56 @@ level=8 ) - all_folders = [] + if version.StrictVersion(sys.version[:3]) >= version.StrictVersion("2.7"): + pool = multiprocessing.Pool(conf.threads, worker_process, (), 1) + else: + pool = multiprocessing.Pool(conf.threads, worker_process, ()) for primary_domain in list(set(domains.values())): log.debug(_("Running for domain %s") % (primary_domain), level=8) auth = Auth(primary_domain) auth.connect(primary_domain) start_time = time.time() - auth.synchronize(mode='_paged_search') + auth.synchronize(mode='_paged_search', callback=queue_add) end_time = time.time() log.info(_("Synchronizing users for %s took %d seconds") % (primary_domain, (end_time-start_time)) ) + while not pool._taskqueue.empty(): + time.sleep(1) + +def queue_add(*args, **kw): + global pool + for dn, entry in kw['entry']: + entry['dn'] = dn + pool.apply_async(_synchronize, (), dict(**entry)) + +def worker_process(*args, **kw): + pass + +def _synchronize(*args, **kw): + log.info(_("Worker process %s handling %s") % (multiprocessing.current_process().name, kw['dn'])) + + entry = utils.normalize(entry) + + if not entry.has_key('mail'): + return + + if not 'kolabinetorgperson' in entry['objectclass']: + return + + imap = IMAP() + imap.connect() + + if not imap.user_mailbox_exists(entry['mail']): + if entry.has_key('mailhost'): + server = entry['mailhost'] + else: + server = None + + imap.user_mailbox_create(entry['mail'], server=server) + + imap.disconnect() +
View file
pykolab-0.7.3.tar.gz/pykolab/conf/defaults.py -> pykolab-0.7.4.tar.gz/pykolab/conf/defaults.py
Changed
@@ -37,4 +37,6 @@ self.kolab_domain_sync_interval = 600 self.kolab_default_locale = 'en_US' - self.ldap_unique_attribute = 'nsuniqueid' \ No newline at end of file + self.ldap_unique_attribute = 'nsuniqueid' + + self.wallace_resource_calendar_expire_days = 100 \ No newline at end of file
View file
pykolab-0.7.3.tar.gz/pykolab/imap/__init__.py -> pykolab-0.7.4.tar.gz/pykolab/imap/__init__.py
Changed
@@ -110,6 +110,8 @@ if uri == None: if conf.has_section(domain) and conf.has_option(domain, 'imap_uri'): uri = conf.get(domain, 'imap_uri') + else: + self.domain = None scheme = None hostname = None @@ -218,8 +220,7 @@ return True except: log.error( - _("Could not create folder %r") + \ - _(" on server %r") % ( + _("Could not create folder %r on server %r") % ( folder_path, server ) @@ -279,6 +280,12 @@ else: return '/' + def imap_murder(self): + if hasattr(self.imap, 'murder') and self.imap.murder: + return True + else: + return False + def namespaces(self): """ Obtain the namespaces. @@ -473,16 +480,25 @@ self.create_folder(folder_name, server) # In a Cyrus IMAP Murder topology, wait for the murder to have settled - if hasattr(self.imap, 'murder') and self.imap.murder: + if self.imap_murder(): self.disconnect() self.connect() - created = False - while not created: - created = self.has_folder(folder_name) - if not created: - log.info(_("Waiting for the Cyrus IMAP Murder to settle...")) - time.sleep(0.5) + created = False + last_log = time.time() + while not created: + created = self.has_folder(folder_name) + if not created: + if time.time() - last_log > 5: + log.info(_("Waiting for the Cyrus IMAP Murder to settle...")) + last_log = time.time() + + time.sleep(0.5) + + _additional_folders = None + + if not hasattr(self, 'domain'): + self.domain == None if not self.domain == None: if conf.has_option(self.domain, "autocreate_folders"): @@ -491,28 +507,28 @@ "autocreate_folders" ) - elif conf.has_option('kolab', "autocreate_folders"): + if _additional_folders == None: + if conf.has_option('kolab', "autocreate_folders"): _additional_folders = conf.get_raw( 'kolab', "autocreate_folders" ) - else: - _additional_folders = {} - - additional_folders = conf.plugins.exec_hook( - "create_user_folders", - kw={ - 'folder': folder_name, - 'additional_folders': _additional_folders - } - ) - if not additional_folders == None: - self.user_mailbox_create_additional_folders( - mailbox_base_name, - additional_folders - ) + additional_folders = conf.plugins.exec_hook( + "create_user_folders", + kw={ + 'folder': folder_name, + 'additional_folders': _additional_folders + } + ) + + if not additional_folders == None: + self.user_mailbox_create_additional_folders( + mailbox_base_name, + additional_folders + ) + if not self.domain == None: if conf.has_option(self.domain, "sieve_mgmt"): sieve_mgmt_enabled = conf.get(self.domain, 'sieve_mgmt') if utils.true_or_false(sieve_mgmt_enabled): @@ -536,20 +552,30 @@ admin_login = conf.get(backend, 'admin_login') admin_password = conf.get(backend, 'admin_password') + if self.imap_murder(): + server = self.user_mailbox_server(folder) + else: + server = None + success = False + last_log = time.time() while not success: try: self.disconnect() - self.connect(login=False) + self.connect(login=False, server=server) self.login_plain(admin_login, admin_password, folder) (personal, other, shared) = self.namespaces() success = True except Exception, errmsg: - log.debug(_("Waiting for the Cyrus murder to settle... %r") % (errmsg)) + if time.time() - last_log > 5 and self.imap_murder(): + log.debug(_("Waiting for the Cyrus murder to settle... %r") % (errmsg)) + last_log = time.time() + if conf.debuglevel > 8: import traceback traceback.print_exc() + time.sleep(0.5) for additional_folder in additional_folders.keys(): @@ -563,6 +589,16 @@ try: self.create_folder(folder_name) + created = False + last_log = time.time() + while not created: + created = self.has_folder(folder_name) + if not created: + if time.time() - last_log > 5: + log.info(_("Waiting for the Cyrus IMAP Murder to settle...")) + last_log = time.time() + + time.sleep(0.5) except: log.warning(_("Mailbox already exists: %s") % (folder_name)) if conf.debuglevel > 8:
View file
pykolab-0.7.3.tar.gz/pykolab/utils.py -> pykolab-0.7.4.tar.gz/pykolab/utils.py
Changed
@@ -309,6 +309,15 @@ return "\n%s\n" % ("\n".join(lines)) +def str2unicode(s, encoding='utf-8'): + if isinstance(s, unicode): + return s + try: + return unicode(s, encoding) + except: + pass + return s + def normalize(_object): if type(_object) == list: result = []
View file
pykolab-0.7.3.tar.gz/pykolab/wap_client/__init__.py -> pykolab-0.7.4.tar.gz/pykolab/wap_client/__init__.py
Changed
@@ -350,6 +350,9 @@ def ou_delete(params={}): return request('POST', 'ou.delete', post=json.dumps(params)) +def ou_edit(params={}): + return request('POST', 'ou.edit', post=json.dumps(params)) + def ou_find(params=None): post = { 'search': { 'params': {} } } @@ -516,8 +519,8 @@ def sharedfolders_list(params={}): return request('POST', 'sharedfolders.list', post=json.dumps(params)) -def system_capabilities(): - return request('GET', 'system.capabilities') +def system_capabilities(domain=None): + return request('GET', 'system.capabilities', get={'domain':domain}) def system_get_domain(): return request('GET', 'system.get_domain')
View file
pykolab-0.7.3.tar.gz/pykolab/xml/event.py -> pykolab-0.7.4.tar.gz/pykolab/xml/event.py
Changed
@@ -945,7 +945,6 @@ from email.MIMEBase import MIMEBase from email.MIMEText import MIMEText from email.Utils import COMMASPACE, formatdate - from email import Encoders msg = MIMEMultipart() organizer = self.get_organizer() @@ -1030,7 +1029,10 @@ from email.MIMEBase import MIMEBase from email.MIMEText import MIMEText from email.Utils import COMMASPACE, formatdate - from email import Encoders + + # encode unicode strings with quoted-printable + from email import charset + charset.add_charset('utf-8', charset.SHORTEST, charset.QP) msg = MIMEMultipart() @@ -1093,19 +1095,19 @@ else: msg_from = from_address - msg['From'] = msg_from + msg['From'] = utils.str2unicode(msg_from) msg['Date'] = formatdate(localtime=True) if subject is None: subject = _("Invitation for %s was %s") % (self.get_summary(), participant_status_label(participant_status)) - msg["Subject"] = subject + msg['Subject'] = utils.str2unicode(subject) if message_text is None: message_text = _("""This is an automated response to one of your event requests.""") - msg.attach(MIMEText(utils.stripped_message(message_text))) + msg.attach(MIMEText(utils.stripped_message(message_text), _charset='utf-8')) part = MIMEBase('text', 'calendar', charset='UTF-8', method=method) del part['MIME-Version'] # mime parts don't need this
View file
pykolab-0.7.3.tar.gz/share/templates/roundcubemail/config.inc.php.tpl -> pykolab-0.7.4.tar.gz/share/templates/roundcubemail/config.inc.php.tpl
Changed
@@ -8,6 +8,7 @@ \$config['username_domain'] = '$primary_domain'; \$config['use_secure_urls'] = true; \$config['assets_path'] = '/roundcubemail/assets/'; + \$config['assets_dir'] = '/usr/share/roundcubemail/public_html/assets/'; \$config['mail_domain'] = ''; @@ -37,7 +38,6 @@ // Kolab specific defaults \$config['product_name'] = 'Kolab Groupware'; - \$config['skin_logo'] = 'skins/kolab/images/kolab_logo.png'; \$config['quota_zero_as_unlimited'] = false; \$config['login_lc'] = 2; \$config['auto_create_user'] = true; @@ -84,8 +84,7 @@ \$config['session_lifetime'] = 180; \$config['password_charset'] = 'UTF-8'; - \$config['useragent'] = 'Kolab 3.1/Roundcube ' . RCUBE_VERSION; - \$config['dont_override'] = Array('skin'); + \$config['useragent'] = 'Kolab 3.4/Roundcube ' . RCUBE_VERSION; \$config['message_sort_col'] = 'date'; @@ -129,7 +128,7 @@ \$config['ldap_debug'] = false; \$config['smtp_debug'] = false; - \$config['skin'] = 'larry'; + \$config['skin'] = 'chameleon'; \$config['skin_include_php'] = false; \$config['mime_magic'] = null; \$config['im_identify_path'] = '/usr/bin/identify';
View file
pykolab-0.7.3.tar.gz/tests/functional/resource_func.py -> pykolab-0.7.4.tar.gz/tests/functional/resource_func.py
Changed
@@ -15,7 +15,8 @@ 'cn': cn, 'kolabtargetfolder': "shared/Resources/" + cn + "@example.org", 'uniquemember': members, - 'owner': owner + 'owner': owner, + 'ou': 'ou=resources,dc=example,dc=org' } resource_details.update(kw)
View file
pykolab-0.7.3.tar.gz/tests/functional/test_wallace/test_005_resource_invitation.py -> pykolab-0.7.4.tar.gz/tests/functional/test_wallace/test_005_resource_invitation.py
Changed
@@ -574,7 +574,7 @@ def test_010_invalid_bookings(self): self.purge_mailbox(self.john['mailbox']) - itip_other = itip_invitation.replace("mailto:%s", "mailto:some-other-resource@example.org\nDESCRIPTION: Sent to %s") + itip_other = itip_invitation.replace("mailto:%s", "mailto:some-other-resource@example.org\nCOMMENT: Sent to %s") self.send_itip_invitation(self.audi['mail'], datetime.datetime(2014,3,22, 8,0,0), template=itip_other) time.sleep(1)
View file
pykolab-0.7.3.tar.gz/tests/unit/test-011-itip.py -> pykolab-0.7.4.tar.gz/tests/unit/test-011-itip.py
Changed
@@ -465,5 +465,13 @@ self.assertEqual(message.get('Subject'), _("Invitation for %(summary)s was %(status)s") % { 'summary':'test', 'status':_accepted }) text = str(message.get_payload(0)); - self.assertIn('SUMMARY=test', text) - self.assertIn('STATUS=' + _accepted, text) + self.assertIn('SUMMARY=3Dtest', text) + self.assertIn('STATUS=3D' + _accepted, text) + + def test_004_send_reply_unicode(self): + itip_events = itip.events_from_message(message_from_string(itip_non_multipart.replace('SUMMARY:test', "SUMMARY:With äöü"))) + itip.send_reply("resource-collection-car@example.org", itip_events, "SUMMARY=%(summary)s; STATUS=%(status)s; NAME=%(name)s;") + + self.assertEqual(len(self.smtplog), 1) + self.assertIn("Subject: =?utf-8?q?Invitation_for_With_=C3=A4=C3=B6=C3=BC_was_Accepted?=", self.smtplog[0][2]) + self.assertIn('SUMMARY=3DWith =C3=A4=C3=B6=C3=BC', self.smtplog[0][2])
View file
pykolab-0.7.3.tar.gz/tests/unit/test-012-wallace_invitationpolicy.py -> pykolab-0.7.4.tar.gz/tests/unit/test-012-wallace_invitationpolicy.py
Changed
@@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + import os import pykolab import logging @@ -160,4 +162,12 @@ self.assertFalse( MIP.is_auto_reply({ 'kolabinvitationpolicy':accept_some }, 'sam@example.org', 'event')) self.assertFalse( MIP.is_auto_reply({ 'kolabinvitationpolicy':accept_avail }, 'user@domain.com', 'event')) self.assertTrue( MIP.is_auto_reply({ 'kolabinvitationpolicy':accept_avail }, 'john@example.org', 'event')) - \ No newline at end of file + + def test_006_send_update_notification(self): + itips = pykolab.itip.events_from_message(message_from_string(itip_multipart.replace('SUMMARY:test', 'SUMMARY:with äöü'))) + MIP.send_update_notification(itips[0]['xml'], { 'mail': 'sender@example.org' }, old=None, reply=True) + + self.assertEqual(len(self.smtplog), 1) + self.assertIn("Subject: =?utf-8?", self.smtplog[0][2]) + self.assertIn("The event 'with =C3=A4=C3=B6=C3=BC' at", self.smtplog[0][2]) +
View file
pykolab-0.7.3.tar.gz/wallace/__init__.py -> pykolab-0.7.4.tar.gz/wallace/__init__.py
Changed
@@ -18,7 +18,6 @@ # import asyncore -import binascii from distutils import version import grp import multiprocessing @@ -42,13 +41,6 @@ from modules import cb_action_ACCEPT -#conf.finalize_conf() -#if conf.debuglevel > 8: -# max_threads = 1 -#else: -# max_threads = 24 -max_threads = 24 - def pickup_message(filepath, *args, **kw): wallace_modules = args[0] if kw.has_key('module'): @@ -141,6 +133,14 @@ ) daemon_group.add_option( + "--threads", + dest = "max_threads", + action = "store", + default = 24, + help = _("Number of threads to use.") + ) + + daemon_group.add_option( "-p", "--pid-file", dest = "pidfile", action = "store", @@ -183,9 +183,9 @@ def do_wallace(self): if version.StrictVersion(sys.version[:3]) >= version.StrictVersion("2.7"): - self.pool = multiprocessing.Pool(max_threads, worker_process, (), 1) + self.pool = multiprocessing.Pool(conf.max_threads, worker_process, (), 1) else: - self.pool = multiprocessing.Pool(max_threads, worker_process, ()) + self.pool = multiprocessing.Pool(conf.max_threads, worker_process, ()) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) @@ -330,8 +330,6 @@ pass def remove_pid(self, *args, **kw): - if hasattr(self, 'heartbeat'): - self.heartbeat.terminate() if os.access(conf.pidfile, os.R_OK): os.remove(conf.pidfile) raise SystemExit
View file
pykolab-0.7.3.tar.gz/wallace/module_invitationpolicy.py -> pykolab-0.7.4.tar.gz/wallace/module_invitationpolicy.py
Changed
@@ -970,6 +970,10 @@ from email.MIMEText import MIMEText from email.Utils import formatdate + # encode unicode strings with quoted-printable + from email import charset + charset.add_charset('utf-8', charset.SHORTEST, charset.QP) + organizer = object.get_organizer() orgemail = organizer.email() orgname = organizer.name() @@ -1053,12 +1057,12 @@ message_text += "\n" + _("*** This is an automated message. Please do not reply. ***") # compose mime message - msg = MIMEText(utils.stripped_message(message_text)) + msg = MIMEText(utils.stripped_message(message_text), _charset='utf-8') msg['To'] = receiving_user['mail'] msg['Date'] = formatdate(localtime=True) - msg['Subject'] = _('"%s" has been updated') % (object.get_summary()) - msg['From'] = '"%s" <%s>' % (orgname, orgemail) if orgname else orgemail + msg['Subject'] = utils.str2unicode(_('"%s" has been updated') % (object.get_summary())) + msg['From'] = utils.str2unicode('"%s" <%s>' % (orgname, orgemail) if orgname else orgemail) smtp = smtplib.SMTP("localhost", 10027) @@ -1081,6 +1085,10 @@ from email.MIMEText import MIMEText from email.Utils import formatdate + # encode unicode strings with quoted-printable + from email import charset + charset.add_charset('utf-8', charset.SHORTEST, charset.QP) + log.debug(_("Send cancellation notification for %s %r to user %r") % ( object.type, object.uid, receiving_user['mail'] ), level=8) @@ -1111,12 +1119,12 @@ message_text += "\n" + _("*** This is an automated message. Please do not reply. ***") # compose mime message - msg = MIMEText(utils.stripped_message(message_text)) + msg = MIMEText(utils.stripped_message(message_text), _charset='utf-8') msg['To'] = receiving_user['mail'] msg['Date'] = formatdate(localtime=True) - msg['Subject'] = _('"%s" has been cancelled') % (object.get_summary()) - msg['From'] = '"%s" <%s>' % (orgname, orgemail) if orgname else orgemail + msg['Subject'] = utils.str2unicode(_('"%s" has been cancelled') % (object.get_summary())) + msg['From'] = utils.str2unicode('"%s" <%s>' % (orgname, orgemail) if orgname else orgemail) smtp = smtplib.SMTP("localhost", 10027)
View file
pykolab-0.7.3.tar.gz/wallace/module_resources.py -> pykolab-0.7.4.tar.gz/wallace/module_resources.py
Changed
@@ -442,7 +442,7 @@ """ global imap - days = int(conf.get('wallace', 'resource_calendar_expire_days', 100)) + days = int(conf.get('wallace', 'resource_calendar_expire_days')) now = datetime.datetime.now(tzlocal()) expire_date = now - datetime.timedelta(days=days) @@ -1197,6 +1197,10 @@ from email.MIMEText import MIMEText from email.Utils import formatdate + # encode unicode strings with quoted-printable + from email import charset + charset.add_charset('utf-8', charset.SHORTEST, charset.QP) + notify = False status = itip_event['xml'].get_attendee_by_email(resource['mail']).get_participant_status(True) @@ -1223,12 +1227,14 @@ message_text = owner_notification_text(resource, owner, itip_event['xml'], success) - msg = MIMEText(utils.stripped_message(message_text)) + msg = MIMEText(utils.stripped_message(message_text), _charset='utf-8') msg['To'] = owner['mail'] msg['From'] = resource['mail'] msg['Date'] = formatdate(localtime=True) - msg['Subject'] = _('Booking for %s has been %s') % (resource['cn'], participant_status_label(status) if success else _('failed')) + msg['Subject'] = utils.str2unicode(_('Booking for %s has been %s') % ( + resource['cn'], participant_status_label(status) if success else _('failed') + )) smtp = smtplib.SMTP("localhost", 10027)
View file
pykolab.dsc
Changed
@@ -2,7 +2,7 @@ Source: pykolab Binary: pykolab, kolab-cli, kolab-conf, kolab-saslauthd, kolab-server, kolab-telemetry, kolab-xml, wallace Architecture: all -Version: 0.7.3-0~kolab2 +Version: 0.7.4-0~kolab1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Homepage: http://www.kolab.org @@ -40,5 +40,5 @@ pykolab deb python optional wallace deb python optional Files: - 00000000000000000000000000000000 0 pykolab-0.7.3.tar.gz + 00000000000000000000000000000000 0 pykolab-0.7.4.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.