\section{mime Namespace Reference}
\label{namespacemime}\index{mime@{mime}}


This module provides a \char`\"{}defang\char`\"{} function to replace naughty attachments.  


\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class {\bf Mime\-Generator}
\begin{DoxyCompactList}\small\item\em Fix multipart handling in email.\-Generator. \end{DoxyCompactList}\item 
class {\bf Mime\-Message}
\begin{DoxyCompactList}\small\item\em Enhance email.\-Message. \end{DoxyCompactList}\item 
class {\bf \-\_\-defang}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
def {\bf zipnames}
\begin{DoxyCompactList}\small\item\em Return a list of filenames in a zip file. \end{DoxyCompactList}\item 
def {\bf unquote}
\item 
def {\bfseries \-\_\-unquotevalue}\label{namespacemime_a06af1405e8211977136d54a42ef52821}

\item 
def {\bfseries message\-\_\-from\-\_\-file}\label{namespacemime_ae4ac8f88ceb657781161542f59c688b7}

\item 
def {\bfseries check\-\_\-ext}\label{namespacemime_a3300c648fedf86af5f68abfd3a2d7fad}

\item 
def {\bfseries check\-\_\-name}\label{namespacemime_aa08e1169a860d8cc414f1735894462f7}

\item 
def {\bf check\-\_\-attachments}
\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
string {\bfseries extlist} = ''\label{namespacemime_a28ea916ef2128b3ff9308cef86a3f120}

\item 
tuple {\bfseries bad\-\_\-extensions} = map(lambda x\-:'.' + x,extlist.\-split(','))\label{namespacemime_af98930bdd55ca491d8757acdac5773b5}

\item 
string {\bfseries virus\-\_\-msg}
\item 
tuple {\bfseries defang} = {\bf \-\_\-defang}()\label{namespacemime_ac0cd1d63f2f4c8e9f01bfa9131074857}

\item 
tuple {\bfseries declname} = re.\-compile(r'[a-\/z\-A-\/Z][-\/\-\_\-.\-a-\/z\-A-\/Z0-\/9]$\ast$\textbackslash{}s$\ast$')\label{namespacemime_a162776fd11c977293fed79e7b4f7dd5c}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
This module provides a \char`\"{}defang\char`\"{} function to replace naughty attachments. We also provide workarounds for bugs in the email module that comes with python. The \char`\"{}bugs\char`\"{} fixed mostly come up only with malformed messages -\/ but that is what you have when dealing with spam. 

\subsection{Function Documentation}
\index{mime@{mime}!check\-\_\-attachments@{check\-\_\-attachments}}
\index{check\-\_\-attachments@{check\-\_\-attachments}!mime@{mime}}
\subsubsection[{check\-\_\-attachments}]{\setlength{\rightskip}{0pt plus 5cm}def mime.\-check\-\_\-attachments (
\begin{DoxyParamCaption}
\item[{}]{msg, }
\item[{}]{check}
\end{DoxyParamCaption}
)}\label{namespacemime_a20eb8e9ae34cd249d472ceef511cce5f}
\begin{DoxyVerb}Scan attachments.
msg     MimeMessage
check   function(MimeMessage): int
      Return CONTINUE, REJECT, ACCEPT
\end{DoxyVerb}
 

Referenced by mime.\-\_\-defang.\-\_\-\-\_\-call\-\_\-\-\_\-().

\index{mime@{mime}!unquote@{unquote}}
\index{unquote@{unquote}!mime@{mime}}
\subsubsection[{unquote}]{\setlength{\rightskip}{0pt plus 5cm}def mime.\-unquote (
\begin{DoxyParamCaption}
\item[{}]{s}
\end{DoxyParamCaption}
)}\label{namespacemime_a80f065a81a19a22301eee579753aeb8e}
\begin{DoxyVerb}Remove quotes from a string.\end{DoxyVerb}
 \index{mime@{mime}!zipnames@{zipnames}}
\index{zipnames@{zipnames}!mime@{mime}}
\subsubsection[{zipnames}]{\setlength{\rightskip}{0pt plus 5cm}def mime.\-zipnames (
\begin{DoxyParamCaption}
\item[{}]{txt}
\end{DoxyParamCaption}
)}\label{namespacemime_a57dcea3987d3498f0f7594667f70b70e}


Return a list of filenames in a zip file. 

Embedded zip files are recursively expanded. 

Referenced by mime.\-Mime\-Message.\-getnames().



\subsection{Variable Documentation}
\index{mime@{mime}!virus\-\_\-msg@{virus\-\_\-msg}}
\index{virus\-\_\-msg@{virus\-\_\-msg}!mime@{mime}}
\subsubsection[{virus\-\_\-msg}]{\setlength{\rightskip}{0pt plus 5cm}string mime.\-virus\-\_\-msg}\label{namespacemime_af6b651706008a7a179b1489ea302b736}
{\bfseries Initial value\-:}
\begin{DoxyCode}
1 = \textcolor{stringliteral}{"""This message appeared to contain a virus.}
2 \textcolor{stringliteral}{It was originally named '%s', and has been removed.}
3 \textcolor{stringliteral}{A copy of your original message was saved as '%s:%s'.}
4 \textcolor{stringliteral}{See your administrator.}
5 \textcolor{stringliteral}{"""}
\end{DoxyCode}
