# HG changeset patch # User meillo@marmaro.de # Date 1230556010 -3600 # Node ID 1611abd5443bf9a7b8cc8bc1ddf9d0ca38a2d003 # Parent b0adae481138b76bbc64f2fbd2847b7d7383fc81 restructuring and new content (a large commit) diff -r b0adae481138 -r 1611abd5443b thesis/tex/4-MasqmailsFuture.tex --- a/thesis/tex/4-MasqmailsFuture.tex Mon Dec 29 14:05:24 2008 +0100 +++ b/thesis/tex/4-MasqmailsFuture.tex Mon Dec 29 14:06:50 2008 +0100 @@ -1,9 +1,28 @@ \chapter{\masqmail's present and future} +This chapter \dots %fixme write text here + + + + \section{Existing code base} + Here regarded is version 0.2.21 of \masqmail. This is the last version released by Oliver \person{Kurth}, and the basis for my thesis. +\subsubsection*{The source code} + +\masqmail\ is written in the C programming language. The program, as of version 0.2.21, consists of 34 source code and eight header files, containing about 9,000 lines of code\footnote{Measured with \name{sloccount} by David A.\ Wheeler.}. Additionally, it includes a \name{base64} implementation (about 300 lines) and \name{md5} code (about 150 lines). For systems that do not provide \name{libident}, this library is distributed as well (circa 600 lines); an available shared library however has higher precedence in linking. + +The only mandatory dependency is \name{glib}---a cross-platform software utility library, originated in the \NAME{GTK+} project. It provides safer replacements for many standard library functions. It also offers handy data containers, easy-to-use implementations of data structures, and much more. + +With \masqmail\ comes the small tool \path{mservdetect}; it helps setting up a configuration that uses the \name{mserver} system to detect the online state. Two other binaries get compiled for testing purposes: \path{readtest} and \path{smtpsend}. All three programms use \masqmail\ source code; they only add a file with a \verb+main()+ function each. + +\masqmail\ does not provide an interface to plug in modules with additional functionality. There exists no add-on or module system. The code is only separated by function to the various source files. Some functional parts can be included or excluded by defining symbols. Adding maildir support at compile time, means giving the option \verb+--enable-maildir+ to the \path{configure} call. This preserves the concerning code to get removed by the preprocessor. Unfortunately the \verb+#ifdef+s are scattered through all the source, leading to source code that is hard to read. +%fixme: refer to ifdef-considered-harmful ? + + + \subsubsection*{Features} \masqmail\ accepts mail on the command line and via \SMTP. Mail queueing and alias expansion is supported. \masqmail\ is able to deliver mail to local mailboxes (in \name{mbox} or \name{maildir} format) or pass it to a \name{mail delivery agent} (like \name{procmail}). Mail destinated to remote locations is sent using \SMTP\ or can be piped to commands, being gatesways to \NAME{UUCP} or \NAME{FAX} for example. @@ -20,29 +39,22 @@ Additional to the \mta\ job, \masqmail\ also offers mail retrieval services with being a \NAME{POP3} client. It can fetch mail from different remote locations, dependent on the active online route. -\subsubsection*{The code} - -\masqmail\ is written in the C programming language. The program, as of version 0.2.21, consists of 34 source code and eight header files, containing about 9,000 lines of code\footnote{Measured with \name{sloccount} by David A.\ Wheeler.}. Additionally, it includes a \name{base64} implementation (about 300 lines) and \name{md5} code (about 150 lines). For systems that do not provide \name{libident}, this library is distributed as well (circa 600 lines); an available shared library however has higher precedence in linking. - -The only mandatory dependency is \name{glib}---a cross-platform software utility library, originated in the \NAME{GTK+} project. It provides safer replacements for many standard library functions. It also offers handy data containers, easy-to-use implementations of data structures, and much more. - - -With \masqmail\ comes the small tool \path{mservdetect}; it helps setting up a configuration that uses the \name{mserver} system to detect the online state. Two other binaries get compiled for testing purposes: \path{readtest} and \path{smtpsend}. All three programms use \masqmail\ source code; they only add a file with a \verb+main()+ function each. - - -\masqmail\ does not provide an interface to plug in modules with additional functionality. There exists no add-on or module system. The code is only separated by function to the various source files. Some functional parts can be included or excluded by defining symbols. Adding maildir support at compile time, means giving the option \verb+--enable-maildir+ to the \path{configure} call. This preserves the concerning code to get removed by the preprocessor. Unfortunately the \verb+#ifdef+s are scattered through all the source, leading to a FIXME(holperig) code base. - \section{Requirements} -This section identifies the requirements for future version of \masqmail. Most of them will apply to modern \MTA{}s in general. +This section identifies the requirements for a modern \masqmail. Most of them will apply to modern \MTA{}s in general. + + \subsection{General requirements} -Following is a list of current and future requirements to make \masqmail\ ready for the future. +The following list of general requirements applies not only to \masqmail, but to all kinds of programs in similar environment doing similar jobs with the same intention. These requirements can be covered by the term ``quality''. +%fixme: add cites +%fixme: refer to ch01 and ch02 +General requirements specify the non-functional properties of the software, thus they are also called \name{non-functional requirements}. \subsubsection*{Security} @@ -72,7 +84,138 @@ -\subsection{Discussion on architecture} + +\subsection{Functional requirements} + +This section identifies the needed functionality for a modern \MTA. The basic job of a \mta\ is to tranport mail from a sender to a recipient. This is the definition of such kind of software and this is how \MTA{}s are generally seen \cite[page 19]{dent04} \cite[pages 3-5]{hafiz05}. + +An \MTA\ therefore needs at least a mail receiving facility and a mail sending facility. + + + +\subsubsection*{Incoming channels} + +\sendmail-compatible \mta{}s must support at least two incoming channels: mail submitted using the \sendmail\ command, and mail received via the \SMTP\ daemon. Thus it is common to split the incoming channel into local and remote. This is done by \qmail\ and \postfix. The same way is \person{Hafiz}'s view. \SMTP\ is the primary mail transport protocol today, but with the increasing need for new protocols\ref{FIXME} in mind, support for more than just \SMTP\ is good to have. This leads to more than one remote channel. + + +\subsubsection*{Outgoing channels} + +Outgoing mail is commonly either sent using \SMTP, piped into local commands (for example \texttt{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. Local mail delivery is a job that requires root priveledge to be able to switch to any user in order to write to his mailbox. + +As mail delivery to local users, is \emph{not} included in the basic job of an \MTA{}, why should it care about it? In order to keep the system simple and to have programs that do one job well, the local delivery job should be handed over to a specialist: the \name{mail delivery agent}. \NAME{MDA}s know about the various mailbox formats and are aware of the problems of concurrent write access and thelike. Hence handling the message and the responsiblity over to a \NAME{MDA}, like \name{procmail} or \name{maildrop}, seems to be the right way to go. + +This means an outgoing connection that pipes mail into local commands is required. Other outgoing channels, one for each supportet protocol, may be designed like it was done in other \MTA{}s. + + + +\subsubsection*{Mail queue} + +Additionally to the mail receiving and sending facilities, mail queues are a basic feature. A mail queue removes the need to deliver intantly as a message is received. They provide fail-safe storage of mails until they are delivered. Mail queues are probably used in all \mta{}s, excluding the simple forwarders. A mail queue is a essential requirement for \masqmail, as it is to be used for non-permanent online connections. This means, mail must be queued until a online connection is available to send the message. + +The mail queue and the module to manage it are the central part of the whole system. This demands especially for robustness and reliability, as a failure here can lead to loosing mail. An \MTA\ takes over responsibility for mail in accepting it, hence loosing mail messages is absolutely to avoid. This covers any kind of crash situation too. The worst thing acceptable to happen is a mail to be sent twice. + +\sendmail, \exim, \qmail, \name{sendmail X}, and \masqmail\ feature one single mail queue. \postfix\ has three of them: \name{incoming}, \name{active}, and \name{deferred}. (The \name{maildrop} queue is excluded, as it is only used for the \texttt{sendmail} command.) + +\MTA\ setups that do external content scanning tend to require two separate queues. To use \sendmail\ in such setups requires two independent instances, with two separate queues, running. \exim\ can handle it with special \name{router} and \name{transport} rules, but the data flow gets complicated. Having two independent queues seems to be preferable. + + + + +\subsubsection*{Header sanitizing} + +Mail coming into the system often lacks important header lines. At least the required ones must be added from the \MTA. One example is the \texttt{Date:} header, another is the, not required but recommended \texttt{Message-ID:} header. Apart from adding missing headers, rewriting headers is important too, to change the locally known domain part of email addresses to globally known ones for example. \masqmail\ needs also the ability to rewrite the domain part dependent on the route used to send the message. + +Generating the envelope is a related job. The envelope specifies the actual recipient of the mail, no matter what the \texttt{To:}, \texttt{Cc:}, and \texttt{Bcc:} headers tell. Multiple reciptients lead to multiple different envelopes, containing all the same mail message. + + + + +\subsubsection*{Aliasing} + +Email addresses can have aliases and need to be expanded. Aliases can be of different kind: different local user, remote user, list of local and/or remote users, or a command. Most important are the aliases in the \path{aliases} file, usually located at \path{/etc/aliases}. Addresses expanding to lists of users lead to more envelopes. Aliases changing the reciptients domain part may require a different route to use. + + + + +\subsubsection*{Choose route to use} + +One key feature of \masqmail\ is its ability to send mail out in different ways. The decision is based on the current online state and whether a route may be used for a message or not. The online state can be retrieved in tree ways, explained in \ref{sec:fixme}. A route to send is found by checking every available route for being able to transfer the current message, until one matches. + + + + +\subsubsection*{Authentication} + +One thing to avoid is being an \name{open relay}. Open relays allow to relay mail from everywhere to everywhere. This is a major source of spam. The solution is restricting relay\footnote{Relaying is passing mail, that is not from and not for the own system, through it.} access. + +Several ways to restrict access are available. The most simple one is restrictiction relaying by the \NAME{IP} address. No extra complexity is added this way, but static \NAME{IP} addresses are needed. + +If static access restriction is not possible, for example mail from locations with changing \NAME{IP} addresses, some kind of authentication mechanism is required. Three common kinds exist: +\begin{itemize} + \item \SMTP-after-\NAME{POP}: Uses authenication on the \NAME{POP} protocol to permit incoming \SMTP\ connections for a limited time afterwards. + \item \SMTP authentication: An extension to \SMTP. Authentication can be requested before mail is accepted. + \item Certificates: They confirm the identity of someone. +\end{itemize} + + + +\subsubsection*{Encryption} + +Electronic mail is very weak to sniffing attacks, because all data transfer is unencrypted. This concerns the message's content, as well as the email addresses in header and envelope, but also authentication dialogs that may transfer plain text passwords (\NAME{PLAIN} and \NAME{LOGIN} are examples). Thus encryption is wanted. + +The common way to encrypt \SMTP\ dialogs is using \name{Transport Layer Security} (short: \TLS, successor of \NAME{SSL}). \TLS\ encrypts the datagrams of the \name{transport layer}. This means it works below the application protocols and can be used by any of them\citeweb{wikipedia:tls}. + +Outgoing \SMTP\ connections can get encrypted using a secure tunnel, created by an external application. Incoming connections, can not use this technique because the remote \NAME{IP} address is hidden then; \NAME{STARTTLS}---defined in \RFC2487---is what \mta{}s implement. + + + +\subsubsection*{Spam prevention} + +Spam is a major threat nowadays, but it is a war in which the good guys tend to lose. Putting much effort in fighting spam results in few gain. Real success will only be possible with new---better---protocols and abandonning the weak legacy technologies. The goal is to provide state-of-the-art spam protection, but not more (see section \ref{sec:swot-analysis}). As spam is not just a nuisance for end users, but also for the infrastructure---the \mta{}s---by increasing the amount of mail messages, \MTA{}s need to protect themself. + +Filtering spam can be done in two ways: Refusing spam during the \SMTP\ dialog or checking for spam after the mail was accepted and queued. Both have advantages and disadvantages, so modern \MTA{}s use them in combination. Spam is identified by the results of a set of checks. Static rules, querying databases (\NAME{DNS} blacklists), requesting special client behavior (\name{greylisting}, \name{hashcash}), or statistical analysis (\name{bogofilter}) are checks that may be used. Running more checks leads to better results, but takes more system resources and time. + +Doing some basic checks during the \SMTP\ dialog seems to be a must. + + + +\subsubsection*{Virus checking} + +Related to spam is malicous content (short: \name{malware}) like viruses, worms, trojan horses. They, in contrast to spam, do not affect the \MTA\ itself, as they are in the mail body. \MTA{}s searching for malware is equal to real world's post offices opening letters to check if they contain something that could harm the recipient. This is not a mail transport job. But the last \MTA---the one responsible for the recipient---seems to be at a good position to do this work. + +In any way should malware checking be done by external programs that may be invoked by the \mta. But using mail deliver and processing agents, like \name{procmail}, a better suited locations to invoke content scanners. + +A popular email filter framework is \name{amavis} which integrates various spam and virus scanners. The common setup includes a receiving \MTA\ which sends it to \name{amavis} using \SMTP, \name{amavis} processes the mail and sends it then to a second \MTA\ that does the outgoing transfer. Having interfaces to such scanners is, for sure, good to have. + + + +\subsubsection*{Archiving} + +Mail archiving and auditability become more important as electronic mail becomes more important. The ability to archive verbatim copies of every mail coming into and every mail going out of the system, with relation between them, appears to be a goal to achieve. + +\postfix\ for example has a \texttt{always\_bcc} feature, to send a copy of every mail to a definable reciptient. At least this funtionality should be given, although a more complete approach is preferable. + + + + + + + + +\section{Work to do} + +What exists, what is missing, what needs to be done? + +auth, enc, archiving + +\masqmail\ is already able to encrypt outgoing connections, but encryption of incoming connections, using \NAME{STARTTLS} should be implemented. This only affects the \SMTP\ server module. + + + + +\subsubsection*{Discussion on architecture} A program's architecture is probably the most influencing design decision, and has the greatest impact on the program's future capabilities. %fixme: search quote ... check if good @@ -116,33 +259,34 @@ +\subsubsection*{A design from scratch?} +<< what would be needed (effort) >> +The next section is a design -http://fanf.livejournal.com/50917.html %how not to design an mta - the sendmail command -http://fanf.livejournal.com/51349.html %how not to design an mta - partitioning for security -http://fanf.livejournal.com/61132.html %how not to design an mta - local delivery -http://fanf.livejournal.com/64941.html %how not to design an mta - spool file format -http://fanf.livejournal.com/65203.html %how not to design an mta - spool file logistics -http://fanf.livejournal.com/65911.html %how not to design an mta - more about log-structured MTA queues -http://fanf.livejournal.com/67297.html %how not to design an mta - more log-structured MTA queues -http://fanf.livejournal.com/70432.html %how not to design an mta - address verification -http://fanf.livejournal.com/72258.html %how not to design an mta - content scanning +\section{A design from scratch} -\subsection{Jobs of an MTA} +The last sections identified the jobs that need to be done by a modern \MTA; problems and prefered choices were mentioned too. Now the various jobs are assigned to modules, of which an architecture is created. It is inpired by existing ones and driven by the identified jobs and requirements. -This section tries to identify the needed modules for a modern \MTA. They are later the pieces of which the new architecture is built of. -The basic job of a \mta\ is to tranport mail from a sender to a recipient. This is the definition of such a program and this is how \person{Dent}\cite[page 19]{dent04} and \person{Hafiz} \cite[pages 3-5]{hafiz05} generally see its design. -An \MTA\ therefor needs at least a mail receiving facility and a mail sending facility. Additionally probably all \MTA\ developers (excluded the only forwarders), see the need for a mail queue. A mail queue removes the need to deliver at once a message is received. They also provide fail-safe storage of mails until they are delivered. +\subsection{Design decisions} + +One major design idea of the design were: +\begin{itemize} + \item free the internal system from in and out channels + \item arbitrary protocol handlers have to be addable afterwards + \item a single facility for scanning (all mail goes through it) + \item concentrate on mail transfer +\end{itemize} \subsubsection*{Incoming channels} @@ -194,17 +338,6 @@ -\subsubsection*{Choose route to use} - -One key feature of \masqmail\ is its ability to send mail out in different ways. The decision is based on the current online state and whether a route may be used for a message or not. The online state can be retrieved in tree ways, explained in \ref{sec:fixme}. A route to send is found by checking every available route for being able to transfer the current message, until one matches. - -This functionality should be implemented in the module that is responsible to invoke one of the outgoing channel modules (for example the one for \SMTP\ or the pipe module). - -\masqmail\ can rewrite the envelope's from address and the \texttt{From:} header, dependent on the outgoing route to use. This rewrite must be done \emph{after} it is clear which route a mail will take, of course, so this may be not the module where other header editing is done. -%fixme: see hafiz05 page 57: maybe put the rewriting into the sending module (like smx, exim, courier) (problem with archiving of all outgoing mail?) - - - \subsubsection*{Aliasing} Where should aliases get expanded? They appear in different kind. Important are the ones available in the \path{aliases} file. Aliases can be: @@ -220,6 +353,17 @@ +\subsubsection*{Choose route to use} + +One key feature of \masqmail\ is its ability to send mail out in different ways. The decision is based on the current online state and whether a route may be used for a message or not. The online state can be retrieved in tree ways, explained in \ref{sec:fixme}. A route to send is found by checking every available route for being able to transfer the current message, until one matches. + +This functionality should be implemented in the module that is responsible to invoke one of the outgoing channel modules (for example the one for \SMTP\ or the pipe module). + +\masqmail\ can rewrite the envelope's from address and the \texttt{From:} header, dependent on the outgoing route to use. This rewrite must be done \emph{after} it is clear which route a mail will take, of course, so this may be not the module where other header editing is done. +%fixme: see hafiz05 page 57: maybe put the rewriting into the sending module (like smx, exim, courier) (problem with archiving of all outgoing mail?) + + + \subsubsection*{Authentication} One thing to avoid is being an \name{open relay}. Open relays allow to relay mail from everywhere to everywhere. This is a major source of spam. The solution is restricting relay\footnote{Relaying is passing mail, that is not from and not for the own system, through it.} access. @@ -228,30 +372,10 @@ If static access restriction is not possible, for example if mail from locations with changing \NAME{IP} addresses wants to be accepted, some kind of authentication mechanism is required. Three common kinds exist: \begin{enumerate} -\item \SMTP-after-\NAME{POP}: uses authenication on the \NAME{POP} protocol to permit incoming \SMTP\ connections for a limited time afterwards. -\item \SMTP authentication: is an extension to \SMTP. Authentication can be requested before mail is accepted. -\item Certificates: confirm the identity of someone. + \item \SMTP-after-\NAME{POP}: uses authenication on the \NAME{POP} protocol to permit incoming \SMTP\ connections for a limited time afterwards. + \item \SMTP authentication: is an extension to \SMTP. Authentication can be requested before mail is accepted. + \item Certificates: confirm the identity of someone. \end{enumerate} -The first mechanism requires a \NAME{POP} (or \NAME{IMAP}) server running on the same host (or a trusted one), to enable the \SMTP\ server to use the login dates on the \NAME{POP} server. This is a common practice used by mail service providers, but is not adequate for the environments \masqmail\ is designed for. - -Certificate based authentication, like provided by \NAME{TLS}, suffers from the overhead of certificate management. But \NAME{TLS} provides encryption too, so is useful anyway. - -\SMTP\ authentication (also refered to as \NAME{SMTP-AUTH}) suppoert is easiest received by using a \name{Simple Authentication and Security Layer} implementation. \person{Dent} sees in \NAME{SASL} the best solution for authenticating dynamic users: -\begin{quote} -%None of these add-ons is an ideal solution. They require additional code compiled into your existing daemons that may then require special write accesss to system files. They also require additional work for busy system administrators. If you cannot use any of the nonauthenticating alternatives mentioned earlier, or your business requirements demand that all of your users' mail pass through your system no matter where they are on the Internet, SASL is probably the solution that offers the most reliable and scalable method to authenticate users. -None of these [authentication methods] is an ideal solution. They require additional code compiled into your existing daemons that may then require special write accesss to system files. They also require additional work for busy system administrators. If you cannot use any of the nonauthenticating alternatives mentioned earlier, or your business requirements demand that all of your users' mail pass through your system no matter where they are on the Internet, \NAME{SASL} is probably the solution that offers the most reliable and scalable method to authenticate users. -\cite[page 44]{dent04} -\end{quote} - -%either by -%- network/ip address -% easiest: restricting by static IP addresses (Access control via hosts.allow/hosts.deny) -%or -%- some kind of auth (for dynamic remote hosts) -% adds complexity -% - SASL -% - POP/IMAP: pop-before-smtp, DRAC, WHOSON -% - TLS (certificates) @@ -265,42 +389,10 @@ The \NAME{POP} protocol, for example, is good suited for such tunneling, but \SMTP\ is is not generally. Outgoing \SMTP\ client connections can be tunneled without problem---\masqmail\ already provides a configure option called \texttt{wrapper} to do so. Tunneling incomming connections to a server leads to problems with \SMTP. As data comes encrypted through the tunnel to the receiving host and gets then decrypted and forwarded on local to the port the application listens on. From the \MTA's view, this makes all connections appear to come from localhost, unfortunately. Figure \ref{fig:stunnel} depicts the data flow. -\begin{figure} - \begin{center} - \input{input/stunnel.tex} - \end{center} - \caption{Data flow using \name{stunnel}} - \label{fig:stunnel} -\end{figure} - For incoming connections, \NAME{STARTTLS}---defined in \RFC2487---is what \mta{}s implement. \masqmail\ is already able to encrypt outgoing connections, but encryption of incoming connections, using \NAME{STARTTLS} should be implemented. This only affects the \SMTP\ server module. -%TLS/SSL prevents attackers to listen on the cable -%but it does not prevent man-in-the-middle attacks -%signed certificates help here -% or PGP encryption - - -%do not use stunnel wit SMTP: -%because all incoming mail would be from 127.0.0.1 !! -%use STARTTLS instead - -%postfix: main.cf -%\begin{verbatim} -% smtpd_use_tls = yes -% smtpd_tls_received_header = no (does not log in received headers) -% -% smtpd_tls_key_file = /etc/postfix/key.pem -% smtpd_tls_cert_file = /etc/postfix/cert.pem -% smtpd_tls_CA_file = /etc/postfix/CAcert.pem -% -% smtp_use_tls = yes (use TLS for sending) -% smtp_tls_key_file = /etc/postfix/key.pem -% smtp_tls_cert_file = /etc/postfix/cert.pem -% smtp_tls_CA_file = /etc/postfix/CAcert.pem -%\end{verbatim} @@ -382,17 +474,9 @@ -\section{Merging the parts} -The last sections identified the jobs that need to be done by a modern \MTA; problems and prefered choices were mentioned too. Now the various jobs are assigned to modules, of which an architecture is created. It is inpired by existing ones and driven by the identified jobs and requirements. -One major design idea of the design were: -\begin{itemize} - \item free the internal system from in and out channels - \item arbitrary protocol handlers have to be addable afterwards - \item a single facility for scanning (all mail goes through it) - \item concentrate on mail transfer -\end{itemize} +\subsection{The resulting architecture} The result is a symetric design, featuring the following parts: Any number of handlers for incoming connections to receive mail and pass it to the module that stores it into the incoming queue. A central scanning module take mail from the incoming queue, processes it in various ways and puts it afterwards into the outgoing queue. Another module takes it out there and passes it to a matching transport module that transfers it to the destination. In other words, three main modules (queue-in, scanning, queue-out) are connected by the two queues (incoming, outgoing); on each end are more modules to receive and send mail---for each protocol one. Figure \ref{fig:masqmail-arch-new} depicts the new designed architecture. @@ -410,7 +494,7 @@ %fixme: do i need all this ``quesses''?? -\subsection{Modules and queues} +\subsubsection*{Modules and queues} The new architecture consists of several modules and two queues. They are defined in more detail now, and the jobs, identified above, are assigned to them. First the three main modules, then the queues, and afterwards the modules for incoming and outgoing transfer. @@ -437,7 +521,7 @@ -\subsection{Inter-module communication} +\subsubsection*{Inter-module communication} Communication between modules is required to exchange data and status information. It is also called ``Inter-process communication'' (short: \NAME{IPC}), as modules are programs being part of a larger system, and processes are generally seen as programs in execution. @@ -472,7 +556,7 @@ -\subsection{Spool file format} +\subsubsection*{Spool file format} The spool file format is basically the same as the one in current \masqmail: one file for the message body, the other for envelope and header information. The data file is stored in a separate data pool. It is written by \name{queue-in}, \name{scanning} can read it if necessary, \name{queue-out} reads it to generate the outgoing message, and deletes it after successful transfer. The header file (including the envelope) is written into the \name{incoming} queue. The \name{scanning} modules reads it, processes it, and writes a modified copy into the \name{outgoing} queue; the file in \name{incoming} is deleted then. \name{queue-out} finally takes the header file from \name{outgoing} to generate the resulting message. This data flow is shown in figure \ref{fig:queue-data-flow}. @@ -493,13 +577,62 @@ Data files do not change at all within the system. They are written in default local plain text format. Required translation is done in the receiver and transport modules. -%\begin{verbatim} -%s f / envelope data -%p i | NL -%o l | / header lines -%o e | mail | NL -%l \ \ mail body -%\end{verbatim} +\begin{tabular}[hbt]{ l l } + +\mbox{ queue-in:} & \mbox{ +\begin{tabular}[hbt]{| c | c | c |} + \hline + incoming & outgoing & pool \\ + \hline + \hline + - & - & - \\ + \hline + 0600 & - & - \\ + \hline + 0600 & - & 0600 \\ + \hline + 0700 & - & 0600 \\ + \hline +\end{tabular} +} \\ + +\quad & \\ + +\mbox{scanning:} & \mbox{ +\begin{tabular}[hbt]{| c | c | c |} + \hline + incoming & outgoing & pool \\ + \hline + \hline + 0700 & - & 0600 \\ + \hline + 0700 & 0600 & 0600 \\ + \hline + 0700 & 0700 & 0600 \\ + \hline + - & 0700 & 0600 \\ + \hline +\end{tabular} +} \\ + +\quad & \\ + +\mbox{queue-out:} & \mbox{ +\begin{tabular}[hbt]{| c | c | c |} + \hline + incoming & outgoing & pool \\ + \hline + \hline + - & 0700 & 0600 \\ + \hline + - & 0700 & - \\ + \hline + - & - & - \\ + \hline +\end{tabular} +} \\ + +\end{tabular} A sample header file. \begin{verbatim} @@ -523,7 +656,7 @@ -\subsection{Rights and permission} +\subsubsection*{Rights and permission} The user set required for \qmail\ seems to be too complex. One special user, like \postfix\ uses, is more appropriate. \name{root} privilege and \name{setuid} permission is avoided as much as possible. @@ -567,31 +700,47 @@ +http://fanf.livejournal.com/50917.html %how not to design an mta - the sendmail command +http://fanf.livejournal.com/51349.html %how not to design an mta - partitioning for security +http://fanf.livejournal.com/61132.html %how not to design an mta - local delivery +http://fanf.livejournal.com/64941.html %how not to design an mta - spool file format +http://fanf.livejournal.com/65203.html %how not to design an mta - spool file logistics +http://fanf.livejournal.com/65911.html %how not to design an mta - more about log-structured MTA queues +http://fanf.livejournal.com/67297.html %how not to design an mta - more log-structured MTA queues +http://fanf.livejournal.com/70432.html %how not to design an mta - address verification +http://fanf.livejournal.com/72258.html %how not to design an mta - content scanning + + + + + + + + \section{Directions to go} +Now how could \masqmail\ be like in, say, five years? + This section discusses about what shapes \masqmail\ could have---which directions the development could go to. -\subsubsection*{\masqmail\ in five years} -Now how could \masqmail\ be like in, say, five years? ---- +1) fix the current version -A design from scratch? -<< what would be needed (effort) >> + +2) create a new one But how is the effort of this complete rewrite compared to what is gained afterwards? - << would one create it at all? >> ---- +pro---contra -\subsubsection*{Work to do} + << short term goals --- long term goals >>