\section{milter.\-milter\-Context Class Reference}
\label{classmilter_1_1milterContext}\index{milter.\-milter\-Context@{milter.\-milter\-Context}}


Hold context for a milter connection.  


Inheritance diagram for milter.\-milter\-Context\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classmilter_1_1milterContext}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
def {\bf getsymval}
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\-\_\-getsymval}. \end{DoxyCompactList}\item 
def {\bf setreply}
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\-\_\-setreply} or {\tt smfi\-\_\-setmlreply}. \end{DoxyCompactList}\item 
def {\bf addheader}
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\-\_\-addheader}. \end{DoxyCompactList}\item 
def {\bf chgheader}
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\-\_\-chgheader}. \end{DoxyCompactList}\item 
def {\bf addrcpt}
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\-\_\-addrcpt}. \end{DoxyCompactList}\item 
def {\bf delrcpt}
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\-\_\-delrcpt}. \end{DoxyCompactList}\item 
def {\bf replacebody}
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\-\_\-replacebody}. \end{DoxyCompactList}\item 
def {\bf setpriv}
\begin{DoxyCompactList}\small\item\em Attach a Python object to this connection context. \end{DoxyCompactList}\item 
def {\bf getpriv}
\begin{DoxyCompactList}\small\item\em Return the Python object attached to this connection context. \end{DoxyCompactList}\item 
def {\bf quarantine}
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\-\_\-quarantine}. \end{DoxyCompactList}\item 
def {\bf progress}
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\-\_\-progress}. \end{DoxyCompactList}\item 
def {\bf chgfrom}
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\-\_\-chgfrom}. \end{DoxyCompactList}\item 
def {\bf setsymlist}
\begin{DoxyCompactList}\small\item\em Tell the M\-T\-A which macro values we are interested in for a given stage. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Hold context for a milter connection. 

Each connection to sendmail creates a new {\ttfamily S\-M\-F\-I\-C\-T\-X} struct within libmilter. The milter module in turn creates a \doxyref{milter\-Context}{p.}{classmilter_1_1milterContext} tied to the {\ttfamily S\-M\-F\-I\-C\-T\-X} struct via {\ttfamily smfi\-\_\-setpriv} to hold a Py\-Thread\-State and a user defined Python object for the connection.

Most application interaction with libmilter takes places via the \doxyref{milter\-Context}{p.}{classmilter_1_1milterContext} object for the connection. It is passed to callback functions as the first parameter.

The {\ttfamily \doxyref{Milter}{p.}{namespaceMilter}} module creates a python class for each connection, and converts function callbacks to instance method invocations. 

\subsection{Member Function Documentation}
\index{milter\-::milter\-Context@{milter\-::milter\-Context}!addheader@{addheader}}
\index{addheader@{addheader}!milter::milterContext@{milter\-::milter\-Context}}
\subsubsection[{addheader}]{\setlength{\rightskip}{0pt plus 5cm}def milter.\-milter\-Context.\-addheader (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{name, }
\item[{}]{value, }
\item[{}]{idx = {\ttfamily -\/1}}
\end{DoxyParamCaption}
)}\label{classmilter_1_1milterContext_af0f2b75b44cb73c3f11864f65f207f29}


Calls {\tt smfi\-\_\-addheader}. 

\index{milter\-::milter\-Context@{milter\-::milter\-Context}!addrcpt@{addrcpt}}
\index{addrcpt@{addrcpt}!milter::milterContext@{milter\-::milter\-Context}}
\subsubsection[{addrcpt}]{\setlength{\rightskip}{0pt plus 5cm}def milter.\-milter\-Context.\-addrcpt (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{rcpt, }
\item[{}]{params = {\ttfamily None}}
\end{DoxyParamCaption}
)}\label{classmilter_1_1milterContext_aca07065a7e5ae3e85749a68127911a2c}


Calls {\tt smfi\-\_\-addrcpt}. 

