milter-client-objects
3
milter managerライブラリ

# milter-client-objects

## プロパティ

gchar * | connection-spec | Read
gpointer | custom-fork | Read / Write
guint | default-packet-buffer-size | Read / Write
MilterEventLoop * | event-loop | Read / Write
MilterClientEventLoopBackend | event-loop-backend | Read / Write
guint | maintenance-interval | Read / Write
guint | max-pending-finished-sessions | Read / Write
guint | n-workers | Read / Write
gchar * | pid-file | Read / Write
gboolean | remove-pid-file-on-exit | Read / Write
gchar * | run-as-daemon | Read / Write
gboolean | start-syslog | Write
gchar * | syslog-facility | Read / Write
gchar * | syslog-identify | Read / Write
guint | worker-id | Read
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

## シグナル

void | connection-established | Run Last
void | event-loop-created | Run Last
void | listen-started | Run Last
void | maintain | Run Last
void | sessions-finished | Run Last
void | worker-created | Run Last
void | workers-created | Run Last
MilterStatus | abort | Run Last
void | abort-response | Run Last
MilterStatus | body | Run Last
void | body-response | Run Last
MilterStatus | connect | Run Last
void | connect-response | Run Last
MilterStatus | data | Run Last
void | data-response | Run Last
void | define-macro | Run Last
MilterStatus | end-of-header | Run Last
void | end-of-header-response | Run Last
MilterStatus | end-of-message | Run Last
void | end-of-message-response | Run Last
MilterStatus | envelope-from | Run Last
void | envelope-from-response | Run Last
MilterStatus | envelope-recipient | Run Last
void | envelope-recipient-response | Run Last
MilterStatus | header | Run Last
void | header-response | Run Last
MilterStatus | helo | Run Last
void | helo-response | Run Last
void | message-processed | Run Last
MilterStatus | negotiate | Run Last
void | negotiate-response | Run Last
void | timeout | Run Last
MilterStatus | unknown | Run Last
void | unknown-response | Run Last

## Types and Values

| MilterClient
| MilterClientContext

## オブジェクト階層

        GObject
        ├── MilterAgent
        │   ╰── MilterProtocolAgent
        │       ╰── MilterClientContext
        ╰── MilterClient
            ╰── MilterManager

## 実装されたインターフェイス

MilterClient implements

MilterClientContext implements

## 説明

## Functions

## Types and Values

### MilterClient

    typedef struct _MilterClient MilterClient;

`MilterClient`は前面にでるオブジェクトです。このオブジェクトがMTAからの接続を受け付けて、各コンテキストに割り振ります。

### MilterClientContext

    typedef struct _MilterClientContext MilterClientContext;

## プロパティ詳細

### The `“connection-spec”` property

      “connection-spec”          gchar *

クライアントの接続指定。

Flags: Read

デフォルト値: NULL

### The `“custom-fork”` property

      “custom-fork”              gpointer

The custom fork.

Flags: Read / Write

### The `“default-packet-buffer-size”` property

      “default-packet-buffer-size” guint

The default packet buffer size of each client context of the client.

Flags: Read / Write

デフォルト値: 0

### The `“event-loop”` property

      “event-loop”               MilterEventLoop *

クライアントのイベントループ。

Flags: Read / Write

### The `“event-loop-backend”` property

      “event-loop-backend”       MilterClientEventLoopBackend

クライアントのイベントループバックエンド。

Flags: Read / Write

Default value: MILTER_CLIENT_EVENT_LOOP_BACKEND_DEFAULT

### The `“maintenance-interval”` property

      “maintenance-interval”     guint

Maintenance interval of the client. each 'maintenance-interval' sessions finished 'maintenance' signal is emitted. 0 means 'disabled'.

Flags: Read / Write

デフォルト値: 0

### The `“max-pending-finished-sessions”` property

      “max-pending-finished-sessions” guint

The maximum number of pending finished sessions of the client.

Flags: Read / Write

デフォルト値: 0

