# HG changeset patch # User meillo@marmaro.de # Date 1232706197 -3600 # Node ID 802635628c924693c6a6acf123444e416574d57d # Parent f5225dd052cbbc995ee56616f9d6ebb24a9f555d various work in ch05 diff -r f5225dd052cb -r 802635628c92 thesis/tex/5-Improvements.tex --- a/thesis/tex/5-Improvements.tex Fri Jan 23 11:22:15 2009 +0100 +++ b/thesis/tex/5-Improvements.tex Fri Jan 23 11:23:17 2009 +0100 @@ -15,7 +15,7 @@ -\subsubsection*{Encryption} +\subsection{Encryption} Encryption should be the first funtionality to add to the current code. This requirement was already discussed on page \pageref{requirement-encryption}. As explained there, \NAME{STARTTLS} encryption---as defined in \RFC\,2487---should be added to \masqmail. @@ -51,7 +51,7 @@ -\subsubsection*{Authentication} +\subsection{Authentication} Authentication is the second function to add; it is important to restrict the access to \masqmail, especially for mail relay. The requirements for authentication where identified on page \pageref{requirement-authentication}. @@ -95,7 +95,7 @@ -\subsubsection*{Security} +\subsection{Security} Improvements to \masqmail's security are an important requirement and are the third task to work on. Retrofitting security \emph{into} \masqmail\ is not or hardly possible as it was explained in section \ref{sec:discussion-further-devel}. But adding wrappers and interposition filters can be a large step towards security. @@ -109,37 +109,36 @@ \name{smap} is non-free software and thus no general choice for \masqmail. A way to achieve a similar setup would be to copy \masqmail\ and strip one copy to the bare minimum what is needed for the proxy job. \name{setuid} could be removed and root privilege too if \name{inetd} is used. This hardens the proxy instance. +Mail from extern would then come through the proxy into the system. Mail from the local host and from the local network could be directly accepted by the normal \masqmail, if those locations are considered trusted. But it seems better to have them use the proxy too, or maybe a second proxy instance with different policy. +The here described setup comes close to the structure of the incoming channels in the new design which is described in \ref{sec:new-design}. This shows the possibilities of the here chosen approach. %fixme: rethink this sentence -split masqmail into two instances -\begin{verbatim} - +--------+ ext ||||| int +--------+ ----> |stripped|---> inter --->|normal | - |masqmail| pos |masqmail| - +--------+ ||||| +--------+ -\end{verbatim} +\subsubsection*{A concrete setup} -<< refer back to enc and auth >> +A stripped down proxy needs to be created. It should only be able to receive mail via \SMTP, encrypt the communication, authenticate clients, and send mail out via \SMTP\ to an internal socket (named ``X'' in the figure). This is a straight forward task. The normal \masqmail\ instance runs on the system too. It takes input from \name{stdin} (by calling the \path{sendmail} command) and via \SMTP\ where it listens on an internal socket (named ``X'' in the figure). Outgoing mail is handled without difference to a regular setup. Figure \ref{fig:proxy-setup} depicts the setup. -<< conditional compilation >> - - -\subsubsection*{Reliability} - -discuss persistence through using databases - +\begin{figure} + \begin{center} + \includegraphics[scale=0.75]{img/proxy-setup.eps} + \end{center} + \caption{A setup with a proxy} + \label{fig:proxy-setup} +\end{figure} \subsubsection*{Spam and malware handling} -discuss the MTA->scanner->MTA approach +The presented setup is the same as the one with two \MTA\ instances and a scanner application in between, which was suggested to add spam and malware scanner afterwards to an \MTA. This is a fortunate conincidence, because a scanner like \name{amavis} can simply be put in replace for the internal socket ``X''. -\subsubsection*{Bug fixes} -already fixed bugs +\subsubsection*{Conditional compilation} +<< conditional compilation >> + + + @@ -155,16 +154,14 @@ \section{A new design} +\label{sec:new-design} The last chapter identified the requirements for a modern and securt \masqmail. Now the various jobs of an \MTA\ get assigned to modules, of which the new architecture is created. It is inspired by existing \MTA{}s and driven by the identified requirements. One wise experience was kept in mind during the design: ``Many times in life, getting off to the right start makes all the difference.'' \cite[page~32]{graff03}. - -\subsection{Design decisions} - -One major design idea of the design were: +Major design ideas of the design were: \begin{itemize} \item free the internal system from in and out channels \item arbitrary protocol handlers have to be addable afterwards @@ -173,6 +170,9 @@ \end{itemize} + +\subsection{Architectural design} + \subsubsection*{Incoming channels} \sendmail-compatible \mta{}s must support at least two incoming channels: mail submitted using the \sendmail\ command, and mail received via the \SMTP\ daemon. It is therefor common to split the incoming channel into local and remote. This is done by \qmail\ and \postfix. The same way is \person{Hafiz}'s view. @@ -213,18 +213,10 @@ %fixme: discuss: filesystem vs. database << \masqmail\ uses the filesytem to store the queue, storing the queue in a databases might improve the reliability through better persistence. >> %fixme - %fixme: what about the ``rule of repair''? -\subsubsection*{Sanitize mail} - -Mail coming into the system often lacks important header lines. At least the required ones must be added from the \MTA. A good example is the \texttt{Message-Id:} header. - -In \postfix, this is done by the \name{cleanup} module, which invokes \name{rewrite}. The position in the message flow is after coming from one of the several incoming channels and before the message is stored into the \name{incoming} queue. Modules that handle incoming channels may also add headers, for example the \texttt{From:} and \texttt{Date:} headers. \name{cleanup}, however, does a complete check to make the mail header complete and valid. - -Apart from deciding where to sanitize the mail header, is the question where to generate the envelope. The envelope specifies the actual recipient of the mail, no matter what the \texttt{To:}, \texttt{Cc:}, and \texttt{Bcc:} headers tell. Multiple reciptients lead to multiple different envelopes, containing all the same mail message. - +\subsection{Functional design} \subsubsection*{Aliasing} @@ -373,6 +365,24 @@ +\subsection{Security design} + +\subsubsection*{Sanitize mail} + +Mail coming into the system often lacks important header lines. At least the required ones must be added from the \MTA. A good example is the \texttt{Message-Id:} header. + +In \postfix, this is done by the \name{cleanup} module, which invokes \name{rewrite}. The position in the message flow is after coming from one of the several incoming channels and before the message is stored into the \name{incoming} queue. Modules that handle incoming channels may also add headers, for example the \texttt{From:} and \texttt{Date:} headers. \name{cleanup}, however, does a complete check to make the mail header complete and valid. + +Apart from deciding where to sanitize the mail header, is the question where to generate the envelope. The envelope specifies the actual recipient of the mail, no matter what the \texttt{To:}, \texttt{Cc:}, and \texttt{Bcc:} headers tell. Multiple reciptients lead to multiple different envelopes, containing all the same mail message. + + + + + + + + + \subsection{The resulting architecture}