\doxysection{Milter.\+testctx.\+Test\+Ctx Class Reference}
\label{classMilter_1_1testctx_1_1TestCtx}\index{Milter.testctx.TestCtx@{Milter.testctx.TestCtx}}


\doxyref{Milter}{p.}{namespaceMilter} context for unit testing milter applications.  


Inheritance diagram for Milter.\+testctx.\+Test\+Ctx\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classMilter_1_1testctx_1_1TestCtx}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a170bdb6ab652aa392cad7f7d78fa399e} 
{\bfseries \+\_\+\+\_\+init\+\_\+\+\_\+} (self, logfile=\textquotesingle{}test/milter.\+log\textquotesingle{})
\item 
\label{classMilter_1_1testctx_1_1TestCtx_ad2ecb49c51184dceb2add8709e04fb0c} 
{\bfseries getpriv} (self)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a39bbdd926edda251eff28fdc0c50bf95} 
{\bfseries setpriv} (self, priv)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a0433e0273eb0195fe8604c62b0b6d008} 
{\bfseries getsymval} (self, name)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a18bc552f2fa4ecdba5abb9a4beb16e97} 
{\bfseries setreply} (self, rcode, xcode, $\ast$msg)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_ac1bb23fe9e86818dbe3e37bb58966f16} 
{\bfseries setsymlist} (self, stage, macros)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a849d4340a0bb50704cbddeb196ce224e} 
{\bfseries addheader} (self, field, value, idx)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a835fad53c2f000a3814b65b1f39fb585} 
{\bfseries chgheader} (self, field, idx, value)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_ab8b7fa84d0e68d6c8e9df56c476c67a7} 
{\bfseries addrcpt} (self, rcpt, params)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_acef40685b4cfa0a58c95e7abdf801b94} 
{\bfseries delrcpt} (self, rcpt)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a3f11df5d8fbcbfb092bbded5aa62e193} 
{\bfseries replacebody} (self, chunk)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a7e77cccd8acf94811f40ad7997c9e04e} 
{\bfseries chgfrom} (self, sender, params=None)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_ac6a1ce2340afcd9f2c9b6fa75807f326} 
{\bfseries quarantine} (self, reason)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a94297fd789cc731a2a8eba5bb205c580} 
{\bfseries progress} (self)
\begin{DoxyCompactList}\small\item\em Reset activity timer. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a5abf163215e13186d141fc8ad628ad83} 
list {\bfseries default\+\_\+opts} = [Milter.\+CURR\+\_\+\+ACTS,0x1fffff,0,0]
\end{DoxyCompactItemize}
\doxysubsubsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a90d01a58db4e0f4fbbd5358348a00d05} 
{\bfseries \+\_\+setsymval} (self, name, val)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_af9eea9ff93a94f1b0e5cbba2fb3c4487} 
{\bfseries \+\_\+abort} (self)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_af6d1956a13f518af0f3c4864ed35f14c} 
{\bfseries \+\_\+close} (self)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_abc239eec99edf65a142410202db5d10f} 
{\bfseries \+\_\+negotiate} (self)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_ada6bb530ca8e31cec07d11f0e978015b} 
{\bfseries \+\_\+connect} (self, host=\textquotesingle{}localhost\textquotesingle{}, helo=\textquotesingle{}spamrelay\textquotesingle{}, ip=\textquotesingle{}1.\+2.\+3.\+4\textquotesingle{})
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a45d896ae99a5fe8e1d2009ca8ce434ec} 
{\bfseries \+\_\+helo} (self, helo)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a30023f55e6a943b85431ee0152767dba} 
{\bfseries \+\_\+envfrom} (self, $\ast$s)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a53348d0f7cdb5c4b8cbed8c654f9bb9f} 
{\bfseries \+\_\+envrcpt} (self, s)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a325a8c926ed6b471a8016f9fa6c4b15a} 
{\bfseries \+\_\+data} (self)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_aefb69b34c149f77e2383f500f2fb7744} 
{\bfseries \+\_\+header} (self, fld, val)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a373367d7978f47dbc9d1103d521659a9} 
{\bfseries \+\_\+eoh} (self)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a0ef128497dfb533a4765a0bb818f2c28} 
{\bfseries \+\_\+feed\+\_\+body} (self, bfp)
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a97ed6f4e65361bcbc2b803d8c29978ee} 
{\bfseries \+\_\+eom} (self)
\item 
\textbf{ \+\_\+feed\+File} (self, fp, sender="{}spam@adv.\+com"{}, rcpt="{}victim@lamb.\+com"{}, $\ast$rcpts)
\begin{DoxyCompactList}\small\item\em Feed a file like object to the ctx. \end{DoxyCompactList}\item 
\textbf{ \+\_\+feed\+Msg} (self, fname, sender="{}spam@adv.\+com"{}, $\ast$rcpts)
\begin{DoxyCompactList}\small\item\em Feed an email contained in a file to the milter. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\label{classMilter_1_1testctx_1_1TestCtx_a6c5c65a526d284a1059d5cae002020c4} 
{\bfseries \+\_\+priv}
\begin{DoxyCompactList}\small\item\em Usually the \doxyref{Milter}{p.}{namespaceMilter} application derived from \doxyref{Milter.\+Base}{p.}{classMilter_1_1Base}. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_a50ed6a4c73039f19a880cc3e5984d05f} 
{\bfseries \+\_\+delrcpt}
\begin{DoxyCompactList}\small\item\em List of recipients deleted. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_ae127ad34f6369fcdf961ca62558ec420} 
{\bfseries \+\_\+addrcpt}
\begin{DoxyCompactList}\small\item\em List of recipients added. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_a98347cc703272d102e279a9df7bebc32} 
{\bfseries \+\_\+macros}
\begin{DoxyCompactList}\small\item\em Macros defined. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_ab403ad47ed1f0b47d78e28ec41b4fad9} 
{\bfseries \+\_\+reply}
\begin{DoxyCompactList}\small\item\em Reply codes and messages set by the milter. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_a6f77bb1aebdead41ae7e3fda4ddce825} 
{\bfseries \+\_\+symlist}
\begin{DoxyCompactList}\small\item\em The macros returned by protocol stage. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_ae4bb1d60414ac4501866299debd30846} 
{\bfseries \+\_\+body}
\begin{DoxyCompactList}\small\item\em The message body. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_a5e3af4969583d476328ac64e5bb76421} 
{\bfseries \+\_\+bodyreplaced}
\begin{DoxyCompactList}\small\item\em True if the milter replaced the message body. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_a22251f96cca9ad0ee3fa33408020c584} 
{\bfseries \+\_\+headerschanged}
\begin{DoxyCompactList}\small\item\em True if the milter changed any headers. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_a08775c91e12481d36113e059673c5eaa} 
{\bfseries \+\_\+msg}
\begin{DoxyCompactList}\small\item\em The rfc822 message object for the current email being fed to the milter. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_aec4a18642e8b73e6b9cf8c2a82f419d6} 
{\bfseries \+\_\+sender}
\begin{DoxyCompactList}\small\item\em The MAIL FROM for the current email being fed to the milter. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_a5a5a3a74c8a9b40d1cfb36733ca737a2} 
{\bfseries \+\_\+envfromchanged}
\begin{DoxyCompactList}\small\item\em True if the milter changed the envelope from. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_a150dd922b0dcf9b0a202d523cf11d5ed} 
{\bfseries \+\_\+opts}
\begin{DoxyCompactList}\small\item\em Negotiated options. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_aacb0aa8a6c6864ca2648ddc10d7fb493} 
{\bfseries \+\_\+activity}
\begin{DoxyCompactList}\small\item\em Last activity. \end{DoxyCompactList}\item 
\label{classMilter_1_1testctx_1_1TestCtx_abb529439402e62586d7da51034c923ca} 
{\bfseries \+\_\+stage}
\item 
\label{classMilter_1_1testctx_1_1TestCtx_af7a6a6e8e8f057aaa1e5370d819ef4ce} 
{\bfseries \+\_\+protocol}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\doxyref{Milter}{p.}{namespaceMilter} context for unit testing milter applications. 

