\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} (self, sym)
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\+\_\+getsymval}. \end{DoxyCompactList}\item 
def {\bf setreply} (self, rcode, xcode, msg)
\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} (self, name, idx, value)
\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} (self, rcpt)
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\+\_\+delrcpt}. \end{DoxyCompactList}\item 
def {\bf replacebody} (self, data)
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\+\_\+replacebody}. \end{DoxyCompactList}\item 
def {\bf setpriv} (self, priv)
\begin{DoxyCompactList}\small\item\em Attach a Python object to this connection context. \end{DoxyCompactList}\item 
def {\bf getpriv} (self)
\begin{DoxyCompactList}\small\item\em Return the Python object attached to this connection context. \end{DoxyCompactList}\item 
def {\bf quarantine} (self, reason)
\begin{DoxyCompactList}\small\item\em Calls {\tt smfi\+\_\+quarantine}. \end{DoxyCompactList}\item 
def {\bf progress} (self)
\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} (self, stage, macrolist)
\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\+::milter\+Context@{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\+::milter\+Context@{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\+::milter\+Context@{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\+::milter\+Context@{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_a162b373afc104ed2bf92bf129dc53ca0}


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

\index{milter\+::milter\+Context@{milter\+::milter\+Context}!delrcpt@{delrcpt}}
\index{delrcpt@{delrcpt}!milter\+::milter\+Context@{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_afda469e2d4a9b34af9634288b32ea0c1}


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

\index{milter\+::milter\+Context@{milter\+::milter\+Context}!getpriv@{getpriv}}
\index{getpriv@{getpriv}!milter\+::milter\+Context@{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_a16e376bbcbfe072234c10f1050451538}


Return the Python object attached to this connection context. 

\index{milter\+::milter\+Context@{milter\+::milter\+Context}!getsymval@{getsymval}}
\index{getsymval@{getsymval}!milter\+::milter\+Context@{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_a31400ad798309f89d4657ca7e9607390}


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

\index{milter\+::milter\+Context@{milter\+::milter\+Context}!progress@{progress}}
\index{progress@{progress}!milter\+::milter\+Context@{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_a4d57a87720c7eb6412c4172b5a2fd879}


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

\index{milter\+::milter\+Context@{milter\+::milter\+Context}!quarantine@{quarantine}}
\index{quarantine@{quarantine}!milter\+::milter\+Context@{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_a2043e408b8e9a0f43ebc9493fd6ec10c}


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

\index{milter\+::milter\+Context@{milter\+::milter\+Context}!replacebody@{replacebody}}
\index{replacebody@{replacebody}!milter\+::milter\+Context@{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_ab1ee74318d985fd1403d3999be06e9d8}


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

\index{milter\+::milter\+Context@{milter\+::milter\+Context}!setpriv@{setpriv}}
\index{setpriv@{setpriv}!milter\+::milter\+Context@{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_aeed89d3493c851c65ec0ed93299d9a9a}


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\+::milter\+Context@{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_acbe9c38494340773dd30aca0366fbec2}


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\+::milter\+Context@{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_add2a7fb7b7d7e65c218f18c23525fa0f}


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}
