Camel.Session¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| add_service(uid, protocol, type) | |
| authenticate(service, mechanism, io_priority, cancellable, callback, *user_data) | |
| authenticate_finish(result) | |
| authenticate_sync(service, mechanism, cancellable) | |
| forget_password(service, item) | |
| forward_to(folder, message, address, io_priority, cancellable, callback, *user_data) | |
| forward_to_finish(result) | |
| forward_to_sync(folder, message, address, cancellable) | |
| get_filter_driver(type, for_folder) | |
| get_junk_filter() | |
| get_junk_headers() | |
| get_oauth2_access_token_sync(service, cancellable) | |
| get_online() | |
| get_password(service, prompt, item, flags) | |
| get_recipient_certificates_sync(flags, recipients, cancellable) | |
| get_user_cache_dir() | |
| get_user_data_dir() | |
| idle_add(priority, function, *data) | |
| list_services() | |
| lookup_addressbook(name) | |
| ref_main_context() | |
| ref_network_monitor() | |
| ref_service(uid) | |
| ref_service_by_url(url, type) | |
| remove_service(service) | |
| remove_services() | |
| set_junk_filter(junk_filter) | |
| set_junk_headers(headers, values) | |
| set_network_monitor(network_monitor) | |
| set_online(online) | |
| submit_job(description, callback, *user_data) | |
| trust_prompt(service, certificate, errors) | |
| user_alert(service, type, message) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
| do_add_service(uid, protocol, type) | |
| do_authenticate_sync(service, mechanism, cancellable) | |
| do_forget_password(service, item) | |
| do_forward_to_sync(folder, message, address, cancellable) | |
| do_get_filter_driver(type, for_folder) | |
| do_get_oauth2_access_token_sync(service, cancellable) | |
| do_get_password(service, prompt, item, flags) | |
| do_get_recipient_certificates_sync(flags, recipients, cancellable) | |
| do_job_finished(cancellable, error) | |
| do_job_started(cancellable) | |
| do_lookup_addressbook(name) | |
| do_remove_service(service) | |
| do_trust_prompt(service, certificate, errors) | |
| do_user_alert(service, type, message) | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| junk-filter | Camel.JunkFilter | r/w/en | Classifies messages as junk or not junk | 
| main-context | GLib.MainContext | r | The main loop context on which to attach event sources | 
| network-monitor | Gio.NetworkMonitor | r/w/en | |
| online | bool | r/w/c/en | Whether the shell is online | 
| user-cache-dir | str | r/w/c/en | User-specific base directory for mail cache | 
| user-data-dir | str | r/w/c/en | User-specific base directory for mail data | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| job-finished | |
| job-started | |
| user-alert | This purpose of this signal is to propagate a server-issued alert message from service to a user interface. | 
Class Details¶
- 
class Camel.Session(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - Camel.SessionClass- 
add_service(uid, protocol, type)¶
- Parameters: - uid (str) – a unique identifier string
- protocol (str) – the service protocol
- type (Camel.ProviderType) – the service type
 - Raises: - Returns: - a - Camel.Serviceinstance, or- None- Return type: - Instantiates a new - Camel.Servicefor self. The uid identifies the service for future lookup. The protocol indicates which- Camel.Providerholds the- GObject.GTypeof the- Camel.Servicesubclass to instantiate. The type explicitly designates the service as a- Camel.Storeor- Camel.Transport.- If the given uid has already been added, the existing - Camel.Servicewith that uid is returned regardless of whether it agrees with the given protocol and type.- If no - Camel.Provideris available to handle the given protocol, or if the- Camel.Providerdoes not specify a valid- GObject.GTypefor type, the function sets error and returns- None.- The returned - Camel.Serviceis referenced for thread-safety and must be unreferenced with- GObject.Object.unref() when finished with it.- New in version 3.2. 
- uid (
 - 
authenticate(service, mechanism, io_priority, cancellable, callback, *user_data)¶
- Parameters: - service (Camel.Service) – aCamel.Service
- mechanism (strorNone) – a SASL mechanism name, orNone
- io_priority (int) – the I/O priority for the request
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – data to pass to the callback function
 - Asynchronously authenticates service, which may involve repeated calls to - Camel.Service.authenticate() or- Camel.Service.authenticate_sync(). A- Camel.Sessionsubclass is largely responsible for implementing this, and should handle things like user prompts and secure password storage. These issues are out-of-scope for Camel.- When the operation is finished, callback will be called. You can then call - Camel.Session.authenticate_finish() to get the result of the operation.- New in version 3.4. 
- service (
 - 
authenticate_finish(result)¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Raises: - GLib.Error- Returns: - Trueon success,- Falseon failure- Return type: - bool- Finishes the operation started with - Camel.Session.authenticate().- If an error occurred, or if authentication was aborted, the function sets error and returns - False.- New in version 3.4. 
 - 
authenticate_sync(service, mechanism, cancellable)¶
- Parameters: - service (Camel.Service) – aCamel.Service
- mechanism (strorNone) – a SASL mechanism name, orNone
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - Return type: - Authenticates service, which may involve repeated calls to - Camel.Service.authenticate() or- Camel.Service.authenticate_sync(). A- Camel.Sessionsubclass is largely responsible for implementing this, and should handle things like user prompts and secure password storage. These issues are out-of-scope for Camel.- If an error occurs, or if authentication is aborted, the function sets error and returns - False.- New in version 3.4. 
- service (
 - 
forget_password(service, item)¶
- Parameters: - service (Camel.Service) – theCamel.Servicerejecting the password
- item (str) – an identifier, unique within this service, for the information
 - Raises: - Returns: - Return type: - This function is used by a - Camel.Serviceto tell the application that the authentication information it provided via- Camel.Session.get_password() was rejected by the service. If the application was caching this information, it should stop, and if the service asks for it again, it should ask the user.- service and item identify the rejected authentication information, as with - Camel.Session.get_password().
- service (
 - 
forward_to(folder, message, address, io_priority, cancellable, callback, *user_data)¶
- Parameters: - folder (Camel.Folder) – theCamel.Folderwhere message is located
- message (Camel.MimeMessage) – theCamel.MimeMessageto forward
- address (str) – the recipient’s email address
- io_priority (int) – the I/O priority for the request
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – data to pass to the callback function
 - Asynchronously forwards message in folder to the email address(s) given by address. - When the operation is finished, callback will be called. You can then call - Camel.Session.forward_to_finish() to get the result of the operation.- New in version 3.6. 
- folder (
 - 
forward_to_finish(result)¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Raises: - GLib.Error- Returns: - Trueon success,- Falseon failure- Return type: - bool- Finishes the operation started with - Camel.Session.forward_to().- If an error occurred, the function sets error and returns - False.- New in version 3.6. 
 - 
forward_to_sync(folder, message, address, cancellable)¶
- Parameters: - folder (Camel.Folder) – theCamel.Folderwhere message is located
- message (Camel.MimeMessage) – theCamel.MimeMessageto forward
- address (str) – the recipient’s email address
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - Return type: - Forwards message in folder to the email address(es) given by address. - If an error occurs, the function sets error and returns - False.- New in version 3.6. 
- folder (
 - 
get_filter_driver(type, for_folder)¶
- Parameters: - type (str) – the type of filter (eg, “incoming”)
- for_folder (Camel.FolderorNone) – an optionalCamel.Folder, for which the filter driver will run, orNone
 - Raises: - Returns: - a filter driver, loaded with applicable rules - Return type: - The optional for_folder can be used to determine which filters to add and which not. 
- type (
 - 
get_junk_filter()¶
- Returns: - a - Camel.JunkFilter, or- None- Return type: - Camel.JunkFilter- Returns the - Camel.JunkFilterinstance used to classify messages as junk or not junk during filtering.- Note that - Camel.JunkFilteritself is just an interface. The application must implement the interface and install a- Camel.JunkFilterinstance for junk filtering to take place.- New in version 3.2. 
 - 
get_junk_headers()¶
- Returns: - Currently used junk headers as a hash table, previously set by - Camel.Session.set_junk_headers().- Return type: - { - str:- str}- New in version 2.22. 
 - 
get_oauth2_access_token_sync(service, cancellable)¶
- Parameters: - service (Camel.Service) – aCamel.Service
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - whether succeeded - out_access_token: - return location for the access token, or - None- out_expires_in: - return location for the token expiry, or - None- Return type: - Obtains the OAuth 2.0 access token for service along with its expiry in seconds from the current time (or 0 if unknown). - Free the returned access token with - GLib.free() when no longer needed.- New in version 3.28. 
- service (
 - 
get_password(service, prompt, item, flags)¶
- Parameters: - service (Camel.Service) – theCamel.Servicethis query is being made by
- prompt (str) – prompt to provide to user
- item (str) – an identifier, unique within this service, for the information
- flags (int) – %CAMEL_SESSION_PASSWORD_REPROMPT, the prompt should force a reprompt %CAMEL_SESSION_PASSWORD_SECRET, whether the password is secret %CAMEL_SESSION_PASSWORD_STATIC, the password is remembered externally
 - Raises: - Returns: - the authentication information or - None- Return type: - This function is used by a - Camel.Serviceto ask the application and the user for a password or other authentication data.- service and item together uniquely identify the piece of data the caller is concerned with. - prompt is a question to ask the user (if the application doesn’t already have the answer cached). If %CAMEL_SESSION_PASSWORD_SECRET is set, the user’s input will not be echoed back. - If %CAMEL_SESSION_PASSWORD_STATIC is set, it means the password returned will be stored statically by the caller automatically, for the current session. - The authenticator should set error to - Gio.IOErrorEnum.CANCELLEDif the user did not provide the information. The caller must- GLib.free() the information returned when it is done with it.
- service (
 - 
get_recipient_certificates_sync(flags, recipients, cancellable)¶
- Parameters: - flags (int) – bit-or ofCamel.RecipientCertificateFlags
- recipients ([str]) – aGLib.PtrArrayof recipients
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - Whether succeeded, or better whether no fatal error happened. - out_certificates: - a - GLib.SListof gathered certificates- Return type: - Searches for S/MIME certificates or PGP keys for the given recipients, which are returned as base64 encoded strings in out_certificates. This is used when encrypting messages. The flags influence what the out_certificates will contain. The order of items in out_certificates should match the order of items in recipients, with - Nonedata for those which could not be found.- The function should return failure only if some fatal error happened. It’s not an error when certificates for some, or all, recipients could not be found. - This method is optional and the default implementation returns - Trueand sets the out_certificates to- None. It’s the only exception when the length of recipients and out_certificates can differ. In all other cases the length of the two should match.- The out_certificates will be freed with g_slist_free_full (certificates, - GLib.free); when done with it.- New in version 3.30. 
- flags (
 - 
get_user_cache_dir()¶
- Returns: - the base directory for mail cache - Return type: - str- Returns the base directory under which to store user-specific mail cache. - New in version 3.4. 
 - 
get_user_data_dir()¶
- Returns: - the base directory for mail data - Return type: - str- Returns the base directory under which to store user-specific mail data. - New in version 3.2. 
 - 
idle_add(priority, function, *data)¶
- Parameters: - priority (int) – the priority of the idle source
- function (GLib.SourceFunc) – a function to call
- data (objectorNone) – data to pass to function
 - Returns: - the ID (greater than 0) of the event source - Return type: - Adds a function to be called whenever there are no higher priority events pending. If function returns - Falseit is automatically removed from the list of event sources and will not be called again.- This internally creates a main loop source using - GLib.idle_source_new() and attaches it to self’s own- Camel.Session- :main-contextusing- GLib.Source.attach().- The priority is typically in the range between - GLib.PRIORITY_DEFAULT_IDLEand- GLib.PRIORITY_HIGH_IDLE.- New in version 3.6. 
- priority (
 - 
list_services()¶
- Returns: - an unsorted list of - Camel.Serviceobjects- Return type: - [ - Camel.Service]- Returns a list of all - Camel.Serviceobjects previously added using- Camel.Session.add_service().- The services returned in the list are referenced for thread-safety. They must each be unreferenced with - GObject.Object.unref() when finished with them. Free the returned list itself with g_list_free().- An easy way to free the list property in one step is as follows: - g_list_free_full (list, g_object_unref);- New in version 3.2. 
 - 
lookup_addressbook(name)¶
- Parameters: - name ( - str) – a name/address to lookup for- Returns: - whether found the name in any address book. - Return type: - bool- Looks up for the name in address books. - New in version 2.22. 
 - 
ref_main_context()¶
- Returns: - a - GLib.MainContext- Return type: - GLib.MainContext- Returns the - GLib.MainContexton which event sources for self are to be attached.- New in version 3.8. 
 - 
ref_network_monitor()¶
- Returns: - A referenced - Gio.NetworkMonitorinstance to use for network availability tests.- Return type: - Gio.NetworkMonitor- References a - Gio.NetworkMonitorinstance, which had been previously set by- Camel.Session.set_network_monitor(). If none is set, then the default- Gio.NetworkMonitoris returned, as provided by- Gio.NetworkMonitor.get_default(). The returned pointer is referenced for thread safety, unref it with- GObject.Object.unref() when no longer needed.- New in version 3.22. 
 - 
ref_service(uid)¶
- Parameters: - uid ( - str) – a unique identifier string- Returns: - a - Camel.Serviceinstance, or- None- Return type: - Camel.Service- Looks up a - Camel.Serviceby its unique identifier string. The service must have been previously added using- Camel.Session.add_service().- The returned - Camel.Serviceis referenced for thread-safety and must be unreferenced with- GObject.Object.unref() when finished with it.- New in version 3.6. 
 - 
ref_service_by_url(url, type)¶
- Parameters: - url (Camel.URL) – aCamel.URL
- type (Camel.ProviderType) – aCamel.ProviderType
 - Returns: - a - Camel.Serviceinstance, or- None- Return type: - Looks up a - Camel.Serviceby trying to match its- Camel.URLagainst the given url and then checking that the object is of the desired type. The service must have been previously added using- Camel.Session.add_service().- The returned - Camel.Serviceis referenced for thread-safety and must be unreferenced with- GObject.Object.unref() when finished with it.- Note this function is significantly slower than - Camel.Session.ref_service().- New in version 3.6. 
- url (
 - 
remove_service(service)¶
- Parameters: - service ( - Camel.Service) – the- Camel.Serviceto remove- Removes a - Camel.Servicepreviously added by- Camel.Session.add_service().- New in version 3.2. 
 - 
remove_services()¶
- Removes all - Camel.Serviceinstances added by- Camel.Session.add_service().- This can be useful during application shutdown to ensure all - Camel.Serviceinstances are freed properly, especially since- Camel.Sessioninstances are prone to reference cycles.- New in version 3.2. 
 - 
set_junk_filter(junk_filter)¶
- Parameters: - junk_filter ( - Camel.JunkFilter) – a- Camel.JunkFilter, or- None- Installs the - Camel.JunkFilterinstance used to classify messages as junk or not junk during filtering.- Note that - Camel.JunkFilteritself is just an interface. The application must implement the interface and install a- Camel.JunkFilterinstance for junk filtering to take place.- New in version 3.2. 
 - 
set_junk_headers(headers, values)¶
- Parameters: - New in version 2.22. 
 - 
set_network_monitor(network_monitor)¶
- Parameters: - network_monitor ( - Gio.NetworkMonitoror- None) – a- Gio.NetworkMonitoror- None- Sets a network monitor instance for the self. This can be used to override which - Gio.NetworkMonitorshould be used to check network availability and whether a server is reachable.- New in version 3.22. 
 - 
set_online(online)¶
- Parameters: - online ( - bool) – whether or not the session should be online- Sets the online status of self to online. 
 - 
submit_job(description, callback, *user_data)¶
- Parameters: - description (str) – human readable description of the job, shown to a user
- callback (Camel.SessionCallback) – aCamel.SessionCallback
- user_data (objectorNone) – user data passed to the callback
 - This function provides a simple mechanism for providers to initiate low-priority background jobs. Jobs can be submitted from any thread, but execution of the jobs is always as follows: - 1) The - Camel.Session- :job-startedsignal is emitted from the thread in which self was created. This is typically the same thread that hosts the global default- GLib.MainContext, or “main” thread.- 2) The callback function is invoked from a different thread where it’s safe to call synchronous functions. - 3) Once callback has returned, the #CamelSesson:job-finished signal is emitted from the same thread as - Camel.Session- :job-startedwas emitted.- 4) Finally if a notify function was provided, it is invoked and passed user_data so that user_data can be freed. - New in version 3.2. 
- description (
 - 
trust_prompt(service, certificate, errors)¶
- Parameters: - service (Camel.Service) – aCamel.Service
- certificate (Gio.TlsCertificate) – the peer’sGio.TlsCertificate
- errors (Gio.TlsCertificateFlags) – the problems with certificate
 - Returns: - the user’s trust level for certificate - Return type: - Prompts the user whether to accept certificate for service. The set of flags given in errors indicate why the certificate failed validation. - If an error occurs during prompting or if the user declines to respond, the function returns - Camel.CertTrust.UNKNOWNand the certificate will be rejected.- New in version 3.8. 
- service (
 - 
user_alert(service, type, message)¶
- Parameters: - service (Camel.Service) – aCamel.Service
- type (Camel.SessionAlertType) – aCamel.SessionAlertType
- message (str) – the message for the user
 - Emits a #CamelSession:user_alert signal from an idle source on the main loop. The idle source’s priority is - GLib.PRIORITY_LOW.- The purpose of the signal is to propagate a server-issued alert message from service to a user interface. The type hints at the nature of the alert message. - New in version 3.12. 
- service (
 - 
do_add_service(uid, protocol, type) virtual¶
- Parameters: - uid (str) – a unique identifier string
- protocol (str) – the service protocol
- type (Camel.ProviderType) – the service type
 - Returns: - a - Camel.Serviceinstance, or- None- Return type: - Instantiates a new - Camel.Servicefor session. The uid identifies the service for future lookup. The protocol indicates which- Camel.Providerholds the- GObject.GTypeof the- Camel.Servicesubclass to instantiate. The type explicitly designates the service as a- Camel.Storeor- Camel.Transport.- If the given uid has already been added, the existing - Camel.Servicewith that uid is returned regardless of whether it agrees with the given protocol and type.- If no - Camel.Provideris available to handle the given protocol, or if the- Camel.Providerdoes not specify a valid- GObject.GTypefor type, the function sets error and returns- None.- The returned - Camel.Serviceis referenced for thread-safety and must be unreferenced with- GObject.Object.unref() when finished with it.- New in version 3.2. 
- uid (
 - 
do_authenticate_sync(service, mechanism, cancellable) virtual¶
- Parameters: - service (Camel.Service) – aCamel.Service
- mechanism (strorNone) – a SASL mechanism name, orNone
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - Return type: - Authenticates service, which may involve repeated calls to - Camel.Service.authenticate() or- Camel.Service.authenticate_sync(). A- Camel.Sessionsubclass is largely responsible for implementing this, and should handle things like user prompts and secure password storage. These issues are out-of-scope for Camel.- If an error occurs, or if authentication is aborted, the function sets error and returns - False.- New in version 3.4. 
- service (
 - 
do_forget_password(service, item) virtual¶
- Parameters: - service (Camel.Service) – theCamel.Servicerejecting the password
- item (str) – an identifier, unique within this service, for the information
 - Returns: - Return type: - This function is used by a - Camel.Serviceto tell the application that the authentication information it provided via- Camel.Session.get_password() was rejected by the service. If the application was caching this information, it should stop, and if the service asks for it again, it should ask the user.- service and item identify the rejected authentication information, as with - Camel.Session.get_password().
- service (
 - 
do_forward_to_sync(folder, message, address, cancellable) virtual¶
- Parameters: - folder (Camel.Folder) – theCamel.Folderwhere message is located
- message (Camel.MimeMessage) – theCamel.MimeMessageto forward
- address (str) – the recipient’s email address
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - Return type: - Forwards message in folder to the email address(es) given by address. - If an error occurs, the function sets error and returns - False.- New in version 3.6. 
- folder (
 - 
do_get_filter_driver(type, for_folder) virtual¶
- Parameters: - type (str) – the type of filter (eg, “incoming”)
- for_folder (Camel.FolderorNone) – an optionalCamel.Folder, for which the filter driver will run, orNone
 - Returns: - a filter driver, loaded with applicable rules - Return type: - The optional for_folder can be used to determine which filters to add and which not. 
- type (
 - 
do_get_oauth2_access_token_sync(service, cancellable) virtual¶
- Parameters: - service (Camel.Service) – aCamel.Service
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - whether succeeded - out_access_token: - return location for the access token, or - None- out_expires_in: - return location for the token expiry, or - None- Return type: - Obtains the OAuth 2.0 access token for service along with its expiry in seconds from the current time (or 0 if unknown). - Free the returned access token with - GLib.free() when no longer needed.- New in version 3.28. 
- service (
 - 
do_get_password(service, prompt, item, flags) virtual¶
- Parameters: - service (Camel.Service) – theCamel.Servicethis query is being made by
- prompt (str) – prompt to provide to user
- item (str) – an identifier, unique within this service, for the information
- flags (int) – %CAMEL_SESSION_PASSWORD_REPROMPT, the prompt should force a reprompt %CAMEL_SESSION_PASSWORD_SECRET, whether the password is secret %CAMEL_SESSION_PASSWORD_STATIC, the password is remembered externally
 - Returns: - the authentication information or - None- Return type: - This function is used by a - Camel.Serviceto ask the application and the user for a password or other authentication data.- service and item together uniquely identify the piece of data the caller is concerned with. - prompt is a question to ask the user (if the application doesn’t already have the answer cached). If %CAMEL_SESSION_PASSWORD_SECRET is set, the user’s input will not be echoed back. - If %CAMEL_SESSION_PASSWORD_STATIC is set, it means the password returned will be stored statically by the caller automatically, for the current session. - The authenticator should set error to - Gio.IOErrorEnum.CANCELLEDif the user did not provide the information. The caller must- GLib.free() the information returned when it is done with it.
- service (
 - 
do_get_recipient_certificates_sync(flags, recipients, cancellable) virtual¶
- Parameters: - flags (int) – bit-or ofCamel.RecipientCertificateFlags
- recipients ([str]) – aGLib.PtrArrayof recipients
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - Whether succeeded, or better whether no fatal error happened. - out_certificates: - a - GLib.SListof gathered certificates- Return type: - Searches for S/MIME certificates or PGP keys for the given recipients, which are returned as base64 encoded strings in out_certificates. This is used when encrypting messages. The flags influence what the out_certificates will contain. The order of items in out_certificates should match the order of items in recipients, with - Nonedata for those which could not be found.- The function should return failure only if some fatal error happened. It’s not an error when certificates for some, or all, recipients could not be found. - This method is optional and the default implementation returns - Trueand sets the out_certificates to- None. It’s the only exception when the length of recipients and out_certificates can differ. In all other cases the length of the two should match.- The out_certificates will be freed with g_slist_free_full (certificates, - GLib.free); when done with it.- New in version 3.30. 
- flags (
 - 
do_job_finished(cancellable, error) virtual¶
- Parameters: - cancellable (Gio.CancellableorNone) –
- error (GLib.Error) –
 
- cancellable (
 - 
do_job_started(cancellable) virtual¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) –
 - 
do_lookup_addressbook(name) virtual¶
- Parameters: - name ( - str) – a name/address to lookup for- Returns: - whether found the name in any address book. - Return type: - bool- Looks up for the name in address books. - New in version 2.22. 
 - 
do_remove_service(service) virtual¶
- Parameters: - service ( - Camel.Service) – the- Camel.Serviceto remove- Removes a - Camel.Servicepreviously added by- Camel.Session.add_service().- New in version 3.2. 
 - 
do_trust_prompt(service, certificate, errors) virtual¶
- Parameters: - service (Camel.Service) – aCamel.Service
- certificate (Gio.TlsCertificate) – the peer’sGio.TlsCertificate
- errors (Gio.TlsCertificateFlags) – the problems with certificate
 - Returns: - the user’s trust level for certificate - Return type: - Prompts the user whether to accept certificate for service. The set of flags given in errors indicate why the certificate failed validation. - If an error occurs during prompting or if the user declines to respond, the function returns - Camel.CertTrust.UNKNOWNand the certificate will be rejected.- New in version 3.8. 
- service (
 - 
do_user_alert(service, type, message) virtual¶
- Parameters: - service (Camel.Service) – aCamel.Service
- type (Camel.SessionAlertType) – aCamel.SessionAlertType
- message (str) – the message for the user
 - Emits a #CamelSession:user_alert signal from an idle source on the main loop. The idle source’s priority is - GLib.PRIORITY_LOW.- The purpose of the signal is to propagate a server-issued alert message from service to a user interface. The type hints at the nature of the alert message. - New in version 3.12. 
- service (
 
- 
Signal Details¶
- 
Camel.Session.signals.job_finished(session, object, p0)¶
- Signal Name: - job-finished- Flags: - Parameters: - session (Camel.Session) – The object which received the signal
- object (Gio.CancellableorNone) –
- p0 (GLib.Error) –
 
- session (
- 
Camel.Session.signals.job_started(session, object)¶
- Signal Name: - job-started- Flags: - Parameters: - session (Camel.Session) – The object which received the signal
- object (Gio.CancellableorNone) –
 
- session (
- 
Camel.Session.signals.user_alert(session, service, type, message)¶
- Signal Name: - user-alert- Flags: - Parameters: - session (Camel.Session) – The object which received the signal
- service (Camel.Service) – theCamel.Serviceissuing the alert
- type (Camel.SessionAlertType) – theCamel.SessionAlertType
- message (str) – the alert message
 - This purpose of this signal is to propagate a server-issued alert message from service to a user interface. The type hints at the severity of the alert message. 
- session (
Property Details¶
- 
Camel.Session.props.junk_filter¶
- Name: - junk-filter- Type: - Camel.JunkFilter- Default Value: - None- Flags: - READABLE,- WRITABLE,- EXPLICIT_NOTIFY- Classifies messages as junk or not junk 
- 
Camel.Session.props.main_context¶
- Name: - main-context- Type: - GLib.MainContext- Default Value: - None- Flags: - READABLE- The main loop context on which to attach event sources 
- 
Camel.Session.props.network_monitor¶
- Name: - network-monitor- Type: - Gio.NetworkMonitor- Default Value: - None- Flags: - READABLE,- WRITABLE,- EXPLICIT_NOTIFY
- 
Camel.Session.props.online¶
- Name: - online- Type: - bool- Default Value: - True- Flags: - READABLE,- WRITABLE,- CONSTRUCT,- EXPLICIT_NOTIFY- Whether the shell is online