\section{Milter.\-test.\-Test\-Base Class Reference}
\label{classMilter_1_1test_1_1TestBase}\index{Milter.\-test.\-Test\-Base@{Milter.\-test.\-Test\-Base}}


Test mixin for unit testing milter applications.  


Inheritance diagram for Milter.\-test.\-Test\-Base\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classMilter_1_1test_1_1TestBase}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
def {\bfseries \-\_\-\-\_\-init\-\_\-\-\_\-}\label{classMilter_1_1test_1_1TestBase_a0cc32f9449a0a37562851b39a0ee3faa}

\item 
def {\bfseries log}\label{classMilter_1_1test_1_1TestBase_a88580d6731a1616609540738fdc4569f}

\item 
def {\bf setsymval}
\begin{DoxyCompactList}\small\item\em Set a macro value. \end{DoxyCompactList}\item 
def {\bfseries getsymval}\label{classMilter_1_1test_1_1TestBase_a8d9cedfc119c0a571de208bb78e608f1}

\item 
def {\bfseries replacebody}\label{classMilter_1_1test_1_1TestBase_a2704bab9553b34aaa90a698376111017}

\item 
def {\bfseries chgheader}\label{classMilter_1_1test_1_1TestBase_a8ba8bee733f94b6499e3c800e2b4a0c2}

\item 
def {\bfseries addheader}\label{classMilter_1_1test_1_1TestBase_a8cff4a22faa595e2ee5d00cec5d8d4d2}

\item 
def {\bfseries delrcpt}\label{classMilter_1_1test_1_1TestBase_aea38dda79fe8741b810f6f40ba3d4542}

\item 
def {\bfseries addrcpt}\label{classMilter_1_1test_1_1TestBase_a1342a8c7de15f24f4765c230da95775a}

\item 
def {\bf setreply}
\begin{DoxyCompactList}\small\item\em Save the reply codes and messages in self.\-\_\-reply. \end{DoxyCompactList}\item 
def {\bfseries setsymlist}\label{classMilter_1_1test_1_1TestBase_a6e53a97ea787e7b6c51ef44bea11b8fa}

\item 
def {\bf feed\-File}
\begin{DoxyCompactList}\small\item\em Feed a file like object to the milter. \end{DoxyCompactList}\item 
def {\bf feed\-Msg}
\begin{DoxyCompactList}\small\item\em Feed an email contained in a file to the milter. \end{DoxyCompactList}\item 
def {\bf connect}
\begin{DoxyCompactList}\small\item\em Call the connect and helo callbacks. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
{\bfseries logfp}\label{classMilter_1_1test_1_1TestBase_ae576a5c9292c902cacf776706b51ee83}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
{\bfseries \-\_\-protocol}\label{classMilter_1_1test_1_1TestBase_a554495134126b4604d7ec563bfdf3d10}

\item 
{\bf \-\_\-delrcpt}\label{classMilter_1_1test_1_1TestBase_ad72eb23389fe68f0bc0c8b88b1338c32}

\begin{DoxyCompactList}\small\item\em List of recipients deleted. \end{DoxyCompactList}\item 
{\bf \-\_\-addrcpt}\label{classMilter_1_1test_1_1TestBase_a36b1103fa4973f2aeb4628333b094d3c}

\begin{DoxyCompactList}\small\item\em List of recipients added. \end{DoxyCompactList}\item 
{\bf \-\_\-macros}\label{classMilter_1_1test_1_1TestBase_a3650cd21768a663a737e8640df2d5e96}

\begin{DoxyCompactList}\small\item\em Macros defined. \end{DoxyCompactList}\item 
{\bf \-\_\-body}
\begin{DoxyCompactList}\small\item\em The message body. \end{DoxyCompactList}\item 
{\bf \-\_\-bodyreplaced}
\begin{DoxyCompactList}\small\item\em True if the milter replaced the message body. \end{DoxyCompactList}\item 
{\bf \-\_\-headerschanged}
\begin{DoxyCompactList}\small\item\em True if the milter changed any headers. \end{DoxyCompactList}\item 
{\bf \-\_\-reply}\label{classMilter_1_1test_1_1TestBase_a6a00a684cc746f4c5d00bab5a6cfa89f}

