ec_message_get_envelope2

March 26, 2020 Contributors

Name

ec_message_get_envelope2 — Return information from the envelope of the message

Synopsis

#include "ec_message.h"

| int **ec_message_get_envelope2** ( | mess, |   |
|   | flags, |   |
|   | localpart, |   |
|   | domain, |   |
|   | isnull); |   |

ec_message * <var class="pdparam">mess</var>;
int <var class="pdparam">flags</var>;
string * <var class="pdparam">localpart</var>;
string * <var class="pdparam">domain</var>;
int * <var class="pdparam">isnull</var>;

Description

**Configuration Change. ** This feature is available starting from Momentum 3.0.9.

Returns information from the envelope of the message.

If flags includes EC_MSG_ENV_FROM then the envelope sender will be the source of the information. If flags includes EC_MSG_ENV_TO, then the envelope recipient will be the source of the information. The local portion of the address will be copied into the localpart buffer if it is not NULL. Similarly, the domain portion of the address will be copied into the domain buffer if it is not NULL.

If isnull is not NULL, then it will be set to 1 if the address is the null sender address, 0 otherwise. If EC_MSG_ENV_COMPLETE is contained in flags, then the address will be copied into the localpart buffer only, without any protocol decoration (eg: no MAIL FROM:<>CRLF).

The EC_MSG_ENV_COMPLETE Flag

To retrieve the complete email address, the localpart and the domain name, you must use the EC_MSG_ENV_COMPLETE flag. See also ec_message_get_envelope.

Parameters

mess

The ec_message.

flags

Any OR’ed combination of EC_MSG_ENV_XXX flags shown below. However, It is not valid to pass EC_MSG_ENV_FROM | EC_MSG_ENV_TO as the flags parameter.

localpart

Storage for the local portion of the address.

domain

Storage for the domain portion of the address.

isnull

If not NULL, this parameter will be set to 1 to indicate that the address is the null sender address, 0 otherwise.

Related Constants

`EC_MSG_ENV_FROM`

Operate on the envelope sender.

`EC_MSG_ENV_TO`

Operate on the envelope recipient.

`EC_MSG_ENV_COMPLETE`

Ignore the domain parameter; the entire address is either in or will be placed in the localpart buffer.

Return Values

Returns 1 on success, 0 if the address is not understood by the system.

Threading

It is legal to call this function in any thread.

See Also

ec_message_get_envelope