docs/diploma

changeset 219:5adc26977dc6

reworked complete chapter 4
author meillo@marmaro.de
date Mon, 05 Jan 2009 18:01:19 +0100
parents 711f0d3f5dfd
children e9e83ad85d71
files thesis/tex/4-MasqmailsFuture.tex
diffstat 1 files changed, 197 insertions(+), 187 deletions(-) [+]
line diff
     1.1 --- a/thesis/tex/4-MasqmailsFuture.tex	Sun Jan 04 22:57:49 2009 +0100
     1.2 +++ b/thesis/tex/4-MasqmailsFuture.tex	Mon Jan 05 18:01:19 2009 +0100
     1.3 @@ -12,31 +12,32 @@
     1.4  
     1.5  \subsubsection*{The source code}
     1.6  
     1.7 -\masqmail\ is written in the C programming language. The program, as of version 0.2.21, consists of 34 source code and eight header files, containing about 9,000 lines of code\footnote{Measured with \name{sloccount} by David A.\ Wheeler.}. Additionally, it includes a \name{base64} implementation (about 300 lines) and \name{md5} code (about 150 lines). For systems that do not provide \name{libident}, this library is distributed as well (circa 600 lines); an available shared library however has higher precedence in linking.
     1.8 +\masqmail\ is written in the C programming language. The program, as of version 0.2.21, consists of 34 source code and eight header files, containing about 9,000 lines of code\footnote{Measured with \name{sloccount} by David A.\ Wheeler.}. Additionally, it includes a \name{base64} implementation (about 300 lines) and \name{md5} code (about 150 lines). For systems that do not provide \name{libident}, this library is distributed as well (circa 600 lines); an available shared library has higher precedence in linking, though.
     1.9  
    1.10 -The only mandatory dependency is \name{glib}---a cross-platform software utility library, originated in the \NAME{GTK+} project. It provides safer replacements for many standard library functions. It also offers handy data containers, easy-to-use implementations of data structures, and much more.
    1.11 +The only mandatory dependency is \name{glib}---a cross-platform software utility library, originated in the \NAME{GTK+} project. It provides safe replacements for many standard library functions, especially for the string functions. It also offers handy data containers, easy-to-use implementations of data structures, and much more.
    1.12  
    1.13  With \masqmail\ comes the small tool \path{mservdetect}; it helps setting up a configuration that uses the \name{mserver} system to detect the online state. Two other binaries get compiled for testing purposes: \path{readtest} and \path{smtpsend}. All three programms use \masqmail\ source code; they only add a file with a \verb+main()+ function each.
    1.14  
    1.15 -\masqmail\ does not provide an interface to plug in modules with additional functionality. There exists no add-on or module system. The code is only separated by function to the various source files. Some functional parts can be included or excluded by defining symbols. Adding maildir support at compile time, means giving the option \verb+--enable-maildir+ to the \path{configure} call. This preserves the concerning code to get removed by the preprocessor. Unfortunately the \verb+#ifdef+s are scattered through all the source, leading to source code that is hard to read.
    1.16 +\masqmail\ lacks an interface to plug in modules with additional functionality. There exists no add-on or module system. The code is only separated by function to the various source files. Some functional parts can be included or excluded by defining symbols at compile time. Adding maildir support, means giving the option \verb+--enable-maildir+ to the \path{configure} call. This preserves the concerning code to get removed by the preprocessor. Unfortunately the \verb+#ifdef+s are scattered through all the source, leading to code that is hard to read.
    1.17  %fixme: refer to ifdef-considered-harmful ?
    1.18  
    1.19  
    1.20  
    1.21  \subsubsection*{Features}
    1.22 +\label{sec:masqmail-features}
    1.23  
    1.24 -\masqmail\ accepts mail on the command line and via \SMTP. Mail queueing and alias expansion is supported. \masqmail\ is able to deliver mail to local mailboxes (in \name{mbox} or \name{maildir} format) or pass it to a \name{mail delivery agent} (like \name{procmail}). Mail destinated to remote locations is sent using \SMTP\ or can be piped to commands, being gatesways to \NAME{UUCP} or \NAME{FAX} for example.
    1.25 +\masqmail\ accepts mail on the command line and via \SMTP. Mail queueing and alias expansion is supported. \masqmail\ is able to deliver mail to local mailboxes (in \name{mbox} or \name{maildir} format) or pass it to a \name{mail delivery agent} (like \name{procmail}). Mail for remote destinations is sent using \SMTP\ or can be piped to commands, that are gatesways to \NAME{UUCP} or telefax for example.
    1.26  
    1.27 -Outgoing \SMTP\ connections feature \SMTP-\NAME{AUTH} and \SMTP-after-\NAME{POP} authentication, but incoming connections do not. Using wrappers for outgoing connections is supported. This offers a two way communication through a wrapper application like \name{openssl}.
    1.28 +Outgoing \SMTP\ connections feature \SMTP-\NAME{AUTH} and \SMTP-after-\NAME{POP} authentication, but incoming connections do not. Using wrappers for outgoing connections is supported. This allows encrypted communication through a wrapper application like \name{openssl}.
    1.29  %todo: what about SSL/TLS encryption?
    1.30  
    1.31 -\masqmail\ focuses on non-permanent online connections, thus a concept of online routes is used. One may configure any amount of routes to send mail. Each route can have criterias, like matching \texttt{From:} or \texttt{To:} headers, to determine if mail is allowed to be sent using it. Mail to destinations outside the local net gets queued until \masqmail\ is informed about the existance of a online connection.
    1.32 +\masqmail\ focuses on non-permanent online connections, thus a concept of online routes is used. One may configure any number of routes to send mail. Each route can have criterias, like matching \texttt{From:} or \texttt{To:} headers, to determine if some message is allowed to be sent over it. Mail to destinations outside the local network gets queued until an online connections is available.
    1.33  
    1.34 -The \masqmail\ executable can be called under various names for sendmail-compatibility reasons. This is organized by symbolic links with different names pointing to the \masqmail\ executable. The \sendmail\ names are \path{/usr/lib/sendmail} and \path{/usr/sbin/sendmail} because many programs expect the \mta\ to be located there. Further more \sendmail\ supports calling it with a different name instead of supplying command line arguments. The best known of this shortcuts is \path{mailq}, which is equivilent to calling it with the argument \verb+-bq+. \masqmail\ recognizes the names \path{mailq}, \path{smtpd}, \path{mailrm}, \path{runq}, \path{rmail}, and \path{in.smtpd}. The first two are inspired by \sendmail. Not implemented is the name \path{newaliases} because \masqmail\ does not generate binary representations of the alias file.\footnote{A shell script located named \path{newaliases}, that invokes \texttt{masqmail -bi}, can provide the command to satisfy other software needing it.} \path{hoststat} and \path{purgestat} are missing for sendmail-compatibility.
    1.35 +The \masqmail\ executable can be called under various names for sendmail-compatibility reasons. This is organized by symbolic links with different names pointing to the \masqmail\ executable. The \sendmail\ names are \path{/usr/lib/sendmail} and \path{/usr/sbin/sendmail} because many programs expect the \mta\ to be located there. Further more \sendmail\ supports calling it with a different name instead of supplying command line arguments. The best known of this shortcuts is \path{mailq}, which is equivilent to calling it with the argument \verb+-bq+. \masqmail\ recognizes the names \path{mailq}, \path{smtpd}, \path{mailrm}, \path{runq}, \path{rmail}, and \path{in.smtpd}. The first two are inspired by \sendmail. Not implemented is the name \path{newaliases} because \masqmail\ does not generate binary representations of the alias file.\footnote{A shell script named \path{newaliases}, that invokes \texttt{masqmail -bi}, can provide the command to satisfy other software needing it.} \path{hoststat} and \path{purgestat} are missing for complete sendmail-compatibility.
    1.36  %masqmail: mailq, mailrm, runq, rmail, smtpd/in.smtpd
    1.37  %sendmail: hoststat, mailq, newaliases, purgestat, smtpd
    1.38  
    1.39 -Additional to the \mta\ job, \masqmail\ also offers mail retrieval services with being a \NAME{POP3} client. It can fetch mail from different remote locations, dependent on the active online route.
    1.40 +Additional to the \mta\ job, \masqmail\ also offers mail retrieval services by being a \NAME{POP3} client. It can fetch mail from different remote locations, dependent on the active online connection.
    1.41  
    1.42  
    1.43  
    1.44 @@ -44,21 +45,136 @@
    1.45  
    1.46  
    1.47  \section{Requirements}
    1.48 +\label{sec:mta-requirements}
    1.49  
    1.50  This section identifies the requirements for a modern \masqmail. Most of them will apply to modern \MTA{}s in general.
    1.51  
    1.52 -%Now that it is explained why email will survive (in some changed but related form), it is time to think about the properties required for \mta{}s in the next years. Because as the fields and kinds of usage change, the requirement change too.
    1.53  
    1.54  
    1.55  
    1.56 -\subsection{General requirements}
    1.57 +\subsection{Functional requirements}
    1.58  
    1.59 -Here follows a list of quality requirements for \masqmail, or other kinds of programs in similar environment and with similar jobs. These requirements specify the non-functional properties of the software, thus they are also called \name{non-functional requirements}. The list is based on \person{Hafiz} \cite[page~2]{hafiz05}, with insperation from \person{Spinellis} \cite[page~6]{spinellis06}.
    1.60 +The basic job of a \mta\ is to tranport mail from senders to recipients. This is the definition of such kind of software, and this is how \MTA{}s are generally seen \cite[page 19]{dent04} \cite[pages 3-5]{hafiz05}.
    1.61 +
    1.62 +An \MTA\ therefore needs at least a mail receiving facility and a mail sending facility.
    1.63 +
    1.64 +
    1.65 +
    1.66 +\subsubsection*{Incoming channels}
    1.67 +
    1.68 +\sendmail-compatible \mta{}s must support at least two incoming channels: mail submitted using the \sendmail\ command, and mail received on a \NAME{TCP} port. Thus it is common to split the incoming channels into local and remote. This is done by \qmail\ and \postfix. The same way is \person{Hafiz}'s view. \SMTP\ is the primary mail transport protocol today, but with the increasing need for new protocols\ref{FIXME} in mind, support for more than just \SMTP\ is good to have. This leads to multiple remote channels.
    1.69 +
    1.70 +
    1.71 +\subsubsection*{Outgoing channels}
    1.72 +
    1.73 +Outgoing mail is commonly either sent using \SMTP, piped into local commands (for example \path{uucp}), or delivered locally by appending to a mailbox.
    1.74 +
    1.75 +Outgoing channels are similar for \qmail, \postfix, and \name{sendmail X}: All of them have a module to send mail using \SMTP, and one for writing into a local mailbox.
    1.76 +
    1.77 +% is the def of MTA: transfer between machines, or transfer between users?
    1.78 +Local mail delivery is a job that requires root priveledge to be able to switch to any user in order to write to his mailbox. As mail delivery to local users, is \emph{not} included in the basic job of an \MTA{}, why should it care about it? In order to reduce root privelege, to keep the system simple, and to have programs that do one job well, the local delivery job should be handed over to a specialist: a \name{mail delivery agent}. \NAME{MDA}s know about the various mailbox formats and are aware of the problems of concurrent write access and thelike. Hence passing the message, and the responsiblity for it, over to an \NAME{MDA}, like \name{procmail} or \name{maildrop}, seems to be best.
    1.79 +
    1.80 +This means an outgoing connection that pipes mail into local commands is required. Other outgoing channels, one for each supportet protocol, may be designed like it was done in other \MTA{}s.
    1.81 +
    1.82 +
    1.83 +
    1.84 +\subsubsection*{Mail queue}
    1.85 +
    1.86 +Additionally to the mail receiving and sending facilities, mail queueing is a basic feature. A mail queue removes the need to deliver intantly as a message is received. It 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.
    1.87 +
    1.88 +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.
    1.89 +
    1.90 +
    1.91 +
    1.92 +
    1.93 +\subsubsection*{Header sanitizing}
    1.94 +
    1.95 +Mail coming into the system often lacks important header lines. At least the required ones must be added by the \MTA. One example is the \texttt{Date:} header, another is the, not required but recommended, \texttt{Message-ID:} header. Apart from adding missing headers, rewriting headers is important too. Changing the locally known domain part of email addresses to globally known ones is an example. \masqmail\ needs to be able to rewrite the domain part dependent on the route used to send the message, to prevent messages to get classified as spam.
    1.96 +
    1.97 +Generating the envelope is a related job. The envelope specifies the actual recipient of the mail, no matter what the \texttt{To:}, \texttt{Cc:}, and \texttt{Bcc:} headers contain. Multiple reciptients lead to multiple different envelopes, containing all the same mail message.
    1.98 +
    1.99 +
   1.100 +
   1.101 +
   1.102 +\subsubsection*{Aliasing}
   1.103 +
   1.104 +Email addresses can have aliases, thus they need to be expanded. Aliases can be of different kind: another local user, a remote user, a list containing local and remote users, or a command. Most important are the aliases in the \path{aliases} file, usually located at \path{/etc/aliases}. Addresses expanding to lists of users lead to more envelopes. Aliases changing the reciptient's domain part may require a different route to be used.
   1.105 +
   1.106 +
   1.107 +
   1.108 +
   1.109 +\subsubsection*{Selecting a route}
   1.110 +
   1.111 +One key feature of \masqmail\ is its ability to send mail out over different routes. The decision, which route to take, 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 is chosen by checking every available route for being able to transfer the current message, until one matches.
   1.112 +
   1.113 +
   1.114 +
   1.115 +
   1.116 +\subsubsection*{Authentication}
   1.117 +
   1.118 +One thing to avoid is being an \name{open relay}. Open relays allow to relay mail from everywhere to everywhere. This is a source of spam. The solution is restricting relay\footnote{Relaying is passing mail, that is not from and not for the own system, through it.} access.
   1.119 +
   1.120 +Several ways to restrict access are available. The most simple one is restrictiction by the \NAME{IP} address. No extra complexity is added this way, but static \NAME{IP} addresses are required.
   1.121 +
   1.122 +If static access restriction is not possible, some kind of authentication mechanism is required. Three common kinds exist:
   1.123 +\begin{itemize}
   1.124 +	\item \SMTP-after-\NAME{POP}: Uses authentication on the \NAME{POP} protocol to permit incoming \SMTP\ connections for a limited time afterwards.
   1.125 +	\item \SMTP\ authentication: An extension to \SMTP. It allows to request authentication before mail is accepted.
   1.126 +	\item Certificates: The identity is confirmed by certificates that are signed by trusted authorities.
   1.127 +\end{itemize}
   1.128 +
   1.129 +
   1.130 +
   1.131 +\subsubsection*{Encryption}
   1.132 +
   1.133 +Electronic mail is very weak to sniffing attacks, because all data transfer is unencrypted. This concerns the message's content, as well as the email addresses in header and envelope, but also authentication dialogs that transfer plain text passwords (\NAME{PLAIN} and \NAME{LOGIN} are examples). Hence encryption is wanted.
   1.134 +
   1.135 +The common way to encrypt \SMTP\ dialogs is using \name{Transport Layer Security} (short: \TLS, successor of \NAME{SSL}). \TLS\ encrypts the datagrams of the \name{transport layer}. This means it works below the application protocols and can be used by any of them \citeweb{wikipedia:tls}.
   1.136 +
   1.137 +Outgoing \SMTP\ connections can get encrypted using a secure tunnel, created by an external application. Incoming connections, can not use this technique because the remote \NAME{IP} address is hidden then; \NAME{STARTTLS}---defined in \RFC2487---is what \mta{}s usually implement.
   1.138 +
   1.139 +
   1.140 +
   1.141 +\subsubsection*{Spam prevention}
   1.142 +
   1.143 +Spam is a major threat nowadays, but it is a war that is hard to win. The goal is to provide state-of-the-art spam protection, but not more (see section \ref{sec:swot-analysis}).
   1.144 +
   1.145 +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.
   1.146 +
   1.147 +Filtering spam can be done in two ways: Refusing spam during the \SMTP\ dialog or checking for spam after the mail was accepted and queued. Both have advantages and disadvantages, so modern \MTA{}s use them in combination. Spam is identified by the results of a set of checks. Static rules, querying databases (\NAME{DNS} blacklists), requesting special client behavior (\name{greylisting}, \name{hashcash}), or statistical analysis (\name{bayesian filters}) are checks that may be used. Running more checks leads to better results, but takes more system resources and more time.
   1.148 +
   1.149 +Doing some basic checks during the \SMTP\ dialog seems to be a must.
   1.150 +
   1.151 +
   1.152 +
   1.153 +\subsubsection*{Virus checking}
   1.154 +
   1.155 +Related to spam is malicous 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.
   1.156 +
   1.157 +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.
   1.158 +
   1.159 +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.
   1.160 +
   1.161 +
   1.162 +
   1.163 +\subsubsection*{Archiving}
   1.164 +
   1.165 +Mail archiving and auditability become more important as email establishes as technology for serious business communication. The ability to archive verbatim copies of every mail coming into and every mail going out of the system, with relation between them, appears to be a goal to achieve.
   1.166 +
   1.167 +\postfix\ for example has a \texttt{always\_bcc} feature, to send a copy of every outgoing mail to a definable reciptient. At least this funtionality should be given, although a more complete approach is preferable.
   1.168 +
   1.169 +
   1.170 +
   1.171 +
   1.172 +
   1.173 +\subsection{Non-functional requirements}
   1.174 +
   1.175 +Here follows a list of non-functional requirements for \masqmail. These requirements specify the quality properties of software. The list is based on \person{Hafiz} \cite[page~2]{hafiz05}, with insperation from \person{Spinellis} \cite[page~6]{spinellis06} and \person{Kan} \cite{kan03}.
   1.176  %fixme: refer to ch01 and ch02
   1.177  
   1.178  
   1.179  \subsubsection*{Security}
   1.180 -\MTA{}s are critical points for computer security, as they are accessable from external networks. They must be secured with high effort. Properties like high priviledge level, work load influenced from extern, work on unsafe data, and demand for reliability, increase the need for security. \masqmail\ needs to be secure enough for its target field of operation.
   1.181 +\MTA{}s are critical points for computer security, as they are accessable from external networks. They must be secured with high effort. Properties like the need for high priviledge level, from outside influencable work load, work on unsafe data, and demand for reliability, increase the need for security. \masqmail\ needs to be secure enough for its target field of operation.
   1.182  
   1.183  
   1.184  \subsubsection*{Reliability}
   1.185 @@ -66,19 +182,19 @@
   1.186  
   1.187  
   1.188  \subsubsection*{Robustness}
   1.189 -Being robust means handling errors properly. Small errors may get tolerated, large errors may kill a process. Killed processes should be automatically restarted 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 the right environment itself. \person{Raymond}'s \name{Rule of Robustness} and his \name{Rule of Repair} are good descriptions.\cite[pages~18--21]{raymond03}
   1.190 +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}.
   1.191  
   1.192  
   1.193  \subsubsection*{Extendability}
   1.194 -Modern needs like large messages demand for more efficient mail transport through the net. Aswell is a final solution needed to defeat the spam problem. New mail transport protocols seem to be the only good solutions for both problems. They also can improve reliability, authentication, and verification issues. \masqmail's architecture needs to be extendable, to allow new features to be added afterwards. For example new mail transfer protocols as they appear and are used.
   1.195 +\masqmail's architecture needs to be extendable, to allow new features to be added afterwards. The reason for this need are changing requirements. New requirements appear, like more efficient mail transfer of large messages or a final solution for spam problem. Extendability is the ability of software to include new function with little work.
   1.196  
   1.197  
   1.198  \subsubsection*{Maintainability}
   1.199 -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 is effort that will easy 40 to 70\,\% of the work afterwards.
   1.200 +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.
   1.201  
   1.202  
   1.203  \subsubsection*{Testability}
   1.204 -Good testability make maintainance easier too, because functionality is directly verifiable when changes are done, thus removing the uncertainty. Modularized software makes testing easier, because parts can be testet without external influences. \person{Spinellis} sees testability as a subquality of maintainability.
   1.205 +Good testability make maintainance easier too, because functionality is directly verifiable when changes are done, thus removing uncertainty. Modularized software makes testing easier, because parts can be testet without external influences. \person{Spinellis} sees testability as a subquality of maintainability.
   1.206  
   1.207  
   1.208  \subsubsection*{Performance}
   1.209 @@ -86,131 +202,15 @@
   1.210  
   1.211  
   1.212  \subsubsection*{Availability}
   1.213 -Availability is important for server programs. They must stay operational, even during \name{denial of service} attacks.
   1.214 +Availability is important for server programs. They must stay operational by blocking \name{denial of service} attacks and thelike.
   1.215  
   1.216  
   1.217  \subsubsection*{Portability}
   1.218 -Source code that compiles and runs on various operationg systems is called portable. Portability can be achieved by using standard features of the programming language and common libraries. Basic rules for portable code are defined by \person{Kerighan} and \person{Pike} \cite{kernighan99}. Portable code lets software spread faster.
   1.219 +Source code that compiles and runs on various operationg systems is called portable. Portability can be achieved by using standard features of the programming language and common libraries. Basic rules to achieve portable code are defined by \person{Kerighan} and \person{Pike} \cite{kernighan99}. Portable code lets software spread faster.
   1.220  
   1.221  
   1.222  \subsubsection*{Usability}
   1.223 -Usability, not mentioned by \person{Hafiz} (he focuses on architecture) but by \person{Spinellis} and \person{Kan}, is a property very important from the user's point of view. Software with bad usability is rarely used, no matter how good it is. If roughly equivilent substitutes with better usability exist, the user will switch to one of them. Usability here means easy to set up and configure, too; users are also administrators here. Having \mta{}s on many home servers and clients, requires easy and standardized configuration. The common setups should be configurable with single actions by the user. Complex configuration should be possible, but focused must be the most common form of configuration: choosing one of several standard setups.
   1.224 -
   1.225 -
   1.226 -
   1.227 -
   1.228 -
   1.229 -\subsection{Functional requirements}
   1.230 -
   1.231 -This section identifies the needed functionality for a modern \MTA. The basic job of a \mta\ is to tranport mail from a sender to a recipient. This is the definition of such kind of software and this is how \MTA{}s are generally seen \cite[page 19]{dent04} \cite[pages 3-5]{hafiz05}.
   1.232 -
   1.233 -An \MTA\ therefore needs at least a mail receiving facility and a mail sending facility.
   1.234 -
   1.235 -
   1.236 -
   1.237 -\subsubsection*{Incoming channels}
   1.238 -
   1.239 -\sendmail-compatible \mta{}s must support at least two incoming channels: mail submitted using the \sendmail\ command, and mail received via the \SMTP\ daemon. Thus it is 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. \SMTP\ is the primary mail transport protocol today, but with the increasing need for new protocols\ref{FIXME} in mind, support for more than just \SMTP\ is good to have. This leads to more than one remote channel.
   1.240 -
   1.241 -
   1.242 -\subsubsection*{Outgoing channels}
   1.243 -
   1.244 -Outgoing mail is commonly either sent using \SMTP, piped into local commands (for example \texttt{uucp}), or delivered locally by appending to a mailbox.
   1.245 -
   1.246 -Outgoing channels are similar for \qmail, \postfix, and \name{sendmail X}: All of them have a module to send mail using \SMTP, and one for writing into a local mailbox. Local mail delivery is a job that requires root priveledge to be able to switch to any user in order to write to his mailbox.
   1.247 -
   1.248 -As mail delivery to local users, is \emph{not} included in the basic job of an \MTA{}, why should it care about it? In order to keep the system simple and to have programs that do one job well, the local delivery job should be handed over to a specialist: the \name{mail delivery agent}. \NAME{MDA}s know about the various mailbox formats and are aware of the problems of concurrent write access and thelike. Hence handling the message and the responsiblity over to a \NAME{MDA}, like \name{procmail} or \name{maildrop}, seems to be the right way to go.
   1.249 -
   1.250 -This means an outgoing connection that pipes mail into local commands is required. Other outgoing channels, one for each supportet protocol, may be designed like it was done in other \MTA{}s.
   1.251 -
   1.252 -
   1.253 -
   1.254 -\subsubsection*{Mail queue}
   1.255 -
   1.256 -Additionally to the mail receiving and sending facilities, mail queues are a basic feature. A mail queue removes the need to deliver intantly as a message is received. They provide fail-safe storage of mails until they are delivered. Mail queues are probably used in all \mta{}s, excluding the simple forwarders. A mail queue is a essential requirement for \masqmail, as it is to be used for non-permanent online connections. This means, mail must be queued until a online connection is available to send the message.
   1.257 -
   1.258 -The mail queue and the module 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 a mail to be sent twice.
   1.259 -
   1.260 -\sendmail, \exim, \qmail, \name{sendmail X}, and \masqmail\ feature one single mail queue. \postfix\ has three of them: \name{incoming}, \name{active}, and \name{deferred}. (The \name{maildrop} queue is excluded, as it is only used for the \texttt{sendmail} command.)
   1.261 -
   1.262 -\MTA\ setups that do external content scanning tend to require two separate queues. To use \sendmail\ in such setups requires two independent instances, with two separate queues, running. \exim\ can handle it with special \name{router} and \name{transport} rules, but the data flow gets complicated. Having two independent queues seems to be preferable.
   1.263 -
   1.264 -
   1.265 -
   1.266 -
   1.267 -\subsubsection*{Header sanitizing}
   1.268 -
   1.269 -Mail coming into the system often lacks important header lines. At least the required ones must be added from the \MTA. One example is the \texttt{Date:} header, another is the, not required but recommended \texttt{Message-ID:} header. Apart from adding missing headers, rewriting headers is important too, to change the locally known domain part of email addresses to globally known ones for example. \masqmail\ needs also the ability to rewrite the domain part dependent on the route used to send the message.
   1.270 -
   1.271 -Generating the envelope is a related job. 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.
   1.272 -
   1.273 -
   1.274 -
   1.275 -
   1.276 -\subsubsection*{Aliasing}
   1.277 -
   1.278 -Email addresses can have aliases and need to be expanded. Aliases can be of different kind: different local user, remote user, list of local and/or remote users, or a command. Most important are the aliases in the \path{aliases} file, usually located at \path{/etc/aliases}. Addresses expanding to lists of users lead to more envelopes. Aliases changing the reciptients domain part may require a different route to use.
   1.279 -
   1.280 -
   1.281 -
   1.282 -
   1.283 -\subsubsection*{Choose route to use}
   1.284 -
   1.285 -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.
   1.286 -
   1.287 -
   1.288 -
   1.289 -
   1.290 -\subsubsection*{Authentication}
   1.291 -
   1.292 -One thing to avoid is being an \name{open relay}. Open relays allow to relay mail from everywhere to everywhere. This is a major source of spam. The solution is restricting relay\footnote{Relaying is passing mail, that is not from and not for the own system, through it.} access.
   1.293 -
   1.294 -Several ways to restrict access are available. The most simple one is restrictiction relaying by the \NAME{IP} address. No extra complexity is added this way, but static \NAME{IP} addresses are needed.
   1.295 -
   1.296 -If static access restriction is not possible, for example mail from locations with changing \NAME{IP} addresses, some kind of authentication mechanism is required. Three common kinds exist:
   1.297 -\begin{itemize}
   1.298 -	\item \SMTP-after-\NAME{POP}: Uses authenication on the \NAME{POP} protocol to permit incoming \SMTP\ connections for a limited time afterwards.
   1.299 -	\item \SMTP authentication: An extension to \SMTP. Authentication can be requested before mail is accepted.
   1.300 -	\item Certificates: They confirm the identity of someone.
   1.301 -\end{itemize}
   1.302 -
   1.303 -
   1.304 -
   1.305 -\subsubsection*{Encryption}
   1.306 -
   1.307 -Electronic mail is very weak to sniffing attacks, because all data transfer is unencrypted. This concerns the message's content, as well as the email addresses in header and envelope, but also authentication dialogs that may transfer plain text passwords (\NAME{PLAIN} and \NAME{LOGIN} are examples). Thus encryption is wanted.
   1.308 -
   1.309 -The common way to encrypt \SMTP\ dialogs is using \name{Transport Layer Security} (short: \TLS, successor of \NAME{SSL}). \TLS\ encrypts the datagrams of the \name{transport layer}. This means it works below the application protocols and can be used by any of them\citeweb{wikipedia:tls}.
   1.310 -
   1.311 -Outgoing \SMTP\ connections can get encrypted using a secure tunnel, created by an external application. Incoming connections, can not use this technique because the remote \NAME{IP} address is hidden then; \NAME{STARTTLS}---defined in \RFC2487---is what \mta{}s implement.
   1.312 -
   1.313 -
   1.314 -
   1.315 -\subsubsection*{Spam prevention}
   1.316 -
   1.317 -Spam is a major threat nowadays, but it is a war in which the good guys tend to lose. Putting much effort in fighting spam results in few gain. Real success will only be possible with new---better---protocols and abandonning the weak legacy technologies. The goal is to provide state-of-the-art spam protection, but not more (see section \ref{sec:swot-analysis}). 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.
   1.318 -
   1.319 -Filtering spam can be done in two ways: Refusing spam during the \SMTP\ dialog or checking for spam after the mail was accepted and queued. Both have advantages and disadvantages, so modern \MTA{}s use them in combination. Spam is identified by the results of a set of checks. Static rules, querying databases (\NAME{DNS} blacklists), requesting special client behavior (\name{greylisting}, \name{hashcash}), or statistical analysis (\name{bogofilter}) are checks that may be used. Running more checks leads to better results, but takes more system resources and time.
   1.320 -
   1.321 -Doing some basic checks during the \SMTP\ dialog seems to be a must.
   1.322 -
   1.323 -
   1.324 -
   1.325 -\subsubsection*{Virus checking}
   1.326 -
   1.327 -Related to spam is malicous 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 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 last \MTA---the one responsible for the recipient---seems to be at a good position to do this work.
   1.328 -
   1.329 -In any way should malware checking be done by external programs that may be invoked by the \mta. But using mail deliver and processing agents, like \name{procmail}, a better suited locations to invoke content scanners.
   1.330 -
   1.331 -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, for sure, good to have.
   1.332 -
   1.333 -
   1.334 -
   1.335 -\subsubsection*{Archiving}
   1.336 -
   1.337 -Mail archiving and auditability become more important as electronic mail becomes more important. The ability to archive verbatim copies of every mail coming into and every mail going out of the system, with relation between them, appears to be a goal to achieve.
   1.338 -
   1.339 -\postfix\ for example has a \texttt{always\_bcc} feature, to send a copy of every mail to a definable reciptient. At least this funtionality should be given, although a more complete approach is preferable.
   1.340 +Usability, not mentioned by \person{Hafiz} (he focuses on architecture) but by \person{Spinellis} and \person{Kan}, is a property very important from the user's point of view. Software with bad usability is rarely used, no matter how good it is. If substitutes with better usability exist, the user will switch to one of them. Here, usability includes setting up and configuring; and the term ``users'' includes administrators. Having \mta{}s on home servers and workstations requires easy and standardized configuration. The common setups should be configurable with little action by the user. Complex configuration should be possible, but focused must be the most common form of configuration: choosing one of several common setups.
   1.341  
   1.342  
   1.343  
   1.344 @@ -221,75 +221,82 @@
   1.345  
   1.346  \section{Work to do}
   1.347  
   1.348 -After \masqmail's features were presented in section \ref{sec:fixme} and the requirements for modern \mta{}s were identified in section \ref{sec:fixme}, here the differences between them are shown.
   1.349 +After \masqmail's features were presented in section \ref{sec:masqmail-features} and the requirements for modern \mta{}s were identified in section \ref{sec:mta-requirements}, here the differences between them are shown.
   1.350  
   1.351  
   1.352  
   1.353  \subsubsection*{Fulfilled requirements}
   1.354  
   1.355 -\masqmail's incoming and outgoing channels are the ones common to most \MTA{}s: the \texttt{sendmail} command and \SMTP\ for incoming mail; local delivery, piping to commands, and \SMTP\ for outgoing mail. Support for other protocols is not available. To add it, modifications at many places in the source are needed.
   1.356 +\masqmail's incoming and outgoing channels are the ones common to most \MTA{}s: the \path{sendmail} command and \SMTP\ for incoming mail; local delivery, piping to commands, and \SMTP\ for outgoing mail. Support for other protocols is not available. To add it, modifications at many places in the source are needed.
   1.357  
   1.358 -One single mail queue is used in \masqmail. The envelope and mail headers are generated when the mail is put into the queue. Aliasing is done on delivery, after the route to be used was determined. Headers may be rewritten then. These parts do all provide the functionality required.
   1.359 +One single mail queue is used in \masqmail. The envelope and mail headers are generated when the mail is put into the queue. Aliasing is done on delivery, after the route to be used was determined. Headers can get rewritten then. These parts do all provide the functionality required.
   1.360  
   1.361 -Static authentication, based on \NAME{IP} addresses, can be set up using the \path{hosts.allow} and \path{hosts.deny} files. Dynamic authentication is supported in form of \NAME{SMTP-AUTH} and \SMTP-after-\NAME{POP}, but only for outgoing connections. The same for encryption which is also only available for outgoing \SMTP\ connections; here a wrapper application like \name{openssl} needs to be used. Support for authentication and encryption of incoming connections is completely missing, but a basic requirement for all secure emailing.
   1.362 +Static authentication, based on \NAME{IP} addresses, can be with \person{Venema}'s \NAME{TCP} \name{Wrapper}, by editing the \path{hosts.allow} and \path{hosts.deny} files. Dynamic \SMTP\ authentication is supported in form of \NAME{SMTP-AUTH} and \SMTP-after-\NAME{POP}, but only for outgoing channels. Similar for encryption which is also only available for outgoing channels; here a wrapper application like \name{openssl} is needed. Support for authentication and encryption of incoming connections is completely missing, although it is a basic requirement for secure emailing.
   1.363  
   1.364 -\masqmail\ does not provide special support for spam filter or content checking. But it is possible to invoke external filter applications by running two independent instances of \masqmail, connected by the filter application. The receiving \MTA\ instance accepts mail and pushes it into the filter. The filter application receives mail, processes it, possible modifies it, and pushes it over to a second \MTA\ instance. The second \MTA\ is responsible for further delivery of the mail. Appendix \ref{app:FIXME} shows configuration files to create such a setup. This is a concept that works in general. However, real spam \emph{prevention}---to not accept spam mail at all---or good filter interfaces are not available, but are nessesary for using \masqmail\ in an unsafe environment.
   1.365 +\masqmail\ does not provide special support for spam filtering and content checking. But it is possible to use external filter applications by running two independent instances of \masqmail, connected by the filter application. The receiving \MTA\ instance accepts mail and pushes it into the filter application. The filter application receives mail, processes it, possible modifies it, and pushes it to a second \MTA\ instance. The second \MTA\ is responsible for further delivery of the mail.
   1.366 +%Appendix \ref{app:FIXME} shows configuration files to create such a setup.
   1.367 +This is a concept that works in general. However, real spam \emph{prevention}---to not even accept spam---or good filter interfaces are not available. But they are nessesary for using \masqmail\ in an unsafe environment.
   1.368  
   1.369  There is currently no way of archiving every message going through \masqmail.
   1.370  
   1.371  
   1.372  Non-functional requirements are not so easy to be marked as fulfilled or not. Instead they are discussed here.
   1.373  
   1.374 -\masqmail\ needs to be ``secure enough'', but what is ``secure enough''? This depends on its target field. Currently \masqmail\ is targeted to workstations and private networks, with explicit warning for use on permanent online hosts \citeweb{masqmail:homepage2}. \masqmail's current security is bad. (For instance does a long time known attack against \sendmail, described by \person{Sill} \cite[page~4]{sill02}, still outwit \masqmail). The security, however, seems acceptable for use on workstations and private networks, if the environment is trusted. In environments where untrusted components or persons have access to \masqmail, its security is too low.
   1.375 +\masqmail\ needs to be ``secure enough'', but what is ``secure enough''? This depends on its target field. Currently \masqmail\ is targeted to workstations and private networks, with explicit warning to not use it on permanent online hosts \citeweb{masqmail:homepage2}. \masqmail's current security is bad. For instance does a long time known attack against \sendmail, described by \person{Sill} \cite[page~4]{sill02}, still outwit \masqmail. Its security, however, seems acceptable for use on workstations and private networks, if the environment is trustable. In environments where untrusted components or persons have access to \masqmail, its security is too low.
   1.376  
   1.377  Similar for its reliability. It has been reported that \masqmail\ has not sent mail under some circumstances \citeweb{FIXME}. %fixme
   1.378 -The author also noticed problems with where only one part of the queued message was removed, the other part remained as garbage. Fortunately, reports abou lost mail are not known. Current reliability is not good enough.
   1.379 +Situations where only one part of sent message was removed from the queue, and the other part remained as garbage, showed off, too---even to the author of this thesis. Fortunately, lost email was no big problem yet, but \person{Kurth} warns:
   1.380 +\begin{quote}
   1.381 +There may still be serious bugs in [masqmail], so mail might get lost. But in the nearly two years of its existence so far there was only one time a bug which caused mail retrieved via pop3 to be lost in rare circumstances.
   1.382 +\hfill\citeweb{masqmail:homepage2}
   1.383 +\end{quote}
   1.384 +In summary: Current reliability is not good enough.
   1.385  
   1.386 -The logging behavior of \masqmail\ is good, but does not cover everything. Also it trusts its environment. 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.
   1.387 +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.
   1.388  
   1.389 -\masqmail's extendability is very poor. This is a general problem of monolithic software, but can thus be provided with high effort. \exim\ is an example for good extendability for a monolithic program.
   1.390 +\masqmail's extendability is very poor. This is a general problem of monolithic software, but can thus be provided with high effort. \exim\ is an example for good extendability in a monolithic program.
   1.391  
   1.392 -The maintainability of \masqmail\ appears to be equivilent 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, and in view of its missing modularity good. The testability suffers from the same. Testing program parts is hard, but done by compiling source parts to special test programs.
   1.393 +The maintainability of \masqmail\ appears to be equivilent 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. The testability suffers from missing modularity. Testing program parts is hard to do. Anyhow, it is done by compiling parts of the source to special test programs.
   1.394  
   1.395 -The performance---effenciency---of \masqmail\ is good enough for its target field of operation, where this is a minor goal. As well is its availability. Hence no further work needs to be done her.
   1.396 +The performance---effenciency---of \masqmail\ is good enough for its target field of operation, where this is a minor goal. This applies equal to availability. Hence no further work needs to be done her.
   1.397  
   1.398 -The code's protability is good with view on \unix-like operation systems. At least \name{Debian}, \name{Redhat}, \NAME{SUSE}, \name{slackware}, \name{Free}\NAME{BSD}, \name{Open}\NAME{BSD}, and \name{Net}\NAME{BSD} are reported to be able to compile and run \masqmail\ \citeweb{masqmail:homepage2}. About special requirements for the underlying file system is not heard of. The portability is already good.
   1.399 +The code's protability is good with view on \unix-like operation systems. At least \name{Debian}, \name{Redhat}, \NAME{SUSE}, \name{slackware}, \name{Free}\NAME{BSD}, \name{Open}\NAME{BSD}, and \name{Net}\NAME{BSD} are reported to be able to compile and run \masqmail\ \citeweb{masqmail:homepage2}. Special requirements for the underlying file system are not known. Therefore, the portability is already good.
   1.400  
   1.401 -The usability, from the administator's point of view, is very good. \masqmail\ was developed to suite a specific, limited job, its configuration does perfect match. The user's view does not reach to the \MTA, as it is hidden behind the \name{mail user agent}.
   1.402 +The usability, from the administator's point of view, is very good. \masqmail\ was developed to suite a specific, limited job---its configuration does perfect match. The user's view does not reach to the \MTA, as it is hidden behind the \name{mail user agent}.
   1.403  
   1.404  
   1.405  
   1.406  \subsubsection*{Missing parts}
   1.407  
   1.408 -Support for other protocols than \SMTP\ seems not to be nessesary at the moment. Adding such support will need lots of work in all parts of \masqmail, hence delaying it until the support is needed appears to be the best solution.
   1.409 +Support for other protocols than \SMTP\ seems not to be nessesary at the moment. Adding such support will need lots of work in many parts of \masqmail. Hence delaying this work until the support becomes mandatory, appears to be the best strategy. This way work can be saved if some protocols never become popular.
   1.410  
   1.411 -Authentication of incoming \SMTP\ connections is definately needed and should be added soon. The same applies to encryption of incomming connections. These two features are essential for restricting relaying and providing privacy.
   1.412 +Authentication of incoming \SMTP\ connections is definately needed and should be added soon. The same applies to encryption of incomming connections. These two features are essential for restricting relaying and for providing privacy.
   1.413  
   1.414 -As authentication can be a guard against spam, filter facilities have lower priority. But basic spam filtering and interfaces for external tools should be implemented in future. Content checking, if really nessesary, should be left over to the \NAME{MDA}, to deal with it in local delivery.
   1.415 +As authentication can be a guard against spam, filter facilities have lower priority. But basic spam filtering and interfaces for external tools should be implemented in future. Content checking should be left over to the \NAME{MDA}, to deal with it during local delivery.
   1.416  
   1.417 -Archiving again is prefered to be implemented soon. It does not require much work, but enables all kinds of statistical analysis. Also it is a requirement for companies to archive their mail communication.
   1.418 +Archiving again is prefered to be implemented soon. It does not require much work, but enables all kinds of statistical analysis.
   1.419  
   1.420  Non-functional requirements need improvement too.
   1.421  
   1.422 -\masqmail's security is bad and limits it thus to a field of operation that shrinks. Security becomes more important and networking and interaction increases. Save and trusted environment become rare. Improving security is an important thing to do in future.
   1.423 +\masqmail's security is bad, thus the program is forced into a limited field of operation. The field of operation even shrinks, as security becomes more important and networking and interaction increases. Save and trusted environment become rare. Improving security is an important thing to do.
   1.424  
   1.425 -Reliability is also to improve. It is a key quality property for an \MTA, and not good enough in \masqmail. Also is the program lacking robustness. Checking the environment and reporting bad characteristics is wanted. Especially improving robustness inrelation to the queue is favorable; applying ideas of \name{crash-only software}\cite{candea03} will be a good step.
   1.426 +Reliability is also to improve. It is a key quality property for an \MTA, and not good enough in \masqmail. Additionally, the program is lacking robustness. Checking the environment and reporting bad characteristics is wanted. Especially improving robustness in relation to the queue is favorable; applying ideas of \name{crash-only software}\cite{candea03} will be a good step.
   1.427  
   1.428 -Extendability, maintainability, and testability do all lack from the monolithic architecture and are nearly impossible to improve without changing the programs structure. These properties can hardly be retrofitted into software. But extendability might become important in the future, and the other two make all further work on the software easier.
   1.429 +Extendability, maintainability, and testability do all suffer from the monolithic architecture and are nearly impossible to improve without changing the programs structure. These properties can hardly be retrofitted into software. Extendability might become important in the future. The other two ease all further work on the software, and also improve security and reliability.
   1.430  
   1.431 -Performance is a nice-to-have property, but as performance improvements are in contrast to many other quality poperties (reliability, maintainability, usability, capability \cite[page~5]{kan03}), jeopardizing these to gain some more performance should not be done. \person{Kernighan} and \person{Pike} state clear: ``[T]he first principle of optimization is \emph{don't}.''\cite[page~165]{kernighan99}. \masqmail\ is not a program to be used on large servers, but on small devices. Thus important for \masqmail\ is focusing on energy and heat, maybe also system resources, not on performance.
   1.432 +Performance is a property that is nice to have. But as performance improvements are in contrast to many other quality poperties (reliability, maintainability, usability, capability \cite[page~5]{kan03}), jeopardizing these to gain some more performance should not be done. \person{Kernighan} and \person{Pike} state clear: ``[T]he first principle of optimization is \emph{don't}.''\cite[page~165]{kernighan99}. \masqmail\ is not a program to be used on large servers, but on small devices. Thus important for \masqmail\ could be energy and heat saving, maybe also system resources, but not performance. Anyway, simplicity and clearness are of higher value.
   1.433  
   1.434 -Focusing on being portable amoung the various flavors of \unix\ systems seems to be okay, because these systems are the ones \MTA{}s run on usually. Problems with non-\unix platforms are primary expected to come from file systems lacking required features. But no special care should be taken here.
   1.435 +Portability amoung the various flavors of \unix\ systems is a goal, because these systems are the ones \MTA{}s run on usually. Portability problems with non-\unix\ platforms are primary expected to come from file systems lacking required features. But no special care should be taken here.
   1.436  
   1.437 -Configuration could be eased more, by providing configuration generators to be able to run \masqmail\ right ``out of the box'' with only running one of several configuration scripts for common setups. This would make \masqmail\ better usable by people not technical educated.
   1.438 +Configuration could be eased more, by providing configuration generators to be able to use \masqmail\ right ``out of the box'' after running one of several configuration scripts for common setups. This would improve \masqmail's usability for not technical educated people.
   1.439  
   1.440  
   1.441  
   1.442  \subsubsection*{The need for structural changes}
   1.443  
   1.444 -Adding authentication and encryption support, for example, is limited to a narrow region in the code. Such features are addable to the current code base without much problem. In contrast does adding support for new protocols or mail processing interfaces to external programs require a lot of effort. Changes in many parts of the source code are required. It is a bad idea to implement large retro-fitted features into software that is critical in security and reliability, like \masqmail. Worse if these features need changes in the program's structure, like adding mail scanning interfaces would do.
   1.445 +Adding authentication and encryption support, for example, is limited to a narrow region in the code. Such features are addable to the current code base without much problem. In contrast does adding support for new protocols or mail processing interfaces to external programs require a lot of effort. Changes in many parts of the source code are required. It is a bad idea to implement large retro-fitted features into software that is critical about security and reliability, like \MTA{}s. Worse if these features need changes in the program's structure, like adding mail scanning interfaces would do.
   1.446  
   1.447 -If such features are needed, it is best do redesign the program's structure and rebuild it. A program's structure is primary its architecture. Which is probably the most influencing design decision, and has the greatest impact on the program's future capabilities. The architecture defines what the program can do, and how it can be used. If the architecture does not fit the requirements, develpement reached a dead end \dots\ further work on this basis will make everything worse. The only good solution is to change the architecture, which, sadley but most likely, means a redesign from scratch.
   1.448 +If such large features are needed, it is best to redesign the program's structure and rebuild it. A program's structure is primary its architecture. Which is the most influencing design decision, and has the greatest impact on the program's future capabilities. The architecture defines what the program can do, and how it can be used. If the architecture does not fit to the requirements, develpement will reach a dead end \dots\ further work then will make everything worse. The only good solution is to change the architecture, which, sadley but most likely, means a redesign from scratch.
   1.449  
   1.450  Quality properties, like security and reliability, as well as extendability and maintainablity, can hardly be added afterwards---if at all. Only structural changes will improve them. Hence, if security, reliability, extendability (to add support for future mail transfer protocols), or maintainability shall be improved, a redesign of \masqmail\ is the only sane way to go.
   1.451  
   1.452 @@ -300,30 +307,32 @@
   1.453  
   1.454  \section{Discussion on MTA architecture}
   1.455  
   1.456 -\masqmail's current artitecture is monolitic like \sendmail's and \exim's. But more than the other two, is it one block of interweaved code. \sendmail\ provides now, with its \name{milter} interface, standardized connection channels to external modules. \exim\ has a highly structured code with many internal interfaces, a good example is the one for authentication ``modules''. %fixme: add ref
   1.457 +\masqmail's current artitecture is monolitic like \sendmail's and \exim's. But more than the other two, is it one block of interweaved code. \exim\ has a highly structured code with many internal interfaces, a good example is the one for authentication ``modules''. %fixme: add ref
   1.458 +\sendmail\ provides now, with its \name{milter} interface, standardized connection channels to external modules.
   1.459  \masqmail\ has none of them; it is what \sendmail\ was in the beginning: a single large block.
   1.460  
   1.461 -Figure \ref{fig:masqmail-arch} is a call graph generated from \masqmail's source code. It gives a impression of how interweaved the internal structure is.
   1.462 +Figure \ref{fig:masqmail-arch} is a call graph generated from \masqmail's source code, excluding logging functions. It gives a impression of how interweaved the internals are.
   1.463 +%fixme: what is included, what not?
   1.464  
   1.465  \begin{figure}
   1.466  	\begin{center}
   1.467 -		%\input{input/masqmail-arch.tex}
   1.468 +		\vspace*{2ex}
   1.469  		\includegraphics[scale=0.75]{img/callgraph.eps}
   1.470  	\end{center}
   1.471  	\caption{Call graph of \masqmail\ to show its internal structure}
   1.472  	\label{fig:masqmail-arch}
   1.473  \end{figure}
   1.474  
   1.475 -\sendmail\ improved its old architecture, for example by adding the milter interface, to add further functionality by invocing external programs. \exim\ was designed, and is carefully maintained, with a modular-like code structure in mind. \qmail\ started from scratch with a ``security-first'' approach, \postfix\ improved on it, and \name{sendmail X}/\name{MeTA1} tries to adopt the best of \qmail\ and \postfix, to completely replace the old \sendmail\ architecture. \person{Hafiz} \cite{hafiz05}. describes this evolution of \mta\ architecture very well.
   1.476 +\sendmail\ improved its old architecture by adding the milter interface, to include further functionality by invocing external programs. \exim\ was designed, and is carefully maintained, with a modular-like code structure in mind. \qmail\ started from scratch with a ``security-first'' approach, \postfix\ improved on it, and \name{sendmail X}/\name{MeTA1} tries to adopt the best of \qmail\ and \postfix\ to completely replace the old \sendmail\ architecture. \person{Hafiz} describes this evolution of \mta\ architecture very well \cite{hafiz05}.
   1.477  
   1.478 -Every one of the popular \MTA{}s is more modular, or became more modular over time, than \masqmail\ is. Modern requirements like spam protection and future requirements like---probably---the use of new mail transport protocols demand modular designs for keeping the software simple. Simplicity is a key property for security. ``[T]he essence of security engenieering is to build systems that are as simple as possible.''\cite[page 45]{graff03}
   1.479 +Every one of these programs is more modular, or became more modular over time, than \masqmail\ is. Modern requirements like spam protection and future requirements like---probably---the use of new mail transport protocols demand for modular designs in order to keep the software simple. Simplicity is a key property for security. ``[T]he essence of security engenieering is to build systems that are as simple as possible.''\cite[page 45]{graff03}
   1.480  
   1.481 -\person{Hafiz} agrees: ``The goal of making software secure can be better achieved by making the design simple and easier to understand and verify.''\cite[page 64]{hafiz05} He identifies the security of \qmail\ to come from it's \name{compartmentalization}, which goes hand in hand with modularity:
   1.482 +\person{Hafiz} agrees: ``The goal of making software secure can be better achieved by making the design simple and easier to understand and verify.'' \cite[page 64]{hafiz05}. He identifies the security of \qmail\ to come from it's \name{compartmentalization}, which goes hand in hand with modularity:
   1.483  \begin{quote}
   1.484  A perfect example is the contrast between the feature envy early \sendmail\ architecture implemented as one process and the simple, modular architecture of \qmail. The security of \qmail\ comes from its compartmentalized simple processes that perform one task only and are therefore testable for security.
   1.485  \hfill\cite[page 64]{hafiz05}
   1.486  \end{quote}
   1.487 -As well does \person{Dent} for \postfix: ``The modular architecture of Postfix forms the basis for much of its security.'' \cite[page 7]{dent04}
   1.488 +Equal does \person{Dent} see the situation for \postfix: ``The modular architecture of Postfix forms the basis for much of its security.'' \cite[page 7]{dent04}
   1.489  
   1.490  Modularity is also needed to satisfy modern \MTA\ requirements, in providing a clear interface to add functionality without increasing the overall complexity much.
   1.491  
   1.492 @@ -336,9 +345,9 @@
   1.493  \end{quote}
   1.494  
   1.495  
   1.496 -All this leads to the wish of a rewrite of \masqmail, using a modern, modular architecture, \emph{if} further features need to be added---ones that require changes in \masqmail's structure. But a rewrite is also needed, if \masqmail\ should become a modern \MTA, with good quality properties.
   1.497 +All this leads to the wish of a rewrite of \masqmail, using a modern, modular architecture, \emph{if} further features need to be added---features that require changes in \masqmail's structure. But a rewrite is also mandatory, if \masqmail\ should become a modern \MTA, with good quality properties.
   1.498  
   1.499 -But redesigning and rewriting a software from scratch is hard. It takes time to design a new architecture, which must prove it is secure and reliable. As well is much time and work needed to implement the design, test it, fix bugs, and so on. Thus the gain of a new design must overweight the effort needed.
   1.500 +But redesigning and rewriting a software from scratch is hard. It takes time to design a new architecture, which then must prove it is secure and reliable. As well is much time and work needed to implement the design, test it, fix bugs, and so on. If flaws in the design appear during prototype implementation, it is nessesary to start again. Thus the gain of a new design must overweight the effort needed.
   1.501  
   1.502  \person{Wheeler}'s program \name{sloccount} calculates following estimations for \masqmail's code base as of version 0.2.21 (excluding library code):
   1.503  {\small
   1.504 @@ -354,13 +363,9 @@
   1.505  SLOCCount, Copyright (C) 2001-2004 David A. Wheeler
   1.506  \end{verbatim}
   1.507  }
   1.508 -The development cost is not relevant for a \freesw\ project of volunteer developers, but the development time is. About 24 man-months are estimated. The current code base was written almost completely by Oliver \person{Kurth} within four years, in his spare time. This means he needed around twice as much time.
   1.509 +The development cost is not relevant for a \freesw\ project with volunteer developers, but the development time is. About 24 man-months are estimated. The current code base was written almost completely by Oliver \person{Kurth} within four years, in his spare time. This means he needed around twice as much time. Of course, he programmed as volunteer developer, not as employee with eight work-hours per day.
   1.510  
   1.511 -Given the asumptions that an equal amount of code is to be produced, a third of existing code can be reused plus concepts and experience, and development speed is like \person{Kurth}'s. Then it would take about two years to have a redesigned new \masqmail\ with the same features. Less time could be needed if a simpler architecture allows faster develpement, better testing, and less bugs.
   1.512 -
   1.513 -
   1.514 -
   1.515 -
   1.516 +Given the asumptions that (1) an equal amount of code needs to be produced for a new \masqmail, (2) a third of existing code can be reused plus concepts and knowledge, and (3) development speed is like \person{Kurth}'s. Then it would take between two and three years to have a redesigned new \masqmail\ with the same features that \masqmail\ now has. Less time would be needed if a simpler architecture allows faster develpement, better testing, and less bugs.
   1.517  
   1.518  
   1.519  
   1.520 @@ -373,27 +378,32 @@
   1.521  
   1.522  \section{Result}
   1.523  
   1.524 -The most needed features, authentication and encryption, can be added to the current code base with changes only some areas. These changes should be made soon. Archiving of mail is another feature to add then. More complete logging coverage, reporting of unsafe environment, and fixing security flaws are quality improvements to do. All this work should be done on basis of the current code.
   1.525 +The most needed features---authentication and encryption---can be added to the current code base with changes in only few parts of the source. These changes should be made soon. Archiving of mail is another feature to add then. More complete logging coverage, reporting of unsafe environment, and fixing high risk security flaws are quality improvements to do. All this work should be done on basis of the current code.
   1.526  
   1.527 -The implementation of authentication and encryption are covered in the next chapter within this thesis.
   1.528 +All other work depends on how the plans for \masqmail's future look like.
   1.529  
   1.530 -All other work depends on how \masqmail's future plans look like.
   1.531 +What shall \masqmail\ be like, in, for instance, five years?
   1.532  
   1.533 -Now, how could \masqmail\ be like, in five years, for instance? Two ways of further development come to mind.
   1.534 +Two ways of further development come to mind.
   1.535  
   1.536 -First, stick to the old architecture and try to add features as possible. This approach needs less effort to be spent, because a working code is alreads present. Further development is only adding small increments to a exiting code base. But the further development goes, the larger is the work needed to add more functionality, and the more bugs will appear, caused by the increasing complexity. Quality of the software will decrease, because lacking of clear internal structure encourages further work to be quick fixes instead of requiring good solutions by design.
   1.537 +First, stick to the old architecture and try to add features as possible. This approach needs less effort to be spent, because a working code is alreads present. Further development is only adding small increments to a exiting code base. But the further development goes, the larger is the work needed to add more functionality, and the more bugs will appear, caused by the increasing complexity. Quality of the software will decrease, because lacking of clear internal structure encourages further work to be quick fixes rather than good solutions.
   1.538  
   1.539 -Second, designing \masqmail\ from scratch and rebuilding it. A lot of time and work is required to do so. Additionally, a new design from scratch introduces new risks: Is the design really better? Was thought of everything? Will there come problems not seeable now? Starting from scratch also means a step back. Against these disadvantages stands the gain of the new design: Further development will be easier and probably faster, overall quality will be better and easier to keep up, and dead ends for further development can be avoided.
   1.540 +Second, the way of designing \masqmail\ from scratch and rebuilding it. A lot of time and work is required to do this. Additionally, a new design from scratch introduces new risks: Is the design really better? Was thought of everything? Will there come problems not seeable now? Starting from scratch also means a step back. Against these disadvantages stands the gain from the new design: Further development will be easier and probably faster, overall quality will be better and easier to keep up, and dead ends for further development are better avoidable.
   1.541  
   1.542 -Finally, the decision for one of the ways depends on the question whether \masqmail\ should remain what it is, then the first option seems to be the right one to choose. Or \masqmail\ should become a modern \mta\ which is able to expand to include new functionality, then the second option is to choose.
   1.543 +Essentially, the decision for one of the ways depends on the question whether \masqmail\ should remain what it is, then the first option seems to be the right one to choose. Or whether \masqmail\ should become a modern \mta\ which is able to expand to include new functionality, then the second option is to choose.
   1.544  
   1.545 -Security, extendability, and the other quality properties appear to have crucial importance in this decision. If they are important for future versions of \masqmail, a new design is a must.
   1.546 +Security, extendability, and the other quality properties appear to have also crucial importance in this decision. If they are required for future versions of \masqmail, then a new design is a must.
   1.547  
   1.548 -\person{Graff} and \person{van Wyk} describe the situation best: ``[I]n today's world, your software is likely to have to operate in a very hostile security environment.'' \cite{graff03} An old-fashioned \mta\ depends, for sure, on a dieing branch, called \name{trusted envrironments}. And nothing other than a fresh and better design will help to survive.
   1.549 +\person{Graff} and \person{van Wyk} describe the situation well: ``[I]n today's world, your software is likely to have to operate in a very hostile security environment.'' \cite{graff03}. An old-fashioned \mta\ depends, for sure, on a dieing branch, called \name{trusted envrironments}. And nothing other than a fresh and better design will help to survive.
   1.550  
   1.551 -The suggested further development on \masqmail\ is: First add the most needed features, being authentication and encryption, to the current code base. This is the short time goal. Second---and this is the long time goal---design a new architecture that satisfies the requirements identified, especially the quality requirements. The implementation of this design shall then, after being usable and throughoutly tested, superseed the old \masqmail.
   1.552 +The suggested further development plan for \masqmail\ is:
   1.553 +\begin{enumerate}
   1.554 +\item The short time goal: Add the most needed features, being authentication and encryption, to the current code base. \item The long time goal: Design a new architecture that satisfies the requirements identified, especially the quality requirements. The implementation of this design shall then, after being usable and throughoutly tested, superseed the old \masqmail.
   1.555 +\end{enumerate}
   1.556  
   1.557 -This action is similar to the change from \sendmail\ to \name{sendmail X}/\name{MeTA1}, except the \sendmail\ change was too late. The plan is to first do the most needed stuff on the old design to make it still usable; then design a new version from scratch, for the future.
   1.558 +This plan is similar to the change from \sendmail\ to \name{sendmail X}/\name{MeTA1}, except the \sendmail\ change was much too late.
   1.559  
   1.560 -The following chapter \ref{chap:improvements} is about the work on the current code base, to reach the short time goals. The chapter afterwards, numbered \ref{chap:new-design}, then introduces a new, modern design for future versions of \masqmail.
   1.561 +The following chapter is about the work on the current code base, to reach the short time goals. The chapter afterwards then introduces a new, modern design for future versions of \masqmail.
   1.562  
   1.563 +
   1.564 +%The plan is to first do the most needed stuff on the old design to make it still usable; then design a new version from scratch, for the future.