<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="MilterClientContext">
<refmeta>
<refentrytitle role="top_of_page" id="MilterClientContext.top_of_page">MilterClientContext</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>milter managerライブラリ</refmiscinfo>
</refmeta>
<refnamediv>
<refname>MilterClientContext</refname>
<refpurpose>milterプロトコルを処理します。</refpurpose>
</refnamediv>

<refsynopsisdiv id="MilterClientContext.synopsis" role="synopsis">
<title role="synopsis.title">概要</title>

<synopsis>#define             <link linkend="MILTER-CLIENT-CONTEXT-ERROR:CAPS">MILTER_CLIENT_CONTEXT_ERROR</link>
enum                <link linkend="MilterClientContextError">MilterClientContextError</link>;
enum                <link linkend="MilterClientContextState">MilterClientContextState</link>;
                    <link linkend="MilterClientContext-struct">MilterClientContext</link>;
<link linkend="GQuark"><returnvalue>GQuark</returnvalue></link>              <link linkend="milter-client-context-error-quark">milter_client_context_error_quark</link>   (<parameter><type>void</type></parameter>);
<link linkend="MilterClientContext"><returnvalue>MilterClientContext</returnvalue></link> * <link linkend="milter-client-context-new">milter_client_context_new</link>         (<parameter><link linkend="MilterClient"><type>MilterClient</type></link> *client</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="milter-client-context-feed">milter_client_context_feed</link>          (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *chunk</parameter>,
                                                         <parameter><link linkend="gsize"><type>gsize</type></link> size</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="gpointer"><returnvalue>gpointer</returnvalue></link>            <link linkend="milter-client-context-get-private-data">milter_client_context_get_private_data</link>
                                                        (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="milter-client-context-set-private-data">milter_client_context_set_private_data</link>
                                                        (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter><link linkend="gpointer"><type>gpointer</type></link> data</parameter>,
                                                         <parameter><link linkend="GDestroyNotify"><type>GDestroyNotify</type></link> destroy</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="milter-client-context-set-reply">milter_client_context_set_reply</link>     (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter><link linkend="guint"><type>guint</type></link> code</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *extended_code</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *message</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="gchar"><returnvalue>gchar</returnvalue></link> *             <link linkend="milter-client-context-format-reply">milter_client_context_format_reply</link>  (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="milter-client-context-add-header">milter_client_context_add_header</link>    (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *value</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="milter-client-context-insert-header">milter_client_context_insert_header</link> (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter><link linkend="guint32"><type>guint32</type></link> index</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *value</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="milter-client-context-change-header">milter_client_context_change_header</link> (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                                                         <parameter><link linkend="guint32"><type>guint32</type></link> index</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *value</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="milter-client-context-delete-header">milter_client_context_delete_header</link> (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                                                         <parameter><link linkend="guint32"><type>guint32</type></link> index</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="milter-client-context-change-from">milter_client_context_change_from</link>   (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *from</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *parameters</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="milter-client-context-add-recipient">milter_client_context_add_recipient</link> (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *recipient</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *parameters</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="milter-client-context-delete-recipient">milter_client_context_delete_recipient</link>
                                                        (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *recipient</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="milter-client-context-replace-body">milter_client_context_replace_body</link>  (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *body</parameter>,
                                                         <parameter><link linkend="gsize"><type>gsize</type></link> body_size</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="milter-client-context-progress">milter_client_context_progress</link>      (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="milter-client-context-quarantine">milter_client_context_quarantine</link>    (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *reason</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="milter-client-context-set-timeout">milter_client_context_set_timeout</link>   (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter><link linkend="guint"><type>guint</type></link> timeout</parameter>);
<link linkend="guint"><returnvalue>guint</returnvalue></link>               <link linkend="milter-client-context-get-timeout">milter_client_context_get_timeout</link>   (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="milter-client-context-set-state">milter_client_context_set_state</link>     (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter><link linkend="MilterClientContextState"><type>MilterClientContextState</type></link> state</parameter>);
<link linkend="MilterClientContextState"><returnvalue>MilterClientContextState</returnvalue></link> <link linkend="milter-client-context-get-state">milter_client_context_get_state</link>
                                                        (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="milter-client-context-set-option">milter_client_context_set_option</link>    (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter><link linkend="MilterOption"><type>MilterOption</type></link> *option</parameter>);
<link linkend="MilterOption"><returnvalue>MilterOption</returnvalue></link> *      <link linkend="milter-client-context-get-option">milter_client_context_get_option</link>    (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>);
</synopsis>
</refsynopsisdiv>
<refsect1 id="MilterClientContext.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">オブジェクト階層</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="MilterAgent">MilterAgent</link>
         +----<link linkend="MilterProtocolAgent">MilterProtocolAgent</link>
               +----MilterClientContext
</synopsis>
</refsect1>
<refsect1 id="MilterClientContext.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">実装されたインターフェイス</title>
<para>MilterClientContextは<link linkend="MilterErrorEmittable">MilterErrorEmittable</link>と<link linkend="MilterFinishedEmittable">MilterFinishedEmittable</link>を実装しています。</para>
</refsect1>
<refsect1 id="MilterClientContext.properties" role="properties">
<title role="properties.title">プロパティ</title>
<synopsis>
  "<link linkend="MilterClientContext--client">client</link>"                   <link linkend="MilterClient"><type>MilterClient</type></link>*         : Read / Write / Construct Only
  "<link linkend="MilterClientContext--message-result">message-result</link>"           <link linkend="MilterMessageResult"><type>MilterMessageResult</type></link>*  : Read / Write
  "<link linkend="MilterClientContext--option">option</link>"                   <link linkend="MilterOption"><type>MilterOption</type></link>*         : Read / Write
  "<link linkend="MilterClientContext--packet-buffer-size">packet-buffer-size</link>"       <link linkend="guint"><type>guint</type></link>                 : Read / Write
  "<link linkend="MilterClientContext--quarantine-reason">quarantine-reason</link>"        <link linkend="gchar"><type>gchar</type></link>*                : Read / Write
  "<link linkend="MilterClientContext--state">state</link>"                    <link linkend="MilterClientContextState"><type>MilterClientContextState</type></link>  : Read / Write
  "<link linkend="MilterClientContext--status">status</link>"                   <link linkend="MilterStatus"><type>MilterStatus</type></link>          : Read / Write
</synopsis>
</refsect1>
<refsect1 id="MilterClientContext.signals" role="signal_proto">
<title role="signal_proto.title">シグナル</title>
<synopsis>
  "<link linkend="MilterClientContext-abort">abort</link>"                                          : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-abort-response">abort-response</link>"                                 : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-body">body</link>"                                           : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-body-response">body-response</link>"                                  : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-connect">connect</link>"                                        : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-connect-response">connect-response</link>"                               : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-data">data</link>"                                           : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-data-response">data-response</link>"                                  : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-define-macro">define-macro</link>"                                   : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-end-of-header">end-of-header</link>"                                  : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-end-of-header-response">end-of-header-response</link>"                         : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-end-of-message">end-of-message</link>"                                 : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-end-of-message-response">end-of-message-response</link>"                        : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-envelope-from">envelope-from</link>"                                  : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-envelope-from-response">envelope-from-response</link>"                         : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-envelope-recipient">envelope-recipient</link>"                             : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-envelope-recipient-response">envelope-recipient-response</link>"                    : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-header">header</link>"                                         : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-header-response">header-response</link>"                                : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-helo">helo</link>"                                           : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-helo-response">helo-response</link>"                                  : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-message-processed">message-processed</link>"                              : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-negotiate">negotiate</link>"                                      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-negotiate-response">negotiate-response</link>"                             : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-timeout">timeout</link>"                                        : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-unknown">unknown</link>"                                        : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  "<link linkend="MilterClientContext-unknown-response">unknown-response</link>"                               : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
</synopsis>
</refsect1>

<refsect1 id="MilterClientContext.description" role="desc">
<title role="desc.title">説明</title>
<para><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>は1つのmilterプロトコルセッションを処理します。これは<link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>インスタンスは各milterプロトコルセッション毎に生成されるということです。</para>
<para>各milterプロトコルコマンドを処理するために、<link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>のシグナルに接続します。<link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>にはmilterプロトコルのイベントに対応したシグナルがあります。</para>
<variablelist>
  <varlistentry>
  <term id="xml.&lt;ulink">
  <ulink url="https://www.milter.org/developers/api/xxfi_negotiate">xxfi_negotiate</ulink>
</term>
  <listitem>
  <para>
  <link linkend="MilterClientContext-negotiate"><type>"negotiate"</type></link>
</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <ulink url="https://www.milter.org/developers/api/xxfi_connect">xxfi_connect</ulink>
</term>
  <listitem>
  <para>
  <link linkend="MilterClientContext-connect"><type>"connect"</type></link>
</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <ulink url="https://www.milter.org/developers/api/xxfi_helo">xxfi_helo</ulink>
</term>
  <listitem>
  <para>
  <link linkend="MilterClientContext-helo"><type>"helo"</type></link>
</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <ulink url="https://www.milter.org/developers/api/xxfi_envfrom">xxfi_envfrom</ulink>
</term>
  <listitem>
  <para>
  <link linkend="MilterClientContext-envelope-from"><type>"envelope-from"</type></link>
</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <ulink url="https://www.milter.org/developers/api/xxfi_envrcpt">xxfi_envrcpt</ulink>
</term>
  <listitem>
  <para>
  <link linkend="MilterClientContext-envelope-recipient"><type>"envelope-recipient"</type></link>
</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <ulink url="https://www.milter.org/developers/api/xxfi_data">xxfi_data</ulink>
</term>
  <listitem>
  <para>
  <link linkend="MilterClientContext-data"><type>"data"</type></link>
</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <ulink url="https://www.milter.org/developers/api/xxfi_unknown">xxfi_unknown</ulink>
</term>
  <listitem>
  <para>
  <link linkend="MilterClientContext-unknown"><type>"unknown"</type></link>
</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <ulink url="https://www.milter.org/developers/api/xxfi_header">xxfi_header</ulink>
</term>
  <listitem>
  <para>
  <link linkend="MilterClientContext-header"><type>"header"</type></link>
</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <ulink url="https://www.milter.org/developers/api/xxfi_eoh">xxfi_eoh</ulink>
</term>
  <listitem>
  <para>
  <link linkend="MilterClientContext-end-of-header"><type>"end-of-header"</type></link>
</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <ulink url="https://www.milter.org/developers/api/xxfi_body">xxfi_body</ulink>
</term>
  <listitem>
  <para>
  <link linkend="MilterClientContext-body"><type>"body"</type></link>
</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <ulink url="https://www.milter.org/developers/api/xxfi_eom">xxfi_eom</ulink>
</term>
  <listitem>
  <para>
  <link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>
</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <ulink url="https://www.milter.org/developers/api/xxfi_abort">xxfi_abort</ulink>
</term>
  <listitem>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>。</para>
  <para>
  NOTE: You will need to check whether the current state is message processing or not. You can use <link linkend="MILTER-CLIENT-CONTEXT-STATE-IN-MESSAGE-PROCESSING:CAPS"><literal>MILTER_CLIENT_CONTEXT_STATE_IN_MESSAGE_PROCESSING</literal></link> for it.
</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <ulink url="https://www.milter.org/developers/api/xxfi_close">xxfi_close</ulink>
</term>
  <listitem>
  <para>
  <link linkend="MilterFinishedEmittable-finished"><type>"finished"</type></link>
</para>
</listitem>
</varlistentry>
</variablelist>
<para>以下はシグナルに接続する例です。すべてのシグナルに接続して、各シグナルハンドラはイベント名を表示します。</para>
<para>
<informalexample><programlisting>
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, <link linkend="name">name</link>, 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
}
</programlisting></informalexample>
</para>
</refsect1>
<refsect1 id="MilterClientContext.details" role="details">
<title role="details.title">詳細</title>
<refsect2 id="MILTER-CLIENT-CONTEXT-ERROR:CAPS" role="macro">
<title>MILTER_CLIENT_CONTEXT_ERROR</title>
<indexterm zone="MILTER-CLIENT-CONTEXT-ERROR:CAPS"><primary>MILTER_CLIENT_CONTEXT_ERROR</primary></indexterm>
<programlisting>#define MILTER_CLIENT_CONTEXT_ERROR           (milter_client_context_error_quark())
</programlisting>
<para><link linkend="MilterClientContext"><type>MilterClientContext</type></link>のエラー用の<link linkend="GError"><type>GError</type></link>クォークを取得するために使われます。</para></refsect2>
<refsect2 id="MilterClientContextError" role="enum">
<title>enum MilterClientContextError</title>
<indexterm zone="MilterClientContextError"><primary>MilterClientContextError</primary></indexterm>
<programlisting>typedef enum {
    MILTER_CLIENT_CONTEXT_ERROR_INVALID_CODE,
    MILTER_CLIENT_CONTEXT_ERROR_IO_ERROR,
    MILTER_CLIENT_CONTEXT_ERROR_NULL,
    MILTER_CLIENT_CONTEXT_ERROR_INVALID_STATE,
    MILTER_CLIENT_CONTEXT_ERROR_INVALID_ACTION,
    MILTER_CLIENT_CONTEXT_ERROR_EMPTY
} MilterClientContextError;
</programlisting>
<para><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>の関数呼び出し中に発生するエラーを識別します。</para><variablelist role="enum">
<varlistentry id="MILTER-CLIENT-CONTEXT-ERROR-INVALID-CODE:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_ERROR_INVALID_CODE</literal></term>
<listitem><simpara><link linkend="milter-client-context-set-reply"><function>milter_client_context_set_reply()</function></link>で指定されたステータスコードが不正であることを示します。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-ERROR-IO-ERROR:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_ERROR_IO_ERROR</literal></term>
<listitem><simpara>milterプロトコルデータの読み書き時に発生した入出力エラーを示します。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-ERROR-NULL:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_ERROR_NULL</literal></term>
<listitem><simpara>予期しない場所で<link linkend="NULL:CAPS"><literal>NULL</literal></link>が渡されたことを示します。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-ERROR-INVALID-STATE:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_ERROR_INVALID_STATE</literal></term>
<listitem><simpara>現在の<link linkend="MilterClientContextState"><literal>MilterClientContextState</literal></link>で予期しない操作が要求されたことを示します。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-ERROR-INVALID-ACTION:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_ERROR_INVALID_ACTION</literal></term>
<listitem><simpara>コンテキストの<link linkend="MilterActionFlags"><literal>MilterActionFlags</literal></link>で予期しない操作が要求されたことを示します。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-ERROR-EMPTY:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_ERROR_EMPTY</literal></term>
<listitem><simpara>
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="MilterClientContextState" role="enum">
<title>enum MilterClientContextState</title>
<indexterm zone="MilterClientContextState"><primary>MilterClientContextState</primary></indexterm>
<programlisting>typedef enum {
    MILTER_CLIENT_CONTEXT_STATE_INVALID,
    MILTER_CLIENT_CONTEXT_STATE_START,
    MILTER_CLIENT_CONTEXT_STATE_NEGOTIATE,
    MILTER_CLIENT_CONTEXT_STATE_NEGOTIATE_REPLIED,
    MILTER_CLIENT_CONTEXT_STATE_CONNECT,
    MILTER_CLIENT_CONTEXT_STATE_CONNECT_REPLIED,
    MILTER_CLIENT_CONTEXT_STATE_HELO,
    MILTER_CLIENT_CONTEXT_STATE_HELO_REPLIED,
    MILTER_CLIENT_CONTEXT_STATE_ENVELOPE_FROM,
    MILTER_CLIENT_CONTEXT_STATE_ENVELOPE_FROM_REPLIED,
    MILTER_CLIENT_CONTEXT_STATE_ENVELOPE_RECIPIENT,
    MILTER_CLIENT_CONTEXT_STATE_ENVELOPE_RECIPIENT_REPLIED,
    MILTER_CLIENT_CONTEXT_STATE_DATA,
    MILTER_CLIENT_CONTEXT_STATE_DATA_REPLIED,
    MILTER_CLIENT_CONTEXT_STATE_UNKNOWN,
    MILTER_CLIENT_CONTEXT_STATE_UNKNOWN_REPLIED,
    MILTER_CLIENT_CONTEXT_STATE_HEADER,
    MILTER_CLIENT_CONTEXT_STATE_HEADER_REPLIED,
    MILTER_CLIENT_CONTEXT_STATE_END_OF_HEADER,
    MILTER_CLIENT_CONTEXT_STATE_END_OF_HEADER_REPLIED,
    MILTER_CLIENT_CONTEXT_STATE_BODY,
    MILTER_CLIENT_CONTEXT_STATE_BODY_REPLIED,
    MILTER_CLIENT_CONTEXT_STATE_END_OF_MESSAGE,
    MILTER_CLIENT_CONTEXT_STATE_END_OF_MESSAGE_REPLIED,
    MILTER_CLIENT_CONTEXT_STATE_QUIT,
    MILTER_CLIENT_CONTEXT_STATE_QUIT_REPLIED,
    MILTER_CLIENT_CONTEXT_STATE_ABORT,
    MILTER_CLIENT_CONTEXT_STATE_ABORT_REPLIED,
    MILTER_CLIENT_CONTEXT_STATE_FINISHED
} MilterClientContextState;
</programlisting>
<para><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>の状態を識別します。</para><variablelist role="enum">
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-INVALID:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_INVALID</literal></term>
<listitem><simpara>不正な状態。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-START:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_START</literal></term>
<listitem><simpara>はじまったばかり。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-NEGOTIATE:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_NEGOTIATE</literal></term>
<listitem><simpara>ネゴシエーションを開始。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-NEGOTIATE-REPLIED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_NEGOTIATE_REPLIED</literal></term>
<listitem><simpara>ネゴシエーション応答を受信した</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-CONNECT:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_CONNECT</literal></term>
<listitem><simpara>接続情報を送信しました。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-CONNECT-REPLIED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_CONNECT_REPLIED</literal></term>
<listitem><simpara>接続情報への応答を受信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-HELO:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_HELO</literal></term>
<listitem><simpara>HELOコマンドの開始。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-HELO-REPLIED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_HELO_REPLIED</literal></term>
<listitem><simpara>HELOコマンドへの応答を受信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-ENVELOPE-FROM:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_ENVELOPE_FROM</literal></term>
<listitem><simpara>MAIL FROMコマンド開始。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-ENVELOPE-FROM-REPLIED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_ENVELOPE_FROM_REPLIED</literal></term>
<listitem><simpara>MAIL FROMコマンドへの応答を受信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-ENVELOPE-RECIPIENT:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_ENVELOPE_RECIPIENT</literal></term>
<listitem><simpara>RCPT TOコマンドの開始。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-ENVELOPE-RECIPIENT-REPLIED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_ENVELOPE_RECIPIENT_REPLIED</literal></term>
<listitem><simpara>RCPT TOコマンドへの応答を受信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-DATA:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_DATA</literal></term>
<listitem><simpara>DATAコマンドの開始。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-DATA-REPLIED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_DATA_REPLIED</literal></term>
<listitem><simpara>DATAコマンドへの応答を受信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-UNKNOWN:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_UNKNOWN</literal></term>
<listitem><simpara>未知のSMTPコマンドの受信。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-UNKNOWN-REPLIED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_UNKNOWN_REPLIED</literal></term>
<listitem><simpara>未知のSMTPコマンドへの応答を受信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-HEADER:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_HEADER</literal></term>
<listitem><simpara>ヘッダを送信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-HEADER-REPLIED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_HEADER_REPLIED</literal></term>
<listitem><simpara>ヘッダへの応答を受信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-END-OF-HEADER:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_END_OF_HEADER</literal></term>
<listitem><simpara>すべてのヘッダを送信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-END-OF-HEADER-REPLIED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_END_OF_HEADER_REPLIED</literal></term>
<listitem><simpara>ヘッダ終了への応答を受信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-BODY:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_BODY</literal></term>
<listitem><simpara>本体のかたまりの送信。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-BODY-REPLIED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_BODY_REPLIED</literal></term>
<listitem><simpara>本体への応答を受信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-END-OF-MESSAGE:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_END_OF_MESSAGE</literal></term>
<listitem><simpara>すべての本文を送信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-END-OF-MESSAGE-REPLIED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_END_OF_MESSAGE_REPLIED</literal></term>
<listitem><simpara>メッセージ終了への応答を受信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-QUIT:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_QUIT</literal></term>
<listitem><simpara>正常終了の開始。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-QUIT-REPLIED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_QUIT_REPLIED</literal></term>
<listitem><simpara>正常終了への応答を受信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-ABORT:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_ABORT</literal></term>
<listitem><simpara>異常終了の開始。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-ABORT-REPLIED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_ABORT_REPLIED</literal></term>
<listitem><simpara>異常終了への応答を受信した。</simpara></listitem>
</varlistentry>
<varlistentry id="MILTER-CLIENT-CONTEXT-STATE-FINISHED:CAPS" role="constant">
<term><literal>MILTER_CLIENT_CONTEXT_STATE_FINISHED</literal></term>
<listitem><simpara>終了した。</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="MilterClientContext-struct" role="struct">
<title>MilterClientContext</title>
<indexterm zone="MilterClientContext-struct"><primary>MilterClientContext</primary></indexterm>
<programlisting>typedef struct _MilterClientContext MilterClientContext;</programlisting>
<para>
</para></refsect2>
<refsect2 id="milter-client-context-error-quark" role="function">
<title>milter_client_context_error_quark ()</title>
<indexterm zone="milter-client-context-error-quark"><primary>milter_client_context_error_quark</primary></indexterm>
<programlisting><link linkend="GQuark"><returnvalue>GQuark</returnvalue></link>              milter_client_context_error_quark   (<parameter><type>void</type></parameter>);</programlisting>
<para>
</para></refsect2>
<refsect2 id="milter-client-context-new" role="function">
<title>milter_client_context_new ()</title>
<indexterm zone="milter-client-context-new"><primary>milter_client_context_new</primary></indexterm>
<programlisting><link linkend="MilterClientContext"><returnvalue>MilterClientContext</returnvalue></link> * milter_client_context_new         (<parameter><link linkend="MilterClient"><type>MilterClient</type></link> *client</parameter>);</programlisting>
<para>新しいコンテキストオブジェクトの生成。通常は、コンテキストオブジェクトは<link linkend="MilterClient"><literal>MilterClient</literal></link>が生成し、<link linkend="MilterClient-connection-established"><type>"connection-established"</type></link>シグナルで渡されます。</para><variablelist role="params">
<varlistentry><term><parameter>client</parameter> :</term>
<listitem><simpara>context用の<link linkend="MilterClient"><literal>MilterClient</literal></link>オブジェクト。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>新しい<link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>オブジェクト。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-feed" role="function">
<title>milter_client_context_feed ()</title>
<indexterm zone="milter-client-context-feed"><primary>milter_client_context_feed</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            milter_client_context_feed          (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *chunk</parameter>,
                                                         <parameter><link linkend="gsize"><type>gsize</type></link> size</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para><parameter>context</parameter>に入力を与えます。テストやデバッグに使えます。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>chunk</parameter> :</term>
<listitem><simpara><parameter>context</parameter>への入力。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter> :</term>
<listitem><simpara><parameter>chunk</parameter>のサイズ。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter> :</term>
<listitem><simpara>エラーを受け取る場所のアドレス、または<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>成功時は<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-get-private-data" role="function">
<title>milter_client_context_get_private_data ()</title>
<indexterm zone="milter-client-context-get-private-data"><primary>milter_client_context_get_private_data</primary></indexterm>
<programlisting><link linkend="gpointer"><returnvalue>gpointer</returnvalue></link>            milter_client_context_get_private_data
                                                        (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>);</programlisting>
<para><parameter>context</parameter>のプライベートなデータ。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara><link linkend="milter-client-context-set-private-data"><function>milter_client_context_set_private_data()</function></link>で設定したプライベートなデータ、あるいは<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-set-private-data" role="function">
<title>milter_client_context_set_private_data ()</title>
<indexterm zone="milter-client-context-set-private-data"><primary>milter_client_context_set_private_data</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                milter_client_context_set_private_data
                                                        (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter><link linkend="gpointer"><type>gpointer</type></link> data</parameter>,
                                                         <parameter><link linkend="GDestroyNotify"><type>GDestroyNotify</type></link> destroy</parameter>);</programlisting>
<para><parameter>context</parameter>のプライベートなデータを設定します。<parameter>data</parameter>は<parameter>destroy</parameter>で破棄されます。<parameter>data</parameter>が破棄されるのは、新しいプライベートなデータが設定されたときか、<parameter>context</parameter>が破棄されたときです。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter> :</term>
<listitem><simpara>プライベートなデータ。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>destroy</parameter> :</term>
<listitem><simpara><parameter>data</parameter>の破棄関数、あるいは<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-set-reply" role="function">
<title>milter_client_context_set_reply ()</title>
<indexterm zone="milter-client-context-set-reply"><primary>milter_client_context_set_reply</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            milter_client_context_set_reply     (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter><link linkend="guint"><type>guint</type></link> code</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *extended_code</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *message</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>エラー応答コードを設定します。<link linkend="MILTER-REPLY-TEMPORARY-FAILURE:CAPS"><literal>MILTER_REPLY_TEMPORARY_FAILURE</literal></link>のときは4xx <parameter>code</parameter>を使います。<link linkend="MILTER-REPLY-REJECT:CAPS"><literal>MILTER_REPLY_REJECT</literal></link>のときは5xx <parameter>code</parameter>を使います。</para>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/smfi_setreply"> smfi_setreply</ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>code</parameter> :</term>
<listitem><simpara>3桁のSMTPエラー応答コード。（RFC 2821）4xxと5xxだけが使えます。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>extended_code</parameter> :</term>
<listitem><simpara>拡張応答コード（RFC 1893/2034）、あるいは<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>message</parameter> :</term>
<listitem><simpara>SMTP応答のテキスト部分または<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter> :</term>
<listitem><simpara>エラーを受け取る場所のアドレス、または<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>成功時は<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-format-reply" role="function">
<title>milter_client_context_format_reply ()</title>
<indexterm zone="milter-client-context-format-reply"><primary>milter_client_context_format_reply</primary></indexterm>
<programlisting><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *             milter_client_context_format_reply  (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>);</programlisting>
<para><link linkend="milter-client-context-set-reply"><function>milter_client_context_set_reply()</function></link>で指定された現在のエラー応答コードを整形します。エラー応答コードが設定されていない場合は、<link linkend="NULL:CAPS"><literal>NULL</literal></link>を返します。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>整形された応答コード、あるいは<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-add-header" role="function">
<title>milter_client_context_add_header ()</title>
<indexterm zone="milter-client-context-add-header"><primary>milter_client_context_add_header</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            milter_client_context_add_header    (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *value</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>現在のメッセージのヘッダリストにヘッダを追加します。この関数は<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>シグナルの中で呼ぶことができます。</para>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/smfi_addheader"> smfi_addheader</ulink>も見てください。</para>
<para>FIXME: <link linkend="MILTER-ACTION-ADD-HEADERS:CAPS"><literal>MILTER_ACTION_ADD_HEADERS</literal></link>について書くこと。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter> :</term>
<listitem><simpara>ヘッダ名。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter> :</term>
<listitem><simpara>ヘッダ値。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter> :</term>
<listitem><simpara>エラーを受け取る場所のアドレス、または<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>成功時は<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-insert-header" role="function">
<title>milter_client_context_insert_header ()</title>
<indexterm zone="milter-client-context-insert-header"><primary>milter_client_context_insert_header</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            milter_client_context_insert_header (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter><link linkend="guint32"><type>guint32</type></link> index</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *value</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>現在のメッセージのヘッダリストの<parameter>index</parameter>にヘッダを追加します。<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>シグナルの中で呼ぶことができます。milter.orgの<ulink url="https://www.milter.org/developers/api/smfi_insheader"> smfi_insheader</ulink>も見てください。</para>
<para>FIXME: MILTER_ACTION_ADD_HEADERSについて書くこと。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index</parameter> :</term>
<listitem><simpara>挿入する位置。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter> :</term>
<listitem><simpara>ヘッダ名。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter> :</term>
<listitem><simpara>ヘッダ値。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter> :</term>
<listitem><simpara>エラーを受け取る場所のアドレス、または<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>成功時は<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-change-header" role="function">
<title>milter_client_context_change_header ()</title>
<indexterm zone="milter-client-context-change-header"><primary>milter_client_context_change_header</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            milter_client_context_change_header (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                                                         <parameter><link linkend="guint32"><type>guint32</type></link> index</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *value</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>名前が<parameter>name</parameter>のヘッダのうち、<parameter>index</parameter>のヘッダを変更します。<parameter>value</parameter>が<link linkend="NULL:CAPS"><literal>NULL</literal></link>ならヘッダは削除されます。<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>シグナルの中で呼ぶことができます。</para>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/smfi_chgheader"> smfi_chgheader</ulink>も見てください。</para>
<para>FIXME: MILTER_ACTION_CHANGE_HEADERSについて書くこと。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter> :</term>
<listitem><simpara>ヘッダ名。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index</parameter> :</term>
<listitem><simpara>名前が<parameter>name</parameter>のヘッダの位置。（1ベース）FIXME: 0ベースに変更する？</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter> :</term>
<listitem><simpara>ヘッダ値。ターゲットのヘッダを削除する場合は<link linkend="NULL:CAPS"><literal>NULL</literal></link>を指定してください。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter> :</term>
<listitem><simpara>エラーを受け取る場所のアドレス、または<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>成功時は<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-delete-header" role="function">
<title>milter_client_context_delete_header ()</title>
<indexterm zone="milter-client-context-delete-header"><primary>milter_client_context_delete_header</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            milter_client_context_delete_header (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                                                         <parameter><link linkend="guint32"><type>guint32</type></link> index</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>名前が<parameter>name</parameter>のヘッダのうち、<parameter>index</parameter>のヘッダを削除します。<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>シグナルの中で呼ぶことができます。<link linkend="milter-client-context-change-header"><function>milter_client_context_change_header()</function></link>の<parameter>value</parameter>を<link linkend="NULL:CAPS"><literal>NULL</literal></link>で呼んだときと同じ動作です。</para>
<para>FIXME: MILTER_ACTION_CHANGE_HEADERSについて書くこと。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter> :</term>
<listitem><simpara>ヘッダ名。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index</parameter> :</term>
<listitem><simpara>名前が<parameter>name</parameter>のヘッダの位置。（1ベース）FIXME: 0ベースに変更する？</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter> :</term>
<listitem><simpara>エラーを受け取る場所のアドレス、または<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>成功時は<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-change-from" role="function">
<title>milter_client_context_change_from ()</title>
<indexterm zone="milter-client-context-change-from"><primary>milter_client_context_change_from</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            milter_client_context_change_from   (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *from</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *parameters</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>現在のメッセージの送信ドレスを変更します。<parameter>parameters</parameter>でESMTPの'MAIL FROM'コマンドのパラメタを設定できます。<parameter>parameters</parameter>は<link linkend="NULL:CAPS"><literal>NULL</literal></link>でもかまいません。<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>シグナルの中で呼ぶことができます。milter.orgの<ulink url="https://www.milter.org/developers/api/smfi_chgfrom">smfi_chgfrom</ulink>も見てください。</para>
<para>FIXME: MILTER_ACTION_CHANGE_FROMについて書くこと。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>from</parameter> :</term>
<listitem><simpara>新しい送信アドレス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>parameters</parameter> :</term>
<listitem><simpara>ESMTPの'MAIL FROM'パラメタ。<link linkend="NULL:CAPS"><literal>NULL</literal></link>も可。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter> :</term>
<listitem><simpara>エラーを受け取る場所のアドレス、または<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>成功時は<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-add-recipient" role="function">
<title>milter_client_context_add_recipient ()</title>
<indexterm zone="milter-client-context-add-recipient"><primary>milter_client_context_add_recipient</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            milter_client_context_add_recipient (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *recipient</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *parameters</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>現在のメッセージに宛先アドレスを追加します。<parameter>parameters</parameter>でESMTPの'RCPT TO'パラメタを設定することができます。<parameter>parameters</parameter>は<link linkend="NULL:CAPS"><literal>NULL</literal></link>でもかまいません。<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>シグナルの中で呼ぶことができます。milter.orgの<ulink url="https://www.milter.org/developers/api/smfi_addrcpt">smfi_addrcpt</ulink>と<ulink url="https://www.milter.org/developers/api/smfi_addrcpt_par">smfi_addrcpt_par</ulink>も見てください。</para>
<para>FIXME: MILTER_ACTION_ADD_RECIPIENTとMILTER_ACTION_ADD_ENVELOPE_RECIPIENT_WITH_PARAMETERSについて書くこと。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>recipient</parameter> :</term>
<listitem><simpara>新しい宛先アドレス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>parameters</parameter> :</term>
<listitem><simpara>ESMTPの'RCPT TO'パラメタ。<link linkend="NULL:CAPS"><literal>NULL</literal></link>も可。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter> :</term>
<listitem><simpara>エラーを受け取る場所のアドレス、または<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>成功時は<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-delete-recipient" role="function">
<title>milter_client_context_delete_recipient ()</title>
<indexterm zone="milter-client-context-delete-recipient"><primary>milter_client_context_delete_recipient</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            milter_client_context_delete_recipient
                                                        (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *recipient</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>名前が<parameter>recipient</parameter>の宛先を削除します。<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>シグナルの中で呼ぶことができます。milter.orgの<ulink url="https://www.milter.org/developers/api/smfi_delrcpt">smfi_delrcpt </ulink>も見てください。</para>
<para>FIXME: MILTER_ACTION_DELETE_RECIPIENTについて書くこと。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>recipient</parameter> :</term>
<listitem><simpara>削除する宛先アドレス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter> :</term>
<listitem><simpara>エラーを受け取る場所のアドレス、または<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>成功時は<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-replace-body" role="function">
<title>milter_client_context_replace_body ()</title>
<indexterm zone="milter-client-context-replace-body"><primary>milter_client_context_replace_body</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            milter_client_context_replace_body  (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *body</parameter>,
                                                         <parameter><link linkend="gsize"><type>gsize</type></link> body_size</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>現在のメッセージの本文を<parameter>body</parameter>で置き換えます。<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>シグナルの中で呼ぶことができます。milter.orgの<ulink url="https://www.milter.org/developers/api/smfi_replacebody">smfi_replacebody </ulink>も見てください。</para>
<para>FIXME: MILTER_ACTION_CHANGE_BODYについて書くこと。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>body</parameter> :</term>
<listitem><simpara>新しい本文。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>body_size</parameter> :</term>
<listitem><simpara><parameter>body</parameter>のサイズ。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter> :</term>
<listitem><simpara>エラーを受け取る場所のアドレス、または<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>成功時は<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-progress" role="function">
<title>milter_client_context_progress ()</title>
<indexterm zone="milter-client-context-progress"><primary>milter_client_context_progress</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            milter_client_context_progress      (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>);</programlisting>
<para>このmilterはまだ処理中であることをMTAに通知します。<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>シグナルの中で呼ぶことができます。milter.orgの<ulink url="https://www.milter.org/developers/api/smfi_progress">smfi_progress </ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>成功時は<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-quarantine" role="function">
<title>milter_client_context_quarantine ()</title>
<indexterm zone="milter-client-context-quarantine"><primary>milter_client_context_quarantine</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            milter_client_context_quarantine    (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *reason</parameter>);</programlisting>
<para>現在のメッセージを理由<parameter>reason</parameter>で隔離します。<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>シグナルの中で呼ぶことができます。milter.orgの<ulink url="https://www.milter.org/developers/api/smfi_quarantine">smfi_quarantine </ulink>も見てください。</para>
<para>FIXME: MILTER_ACTION_QUARANTINEについて書くこと。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>reason</parameter> :</term>
<listitem><simpara>どうして現在のメッセージが隔離されるかの理由。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>成功時は<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-set-timeout" role="function">
<title>milter_client_context_set_timeout ()</title>
<indexterm zone="milter-client-context-set-timeout"><primary>milter_client_context_set_timeout</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                milter_client_context_set_timeout   (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter><link linkend="guint"><type>guint</type></link> timeout</parameter>);</programlisting>
<para>秒単位でタイムアウトを設定します。MTAが<parameter>timeout</parameter>秒以内に応答しない場合は、<link linkend="MilterClientContext-timeout"><type>"timeout"</type></link>シグナルが発行されます。milter.orgの<ulink url="https://www.milter.org/developers/api/smfi_settimeout">smfi_settimeout </ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>timeout</parameter> :</term>
<listitem><simpara>秒単位のタイムアウト。（既定値は7210秒）</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-get-timeout" role="function">
<title>milter_client_context_get_timeout ()</title>
<indexterm zone="milter-client-context-get-timeout"><primary>milter_client_context_get_timeout</primary></indexterm>
<programlisting><link linkend="guint"><returnvalue>guint</returnvalue></link>               milter_client_context_get_timeout   (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>);</programlisting>
<para>秒単位でタイムアウトを取得します。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>秒単位でのタイムアウト。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-set-state" role="function">
<title>milter_client_context_set_state ()</title>
<indexterm zone="milter-client-context-set-state"><primary>milter_client_context_set_state</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                milter_client_context_set_state     (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter><link linkend="MilterClientContextState"><type>MilterClientContextState</type></link> state</parameter>);</programlisting>
<para>現在の状態を設定します。</para>
<para>
<note>This is for testing. Don't use it directory for normal use.</note>
</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>state</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContextState"><literal>MilterClientContextState</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-get-state" role="function">
<title>milter_client_context_get_state ()</title>
<indexterm zone="milter-client-context-get-state"><primary>milter_client_context_get_state</primary></indexterm>
<programlisting><link linkend="MilterClientContextState"><returnvalue>MilterClientContextState</returnvalue></link> milter_client_context_get_state
                                                        (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>);</programlisting>
<para>現在の状態を取得します。</para>
<para>
<note>This is for testing. Don't use it directory for normal use.</note>
</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>現在の状態。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-set-option" role="function">
<title>milter_client_context_set_option ()</title>
<indexterm zone="milter-client-context-set-option"><primary>milter_client_context_set_option</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                milter_client_context_set_option    (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>,
                                                         <parameter><link linkend="MilterOption"><type>MilterOption</type></link> *option</parameter>);</programlisting>
<para>現在のコンテキストのオプションを取得します。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>option</parameter> :</term>
<listitem><simpara><link linkend="MilterOption"><literal>MilterOption</literal></link>。</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="milter-client-context-get-option" role="function">
<title>milter_client_context_get_option ()</title>
<indexterm zone="milter-client-context-get-option"><primary>milter_client_context_get_option</primary></indexterm>
<programlisting><link linkend="MilterOption"><returnvalue>MilterOption</returnvalue></link> *      milter_client_context_get_option    (<parameter><link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context</parameter>);</programlisting>
<para>コンテキストに接続しているサーバのソケットアドレスを取得します。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara><link linkend="MilterClientContext"><literal>MilterClientContext</literal></link>。</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>コンテキストに接続しているサーバのソケットアドレス。</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="MilterClientContext.property-details" role="property_details">
<title role="property_details.title">プロパティ詳細</title>
<refsect2 id="MilterClientContext--client" role="property"><title><literal>"client"</literal>プロパティ</title>
<indexterm zone="MilterClientContext--client"><primary>MilterClientContext:client</primary></indexterm>
<programlisting>  "client"                   <link linkend="MilterClient"><type>MilterClient</type></link>*         : Read / Write / Construct Only</programlisting>
<para>コンテキストのクライアント。</para></refsect2>
<refsect2 id="MilterClientContext--message-result" role="property"><title><literal>"message-result"</literal>プロパティ</title>
<indexterm zone="MilterClientContext--message-result"><primary>MilterClientContext:message-result</primary></indexterm>
<programlisting>  "message-result"           <link linkend="MilterMessageResult"><type>MilterMessageResult</type></link>*  : Read / Write</programlisting>
<para>クライアントコンテキストのメッセージの処理結果。</para></refsect2>
<refsect2 id="MilterClientContext--option" role="property"><title><literal>"option"</literal>プロパティ。</title>
<indexterm zone="MilterClientContext--option"><primary>MilterClientContext:option</primary></indexterm>
<programlisting>  "option"                   <link linkend="MilterOption"><type>MilterOption</type></link>*         : Read / Write</programlisting>
<para>クライントコンテキストのオプション。</para></refsect2>
<refsect2 id="MilterClientContext--packet-buffer-size" role="property"><title><literal>"packet-buffer-size"</literal>プロパティ</title>
<indexterm zone="MilterClientContext--packet-buffer-size"><primary>MilterClientContext:packet-buffer-size</primary></indexterm>
<programlisting>  "packet-buffer-size"       <link linkend="guint"><type>guint</type></link>                 : Read / Write</programlisting>
<para>クライアントコンテキストのパケットバッファサイズ。</para><para>デフォルト値: 0</para>
</refsect2>
<refsect2 id="MilterClientContext--quarantine-reason" role="property"><title><literal>"quarantine-reason"</literal>プロパティ</title>
<indexterm zone="MilterClientContext--quarantine-reason"><primary>MilterClientContext:quarantine-reason</primary></indexterm>
<programlisting>  "quarantine-reason"        <link linkend="gchar"><type>gchar</type></link>*                : Read / Write</programlisting>
<para>クライアントコンテキストの隔離理由。</para><para>デフォルト値: NULL</para>
</refsect2>
<refsect2 id="MilterClientContext--state" role="property"><title><literal>"state"</literal>プロパティ</title>
<indexterm zone="MilterClientContext--state"><primary>MilterClientContext:state</primary></indexterm>
<programlisting>  "state"                    <link linkend="MilterClientContextState"><type>MilterClientContextState</type></link>  : Read / Write</programlisting>
<para>クライアントコンテキストの状態。</para><para>デフォルト値: MILTER_CLIENT_CONTEXT_STATE_INVALID</para>
</refsect2>
<refsect2 id="MilterClientContext--status" role="property"><title><literal>"status"</literal>プロパティ</title>
<indexterm zone="MilterClientContext--status"><primary>MilterClientContext:status</primary></indexterm>
<programlisting>  "status"                   <link linkend="MilterStatus"><type>MilterStatus</type></link>          : Read / Write</programlisting>
<para>クライアントコンテキストのステータス。</para><para>デフォルト値: MILTER_STATUS_DEFAULT</para>
</refsect2>
</refsect1>
<refsect1 id="MilterClientContext.signal-details" role="signals">
<title role="signals.title">シグナル詳細</title>
<refsect2 id="MilterClientContext-abort" role="signal"><title><literal>"abort"</literal>シグナル</title>
<indexterm zone="MilterClientContext-abort"><primary>MilterClientContext::abort</primary></indexterm>
<programlisting><link linkend="MilterStatus"><returnvalue>MilterStatus</returnvalue></link>        user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link>     *context,
                                                        <link linkend="MilterClientContextState"><type>MilterClientContextState</type></link> Returns,
                                                        <link linkend="gpointer"><type>gpointer</type></link>                 user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>このシグナルは<link linkend="MilterClientContext-envelope-from"><type>"envelope-from"</type></link>から<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>の間のどこかのタイミングで呼び出される可能性があります。このシグナルはmilter内部でエラーが発生し、かつ、メッセージ処理が完了していないときだけ実行されます。例えば、milterが<link linkend="MILTER-STATUS-ACCEPT:CAPS"><literal>MILTER_STATUS_ACCEPT</literal></link>、<link linkend="MILTER-STATUS-REJECT:CAPS"><literal>MILTER_STATUS_REJECT</literal></link>、<link linkend="MILTER-STATUS-DISCARD:CAPS"><literal>MILTER_STATUS_DISCARD</literal></link>、<link linkend="MILTER-STATUS-TEMPORARY-FAILURE:CAPS"><literal>MILTER_STATUS_TEMPORARY_FAILURE</literal></link>を返しているときは、このシグナルは発行されません。</para>
<para>milterが<link linkend="MilterClientContext-envelope-from"><type>"envelope-from"</type></link>から<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>の間にメッセージのために割り当てたリソースがある場合は、このシグナルの中で開放してください。しかし、接続用に割り当てたリソースは開放しないでください。そのリソースは<link linkend="MilterFinishedEmittable-finished"><type>"finished"</type></link>シグナルの中で開放してください。</para>
<para>すべての利用可能な応答ステータスは以下の通りです。</para>
<variablelist>
  <varlistentry>
  <term id="xml.&lt;link">
  <link linkend="MILTER-STATUS-CONTINUE:CAPS"><literal>MILTER_STATUS_CONTINUE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージに対する処理を続けます。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-DISCARD:CAPS"><literal>MILTER_STATUS_DISCARD</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを受け入れて、だまって破棄します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-ACCEPT:CAPS"><literal>MILTER_STATUS_ACCEPT</literal></link>
</term>
  <listitem>
  <para>これ以上処理を続けずに、現在のメッセージを受け入れます。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-TEMPORARY-FAILURE:CAPS"><literal>MILTER_STATUS_TEMPORARY_FAILURE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを一時的な障害が発生したとして拒否します。（つまり、SMTPでは4xxステータスコードになります。）</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>
</term>
  <listitem>
  <para>It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.</para>
  <para>このステータスを返すのは、<link linkend="MilterClientContext-end-of-message-response"><type>"end-of-message-response"</type></link>シグナルを自分で発行するということです。そのときは、上記のどれかの<link linkend="MilterStatus"><literal>MilterStatus</literal></link>を一緒に渡してください。</para>
  <para>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.</para>
</listitem>
</varlistentry>
</variablelist>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/xxfi_abort"> xxfi_abort</ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-abort-response" role="signal"><title><literal>"abort-response"</literal>シグナル</title>
<indexterm zone="MilterClientContext-abort-response"><primary>MilterClientContext::abort-response</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="MilterStatus"><type>MilterStatus</type></link>         status,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted implicitly after
<link linkend="MilterClientContext-abort"><type>"abort"</type></link> returns a status except
<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>. This signal's default
handler replies a response to MTA. You don't need to
connect this signal.
</para>
<para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>の中で<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>を返した場合、自分でこのシグナルを<parameter>context</parameter>に発行しなければいけません。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-body" role="signal"><title><literal>"body"</literal>シグナル</title>
<indexterm zone="MilterClientContext-body"><primary>MilterClientContext::body</primary></indexterm>
<programlisting><link linkend="MilterStatus"><returnvalue>MilterStatus</returnvalue></link>        user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="gchar"><type>gchar</type></link>               *chunk,
                                                        <link linkend="guint64"><type>guint64</type></link>              size,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>このシグナルは本文のデータを受け取ったときに呼ばれます。このシグナルは<link linkend="MilterClientContext-end-of-header"><type>"end-of-header"</type></link>から<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>の間に0回以上発行されます。</para>
<para>すべての利用可能な応答ステータスは以下の通りです。</para>
<variablelist>
  <varlistentry>
  <term id="xml.&lt;link">
  <link linkend="MILTER-STATUS-CONTINUE:CAPS"><literal>MILTER_STATUS_CONTINUE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージに対する処理を続けます。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-REJECT:CAPS"><literal>MILTER_STATUS_REJECT</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを拒否します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-DISCARD:CAPS"><literal>MILTER_STATUS_DISCARD</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを受け入れて、だまって破棄します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-ACCEPT:CAPS"><literal>MILTER_STATUS_ACCEPT</literal></link>
</term>
  <listitem>
  <para>これ以上処理を続けずに、現在のメッセージを受け入れます。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-TEMPORARY-FAILURE:CAPS"><literal>MILTER_STATUS_TEMPORARY_FAILURE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを一時的な障害が発生したとして拒否します。（つまり、SMTPでは4xxステータスコードになります。）</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-SKIP:CAPS"><literal>MILTER_STATUS_SKIP</literal></link>
</term>
  <listitem>
  <para>これ以上の本文の処理を省略します。<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link>が発行されます。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-NO-REPLY:CAPS"><literal>MILTER_STATUS_NO_REPLY</literal></link>
</term>
  <listitem>
  <para>MTAに返答しません。</para>
  <para>milterは<link linkend="MilerClientContext-negotiate"><type>"negotiate"</type></link>ハンドラの中で<link linkend="MILTER-STEP-NO-REPLY-BODY:CAPS"><literal>MILTER_STEP_NO_REPLY_BODY</literal></link>を設定しなければいけません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>
</term>
  <listitem>
  <para>It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.</para>
  <para>このステータスを返すのは、<link linkend="MilterClientContext-body-response"><type>"body-response"</type></link>シグナルを自分で発行するということです。そのときは、上記のどれかの<link linkend="MilterStatus"><literal>MilterStatus</literal></link>を一緒に渡してください。</para>
  <para>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.</para>
</listitem>
</varlistentry>
</variablelist>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/xxfi_body"> xxfi_body</ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>chunk</parameter> :</term>
<listitem><simpara>本文の1かたまり。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter> :</term>
<listitem><simpara><parameter>chunk</parameter>のサイズ。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-body-response" role="signal"><title><literal>"body-response"</literal>シグナル</title>
<indexterm zone="MilterClientContext-body-response"><primary>MilterClientContext::body-response</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="MilterStatus"><type>MilterStatus</type></link>         status,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted implicitly after
<link linkend="MilterClientContext-body"><type>"body"</type></link> returns a status except
<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>. This signal's default
handler replies a response to MTA. You don't need to
connect this signal.
</para>
<para><link linkend="MilterClientContext-body"><type>"body"</type></link>で<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>を返したなら、自分でこのシグナルを<parameter>context</parameter>に発行しなければいけません。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-connect" role="signal"><title><literal>"connect"</literal>シグナル</title>
<indexterm zone="MilterClientContext-connect"><primary>MilterClientContext::connect</primary></indexterm>
<programlisting><link linkend="MilterStatus"><returnvalue>MilterStatus</returnvalue></link>        user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="gchar"><type>gchar</type></link>               *host_name,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             address,
                                                        <link linkend="guint"><type>guint</type></link>                address_size,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)         : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted on SMTP client is connected to
MTA.
</para>
<para>すべての利用可能な応答ステータスは以下の通りです。</para>
<variablelist>
  <varlistentry>
  <term id="xml.&lt;link">
  <link linkend="MILTER-STATUS-CONTINUE:CAPS"><literal>MILTER_STATUS_CONTINUE</literal></link>
</term>
  <listitem>
  <para>現在の接続に対する処理を続行します。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-REJECT:CAPS"><literal>MILTER_STATUS_REJECT</literal></link>
</term>
  <listitem>
  <para>現在の接続を拒否します。</para>
  <para><link linkend="MilterFinishedEmittable-finished"><type>"finished"</type></link>が発行されるでしょう。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-ACCEPT:CAPS"><literal>MILTER_STATUS_ACCEPT</literal></link>
</term>
  <listitem>
  <para>これ以上処理を続けずに、現在の接続を受け入れます。</para>
  <para><link linkend="MilterFinishedEmittable-finished"><type>"finished"</type></link>が発行されるでしょう。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-TEMPORARY-FAILURE:CAPS"><literal>MILTER_STATUS_TEMPORARY_FAILURE</literal></link>
</term>
  <listitem>
  <para>現在の接続を一時的な障害が発生したとして拒否します。（つまり、SMTPでは4xxのステータスコードになります。）</para>
  <para><link linkend="MilterFinishedEmittable-finished"><type>"finished"</type></link>が発行されるでしょう。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-NO-REPLY:CAPS"><literal>MILTER_STATUS_NO_REPLY</literal></link>
</term>
  <listitem>
  <para>MTAに返答しません。</para>
  <para>milterは<link linkend="MilerClientContext-negotiate"><type>"negotiate"</type></link>ハンドラの中で<link linkend="MILTER-STEP-NO-REPLY-CONNECT:CAPS"><literal>MILTER_STEP_NO_REPLY_CONNECT</literal></link>を設定しなければいけません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>
</term>
  <listitem>
  <para>It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.</para>
  <para>
  If you returns this status, you need to emit <link linkend="MilterClientContext-connect-response"><type>"connect-response"</type></link> signal by yourself with one of the above <link linkend="MilterStatus"><literal>MilterStatus</literal></link>es.
</para>
  <para>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.</para>
</listitem>
</varlistentry>
</variablelist>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/xxfi_connect">xxfi_connect</ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>host_name</parameter> :</term>
<listitem><simpara>接続してきたSMTPクライアントのホスト名。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>address</parameter> :</term>
<listitem><simpara>接続してきたSMTPクライアントのアドレス。（struct sockaddr）</simpara></listitem></varlistentry>
<varlistentry><term><parameter>address_size</parameter> :</term>
<listitem><simpara><parameter>address</parameter>のサイズ。（socklen_t）</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-connect-response" role="signal"><title>The <literal>"connect-response"</literal> signal</title>
<indexterm zone="MilterClientContext-connect-response"><primary>MilterClientContext::connect-response</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="MilterStatus"><type>MilterStatus</type></link>         status,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted implicitly after
<link linkend="MilterClientContext-connect"><type>"connect"</type></link> returns a status except
<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>. This signal's default
handler replies a response to MTA. You don't need to
connect this signal.
</para>
<para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>の中で<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>を返した場合、自分でこのシグナルを<parameter>context</parameter>に発行しなければいけません。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-data" role="signal"><title><literal>"data"</literal>シグナル</title>
<indexterm zone="MilterClientContext-data"><primary>MilterClientContext::data</primary></indexterm>
<programlisting><link linkend="MilterStatus"><returnvalue>MilterStatus</returnvalue></link>        user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>このシグナルはSMTPの"DATA"コマンドのときに発行されます。</para>
<para>すべての利用可能な応答ステータスは以下の通りです。</para>
<variablelist>
  <varlistentry>
  <term id="xml.&lt;link">
  <link linkend="MILTER-STATUS-CONTINUE:CAPS"><literal>MILTER_STATUS_CONTINUE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージに対する処理を続けます。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-REJECT:CAPS"><literal>MILTER_STATUS_REJECT</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを拒否します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-DISCARD:CAPS"><literal>MILTER_STATUS_DISCARD</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを受け入れて、だまって破棄します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-ACCEPT:CAPS"><literal>MILTER_STATUS_ACCEPT</literal></link>
</term>
  <listitem>
  <para>現在の宛先を受け入れます。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-TEMPORARY-FAILURE:CAPS"><literal>MILTER_STATUS_TEMPORARY_FAILURE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを一時的な障害が発生したとして拒否します。（つまり、SMTPでは4xxステータスコードになります。）</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-NO-REPLY:CAPS"><literal>MILTER_STATUS_NO_REPLY</literal></link>
</term>
  <listitem>
  <para>MTAに返答しません。</para>
  <para>milterは<link linkend="MilerClientContext-negotiate"><type>"negotiate"</type></link>ハンドラの中で<link linkend="MILTER-STEP-NO-REPLY-DATA:CAPS"><literal>MILTER_STEP_NO_REPLY_DATA</literal></link>を設定しなければいけません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>
</term>
  <listitem>
  <para>It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.</para>
  <para>
  If you returns this status, you need to emit <link linkend="MilterClientContext-data-response"><type>"data-response"</type></link> signal by yourself with one of the above <link linkend="MilterStatus"><literal>MilterStatus</literal></link>es.
</para>
  <para>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.</para>
</listitem>
</varlistentry>
</variablelist>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/xxfi_data"> xxfi_data</ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-data-response" role="signal"><title>The <literal>"data-response"</literal> signal</title>
<indexterm zone="MilterClientContext-data-response"><primary>MilterClientContext::data-response</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="MilterStatus"><type>MilterStatus</type></link>         status,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted implicitly after
<link linkend="MilterClientContext-data"><type>"data"</type></link> returns a status except
<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>. This signal's default
handler replies a response to MTA. You don't need to
connect this signal.
</para>
<para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>の中で<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>を返した場合、自分でこのシグナルを<parameter>context</parameter>に発行しなければいけません。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-define-macro" role="signal"><title>The <literal>"define-macro"</literal> signal</title>
<indexterm zone="MilterClientContext-define-macro"><primary>MilterClientContext::define-macro</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="MilterCommand"><type>MilterCommand</type></link>        command,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             macros,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted when macro definition is
received. Normally, this signal isn't needed to be
connected.
</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>command</parameter> :</term>
<listitem><simpara>マクロが定義されるコマンド。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>macros</parameter> :</term>
<listitem><simpara>マクロ定義。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-end-of-header" role="signal"><title><literal>"end-of-header"</literal>シグナル</title>
<indexterm zone="MilterClientContext-end-of-header"><primary>MilterClientContext::end-of-header</primary></indexterm>
<programlisting><link linkend="MilterStatus"><returnvalue>MilterStatus</returnvalue></link>        user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>このシグナルはすべてのヘッダが処理されたときに呼ばれます。</para>
<para>すべての利用可能な応答ステータスは以下の通りです。</para>
<variablelist>
  <varlistentry>
  <term id="xml.&lt;link">
  <link linkend="MILTER-STATUS-CONTINUE:CAPS"><literal>MILTER_STATUS_CONTINUE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージに対する処理を続けます。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-REJECT:CAPS"><literal>MILTER_STATUS_REJECT</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを拒否します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-DISCARD:CAPS"><literal>MILTER_STATUS_DISCARD</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを受け入れて、だまって破棄します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-ACCEPT:CAPS"><literal>MILTER_STATUS_ACCEPT</literal></link>
</term>
  <listitem>
  <para>これ以上処理を続けずに、現在のメッセージを受け入れます。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-TEMPORARY-FAILURE:CAPS"><literal>MILTER_STATUS_TEMPORARY_FAILURE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを一時的な障害が発生したとして拒否します。（つまり、SMTPでは4xxステータスコードになります。）</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-NO-REPLY:CAPS"><literal>MILTER_STATUS_NO_REPLY</literal></link>
</term>
  <listitem>
  <para>MTAに返答しません。</para>
  <para>milterは<link linkend="MilerClientContext-negotiate"><type>"negotiate"</type></link>ハンドラの中で<link linkend="MILTER-STEP-NO-REPLY-END-OF-HEADER:CAPS"><literal>MILTER_STEP_NO_REPLY_END_OF_HEADER</literal></link>を設定しなければいけません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>
</term>
  <listitem>
  <para>It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.</para>
  <para>このステータスを返すのは、<link linkend="MilterClientContext-end-of-header-response"><type>"end-of-header-response"</type></link>シグナルを自分で発行するということです。そのときは、上記のどれかの<link linkend="MilterStatus"><literal>MilterStatus</literal></link>を一緒に渡してください。</para>
  <para>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.</para>
</listitem>
</varlistentry>
</variablelist>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/xxfi_eof"> xxfi_eof</ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-end-of-header-response" role="signal"><title>The <literal>"end-of-header-response"</literal> signal</title>
<indexterm zone="MilterClientContext-end-of-header-response"><primary>MilterClientContext::end-of-header-response</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="MilterStatus"><type>MilterStatus</type></link>         status,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted implicitly after
<link linkend="MilterClientContext-end-of-header"><type>"end-of-header"</type></link> returns a status
except <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>. This signal's default
handler replies a response to MTA. You don't need to
connect this signal.
</para>
<para><link linkend="MilterClientContext-body"><type>"body"</type></link>で<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>を返したなら、自分でこのシグナルを<parameter>context</parameter>に発行しなければいけません。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-end-of-message" role="signal"><title>The <literal>"end-of-message"</literal> signal</title>
<indexterm zone="MilterClientContext-end-of-message"><primary>MilterClientContext::end-of-message</primary></indexterm>
<programlisting><link linkend="MilterStatus"><returnvalue>MilterStatus</returnvalue></link>        user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="gchar"><type>gchar</type></link>               *Returns,
                                                        <link linkend="guint64"><type>guint64</type></link>              arg2,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>このシグナルはすべての<link linkend="MilterClientContext-body"><type>"body"</type></link>が発行された後に発行されます。すべてのメッセージ変更はこのシグナルの中出だけ実行できます。変更は<link linkend="milter-client-context-add-header"><function>milter_client_context_add_header()</function></link>、<link linkend="milter-client-context-change-from"><function>milter_client_context_change_from()</function></link>などで行えます。</para>
<para>すべての利用可能な応答ステータスは以下の通りです。</para>
<variablelist>
  <varlistentry>
  <term id="xml.&lt;link">
  <link linkend="MILTER-STATUS-CONTINUE:CAPS"><literal>MILTER_STATUS_CONTINUE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージに対する処理を続けます。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-DISCARD:CAPS"><literal>MILTER_STATUS_DISCARD</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを受け入れて、だまって破棄します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-ACCEPT:CAPS"><literal>MILTER_STATUS_ACCEPT</literal></link>
</term>
  <listitem>
  <para>これ以上処理を続けずに、現在のメッセージを受け入れます。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-TEMPORARY-FAILURE:CAPS"><literal>MILTER_STATUS_TEMPORARY_FAILURE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを一時的な障害が発生したとして拒否します。（つまり、SMTPでは4xxステータスコードになります。）</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>
</term>
  <listitem>
  <para>It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.</para>
  <para>このステータスを返すのは、<link linkend="MilterClientContext-end-of-message-response"><type>"end-of-message-response"</type></link>シグナルを自分で発行するということです。そのときは、上記のどれかの<link linkend="MilterStatus"><literal>MilterStatus</literal></link>を一緒に渡してください。</para>
  <para>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.</para>
</listitem>
</varlistentry>
</variablelist>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/xxfi_eom"> xxfi_eom</ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-end-of-message-response" role="signal"><title><literal>"end-of-message-response"</literal>シグナル</title>
<indexterm zone="MilterClientContext-end-of-message-response"><primary>MilterClientContext::end-of-message-response</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="MilterStatus"><type>MilterStatus</type></link>         status,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted implicitly after
<link linkend="MilterClientContext-end-of-message"><type>"end-of-message"</type></link> returns a status
except <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>. This signal's default
handler replies a response to MTA. You don't need to
connect this signal.
</para>
<para><link linkend="MilterClientContext-body"><type>"body"</type></link>で<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>を返したなら、自分でこのシグナルを<parameter>context</parameter>に発行しなければいけません。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-envelope-from" role="signal"><title><literal>"envelope-from"</literal>シグナル</title>
<indexterm zone="MilterClientContext-envelope-from"><primary>MilterClientContext::envelope-from</primary></indexterm>
<programlisting><link linkend="MilterStatus"><returnvalue>MilterStatus</returnvalue></link>        user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="gchar"><type>gchar</type></link>               *from,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>このシグナルはSMTPの"MAIL FROM"コマンドのときに呼ばれます。</para>
<para>すべての利用可能な応答ステータスは以下の通りです。</para>
<variablelist>
  <varlistentry>
  <term id="xml.&lt;link">
  <link linkend="MILTER-STATUS-CONTINUE:CAPS"><literal>MILTER_STATUS_CONTINUE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージに対する処理を続けます。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-REJECT:CAPS"><literal>MILTER_STATUS_REJECT</literal></link>
</term>
  <listitem>
  <para>現在の差出人とメッセージを拒否します。新しい差出人が指定されるかもしれません。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-DISCARD:CAPS"><literal>MILTER_STATUS_DISCARD</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを受け入れて、だまって破棄します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-ACCEPT:CAPS"><literal>MILTER_STATUS_ACCEPT</literal></link>
</term>
  <listitem>
  <para>これ以上処理を続けずに、現在のメッセージを受け入れます。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-TEMPORARY-FAILURE:CAPS"><literal>MILTER_STATUS_TEMPORARY_FAILURE</literal></link>
</term>
  <listitem>
  <para>現在の差出人とメッセージを一時的な障害が発生したとして拒否します。（つまり、SMTPでは4xxのステータスコードになります。）新しい差出人が指定されるかもしれません。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-NO-REPLY:CAPS"><literal>MILTER_STATUS_NO_REPLY</literal></link>
</term>
  <listitem>
  <para>MTAに返答しません。</para>
  <para>milterは<link linkend="MilerClientContext-negotiate"><type>"negotiate"</type></link>ハンドラの中で<link linkend="MILTER-STEP-NO-REPLY-BODY:CAPS"><literal>MILTER_STEP_NO_REPLY_BODY</literal></link>を設定しなければいけません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>
</term>
  <listitem>
  <para>It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.</para>
  <para>
  If you returns this status, you need to emit <link linkend="MilterClientContext-envelope-from-response"><type>"envelope-from-response"</type></link> signal by yourself with one of the above <link linkend="MilterStatus"><literal>MilterStatus</literal></link>es.
</para>
  <para>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.</para>
</listitem>
</varlistentry>
</variablelist>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/xxfi_envfrom"> xxfi_envfrom</ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>from</parameter> :</term>
<listitem><simpara>SMTPの"MAIL FROM"コマンドの送信アドレス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-envelope-from-response" role="signal"><title><literal>"envelope-from-response"</literal>シグナル</title>
<indexterm zone="MilterClientContext-envelope-from-response"><primary>MilterClientContext::envelope-from-response</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="MilterStatus"><type>MilterStatus</type></link>         status,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted implicitly after
<link linkend="MilterClientContext-envelope-from"><type>"envelope-from"</type></link> returns a status
except <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>. This signal's default
handler replies a response to MTA. You don't need to
connect this signal.
</para>
<para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>の中で<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>を返した場合、自分でこのシグナルを<parameter>context</parameter>に発行しなければいけません。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-envelope-recipient" role="signal"><title><literal>"envelope-recipient"</literal>シグナル</title>
<indexterm zone="MilterClientContext-envelope-recipient"><primary>MilterClientContext::envelope-recipient</primary></indexterm>
<programlisting><link linkend="MilterStatus"><returnvalue>MilterStatus</returnvalue></link>        user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="gchar"><type>gchar</type></link>               *recipient,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>このシグナルはSMTPの"RCPT TO"コマンドのときに発行されます。</para>
<para>すべての利用可能な応答ステータスは以下の通りです。</para>
<variablelist>
  <varlistentry>
  <term id="xml.&lt;link">
  <link linkend="MILTER-STATUS-CONTINUE:CAPS"><literal>MILTER_STATUS_CONTINUE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージに対する処理を続けます。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-REJECT:CAPS"><literal>MILTER_STATUS_REJECT</literal></link>
</term>
  <listitem>
  <para>現在の宛先を拒否します。現在のメッセージの処理は続きます。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-DISCARD:CAPS"><literal>MILTER_STATUS_DISCARD</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを受け入れて、だまって破棄します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-ACCEPT:CAPS"><literal>MILTER_STATUS_ACCEPT</literal></link>
</term>
  <listitem>
  <para>現在の宛先を受け入れます。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-TEMPORARY-FAILURE:CAPS"><literal>MILTER_STATUS_TEMPORARY_FAILURE</literal></link>
</term>
  <listitem>
  <para>現在の宛先を一時的な障害が発生したとして拒否します。（つまり、SMTPでは4xxのステータスコードになります。）現在のメッセージの処理は継続します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-NO-REPLY:CAPS"><literal>MILTER_STATUS_NO_REPLY</literal></link>
</term>
  <listitem>
  <para>MTAに返答しません。</para>
  <para>milterは<link linkend="MilerClientContext-negotiate"><type>"negotiate"</type></link>ハンドラの中で<link linkend="MILTER-STEP-NO-REPLY-CONNECT:CAPS"><literal>MILTER_STEP_NO_REPLY_CONNECT</literal></link>を設定しなければいけません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>
</term>
  <listitem>
  <para>It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.</para>
  <para>
  If you returns this status, you need to emit <link linkend="MilterClientContext-envelope-recipient-response"><type>"envelope-recipient-response"</type></link> signal by yourself with one of the above <link linkend="MilterStatus"><literal>MilterStatus</literal></link>es.
</para>
  <para>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.</para>
</listitem>
</varlistentry>
</variablelist>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/xxfi_envrcpt"> xxfi_envrcpt</ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>recipient</parameter> :</term>
<listitem><simpara>SMTPの"RCPT TO"コマンドの宛先アドレス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-envelope-recipient-response" role="signal"><title><literal>"envelope-recipient-response"</literal>シグナル</title>
<indexterm zone="MilterClientContext-envelope-recipient-response"><primary>MilterClientContext::envelope-recipient-response</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="MilterStatus"><type>MilterStatus</type></link>         status,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted implicitly after
<link linkend="MilterClientContext-envelope-recipient"><type>"envelope-recipient"</type></link> returns a
status except <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>. This signal's
default handler replies a response to MTA. You don't
need to connect this signal.
</para>
<para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>の中で<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>を返した場合、自分でこのシグナルを<parameter>context</parameter>に発行しなければいけません。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-header" role="signal"><title><literal>"header"</literal>シグナル。</title>
<indexterm zone="MilterClientContext-header"><primary>MilterClientContext::header</primary></indexterm>
<programlisting><link linkend="MilterStatus"><returnvalue>MilterStatus</returnvalue></link>        user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="gchar"><type>gchar</type></link>               *name,
                                                        <link linkend="gchar"><type>gchar</type></link>               *value,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>このコールバックは各ヘッダに対して呼ばれます。もし、<link linkend="smfiDesc"><literal>smfiDesc</literal></link>::xxfi_flagsに<link linkend="SMFIP-HDR-LEADSPC:CAPS"><literal>SMFIP_HDR_LEADSPC</literal></link>フラグが設定されていれば、<parameter>value</parameter>はヘッダ名と値を区切る":"の後ろにあるスペースも含みます。</para>
<para>例:</para>
<para>
<informalexample><programlisting>
From: from &lt;from@example.com&gt;
To: recipient &lt;recipient@example.com&gt;
Subject:a subject
</programlisting></informalexample>
</para>
<para><link linkend="MILTER-STEP-HEADER-VALUE-WITH-LEADING-SPACE:CAPS"><literal>MILTER_STEP_HEADER_VALUE_WITH_LEADING_SPACE</literal></link>あり:</para>
<para>
<informalexample><programlisting>
"From", " from &lt;from@example.com&gt;"
"To", " recipient &lt;recipient@example.com&gt;"
"Subject", "a subject"
</programlisting></informalexample>
</para>
<para><link linkend="MILTER-STEP-HEADER-VALUE-WITH-LEADING-SPACE:CAPS"><literal>MILTER_STEP_HEADER_VALUE_WITH_LEADING_SPACE</literal></link>なし:</para>
<para>
<informalexample><programlisting>
"From", "from &lt;from@example.com&gt;"
"To", "recipient &lt;recipient@example.com&gt;"
"Subject", "a subject"
</programlisting></informalexample>
</para>
<para>すべての利用可能な応答ステータスは以下の通りです。</para>
<variablelist>
  <varlistentry>
  <term id="xml.&lt;link">
  <link linkend="MILTER-STATUS-CONTINUE:CAPS"><literal>MILTER_STATUS_CONTINUE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージに対する処理を続けます。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-REJECT:CAPS"><literal>MILTER_STATUS_REJECT</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを拒否します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-DISCARD:CAPS"><literal>MILTER_STATUS_DISCARD</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを受け入れて、だまって破棄します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-ACCEPT:CAPS"><literal>MILTER_STATUS_ACCEPT</literal></link>
</term>
  <listitem>
  <para>これ以上処理を続けずに、現在のメッセージを受け入れます。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-TEMPORARY-FAILURE:CAPS"><literal>MILTER_STATUS_TEMPORARY_FAILURE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを一時的な障害が発生したとして拒否します。（つまり、SMTPでは4xxステータスコードになります。）</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-NO-REPLY:CAPS"><literal>MILTER_STATUS_NO_REPLY</literal></link>
</term>
  <listitem>
  <para>MTAに返答しません。</para>
  <para>milterは<link linkend="MilerClientContext-negotiate"><type>"negotiate"</type></link>ハンドラの中で<link linkend="MILTER-STEP-NO-REPLY-END-OF-HEADER:CAPS"><literal>MILTER_STEP_NO_REPLY_END_OF_HEADER</literal></link>を設定しなければいけません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>
</term>
  <listitem>
  <para>It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.</para>
  <para>
  If you returns this status, you need to emit <link linkend="MilterClientContext-header-response"><type>"header-response"</type></link> signal by yourself with one of the above <link linkend="MilterStatus"><literal>MilterStatus</literal></link>es.
</para>
  <para>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.</para>
</listitem>
</varlistentry>
</variablelist>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/xxfi_header"> xxfi_header</ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter> :</term>
<listitem><simpara>ヘッダ名。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter> :</term>
<listitem><simpara>ヘッダ値。<parameter>value</parameter>は折り返し時に挿入された空白を含むかもしれません。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-header-response" role="signal"><title><literal>"header-response"</literal>シグナル。</title>
<indexterm zone="MilterClientContext-header-response"><primary>MilterClientContext::header-response</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="MilterStatus"><type>MilterStatus</type></link>         status,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted implicitly after
<link linkend="MilterClientContext-header"><type>"header"</type></link> returns a status except
<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>. This signal's default
handler replies a response to MTA. You don't need to
connect this signal.
</para>
<para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>の中で<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>を返した場合、自分でこのシグナルを<parameter>context</parameter>に発行しなければいけません。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-helo" role="signal"><title><literal>"helo"</literal>シグナル</title>
<indexterm zone="MilterClientContext-helo"><primary>MilterClientContext::helo</primary></indexterm>
<programlisting><link linkend="MilterStatus"><returnvalue>MilterStatus</returnvalue></link>        user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="gchar"><type>gchar</type></link>               *fqdn,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>このシグナルはSMTPの"HELO"/"EHLO"コマンドのときに発行されます。</para>
<para>すべての利用可能な応答ステータスは以下の通りです。</para>
<variablelist>
  <varlistentry>
  <term id="xml.&lt;link">
  <link linkend="MILTER-STATUS-CONTINUE:CAPS"><literal>MILTER_STATUS_CONTINUE</literal></link>
</term>
  <listitem>
  <para>現在の接続に対する処理を続行します。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-REJECT:CAPS"><literal>MILTER_STATUS_REJECT</literal></link>
</term>
  <listitem>
  <para>現在の接続を拒否します。</para>
  <para><link linkend="MilterFinishedEmittable-finished"><type>"finished"</type></link>が発行されるでしょう。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-ACCEPT:CAPS"><literal>MILTER_STATUS_ACCEPT</literal></link>
</term>
  <listitem>
  <para>これ以上処理を続けずに、現在の接続を受け入れます。</para>
  <para><link linkend="MilterFinishedEmittable-finished"><type>"finished"</type></link>が発行されるでしょう。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-TEMPORARY-FAILURE:CAPS"><literal>MILTER_STATUS_TEMPORARY_FAILURE</literal></link>
</term>
  <listitem>
  <para>現在の接続を一時的な障害が発生したとして拒否します。（つまり、SMTPでは4xxのステータスコードになります。）</para>
  <para><link linkend="MilterFinishedEmittable-finished"><type>"finished"</type></link>が発行されるでしょう。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-NO-REPLY:CAPS"><literal>MILTER_STATUS_NO_REPLY</literal></link>
</term>
  <listitem>
  <para>MTAに返答しません。</para>
  <para>milterは<link linkend="MilerClientContext-negotiate"><type>"negotiate"</type></link>ハンドラの中で<link linkend="MILTER-STEP-NO-REPLY-BODY:CAPS"><literal>MILTER_STEP_NO_REPLY_BODY</literal></link>を設定しなければいけません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>
</term>
  <listitem>
  <para>It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.</para>
  <para>
  If you returns this status, you need to emit <link linkend="MilterClientContext-helo-response"><type>"helo-response"</type></link> signal by yourself with one of the above <link linkend="MilterStatus"><literal>MilterStatus</literal></link>es.
</para>
  <para>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.</para>
</listitem>
</varlistentry>
</variablelist>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/xxfi_helo"> xxfi_helo</ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>fqdn</parameter> :</term>
<listitem><simpara>SMTPの"HELO"/"EHLO"コマンドでのFQDN。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-helo-response" role="signal"><title><literal>"helo-response"</literal>シグナル</title>
<indexterm zone="MilterClientContext-helo-response"><primary>MilterClientContext::helo-response</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="MilterStatus"><type>MilterStatus</type></link>         status,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted implicitly after
<link linkend="MilterClientContext-helo"><type>"helo"</type></link> returns a status except
<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>. This signal's default
handler replies a response to MTA. You don't need to
connect this signal.
</para>
<para><link linkend="MilterClientContext-body"><type>"body"</type></link>で<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>を返したなら、自分でこのシグナルを<parameter>context</parameter>に発行しなければいけません。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-message-processed" role="signal"><title><literal>"message-processed"</literal>シグナル</title>
<indexterm zone="MilterClientContext-message-processed"><primary>MilterClientContext::message-processed</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *milterclientcontext,
                                                        <link linkend="MilterMessageResult"><type>MilterMessageResult</type></link> *arg1,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)                : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>milterclientcontext</parameter> :</term>
<listitem><simpara>the object which received the signal.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-negotiate" role="signal"><title><literal>"negotiate"</literal>シグナル</title>
<indexterm zone="MilterClientContext-negotiate"><primary>MilterClientContext::negotiate</primary></indexterm>
<programlisting><link linkend="MilterStatus"><returnvalue>MilterStatus</returnvalue></link>        user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link>  *context,
                                                        <link linkend="MilterOption"><type>MilterOption</type></link>         *option,
                                                        <link linkend="MilterMacrosRequests"><type>MilterMacrosRequests</type></link> *macros_requests,
                                                        <link linkend="gpointer"><type>gpointer</type></link>              user_data)            : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted on negotiate request from MTA.
If you want to modify actions (<link linkend="MilterActionFlags"><literal>MilterActionFlags</literal></link>)
and steps (<link linkend="MilterStepFlags"><literal>MilterStepFlags</literal></link>), you modify <parameter>option</parameter>. If
you want to add macros that you want to receive, you
modify <parameter>macros_requests</parameter>.
</para>
<para>すべての利用可能な応答ステータスは以下の通りです。</para>
<variablelist>
  <varlistentry>
  <term id="xml.&lt;link">
  <link linkend="MILTER-STATUS-ALL-OPTIONS:CAPS"><literal>MILTER_STATUS_ALL_OPTIONS</literal></link>
</term>
  <listitem>
  <para>すべての利用可能なアクションとステップを有効にします。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-REJECT:CAPS"><literal>MILTER_STATUS_REJECT</literal></link>
</term>
  <listitem>
  <para>現在のセッションを拒否します。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-CONTINUE:CAPS"><literal>MILTER_STATUS_CONTINUE</literal></link>
</term>
  <listitem>
  <para><parameter>option</parameter>と<parameter>macros_requests</parameter>で指定されたアクション、ステップ、要求マクロリストを使って現在のセッションの処理を続けます</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>
</term>
  <listitem>
  <para>It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.</para>
  <para>
  If you returns this status, you need to emit <link linkend="MilterClientContext-negotiate-response"><type>"negotiate-response"</type></link> signal by yourself with one of the above <link linkend="MilterStatus"><literal>MilterStatus</literal></link>es.
</para>
  <para>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.</para>
</listitem>
</varlistentry>
</variablelist>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/xxfi_negotiate"> xxfi_negotiate</ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>option</parameter> :</term>
<listitem><simpara>MTAからのネゴシエーションのオプション。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>macros_requests</parameter> :</term>
<listitem><simpara>要求マクロリスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-negotiate-response" role="signal"><title><literal>"negotiate-response"</literal>シグナル</title>
<indexterm zone="MilterClientContext-negotiate-response"><primary>MilterClientContext::negotiate-response</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link>  *context,
                                                        <link linkend="MilterOption"><type>MilterOption</type></link>         *option,
                                                        <link linkend="MilterMacrosRequests"><type>MilterMacrosRequests</type></link> *macros_requests,
                                                        <link linkend="MilterStatus"><type>MilterStatus</type></link>          status,
                                                        <link linkend="gpointer"><type>gpointer</type></link>              user_data)            : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted implicitly after
<link linkend="MilterClientContext-negotiate"><type>"negotiate"</type></link> returns a status
except <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>. This signal's default
handler replies a response to MTA. You don't need to
connect this signal.
</para>
<para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>の中で<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>を返した場合、自分でこのシグナルを<parameter>context</parameter>に発行しなければいけません。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>option</parameter> :</term>
<listitem><simpara>MTAからのネゴシエーションのオプション。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>macros_requests</parameter> :</term>
<listitem><simpara>要求マクロリスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-timeout" role="signal"><title>The <literal>"timeout"</literal> signal</title>
<indexterm zone="MilterClientContext-timeout"><primary>MilterClientContext::timeout</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted if MTA doesn't return the next
command within <link linkend="milter-client-context-get-timeout"><function>milter_client_context_get_timeout()</function></link>
seconds. If <link linkend="MilterClientContext-timeout"><type>"timeout"</type></link> is emitted,
the current connection is aborted and
<link linkend="MilterFinishedEmittable-finished"><type>"finished"</type></link> are emitted.
<link linkend="MilterClientContext-abort"><type>"abort"</type></link> may be emitted before
<link linkend="MilterFinishedEmittable-finished"><type>"finished"</type></link> if the milter
is processing a message.
</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-unknown" role="signal"><title>The <literal>"unknown"</literal> signal</title>
<indexterm zone="MilterClientContext-unknown"><primary>MilterClientContext::unknown</primary></indexterm>
<programlisting><link linkend="MilterStatus"><returnvalue>MilterStatus</returnvalue></link>        user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="gchar"><type>gchar</type></link>               *command,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>このシグナルは未知のSMTPコマンドまたは未実装のSMTPコマンドが送られてきた場合に発行されます。</para>
<para>すべての利用可能な応答ステータスは以下の通りです。</para>
<variablelist>
  <varlistentry>
  <term id="xml.&lt;link">
  <link linkend="MILTER-STATUS-REJECT:CAPS"><literal>MILTER_STATUS_REJECT</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを拒否します。</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-TEMPORARY-FAILURE:CAPS"><literal>MILTER_STATUS_TEMPORARY_FAILURE</literal></link>
</term>
  <listitem>
  <para>現在のメッセージを一時的な障害が発生したとして拒否します。（つまり、SMTPでは4xxステータスコードになります。）</para>
  <para><link linkend="MilterClientContext-abort"><type>"abort"</type></link>は発行されません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-NO-REPLY:CAPS"><literal>MILTER_STATUS_NO_REPLY</literal></link>
</term>
  <listitem>
  <para>MTAに返答しません。</para>
  <para>milterは<link linkend="MilerClientContext-negotiate"><type>"negotiate"</type></link>ハンドラの中で<link linkend="MILTER-STEP-NO-REPLY-DATA:CAPS"><literal>MILTER_STEP_NO_REPLY_DATA</literal></link>を設定しなければいけません。</para>
</listitem>
</varlistentry>
  <varlistentry>
  <term>
  <link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>
</term>
  <listitem>
  <para>It means that the processing in callback is in progress and returning response status is pending. The main loop for the milter is continued.</para>
  <para>
  If you returns this status, you need to emit <link linkend="MilterClientContext-unknown-response"><type>"unknown-response"</type></link> signal by yourself with one of the above <link linkend="MilterStatus"><literal>MilterStatus</literal></link>es.
</para>
  <para>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.</para>
</listitem>
</varlistentry>
</variablelist>
<para>MTAは、未知のSMTPコマンドまたは未実装のSMTPコマンドは常に拒否することに中してください。</para>
<para>milter.orgの<ulink url="https://www.milter.org/developers/api/xxfi_unknown"> xxfi_unknown</ulink>も見てください。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>command</parameter> :</term>
<listitem><simpara>未知のSMTPコマンド。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>返値</emphasis>&nbsp;:</term><listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="MilterClientContext-unknown-response" role="signal"><title>The <literal>"unknown-response"</literal> signal</title>
<indexterm zone="MilterClientContext-unknown-response"><primary>MilterClientContext::unknown-response</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="MilterClientContext"><type>MilterClientContext</type></link> *context,
                                                        <link linkend="MilterStatus"><type>MilterStatus</type></link>         status,
                                                        <link linkend="gpointer"><type>gpointer</type></link>             user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
This signal is emitted implicitly after
<link linkend="MilterClientContext-unknown"><type>"unknown"</type></link> returns a status except
<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>. This signal's default
handler replies a response to MTA. You don't need to
connect this signal.
</para>
<para><link linkend="MilterClientContext-body"><type>"body"</type></link>で<link linkend="MILTER-STATUS-PROGRESS:CAPS"><literal>MILTER_STATUS_PROGRESS</literal></link>を返したなら、自分でこのシグナルを<parameter>context</parameter>に発行しなければいけません。</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>シグナルを受け取るコンテキスト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter> :</term>
<listitem><simpara>応答ステータス。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>

</refentry>