### The `“n-workers”` property

      “n-workers”                guint

The Number of worker processes of the client.

Flags: Read / Write

Allowed values: <= 1000

デフォルト値: 0

### The `“pid-file”` property

      “pid-file”                 gchar *

クライアントのPIDファイル。

Flags: Read / Write

デフォルト値: NULL

### The `“remove-pid-file-on-exit”` property

      “remove-pid-file-on-exit”  gboolean

Whether removing PID file of the client on exist.

Flags: Read / Write

デフォルト値: TRUE

### The `“run-as-daemon”` property

      “run-as-daemon”            gchar *

Whether running the client as a daemon or not.

Flags: Read / Write

デフォルト値: NULL

### The `“start-syslog”` property

      “start-syslog”             gboolean

Start syslog for the client.

Flags: Write

Default value: FALSE

### The `“syslog-facility”` property

      “syslog-facility”          gchar *

クライアントのsyslogファシリティ名。

Flags: Read / Write

デフォルト値: NULL

### The `“syslog-identify”` property

      “syslog-identify”          gchar *

Syslog identify of the client.

Flags: Read / Write

デフォルト値: NULL

### The `“worker-id”` property

      “worker-id”                guint

クライアントのワーカープロセスID。

Flags: Read

Allowed values: <= 1000

デフォルト値: 0

### The `“client”` property

      “client”                   MilterClient *

コンテキストのクライアント。

Flags: Read / Write / Construct Only

### The `“message-result”` property

      “message-result”           MilterMessageResult *

クライアントコンテキストのメッセージの処理結果。

Flags: Read / Write

### The `“option”` property

      “option”                   MilterOption *

クライントコンテキストのオプション。

Flags: Read / Write

### The `“packet-buffer-size”` property

      “packet-buffer-size”       guint

クライアントコンテキストのパケットバッファサイズ。

Flags: Read / Write

デフォルト値: 0

### The `“quarantine-reason”` property

      “quarantine-reason”        gchar *

クライアントコンテキストの隔離理由。

Flags: Read / Write

デフォルト値: NULL

### The `“state”` property

      “state”                    MilterClientContextState

クライアントコンテキストの状態。

Flags: Read / Write

デフォルト値: MILTER_CLIENT_CONTEXT_STATE_INVALID

### The `“status”` property

      “status”                   MilterStatus

クライアントコンテキストのステータス。

Flags: Read / Write

デフォルト値: MILTER_STATUS_DEFAULT

## シグナル詳細

### The `“connection-established”` signal

    void
    user_function (MilterClient        *milterclient,
                   MilterClientContext *arg1,
                   gpointer             user_data)

Flags: Run Last

### The `“event-loop-created”` signal

    void
    user_function (MilterClient    *milterclient,
                   MilterEventLoop *arg1,
                   gpointer         user_data)

Flags: Run Last

### The `“listen-started”` signal

    void
    user_function (MilterClient *milterclient,
                   gpointer      arg1,
                   guint         arg2,
                   gpointer      user_data)

Flags: Run Last

### The `“maintain”` signal

    void
    user_function (MilterClient *milterclient,
                   gpointer      user_data)

Flags: Run Last

### The `“sessions-finished”` signal

    void
    user_function (MilterClient *milterclient,
                   guint         arg1,
                   gpointer      user_data)

Flags: Run Last

### The `“worker-created”` signal

    void
    user_function (MilterClient *milterclient,
                   gpointer      user_data)

Flags: Run Last

### The `“workers-created”` signal

    void
    user_function (MilterClient *milterclient,
                   guint         arg1,
                   gpointer      user_data)

Flags: Run Last

### The `“abort”` signal

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

This signal may be emitted at any time between “envelope-from” and “end-of-message”. This signal is only emitted if the milter causes an internal error and the message processing isn't completed. For example, if the milter has already returned `MILTER_STATUS_ACCEPT`, `MILTER_STATUS_REJECT`, `MILTER_STATUS_DISCARD` and `MILTER_STATUS_TEMPORARY_FAILURE`, this signal will not emitted.