\begin{DoxyCompactList}\small\item\em Reply codes and messages set by the milter. \end{DoxyCompactList}\item 
{\bf \-\_\-msg}
\begin{DoxyCompactList}\small\item\em The rfc822 message object for the current email being fed to the milter. \end{DoxyCompactList}\item 
{\bfseries \-\_\-symlist}\label{classMilter_1_1test_1_1TestBase_aa8452abd02ee8cf5dfcf4b3d9daa697e}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Test mixin for unit testing milter applications. 

This mixin overrides many Milter.\-Milter\-Base methods with stub versions that simply record what was done. \begin{DoxySince}{Since}
0.\-9.\-8 
\end{DoxySince}


\subsection{Member Function Documentation}
\index{Milter\-::test\-::\-Test\-Base@{Milter\-::test\-::\-Test\-Base}!connect@{connect}}
\index{connect@{connect}!Milter::test::TestBase@{Milter\-::test\-::\-Test\-Base}}
\subsubsection[{connect}]{\setlength{\rightskip}{0pt plus 5cm}def Milter.\-test.\-Test\-Base.\-connect (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{host = {\ttfamily 'localhost'}, }
\item[{}]{helo = {\ttfamily 'spamrelay'}, }
\item[{}]{ip = {\ttfamily '1.2.3.4'}}
\end{DoxyParamCaption}
)}\label{classMilter_1_1test_1_1TestBase_a36eabddf195827bfe812bb609fb8d993}


Call the connect and helo callbacks. 

The helo callback is not called if connect does not return C\-O\-N\-T\-I\-N\-U\-E. 
\begin{DoxyParams}{Parameters}
{\em host} & the hostname passed to the connect callback \\
\hline
{\em helo} & the hostname passed to the helo callback \\
\hline
{\em ip} & the I\-P address passed to the connect callback \\
\hline
\end{DoxyParams}


References Milter.\-test.\-Test\-Base.\-\_\-body, Milter.\-test.\-Test\-Base.\-\_\-bodyreplaced, Milter.\-greysql.\-Greylist.\-close(), Milter.\-greylist.\-Greylist.\-close(), Milter.\-Base.\-close(), Milter.\-Milter.\-close(), Milter.\-Base.\-hello(), Milter.\-Milter.\-hello(), and Milter.\-Base.\-negotiate().