\index{milter\-::milter\-Context@{milter\-::milter\-Context}!chgfrom@{chgfrom}}
\index{chgfrom@{chgfrom}!milter::milterContext@{milter\-::milter\-Context}}
\subsubsection[{chgfrom}]{\setlength{\rightskip}{0pt plus 5cm}def milter.\-milter\-Context.\-chgfrom (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{sender, }
\item[{}]{param = {\ttfamily None}}
\end{DoxyParamCaption}
)}\label{classmilter_1_1milterContext_a4ada6dc0c20a245ed29c8e38f753ab09}


Calls {\tt smfi\-\_\-chgfrom}. 

\index{milter\-::milter\-Context@{milter\-::milter\-Context}!chgheader@{chgheader}}
\index{chgheader@{chgheader}!milter::milterContext@{milter\-::milter\-Context}}
\subsubsection[{chgheader}]{\setlength{\rightskip}{0pt plus 5cm}def milter.\-milter\-Context.\-chgheader (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{name, }
\item[{}]{idx, }
\item[{}]{value}
\end{DoxyParamCaption}
)}\label{classmilter_1_1milterContext_a5eb8e5cf6685d5f3eade0647b3d59194}


Calls {\tt smfi\-\_\-chgheader}. 

\index{milter\-::milter\-Context@{milter\-::milter\-Context}!delrcpt@{delrcpt}}
\index{delrcpt@{delrcpt}!milter::milterContext@{milter\-::milter\-Context}}
\subsubsection[{delrcpt}]{\setlength{\rightskip}{0pt plus 5cm}def milter.\-milter\-Context.\-delrcpt (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{rcpt}
\end{DoxyParamCaption}
)}\label{classmilter_1_1milterContext_a53774c9f660f1d7a1e8ea00fac9f1e12}


Calls {\tt smfi\-\_\-delrcpt}. 

\index{milter\-::milter\-Context@{milter\-::milter\-Context}!getpriv@{getpriv}}
\index{getpriv@{getpriv}!milter::milterContext@{milter\-::milter\-Context}}
\subsubsection[{getpriv}]{\setlength{\rightskip}{0pt plus 5cm}def milter.\-milter\-Context.\-getpriv (
\begin{DoxyParamCaption}
\item[{}]{self}
\end{DoxyParamCaption}
)}\label{classmilter_1_1milterContext_ab3e52aa4188ad976eaae1bf949230fa9}


Return the Python object attached to this connection context. 

\index{milter\-::milter\-Context@{milter\-::milter\-Context}!getsymval@{getsymval}}
\index{getsymval@{getsymval}!milter::milterContext@{milter\-::milter\-Context}}
\subsubsection[{getsymval}]{\setlength{\rightskip}{0pt plus 5cm}def milter.\-milter\-Context.\-getsymval (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{sym}
\end{DoxyParamCaption}
)}\label{classmilter_1_1milterContext_aa4e075ee1d90ffcdb9be01cbac9381ff}


Calls {\tt smfi\-\_\-getsymval}. 

\index{milter\-::milter\-Context@{milter\-::milter\-Context}!progress@{progress}}
\index{progress@{progress}!milter::milterContext@{milter\-::milter\-Context}}
\subsubsection[{progress}]{\setlength{\rightskip}{0pt plus 5cm}def milter.\-milter\-Context.\-progress (
\begin{DoxyParamCaption}
\item[{}]{self}
\end{DoxyParamCaption}
)}\label{classmilter_1_1milterContext_ab189edb84978a6eb5b717809802ac658}


Calls {\tt smfi\-\_\-progress}. 

\index{milter\-::milter\-Context@{milter\-::milter\-Context}!quarantine@{quarantine}}
\index{quarantine@{quarantine}!milter::milterContext@{milter\-::milter\-Context}}
\subsubsection[{quarantine}]{\setlength{\rightskip}{0pt plus 5cm}def milter.\-milter\-Context.\-quarantine (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{reason}
\end{DoxyParamCaption}
)}\label{classmilter_1_1milterContext_af14bd477c0e3b507aab902b72931f753}