If the milter has any resources allocated for the message between “envelope-from” and “end-of-message”, should be freed in this signal. But any resources allocated for the connection should not be freed in this signal. It should be freed in “finished”.

すべての利用可能な応答ステータスは以下の通りです。

`MILTER_STATUS_CONTINUE`

  現在のメッセージに対する処理を続けます。

`MILTER_STATUS_DISCARD`

  Accepts the current message and discards it silently.

  “abort” is not emitted.

`MILTER_STATUS_ACCEPT`

  Accepts the current message without further more processing.

  “abort” is not emitted.

`MILTER_STATUS_TEMPORARY_FAILURE`

  Rejects the current message with temporary failure. (i.e. 4xx status code in SMTP)

  “abort” is not emitted.

`MILTER_STATUS_PROGRESS`

  It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.

  If you returns this status, you need to emit “end-of-message-response” signal by yourself with one of the above `MilterStatus`es.

  This status may be used for a milter that has IO wait. (e.g. The milter may need to connect to the its server like clamav-milter) Normally, this status will not be used.

milter.orgの xxfi_abortも見てください。

#### Parameters

context | シグナルを受け取るコンテキスト。 |
user_data | user data set when the signal handler was connected. |

#### Returns

応答ステータス。

Flags: Run Last

### The `“abort-response”` signal

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

This signal is emitted implicitly after “abort” returns a status except `MILTER_STATUS_PROGRESS`. This signal's default handler replies a response to MTA. You don't need to connect this signal.

If you returns `MILTER_STATUS_PROGRESS` in “abort”, you need to emit this signal to `context` by yourself.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
status | 応答ステータス。 |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“body”` signal

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

This signal is emitted on body data is received. This signal is emitted zero or more times between “end-of-header” and “end-of-message”.

すべての利用可能な応答ステータスは以下の通りです。

`MILTER_STATUS_CONTINUE`

  現在のメッセージに対する処理を続けます。

`MILTER_STATUS_REJECT`

  Rejects the current message.

  “abort” is not emitted.

`MILTER_STATUS_DISCARD`

  Accepts the current message and discards it silently.

  “abort” is not emitted.

`MILTER_STATUS_ACCEPT`

  Accepts the current message without further more processing.

  “abort” is not emitted.

`MILTER_STATUS_TEMPORARY_FAILURE`

  Rejects the current message with temporary failure. (i.e. 4xx status code in SMTP)

  “abort” is not emitted.

`MILTER_STATUS_SKIP`

  Skips further body processing. “end-of-message” is emitted.

`MILTER_STATUS_NO_REPLY`

  Doesn't send a reply back to MTA.

  The milter must set `MILTER_STEP_NO_REPLY_BODY` in “negotiate” handler.

`MILTER_STATUS_PROGRESS`

  It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.

  If you returns this status, you need to emit “body-response” signal by yourself with one of the above `MilterStatus`es.

  This status may be used for a milter that has IO wait. (e.g. The milter may need to connect to the its server like clamav-milter) Normally, this status will not be used.

milter.orgの xxfi_bodyも見てください。

#### Parameters

context | シグナルを受け取るコンテキスト。 |
chunk | 本文の1かたまり。 |
size | the size of `chunk` . |
user_data | user data set when the signal handler was connected. |

#### Returns

応答ステータス。

Flags: Run Last

### The `“body-response”` signal

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

This signal is emitted implicitly after “body” returns a status except `MILTER_STATUS_PROGRESS`. This signal's default handler replies a response to MTA. You don't need to connect this signal.

If you returns `MILTER_STATUS_PROGRESS` in “body”, you need to emit this signal to `context` by yourself.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
status | 応答ステータス。 |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“connect”` signal

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

This signal is emitted on SMTP client is connected to MTA.

すべての利用可能な応答ステータスは以下の通りです。

`MILTER_STATUS_CONTINUE`

  現在の接続に対する処理を続行します。

