## CamelNetworkSettings CamelNetworkSettings |

## Synopsis

                        CamelNetworkSettings;
    const gchar *       camel_network_settings_get_auth_mechanism
                                                            (CamelNetworkSettings *settings);
    gchar *             camel_network_settings_dup_auth_mechanism
                                                            (CamelNetworkSettings *settings);
    void                camel_network_settings_set_auth_mechanism
                                                            (CamelNetworkSettings *settings,
                                                             const gchar *auth_mechanism);
    const gchar *       camel_network_settings_get_host     (CamelNetworkSettings *settings);
    gchar *             camel_network_settings_dup_host     (CamelNetworkSettings *settings);
    void                camel_network_settings_set_host     (CamelNetworkSettings *settings,
                                                             const gchar *host);
    guint16             camel_network_settings_get_port     (CamelNetworkSettings *settings);
    void                camel_network_settings_set_port     (CamelNetworkSettings *settings,
                                                             guint16 port);
    enum                CamelNetworkSecurityMethod;
    CamelNetworkSecurityMethod camel_network_settings_get_security_method
                                                            (CamelNetworkSettings *settings);
    void                camel_network_settings_set_security_method
                                                            (CamelNetworkSettings *settings,
                                                             CamelNetworkSecurityMethod method);
    const gchar *       camel_network_settings_get_user     (CamelNetworkSettings *settings);
    gchar *             camel_network_settings_dup_user     (CamelNetworkSettings *settings);
    void                camel_network_settings_set_user     (CamelNetworkSettings *settings,
                                                             const gchar *user);

## Object Hierarchy

      GInterface
       +----CamelNetworkSettings

## Prerequisites

CamelNetworkSettings requires CamelSettings.

## Known Implementations

CamelNetworkSettings is implemented by CamelIMAPXSettings.

## Properties

      "auth-mechanism"           gchar*                : Read / Write / Construct
      "host"                     gchar*                : Read / Write / Construct
      "port"                     guint                 : Read / Write / Construct
      "security-method"          CamelNetworkSecurityMethod  : Read / Write / Construct
      "user"                     gchar*                : Read / Write / Construct

## Description

## Details

### CamelNetworkSettings

    typedef struct _CamelNetworkSettings CamelNetworkSettings;

Since 3.2

### camel_network_settings_get_auth_mechanism ()

    const gchar *       camel_network_settings_get_auth_mechanism
                                                            (CamelNetworkSettings *settings);

Returns the mechanism name used to authenticate to a network service. Often this refers to a SASL mechanism such as "LOGIN" or "GSSAPI".

`settings` : | a CamelNetworkSettings
Returns : | the authentication mechanism name

Since 3.4

### camel_network_settings_dup_auth_mechanism ()

    gchar *             camel_network_settings_dup_auth_mechanism
                                                            (CamelNetworkSettings *settings);

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

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

`settings` : | a CamelNetworkSettings
Returns : | a newly-allocated copy of "auth-mechanism"

Since 3.4

### camel_network_settings_set_auth_mechanism ()

    void                camel_network_settings_set_auth_mechanism
                                                            (CamelNetworkSettings *settings,
                                                             const gchar *auth_mechanism);

Sets the mechanism name used to authenticate to a network service. Often this refers to a SASL mechanism such as "LOGIN" or "GSSAPI". The "auth-mechanism" property is automatically stripped of leading and trailing whitespace.

`settings` : | a CamelNetworkSettings
`auth_mechanism` : | an authentication mechanism name, or `NULL`

Since 3.4

### camel_network_settings_get_host ()

    const gchar *       camel_network_settings_get_host     (CamelNetworkSettings *settings);

Returns the host name used to authenticate to a network service.

`settings` : | a CamelNetworkSettings
Returns : | the host name of a network service

Since 3.4

### camel_network_settings_dup_host ()

    gchar *             camel_network_settings_dup_host     (CamelNetworkSettings *settings);

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

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

`settings` : | a CamelNetworkSettings
Returns : | a newly-allocated copy of "host"

