## ESourceMailIdentity ESourceMailIdentity — ESource extension for an email identity |

## Functions

const gchar * | e_source_mail_identity_get_address ()
gchar * | e_source_mail_identity_dup_address ()
void | e_source_mail_identity_set_address ()
const gchar * | e_source_mail_identity_get_name ()
gchar * | e_source_mail_identity_dup_name ()
void | e_source_mail_identity_set_name ()
const gchar * | e_source_mail_identity_get_organization ()
gchar * | e_source_mail_identity_dup_organization ()
void | e_source_mail_identity_set_organization ()
const gchar * | e_source_mail_identity_get_reply_to ()
gchar * | e_source_mail_identity_dup_reply_to ()
void | e_source_mail_identity_set_reply_to ()
const gchar * | e_source_mail_identity_get_signature_uid ()
gchar * | e_source_mail_identity_dup_signature_uid ()
void | e_source_mail_identity_set_signature_uid ()
const gchar * | e_source_mail_identity_get_aliases ()
gchar * | e_source_mail_identity_dup_aliases ()
void | e_source_mail_identity_set_aliases ()
GHashTable * | e_source_mail_identity_get_aliases_as_hash_table ()

## Types and Values

#define | E_SOURCE_EXTENSION_MAIL_IDENTITY
struct | ESourceMailIdentity

## Object Hierarchy

        GObject
        ╰── ESourceExtension
            ╰── ESourceMailIdentity

## Includes

    #include <libedataserver/libedataserver.h>

## Description

The ESourceMailIdentity extension describes an "identity" for a mail account, which is the information that other people see when they read your messages.

Access the extension as follows:

    1
    2
    3
    4
    5
    #include <libedataserver/libedataserver.h>

    ESourceMailIdentity *extension;

    extension = e_source_get_extension (source, E_SOURCE_EXTENSION_MAIL_IDENTITY);

## Functions

### e_source_mail_identity_get_address ()

    const gchar *
    e_source_mail_identity_get_address (ESourceMailIdentity *extension);

Returns the email address for this identity from which to send messages. This may be an empty string but will never be `NULL`.

#### Parameters

extension | an ESourceMailIdentity |

#### Returns

the sender's email address.

[nullable]

Since: 3.6

### e_source_mail_identity_dup_address ()

    gchar *
    e_source_mail_identity_dup_address (ESourceMailIdentity *extension);

Thread-safe variation of `e_source_mail_identity_get_address()`. Use this function when accessing `extension` from multiple threads.

The returned string should be freed with `g_free()` when no longer needed.

#### Parameters

extension | an ESourceMailIdentity |

#### Returns

a newly-allocated copy of “address”.

[nullable]

Since: 3.6

### e_source_mail_identity_set_address ()

    void
    e_source_mail_identity_set_address (ESourceMailIdentity *extension,
                                        const gchar *address);

Sets the email address for this identity from which to send messages.

The internal copy of `address` is automatically stripped of leading and trailing whitespace. If the resulting string is empty, `NULL` is set instead.

#### Parameters

extension | an ESourceMailIdentity |
address | the sender's email address, or `NULL`. | [nullable]

Since: 3.6

### e_source_mail_identity_get_name ()

    const gchar *
    e_source_mail_identity_get_name (ESourceMailIdentity *extension);

Returns the sender's name for this identity.

#### Parameters

extension | an ESourceMailIdentity |

#### Returns

the sender's name.

[nullable]

Since: 3.6

### e_source_mail_identity_dup_name ()

    gchar *
    e_source_mail_identity_dup_name (ESourceMailIdentity *extension);

Thread-safe variation of `e_source_mail_identity_get_name()`. Use this function when accessing `extension` from multiple threads.

The returned string should be freed with `g_free()` when no longer needed.

#### Parameters

extension | an ESourceMailIdentity |

#### Returns

a newly-allocated copy of “name”.

[nullable]

Since: 3.6

### e_source_mail_identity_set_name ()

    void
    e_source_mail_identity_set_name (ESourceMailIdentity *extension,
                                     const gchar *name);

Sets the sender's name for this identity.

The internal copy of `name` is automatically stripped of leading and trailing whitespace.

#### Parameters

extension | an ESourceMailIdentity |
name | the sender's name, or `NULL`. | [nullable]

Since: 3.6

### e_source_mail_identity_get_organization ()

    const gchar *
    e_source_mail_identity_get_organization
                                   (ESourceMailIdentity *extension);

Returns the sender's organization for this identity.

#### Parameters

extension | an ESourceMailIdentity |

#### Returns

the sender's organization.

[nullable]

Since: 3.6

### e_source_mail_identity_dup_organization ()

    gchar *
    e_source_mail_identity_dup_organization
                                   (ESourceMailIdentity *extension);

Thread-safe variation of `e_source_mail_identity_dup_organization()`. Use this function when accessing `extension` from multiple threads.

The returned string should be freed with `g_free()` when no longer needed.

#### Parameters

extension | an ESourceMailIdentity |

#### Returns

a newly-allocated copy of “organization”.

[nullable]

Since: 3.6

### e_source_mail_identity_set_organization ()

    void
    e_source_mail_identity_set_organization
                                   (ESourceMailIdentity *extension,
                                    const gchar *organization);

Sets the sender's organization for this identity.

The internal copy of `organization` is automatically stripped of leading and trailing whitespace. If the resulting string is empty, `NULL` is set instead.

#### Parameters

extension | an ESourceMailIdentity |
organization | the sender's organization, or `NULL`. | [nullable]

Since: 3.6