`MILTER_STATUS_REJECT`

  Rejects the current connection.

  “finished” will be emitted.

`MILTER_STATUS_ACCEPT`

  Accepts the current connection without further more processing.

  “finished” will be emitted.

`MILTER_STATUS_TEMPORARY_FAILURE`

  Rejects the current connection with a temporary failure. (i.e. 4xx status code in SMTP)

  “finished” will be emitted.

`MILTER_STATUS_NO_REPLY`

  Doesn't send a reply back to MTA.

  The milter must set `MILTER_STEP_NO_REPLY_CONNECT` in “negotiate” handler.

`MILTER_STATUS_PROGRESS`

  It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.

  If you returns this status, you need to emit “connect-response” signal by yourself with one of the above `MilterStatus`es.

  This status may be used for a milter that has IO wait. (e.g. The milter may need to connect to the its server like clamav-milter) Normally, this status will not be used.

milter.orgのxxfi_connectも見てください。

#### Parameters

context | シグナルを受け取るコンテキスト。 |
host_name | 接続してきたSMTPクライアントのホスト名。 |
address | 接続してきたSMTPクライアントのアドレス。（struct sockaddr） |
address_size | the size of `address` . (socklen_t) |
user_data | user data set when the signal handler was connected. |

#### Returns

応答ステータス。

Flags: Run Last

### The `“connect-response”` signal

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

This signal is emitted implicitly after “connect” returns a status except `MILTER_STATUS_PROGRESS`. This signal's default handler replies a response to MTA. You don't need to connect this signal.

If you returns `MILTER_STATUS_PROGRESS` in “connect”, you need to emit this signal to `context` by yourself.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
status | 応答ステータス。 |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“data”` signal

    MilterStatus
    user_function (MilterClientContext *context,
                   gpointer             user_data)

このシグナルはSMTPの"DATA"コマンドのときに発行されます。

すべての利用可能な応答ステータスは以下の通りです。

`MILTER_STATUS_CONTINUE`

  現在のメッセージに対する処理を続けます。

`MILTER_STATUS_REJECT`

  Rejects the current message.

  “abort” is not emitted.

`MILTER_STATUS_DISCARD`

  Accepts the current message and discards it silently.

  “abort” is not emitted.

`MILTER_STATUS_TEMPORARY_FAILURE`

  Rejects the current message with temporary failure. (i.e. 4xx status code in SMTP)

  “abort” is not emitted.

`MILTER_STATUS_NO_REPLY`

  Doesn't send a reply back to MTA.

  The milter must set `MILTER_STEP_NO_REPLY_DATA` in “negotiate” handler.

`MILTER_STATUS_PROGRESS`

  It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.

  If you returns this status, you need to emit “data-response” signal by yourself with one of the above `MilterStatus`es.

  This status may be used for a milter that has IO wait. (e.g. The milter may need to connect to the its server like clamav-milter) Normally, this status will not be used.

milter.orgの xxfi_dataも見てください。

#### Parameters

context | シグナルを受け取るコンテキスト。 |
user_data | user data set when the signal handler was connected. |

#### Returns

応答ステータス。

Flags: Run Last

### The `“data-response”` signal

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

This signal is emitted implicitly after “data” returns a status except `MILTER_STATUS_PROGRESS`. This signal's default handler replies a response to MTA. You don't need to connect this signal.

If you returns `MILTER_STATUS_PROGRESS` in “data”, you need to emit this signal to `context` by yourself.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
status | 応答ステータス。 |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“define-macro”` signal

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

