an effective anti-spam with milter - milter manager

MilterClientContext

MilterClientContext — Process milter protocol.

Functions

#define MILTER_CLIENT_CONTEXT_STATE_IN_MESSAGE_PROCESSING()
GQuark milter_client_context_error_quark ()
MilterClientContext * milter_client_context_new ()
gboolean milter_client_context_feed ()
gpointer milter_client_context_get_private_data ()
void milter_client_context_set_private_data ()
gboolean milter_client_context_set_reply ()
gchar * milter_client_context_format_reply ()
gboolean milter_client_context_add_header ()
gboolean milter_client_context_insert_header ()
gboolean milter_client_context_change_header ()
gboolean milter_client_context_delete_header ()
gboolean milter_client_context_change_from ()
gboolean milter_client_context_add_recipient ()
gboolean milter_client_context_delete_recipient ()
gboolean milter_client_context_replace_body ()
gboolean milter_client_context_progress ()
gboolean milter_client_context_quarantine ()
void milter_client_context_set_timeout ()
guint milter_client_context_get_timeout ()
void milter_client_context_set_state ()
MilterClientContextState milter_client_context_get_state ()
void milter_client_context_set_quarantine_reason ()
const gchar * milter_client_context_get_quarantine_reason ()
MilterClientContextState milter_client_context_get_last_state ()
void milter_client_context_set_status ()
MilterStatus milter_client_context_get_status ()
void milter_client_context_set_option ()
MilterOption * milter_client_context_get_option ()
void milter_client_context_set_socket_address ()
MilterGenericSocketAddress * milter_client_context_get_socket_address ()
MilterMessageResult * milter_client_context_get_message_result ()
void milter_client_context_set_message_result ()
void milter_client_context_reset_message_related_data ()
guint milter_client_context_get_n_processing_sessions ()
void milter_client_context_set_packet_buffer_size ()
guint milter_client_context_get_packet_buffer_size ()
void milter_client_context_set_mail_transaction_shelf_value ()
const gchar * milter_client_context_get_mail_transaction_shelf_value ()
GHashTable * milter_client_context_get_mail_transaction_shelf ()
void milter_client_context_clear_mail_transaction_shelf ()
void milter_client_context_mail_transaction_shelf_foreach ()

Properties

MilterClient * client Read / Write / Construct Only
MilterMessageResult * message-result Read / Write
MilterOption * option Read / Write
guint packet-buffer-size Read / Write
gchar * quarantine-reason Read / Write
MilterClientContextState state Read / Write
MilterStatus status Read / Write

Object Hierarchy

    GEnum
    ├── MilterClientContextError
    ╰── MilterClientContextState
    GObject
    ╰── MilterAgent
        ╰── MilterProtocolAgent
            ╰── MilterClientContext

Implemented Interfaces

MilterClientContext implements

Description

The MilterClientContext processes one milter protocol session. It means MilterClientContext instance is created for each milter protocol session.

To process each milter protocol command, you need to connect signals of MilterClientContext. MilterClientContext has signals that correspond to milter protocol events:

NOTE: You will need to check whether the current state is message processing or not. You can use MILTER_CLIENT_CONTEXT_STATE_IN_MESSAGE_PROCESSING for it.

Here is an example to connect signals. It connects all signals and each connected signal handler prints its event name:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
static MilterStatus
cb_negotiate (MilterClientContext *context, MilterOption *option,
              gpointer user_data)
{
    g_print("negotiate\n");
    return MILTER_STATUS_ALL_OPTIONS;
}

static MilterStatus
cb_connect (MilterClientContext *context, const gchar *host_name,
            const struct sockaddr *address, socklen_t address_length,
            gpointer user_data)
{
    g_print("connect\n");
    return MILTER_STATUS_CONTINUE;
}

static MilterStatus
cb_helo (MilterClientContext *context, const gchar *fqdn, gpointer user_data)
{
    g_print("helo\n");
    return MILTER_STATUS_CONTINUE;
}