A substitute for \doxyref{milter.\+milter\+Context}{p.}{classmilter_1_1milterContext} that can be passed to \doxyref{Milter.\+Base.\+\_\+setctx()}{p.}{classMilter_1_1Base_a2bb94ae9f2dd886171ae14a6fc31777c}. \begin{DoxySince}{Since}
1.\+0.\+3 
\end{DoxySince}


\doxysubsection{Member Function Documentation}
\label{classMilter_1_1testctx_1_1TestCtx_adaaad605b438e4851fd5c12ef3b622c7} 
\index{Milter.testctx.TestCtx@{Milter.testctx.TestCtx}!\_feedFile@{\_feedFile}}
\index{\_feedFile@{\_feedFile}!Milter.testctx.TestCtx@{Milter.testctx.TestCtx}}
\doxysubsubsection{\_feedFile()}
{\footnotesize\ttfamily Milter.\+testctx.\+Test\+Ctx.\+\_\+feed\+File (\begin{DoxyParamCaption}\item[{}]{self,  }\item[{}]{fp,  }\item[{}]{sender = {\ttfamily "{}spam@adv.com"{}},  }\item[{}]{rcpt = {\ttfamily "{}victim@lamb.com"{}},  }\item[{$\ast$}]{rcpts }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}}



Feed a file like object to the ctx. 

