\doxysection{milter.\+milter\+Context Class Reference}
\label{classmilter_1_1milterContext}\index{milter.milterContext@{milter.milterContext}}


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}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\label{classmilter_1_1milterContext_a31400ad798309f89d4657ca7e9607390}} 
def \textbf{ getsymval} (self, sym)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+getsymval}}. \end{DoxyCompactList}\item 
def \textbf{ setreply} (self, rcode, xcode, $\ast$msg)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+setreply}} or {\texttt{ smfi\+\_\+setmlreply}}. \end{DoxyCompactList}\item 
\mbox{\label{classmilter_1_1milterContext_ab8f58e8feb7a0e64dff60c6426c25443}} 
def \textbf{ addheader} (self, name, value, idx=-\/1)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+addheader}}. \end{DoxyCompactList}\item 
\mbox{\label{classmilter_1_1milterContext_a162b373afc104ed2bf92bf129dc53ca0}} 
def \textbf{ chgheader} (self, name, idx, value)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+chgheader}}. \end{DoxyCompactList}\item 
\mbox{\label{classmilter_1_1milterContext_aba5fe9d8007ffd3a7752124fba52bf6d}} 
def \textbf{ addrcpt} (self, rcpt, params=None)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+addrcpt}}. \end{DoxyCompactList}\item 
\mbox{\label{classmilter_1_1milterContext_afda469e2d4a9b34af9634288b32ea0c1}} 
def \textbf{ delrcpt} (self, rcpt)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+delrcpt}}. \end{DoxyCompactList}\item 
\mbox{\label{classmilter_1_1milterContext_ab1ee74318d985fd1403d3999be06e9d8}} 
def \textbf{ replacebody} (self, data)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+replacebody}}. \end{DoxyCompactList}\item 
def \textbf{ setpriv} (self, priv)
\begin{DoxyCompactList}\small\item\em Attach a Python object to this connection context. \end{DoxyCompactList}\item 
\mbox{\label{classmilter_1_1milterContext_a16e376bbcbfe072234c10f1050451538}} 
def \textbf{ getpriv} (self)
\begin{DoxyCompactList}\small\item\em Return the Python object attached to this connection context. \end{DoxyCompactList}\item 
\mbox{\label{classmilter_1_1milterContext_a2043e408b8e9a0f43ebc9493fd6ec10c}} 
def \textbf{ quarantine} (self, reason)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+quarantine}}. \end{DoxyCompactList}\item 
\mbox{\label{classmilter_1_1milterContext_a4d57a87720c7eb6412c4172b5a2fd879}} 
def \textbf{ progress} (self)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+progress}}. \end{DoxyCompactList}\item 
\mbox{\label{classmilter_1_1milterContext_ac56655b52becc378db9cdd28e44c2465}} 
def \textbf{ chgfrom} (self, sender, param=None)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+chgfrom}}. \end{DoxyCompactList}\item 
def \textbf{ setsymlist} (self, stage, macrolist)
\begin{DoxyCompactList}\small\item\em Tell the MTA which macro values we are interested in for a given stage. \end{DoxyCompactList}\end{DoxyCompactItemize}


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

Each connection to sendmail creates a new {\ttfamily SMFICTX} struct within libmilter. The milter module in turn creates a \doxyref{milter\+Context}{p.}{classmilter_1_1milterContext} tied to the {\ttfamily SMFICTX} 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. 

\doxysubsection{Member Function Documentation}
\mbox{\label{classmilter_1_1milterContext_aeed89d3493c851c65ec0ed93299d9a9a}} 
\index{milter.milterContext@{milter.milterContext}!setpriv@{setpriv}}
\index{setpriv@{setpriv}!milter.milterContext@{milter.milterContext}}
\doxysubsubsection{setpriv()}
{\footnotesize\ttfamily def milter.\+milter\+Context.\+setpriv (\begin{DoxyParamCaption}\item[{}]{self,  }\item[{}]{priv }\end{DoxyParamCaption})}



Attach a Python object to this connection context. 

\begin{DoxyReturn}{Returns}
the old value or None 
\end{DoxyReturn}
\mbox{\label{classmilter_1_1milterContext_ac091d9b14cd94f160eadef20f88b4b46}} 
\index{milter.milterContext@{milter.milterContext}!setreply@{setreply}}
\index{setreply@{setreply}!milter.milterContext@{milter.milterContext}}
\doxysubsubsection{setreply()}
{\footnotesize\ttfamily def milter.\+milter\+Context.\+setreply (\begin{DoxyParamCaption}\item[{}]{self,  }\item[{}]{rcode,  }\item[{}]{xcode,  }\item[{$\ast$}]{msg }\end{DoxyParamCaption})}



Calls {\texttt{ smfi\+\_\+setreply}} or {\texttt{ smfi\+\_\+setmlreply}}. 


\begin{DoxyParams}{Parameters}
{\em rcode} & SMTP response code \\
\hline
{\em xcode} & extended SMTP response code \\
\hline
{\em msg} & one or more message lines. If the MTA does not support multiline messages, only the first is used. \\
\hline
\end{DoxyParams}
\mbox{\label{classmilter_1_1milterContext_add2a7fb7b7d7e65c218f18c23525fa0f}} 
\index{milter.milterContext@{milter.milterContext}!setsymlist@{setsymlist}}
\index{setsymlist@{setsymlist}!milter.milterContext@{milter.milterContext}}
\doxysubsubsection{setsymlist()}
{\footnotesize\ttfamily def milter.\+milter\+Context.\+setsymlist (\begin{DoxyParamCaption}\item[{}]{self,  }\item[{}]{stage,  }\item[{}]{macrolist }\end{DoxyParamCaption})}



Tell the MTA 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\+\_\+\+CONNECT, M\+\_\+\+HELO, M\+\_\+\+ENVFROM, M\+\_\+\+ENVRCPT, M\+\_\+\+DATA, M\+\_\+\+EOM, M\+\_\+\+EOH. Calls {\texttt{ 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}


Referenced by Milter.\+Base.\+negotiate().



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