Location:
IMAPSET.H
Link against: imcm.lib
class CImImap4Settings : public CImBaseEmailSettings;
Settings for connection to and use of an IMAP4 mail server and its mailboxes.
Messaging clients should use an instance of this class to specify and retrieve configuration settings that are used by an IMAP4 service when executing email operations.
Service settings include:
server log on settings (user name and password)
message header synchronisation strategy and synchronisation limits
message getting options, such as maximum size. Note that these options are not used by the IMAP MTM. They can be used by client applications to store user preferences, and be used by the client when issuing get commands.
miscelleanous settings, including whether IMAP IDLE should be used
CImImap4Settings objects are created and accessed through CEmailAccounts
. CEmailAccounts
can also be used to get the connection settings, such as the ISP to use, used to access an IMAP server.
Settings for a service are associated with a service-type entry in the Message Server'smessage store. However the settings are not actually stored in the message store, but in the device's Central Repository data store.
CBase
- Base class for all classes to be instantiated on the heap
CImBaseEmailSettings
- Parent class for
CImImap4Settings
- Settings for connection to and use of an IMAP4 mail server and its mailboxes
Defined in CImImap4Settings
:
AcknowledgeReceipts()
, AttachmentSizeLimit()
, AutoSendOnConnect()
, BodyTextSizeLimit()
, CImImap4Settings()
, CopyL()
, DeleteEmailsWhenDisconnecting()
, DisconnectedUserMode()
, FetchSize()
, FolderPath()
, GetMailOptions()
, ImapIdle()
, ImapIdleTimeout()
, InboxSynchronisationLimit()
, LoginName()
, MailboxSynchronisationLimit()
, MaxEmailSize()
, PartialMailOptions()
, Password()
, PathSeparator()
, Reset()
, SearchString()
, SetAcknowledgeReceipts()
, SetAttachmentSizeLimitL()
, SetAutoSendOnConnect()
, SetBodyTextSizeLimitL()
, SetDeleteEmailsWhenDisconnecting()
, SetDisconnectedUserMode()
, SetFetchSizeL()
, SetFolderPathL()
, SetGetMailOptions()
, SetImapIdle()
, SetImapIdleTimeoutL()
, SetInboxSynchronisationLimit()
, SetLoginNameL()
, SetMailboxSynchronisationLimit()
, SetMaxEmailSize()
, SetPartialMailOptionsL()
, SetPasswordL()
, SetPathSeparator()
, SetSearchStringL()
, SetSubscribe()
, SetSyncRateL()
, SetSynchronise()
, SetUpdatingSeenFlags()
, SetUseExpunge()
, Subscribe()
, SyncRate()
, Synchronise()
, UpdatingSeenFlags()
, UseExpunge()
, operator==()
, ~CImImap4Settings()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
Inherited from CImBaseEmailSettings
:
EBaseEmailSettingsClearFlag
,
EBaseEmailSettingsLastUsedFlag
,
EBaseEmailSettingsSSLWrappedSockets
,
EBaseEmailSettingsSecureSockets
,
Port()
,
SSLWrapper()
,
SecureSockets()
,
ServerAddress()
,
SetPort()
,
SetSSLWrapper()
,
SetSecureSockets()
,
SetServerAddressL()
,
TImBaseEmailSettings
,
iFlags
,
iPortNumber
IMPORT_C CImImap4Settings();
Allocates and creates a new CImImap4Settings object initialised to default values.
IMPORT_C const TPtrC8 LoginName() const;
Retrieves the configured login user name (mailbox) of the IMAP4 service.
|
IMPORT_C void SetLoginNameL(const TDesC8 &aLoginName);
Configures the login user name (mailbox) for the IMAP4 service.
|
IMPORT_C const TPtrC8 Password() const;
Retrieves the configured login password that will be sent during authentication with the IMAP4 server.
|
IMPORT_C void SetPasswordL(const TDesC8 &aPassword);
Configures the login password for the IMAP4 service.
|
IMPORT_C const TPtrC8 FolderPath() const;
Retrieves the configured path of the IMAP4 mailbox on the server if the user's primary mailbox is not in the Inbox folder.
Most of the time this setting will not have to be configured, however this may need to be altered by the user for use with some IMAP4 servers. Refer to RFC 3501 Section 5.1 Mailbox Naming for more information.
The default setting is empty.
|
IMPORT_C void SetFolderPathL(const TDesC8 &aFolderPath);
Specifies the path to the IMAP4 mailbox on the server if the user's primary mailbox is not in the Inbox folder.
Most of the time this setting will not have to be configured, however this may need to be altered by the user for use with some IMAP4 servers. Refer to RFC 3501 Section 5.1 Mailbox Naming for more information.
The default setting is empty.
|
IMPORT_C const TPtrC8 SearchString() const;
Gets the search string used to filter which messages are synchronised.
For details, see SetSearchStringL()
.
|
IMPORT_C void SetSearchStringL(const TDesC8 &aSearchString);
Sets a search string for the service.
This setting allows a filter to be specified that prevents certain e-mail messages from being synchronised onto the device when a client requests a synchronisation. An IMAP Search command is issued to the server to provide a list of messages to be synchronised.
Note that when a synchronisation command is given with a search string set:
Mailbox synchronisation limits are ignored.
Existing messages that do not match the search criteria, and that have not had their body fetched, are deleted locally.
If the remote server does not support the filter, or the filter is malformed, the synchronisation command will return an error.
To remove a filter, set the search string to KNullDesC.
A complete overview of the syntax of search strings is given in section 6.4.4 (SEARCH Command) of RFC 3501. Some valid example search strings are:
FLAGGED SINCE 1-Feb-1994 NOT FROM "Smith"
BODY "some text in the body"
|
IMPORT_C TText8 PathSeparator() const;
Retrieves the character configured to separate hierarchical mailbox names on the IMAP4 server. Refer to RFC 3501 section 5.1.1 for more information.
The default setting an empty null-terminated string.
|
IMPORT_C void SetPathSeparator(const TText8 aPathSeparator);
Specifies the character used to separate hierarchical mailbox names on the IMAP4 server. Refer to RFC 3501 section 5.1.1 for more information.
The default setting an empty null-terminated string.
|
IMPORT_C TBool DisconnectedUserMode() const;
Checks if disconnected user mode is configured.
If disconnected user mode is enabled by calling SetDisconnectedUserMode()
, then the IMAP4 client MTM (CImap4ClientMtm
) will accept message operations, such as deleting messages from a server, while the user is offline. The operations are stored
and executed when the user connects again.
|
IMPORT_C void SetDisconnectedUserMode(TBool aFlag);
Enables the IMAP4 client MTM (CImap4ClientMtm
) to accept message operations while disconnected.
If disconnected user mode is enabled the IMAP4 client MTM will accept message operations such as deleting messages from a server, while the user is offline. The operations are stored and executed when the user connects again.
|
IMPORT_C void SetSynchronise(const TFolderSyncType aType);
Sets the method for synchronising folder information with the server.
The default setting is EUseRemote.
|
IMPORT_C TFolderSyncType Synchronise() const;
Retrieves the method for synchronising folder information with the server.
The default setting is EUseRemote.
|
IMPORT_C void SetSubscribe(const TFolderSubscribeType aType);
Sets the method for synchronising IMAP4 subscription information with a server.
The default setting is EUpdateNeither.
|
IMPORT_C TFolderSubscribeType Subscribe() const;
Retrieves the configured method for synchronising IMAP4 subscription information with a server.
The default setting is EUpdateNeither.
|
IMPORT_C TBool AutoSendOnConnect() const;
|
IMPORT_C void SetAutoSendOnConnect(TBool aFlag);
Configures the IMAP4 service to send queued emails associated with the same internet access point to be sent first before logging onto the IMAP4 server.
The internet access point for each email service (POP3, IMAP4, SMTP) is configured using CImIAPPreferences
.
|
IMPORT_C TUint MaxEmailSize() const;
Returns the maximum message size in bytes to be downloaded.
This value is set by a calling SetMaxEmailSize()
. The default setting is KMaxInt.
Note that the value of this setting is not used by the IMAP MTM. It can be used by client applications to store a user preference,
and used when issuing get commands with CImap4ClientMtm::InvokeAsyncFunctionL()
. Such commands take a TImImap4GetMailInfo
parameter, which has a iMaxEmailSize setting.
|
IMPORT_C void SetMaxEmailSize(const TUint aMaxEmailSize);
Sets the maximum message size in bytes to be downloaded.
The default setting is KMaxInt.
Note that the value of this setting is not used by the IMAP MTM. It can be used by client applications to store a user preference,
and used when issuing get commands with CImap4ClientMtm::InvokeAsyncFunctionL()
. Such commands take a TImImap4GetMailInfo
parameter, which has a iMaxEmailSize setting.
|
IMPORT_C TBool DeleteEmailsWhenDisconnecting() const;
Checks whether the caller has enabled messages marked to be deleted while offline to be expunged from the server when disconnecting from the next online session.
Otherwise they are marked for delete and expunged during the initial synchronisation.
To enable this functionality, call SetDeleteEmailsWhenDisconnecting()
.
|
IMPORT_C void SetDeleteEmailsWhenDisconnecting(TBool aFlag);
If enabled, messages marked as deleted while offline will be deleted when logging off from the next IMAP4 session. If disabled, messages are deleted when the client synchronises with the server after a connection.
Enabling this functionality has the advantage of speeding up synchronisation at the expense of disconnection speed.
|
IMPORT_C TBool AcknowledgeReceipts() const;
Checks whether the caller has enabled this setting by calling SetAcknowledgeReceipts()
.
This flag is a convenience setting for Messaging client applications that may wish to store whether or not to send a receipt
email message to the sender when the email has been received. The Messaging subsystem does not use this setting, and has to
be explicitly commanded by the Messaging client application to send a receipt notification. Messaging applications can use
CImHeader
to check if a message has a return receipt address. Receipt notification messages can be created using CImEmailOperation
, and sent using the SMTP client MTM.
|
IMPORT_C void SetAcknowledgeReceipts(TBool aFlag);
Sets or resets a flag.
This flag is a convenience setting for Messaging client applications that may wish to store whether or not to send a receipt
email message to the sender when the email has been received. The Messaging subsystem does not use this setting, and has to
be explicitly commanded by the Messaging client application to send a receipt notification. Messaging applications can use
CImHeader
to check if a message has a return receipt address. Receipt notification messages can be created using CImEmailOperation
, and sent using the SMTP client MTM.
|
IMPORT_C TImap4GetMailOptions GetMailOptions() const;
Gets a preference setting for which components of a message (headers, body, attachments) to fetch when getting messages from a remote server.
Note that the value of this setting is not used by the IMAP MTM. It can be used by client applications to store a user preference,
and used when issuing get commands with CImap4ClientMtm::InvokeAsyncFunctionL()
. Such commands take a TImImap4GetMailInfo
parameter, which has a TImap4GetMailOptions setting.
The setting is specified using SetGetMailOptions()
.
|
IMPORT_C void SetGetMailOptions(TImap4GetMailOptions aGetMailOptions);
Sets a preference setting for which components of a message (headers, body, attachments) to fetch when getting messages from a remote server.
Note that the value of this setting is not used by the IMAP MTM. It can be used by client applications to store a user preference,
and used when issuing get commands with CImap4ClientMtm::InvokeAsyncFunctionL()
. Such commands take a TImImap4GetMailInfo
parameter, which has a TImap4GetMailOptions setting.
|
IMPORT_C CImImap4Settings &CopyL(const CImImap4Settings &aCImImap4Settings);
Copies the configuration settings from another IMAP4 settings object into this object.
|
|
IMPORT_C TBool operator==(const CImImap4Settings &aCImImap4Settings) const;
Equality operator.
|
|
IMPORT_C TInt32 InboxSynchronisationLimit() const;
Gets the maximum number of new messages in the Inbox that are synchronised when a synchronisation takes place.
This setting is configured by calling SetInboxSynchronisationLimit()
. To configure limits for other folders, call SetMailboxSynchronisationLimit()
.
The default setting is to synchronise all messages in the Inbox folder.
|
IMPORT_C void SetInboxSynchronisationLimit(const TInt32 aInboxSyncLimit);
Sets the maximum number of new messages in the Inbox that are synchronised when a synchronisation takes place.
The default setting is to synchronise all messages in the Inbox folder.
|
IMPORT_C TInt32 MailboxSynchronisationLimit() const;
Gets the maximum number of new messages, for folders other than the Inbox, that are synchronised when a synchronisation takes place.
This setting is configured by calling SetMailboxSynchronisationLimit()
. To specify synchronisation limits for just the Inbox folder, call SetInboxSynchronisationLimit()
.
The default setting is to synchronise all messages.
|
IMPORT_C void SetMailboxSynchronisationLimit(const TInt32 aMailboxSyncLimit);
Sets the maximum number of new messages, for folders other than the Inbox, that are synchronised when a synchronisation takes place.
The default setting is to synchronise all messages.
|
IMPORT_C TBool UpdatingSeenFlags() const;
Retrieves whether the IMAP4 seen flag of new messages will be set on the server only when the message has been marked as read, or when the message has been synchronised.
The default setting is EFalse which means that the seen flag will be set on the server when the new message has been synchronised
with the client. The messaging application can mark the message as being read (seen) by calling TMsvEntry::SetUnread()
.
|
IMPORT_C void SetUpdatingSeenFlags(TBool aFlag);
Specifies whether the IMAP4 seen flag of messages will be set on the server only when the message has been marked as read, or when the message has been synchronised.
The default setting is EFalse which means that the seen flag will be set on the server when the new message has been synchronised
with the client. The messaging application can mark the message as being read (seen) by calling TMsvEntry::SetUnread()
.
|
IMPORT_C TInt SyncRate() const;
Retrieves the rate in seconds at which the Inbox is refreshed.
The default setting is 300 seconds (5 minutes).
This setting applies only when the KIMAP4MTMConnectAndSyncCompleteAfterDisconnect
command is used to periodically resynchronise the Inbox.
|
IMPORT_C void SetSyncRateL(TInt aSyncRate);
Specifies the rate in seconds at which the Inbox will be refreshed when connected.
The default setting is 300 seconds (5 minutes).
This setting applies only when the KIMAP4MTMConnectAndSyncCompleteAfterDisconnect
command is used to periodically resynchronise the Inbox.
|
IMPORT_C TUint FetchSize() const;
Retrieves the IMAP fetch size.
When downloading large attachments, data is requested (fetched) in increments. The larger the fetch size, fewer fetch commands are sent to the IMAP4 server. This speeds up the attachment download rate, but only to a limit. The limit is network specific. A fetch size that is too large will degrade performance shortly after downloading an attachment is cancelled, because the fetched data will still be incomming on the socket after cancellation.
The default fetch size is 20480 bytes (20 KB). The default value is optimum for actual connection rates up to 2 Mbps.
|
IMPORT_C void SetFetchSizeL(TUint aFetchSizeBytes);
Specifies the IMAP fetch size in bytes.
When downloading large attachments, data is requested (fetched) in increments. The larger the fetch size, fewer fetch commands are sent to the IMAP4 server. This speeds up the attachment download rate, but only to a limit. The limit is network specific. A fetch size that is too large will degrade performance shortly after downloading an attachment is cancelled, because the fetched data will still be incomming on the socket after cancellation.
The default fetch size is 20480 bytes (20 KB). The default value is optimum for actual connection rates up to 2 Mbps.
|
IMPORT_C TBool ImapIdle() const;
Retrieves whether the IMAP IDLE command should be used as defined in RFC2177.
The default setting is ETrue which means that the IMAP IDLE command will be used if the server supports it.
|
IMPORT_C void SetImapIdle(TBool aFlag);
Specifies whether the IMAP IDLE command should be used as defined in RFC2177.
The default setting is ETrue which means that the IMAP IDLE command will be used if the server supports it.
|
IMPORT_C TInt ImapIdleTimeout() const;
Retrieves the IMAP IDLE timeout seconds.
The default setting is 1740 seconds (29 minutes).
|
IMPORT_C void SetImapIdleTimeoutL(TInt aIdleTimeout);
Specifies the IMAP IDLE timeout in seconds.
The default setting is 1740 seconds (29 minutes).
|
IMPORT_C TImImap4PartialMailOptions PartialMailOptions() const;
Gets the option for how
The specification can be as follows:
No limits on the body part, only body text, only attachments, the entire message (both body text and attachment) with size limits on body text and attachment the entire message with total size limit (ECumulative - body text + attachment <= total size limit) when synchronising with the IMAP4 server.
The specification for the body parts to be downloaded is set by SetPartialMailOptionsL()
.
|
IMPORT_C void SetPartialMailOptionsL(TImImap4PartialMailOptions aPartialMailOptions);
Specifies whether no limits on the body parts, only body text, only attachments, the entire message (both body text and attachment) with size limits on body text and attachment or the entire message with total size limit (ECumulative - body text + attachment <= Total size limit) will be downloaded when synchronising with the IMAP4 server.
Note that the value of this setting is not used by the IMAP MTM. It can be used by client applications to store a user preference,
and used when issuing populate commands with CImap4ClientMtm::InvokeAsyncFunctionL()
. Such commands take a TImImap4GetPartialMailInfo
parameter, which has a iPartialMailOptions setting.
|
IMPORT_C TInt32 BodyTextSizeLimit() const;
Retrieves the maximum body text size limit for the partial fetch of message body. If text/plain part + text/html part (alternative part) < body text size limit then fetch text/html part else fetch only text/plain part.
The default body text size limit is KMaxTInt. The body text size limit is set by SetBodyTextSizeLimitL()
.
|
IMPORT_C void SetBodyTextSizeLimitL(TInt32 aBodyTextSizeLimit);
Specifies the maximum body text size limit for the partial fetch of message body.
The default body text size limit is KMaxTInt.
Note that the value of this setting is not used by the IMAP MTM. It can be used by client applications to store a user preference,
and used when issuing populate commands with CImap4ClientMtm::InvokeAsyncFunctionL()
. Such commands take a TImImap4GetPartialMailInfo
parameter, which has a iBodyTextSizeLimit setting.
|
IMPORT_C TInt32 AttachmentSizeLimit() const;
Retrieves the maximum attachment size limit for the partial fetch of attachments in a message.
The default attachment size limit is KMaxTInt. The attachment size limit is set by SetAttachmentSizeLimitL()
.
|
IMPORT_C void SetAttachmentSizeLimitL(TInt32 aAttachmentSizeLimit);
Specifies the maximum attachment size limit for the partial fetch of attachments in a message.
The default attachment size limit is KMaxTInt.
Note that the value of this setting is not used by the IMAP MTM. It can be used by client applications to store a user preference,
and used when issuing populate commands with CImap4ClientMtm::InvokeAsyncFunctionL()
. Such commands take a TImImap4GetPartialMailInfo
parameter, which has a iAttachmentSizeLimit setting.
|
IMPORT_C TBool UseExpunge() const;
Check whether the KImap4EmailExpungeFlag is set in CImImap4Settings
|
IMPORT_C void SetUseExpunge(TBool aFlag);
Allows KImap4EmailExpungeFlag to be set. It is used by the state machine in CImapCompoundCopyToLocal,CImapCompoundCopyWithinService, CImapCompoundDelete and CImapFolder. The state machines use the flag to decide whether to use EXPUNGE command to perform the deletion.
The settings are written to the central repository.
|