\index{Milter\-::test\-::\-Test\-Base@{Milter\-::test\-::\-Test\-Base}!feed\-File@{feed\-File}}
\index{feed\-File@{feed\-File}!Milter::test::TestBase@{Milter\-::test\-::\-Test\-Base}}
\subsubsection[{feed\-File}]{\setlength{\rightskip}{0pt plus 5cm}def Milter.\-test.\-Test\-Base.\-feed\-File (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{fp, }
\item[{}]{sender = {\ttfamily \char`\"{}spam@adv.com\char`\"{}}, }
\item[{}]{rcpt = {\ttfamily \char`\"{}victim@lamb.com\char`\"{}}, }
\item[{}]{rcpts}
\end{DoxyParamCaption}
)}\label{classMilter_1_1test_1_1TestBase_a15be253865ea1d2f051c8f20598cb202}


Feed a file like object to the milter. 

Calls envfrom, envrcpt for each recipient, header for each header field, body for each body block, and finally eom. A return code from the milter other than C\-O\-N\-T\-I\-N\-U\-E returns immediately with that return code.

This is a convenience method, a test could invoke the callbacks in sequence on its own -\/ and for some complex tests, this may be necessary. 
\begin{DoxyParams}{Parameters}
{\em fp} & the file with rfc2822 message stream \\
\hline
{\em sender} & the M\-A\-I\-L F\-R\-O\-M \\
\hline
{\em rcpt} & R\-C\-P\-T T\-O -\/ additional recipients may follow \\
\hline
\end{DoxyParams}


References Milter.\-test.\-Test\-Base.\-\_\-body, Milter.\-test.\-Test\-Base.\-\_\-bodyreplaced, Milter.\-test.\-Test\-Base.\-\_\-headerschanged, Milter.\-test.\-Test\-Base.\-\_\-msg, Milter.\-test.\-Test\-Base.\-\_\-reply, Milter.\-Base.\-body(), Milter.\-Base.\-envfrom(), Milter.\-Milter.\-envfrom(), Milter.\-Base.\-envrcpt(), Milter.\-Milter.\-envrcpt(), Milter.\-Base.\-eoh(), Milter.\-Milter.\-eoh(), Milter.\-Base.\-eom(), Milter.\-Milter.\-eom(), Milter.\-Base.\-header(), and Milter.\-Milter.\-header().



Referenced by Milter.\-test.\-Test\-Base.\-feed\-Msg().

\index{Milter\-::test\-::\-Test\-Base@{Milter\-::test\-::\-Test\-Base}!feed\-Msg@{feed\-Msg}}
\index{feed\-Msg@{feed\-Msg}!Milter::test::TestBase@{Milter\-::test\-::\-Test\-Base}}
\subsubsection[{feed\-Msg}]{\setlength{\rightskip}{0pt plus 5cm}def Milter.\-test.\-Test\-Base.\-feed\-Msg (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{fname, }
\item[{}]{sender = {\ttfamily \char`\"{}spam@adv.com\char`\"{}}, }
\item[{}]{rcpts}
\end{DoxyParamCaption}
)}\label{classMilter_1_1test_1_1TestBase_ae3ec93df6873b1cfa8f4629d6413cb39}


Feed an email contained in a file to the milter. 

This is a convenience method that invokes \doxyref{feed\-File }{p.}{classMilter_1_1test_1_1TestBase_a15be253865ea1d2f051c8f20598cb202}. 
\begin{DoxyParams}{Parameters}
{\em sender} & M\-A\-I\-L F\-R\-O\-M \\
\hline
{\em rcpts} & R\-C\-P\-T T\-O, multiple recipients may be supplied \\
\hline
\end{DoxyParams}


References Milter.\-test.\-Test\-Base.\-feed\-File().

\index{Milter\-::test\-::\-Test\-Base@{Milter\-::test\-::\-Test\-Base}!setreply@{setreply}}
\index{setreply@{setreply}!Milter::test::TestBase@{Milter\-::test\-::\-Test\-Base}}
\subsubsection[{setreply}]{\setlength{\rightskip}{0pt plus 5cm}def Milter.\-test.\-Test\-Base.\-setreply (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{rcode, }
\item[{}]{xcode, }
\item[{}]{msg}
\end{DoxyParamCaption}
)}\label{classMilter_1_1test_1_1TestBase_ad99832fe09aa84d69b923334500e6041}


Save the reply codes and messages in self.\-\_\-reply. 



References Milter.\-Base.\-\_\-actions, Milter.\-test.\-Test\-Base.\-\_\-reply, and Milter.\-test.\-Test\-Base.\-\_\-symlist.

\index{Milter\-::test\-::\-Test\-Base@{Milter\-::test\-::\-Test\-Base}!setsymval@{setsymval}}
\index{setsymval@{setsymval}!Milter::test::TestBase@{Milter\-::test\-::\-Test\-Base}}
\subsubsection[{setsymval}]{\setlength{\rightskip}{0pt plus 5cm}def Milter.\-test.\-Test\-Base.\-setsymval (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{name, }
\item[{}]{val}
\end{DoxyParamCaption}
)}\label{classMilter_1_1test_1_1TestBase_a6ae1d9deb63095010dfea7e77e38c997}


Set a macro value. 

These are retrieved by the milter with getsymval. 
\begin{DoxyParams}{Parameters}
{\em name} & the macro name, as passed to getsymval \\
\hline
{\em val} & the macro value \\
\hline
\end{DoxyParams}


References Milter.\-test.\-Test\-Base.\-\_\-body, Milter.\-test.\-Test\-Base.\-\_\-bodyreplaced, Milter.\-test.\-Test\-Base.\-\_\-headerschanged, Milter.\-test.\-Test\-Base.\-\_\-macros, Milter.\-test.\-Test\-Base.\-\_\-msg, Milter.\-test.\-Test\-Base.\-log(), Milter.\-Base.\-log(), and Milter.\-Milter.\-log().



\subsection{Member Data Documentation}
\index{Milter\-::test\-::\-Test\-Base@{Milter\-::test\-::\-Test\-Base}!\-\_\-body@{\-\_\-body}}
\index{\-\_\-body@{\-\_\-body}!Milter::test::TestBase@{Milter\-::test\-::\-Test\-Base}}
\subsubsection[{\-\_\-body}]{\setlength{\rightskip}{0pt plus 5cm}Milter.\-test.\-Test\-Base.\-\_\-body\hspace{0.3cm}{\ttfamily [private]}}\label{classMilter_1_1test_1_1TestBase_a91f2c2958adb1b070219caed7a4a3bec}


The message body. 



Referenced by Milter.\-test.\-Test\-Base.\-connect(), Milter.\-test.\-Test\-Base.\-feed\-File(), and Milter.\-test.\-Test\-Base.\-setsymval().

\index{Milter\-::test\-::\-Test\-Base@{Milter\-::test\-::\-Test\-Base}!\-\_\-bodyreplaced@{\-\_\-bodyreplaced}}
\index{\-\_\-bodyreplaced@{\-\_\-bodyreplaced}!Milter::test::TestBase@{Milter\-::test\-::\-Test\-Base}}
\subsubsection[{\-\_\-bodyreplaced}]{\setlength{\rightskip}{0pt plus 5cm}Milter.\-test.\-Test\-Base.\-\_\-bodyreplaced\hspace{0.3cm}{\ttfamily [private]}}\label{classMilter_1_1test_1_1TestBase_a26c23edb207941eafc4047322c29baa2}


True if the milter replaced the message body. 



Referenced by Milter.\-test.\-Test\-Base.\-connect(), Milter.\-test.\-Test\-Base.\-feed\-File(), and Milter.\-test.\-Test\-Base.\-setsymval().

\index{Milter\-::test\-::\-Test\-Base@{Milter\-::test\-::\-Test\-Base}!\-\_\-headerschanged@{\-\_\-headerschanged}}
\index{\-\_\-headerschanged@{\-\_\-headerschanged}!Milter::test::TestBase@{Milter\-::test\-::\-Test\-Base}}
\subsubsection[{\-\_\-headerschanged}]{\setlength{\rightskip}{0pt plus 5cm}Milter.\-test.\-Test\-Base.\-\_\-headerschanged\hspace{0.3cm}{\ttfamily [private]}}\label{classMilter_1_1test_1_1TestBase_a7ec00842c93705982e451d6e1b0a4cd4}


True if the milter changed any headers. 



Referenced by Milter.\-test.\-Test\-Base.\-feed\-File(), and Milter.\-test.\-Test\-Base.\-setsymval().

\index{Milter\-::test\-::\-Test\-Base@{Milter\-::test\-::\-Test\-Base}!\-\_\-msg@{\-\_\-msg}}
\index{\-\_\-msg@{\-\_\-msg}!Milter::test::TestBase@{Milter\-::test\-::\-Test\-Base}}
\subsubsection[{\-\_\-msg}]{\setlength{\rightskip}{0pt plus 5cm}Milter.\-test.\-Test\-Base.\-\_\-msg\hspace{0.3cm}{\ttfamily [private]}}\label{classMilter_1_1test_1_1TestBase_a197497e481c38a59a313a55d8dc6f280}


The rfc822 message object for the current email being fed to the milter. 



Referenced by Milter.\-test.\-Test\-Base.\-feed\-File(), and Milter.\-test.\-Test\-Base.\-setsymval().



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