Calls the callbacks in the same sequence as libmilter. 
\begin{DoxyParams}{Parameters}
{\em fp} & the file with rfc2822 message stream \\
\hline
{\em sender} & the MAIL FROM \\
\hline
{\em rcpt} & RCPT TO -\/ additional recipients may follow \\
\hline
\end{DoxyParams}


References \textbf{ Milter.\+test.\+Test\+Base.\+\_\+body}, \textbf{ Milter.\+testctx.\+Test\+Ctx.\+\_\+body}, \textbf{ Milter.\+test.\+Test\+Base.\+\_\+bodyreplaced}, \textbf{ Milter.\+testctx.\+Test\+Ctx.\+\_\+bodyreplaced}, Milter.\+testctx.\+Test\+Ctx.\+\_\+data(), Milter.\+testctx.\+Test\+Ctx.\+\_\+envfrom(), Milter.\+testctx.\+Test\+Ctx.\+\_\+envrcpt(), Milter.\+testctx.\+Test\+Ctx.\+\_\+eoh(), Milter.\+testctx.\+Test\+Ctx.\+\_\+eom(), Milter.\+testctx.\+Test\+Ctx.\+\_\+feed\+\_\+body(), Milter.\+testctx.\+Test\+Ctx.\+\_\+header(), \textbf{ Milter.\+test.\+Test\+Base.\+\_\+headerschanged}, \textbf{ Milter.\+testctx.\+Test\+Ctx.\+\_\+headerschanged}, \textbf{ Milter.\+test.\+Test\+Base.\+\_\+msg}, \textbf{ Milter.\+testctx.\+Test\+Ctx.\+\_\+msg}, \textbf{ Milter.\+test.\+Test\+Base.\+\_\+reply}, and \textbf{ Milter.\+testctx.\+Test\+Ctx.\+\_\+reply}.



Referenced by \textbf{ Milter.\+testctx.\+Test\+Ctx.\+\_\+feed\+Msg()}.

\label{classMilter_1_1testctx_1_1TestCtx_a834f8a30587317d35b2bf04b5548e8eb} 
\index{Milter.testctx.TestCtx@{Milter.testctx.TestCtx}!\_feedMsg@{\_feedMsg}}
\index{\_feedMsg@{\_feedMsg}!Milter.testctx.TestCtx@{Milter.testctx.TestCtx}}
\doxysubsubsection{\_feedMsg()}
{\footnotesize\ttfamily Milter.\+testctx.\+Test\+Ctx.\+\_\+feed\+Msg (\begin{DoxyParamCaption}\item[{}]{self,  }\item[{}]{fname,  }\item[{}]{sender = {\ttfamily "{}spam@adv.com"{}},  }\item[{$\ast$}]{rcpts }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}}



Feed an email contained in a file to the milter. 

This is a convenience method that invokes \doxyref{feed\+File }{p.}{}. 
\begin{DoxyParams}{Parameters}
{\em sender} & MAIL FROM \\
\hline
{\em rcpts} & RCPT TO, multiple recipients may be supplied \\
\hline
\end{DoxyParams}


References \textbf{ Milter.\+testctx.\+Test\+Ctx.\+\_\+feed\+File()}.



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