modules.dhbw.zimbra.ZimbraHandler

class modules.dhbw.zimbra.ZimbraHandler[source]

Bases: ImporterSession

Handler for interacting with zimbra.

urlstr

the given url for zimbra

accountnamestr

the dhbw mail account

contactsList[Dict[str, str]]

a list representing all contacts from zimbra

realnamestr

the real name of the logged in user

signaturesList[str]

a list of all available signatures to the user

login(self): None

creates a session for the user

logout(self): None

sends a logout request

scrape(self): None

scrape the wanted data from the website

get_contacts(self): None

import contacts from the default “contact” book

new_contact(self, contact_dict): None

create a new contact inside the default contact book

remove_contact(self, contact_id): None

remove an existing contact from the default contact book

_create_entities_list(self, recipients, rec_cc, rec_bcc): List[Dict[str, str]]

create a list with dictionary elements

_generate_mail(self, mail_dict): Dict[str, Any]

build the mail in the needed format for zimbra

send_mail(self, mail_dict): None

sends a mail to the soap backend of zimbra

Methods

drop_header

method to drop an header

get_contacts

Import contacts from the default contact book.

login

Authenticate the user against zimbra.

logout

sends a logout request

new_contact

Create a new contact inside the default contact book.

remove_contact

remove an existing contact from the default contact book

scrape

Scrape the selected data from zimbra.

send_mail

Sends a mail to the soap backend of zimbra.

Attributes

accountname

contacts

realname

signatures

auth_token

email

headers

scraped_data

url

drop_header(header) None

method to drop an header

header: str

the name of the header which should be dropped

None

get_contacts()[source]

Import contacts from the default contact book.

None

async login(username, password)[source]

Authenticate the user against zimbra.

username: str

the username for the authentication process

password: str

the password for the authentication process

ZimbraHandler

logout()[source]

sends a logout request

None

new_contact(contact_dict)[source]

Create a new contact inside the default contact book.

contact_dict : Dict

None

remove_contact(contact_id)[source]

remove an existing contact from the default contact book

contact_id : str

async scrape()[source]

Scrape the selected data from zimbra.

None

send_mail(mail_dict)[source]

Sends a mail to the soap backend of zimbra.

mail_dict: SendMailDict

a dictionary containing recipients, subject, content-type and the actual content

None