|  | Home |

# QMail Namespace Reference

The QMail namespace contains miscellaneous functionality used by the Messaging framework. More...

        #include <QMail>

## Types

enum | SaslMechanism { NoMechanism, LoginMechanism, PlainMechanism, CramMd5Mechanism }

## Functions

QString | baseSubject ( const QString & subject, bool * replyOrForward )
QSqlDatabase | createDatabase ()
QString | dataPath ()
QStringList | extensionsForMimeType ( const QString & mimeType )
int | fileLock ( const QString & lockFile )
bool | fileUnlock ( int id )
QString | lastSystemErrorMessage ()
QStringList | messageIdentifiers ( const QString & str )
QString | messageServerPath ()
QString | messageSettingsPath ()
QString | mimeTypeFromFileName ( const QString & filename )
QString | pluginsPath ()
StringType | quoteString ( const StringType & src )
QString | sslCertsPath ()
QString | tempPath ()
StringType | unquoteString ( const StringType & src )
void | usleep ( unsigned long usecs )

## Detailed Description

The QMail namespace contains miscellaneous functionality used by the Messaging framework.

## Type Documentation

### enum QMail::SaslMechanism

This enum type describes the available SASL (Simple Authentication and Security Layer RFC 2822 ) mechanisms for authenticating with external servers using protocol plugins. They should be used in conjunction with a data security mechanism such as TLS (Transport Layer Security RFC 4346)

Constant | Value | Description
--- | --- | ---
`QMail::NoMechanism` | `0` | No SASL mechanism will be used.
`QMail::LoginMechanism` | `1` | Simple clear-text user/password authentication mechanism, obsoleted by Plain.
`QMail::PlainMechanism` | `2` | Simple clear-text user/password authentication mechanism.
`QMail::CramMd5Mechanism` | `3` | A challenge-response authentication mechanism.

## Function Documentation

### QString QMail::baseSubject ( const QString & subject, bool * replyOrForward )

Returns the 'base' form of subject, using the transformation defined by RFC5256. If the original subject contains any variant of the tokens "Re" or "Fwd" recognized by RFC5256, then replyOrForward will be set to true.

### QSqlDatabase QMail::createDatabase ()

Returns the database where the Messaging framework will store its message meta-data. If the database does not exist, it is created.

### QString QMail::dataPath ()

Returns the path to where the Messaging framework will store its data files.

### QStringList QMail::extensionsForMimeType ( const QString & mimeType )

Returns a list of valid file extensions for the mime type string mimeType or an empty list if the mime type is unrecognized.

### int QMail::fileLock ( const QString & lockFile )

Convenience function that attempts to obtain a lock on a file with name lockFile. It is not necessary to create lockFile as this file is created temporarily.

Returns the id of the lockFile if successful or `-1` for failure.

See also QMail::fileUnlock().

### bool QMail::fileUnlock ( int id )

Convenience function that attempts to unlock the file with identifier id that was locked by `QMail::fileLock`.

Returns `true` for success or `false` otherwise.

See also QMail::fileLock().

### QString QMail::lastSystemErrorMessage ()

Returns the text describing the last error reported by the underlying platform.

### QStringList QMail::messageIdentifiers ( const QString & str )

Returns the sequence of message identifiers that can be extracted from str. Message identifiers must conform to the definition given by RFC 5256.

### QString QMail::messageServerPath ()

Returns the path to where the Messaging framework will invoke the messageserver process.

### QString QMail::messageSettingsPath ()

Returns the path to where the Messaging framework will search for settings information.

### QString QMail::mimeTypeFromFileName ( const QString & filename )

Returns the string mime type based on the filename filename.

### QString QMail::pluginsPath ()

Returns the path to where the Messaging framework will look for its plugin directories

### StringType QMail::quoteString ( const StringType & src )

Returns src surrounded by double-quotes, which are added if not already present.

### QString QMail::sslCertsPath ()

Returns the path to where the Messaging framework will search for SSL certificates.

### QString QMail::tempPath ()

Returns the path to where the Messaging framework will store its temporary files.

### StringType QMail::unquoteString ( const StringType & src )

If src has double-quote as the first and last characters, return the string between those characters; otherwise, return the original string.

### void QMail::usleep ( unsigned long usecs )

Suspends the current process for usecs microseconds.