static MilterStatus
cb_envelope_from (MilterClientContext *context, const gchar *from,
                  gpointer user_data)
{
    g_print("envelope-from\n");
    return MILTER_STATUS_CONTINUE;
}

static MilterStatus
cb_envelope_recipient (MilterClientContext *context, const gchar *to,
                       gpointer user_data)
{
    g_print("envelope-recipient\n");
    return MILTER_STATUS_CONTINUE;
}

static MilterStatus
cb_data (MilterClientContext *context, gpointer user_data)
{
    g_print("data\n");
    return MILTER_STATUS_CONTINUE;
}

static MilterStatus
cb_header (MilterClientContext *context, const gchar *name, const gchar *value,
           gpointer user_data)
{
    g_print("header\n");
    return MILTER_STATUS_CONTINUE;
}

static MilterStatus
cb_end_of_header (MilterClientContext *context, gpointer user_data)
{
    g_print("end-of-header\n");
    return MILTER_STATUS_CONTINUE;
}

static MilterStatus
cb_body (MilterClientContext *context, const gchar *chunk, gsize length,
         gpointer user_data)
{
    g_print("body\n");
    return MILTER_STATUS_CONTINUE;
}

static MilterStatus
cb_end_of_message (MilterClientContext *context,
                   const gchar *chunk, gsize length,
                   gpointer user_data)
{
    g_print("end-of-message\n");
    return MILTER_STATUS_CONTINUE;
}

static MilterStatus
cb_abort (MilterClientContext *context, MilterClientContextState state,
          gpointer user_data)
{
    g_print("abort\n");
    return MILTER_STATUS_CONTINUE;
}

static MilterStatus
cb_unknown (MilterClientContext *context, const gchar *command,
            gpointer user_data)
{
    g_print("unknown\n");
    return MILTER_STATUS_CONTINUE;
}

