docs/diploma

diff thesis/tex/4-MasqmailsFuture.tex @ 402:e57129f57faa

finished the indexing in a huge last effort
author meillo@marmaro.de
date Sun, 08 Feb 2009 22:51:42 +0100
parents 5254a119ad56
children f0fa40e30dfb
line diff
     1.1 --- a/thesis/tex/4-MasqmailsFuture.tex	Sat Feb 07 23:48:48 2009 +0100
     1.2 +++ b/thesis/tex/4-MasqmailsFuture.tex	Sun Feb 08 22:51:42 2009 +0100
     1.3 @@ -5,7 +5,7 @@
     1.4  
     1.5  
     1.6  \section{The goal}
     1.7 -\index{development goal}
     1.8 +\index{development!goal}
     1.9  
    1.10  Before requirements can be identified and further development can be discussed, it is important to clearly specify the goal to achieve. This means: What shall \masqmail\ be like in, for instance, five years?
    1.11  \index{masqmail!in five years}
    1.12 @@ -18,7 +18,7 @@
    1.13  \masqmail\ was intended to be a small ``real'' \MTA\ which covers the niche of managing the relay over several smart hosts. Small and resource friendly software is still important for workstations, home servers, and especially for embedded computers. Other software that focuses on the same niche is not known. Dial-up connections have become rare but mobile computers that move between different networks are popular. So, the niche is still present.
    1.14  
    1.15  What has changed in general is the security that is needed for software. \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[page~33]{graff03}. Additionally they say: ``By definition, mail software processes information from potentially untrusted sources. Therefore, mail software must be written with great care, even when it runs with user privileges and even when it does not talk directly to a network.'' \cite[page~90]{graff03}. As \masqmail\ is mail software and trusted environments become rare, it is best for \masqmail\ to become a secure \MTA.
    1.16 -\index{hostile environment}
    1.17 +\index{untrusted environment}
    1.18  \index{security}
    1.19  
    1.20  In summary, the goal for \masqmail\ is to stay in the current niche with respect to modern usage scenarios and to become a secure \MTA.
    1.21 @@ -55,9 +55,13 @@
    1.22  Outgoing mail is commonly either sent using \SMTP, piped into local commands (for example \path{uucp}), or delivered locally by appending to a mailbox. 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.23  \index{outgoing channels}
    1.24  \index{uucp}
    1.25 +\index{sendmail!sendmailx}
    1.26 +\index{pipe}
    1.27  
    1.28  Local mail delivery is a job that uses root privilege to be able to switch to any user in order to write to his mailbox. It is possible to deliver without being root privilege, but delivery to user's home folders is not generally possible then. Thus even the modular \MTA{}s \qmail\ and \postfix\ use root privilege for this job. As mail delivery to local users is \emph{not} included in the basic job of an \MTA{} and introduces a lot of new complexity, why should the \MTA\ bother? In order to keep the system simple, reduce privilege, and to have programs that do one job well, the local delivery job should be handed over to a specialist: the \NAME{MDA}. \NAME{MDA}s know about the various mailbox formats and are aware of the problems of concurrent write access and the like. Hence passing the message, and the responsibility for it, over to an \NAME{MDA} seems to be best.
    1.29  \index{local delivery}
    1.30 +\index{mda}
    1.31 +\index{root privilege}
    1.32  
    1.33  This means an outgoing connection that pipes mail into local commands is required. To other outgoing channels applies what was already said about incoming channels.
    1.34  
    1.35 @@ -66,7 +70,6 @@
    1.36  		\includegraphics[scale=0.75]{fig/mta-channels.eps}
    1.37  	\end{center}
    1.38  	\caption{Required incoming and outgoing channels}
    1.39 -	\index{figure!Required incoming and outgoing channels}
    1.40  	\label{fig:mta-channels}
    1.41  \end{figure}
    1.42  
    1.43 @@ -81,20 +84,22 @@
    1.44  \label{rf2}
    1.45  \index{mail queue}
    1.46  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 intended 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.
    1.47 -\index{forwarder}
    1.48 -\index{non-permanent}
    1.49 +\index{relay-only mta}
    1.50 +\index{non-permanent online connection}
    1.51  
    1.52 -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 mail loss. An \MTA\ takes over responsibility for mail by 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.53 +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 mail loss. An \MTA\ takes over responsibility for mail by accepting it, hence losing 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.54 +\index{smtp!responsibility}
    1.55  \index{reliability}
    1.56 +\index{mail loss}
    1.57  
    1.58  
    1.59  
    1.60  
    1.61  \paragraph{\RF\,3: Header sanitizing}
    1.62  \label{rf3}
    1.63 -\index{header sanitizing}
    1.64 +\index{mail sanitizing}
    1.65  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.66 -\index{masqmail!online routes}
    1.67 +\index{online routes}
    1.68  
    1.69  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 recipients lead to multiple different envelopes, all containing the same mail message.
    1.70  
    1.71 @@ -103,7 +108,7 @@
    1.72  
    1.73  \paragraph{\RF\,4: Aliasing}
    1.74  \label{rf4}
    1.75 -\index{aliases}
    1.76 +\index{alias expansion}
    1.77  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 of 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 recipient's domain part may require a different route to be used.
    1.78  
    1.79  
    1.80 @@ -125,7 +130,8 @@
    1.81  \index{open relay}
    1.82  \index{spam}
    1.83  
    1.84 -Several ways to restrict access are available. The most simple one is restriction by the \NAME{IP} address. No extra complexity is added this way but the \NAME{IP} addresses need to be static or within known ranges. This approach is often used to allow relaying for local nets. The access check can be done by the \MTA\ or by a guard (e.g.\ \NAME{TCP} \name{Wrappers} \cite{venema92}) before. The main advantage here is the minimal setup and maintenance work needed. This kind of access restriction is important to be implemented.
    1.85 +Several ways to restrict access are available. The most simple one is restriction by the \NAME{IP} address. No extra complexity is added this way but the \NAME{IP} addresses need to be static or within known ranges. This approach is often used to allow relaying for local nets. The access check can be done by the \MTA\ or by a guard (e.g.\ \NAME{TCP} \name{Wrapper} \cite{venema92}) before. The main advantage here is the minimal setup and maintenance work needed. This kind of access restriction is important to be implemented.
    1.86 +\index{tcp wrapper}
    1.87  \index{access restriction}
    1.88  
    1.89  This authentication based on \NAME{IP} addresses is impossible in situations where hosts with changing \NAME{IP} addresses, that are not part of a known sub net, need access. Then a authentication mechanism based on some \emph{secret} is required. Three common approaches exist:
    1.90 @@ -155,22 +161,21 @@
    1.91  \label{requirement-encryption}
    1.92  \index{enc}
    1.93  Electronic mail is vulnerable to sniffing attacks, because in generic \SMTP\ all data transfer is unencrypted. The message's body, the header, and the envelope are all unencrypted. But also some authentication dialogs transfer plain text passwords (e.g.\ \NAME{PLAIN} and \NAME{LOGIN}). Hence encryption is throughout important.
    1.94 -\index{auth}
    1.95 +\index{plain text}
    1.96  
    1.97  The common way to encrypt \SMTP\ dialogs is using \name{Transport Layer Security} (short: \NAME{TLS}, the successor of \NAME{SSL}). \NAME{TLS} encrypts the datagrams of the \name{transport layer}. This means it works below the application protocols and can be used with any of them \citeweb{wikipedia:tls}.
    1.98  \index{tls}
    1.99 -\index{ssl}
   1.100  
   1.101  Using secure tunnels that are provided by external programs should be preferred over including encryption into the application, because the application needs not to bother with encryption then. Outgoing \SMTP\ connections can get encrypted using a secure tunnel, created by an external application (like \name{openssl}). But incoming connections can not use external secure tunnels, because the remote \NAME{IP} address is hidden then; all connections would appear to come from localhost instead. Figure~\ref{fig:stunnel} depicts the situation of using an application like \name{stunnel} for incoming connections. The connection to port 25 comes from localhost and this information reaches the \MTA. Authentication based on \NAME{IP} addresses and many spam prevention methods are useless then.
   1.102  \index{secure tunnel}
   1.103  \index{stunnel}
   1.104 +\index{openssl}
   1.105  
   1.106  \begin{figure}
   1.107  	\begin{center}
   1.108  		\includegraphics[scale=0.75]{fig/stunnel.eps}
   1.109  	\end{center}
   1.110  	\caption{Using \name{stunnel} for incoming connections}
   1.111 -	\index{figure!Using \name{stunnel} for incoming connections}
   1.112  	\label{fig:stunnel}
   1.113  \end{figure}
   1.114  
   1.115 @@ -179,6 +184,7 @@
   1.116  \index{starttls}
   1.117  
   1.118  \NAME{STARTTLS}---defined in \RFC\,2487---is what \RFC\,3207 recommends to use for secure \SMTP. The connection then goes over port 25, but gets encrypted when the \NAME{STARTTLS} keyword is issued. Email depends on compatibility---only encryption methods that client and server support can be used. Hence it is best to act after the recommendations of the \RFC\ documents. This means \NAME{STARTTLS} encryption should be supported for incoming and for outgoing connections.
   1.119 +\index{rfc}
   1.120  
   1.121  
   1.122  
   1.123 @@ -195,7 +201,7 @@
   1.124  Spam is usually identified by the results of a set of checks. Static rules, database querying (e.g.\ \NAME{DNS} blacklists \cite{cole07} \cite{levine08}), requesting special client behavior (e.g.\ \name{greylisting} \cite{harris03}, \name{hashcash} \cite{back02}), or statistical analysis (e.g.\ \name{bayesian filters} \cite{graham02}) are checks that may be used. Running more checks leads to better results, but takes more system resources and more time.
   1.125  \index{dns blacklist}
   1.126  \index{greylisting}
   1.127 -\index{hashcash}
   1.128 +\index{Hashcash}
   1.129  \index{bayesian filter}
   1.130  
   1.131  Doing some basic checks during the \SMTP\ dialog seems to be a must \cite[page~25]{eisentraut05}. Including these checks into the \MTA\ makes them fast to avoid \SMTP\ dialog timeouts. For modularity and reusability reasons internal interfaces to specialized modules seem to be best. \person{Raymond} says: ``Modularity (simple parts, clean interfaces) is a way to organize programs to make them simpler.'' \cite[chapter~1]{raymond03}.
   1.132 @@ -215,6 +221,7 @@
   1.133  
   1.134  In any way should malware checking be performed by external programs that may be invoked by the \MTA. However, \NAME{MDA}s are better points to invoke content scanners.
   1.135  \index{content scanner}
   1.136 +\index{mda}
   1.137  
   1.138  A popular email filter framework is \name{amavis} which integrates various spam and malware scanners. The common setup includes a receiving \MTA\ which sends mail to \name{amavis} using \SMTP, \name{amavis} processes the mail and sends it then to a second \MTA\ that does the outgoing transfer. (This setup with two \MTA\ instances is discussed in more detail in section~\ref{sec:current-code-security}.)
   1.139  
   1.140 @@ -224,10 +231,13 @@
   1.141  \label{rf10}
   1.142  \index{archiving}
   1.143  Mail archiving and auditability become more important as email establishes as technology for serious business communication. Archiving is a must for companies in many countries. In the United States, the \name{Sarbanes-Oxley Act} \cite{sox} covers this topic.
   1.144 +\index{Sarbanes-Oxley Act}
   1.145  
   1.146  It is a goal to have the ability to archive verbatim copies of every mail coming into and every mail going out of the system, with relation between them.
   1.147  
   1.148  \postfix\ for example has a \name{always\_bcc} feature, to send a copy of every outgoing mail to a definable recipient. At least this functionality should be given, although a more complete approach, like \qmail\ provides, is preferable. \qmail\ is able to save copies of all sent and received messages and additionally complete \SMTP\ dialogs \cite[page~12]{sill02}.
   1.149 +\index{postfix}
   1.150 +\index{qmail}
   1.151  \index{smtp!dialog}
   1.152  
   1.153  But if archiving is of high importance, a dedicated archiving solution is advisable, anyway.
   1.154 @@ -248,22 +258,26 @@
   1.155  
   1.156  \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 be able to break \masqmail.
   1.157  \index{masqmail!security}
   1.158 +\index{non-permanent online connection}
   1.159  
   1.160  
   1.161  \paragraph{\RG\,2: Reliability}
   1.162  \index{reliability}
   1.163  Reliability is the second essential quality property for an \MTA. Mail for which the \MTA\ took responsibility must never get lost while it is within the \MTA's responsibility. The \MTA\ must not be \emph{the cause} of any mail loss, no matter what happens. Unreliable \MTA{}s are of no value. However, as the mail transport infrastructure is a distributed system, one of the communication partners or the transport medium may crash at any time during mail transfer. Thus reliability is needed for mail transfer communication, too.
   1.164 +\index{smtp!responsibility}
   1.165  \index{mail loss}
   1.166  
   1.167  The goal is to transfer exactly one copy of the message. \person{Tanenbaum} evaluates the situation and comes to the conclusion that ``in general, there is no way to arrange this.'' \cite[pages~377--379]{tanenbaum02}. Only strategies where no mail gets lost are acceptable; he identifies three of them, but one generates more duplicates than the others, so two strategies remain. (1) The client always reissues the transfer. The server first sends an acknowledgment and then handles the transfer. (2) The client reissues the transfer only if no acknowledgment was received. The server first handles the transfer and sends the acknowledgment afterwards. The first strategy does not need acknowledgments at all, however, it will lose mail if the second transfer fails, too.
   1.168  
   1.169  Hence, mail transfer between two processes should use the strategy: The client reissues if it receives no acknowledgment. The server first handles the message and then sends the acknowledgment. This strategy only leads to duplicates if a crash happens in the time between the message is fully transferred to the server and the acknowledgment is received by the client. No mail will get lost.
   1.170 -\index{duplicates}
   1.171 +\index{duplicates of messages}
   1.172  
   1.173  
   1.174  \paragraph{\RG\,3: Robustness}
   1.175  \index{robustness}
   1.176  Being robust means handling errors properly. Small errors may get corrected, large errors may kill a process. Killed processes should get 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.177 +\index{robustness!rule of}
   1.178 +\index{repair!rule of}
   1.179  
   1.180  
   1.181  \paragraph{\RG\,4: Extendability}
   1.182 @@ -292,31 +306,35 @@
   1.183  \paragraph{\RG\,8: Availability}
   1.184  \index{availability}
   1.185  Availability is important for server programs. They must stay operational by blocking \name{denial of service} attacks and the like. Automated restarts into a clean state after fatal errors are also required.
   1.186 +\index{denial of service attack}
   1.187  
   1.188  
   1.189  \paragraph{\RG\,9: Portability}
   1.190  \index{portability}
   1.191  Source code that compiles and runs on various operation 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{Kernighan} and \person{Pike} \cite{kernighan99}. Portable code lets software spread faster. Portability among the various flavors of Unix systems is a goal for \masqmail, because these systems are the ones \MTA{}s usually run on. No special care needs to be taken for non-Unix platforms.
   1.192 +\index{Unix}
   1.193  
   1.194  
   1.195  
   1.196  \paragraph{\RG\,10: Usability}
   1.197  \index{usability}
   1.198  Usability, not mentioned by \person{Hafiz} \cite{hafiz05} (he focuses on architecture) but by \person{Spinellis} \cite{spinellis06} and \person{Kan} \cite{kan03}, is a property which is 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; 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 the focus should be on the most common form of configuration: choosing one of several common setups.
   1.199 +\index{configuration}
   1.200  
   1.201  
   1.202  
   1.203  
   1.204  \subsection{Architecture}
   1.205  \label{sec:discussion-mta-arch}
   1.206 -\index{architecture}
   1.207 +\index{mta!architecture}
   1.208  
   1.209  \masqmail's current architecture is monolithic 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 interface for authentication ``modules''. \sendmail\ provides now, with its \name{milter} interface, standardized connection channels to external modules. \masqmail\ has none of them---it is what \sendmail\ was in the beginning: a single large block.
   1.210 +\index{sendmail}
   1.211 +\index{exim}
   1.212  \index{milter}
   1.213  \index{masqmail!architecture}
   1.214  
   1.215  Figure~\ref{fig:masqmail-arch} is a call graph generated from \masqmail's source code. It gives an impression of how interweaved the internals are. There are no compartments at all.
   1.216 -\index{masqmail!call graph}
   1.217  \index{call graph}
   1.218  
   1.219  \begin{figure}
   1.220 @@ -325,25 +343,34 @@
   1.221  		\includegraphics[scale=0.75]{fig/callgraph.eps}
   1.222  	\end{center}
   1.223  	\caption{Internal structure of \masqmail, showed by a call graph. (Logging functions are ignored; test and \NAME{POP3} code is excluded.)}
   1.224 -	\index{figure!Internal structure of \masqmail.}
   1.225  	\label{fig:masqmail-arch}
   1.226  \end{figure}
   1.227  
   1.228  \sendmail\ improved its old architecture by adding the milter interface, to include further functionality by invoking 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.229 +\index{sendmail}
   1.230 +\index{postfix}
   1.231 +\index{qmail}
   1.232 +\index{exim}
   1.233 +\index{sendmail!sendmailx}
   1.234 +\index{sendmail!meta1}
   1.235  \index{security}
   1.236  
   1.237  Every one of these programs is more modular, or became more modular over time, than \masqmail\ is. Modern requirements like spam protection and probable future requirements like 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 engineering is to build systems that are as simple as possible.'' \cite[page 45]{graff03}.
   1.238  \index{modularity}
   1.239  
   1.240  \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.241 +\index{qmail}
   1.242  \index{compartmentalization}
   1.243  
   1.244  \begin{quote}
   1.245  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.246  \hfill\cite[page 64]{hafiz05}
   1.247  \end{quote}
   1.248 +\index{sendmail}
   1.249 +\index{qmail}
   1.250  
   1.251  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.252 +\index{postfix}
   1.253  \index{modularity}
   1.254  
   1.255  Modularity is also needed to satisfy modern \MTA\ requirements in providing a clear interface to add functionality without increasing the overall complexity much.
   1.256 @@ -380,12 +407,13 @@
   1.257  One single mail queue is used in \masqmail. It satisfies all current requirements.
   1.258  
   1.259  \paragraph{\RF\,3: Header sanitizing}
   1.260 -\index{header sanitizing}
   1.261 +\index{mail sanitizing}
   1.262  The envelope and mail headers are generated when the mail is put into the queue. The requirements are fulfilled.
   1.263  
   1.264  \paragraph{\RF\,4: Aliasing}
   1.265 -\index{aliases}
   1.266 -Aliasing is done on delivery. All common kinds of aliases in the global aliases file are supported. So called \name{.forward} aliasing is not supported, but this is less common and seldom used.
   1.267 +\index{alias expansion}
   1.268 +Alias expansion is done on delivery. All common kinds of aliases in the global aliases file are supported. So called \name{.forward} aliasing is not supported, but this is less common and seldom used.
   1.269 +\index{alias expansion!.forward}
   1.270  
   1.271  \paragraph{\RF\,5: Route management}
   1.272  \index{online routes}
   1.273 @@ -394,6 +422,7 @@
   1.274  \paragraph{\RF\,6: Authentication}
   1.275  \index{auth}
   1.276  Static authentication, based on \NAME{IP} addresses, can be achieved with \person{Venema}'s \NAME{TCP} \name{Wrapper} \cite{venema92}, by editing the \path{hosts.allow} and \path{hosts.deny} files. This is only relevant to authenticate hosts that try to submit mail into the system. Dynamic (secret-based) \SMTP\ authentication is already supported in form of \NAME{SMTP-AUTH} and \SMTP-after-\NAME{POP}, but only for outgoing connections. For incoming connections only address-based authentication is supported.
   1.277 +\index{tcp wrapper}
   1.278  \index{auth!smtp-after-pop}
   1.279  \index{auth!smtp-auth}
   1.280  
   1.281 @@ -401,10 +430,14 @@
   1.282  \index{enc}
   1.283  Similar is the situation for encryption which is also only available for outgoing channels; here a tunnel application, like \name{openssl}, is needed. A secure tunnel can be created to send mail trough. State-of-the-art, however, is using \NAME{STARTTLS}, but this is not supported. For incoming channels, no encryption is available. The only possible setup to provide encryption of incoming channels is using an application like \name{stunnel} to crypt between the secure connection to the remote host and the plain connection to the \MTA. Unfortunately, this suffers from the problem explained on page \pageref{fig:stunnel} in figure~\ref{fig:stunnel}. Anyway, it would still be no \NAME{STARTTLS} support.
   1.284  \index{secure tunnel}
   1.285 +\index{stunnel}
   1.286 +\index{starttls}
   1.287 +\index{openssl}
   1.288  
   1.289  \paragraph{\RF\,8: Spam handling}
   1.290  \index{spam!handling}
   1.291  \masqmail\ does not provide special support for spam filtering. Spam prevention by not accepting spam during the \SMTP\ dialog is not possible at all. Spam filtering is only possible by using two \masqmail\ instances with an external spam filter in between. The mail flow is from the receiving \MTA\ instance, which accepts mail, to the filter application that processes and possible modifies it, to the second \MTA\ which is responsible for further delivery of the mail. This is a concept that works in general, and it is good to separate different work with clear interfaces. But the need of two instances of the same \MTA, with doubled setup, makes it rather a work-around. Better is to have this data flow respected in the \MTA\ design, like it was done in \postfix. Anyway, the more important part of spam handling, for sure, is done during the \SMTP\ dialog by completely refusing unwanted mail.
   1.292 +\index{postfix}
   1.293  
   1.294  \paragraph{\RF\,9: Malware handling}
   1.295  \index{malware!handling}
   1.296 @@ -418,7 +451,8 @@
   1.297  
   1.298  \paragraph{\RG\,1: Security}
   1.299  \index{security}
   1.300 -\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 attacks. In environments where untrusted components or persons have access to \masqmail, its security is too low. Its author states that \masqmail\ ``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, a security report that confirms \masqmail's security level is missing.
   1.301 +\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 attacks. In environments where untrusted components or persons have access to \masqmail, its security is too low. Its author states that \masqmail\ ``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, a security report that confirms \masqmail's security level is missing.
   1.302 +\index{denial of service attack}
   1.303  \index{masqmail!security}
   1.304  
   1.305  \masqmail\ uses conditional compilation to exclude unneeded functionality from the executable at compile time. Excluding code means excluding all bugs and weaknesses within this code, too. Excluding unused code is a good concept to improve security.
   1.306 @@ -443,10 +477,13 @@
   1.307  \paragraph{\RG\,4: Extendability}
   1.308  \index{extendability}
   1.309  \masqmail's extendability is very poor. This is a general problem of monolithic software, but can though be provided with high effort. \exim\ is an example for good extendability in a monolithic program.
   1.310 +\index{exim}
   1.311  
   1.312  \paragraph{\RG\,5: Maintainability}
   1.313  \index{maintainability}
   1.314  The maintainability of \masqmail\ is equivalent to other software of similar kind. Missing modularity and therefore more complexity makes the maintainer's work harder. Conditional compilation might be good for security, but \name{ifdef}s scattered throughout the source code is a pain for maintenance. In summary is \masqmail's maintainability bearable, like in average Free Software projects.
   1.315 +\index{Free Software projects}
   1.316 +\index{conditional compilation}
   1.317  
   1.318  
   1.319  
   1.320 @@ -469,13 +506,17 @@
   1.321  \paragraph{\RG\,9: Portability}
   1.322  \index{portability}
   1.323  The code's portability is good with view on Unix-like operation systems. At least \name{Debian}, \name{Red Hat}, \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. Thus, the portability is already good.
   1.324 -\index{masqmail!supported systems}
   1.325 +\index{bsd}
   1.326 +\index{Unix}
   1.327 +\index{masqmail}
   1.328  
   1.329  
   1.330  \paragraph{\RG\,10: Usability}
   1.331  \index{usability}
   1.332  The usability is very good, from the administrator's point of view. \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 \MUA. Configuration could be eased even more by providing configuration generators that enable \masqmail\ to be used 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.333  \index{out-of-the-box usage}
   1.334 +\index{configuration}
   1.335 +\index{mua}
   1.336  
   1.337  
   1.338  
   1.339 @@ -490,14 +531,12 @@
   1.340  		\input{tbl/requirements.tbl}
   1.341  	\end{center}
   1.342  	\caption{Importance of and pending work for requirements}
   1.343 -	\index{table!Importance of and pending work for requirements}
   1.344  	\label{tab:requirements}
   1.345  \end{table}
   1.346  
   1.347  The importance is ranked from `-{}-' (not important) to `++' (very important). The pending work is ranked from `-{}-' (nothing) to `++' (very much). Large work tasks with high importance need to receive much attention, they need to be in focus. In contrast should small, low importance work tasks receive few attention. Here the focus for a task is calculated by summing up the importance and the pending work with equal weight. Normally, tasks with high focus are the ones of high priority and should be done first.
   1.348  
   1.349  The functional requirements that receive highest attention are \RF\,6 (authentication), \RF\,7 (encryption), and \RF\,8 (spam handling). Of the non-functional requirements, \RG\,1 (security), \RG\,2 (reliability), and \RG\,4 (extendability), rank highest.
   1.350 -\index{requirements!ranking}
   1.351  
   1.352  These tasks are presented in more detail in a todo list, now. The list is sorted by focus and then by importance.
   1.353  
   1.354 @@ -505,6 +544,7 @@
   1.355  \subsubsection*{\TODO\,1: Encryption (\RF\,7)}
   1.356  \index{enc}
   1.357  Encryption is chosen for number one as it is essential to provide privacy. Using \NAME{STARTTLS} for encryption is definitely needed and should be added first; encrypted data transfer is hardly possible without support for it.
   1.358 +\index{starttls}
   1.359  
   1.360  
   1.361  \subsubsection*{\TODO\,2: Authentication (\RF\,6)}
   1.362 @@ -544,7 +584,7 @@
   1.363  
   1.364  
   1.365  \section{Ways for further development}
   1.366 -\index{development strategies}
   1.367 +\index{development!strategy}
   1.368  
   1.369  Knowing what needs to be done is only one part, the other is deciding \emph{how} to do it by focusing on a global development strategy.
   1.370  
   1.371 @@ -572,7 +612,6 @@
   1.372  		\input{tbl/strategies.tbl}
   1.373  	\end{center}
   1.374  	\caption{Development strategies and their suitability for requirements}
   1.375 -	\index{figure!Development strategies and their suitability for requirements}
   1.376  	\label{tab:strategies}
   1.377  \end{table}
   1.378  
   1.379 @@ -628,16 +667,17 @@
   1.380  
   1.381  
   1.382  \subsubsection*{Effort estimation}
   1.383 -\index{effort estimation}
   1.384 +\index{development!work effort}
   1.385  
   1.386  Although a strategy might lead to the best result, one may choose another one if the required effort is too high. The effort for a redesign and rebuild is estimated now.
   1.387  
   1.388  \person{Wheeler}'s program \name{sloccount} calculates following estimations for \masqmail's code base as of version 0.2.21 (excluding library code):
   1.389 -\index{masqmail!development effort}
   1.390 +\index{lines of code}
   1.391  
   1.392  \codeinput{input/masqmail-sloccount.txt}
   1.393  
   1.394  The development costs in money are not relevant for a Free Software project with volunteer developers, but the development time is. About 24 man-months are estimated. The current code base was written almost completely by \person{Oliver Kurth} within four years in his spare time. This means he needed around twice as much time. Of course, he programmed as a volunteer developer not as an employee with eight work-hours per day.
   1.395 +\index{Free Software projects}
   1.396  
   1.397  Given the assumptions that (1) an equal amount of code needs to be produced for a new designed \masqmail, (2) a third of the 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 for one programmer to produce a redesigned new \masqmail\ with the same features that \masqmail\ now has. Less time would be needed if a simpler architecture allows faster development, better testing, and less bugs. Of course, more developers would speed it up, too.
   1.398  
   1.399 @@ -645,7 +685,7 @@
   1.400  
   1.401  
   1.402  \subsubsection*{Risks}
   1.403 -\index{risks}
   1.404 +\index{development!risks}
   1.405  
   1.406  The gained result of a new design might still outweigh the development effort. But risks are something more to consider.
   1.407  
   1.408 @@ -674,16 +714,18 @@
   1.409  
   1.410  
   1.411  \subsubsection*{Repairing}
   1.412 -\index{reparing}
   1.413 +\index{repair}
   1.414  
   1.415  Besides these advantages of existing code, one must not forget that further work on it is often repair work. Small bug fixes are not the problem, but adding something for which the software originally was not designed, will cause problems. Such work often destroys the clear concepts of the software, especially in interweaved monolithic code.
   1.416  
   1.417  \person{Doug McIlroy}, a person with important influence on Unix especially by inventing the Unix pipe, demands: ``To do a new job, build afresh rather than complicate old programs by adding new features.'' \cite{mcilroy78}.
   1.418 +\index{pipe}
   1.419 +\index{Unix}
   1.420  
   1.421  Repair strategies are useful, but only in the short-time view and in times of trouble. If the future is bright, however, one does best by investing into a software. As shown in section~\ref{sec:market-analysis-conclusion}, the future for \MTA{}s is bright. This means it is time to invest into a redesign with the intension to build up a more modern product.
   1.422  
   1.423  In the author's view is \masqmail\ already needing this redesign since about 2003 when the old design was still quite suitable \dots\ it already delayed too long.
   1.424 -\index{masqmail!redesign}
   1.425 +\index{masqmail!new design}
   1.426  
   1.427  %Clinging to much to existing code will be no help, it is an indicator for fear. Having the courage to through bad code away to make it better, shows the view forward.
   1.428  
   1.429 @@ -695,11 +737,13 @@
   1.430  
   1.431  
   1.432  \subsubsection*{A guard against dead ends}
   1.433 -\index{dead ends}
   1.434 +\index{development!dead end}
   1.435  
   1.436  A new design does protect against such dead ends.
   1.437  
   1.438  Changing requirements are one possible dead end if the software does not evolve with them. A famous example is \sendmail; it had an almost monopoly for a long time. But when security became important, \sendmail\ was only repaired instead of the problem sources---its insecure design---would have been removed. Thus security problems reappeared and over the years \sendmail's market share shrank as more secure \MTA{}s became available. \sendmail's reaction to the new requirements, in form of \name{sendmail~X} and \name{MeTA1}, came much to late---the users already switched to other \MTA{}s.
   1.439 +\index{sendmail!sendmailx}
   1.440 +\index{sendmail!meta1}
   1.441  \index{sendmail}
   1.442  
   1.443  Redesigning a software as requirements change helps keeping it alive.
   1.444 @@ -708,7 +752,9 @@
   1.445  The knowledge of \person{Heraclitus}, a Greek philosopher, shall be an inspriation: ``Nothing endures but change.''
   1.446  
   1.447  Another danger is the dead end of complexity which is likely to appear by constant work on the same code base. It is even more likely if the code base has a monolithic architecture. A good example for simplicity is \qmail\ which consists of small independent modules, each with only about one thousand lines of code. Such simple code makes it obvious to understand what it does. The \name{suckless} project \citeweb{suckless.org} for example advertises such a philosophy of small and simple software by following the thoughts of the Unix inventors \cite{kernighan84} \cite{kernighan99}. Simple, small, and clear code avoids complexity and is thus also a strong prerequisite for security.
   1.448 -\index{suckless}
   1.449 +\index{qmail}
   1.450 +\index{suckless software}
   1.451 +\index{Unix}
   1.452  
   1.453  
   1.454  
   1.455 @@ -720,6 +766,7 @@
   1.456  The avoidance of dead ends is essential for further development on current code, too. Hence it is mandatory to refactor the existing code base sooner or later. Most important is the intention to modularize it, as modularity improves many quality properties, eases further development, and essentially improves security.
   1.457  
   1.458  One example how modular structure makes it easy to add further functionality is described by \person{Sill}: He says that integrating the \name{amavis} filter framework into the \qmail\ system can be done by simply renaming the \path{qmail-queue} module to \path{qmail-queue-real} and then renaming the \path{amavis} executable to \path{qmail-queue} \cite[section~12.7.1]{sill02}. Nothing more in the \qmail\ system needs to be changed. This is a very admirable ability which is only possible in a modular system that consists of independent executables.
   1.459 +\index{qmail}
   1.460  \index{modularity}
   1.461  
   1.462  This thesis showed several times that modularity is a key property for good software design. Modularity can hardly be retrofitted into software, hence development on base of current code will need a throughout restructuring too, to modularize the source code. Thus a new design is similar to such a throughout refactoring, except the dependence on current code.
   1.463 @@ -737,6 +784,7 @@
   1.464  This classifies current code to be better suited for adding functionality, and a new design to be better suited for quality improvements. Both strategies need to improve function as well as quality, however, the focus of the strategy is determined by this difference.
   1.465  
   1.466  Easier work is likely to be done earlier in Free Software projects than hard work. Thus, by choosing S\,1+2 volunteer developers tend to implement function first and delay quality improvements, no matter what the suggested order of the work tasks is. S\,3, in contrast, would benefit early quality improvements and later function improvements. This is real-life experience from Free Software development.
   1.467 +\index{Free Software projects}
   1.468  
   1.469  
   1.470  
   1.471 @@ -776,9 +824,9 @@
   1.472  
   1.473  
   1.474  \subsubsection*{Good software, good feelings}
   1.475 -\index{good feeling}
   1.476  
   1.477  One last argument shall be added. This one is more common to Free Software but can also be found in non-free software.
   1.478 +\index{Free Software}
   1.479  
   1.480  Free Software ``sells'' if it has a good user base. For example: Although \qmail\ is somehow outdated and its author has not released any new version since about ten years, \qmail\ still has a very strong user base and community.
   1.481  \index{qmail}
   1.482 @@ -786,7 +834,7 @@
   1.483  Good concepts, sound design, and a sane philosophy gives users good feelings for the software and faith in it. They become interested in using it and to contribute. In contrast do constant repaire work and reappearance of weaknesses leave a bad feeling.
   1.484  
   1.485  The motivation of most volunteer developers is their wish to do good work with the goal to create good software. Projects that follow admirable plans towards a good product will motivate volunteers to help. More helpers can get the 2,5 man-years for a new design in less absolute time done. Additionally is a good developers base the best start for a good user base, and users define a software's value.
   1.486 -\index{motivation}
   1.487 +\index{development!motivation}
   1.488  
   1.489  
   1.490  
   1.491 @@ -802,7 +850,7 @@
   1.492  Strategy 3 (A new design) is slightly preferred over the combination of strategy 1 (Improve existing code) and 2 (Add wrappers and interposition filters), from the requirement's point of view.
   1.493  
   1.494  The discussion afterwards did generally support the new design strategy. But some arguments stood against it. These were:
   1.495 -\index{development strategy}
   1.496 +\index{development!strategy}
   1.497  
   1.498  \begin{enumerate}
   1.499  	\item The development time and effort
   1.500 @@ -816,7 +864,7 @@
   1.501  
   1.502  
   1.503  With respect to the current situation, the suggested further development plan for \masqmail\ is split into a short-time plan and a long-time plan:
   1.504 -\index{development goal}
   1.505 +\index{development!goal}
   1.506  
   1.507  \begin{enumerate}
   1.508  	\item The short-time plan: Add the most needed features, namely encryption, authentication, and security wrappers, to the current code base.
   1.509 @@ -828,6 +876,6 @@
   1.510  The basics of this development idea can be described as: Recurrent development of a new design from scratch, while the old version is still in use and gets repaired.
   1.511  
   1.512  Hence a modern design will inherit an old one in periodic intervals. This is a very future-proof concept that combines the best of short-term and long-term planning. The price to pay is only the increased work, which gets covered by volunteers that \emph{want} to do it.
   1.513 -\index{motivation}
   1.514 +\index{development!motivation}
   1.515  
   1.516