univention.mail package

Submodules

univention.mail.dovecot module

class univention.mail.dovecot.DovecotListener(listener, name)[source]

Bases: object

log_p(msg)[source]
log_e(msg)[source]
new_email_account(email)[source]
delete_email_account(dn, email)[source]
read_from_ext_proc_as_root(cmd, regexp=None, stdin=None, stdout=- 1, stderr=None, stdin_input=None)[source]

Wrapper around Popen(), runs external command as root and return its output, optionally the first hit of a regexp. May raise an exception.

Parameters
  • cmd – list: with executable path as first item

  • regexp – string: regexp for re.findall()

Returns

string

move_user_home(newMailPrimaryAddress, oldMailPrimaryAddress, force_rename=False)[source]
move_mail_home(old_path, new_path, email, force_rename=False)[source]
get_maillocation()[source]
upload_activate_sieve_script(email, file)[source]
get_user_home(username)[source]
get_masteruser_credentials()[source]
get_dovecot_user()[source]
mkdir_p(dir)[source]
classmethod chown_r(path, uid, gid)[source]

Recursively set owner and group on a file/directory and its subdirectories.

Parameters
  • path (str) – file/directory (and its subdirectories) to change ownership on

  • uid (int) – UID to set

  • gid (int) – GID to set

Returns

None

univention.mail.dovecot_shared_folder module

class univention.mail.dovecot_shared_folder.DovecotFolderAclEntry(folder_name, identifier, acl)[source]

Bases: object

classmethod from_str(line)[source]
class univention.mail.dovecot_shared_folder.DovecotGlobalAclFile(listener)[source]

Bases: object

dovemail_gid = 101
add_acls(acl_list)[source]
remove_acls(folder_name)[source]
class univention.mail.dovecot_shared_folder.DovecotSharedFolderListener(*args, **kwargs)[source]

Bases: univention.mail.dovecot.DovecotListener

add_shared_folder(new)[source]
del_shared_folder(old)[source]
mod_shared_folder(old, new)[source]
get_public_location(ns)[source]
create_public_folder(folder_name)[source]
read_from_ext_proc_as_root(cmd, regexp=None, stdin=None, stdout=- 1, stderr=None, stdin_input=None)[source]

Wrapper around Popen(), runs external command as root and return its output, optionally the first hit of a regexp. May raise an exception.

Parameters
  • cmd – list: with executable path as first item

  • regexp – string: regexp for re.findall()

Returns

string

doveadm_set_mailbox_acls(mailbox, acls)[source]
imap_set_mailbox_acls(mb_owner, mailbox, acls)[source]
update_public_mailbox_configuration(delete_only=None)[source]

Cache public folders and their quota into a UCRV.

Parameters

delete_only – if True removes only entry ‘delete_only’, else recreates from scratch.

Returns

None

unsubscribe_from_mailbox(users, mailbox)[source]
get_udm_infos(udm_module, udm_filter)[source]
add_global_acls(new)[source]
remove_global_acls(old)[source]