This signal is emitted when macro definition is received. Normally, this signal isn't needed to be connected.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
command | マクロが定義されるコマンド。 |
macros | マクロ定義。 |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“end-of-header”` signal

    MilterStatus
    user_function (MilterClientContext *context,
                   gpointer             user_data)

このシグナルはすべてのヘッダが処理されたときに呼ばれます。

すべての利用可能な応答ステータスは以下の通りです。

`MILTER_STATUS_CONTINUE`

  現在のメッセージに対する処理を続けます。

`MILTER_STATUS_REJECT`

  Rejects the current message.

  “abort” is not emitted.

`MILTER_STATUS_DISCARD`

  Accepts the current message and discards it silently.

  “abort” is not emitted.

`MILTER_STATUS_ACCEPT`

  Accepts the current message without further more processing.

  “abort” is not emitted.

`MILTER_STATUS_TEMPORARY_FAILURE`

  Rejects the current message with temporary failure. (i.e. 4xx status code in SMTP)

  “abort” is not emitted.

`MILTER_STATUS_NO_REPLY`

  Doesn't send a reply back to MTA.

  The milter must set `MILTER_STEP_NO_REPLY_END_OF_HEADER` in “negotiate” handler.

`MILTER_STATUS_PROGRESS`

  It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.

  If you returns this status, you need to emit “end-of-header-response” signal by yourself with one of the above `MilterStatus`es.

  This status may be used for a milter that has IO wait. (e.g. The milter may need to connect to the its server like clamav-milter) Normally, this status will not be used.

milter.orgの xxfi_eofも見てください。

#### Parameters

context | シグナルを受け取るコンテキスト。 |
user_data | user data set when the signal handler was connected. |

#### Returns

応答ステータス。

Flags: Run Last

### The `“end-of-header-response”` signal

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

This signal is emitted implicitly after “end-of-header” returns a status except `MILTER_STATUS_PROGRESS`. This signal's default handler replies a response to MTA. You don't need to connect this signal.

If you returns `MILTER_STATUS_PROGRESS` in “end-of-header”, you need to emit this signal to `context` by yourself.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
status | 応答ステータス。 |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“end-of-message”` signal

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

This signal is emitted after all “body” are emitted. All message modifications can be done only in this signal handler. The modifications can be done with `milter_client_context_add_header()`, `milter_client_context_change_from()` and so on.

すべての利用可能な応答ステータスは以下の通りです。

`MILTER_STATUS_CONTINUE`

  現在のメッセージに対する処理を続けます。

`MILTER_STATUS_DISCARD`

  Accepts the current message and discards it silently.

  “abort” is not emitted.

`MILTER_STATUS_ACCEPT`

  Accepts the current message without further more processing.

  “abort” is not emitted.

`MILTER_STATUS_TEMPORARY_FAILURE`

  Rejects the current message with temporary failure. (i.e. 4xx status code in SMTP)

  “abort” is not emitted.

`MILTER_STATUS_PROGRESS`

  It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.

  If you returns this status, you need to emit “end-of-message-response” signal by yourself with one of the above `MilterStatus`es.

  This status may be used for a milter that has IO wait. (e.g. The milter may need to connect to the its server like clamav-milter) Normally, this status will not be used.

milter.orgの xxfi_eomも見てください。

#### Parameters

context | シグナルを受け取るコンテキスト。 |
user_data | user data set when the signal handler was connected. |

#### Returns

応答ステータス。

Flags: Run Last

### The `“end-of-message-response”` signal

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

This signal is emitted implicitly after “end-of-message” returns a status except `MILTER_STATUS_PROGRESS`. This signal's default handler replies a response to MTA. You don't need to connect this signal.