Calls {\tt smfi\-\_\-quarantine}. 

\index{milter\-::milter\-Context@{milter\-::milter\-Context}!replacebody@{replacebody}}
\index{replacebody@{replacebody}!milter::milterContext@{milter\-::milter\-Context}}
\subsubsection[{replacebody}]{\setlength{\rightskip}{0pt plus 5cm}def milter.\-milter\-Context.\-replacebody (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{data}
\end{DoxyParamCaption}
)}\label{classmilter_1_1milterContext_a1836cf657341047a2c21edea00c227bc}


Calls {\tt smfi\-\_\-replacebody}. 

\index{milter\-::milter\-Context@{milter\-::milter\-Context}!setpriv@{setpriv}}
\index{setpriv@{setpriv}!milter::milterContext@{milter\-::milter\-Context}}
\subsubsection[{setpriv}]{\setlength{\rightskip}{0pt plus 5cm}def milter.\-milter\-Context.\-setpriv (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{priv}
\end{DoxyParamCaption}
)}\label{classmilter_1_1milterContext_a97feda35e0d99384420adf4e33a22f63}


Attach a Python object to this connection context. 

\begin{DoxyReturn}{Returns}
the old value or None 
\end{DoxyReturn}
\index{milter\-::milter\-Context@{milter\-::milter\-Context}!setreply@{setreply}}
\index{setreply@{setreply}!milter::milterContext@{milter\-::milter\-Context}}
\subsubsection[{setreply}]{\setlength{\rightskip}{0pt plus 5cm}def milter.\-milter\-Context.\-setreply (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{rcode, }
\item[{}]{xcode, }
\item[{}]{msg}
\end{DoxyParamCaption}
)}\label{classmilter_1_1milterContext_a06aa38a0367832ce40044b01a2dc8c90}


Calls {\tt smfi\-\_\-setreply} or {\tt smfi\-\_\-setmlreply}. 


\begin{DoxyParams}{Parameters}
{\em rcode} & S\-M\-T\-P response code \\
\hline
{\em xcode} & extended S\-M\-T\-P response code \\
\hline
{\em msg} & one or more message lines. If the M\-T\-A does not support multiline messages, only the first is used. \\
\hline
\end{DoxyParams}
\index{milter\-::milter\-Context@{milter\-::milter\-Context}!setsymlist@{setsymlist}}
\index{setsymlist@{setsymlist}!milter::milterContext@{milter\-::milter\-Context}}
\subsubsection[{setsymlist}]{\setlength{\rightskip}{0pt plus 5cm}def milter.\-milter\-Context.\-setsymlist (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{stage, }
\item[{}]{macrolist}
\end{DoxyParamCaption}
)}\label{classmilter_1_1milterContext_a03d5744a87fc6956eda62588909467a9}


Tell the M\-T\-A which macro values we are interested in for a given stage. 

Of interest only when you need to squeeze a few more bytes of bandwidth. It may only be called from the negotiate callback. The protocol stages are M\-\_\-\-C\-O\-N\-N\-E\-C\-T, M\-\_\-\-H\-E\-L\-O, M\-\_\-\-E\-N\-V\-F\-R\-O\-M, M\-\_\-\-E\-N\-V\-R\-C\-P\-T, M\-\_\-\-D\-A\-T\-A, M\-\_\-\-E\-O\-M, M\-\_\-\-E\-O\-H. Calls {\tt smfi\-\_\-setsymlist}. 
\begin{DoxyParams}{Parameters}
{\em stage} & protocol stage in which the macro list should be used \\
\hline
{\em macrolist} & a space separated list of macro names \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
doc/milter.\-py\end{DoxyCompactItemize}
