docs/diploma

changeset 287:6cf649e62d42

minor renames and commenting
author meillo@marmaro.de
date Fri, 16 Jan 2009 10:35:48 +0100
parents 980eb42256ff
children 8341092a7554
files thesis/tbl/requirements.tbl thesis/tbl/strategies.tbl thesis/tex/3-MailTransferAgents.tex thesis/tex/4-MasqmailsFuture.tex thesis/tex/5-Improvements.tex
diffstat 5 files changed, 59 insertions(+), 37 deletions(-) [+]
line diff
     1.1 --- a/thesis/tbl/requirements.tbl	Fri Jan 16 09:46:05 2009 +0100
     1.2 +++ b/thesis/tbl/requirements.tbl	Fri Jan 16 10:35:48 2009 +0100
     1.3 @@ -6,7 +6,7 @@
     1.4  	\RF2: Mail queue         & ++ & - & + \\
     1.5  	\RF3: Header sanitizing  & 0 & - & - \\
     1.6  	\RF4: Aliasing           & 0 & - & - \\
     1.7 -	\RF5: Route selection    & + & - & 0 \\
     1.8 +	\RF5: Route management   & + & - & 0 \\
     1.9  	\RF6: Authentication     & ++ & + & +++ \\
    1.10  	\RF7: Encryption         & ++ & + & +++ \\
    1.11  	\RF8: Spam prevention    & + & ++ & +++ \\
     2.1 --- a/thesis/tbl/strategies.tbl	Fri Jan 16 09:46:05 2009 +0100
     2.2 +++ b/thesis/tbl/strategies.tbl	Fri Jan 16 10:35:48 2009 +0100
     2.3 @@ -2,32 +2,32 @@
     2.4  	\hline
     2.5  	Requirement           & Focus & S1 & S2 & S3 \\
     2.6  	\hline \hline
     2.7 -	\RF7: encryption (\TODO1)       & +++ & x  &    &   \\
     2.8 -	\RF6: authentication (\TODO2)   & +++ & x  &    &   \\
     2.9 -	\RG1: security (\TODO3)         & +++ &    & x  & x \\
    2.10 -	\RG2: reliability (\TODO4)      & +++ &    &    & x \\
    2.11 -	\RF8: spam handling (\TODO5)    & +++ & x  & x  & x \\
    2.12 -	\RG4: extendability (\TODO6)    & +++ &    &    & x \\
    2.13 +	\RF7: Encryption (\TODO1)       & +++ & x  &    &   \\
    2.14 +	\RF6: Authentication (\TODO2)   & +++ & x  &    &   \\
    2.15 +	\RG1: Security (\TODO3)         & +++ &    & x  & x \\
    2.16 +	\RG2: Reliability (\TODO4)      & +++ &    &    & x \\
    2.17 +	\RF8: Spam handling (\TODO5)    & +++ & x  & x  & x \\
    2.18 +	\RG4: Extendability (\TODO6)    & +++ &    &    & x \\
    2.19  	\hline
    2.20 -	\RG3: robustness        & ++  &    &    & x \\
    2.21 +	\RG3: Robustness        & ++  &    &    & x \\
    2.22  	\hline
    2.23 -	\RF1: in/out channels   & +   & x  & x  & x \\
    2.24 -	\RF2: mail queueing     & +   &    &    & x \\
    2.25 -	\RG5: maintainability   & +   &    &    & x \\
    2.26 +	\RF1: In/out channels   & +   & x  & x  & x \\
    2.27 +	\RF2: Mail queueing     & +   &    &    & x \\
    2.28 +	\RG5: Maintainability   & +   &    &    & x \\
    2.29  	\hline
    2.30 -	\RF5: route selection   & 0   & x  &    &   \\
    2.31 -	\RF9: malware handling  & 0   & x  & x  & x \\
    2.32 -	\RF10: archiving        & 0   & x  &    & x \\
    2.33 -	\RG6: testability       & 0   &    &    & x \\
    2.34 +	\RF5: Route management  & 0   & x  &    &   \\
    2.35 +	\RF9: Malware handling  & 0   & x  & x  & x \\
    2.36 +	\RF10: Archiving        & 0   & x  &    & x \\
    2.37 +	\RG6: Testability       & 0   &    &    & x \\
    2.38  	\hline
    2.39 -	\RF3: header sanitizing & -   & x  &    &   \\
    2.40 -	\RF4: aliasing          & -   & x  &    &   \\
    2.41 -	\RG10: usability        & -   & x  &    &   \\
    2.42 +	\RF3: Header sanitizing & -   & x  &    &   \\
    2.43 +	\RF4: Aliasing          & -   & x  &    &   \\
    2.44 +	\RG10: Usability        & -   & x  &    &   \\
    2.45  	\hline
    2.46 -	\RG8: availability      & -{}- & x &    &   \\
    2.47 +	\RG8: Availability      & -{}- & x &    &   \\
    2.48  	\hline
    2.49 -	\RG7: performance       & -{}-{}- & x &  &  \\
    2.50 -	\RG9: portability       & -{}-{}- & x &  &  \\
    2.51 +	\RG7: Performance       & -{}-{}- & x &  &  \\
    2.52 +	\RG9: Portability       & -{}-{}- & x &  &  \\
    2.53  	\hline \hline
    2.54  	Score (Sum of `+')      & 23  & 9  & 7  & 17 \\
    2.55  	\hline
     3.1 --- a/thesis/tex/3-MailTransferAgents.tex	Fri Jan 16 09:46:05 2009 +0100
     3.2 +++ b/thesis/tex/3-MailTransferAgents.tex	Fri Jan 16 10:35:48 2009 +0100
     3.3 @@ -234,7 +234,7 @@
     3.4  
     3.5  
     3.6  
     3.7 -\section{Result}
     3.8 +\section{Summary}
     3.9  
    3.10  FIXME %fixme
    3.11  
     4.1 --- a/thesis/tex/4-MasqmailsFuture.tex	Fri Jan 16 09:46:05 2009 +0100
     4.2 +++ b/thesis/tex/4-MasqmailsFuture.tex	Fri Jan 16 10:35:48 2009 +0100
     4.3 @@ -65,7 +65,7 @@
     4.4  
     4.5  
     4.6  \paragraph{\RF2: Mail queuing}
     4.7 -Mail queuing removes the need to deliver instantly as a message is received. The queue provides fail-safe storage of mails until they are delivered. Mail queues are probably used in all \mta{}s, excluding the simple forwarders. The mail queue is essential for \masqmail, as \masqmail\ is used for non-permanent online connections. This means, mail must be queued until a online connection is available to send the message. This may be after a reboot. Hence the mail queue must provide persistence.
     4.8 +Mail queuing removes the need to deliver instantly as a message is received. The queue provides fail-safe storage of mails until they are delivered. Mail queues are probably used in all \mta{}s, even in some simple forwarders. The mail queue is essential for \masqmail, as \masqmail\ is used for non-permanent online connections. This means, mail must be queued until a online connection is available to send the message. This may be after a reboot. Hence the mail queue must provide persistence.
     4.9  
    4.10  The mail queue and the module(s) to manage it are the central part of the whole system. This demands especially for robustness and reliability, as a failure here can lead to loosing mail. An \MTA\ takes over responsibility for mail in accepting it, hence loosing mail messages is absolutely to avoid. This covers any kind of crash situation too. The worst thing acceptable to happen is an already sent mail to be sent again.
    4.11  
    4.12 @@ -86,7 +86,7 @@
    4.13  
    4.14  
    4.15  
    4.16 -\paragraph{\RF5: Selecting a route}
    4.17 +\paragraph{\RF5: Route management}
    4.18  One key feature of \masqmail\ is its ability to send mail out over different routes. The online state defines the active route to be used. A specific route may not be suited for all messages, thus these messages are hold back until a suiting route is active. For more information on this concept see section \ref{sec:masqmail-routes}.
    4.19  
    4.20  
    4.21 @@ -145,12 +145,12 @@
    4.22  
    4.23  
    4.24  
    4.25 -\paragraph{\RF9: Virus checking}
    4.26 +\paragraph{\RF9: Malware handling}
    4.27  Related to spam is malicious content (short: \name{malware}) like viruses, worms, trojan horses. They, in contrast to spam, do not affect the \MTA\ itself, as they are in the mail's body. \MTA{}s searching for malware is equal to real world's post offices opening letters to check if they contain something that could harm the recipient. This is not a mail transport job. But the \MTA\ responsible for the recipient seems to be at a good position to do this work, so it is often done there.
    4.28  
    4.29  In any way should malware checking be performed by external programs that may be invoked by the \mta. But using mail deliver agents, like \name{procmail}, are better suited locations to invoke content scanners.
    4.30  
    4.31 -A popular email filter framework is \name{amavis} which integrates various spam and virus scanners. The common setup includes a receiving \MTA\ which sends it to \name{amavis} using \SMTP, \name{amavis} processes the mail and sends it then to a second \MTA\ that does the outgoing transfer. Having interfaces to such scanners is nice to have, though.
    4.32 +A popular email filter framework is \name{amavis} which integrates various spam and malware scanners. The common setup includes a receiving \MTA\ which sends it to \name{amavis} using \SMTP, \name{amavis} processes the mail and sends it then to a second \MTA\ that does the outgoing transfer. Having interfaces to such scanners is nice to have, though.
    4.33  
    4.34  
    4.35  
    4.36 @@ -176,6 +176,7 @@
    4.37  \paragraph{\RG1: Security}
    4.38  \MTA{}s are critical points for computer security, as they are accessible from external networks. They must be secured with high effort. Properties like the need for high privilege level, from outside influenced work load, work on unsafe data, and demand for reliability, increase the need for security. This is best done by modularization, also called \name{compartementalization}, as described in section \ref{sec:discussion-mta-arch}. \masqmail\ needs to be secure enough for its target field of operation. \masqmail\ is targeted to workstations and private networks, with explicit warning to not use it on permanent online hosts \citeweb{masqmail:homepage2}. But as non-permanent online connections and trustable environments become rare, \masqmail's security should be so good, that it is usable with permanent online connections and in unsafe environments. For example should mails with bad content not break \masqmail.
    4.39  
    4.40 +<< conditional compilation >>
    4.41  
    4.42  
    4.43  \paragraph{\RG2: Reliability}
    4.44 @@ -185,6 +186,9 @@
    4.45  
    4.46  Hence, mail transfer between two processes must use the strategy: The client reissues if it receives no acknowledgement; the server first handles the message and then sends the acknowledgement. This strategy only leads to duplicates if a crash happens in the time between the message is fully transfered to the server and the acknowlegement is received by the client. No mail will get lost.
    4.47  
    4.48 +<< DB as queue >>
    4.49 +
    4.50 +<< exactly one copy of a message at one time >>
    4.51  
    4.52  \paragraph{\RG3: Robustness}
    4.53  Being robust means handling errors properly. Small errors may get corrected, large errors may kill a process. Killed processes should restarted automatically and lead to a clean state again. Log messages should be written in every case. Robust software does not need a special environment, it creates a friendly environment itself. \person{Raymond}'s \name{Rule of Robustness} and his \name{Rule of Repair} are good descriptions \cite[pages~18--21]{raymond03}.
    4.54 @@ -197,6 +201,8 @@
    4.55  \paragraph{\RG5: Maintainability}
    4.56  Maintaining software takes much time and effort. \person{Spinellis} guesses ``40\,\% to 70\,\% of the effort that goes into a software system is expended after the system is written first time.'' \cite[page~1]{spinellis03}. This work is called \emph{maintaining}. Hence making software good to maintain will ease work afterwards.
    4.57  
    4.58 +<< conditional compilation >>
    4.59 +
    4.60  
    4.61  \paragraph{\RG6: Testability}
    4.62  Good testability make maintenance easier too, because functionality is directly verifiable when changes are done, thus removing uncertainty. Modularized software makes testing easier, because parts can be tested without external influences. \person{Spinellis} sees testability as a sub-quality of maintainability.
    4.63 @@ -238,7 +244,7 @@
    4.64  		%\includegraphics[scale=0.75]{img/callgraph.eps}
    4.65  		\includegraphics[scale=0.75]{img/masqmail-3-omitlog5.eps}
    4.66  	\end{center}
    4.67 -	\caption{Call graph of \masqmail\ to show its internal structure}
    4.68 +	\caption{Internal structure of \masqmail, showed by a call graph}
    4.69  	\label{fig:masqmail-arch}
    4.70  \end{figure}
    4.71  
    4.72 @@ -272,16 +278,20 @@
    4.73  \paragraph{\RF1: In/out channels}
    4.74  \masqmail's incoming and outgoing channels are the ones required for an \MTA{}s at the moment. They are depicted in figure \ref{fig:masqmail-in-out} on page \pageref{fig:masqmail-in-out}. This is all what is currently needed. But new protocols and mailing concepts are likely to appear (see section \ref{sec:electronic-mail}). \masqmail\ has no support for adding further protocols. Thus modifications at many places in the source are needed to add them though. Today, support for further protocols is not needed, so \masqmail\ is regarded to fulfill \RF1, but the probable future need should be kept in mind.
    4.75  
    4.76 +<< smtp submission >>
    4.77 +
    4.78  \paragraph{\RF2: Queueing}
    4.79  One single mail queue is used in \masqmail; it satisfies all current requirements.
    4.80  
    4.81 +<< persistence: DB >>
    4.82 +
    4.83  \paragraph{\RF3: Header sanitizing}
    4.84  The envelope and mail headers are generated when the mail is put into the queue. The requirements are fulfilled.
    4.85  
    4.86  \paragraph{\RF4: Aliasing}
    4.87  Aliasing is done on delivery. All common kinds of aliases in the global aliases file are supported. \name{.forward} aliasing is not, but this is less common and seldom used.
    4.88  
    4.89 -\paragraph{\RF5: Select route}
    4.90 +\paragraph{\RF5: Route management}
    4.91  Setting of the route to use is done on delivery. Headers can get rewritten a second time then. This part does provide all the functionality required.
    4.92  
    4.93  \paragraph{\RF6: Authentication}
    4.94 @@ -306,6 +316,7 @@
    4.95  \masqmail's current security is bad. However, it seems acceptable for using \masqmail\ on workstations and private networks, if the environment is trustable and \masqmail\ is protected against remote attackers. In environments where untrusted components or persons have access to \masqmail, its security is too low.
    4.96  Its author states it ``is not designed to'' such usage \citeweb{masqmail:homepage2}. This is a clear indicator for being careful. Issues like high memory consumption, low performance, and denial-of-service attacks---things not regarded by design---may cause serious problems. In any way, is a security report missing that confirms \masqmail's security level.
    4.97  
    4.98 +<< conditional compilation >>
    4.99  
   4.100  \paragraph{\RG2: Reliability}
   4.101  Similar is its reliability not good enough. Situations where only one part of sent message was removed from the queue, and the other part remained as garbage, showed off \citeweb{debian:bug245882}. Problems with large mail and small bandwidth were also reported \citeweb{debian:bug216226}. Fortunately, lost email was no big problem yet, but \person{Kurth} warns:
   4.102 @@ -316,6 +327,8 @@
   4.103  In summary: Current reliability needs to be improved.
   4.104  %fixme: state machine
   4.105  
   4.106 +<< persistence: db >>
   4.107 +
   4.108  \paragraph{\RG3: Robustness}
   4.109  The logging behavior of \masqmail\ is good, although it does not cover all problem situations. For example, if the queue directory is world writeable by accident (or as action of an intruder), any user can remove messages from the queue or replace them with own ones. \masqmail\ does not even write a debug message in this case. The origin of this problem, however, is \masqmail's trust in its environment.
   4.110  
   4.111 @@ -325,8 +338,10 @@
   4.112  \paragraph{\RG5: Maintainability}
   4.113  The maintainability of \masqmail\ is equivalent to other software of similar kind. Missing modularity and therefore more complexity makes the maintainer's work harder. In summary is \masqmail's maintainability bearable, like in average Free Software projects.
   4.114  
   4.115 +<< conditional compilation >>
   4.116 +
   4.117  \paragraph{\RG6: Testability}
   4.118 -The testability suffers from missing modularity. Testing program parts is hard to do. Nevertheless, it is done by compiling parts of the source to special test programs.
   4.119 +The testability suffers from missing modularity. Testing program parts is hard to do. Nevertheless, it is done by compiling parts of the source to special test programs. %fixme: what are the names? what do they test?
   4.120  
   4.121  \paragraph{\RG7: Performance}
   4.122  The performance---efficiency---of \masqmail\ is good enough for its target field of operation, where this is a minor goal.
     5.1 --- a/thesis/tex/5-Improvements.tex	Fri Jan 16 09:46:05 2009 +0100
     5.2 +++ b/thesis/tex/5-Improvements.tex	Fri Jan 16 10:35:48 2009 +0100
     5.3 @@ -9,7 +9,7 @@
     5.4  
     5.5  
     5.6  
     5.7 -\section{On base of current code}
     5.8 +\section{Based on current code}
     5.9  
    5.10  The first three \TODO{}s are implementable by improving the current code or by adding wrappers or interposition filters. The following sections describe solution approaches to do that work.
    5.11  
    5.12 @@ -65,7 +65,7 @@
    5.13  
    5.14  \begin{enumerate}
    5.15  	\item \SMTP-after-\NAME{POP}: uses authenication on the \NAME{POP} protocol to permit incoming \SMTP\ connections for a limited time afterwards.
    5.16 -	\item \SMTP authentication: is an extension to \SMTP. Authentication can be requested before mail is accepted.
    5.17 +	\item \SMTP\ authentication: is an extension to \SMTP. Authentication can be requested before mail is accepted.
    5.18  	\item Certificates: confirm the identity of someone.
    5.19  \end{enumerate}
    5.20  
    5.21 @@ -212,14 +212,15 @@
    5.22  	\item a list of users (e.g.\ ``\texttt{bob: alice, john@example.com}'')
    5.23  	\item a command (e.g.\ ``\texttt{bob: |foo}'')
    5.24  \end{enumerate}
    5.25 -Addresses expanding to lists of users lead to more envelopes. Aliases changing the reciptients domain part may require a different route to use.
    5.26 +Addresses expanding to lists of users lead to more envelopes. Aliases changing the reciptients domain part may make the message unsuitable for a specific online route.
    5.27  
    5.28  Aliasing is often handled in expanding the alias and reinjecting the mail into the system. Unfortunately, the mail is processed twice then; additionally does the system have to handle more mail this way. If it is wanted to check the new recipient address for acceptance and do all processing again, then reinjecting it is the best choice.
    5.29  
    5.30  
    5.31  
    5.32 -\subsubsection*{Choose route to use}
    5.33 +\subsubsection*{Route management}
    5.34  
    5.35 +%fixme: rework!!
    5.36  One key feature of \masqmail\ is its ability to send mail out in different ways. The decision is based on the current online state and whether a route may be used for a message or not. The online state can be retrieved in tree ways, explained in \ref{sec:fixme}. A route to send is found by checking every available route for being able to transfer the current message, until one matches.
    5.37  
    5.38  This functionality should be implemented in the module that is responsible to invoke one of the outgoing channel modules (for example the one for \SMTP\ or the pipe module).
    5.39 @@ -265,16 +266,21 @@
    5.40  \subsubsection*{Spam prevention}
    5.41  
    5.42  ---
    5.43 -Spam is a major threat nowadays and the goal is to reduce it to a bearable level (see section \ref{sec:swot-analysis}). Spam fighting is a war are where the good guys tend to lose. Putting too much effort there will result in few gain. Real success will only be possible with new---better---protocols and abandonning the weak legacy technologies. Hence \masqmail\ should be able to provide state-of-the-art spam protection, but not more.
    5.44 +
    5.45 +Spam is a major threat nowadays and the goal is to reduce it to a bearable level (see section \ref{sec:swot-analysis}). Spam fighting is a war in which the good guys tend to lose. Putting too much effort there will result in few gain. Real success will only be possible with new---better---protocols and abandonning the weak legacy technologies. Hence \masqmail\ should be able to provide state-of-the-art spam protection, but not more.
    5.46 +
    5.47  ---
    5.48  
    5.49  Spam is a major threat to email, as described in section \ref{sec:swot-analysis}. The two main problems are forgable sender addresses and that it is cheap to send hundreds of thousands of messages. Hence, spam senders can operate in disguise and have minimal cost.
    5.50  
    5.51 -As spam is not just a nuisance for end users, but also for the infrastructure---the \mta{}s---by increasing the amount of mail messages, \MTA{}s need to protect themself. Two approaches are used.
    5.52 +As spam is not just a nuisance for end users but also for the infrastructure---the \mta{}s---by increasing the amount of mail messages. Thus \MTA{}s need to protect themself. Two different approaches are used:
    5.53  
    5.54 -First refusing spam during the \SMTP\ dialog. This is the way it was meant by the designers of the \SMTP\ protocol. They thought checking the sender and reciptient mail addresses would be enough, but as they are forgable it is not. More and more complex checks need to be done. Checking needs time, but \SMTP\ dialogs time out if it takes too long. Thus only limited time can be used, during the \SMTP\ dialog, for checking if a message seems to be spam. The advantage is that acceptance of bad messages can be simply refused---no responsibility for the message is takes and no further system load is added. See \RFC2505 (especially section 1.5) for detail.
    5.55 +\begin{enumerate}
    5.56 +\item Refusing spam during the \SMTP\ dialog. This is the way it was meant by the designers of the \SMTP\ protocol. They thought checking the sender and reciptient mail addresses would be enough, but as they are forgable it is not. More and more complex checks need to be done. Checking needs time, but \SMTP\ dialogs time out if it takes too long. Thus only limited time can be used, during the \SMTP\ dialog, for checking if a message seems to be spam. The advantage is that acceptance of bad messages can be simply refused---no responsibility for the message is taken and no further system load is added. See \RFC2505 (especially section 1.5) for detail.
    5.57  
    5.58 -Second checking for spam after the mail was accepted and queued. Here more processing time can be invested, so more detailed checks can be done. But, as responsibility for messages was taken by accepting them, it is no choice to simply delete spam mail. Checks for spam do not lead to sure results, they just indicate the possibility the message is unwanted mail. \person{Eisentraut} indicates actions to take after a message is recognized as probably spam \cite[pages 18--20]{eisentraut05}. The only acceptable one, for mail the \MTA\ is responsible for, is adding further or rewriting existent header lines. Thus all further work on the message is the same as for non-spam messages.
    5.59 +\item
    5.60 +Checking for spam after the mail was accepted and queued. Here more processing time can be invested, so more detailed checks can be done. But, as responsibility for messages was taken by accepting them, it is no choice to simply delete spam mail. Checks for spam do not lead to sure results, they just indicate the possibility the message is unwanted mail. \person{Eisentraut} indicates actions to take after a message is recognized as probably spam \cite[pages 18--20]{eisentraut05}. The only acceptable one, for mail the \MTA\ is responsible for, is adding further or rewriting existent header lines. Thus all further work on the message is the same as for non-spam messages.
    5.61 +\end{enumerate}
    5.62  
    5.63  Modern \MTA{}s use both techniques in combination. Checks during the \SMTP\ dialog tend to be implemented in the \mta\ to make it fast; checks after the message was queued are often done using external programs (\name{spamassassin} is a well known one). \person{Eisentraut} sees the checks during the \SMTP\ dialog to be essentiell: ``Ganz ohne Analyse während der SMTP-Phase kommt sowieso kein MTA aus, und es ist eine Frage der Einschätzung, wie weit man diese Phase belasten möchte.''\cite[page 25]{eisentraut05} (translated: ``No \MTA\ can go without analysis during the \SMTP\ dialog, anyway, and it is a question of estimation how much to stress this period.'')
    5.64  
    5.65 @@ -375,6 +381,7 @@
    5.66  
    5.67  
    5.68  The \name{queue-out} module takes messages from the \name{outgoing} queue, queries information about the online connection, and then selects matching routes, creates envelopes for each recipient and passes the messages to the correct transport module. Successfully transfered messages are removed from the \name{outgoing} queue. This module includes some tasks specific to \masqmail.
    5.69 +%fixme: rework route selection
    5.70  
    5.71  
    5.72  The \name{incoming} queue stores messages received via one of the incoming channels. The messages are in unprocessed form; only envelope data is prepended.