static void
setup_context_signals (MilterClientContext *context)
{
#define CONNECT(name)                                                   \
    g_signal_connect(context, #name, G_CALLBACK(cb_ ## name), NULL)

    CONNECT(negotiate);
    CONNECT(connect);
    CONNECT(helo);
    CONNECT(envelope_from);
    CONNECT(envelope_recipient);
    CONNECT(data);
    CONNECT(header);
    CONNECT(end_of_header);
    CONNECT(body);
    CONNECT(end_of_message);
    CONNECT(abort);
    CONNECT(unknown);

#undef CONNECT
}

Functions

MILTER_CLIENT_CONTEXT_STATE_IN_MESSAGE_PROCESSING()

#define             MILTER_CLIENT_CONTEXT_STATE_IN_MESSAGE_PROCESSING(state)


milter_client_context_error_quark ()

GQuark
milter_client_context_error_quark (void);


milter_client_context_new ()

MilterClientContext *
milter_client_context_new (MilterClient *client);

Creates a new context object. Normally, context object is created by MilterClient and passed by “connection-established” signal.

Parameters

client

a MilterClient for the context.

 

Returns

a new MilterClientContext object.


milter_client_context_feed ()

gboolean
milter_client_context_feed (MilterClientContext *context,
                            const gchar *chunk,
                            gsize size,
                            GError **error);

Feeds a chunk to the context . You can use it for testing or debugging.

Parameters

context

a MilterClientContext.

 

chunk

the string to be fed to context .

 

size

the size of chunk .

 

error

return location for an error, or NULL.

 

Returns

TRUE on success.


milter_client_context_get_private_data ()

gpointer
milter_client_context_get_private_data
                               (MilterClientContext *context);

Gets the private data of the context .

Parameters

context

a MilterClientContext.

 

Returns

the private data set by milter_client_context_set_private_data() or NULL.


milter_client_context_set_private_data ()

void
milter_client_context_set_private_data
                               (MilterClientContext *context,
                                gpointer data,
                                GDestroyNotify destroy);

Sets the private data of the context . data is destroyed by destroy when data is unset. data is unset when new private data is set or context is destroyed.

Parameters

context

a MilterClientContext.

 

data

the private data.

 

destroy

the destroy function for data or NULL.

 

milter_client_context_set_reply ()

gboolean
milter_client_context_set_reply (MilterClientContext *context,
                                 guint code,
                                 const gchar *extended_code,
                                 const gchar *message,
                                 GError **error);

Sets the error reply code. 4xx code is used on MILTER_REPLY_TEMPORARY_FAILURE. 5xx code is used on MILTER_REPLY_REJECT.

See also smfi_setreply on milter.org.

Parameters

context

a MilterClientContext.

 

code

the three-digit SMTP error reply code. (RFC 2821) Only 4xx and 5xx are accepted.

 

extended_code

the extended reply code (RFC 1893/2034), or NULL.

 

message

the text part of the SMTP reply, or NULL.

 

error

return location for an error, or NULL.

 

Returns

TRUE on success.


milter_client_context_format_reply ()

gchar *
milter_client_context_format_reply (MilterClientContext *context);

Formats the current error reply code specified by milter_client_context_set_reply(). If error reply code isn't set, this function returns NULL.

Parameters

context

a MilterClientContext.

 

Returns

formatted reply code, or NULL.


milter_client_context_add_header ()

gboolean
milter_client_context_add_header (MilterClientContext *context,
                                  const gchar *name,
                                  const gchar *value,
                                  GError **error);

Adds a header to the current message's header list. This function can be called in “end-of-message” signal.

See also smfi_addheader on milter.org.

FIXME: write about MILTER_ACTION_ADD_HEADERS.

Parameters

context

a MilterClientContext.

 

name

the header name.

 

value

the header value.

 

error

return location for an error, or NULL.

 

Returns

TRUE on success.


milter_client_context_insert_header ()

gboolean
milter_client_context_insert_header (MilterClientContext *context,
                                     guint32 index,
                                     const gchar *name,
                                     const gchar *value,
                                     GError **error);

Inserts a header into the current message's header lists at index . This function can be called in “end-of-message” signal. See also smfi_insheader on milter.org.

FIXME: write about MILTER_ACTION_ADD_HEADERS.

Parameters

context

a MilterClientContext.

 

index

the index to be inserted.

 

name

the header name.

 

value

the header value.

 

error

return location for an error, or NULL.

 

Returns

TRUE on success.


milter_client_context_change_header ()

gboolean
milter_client_context_change_header (MilterClientContext *context,
                                     const gchar *name,
                                     guint32 index,
                                     const gchar *value,
                                     GError **error);

Changes a header that is located at index in headers that all of them are named name . If value is NULL, the header is deleted. This function can be called in “end-of-message” signal.

See also smfi_chgheader on milter.org.

FIXME: write about MILTER_ACTION_CHANGE_HEADERS.

Parameters

context

a MilterClientContext.

 

name

the header name.

 

index

the index of headers that all of them are named name . (1-based) FIXME: should change 0-based?

 

value

the header value. Use NULL to delete the target header.

 

error

return location for an error, or NULL.

 

Returns

TRUE on success.


milter_client_context_delete_header ()

gboolean
milter_client_context_delete_header (MilterClientContext *context,
                                     const gchar *name,
                                     guint32 index,
                                     GError **error);

Deletes a header that is located at index in headers that all of them are named name . This function can be called in “end-of-message” signal. This function works same as milter_client_context_change_header() with NULL as value .

FIXME: write about MILTER_ACTION_CHANGE_HEADERS.

Parameters

context

a MilterClientContext.

 

name

the header name.

 

index

the index of headers that all of them are named name . (1-based) FIXME: should change 0-based?

 

error

return location for an error, or NULL.

 

Returns

TRUE on success.


milter_client_context_change_from ()

gboolean
milter_client_context_change_from (MilterClientContext *context,
                                   const gchar *from,
                                   const gchar *parameters,
                                   GError **error);

Changes the envelope from address of the current message. ESMTP's 'MAIL FROM' parameter can be set by parameters . parameters may be NULL. This function can be called in “end-of-message” signal. See also smfi_chgfrom on milter.org.

FIXME: write about MILTER_ACTION_CHANGE_FROM.

Parameters

context

a MilterClientContext.

 

from

the new envelope from address.

 

parameters

the ESMTP's 'MAIL FROM' parameter. It can be NULL.

 

error

return location for an error, or NULL.

 

Returns

TRUE on success.


milter_client_context_add_recipient ()

gboolean
milter_client_context_add_recipient (MilterClientContext *context,
                                     const gchar *recipient,
                                     const gchar *parameters,
                                     GError **error);

Adds a new envelope recipient address to the current message. ESMTP's 'RCPT TO' parameter can be set by parameters . parameters may be NULL. This function can be called in “end-of-message” signal. See also smfi_addrcpt and smfi_addrcpt_par on milter.org.

FIXME: write about MILTER_ACTION_ADD_RECIPIENT and MILTER_ACTION_ADD_ENVELOPE_RECIPIENT_WITH_PARAMETERS.

Parameters

context

a MilterClientContext.

 

recipient

the new envelope recipient address.

 

parameters

the ESMTP's 'RCPT TO' parameter. It can be NULL.

 

error

return location for an error, or NULL.

 

Returns

TRUE on success.


milter_client_context_delete_recipient ()

gboolean
milter_client_context_delete_recipient
                               (MilterClientContext *context,
                                const gchar *recipient,
                                GError **error);

Removes a envelope recipient that named recipient . This function can be called in “end-of-message” signal. See also smfi_delrcpt on milter.org.

FIXME: write about MILTER_ACTION_DELETE_RECIPIENT.

Parameters

context

a MilterClientContext.

 

recipient

the envelope recipient address to be removed.

 

error

return location for an error, or NULL.

 

Returns

TRUE on success.


milter_client_context_replace_body ()

gboolean
milter_client_context_replace_body (MilterClientContext *context,
                                    const gchar *body,
                                    gsize body_size,
                                    GError **error);

Replaces the body of the current message with body . This function can be called in “end-of-message” signal. See also smfi_replacebody on milter.org.

FIXME: write about MILTER_ACTION_CHANGE_BODY.

Parameters

context

a MilterClientContext.

 

body

the new body.

 

body_size

the size of body .

 

error

return location for an error, or NULL.

 

Returns

TRUE on success.


milter_client_context_progress ()

gboolean
milter_client_context_progress (MilterClientContext *context);

Notifies the MTA that this milter is still in progress. This function can be called in “end-of-message” signal. See also smfi_progress on milter.org.

Parameters

context

a MilterClientContext.

 

Returns

TRUE on success.


milter_client_context_quarantine ()

gboolean
milter_client_context_quarantine (MilterClientContext *context,
                                  const gchar *reason);

Quarantines the current message with reason . This function can be called in “end-of-message” signal. See also smfi_quarantine on milter.org.

FIXME: write about MILTER_ACTION_QUARANTINE.

Parameters

context

a MilterClientContext.

 

reason

the reason why the current message is quarantined.

 

Returns

TRUE on success.


milter_client_context_set_timeout ()

void
milter_client_context_set_timeout (MilterClientContext *context,
                                   guint timeout);

Sets the timeout by seconds. If MTA doesn't responses in timeout seconds, “timeout” signal is emitted. See also smfi_settimeout on milter.org.

Parameters

context

a MilterClientContext.

 

timeout

the timeout by seconds. (default is 7210 seconds)

 

milter_client_context_get_timeout ()

guint
milter_client_context_get_timeout (MilterClientContext *context);

Gets the timeout by seconds.

Parameters

context

a MilterClientContext.

 

Returns

timeout by seconds.


milter_client_context_set_state ()

void
milter_client_context_set_state (MilterClientContext *context,
                                 MilterClientContextState state);

Sets the current state.

This is for testing. Don't use it directory for normal use.

Parameters

context

a MilterClientContext.

 

state

a MilterClientContextState.

 

milter_client_context_get_state ()

MilterClientContextState
milter_client_context_get_state (MilterClientContext *context);

Gets the current state.

This is for testing. Don't use it directory for normal use.

Parameters

context

a MilterClientContext.

 

Returns

the current state.


milter_client_context_set_quarantine_reason ()

void
milter_client_context_set_quarantine_reason
                               (MilterClientContext *context,
                                const gchar *reason);

Sets the quarantine reason.

This is for testing. Don't use it directory for normal use.

Parameters

context

a MilterClientContext.

 

reason

a quarantine reason.

 

milter_client_context_get_quarantine_reason ()

const gchar *
milter_client_context_get_quarantine_reason
                               (MilterClientContext *context);

Gets the quarantine reason.

This is for testing. Don't use it directory for normal use.

Parameters

context

a MilterClientContext.

 

Returns

the quarantine reason.


milter_client_context_get_last_state ()

MilterClientContextState
milter_client_context_get_last_state (MilterClientContext *context);

Gets the last state. It's one of start, negotiate, connect, helo, envelope-from, envelope-recipient, data, unknown, header, end-of-header, body and end-of-message.

Parameters

context

a MilterClientContext.

 

Returns

the last state.


milter_client_context_set_status ()

void
milter_client_context_set_status (MilterClientContext *context,
                                  MilterStatus status);

Sets the current status.

Parameters

context

a MilterClientContext.

 

status

a MilterStatus.

 

milter_client_context_get_status ()

MilterStatus
milter_client_context_get_status (MilterClientContext *context);

Gets the current status.

Parameters

context

a MilterClientContext.

 

Returns

the current status.


milter_client_context_set_option ()

void
milter_client_context_set_option (MilterClientContext *context,
                                  MilterOption *option);

Sets the option for the context.

Parameters

context

a MilterClientContext.

 

option

a MilterOption.

 

milter_client_context_get_option ()

MilterOption *
milter_client_context_get_option (MilterClientContext *context);

Gets the socket address of connected server for the context.

Parameters

context

a MilterClientContext.

 

Returns

the socket address of connected server for the context.


milter_client_context_set_socket_address ()

void
milter_client_context_set_socket_address
                               (MilterClientContext *context,
                                MilterGenericSocketAddress *address);

Sets the socket address of connected server for the context.

Parameters

context

a MilterClientContext.

 

address

a MilterGenericSocketAddress.

 

milter_client_context_get_socket_address ()

MilterGenericSocketAddress *
milter_client_context_get_socket_address
                               (MilterClientContext *context);


milter_client_context_get_message_result ()

MilterMessageResult *
milter_client_context_get_message_result
                               (MilterClientContext *context);

Gets the message result of context .

Parameters

context

a MilterClientContext.

 

Returns

the message result of context .


milter_client_context_set_message_result ()

void
milter_client_context_set_message_result
                               (MilterClientContext *context,
                                MilterMessageResult *result);

Sets the message result of context .

Parameters

context

a MilterClientContext.

 

result

the message result.

 

milter_client_context_reset_message_related_data ()

void
milter_client_context_reset_message_related_data
                               (MilterClientContext *context);

Resets message related data of context .

Normally, you don't need to call this function.

Parameters

context

a MilterClientContext.

 

milter_client_context_get_n_processing_sessions ()

guint
milter_client_context_get_n_processing_sessions
                               (MilterClientContext *context);

Returns number of the current processing sessions.

Parameters

context

a MilterClientContext.

 

Returns

number of the current processing sessions.


milter_client_context_set_packet_buffer_size ()

void
milter_client_context_set_packet_buffer_size
                               (MilterClientContext *context,
                                guint size);

Sets the packet buffer size for the context. Packets on end-of-message are buffered until the buffer size is full. Packet buffering is for performance.

Parameters

context

a MilterClientContext.

 

size

a packet buffer size in bytes. (The deafult is 0 bytes. It means buffering is disabled.)

 

milter_client_context_get_packet_buffer_size ()

guint
milter_client_context_get_packet_buffer_size
                               (MilterClientContext *context);

Gets the packet buffer size for the context.

Parameters

context

a MilterClientContext.

 

Returns

the packet buffer size for the context.


milter_client_context_set_mail_transaction_shelf_value ()

void
milter_client_context_set_mail_transaction_shelf_value
                               (MilterClientContext *context,
                                const gchar *key,
                                const gchar *value);

Sets the string for the mail_transaction_shelf.

Parameters

context

a MilterClientContext.

 

key

a string

 

value

a string

 

milter_client_context_get_mail_transaction_shelf_value ()

const gchar *
milter_client_context_get_mail_transaction_shelf_value
                               (MilterClientContext *context,
                                const gchar *key);

Gets the string for the mail_transaction_shelf.

Parameters

context

a MilterClientContext.

 

key

a key

 

Returns

the string for the mail_transaction_shelf.


milter_client_context_get_mail_transaction_shelf ()

GHashTable *
milter_client_context_get_mail_transaction_shelf
                               (MilterClientContext *context);

Gets the mail_transaction_shelf. This is a mail-transaction scope storage.

Parameters

context

a MilterClientContext.

 

Returns

the GHashTable for the context.


milter_client_context_clear_mail_transaction_shelf ()

void
milter_client_context_clear_mail_transaction_shelf
                               (MilterClientContext *context);

Remove all keys and values from mail_transaction_shelf.

Parameters

context

a MilterClientContext.

 

milter_client_context_mail_transaction_shelf_foreach ()

void
milter_client_context_mail_transaction_shelf_foreach
                               (MilterClientContext *context,
                                GHFunc func,
                                gpointer user_data);

A wrapper for g_hash_table_foreach().

Parameters

context

a MilterClientContext.

 

func

the function to call for each key/value pair

 

user_data

user data to pass to the function

 

Types and Values

MILTER_CLIENT_CONTEXT_ERROR

#define MILTER_CLIENT_CONTEXT_ERROR           (milter_client_context_error_quark())

Used to get the GError quark for MilterClientContext errors.


enum MilterClientContextError

These identify the variable errors that can occur while calling MilterClientContext functions.

Members

MILTER_CLIENT_CONTEXT_ERROR_INVALID_CODE

Indicates a status code specified by milter_client_context_set_reply() is invalid.

 

MILTER_CLIENT_CONTEXT_ERROR_IO_ERROR

Indicates an IO error causing on writing/reading milter protocol data.

 

MILTER_CLIENT_CONTEXT_ERROR_NULL

Indicates unexpected NULL is passed.

 

MILTER_CLIENT_CONTEXT_ERROR_INVALID_STATE

Indicates unexpected operation is requested on the current MilterClientContextState.

 

MILTER_CLIENT_CONTEXT_ERROR_INVALID_ACTION

Indicates unexpected operation is requested on the context's MilterActionFlags.

 

MILTER_CLIENT_CONTEXT_ERROR_EMPTY

   

enum MilterClientContextState

These identify the state of MilterClientContext.

Members

MILTER_CLIENT_CONTEXT_STATE_INVALID

Invalid state.

 

MILTER_CLIENT_CONTEXT_STATE_START

Just started.

 

MILTER_CLIENT_CONTEXT_STATE_NEGOTIATE

Starting negotiation.

 

MILTER_CLIENT_CONTEXT_STATE_NEGOTIATE_REPLIED

Received negotiation response.

 

MILTER_CLIENT_CONTEXT_STATE_CONNECT

Sent connection information.

 

MILTER_CLIENT_CONTEXT_STATE_CONNECT_REPLIED

Received connection information response.

 

MILTER_CLIENT_CONTEXT_STATE_HELO

Starting HELO.

 

MILTER_CLIENT_CONTEXT_STATE_HELO_REPLIED

Received HELO response.

 

MILTER_CLIENT_CONTEXT_STATE_ENVELOPE_FROM

Starting MAIL FROM command.

 

MILTER_CLIENT_CONTEXT_STATE_ENVELOPE_FROM_REPLIED

Receive MAIL FROM response.

 

MILTER_CLIENT_CONTEXT_STATE_ENVELOPE_RECIPIENT

Starting RCPT TO command.

 

MILTER_CLIENT_CONTEXT_STATE_ENVELOPE_RECIPIENT_REPLIED

Receive RCPT TO response.

 

MILTER_CLIENT_CONTEXT_STATE_DATA

Starting DATA command.

 

MILTER_CLIENT_CONTEXT_STATE_DATA_REPLIED

Receive DATA response.

 

MILTER_CLIENT_CONTEXT_STATE_UNKNOWN

Receiving unknown SMTP command.

 

MILTER_CLIENT_CONTEXT_STATE_UNKNOWN_REPLIED

Receive unknown SMTP command response.

 

MILTER_CLIENT_CONTEXT_STATE_HEADER

Sent a header.

 

MILTER_CLIENT_CONTEXT_STATE_HEADER_REPLIED

Receive header response.

 

MILTER_CLIENT_CONTEXT_STATE_END_OF_HEADER

All headers are sent.

 

MILTER_CLIENT_CONTEXT_STATE_END_OF_HEADER_REPLIED

Receive end-of-header response.

 

MILTER_CLIENT_CONTEXT_STATE_BODY

Sending body chunks.

 

MILTER_CLIENT_CONTEXT_STATE_BODY_REPLIED

Received body response.

 

MILTER_CLIENT_CONTEXT_STATE_END_OF_MESSAGE

All body chunks are sent.

 

MILTER_CLIENT_CONTEXT_STATE_END_OF_MESSAGE_REPLIED

Receive end-of-message response.

 

MILTER_CLIENT_CONTEXT_STATE_QUIT

Starting quitting.

 

MILTER_CLIENT_CONTEXT_STATE_QUIT_REPLIED

Receive quit response.

 

MILTER_CLIENT_CONTEXT_STATE_ABORT

Starting aborting.

 

MILTER_CLIENT_CONTEXT_STATE_ABORT_REPLIED

Receive abort response.

 

MILTER_CLIENT_CONTEXT_STATE_FINISHED

Finished.

 

Property Details

The “client” property

  “client”                   MilterClient *

The client of the context.

Flags: Read / Write / Construct Only


The “message-result” property

  “message-result”           MilterMessageResult *

The message result of client context.

Flags: Read / Write


The “option” property

  “option”                   MilterOption *

The option of client context.

Flags: Read / Write


The “packet-buffer-size” property

  “packet-buffer-size”       guint

The packet buffer size of the client context.

Flags: Read / Write

Default value: 0


The “quarantine-reason” property

  “quarantine-reason”        gchar *

The quarantine reason of client context.

Flags: Read / Write

Default value: NULL


The “state” property

  “state”                    MilterClientContextState

The state of client context.

Flags: Read / Write

Default value: MILTER_CLIENT_CONTEXT_STATE_INVALID


The “status” property

  “status”                   MilterStatus

The status of client context.

Flags: Read / Write

Default value: MILTER_STATUS_DEFAULT

Signal Details

The “abort” signal

MilterStatus
user_function (MilterClientContext     *context,
               MilterClientContextState Returns,
               gpointer                 user_data)

Flags: Run Last


The “abort-response” signal

void
user_function (MilterClientContext *context,
               MilterStatus         status,
               gpointer             user_data)

Flags: Run Last


The “body” signal

MilterStatus
user_function (MilterClientContext *context,
               gchar               *chunk,
               guint64              size,
               gpointer             user_data)

Flags: Run Last


The “body-response” signal

void
user_function (MilterClientContext *context,
               MilterStatus         status,
               gpointer             user_data)

Flags: Run Last


The “connect” signal

MilterStatus
user_function (MilterClientContext *context,
               gchar               *host_name,
               gpointer             address,
               guint                address_size,
               gpointer             user_data)

Flags: Run Last


The “connect-response” signal

void
user_function (MilterClientContext *context,
               MilterStatus         status,
               gpointer             user_data)

Flags: Run Last


The “data” signal

MilterStatus
user_function (MilterClientContext *context,
               gpointer             user_data)

Flags: Run Last


The “data-response” signal

void
user_function (MilterClientContext *context,
               MilterStatus         status,
               gpointer             user_data)

Flags: Run Last


The “define-macro” signal

void
user_function (MilterClientContext *context,
               MilterCommand        command,
               gpointer             macros,
               gpointer             user_data)

Flags: Run Last


The “end-of-header” signal

MilterStatus
user_function (MilterClientContext *context,
               gpointer             user_data)

Flags: Run Last


The “end-of-header-response” signal

void
user_function (MilterClientContext *context,
               MilterStatus         status,
               gpointer             user_data)

Flags: Run Last


The “end-of-message” signal

MilterStatus
user_function (MilterClientContext *context,
               gchar               *Returns,
               guint64              arg2,
               gpointer             user_data)

Flags: Run Last


The “end-of-message-response” signal

void
user_function (MilterClientContext *context,
               MilterStatus         status,
               gpointer             user_data)

Flags: Run Last


The “envelope-from” signal

MilterStatus
user_function (MilterClientContext *context,
               gchar               *from,
               gpointer             user_data)

Flags: Run Last


The “envelope-from-response” signal

void
user_function (MilterClientContext *context,
               MilterStatus         status,
               gpointer             user_data)

Flags: Run Last


The “envelope-recipient” signal

MilterStatus
user_function (MilterClientContext *context,
               gchar               *recipient,
               gpointer             user_data)

Flags: Run Last


The “envelope-recipient-response” signal

void
user_function (MilterClientContext *context,
               MilterStatus         status,
               gpointer             user_data)

Flags: Run Last


The “header” signal

MilterStatus
user_function (MilterClientContext *context,
               gchar               *name,
               gchar               *value,
               gpointer             user_data)

Flags: Run Last


The “header-response” signal

void
user_function (MilterClientContext *context,
               MilterStatus         status,
               gpointer             user_data)

Flags: Run Last


The “helo” signal

MilterStatus
user_function (MilterClientContext *context,
               gchar               *fqdn,
               gpointer             user_data)

Flags: Run Last


The “helo-response” signal

void
user_function (MilterClientContext *context,
               MilterStatus         status,
               gpointer             user_data)

Flags: Run Last


The “message-processed” signal

void
user_function (MilterClientContext *milterclientcontext,
               MilterMessageResult *arg1,
               gpointer             user_data)

Flags: Run Last


The “negotiate” signal

MilterStatus
user_function (MilterClientContext  *context,
               MilterOption         *option,
               MilterMacrosRequests *macros_requests,
               gpointer              user_data)

Flags: Run Last


The “negotiate-response” signal

void
user_function (MilterClientContext  *context,
               MilterOption         *option,
               MilterMacrosRequests *macros_requests,
               MilterStatus          status,
               gpointer              user_data)

Flags: Run Last


The “timeout” signal

void
user_function (MilterClientContext *context,
               gpointer             user_data)

Flags: Run Last


The “unknown” signal

MilterStatus
user_function (MilterClientContext *context,
               gchar               *command,
               gpointer             user_data)

Flags: Run Last


The “unknown-response” signal

void
user_function (MilterClientContext *context,
               MilterStatus         status,
               gpointer             user_data)

Flags: Run Last