\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}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\label{classmilter_1_1milterContext_a997df73fe82bee8e3545cd697825d9dc} 
{\bfseries getsymval} (self, sym)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+getsymval}}. \end{DoxyCompactList}\item 
\textbf{ setreply} (self, rcode, xcode, $\ast$msg)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+setreply}} or {\texttt{ smfi\+\_\+setmlreply}}. \end{DoxyCompactList}\item 
\label{classmilter_1_1milterContext_a09f6de6e5d488f837675fb6ee1653ff1} 
{\bfseries addheader} (self, name, value, idx=-\/1)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+addheader}}. \end{DoxyCompactList}\item 
\label{classmilter_1_1milterContext_aa766f7588e9f79e384c5d0b0851a5210} 
{\bfseries chgheader} (self, name, idx, value)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+chgheader}}. \end{DoxyCompactList}\item 
\label{classmilter_1_1milterContext_a7d86da87d9073a5eb5a38439a9793bea} 
{\bfseries addrcpt} (self, rcpt, params=None)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+addrcpt}}. \end{DoxyCompactList}\item 
\label{classmilter_1_1milterContext_aff9f73f586ddaee567cb0828bf0d4184} 
{\bfseries delrcpt} (self, rcpt)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+delrcpt}}. \end{DoxyCompactList}\item 
\label{classmilter_1_1milterContext_abff7541c6810124e13bb9b9e7169ca90} 
{\bfseries replacebody} (self, data)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+replacebody}}. \end{DoxyCompactList}\item 
\textbf{ setpriv} (self, priv)
\begin{DoxyCompactList}\small\item\em Attach a Python object to this connection context. \end{DoxyCompactList}\item 
\label{classmilter_1_1milterContext_a1032b97ea09c37e9650b2afa9ae94c4f} 
{\bfseries getpriv} (self)
\begin{DoxyCompactList}\small\item\em Return the Python object attached to this connection context. \end{DoxyCompactList}\item 
\label{classmilter_1_1milterContext_aa4420591c3dd3bb0ade1cdd5e3aec0ef} 
{\bfseries quarantine} (self, reason)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+quarantine}}. \end{DoxyCompactList}\item 
\label{classmilter_1_1milterContext_a95bb556ae14f0ce948e7b1b2efb2a1fc} 
{\bfseries progress} (self)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+progress}}. \end{DoxyCompactList}\item 
\label{classmilter_1_1milterContext_a7b65badb792307f38fd4c976c343dbff} 
{\bfseries chgfrom} (self, sender, param=None)
\begin{DoxyCompactList}\small\item\em Calls {\texttt{ smfi\+\_\+chgfrom}}. \end{DoxyCompactList}\item 
\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 milter\+Context 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 milter\+Context 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}
\label{classmilter_1_1milterContext_a57f0ae73a681c655023d04404638ada2} 
\index{milter.milterContext@{milter.milterContext}!setpriv@{setpriv}}
\index{setpriv@{setpriv}!milter.milterContext@{milter.milterContext}}
\doxysubsubsection{setpriv()}
{\footnotesize\ttfamily 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}
\label{classmilter_1_1milterContext_a6436bb5c19d52eabc1eea3173c242068} 
\index{milter.milterContext@{milter.milterContext}!setreply@{setreply}}
\index{setreply@{setreply}!milter.milterContext@{milter.milterContext}}
\doxysubsubsection{setreply()}
{\footnotesize\ttfamily 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}
\label{classmilter_1_1milterContext_ac16b58dcb13a3899cb998fecd106153c} 
\index{milter.milterContext@{milter.milterContext}!setsymlist@{setsymlist}}
\index{setsymlist@{setsymlist}!milter.milterContext@{milter.milterContext}}
\doxysubsubsection{setsymlist()}
{\footnotesize\ttfamily 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 \textbf{ Milter.\+Base.\+negotiate()}.



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