docs/diploma

changeset 293:b4293d0b7062

much much work in ch04! especially for strategy discussion
author meillo@marmaro.de
date Sat, 17 Jan 2009 22:34:14 +0100
parents 83b0f64c0fc6
children 975769c6c5a5
files thesis/tex/4-MasqmailsFuture.tex
diffstat 1 files changed, 167 insertions(+), 109 deletions(-) [+]
line diff
     1.1 --- a/thesis/tex/4-MasqmailsFuture.tex	Sat Jan 17 17:21:06 2009 +0100
     1.2 +++ b/thesis/tex/4-MasqmailsFuture.tex	Sat Jan 17 22:34:14 2009 +0100
     1.3 @@ -5,17 +5,17 @@
     1.4  
     1.5  \section{The goal}
     1.6  
     1.7 -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.8 +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.9  
    1.10 -Should \masqmail\ become more specific to a more narrow niche, or rather become more general and move a bit out of its niche? Or should it even become a totally general \MTA, like \sendmail, \exim, \qmail, and \postfix\ are?
    1.11 +Should \masqmail\ become more specific to a more narrow niche or rather become more general and move a bit out of its niche? Or should it even become a totally general \MTA\ like \sendmail, \exim, \qmail, and \postfix?
    1.12  
    1.13 -Becoming completely general seems to be no choice because the competitors are too many and they are already too strong. It would require a strong base of developers and superior features to the competitors. There seems to be no need for another general purpose \MTA\ amoung those four programs. Thus it would most likely remain a try. \person{Venema} stated ``It is becoming less and less likely that someone will write another full-featured Postfix or Sendmail \MTA\ \emph{from scratch} (100 kloc).'' \cite{venema:postfix-growth}. At least \masqmail\ is not going to try that.
    1.14 +Becoming completely general seems to be no choice because the competitors are too many and they are already too strong. It would require a strong base of developers and superior features to establish. There seems to be no need for another general purpose \MTA\ additional to those four programs. Thus the effort would most likely die a try. \person{Venema} stated ``It is becoming less and less likely that someone will write another full-featured Postfix or Sendmail \MTA\ \emph{from scratch} (100 kloc).'' \cite{venema:postfix-growth}. At least \masqmail\ is not going to try that.
    1.15  
    1.16 -\masqmail\ was intended to be small and to cover the niche of managing 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 niche of managing relay over several smart hosts is not known. Dial-up connections have become rare but mobile computers moving between different networks are popular. So, the niche is still present.
    1.17 +\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.18  
    1.19  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.'' 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~33, page~90]{graff03}. As \masqmail\ is mail software and trusted environments become rare, it is best for \masqmail\ to become a secure \MTA.
    1.20  
    1.21 -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.22 +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.23  
    1.24  
    1.25  
    1.26 @@ -155,11 +155,11 @@
    1.27  
    1.28  
    1.29  \paragraph{\RF10: Archiving}
    1.30 -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.31 +Mail archiving and auditability become more important as email establishes as technology for serious business communication. It is also a must for companies in many countries. << SOX >> %fixme: cite SOX
    1.32 +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.33  
    1.34  \postfix\ for example has a \texttt{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.35  
    1.36 -<< refer to SOX >> %fixme
    1.37  
    1.38  
    1.39  
    1.40 @@ -172,7 +172,9 @@
    1.41  
    1.42  
    1.43  \paragraph{\RG1: Security}
    1.44 -\MTA{}s are critical points for computer security, as they are accessible from external networks. They must be secured with high effort. Properties like the need for high privilege level, from outside influenced work load, work on unsafe data, and demand for reliability, increase the need for security. This is best done by modularization, also called \name{compartementalization}, as described in section \ref{sec:discussion-mta-arch}. \masqmail\ needs to be secure enough for its target field of operation. \masqmail\ is targeted to workstations and private networks, with explicit warning to not use it on permanent online hosts \citeweb{masqmail:homepage2}. But as non-permanent online connections and trustable environments become rare, \masqmail's security should be so good, that it is usable with permanent online connections and in unsafe environments. For example should mails with bad content not break \masqmail.
    1.45 +\MTA{}s are critical points for computer security, as they are accessible from external networks. They must be secured with high effort. Properties like the need for high privilege level, from outside influenced work load, work on unsafe data, and demand for reliability, increase the need for security. This is best done by modularization, also called \name{compartementalization}, as described in section \ref{sec:discussion-mta-arch}.
    1.46 +
    1.47 +\masqmail\ needs to be secure enough for its target field of operation. \masqmail\ is targeted to workstations and private networks, with explicit warning to not use it on permanent online hosts \citeweb{masqmail:homepage2}. But as non-permanent online connections and trustable environments become rare, \masqmail's security should be so good, that it is usable with permanent online connections and in unsafe environments. For example should mails with bad content not break \masqmail.
    1.48  
    1.49  
    1.50  \paragraph{\RG2: Reliability}
    1.51 @@ -200,7 +202,10 @@
    1.52  
    1.53  
    1.54  \paragraph{\RG7: Performance}
    1.55 -Also called ``efficiency''. Efficient software requires few time and few resources. The merge of communication hardware and its move from service providers to homes and to mobile devices, demand smaller and more resource-friendly software. The amount of mail will be lower, even if much more mail will be sent. More important will be the energy consumption and heat emission. These topics increased in relevance during the past years and they are expected to become more central.
    1.56 +Also called ``efficiency''. Efficient software requires few time and few resources. The merge of communication hardware and its move from service providers to homes and to mobile devices, demand smaller and more resource-friendly software. The amount of mail will be lower even if much more mail will be sent, thus time performance is less important. \masqmail\ is not a program to be used on large servers, but on small devices. Thus more important for \masqmail\ will be energy and heat saving, maybe also system resources.
    1.57 +
    1.58 +As performance improvements are in contrast to many other quality properties (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}. Simplicity and clearness are of higher value.
    1.59 +
    1.60  
    1.61  
    1.62  \paragraph{\RG8: Availability}
    1.63 @@ -208,16 +213,18 @@
    1.64  
    1.65  
    1.66  \paragraph{\RG9: Portability}
    1.67 -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.
    1.68 +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, because these systems are the ones \MTA{}s run on usually. No special care needs to be taken for non-\unix\ platforms.
    1.69 +
    1.70  
    1.71  
    1.72  \paragraph{\RG10: Usability}
    1.73  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.74  
    1.75 +<< masqmail as portable app? >>
    1.76  
    1.77  
    1.78  
    1.79 -\subsection{Thoughts about architecture}
    1.80 +\subsection{Architecture}
    1.81  \label{sec:discussion-mta-arch}
    1.82  
    1.83  %todo: what's this section to do with requirements?
    1.84 @@ -235,7 +242,8 @@
    1.85  		%\includegraphics[scale=0.75]{img/callgraph.eps}
    1.86  		\includegraphics[scale=0.75]{img/masqmail-3-omitlog5.eps}
    1.87  	\end{center}
    1.88 -	\caption{Internal structure of \masqmail, showed by a call graph}
    1.89 +	\caption{Internal structure of \masqmail, showed by a call graph. (Logging functions are excluded.)}
    1.90 +	%fixme: what else is excluded
    1.91  	\label{fig:masqmail-arch}
    1.92  \end{figure}
    1.93  
    1.94 @@ -273,7 +281,10 @@
    1.95  
    1.96  
    1.97  \paragraph{\RF1: In/out channels}
    1.98 -\masqmail's incoming and outgoing channels are the ones required for an \MTA{}s at the moment. They are depicted in figure \ref{fig:masqmail-in-out} on page \pageref{fig:masqmail-in-out}. This is all what is currently needed. But new protocols and mailing concepts are likely to appear (see section \ref{sec:electronic-mail}). \masqmail\ has no support for adding further protocols. Thus modifications at many places in the source are needed to add them though. Today, support for further protocols is not needed, so \masqmail\ is regarded to fulfill \RF1, but the probable future need should be kept in mind.
    1.99 +The incoming and outgoing channels that \masqmail\ already has are the ones required for an \MTA{}s at the moment. They are depicted in figure \ref{fig:masqmail-in-out} on page \pageref{fig:masqmail-in-out}.
   1.100 +Support for other protocols seems not to be necessary at the moment, although new protocols and mailing concepts are likely to appear (see section \ref{sec:electronic-mail}).
   1.101 +Today, other protocols are not needed, so \masqmail\ is regarded to fulfill \RF1.
   1.102 +But as \masqmail\ has no support for adding further protocols, delaying the work to support them until they are widely used, appears to be the best strategy anyway.
   1.103  
   1.104  << smtp submission >> %fixme
   1.105  
   1.106 @@ -312,7 +323,7 @@
   1.107  \masqmail's current security is bad. However, it seems acceptable for using \masqmail\ on workstations and private networks, if the environment is trustable and \masqmail\ is protected against remote attackers. In environments where untrusted components or persons have access to \masqmail, its security is too low.
   1.108  Its author states it ``is not designed to'' such usage \citeweb{masqmail:homepage2}. This is a clear indicator for being careful. Issues like high memory consumption, low performance, and denial-of-service attacks---things not regarded by design---may cause serious problems. In any way, is a security report missing that confirms \masqmail's security level.
   1.109  
   1.110 -\masqmail\ uses conditional compilation to exclude unneeded functionality from the executable at complile time. Excluding code means excluding all bugs and weaknesses within this code too. This improves security.
   1.111 +\masqmail\ uses conditional compilation to exclude unneeded functionality from the executable at complile time. Excluding code means excluding all bugs and weaknesses within this code too. Excluding unused code is a good concept to improve security.
   1.112  
   1.113  \paragraph{\RG2: Reliability}
   1.114  Similar is its reliability not good enough. Situations where only one part of sent message was removed from the queue, and the other part remained as garbage, showed off \citeweb{debian:bug245882}. Problems with large mail and small bandwidth were also reported \citeweb{debian:bug216226}. Fortunately, lost email was no big problem yet, but \person{Kurth} warns:
   1.115 @@ -327,6 +338,7 @@
   1.116  
   1.117  \paragraph{\RG3: Robustness}
   1.118  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.119 +%todo: rule of robustness, rule of repair
   1.120  
   1.121  \paragraph{\RG4: Extendability}
   1.122  \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.123 @@ -339,6 +351,8 @@
   1.124  \paragraph{\RG6: Testability}
   1.125  The testability suffers from missing modularity. Testing program parts is hard to do. Nevertheless, it is done by compiling parts of the source to special test programs. %fixme: what are the names? what do they test?
   1.126  
   1.127 +This kind of testing is only clean-room testing, so .... %fixme
   1.128 +
   1.129  \paragraph{\RG7: Performance}
   1.130  The performance---efficiency---of \masqmail\ is good enough for its target field of operation, where this is a minor goal.
   1.131  
   1.132 @@ -348,9 +362,9 @@
   1.133  \paragraph{\RG9: Portability}
   1.134  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. Therefore, the portability is already good.
   1.135  
   1.136 +
   1.137  \paragraph{\RG10: Usability}
   1.138 -The usability, from the administrator'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.139 -
   1.140 +The usability, from the administrator'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}. But 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.141  
   1.142  
   1.143  
   1.144 @@ -401,19 +415,6 @@
   1.145  
   1.146  
   1.147  
   1.148 -\subsubsection*{Further \NAME{TODO}s}
   1.149 -
   1.150 -Support for other protocols than \SMTP\ seems not to be necessary 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.151 -
   1.152 -Archiving again is preferred to be implemented soon. It does not require much work, but enables all kinds of statistical analysis.
   1.153 -
   1.154 -Performance is a property that is nice to have. But as performance improvements are in contrast to many other quality properties (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.155 -
   1.156 -Portability among 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.157 -% unix fs on windows
   1.158 -
   1.159 -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.160 -% masqmail as portable app?
   1.161  
   1.162  
   1.163  
   1.164 @@ -422,6 +423,11 @@
   1.165  
   1.166  \section{Ways for further development}
   1.167  
   1.168 +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.169 +
   1.170 +
   1.171 +\subsection{Possibilities}
   1.172 +
   1.173  Futher development of software can always go three different ways:
   1.174  \begin{enumerate}
   1.175  \item[S1:] Improve the current code base.
   1.176 @@ -429,10 +435,12 @@
   1.177  \item[S3:] Redesign the software from scratch and rebuild it.
   1.178  \end{enumerate}
   1.179  
   1.180 -The first two strategies base on the available source code, and can be applied in combination. The third strategy splits from the old code base and starts over again. Wrappers and interposition filters would then be outright included into the new architecture. Parts of existing old code could be used if appropriate.
   1.181 +The first two strategies base on the available source code, and can be applied in combination. The third strategy splits from the old code base and starts over again. Wrappers and interposition filters would be outright included into a new architecture; they are a subset of a new design. Also parts of existing code can be used in a new design if appropriate.
   1.182  
   1.183  
   1.184 -The requirements are now regarded, each on its own. Each one is linked to the development strategy that is prefered to reach the specific requirement. Some requirements may be well achievable by using different strategies, so they are linked to all of them. The order of the requirements in the list depend on their level of focus. This linking of strategies to the requirements is shown in table \ref{tab:strategies}.
   1.185 +The requirements are now regarded each on its own, and are linked to the development strategy that is prefered to reach each specific requirement. If some requirement is well achievable by using different strategies then it is linked to all of them. Implementing encryption (\TODO1) and authentication (\TODO2), for example, are limited to a narrow region in the code. Such features are addable to the current code base without much problem. In contrast can quality properties like reliability (\TODO4), extendability (\TODO6), and maintainability hardly be added to code afterwards---if at all. Security (\TODO3) is addable in a new design, of course, but also with wrappers or interposition filters.
   1.186 +
   1.187 +This linking of strategies to the requirements is shown in table \ref{tab:strategies}. The requirements are ordered by their focus.
   1.188  
   1.189  \begin{table}
   1.190  	\begin{center}
   1.191 @@ -443,77 +451,33 @@
   1.192  \end{table}
   1.193  
   1.194  
   1.195 -Next, the best strategy for further development needs to be discovered.
   1.196 +Next, the best strategy for further development needs to be discovered. Therefore a score for each strategy is obtained now by summing up the focus points of each requirement for which a strategy is prefered. Herefore only positive focus points are regarded, with each plus symbol counting one. Requirements with negative focus are not regareded because they are already or nearly reached, but the view here is on outstanding work. %(Respecting negative focus points leads to a similar result.)
   1.197  
   1.198 -Implementing \TODO1 encryption and \TODO2 authentication, for example, are 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 mail processing interfaces to external programs (\TODO5) or support for new protocols require a lot of effort. Changes in many parts of the source code are required. If such large features are needed, it is best to redesign the program's structure and rebuild it.
   1.199 +Strategy 1 (Improve current code) has a score of 9 points. Strategy 2 (Wrappers and interposition filters) has a score of 7 points. Strategy 3 (A new design) scores on top with 17 points. \St1 and \St2 can be used in combination; the combined score is 13 points. Thus strategy 3 ranges first, followed by the combination of strategy 1 and 2.
   1.200  
   1.201 -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 (\TODO5) would do. Quality properties, like security (\TODO3) and reliability (\TODO3), as well as extendability (\TODO6) and maintainability, can hardly be added afterwards---if at all.
   1.202 +This leads to the conclusion, that S3 (A new design) is probably the best strategy for further development. But this result respects only the view on requirements and their relevance. Other factors like development effort and risks are important to think about too. These issues are discussed in the following sections, comparing \St3 against the combination \St1+2.
   1.203  
   1.204  
   1.205 -A score for each strategy is obtained by summing up the focus points of each requirement for which a strategy is prefered. Herefore only positive focus points are regarded, with each plus symbol counting one. (Respecting negative focus points also leads to a similar result.)
   1.206  
   1.207 -Strategy 1 (Improve current code), gets a score of 9 points. Strategy 2 (Wrappers and interposition filters) has a score of 7 points. And strategy 3 (A new design) scores on top with 17 points. As \St1 and \St2 may be used in combination, a combined score is important to calculate. The combination has in total 13 points, but it is still beaten by \St3.
   1.208  
   1.209 -This leads to the conclusion, that S3 (A new design) is probably the best strategy for further development. But this conclusion respects only the view on requirements and their relevance. Other factors like development effort and risks are important to respect too. These issues are discussed in the following sections.
   1.210  
   1.211  
   1.212  
   1.213  
   1.214 +\subsection{Discussion}
   1.215  
   1.216 -\subsubsection*{S3: A new design from scratch}
   1.217  
   1.218 -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, development will reach a dead end \dots\ further work then will make everything worse. The only good solution is to change the architecture, which, sadly but most likely, means a redesign from scratch.
   1.219 +\subsubsection*{Quality improvements} % PRO
   1.220  
   1.221 -Quality properties, like security (\TODO3) and reliability (\TODO3), as well as extendability (\TODO6) and maintainability, 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.222 +Most quality properties can hardly be added to a software afterwards. Hence, if reliability, extendability, or maintainability shall be improved, a redesign of \masqmail\ is the best way to take. This is also true for adding modularity with internal and external interfaces, which is highly prefered from the architectural point of view (see section \ref{sec:discussion-mta-arch}).
   1.223  
   1.224 -%Extendability does suffer from the monolithic architecture and is nearly impossible to improve without changing the programs structure. This property can hardly be retrofitted into software. Extendability is expected become important in the future as new protocols need to be supported.
   1.225 +The wish for good reliability, extendability, and maintainability inevitably point towards a rewrite using a modern, modular architecture. The need for further features, especially ones that require changes in \masqmail's structure, support the decision for a new design too. Hence a rewrite is enfavored if \masqmail\ should become a modern \MTA, with good quality properties.
   1.226  
   1.227  
   1.228 -However, a redesign and rewrite of 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 necessary to start again. Thus the gain of a new design must overweight the effort needed.
   1.229  
   1.230 -\person{Wheeler}'s program \name{sloccount} calculates following estimations for \masqmail's code base as of version 0.2.21 (excluding library code):
   1.231 +\subsubsection*{Security}
   1.232  
   1.233 -\codeinput{input/masqmail-sloccount.txt}
   1.234 -
   1.235 -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 \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 employee with eight work-hours per day.
   1.236 -
   1.237 -Given the assumptions 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 development, better testing, and less bugs.
   1.238 -
   1.239 -
   1.240 -
   1.241 ----
   1.242 -
   1.243 -on venema: ``there'll be no second postfix'':
   1.244 -
   1.245 -Yes there will be one, when postfix becomes obsolete, and this day will come as requirements change. See sendmail for example: it had nearly the whole market ... and now it's dying. sendmail once also thought it would be the number 1, forever.
   1.246 -
   1.247 -cf. Tanenbaum vs. Linux: It was too early. Linux' time has not ended, but it will some day.
   1.248 -
   1.249 -anyway, masqmail is not intended to become a second postfix. It's more inteded to become a second qmail, but with a differend target field.
   1.250 -
   1.251 -
   1.252 ----
   1.253 -
   1.254 -
   1.255 -Remarkable is the distribution of the score points between functional and non-functional requirements. S1 (Improve current code) gets most points from functional requirements. Thus it is the best strategy to improve them. S3 (New design), in contrast, scores high for non-functional requirements. Thus it is best chosen to improve the software's quality. S2 (Wrappers and interposition filters) is balanced.
   1.256 -
   1.257 -
   1.258 -
   1.259 -%\subsubsection*{The need for structural changes}
   1.260 -
   1.261 -%\person{Hafiz} adds: ``The major idea is that security cannot be retrofitted into an architecture.''\cite[page 64]{hafiz05}
   1.262 -
   1.263 ----
   1.264 -
   1.265 -
   1.266 -
   1.267 -
   1.268 -
   1.269 -
   1.270 -
   1.271 -\textbf{A redesign from scratch}
   1.272 -
   1.273 -Security comes from good design, as \person{Graff} and \person{van Wyk} explain:
   1.274 +Similar is the situation for security. Security comes from good design, explain \person{Graff} and \person{van Wyk}:
   1.275  \begin{quote}
   1.276  Good design is the sword and shield of the security-conscious developer. Sound design defends your application from subversion or misuse, protecting your network and the information on it from internal and external attacks alike. It also provides a safe foundation for future extensions and maintenance of the software.
   1.277  %
   1.278 @@ -521,14 +485,120 @@
   1.279  \hfill\cite[page 55]{graff03}
   1.280  \end{quote}
   1.281  
   1.282 -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.283 +They also recommend to add wrappers and interposition filters \emph{around} applications, but more as repair techniques if it is not possible to design security \emph{into} a software the first way \cite[pages~71--72]{graff03}.
   1.284  
   1.285 +\person{Hafiz} adds: ``The major idea is that security cannot be retrofitted \emph{into} an architecture.'' \cite[page 64]{hafiz05} (emphasisis added).
   1.286  
   1.287 -\textbf{Further reasons for a new design}
   1.288  
   1.289 -impressing  simplicity of qmail: only about 1000 SLOC per file (= about one module). It's obvious what it does. cf. suckless.org
   1.290  
   1.291  
   1.292 +\subsubsection*{Effort estimation}
   1.293 +
   1.294 +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.295 +
   1.296 +\person{Wheeler}'s program \name{sloccount} calculates following estimations for \masqmail's code base as of version 0.2.21 (excluding library code):
   1.297 +
   1.298 +\codeinput{input/masqmail-sloccount.txt}
   1.299 +
   1.300 +The development cost in money 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 \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.301 +
   1.302 +Given the assumptions that (1) an equal amount of code needs to be produced for a new designed \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 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.303 +
   1.304 +
   1.305 +
   1.306 +
   1.307 +\subsubsection*{Risks}
   1.308 +
   1.309 +If the gained result still overwights the development effort, risks are something more to consider.
   1.310 +
   1.311 +A redesign and rewrite of software from scratch is hard. It takes time to design a new architecture, which then must prove that it is as good as expected. 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 necessary to start again.
   1.312 +
   1.313 +Such a redesign can fail at many points and it is for long unclear if the result is really better than what is already existent. Even if it is working, it is still not matured then.
   1.314 +
   1.315 +One thing is clear: Starting a redesign and rebuild \emph{is} a risky decision.
   1.316 +
   1.317 +
   1.318 +
   1.319 +\subsubsection*{Existing code is precious}
   1.320 +
   1.321 +If a new design needs much effort and additionally is a risk, what about the alternative then?
   1.322 +
   1.323 +Adding new functionality to an existing code base seems to be a secure and cheap strategy. The existing code is known to work and features can often be added in small increments. The risk of wasted effort if a new design fails is hardly existent. And the faults in the current design are already made and most probably fixed.
   1.324 +
   1.325 +Also functionality that is hard to add incrementally into the application, like support for new protocols, may be addable by ``translation programs'' to the outside. \masqmail\ can be secured to a huge amount by guarding it with wrappers that block attackers. Spam and malware scanners can be included by running two instances of \masqmail. All those methods base on the current code which they can indirectly improve.
   1.326 +
   1.327 +The required effort is probably under thirty percent of a new design and work directly shows results. These are strong arguments against a new design.
   1.328 +
   1.329 +
   1.330 +%XXX
   1.331 +
   1.332 +\subsubsection*{Repairing}
   1.333 +
   1.334 +Repair strategies are only useful in the short time view and in times of trouble. But if the future is bright, one does best by investing. Here it means investing time in redesigning to build up a more modern product. cf. ch02: the future is bright!
   1.335 +
   1.336 +\masqmail\ should have already been redesigned in 2002 or so, when the old design was still quite suitable ... it already delayed too long.
   1.337 +
   1.338 +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.339 +
   1.340 +Further development on base of current code needs to improve the quality properties too. Some quality requirements can be achieved by adding wrappers or interposition filters from the outside. For those is the development effort approximately equal to a solution by new design. But for quality requirements like extendability or maintainability, the effort does increase with expotentionel rate as development proceeds. But without those properties development of a software will most likely come to a dead end.
   1.341 +
   1.342 +
   1.343 +
   1.344 +
   1.345 +
   1.346 +\subsubsection*{A guard against dead ends}
   1.347 +
   1.348 +But a new design does also protect against dangers. Changing requirements are a risk for software if it does not evolve with them. A famous example is \sendmail, which had nearly a monopoly for a long time. But when security became important \sendmail\ was only repaired, instead of removing the problem sources. Thus security problems reappeared and over the years \sendmail's market share shrinked as more secure \MTA{}s became available. %fixme: declined ??
   1.349 +\sendmail's reaction to the changed requirements, in form of \name{sendmail X} and \name{MeTA1}, came much to late---the users already switched to other \MTA{}s.
   1.350 +
   1.351 +Redesigning a software as requirements change helps keeping it alive. % add quote: ``one thing surely remains: change'' (something like that)
   1.352 +
   1.353 +Another danger is complexity which is likely to appear by constantly working 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} advertizes a philosophy of small and simple software by following the thoughts of the \unix\ inventors \cite{kernighan84} \cite{kernighan99}. Simple, small, and clear code reduces bugs and, as the code function becomes obvious, it is a large step towards security.
   1.354 +
   1.355 +
   1.356 +
   1.357 +
   1.358 +
   1.359 +\subsubsection*{Modularity}
   1.360 +
   1.361 +The (by design) modular structure makes it also easy to add further functionality. \person{Sill} for example describes integrating the \name{amavis} filter framework into the \qmail\ system can be done by renaming the \name{qmail-queue} module to \name{qmail-queue-real} and renaming the \name{amavis} to \name{qmail-queue} \cite[section~12.7.1]{sill02}. Nothing more in \qmail\ needs to be changed. This is a very admirable approach, but only possible in a modular system that consists of independent executables.
   1.362 +
   1.363 +Extendability does suffer from the monolithic architecture and is nearly impossible to improve without changing the programs structure. This property can hardly be retrofitted into software. Extendability is expected become important in the future as new protocols need to be supported.
   1.364 +
   1.365 +
   1.366 +Hence, to be able to develop \masqmail\ for a long time, it is a must to refactor the existing code with the intention to modularize it. A new design is similar to such a throughout refactoring, except without basing on current code.
   1.367 +
   1.368 +
   1.369 +
   1.370 +
   1.371 +
   1.372 +
   1.373 +
   1.374 +
   1.375 +\subsubsection*{Split between function and quality}
   1.376 +
   1.377 +Remarkable is the distribution of the score points between functional and non-functional requirements. S1 (Improve current code) gets most points from functional requirements. Thus it is the best strategy to improve them. S3 (New design), in contrast, scores high for non-functional requirements. Thus it is best chosen to improve the software's quality. S2 (Wrappers and interposition filters) is balanced.
   1.378 +
   1.379 +a question of order:
   1.380 +- repair: first function, then quality
   1.381 +- redesign: first quality, then function
   1.382 +
   1.383 +
   1.384 +
   1.385 +
   1.386 +
   1.387 +
   1.388 +\subsubsection*{The break even}
   1.389 +
   1.390 +The effort needed is much smaller than for a new design plus improvements on the first view. But to have similar quality properties in four years, a \masqmail\ that is based on current code will probably require as much effort as a new designed \masqmail\ will take. For all further development afterwards, the new design will scale nearly linear while the old code will require exponentiell more work.
   1.391 +
   1.392 +It \emph{is} important to design from scratch somewhen! But when?
   1.393 +
   1.394 +
   1.395 +
   1.396 +
   1.397 +\subsubsection*{The problem with ``good enough''}
   1.398 +
   1.399  do not try to safe obsolete stuff. This will not work (see sendmail).
   1.400  
   1.401  It is often done in commercial software, when it's about making money. Free software with volunteer programmers in contrast care about good software..
   1.402 @@ -537,16 +607,12 @@
   1.403  
   1.404  But making a cut is hard, as it is still ``good enough''.
   1.405  
   1.406 +(It already is too late.)
   1.407  
   1.408 ----
   1.409  
   1.410 -repair strategies is only useful in the short time view and for hard times. but if the future is bright, one must invest. here it means redesigning to build up a more modern product. cf. ch02: the future is bright!
   1.411  
   1.412 -Masqmail should have been redesigned in 2002 or so, when the old design was still quite suitable ... it already delayed too long.
   1.413  
   1.414 -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.415 -
   1.416 ----
   1.417 +\subsubsection*{Bonus: Good software, good feelings}
   1.418  
   1.419  repairing leaves a worse feeling. Free Software ``sells'' if it has a good userbase. Although qmail is somehow outdated and its author has released no new version since about 10 years, qmail has a very strong userbase and community.
   1.420  
   1.421 @@ -558,12 +624,6 @@
   1.422  
   1.423  
   1.424  
   1.425 -\subsubsection*{S\,1 and S\,2: Improve old code and add wrappers}
   1.426 -
   1.427 -
   1.428 -FIXME
   1.429 -
   1.430 -
   1.431  
   1.432  
   1.433  
   1.434 @@ -573,23 +633,21 @@
   1.435  
   1.436  \section{Result}
   1.437  
   1.438 +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, development will reach a dead end \dots\ further work then will make everything worse. The only good solution then is to change the architecture, which, sadly but most likely, means a redesign from scratch.
   1.439 +
   1.440  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.441  
   1.442 -All other work depends on how the plans for \masqmail's future look like.
   1.443  
   1.444 -What shall \masqmail\ be like, in, for instance, five years?
   1.445  
   1.446 -Two ways of further development come to mind.
   1.447  
   1.448 -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 already 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.449 +\begin{enumerate}
   1.450 +\item
   1.451 +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 already 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.452  
   1.453 -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 foreseeable 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.454 +\item
   1.455 +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 foreseeable 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.456 +\end{enumerate}
   1.457  
   1.458 -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.459 -
   1.460 -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.461 -
   1.462 -\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 environments}. And nothing other than a fresh and better design will help to survive.
   1.463  
   1.464  
   1.465