If you returns `MILTER_STATUS_PROGRESS` in “end-of-message”, you need to emit this signal to `context` by yourself.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
status | 応答ステータス。 |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“envelope-from”` signal

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

このシグナルはSMTPの"MAIL FROM"コマンドのときに呼ばれます。

すべての利用可能な応答ステータスは以下の通りです。

`MILTER_STATUS_CONTINUE`

  現在のメッセージに対する処理を続けます。

`MILTER_STATUS_REJECT`

  Rejects the current envelope from address and message. A new envelope from may be specified.

  “abort” is not emitted.

`MILTER_STATUS_DISCARD`

  Accepts the current message and discards it silently.

  “abort” is not emitted.

`MILTER_STATUS_ACCEPT`

  Accepts the current message without further more processing.

  “abort” is not emitted.

`MILTER_STATUS_TEMPORARY_FAILURE`

  Rejects the current envelope from address and message with temporary failure. (i.e. 4xx status code in SMTP) A new envelope from address may be specified.

  “abort” is not emitted.

`MILTER_STATUS_NO_REPLY`

  Doesn't send a reply back to MTA.

  The milter must set `MILTER_STEP_NO_REPLY_ENVELOPE_FROM` in “negotiate” handler.

`MILTER_STATUS_PROGRESS`

  It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.

  If you returns this status, you need to emit “envelope-from-response” signal by yourself with one of the above `MilterStatus`es.

  This status may be used for a milter that has IO wait. (e.g. The milter may need to connect to the its server like clamav-milter) Normally, this status will not be used.

milter.orgの xxfi_envfromも見てください。

#### Parameters

context | シグナルを受け取るコンテキスト。 |
from | SMTPの"MAIL FROM"コマンドの送信アドレス。 |
user_data | user data set when the signal handler was connected. |

#### Returns

応答ステータス。

Flags: Run Last

### The `“envelope-from-response”` signal

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

This signal is emitted implicitly after “envelope-from” returns a status except `MILTER_STATUS_PROGRESS`. This signal's default handler replies a response to MTA. You don't need to connect this signal.

If you returns `MILTER_STATUS_PROGRESS` in “envelope-from”, you need to emit this signal to `context` by yourself.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
status | 応答ステータス。 |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“envelope-recipient”` signal

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

このシグナルはSMTPの"RCPT TO"コマンドのときに発行されます。

すべての利用可能な応答ステータスは以下の通りです。

`MILTER_STATUS_CONTINUE`

  現在のメッセージに対する処理を続けます。

`MILTER_STATUS_REJECT`

  Rejects the current envelope recipient address. Processing the current messages is continued.

  “abort” is not emitted.

`MILTER_STATUS_DISCARD`

  Accepts the current message and discards it silently.

  “abort” is not emitted.

`MILTER_STATUS_ACCEPT`

  Accepts the current envelope recipient.

  “abort” is not emitted.

`MILTER_STATUS_TEMPORARY_FAILURE`

  Rejects the current envelope recipient address with temporary failure. (i.e. 4xx status code in SMTP) Processing the current message is continued.

  “abort” is not emitted.

`MILTER_STATUS_NO_REPLY`

  Doesn't send a reply back to MTA.

  The milter must set `MILTER_STEP_NO_REPLY_ENVELOPE_RECIPIENT` in “negotiate” handler.

`MILTER_STATUS_PROGRESS`

  It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.

  If you returns this status, you need to emit “envelope-recipient-response” signal by yourself with one of the above `MilterStatus`es.

  This status may be used for a milter that has IO wait. (e.g. The milter may need to connect to the its server like clamav-milter) Normally, this status will not be used.

milter.orgの xxfi_envrcptも見てください。

#### Parameters

context | シグナルを受け取るコンテキスト。 |
recipient | SMTPの"RCPT TO"コマンドの宛先アドレス。 |
user_data | user data set when the signal handler was connected. |

#### Returns

応答ステータス。

Flags: Run Last

### The `“envelope-recipient-response”` signal

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

This signal is emitted implicitly after “envelope-recipient” returns a status except `MILTER_STATUS_PROGRESS`. This signal's default handler replies a response to MTA. You don't need to connect this signal.

