ExchangeAccount
From Evolution
_ExchangeAccountPrivate
This structure contails all the information related to an exchange account like name, password, password key, OWA URL, folder and folder hierarchy details, URIs, E2KContect, GS server information etc.
ctx: E2kContext
gc: E2kGlobalCatalog
standard_uris: hash table of
fsize: Folder size hash table containing folder name and row reference (GtkTreeRowReference)
connect_lock: mutext used to lock during account operations like setting ONLINE/OFFINE, esatablishing the connection.
connecting, connected: flags, connecting is set before we establish the connection, once the connection is establised, connecting will be set to FASLE and connecting to TRUE.
hierarchies: Array of personal, favorite, public, foreign and GAL hierarchies,
hierarchies_by_folder: hash table containing a folder and reference to the hierarchy it belongs to. Useful when we have a folder name and what to retrive the hierarchy object it belongs to.
foreign_hierarchies: used for the foreign folders, means other users folders. hash table which maps the folder owner's e-mail id to the hierarchy. Used to retrive the hieratchy for a user, who's e-mail id is given.
favorites_hierarchy: Favorite folder hierachy
folders: Hash table mapping folder path, physical URI, internal URI, permanent URI to folders. Example for these keys are listed below:
path : /personal internal uri : http://server/exchange/user gal://server/exchange/user physical uri : exchange://user@server/exchange/personal permanent uri:
fresh_folders: Hash table which maps the folder path to folders, which is up-to-date.
uri_authority: string which contains user name, server name and authentication mechanism, used while forming the URIs. Example
user;auth=NTLM@server user;auth=Basic@server user@server
http_uri_schema: schema or format for the URI, used in construcing the home URI. Example
http://%s/exchange/%s/
uris_use_email: flag set to TRUE if the URI has a e-mail id in it, used to extract the mailbox information.
offline_sync: flag set to TRUE if the account is marked for OFFLINE usage, otherwise set to FALSE.
identity_name and identity_email: Identity information of a user, name and e-mail
source_uri: the URI. Example:
exchange://user@server/ exchange://user;auth=NTLM@server/
password_key: password key used by "epasswords". Example:
exchange://user@server/ exchange://user;auth=NTLM@server/
username: Name of the user
password: User's password.
windows_domain: Windows domain, Example:
myexchange.com
nt_domain: NT domain. Exaple:
MYEXCHANGE
ad_server: GC server name
owa_url: OWA URL string.
auth_pref: the authentication type to use. Example:
E2K_AUTOCONFIG_USE_BASIC E2K_AUTOCONFIG_USE_NTLM
ad_limit: GAL limit
passwd_exp_warn_period: Number of days before password expiry date, used to warn the user while login about his password expiry.
quota_limit: Variable to store the quota limit variabe, can hold uota_norecv, quota_nosend, quota_warn depending upon the quta has reached the limit where sending mails is blocked or receving mails has blocked etc.
account_list: List of EAccounts. Since we support only one account as of now it'll not have more than one account.
account: reference to EAccount
discover_datas and discover_data_lock: the structure to hold the user and folder names, which is used for discovering the shared folders.
exchange_account_connect ():
This is the function used to connect to the server. Here we check for the offline status of the account first. And if the account is in OFFLINE mode, we just setup the account hierarchies and then retrun. If the account is in ONLINE mode, we check that if the E2KContext object is already created, if yes we have already connected, and we return the context. If not, we create the E2KAutoconfig object, then call e2k_autoconfig_get_context() to get the E2KContext object.
If we fail during this, we check if we have failed because the password has expired and set the proper error code. We make use for kerberose calls for checking for the password expiry.
We also check if we can handle the error internally and try again with some changes, for the errors we get because of -> using wrong authentication mechanism (using BASIC when we are supposed to use NTLM, vice versa) or -> server requireing a redirection or -> server requires SSL and
On success, we read the standard URIs using PROPFIND. Then we procced with setting up folder hierarchies and mark the account as CONNECTED. If GC server is accessible we check the qouta limitations for the user and set the quota_limit and emit the CONNECTED signal.
exchange_account_rescan_tree
This function is used to scan the tree hierarchy for an exchange account. This is called by all mail, calendar and Addressbook backends and also by evolution exchange plugin.
In this function we since we are scanning and updating the tree again, we free the fresh folders hash table first and re construct them. We call exchange_hierarchy_scan_subtree() which based on the hierarchy called scan_subtree() function [which can be recursive based on the hierarchy (webdav is recursive)] and recan() for personal/favorite/public/foregin hierarchies.