### e_source_mail_identity_get_reply_to ()

    const gchar *
    e_source_mail_identity_get_reply_to (ESourceMailIdentity *extension);

Returns the email address for this identity to which recipients should send replies.

#### Parameters

extension | an ESourceMailIdentity |

#### Returns

the sender's reply-to address.

[nullable]

Since: 3.6

### e_source_mail_identity_dup_reply_to ()

    gchar *
    e_source_mail_identity_dup_reply_to (ESourceMailIdentity *extension);

Thread-safe variation of `e_source_mail_identity_get_reply_to()`. Use this function when accessing `extension` from multiple threads.

The returned string should be freed with `g_free()` when no longer needed.

#### Parameters

extension | an ESourceMailIdentity |

#### Returns

a newly-allocated copy of “reply-to”.

[nullable]

Since: 3.6

### e_source_mail_identity_set_reply_to ()

    void
    e_source_mail_identity_set_reply_to (ESourceMailIdentity *extension,
                                         const gchar *reply_to);

Sets the email address for this identity to which recipients should send replies.

The internal copy of `reply_to` is automatically stripped of leading and trailing whitespace. If the resulting string is empty, `NULL` is set instead.

#### Parameters

extension | an ESourceMailIdentity |
reply_to | the sender's reply-to address, or `NULL`. | [nullable]

Since: 3.6

### e_source_mail_identity_get_signature_uid ()

    const gchar *
    e_source_mail_identity_get_signature_uid
                                   (ESourceMailIdentity *extension);

Returns the “uid” of an ESource describing a mail signature.

If the user does not want to use a signature for this identity, the convention is to set the “signature-uid” property to "none".

#### Parameters

extension | an ESourceMailIdentity |

#### Returns

the sender's signature ID, or "none".

[nullable]

Since: 3.6

### e_source_mail_identity_dup_signature_uid ()

    gchar *
    e_source_mail_identity_dup_signature_uid
                                   (ESourceMailIdentity *extension);

Thread-safe variation of `e_source_mail_identity_get_signature_uid()`. Use this function when accessing `extension` from multiple threads.

The returned string should be freed with `g_free()` when no longer needed.

#### Parameters

extension | an ESourceMailIdentity |

#### Returns

a newly-allocated copy of “signature-uid”.

[nullable]

Since: 3.6

### e_source_mail_identity_set_signature_uid ()

    void
    e_source_mail_identity_set_signature_uid
                                   (ESourceMailIdentity *extension,
                                    const gchar *signature_uid);

Sets the “uid” of an ESource describing a mail signature.

If the user does not want to use a signature for this identity, the convention is to set the “signature-uid” property to "none". In keeping with that convention, the property will be set to "none" if `signature_uid` is `NULL` or an empty string.

#### Parameters

extension | an ESourceMailIdentity |
signature_uid | the sender's signature ID, or `NULL`. | [nullable]

Since: 3.6

### e_source_mail_identity_get_aliases ()

    const gchar *
    e_source_mail_identity_get_aliases (ESourceMailIdentity *extension);

Returns the email address aliases for this identity. These are comma-separated email addresses which may or may not contain also different name. This may be an empty string, but will never be `NULL`. There can be used `camel_address_decode()` on a CamelInternetAddress to decode the list of aliases.

#### Parameters

extension | an ESourceMailIdentity |

#### Returns

the sender's email address aliases.

[nullable]

Since: 3.24

### e_source_mail_identity_dup_aliases ()

    gchar *
    e_source_mail_identity_dup_aliases (ESourceMailIdentity *extension);

Thread-safe variation of `e_source_mail_identity_get_aliases()`. Use this function when accessing `extension` from multiple threads.

The returned string should be freed with `g_free()` when no longer needed.

#### Parameters

extension | an ESourceMailIdentity |

#### Returns

a newly-allocated copy of “aliases”.

[nullable]

Since: 3.24

### e_source_mail_identity_set_aliases ()

    void
    e_source_mail_identity_set_aliases (ESourceMailIdentity *extension,
                                        const gchar *aliases);

Sets the email address aliases for this identity. These are comma-separated email addresses which may or may not contain also different name.

The internal copy of `aliases` is automatically stripped of leading and trailing whitespace. If the resulting string is empty, `NULL` is set instead.

#### Parameters

extension | an ESourceMailIdentity |
aliases | the sender's email address aliases, or `NULL`. | [nullable]

Since: 3.24

### e_source_mail_identity_get_aliases_as_hash_table ()

    GHashTable *
    e_source_mail_identity_get_aliases_as_hash_table
                                   (ESourceMailIdentity *extension);

Returns a set aliases as a hash table with address as key and name as value of the hash table. The name can be sometimes empty or NULL, thus rather use `g_hash_table_contains()` when checking for particular address. The addresses are compared case insensitively. The same addresses with a different name are included only once, the last variant of it. Use `e_source_mail_identity_get_aliases()` if you need more fine-grained control on the list of aliases.

#### Parameters

extension | an ESourceMailIdentity |

#### Returns

A newly created GHashTable will all the aliases. Returns `NULL` if there are none set. Use `g_hash_table_destroy()` to free the returned hash table.

[transfer full][element-type utf8 utf8][nullable]

Since: 3.24

## Types and Values

### E_SOURCE_EXTENSION_MAIL_IDENTITY

    #define E_SOURCE_EXTENSION_MAIL_IDENTITY "Mail Identity"

Pass this extension name to `e_source_get_extension()` to access ESourceMailIdentity. This is also used as a group name in key files.

Since: 3.6

### struct ESourceMailIdentity

    struct ESourceMailIdentity;

Contains only private data that should be read and manipulated using the functions below.

Since: 3.6