If you returns `MILTER_STATUS_PROGRESS` in “envelope-recipient”, you need to emit this signal to `context` by yourself.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
status | 応答ステータス。 |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“header”` signal

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

This signal is emitted on each header. If `MILTER_STEP_HEADER_LEADING_SPACE` is set in “negotiate”, `value` have spaces after header name and value separator ":".

例:

    From: from <from@example.com>
    To: recipient <recipient@example.com>
    Subject:a subject

`MILTER_STEP_HEADER_VALUE_WITH_LEADING_SPACE`あり:

    "From", " from <from@example.com>"
    "To", " recipient <recipient@example.com>"
    "Subject", "a subject"

`MILTER_STEP_HEADER_VALUE_WITH_LEADING_SPACE`なし:

    "From", "from <from@example.com>"
    "To", "recipient <recipient@example.com>"
    "Subject", "a subject"

すべての利用可能な応答ステータスは以下の通りです。

`MILTER_STATUS_CONTINUE`

  現在のメッセージに対する処理を続けます。

`MILTER_STATUS_REJECT`

  Rejects the current message.

  “abort” is not emitted.

`MILTER_STATUS_DISCARD`

  Accepts the current message and discards it silently.

  “abort” is not emitted.

`MILTER_STATUS_ACCEPT`

  Accepts the current message without further more processing.

  “abort” is not emitted.

`MILTER_STATUS_TEMPORARY_FAILURE`

  Rejects the current message with temporary failure. (i.e. 4xx status code in SMTP)

  “abort” is not emitted.

`MILTER_STATUS_NO_REPLY`

  Doesn't send a reply back to MTA.

  The milter must set `MILTER_STEP_NO_REPLY_HEADER` in “negotiate” handler.

`MILTER_STATUS_PROGRESS`

  It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.

  If you returns this status, you need to emit “header-response” signal by yourself with one of the above `MilterStatus`es.

  This status may be used for a milter that has IO wait. (e.g. The milter may need to connect to the its server like clamav-milter) Normally, this status will not be used.

milter.orgの xxfi_headerも見てください。

#### Parameters

context | シグナルを受け取るコンテキスト。 |
name | ヘッダ名。 |
value | ヘッダ値。`value`は折り返し時に挿入された空白を含むかもしれません。 |
user_data | user data set when the signal handler was connected. |

#### Returns

応答ステータス。

Flags: Run Last

### The `“header-response”` signal

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

This signal is emitted implicitly after “header” returns a status except `MILTER_STATUS_PROGRESS`. This signal's default handler replies a response to MTA. You don't need to connect this signal.

If you returns `MILTER_STATUS_PROGRESS` in “header”, you need to emit this signal to `context` by yourself.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
status | 応答ステータス。 |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“helo”` signal

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

このシグナルはSMTPの"HELO"/"EHLO"コマンドのときに発行されます。

すべての利用可能な応答ステータスは以下の通りです。

`MILTER_STATUS_CONTINUE`

  現在の接続に対する処理を続行します。

`MILTER_STATUS_REJECT`

  Rejects the current connection.

  “finished” will be emitted.

`MILTER_STATUS_ACCEPT`

  Accepts the current connection without further more processing.

  “finished” will be emitted.

`MILTER_STATUS_TEMPORARY_FAILURE`

  Rejects the current connection with a temporary failure. (i.e. 4xx status code in SMTP)

  “finished” will be emitted.

`MILTER_STATUS_NO_REPLY`

  Doesn't send a reply back to MTA.

  The milter must set `MILTER_STEP_NO_REPLY_HELO` in “negotiate” handler.

`MILTER_STATUS_PROGRESS`

  It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.

  If you returns this status, you need to emit “helo-response” signal by yourself with one of the above `MilterStatus`es.

  This status may be used for a milter that has IO wait. (e.g. The milter may need to connect to the its server like clamav-milter) Normally, this status will not be used.

milter.orgの xxfi_heloも見てください。

#### Parameters

context | シグナルを受け取るコンテキスト。 |
fqdn | SMTPの"HELO"/"EHLO"コマンドでのFQDN。 |
user_data | user data set when the signal handler was connected. |

#### Returns

応答ステータス。

Flags: Run Last

### The `“helo-response”` signal

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

This signal is emitted implicitly after “helo” returns a status except `MILTER_STATUS_PROGRESS`. This signal's default handler replies a response to MTA. You don't need to connect this signal.

If you returns `MILTER_STATUS_PROGRESS` in “helo”, you need to emit this signal to `context` by yourself.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
status | 応答ステータス。 |
user_data | user data set when the signal handler was connected. |

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)