Since 3.4

### camel_network_settings_set_host ()

    void                camel_network_settings_set_host     (CamelNetworkSettings *settings,
                                                             const gchar *host);

Sets the host name used to authenticate to a network service. The "host" property is automatically stripped of leading and trailing whitespace.

`settings` : | a CamelNetworkSettings
`host` : | a host name, or `NULL`

Since 3.4

### camel_network_settings_get_port ()

    guint16             camel_network_settings_get_port     (CamelNetworkSettings *settings);

Returns the port number used to authenticate to a network service.

`settings` : | a CamelNetworkSettings
Returns : | the port number of a network service

Since 3.4

### camel_network_settings_set_port ()

    void                camel_network_settings_set_port     (CamelNetworkSettings *settings,
                                                             guint16 port);

Sets the port number used to authenticate to a network service.

`settings` : | a CamelNetworkSettings
`port` : | a port number

Since 3.4

### enum CamelNetworkSecurityMethod

    typedef enum {
    	CAMEL_NETWORK_SECURITY_METHOD_NONE,
    	CAMEL_NETWORK_SECURITY_METHOD_SSL_ON_ALTERNATE_PORT,
    	CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT
    } CamelNetworkSecurityMethod;

Methods for establishing an encrypted (or unencrypted) network connection.

`CAMEL_NETWORK_SECURITY_METHOD_NONE` | Use an unencrypted network connection.
`CAMEL_NETWORK_SECURITY_METHOD_SSL_ON_ALTERNATE_PORT` | Use SSL by connecting to an alternate port number.
`CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT` | Use SSL or TLS by connecting to the standard port and invoking STARTTLS before authenticating. This is the recommended method.

Since 3.2

### camel_network_settings_get_security_method ()

    CamelNetworkSecurityMethod camel_network_settings_get_security_method
                                                            (CamelNetworkSettings *settings);

Returns the method used to establish a secure (or unsecure) network connection.

`settings` : | a CamelNetworkSettings
Returns : | the security method

Since 3.2

### camel_network_settings_set_security_method ()

    void                camel_network_settings_set_security_method
                                                            (CamelNetworkSettings *settings,
                                                             CamelNetworkSecurityMethod method);

Sets the method used to establish a secure (or unsecure) network connection. Note that changing this setting has no effect on an already-established network connection.

`settings` : | a CamelNetworkSettings
`method` : | the security method

Since 3.2

### camel_network_settings_get_user ()

    const gchar *       camel_network_settings_get_user     (CamelNetworkSettings *settings);

Returns the user name used to authenticate to a network service.

`settings` : | a CamelNetworkSettings
Returns : | the user name of a network service

Since 3.4

### camel_network_settings_dup_user ()

    gchar *             camel_network_settings_dup_user     (CamelNetworkSettings *settings);

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

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

`settings` : | a CamelNetworkSettings
Returns : | a newly-allocated copy of "user"

Since 3.4

### camel_network_settings_set_user ()

    void                camel_network_settings_set_user     (CamelNetworkSettings *settings,
                                                             const gchar *user);

Sets the user name used to authenticate to a network service. The "user" property is automatically stripped of leading and trailing whitespace.

`settings` : | a CamelNetworkSettings
`user` : | a user name, or `NULL`

Since 3.4

## Property Details

### The `"auth-mechanism"` property

      "auth-mechanism"           gchar*                : Read / Write / Construct

Authentication mechanism name.

Default value: NULL

### The `"host"` property

      "host"                     gchar*                : Read / Write / Construct

Host name for the network service.

Default value: "localhost"

### The `"port"` property

      "port"                     guint                 : Read / Write / Construct

Port number for the network service.

Allowed values: <= 65535

Default value: 0

### The `"security-method"` property

      "security-method"          CamelNetworkSecurityMethod  : Read / Write / Construct

Method used to establish a network connection.

Default value: CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT

### The `"user"` property

      "user"                     gchar*                : Read / Write / Construct

User name for the network account.

Default value: "mbarnes"