This signal is emitted on negotiate request from MTA. If you want to modify actions (`MilterActionFlags`) and steps (`MilterStepFlags`), you modify `option` . If you want to add macros that you want to receive, you modify `macros_requests` .

すべての利用可能な応答ステータスは以下の通りです。

`MILTER_STATUS_ALL_OPTIONS`

  すべての利用可能なアクションとステップを有効にします。

`MILTER_STATUS_REJECT`

  現在のセッションを拒否します。

`MILTER_STATUS_CONTINUE`

  `option`と`macros_requests`で指定されたアクション、ステップ、要求マクロリストを使って現在のセッションの処理を続けます

`MILTER_STATUS_PROGRESS`

  It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.

  If you returns this status, you need to emit “negotiate-response” signal by yourself with one of the above `MilterStatus`es.

  This status may be used for a milter that has IO wait. (e.g. The milter may need to connect to the its server like clamav-milter) Normally, this status will not be used.

milter.orgの xxfi_negotiateも見てください。

#### Parameters

context | シグナルを受け取るコンテキスト。 |
option | MTAからのネゴシエーションのオプション。 |
macros_requests | 要求マクロリスト。 |
user_data | user data set when the signal handler was connected. |

#### Returns

応答ステータス。

Flags: Run Last

### The `“negotiate-response”` signal

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

This signal is emitted implicitly after “negotiate” returns a status except `MILTER_STATUS_PROGRESS`. This signal's default handler replies a response to MTA. You don't need to connect this signal.

If you returns `MILTER_STATUS_PROGRESS` in “negotiate” handler, you need to emit this signal to `context` by yourself.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
option | MTAからのネゴシエーションのオプション。 |
macros_requests | 要求マクロリスト。 |
status | 応答ステータス。 |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“timeout”` signal

    void
    user_function (MilterClientContext *context,
                   gpointer             user_data)

This signal is emitted if MTA doesn't return the next command within `milter_client_context_get_timeout()` seconds. If “timeout” is emitted, the current connection is aborted and “finished” are emitted. “abort” may be emitted before “finished” if the milter is processing a message.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“unknown”` signal

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

このシグナルは未知のSMTPコマンドまたは未実装のSMTPコマンドが送られてきた場合に発行されます。

すべての利用可能な応答ステータスは以下の通りです。

`MILTER_STATUS_REJECT`

  Rejects the current message.

  “abort” is not emitted.

`MILTER_STATUS_TEMPORARY_FAILURE`

  Rejects the current message with temporary failure. (i.e. 4xx status code in SMTP)

  “abort” is not emitted.

`MILTER_STATUS_NO_REPLY`

  Doesn't send a reply back to MTA.

  The milter must set `MILTER_STEP_NO_REPLY_DATA` in “negotiate” handler.

`MILTER_STATUS_PROGRESS`

  It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.

  If you returns this status, you need to emit “unknown-response” signal by yourself with one of the above `MilterStatus`es.

  This status may be used for a milter that has IO wait. (e.g. The milter may need to connect to the its server like clamav-milter) Normally, this status will not be used.

MTAは、未知のSMTPコマンドまたは未実装のSMTPコマンドは常に拒否することに中してください。

milter.orgの xxfi_unknownも見てください。

#### Parameters

context | シグナルを受け取るコンテキスト。 |
command | 未知のSMTPコマンド。 |
user_data | user data set when the signal handler was connected. |

#### Returns

応答ステータス。

Flags: Run Last

### The `“unknown-response”` signal

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

This signal is emitted implicitly after “unknown” returns a status except `MILTER_STATUS_PROGRESS`. This signal's default handler replies a response to MTA. You don't need to connect this signal.

If you returns `MILTER_STATUS_PROGRESS` in “unknown”, you need to emit this signal to `context` by yourself.

#### Parameters

context | シグナルを受け取るコンテキスト。 |
status | 応答ステータス。 |
user_data | user data set when the signal handler was connected. |

Flags: Run Last