docs/diploma

changeset 78:3148ed044103

wrote about structure and features of masqmail; quotation -> quote
author meillo@marmaro.de
date Thu, 06 Nov 2008 17:50:25 +0100
parents a6d67c5f7d78
children 211e2ea6ddf8
files thesis/tex/1-Introduction.tex thesis/tex/1-Masqmail.tex
diffstat 2 files changed, 40 insertions(+), 41 deletions(-) [+]
line diff
     1.1 --- a/thesis/tex/1-Introduction.tex	Thu Nov 06 16:40:27 2008 +0100
     1.2 +++ b/thesis/tex/1-Introduction.tex	Thu Nov 06 17:50:25 2008 +0100
     1.3 @@ -38,22 +38,22 @@
     1.4  
     1.5  Here are definitions from others:
     1.6  
     1.7 -\begin{quotation}
     1.8 +\begin{quote}
     1.9  A mail transfer agent (MTA) is a highly specialized program that delivers mail and transports it between machines, like the post office.
    1.10  \cite{costales97}
    1.11 -\end{quotation}
    1.12 +\end{quote}
    1.13  
    1.14 -\begin{quotation}
    1.15 +\begin{quote}
    1.16  A mail transfer agent (MTA) (also called a mail transport agent, message transfer agent, or smtpd (short for SMTP daemon)), is a computer program or software agent that transfers electronic mail messages from one computer to another.
    1.17  \citeweb{wikipedia:mta}
    1.18 -\end{quotation}
    1.19 +\end{quote}
    1.20  
    1.21 -\begin{quotation}
    1.22 +\begin{quote}
    1.23  mail server (also known as a mail transfer agent or MTA, a mail transport agent, a mail router or an Internet mailer) is an application that receives incoming e-mail from local users (people within the same domain) and remote senders and forwards outgoing e-mail for delivery.
    1.24  \citeweb{website:techtarget}
    1.25 -\end{quotation}
    1.26 +\end{quote}
    1.27  
    1.28 -\begin{quotation}
    1.29 +\begin{quote}
    1.30  Message Transfer Agent - (MTA, Mail Transfer Agent): Any program responsible for delivering e-mail messages. Upon receiving a message from a Mail User Agent or another MTA, [...] it [...] delivers it to any local addressees and/or forwards it to other remote MTAs (routing) for delivery to remote recipients.
    1.31  %Any program responsible for delivering e-mail messages. Upon receiving a message from a Mail User Agent or another MTA, often by SMTP over the Internet, it stores it temporarily locally and analyses the recipients and delivers it to any local addressees and/or forwards it to other remote MTAs (routing) for delivery to remote recipients. In either case it may edit and/or add to the message headers.
    1.32  %
    1.33 @@ -61,7 +61,7 @@
    1.34  %
    1.35  %RFC 2821 (SMTP) expands MTA as ``Mail Transfer Agent'' though this is less common. Alternatives with ``Transport'' are also seen but less correct.
    1.36  \citeweb{website:thefreedictionary}
    1.37 -\end{quotation}
    1.38 +\end{quote}
    1.39  
    1.40  Common is the transfer of mail to other machines; this is the actual job. \MTA{}s work with mail, received from local users and/or remote machines. Mail delivery however is \emph{not} what \mta{}s are for, although probably every \MTA\ is able to deliver mail, and many do. \name{mail delivery agents} (short: \NAME{MDA}) are the programs for this job. Two of the best known \NAME{MDA}s are \name{procmail} and \name{maildrop}.
    1.41  
    1.42 @@ -78,9 +78,9 @@
    1.43  \cite[page xviii]{costales97}
    1.44  
    1.45  Others see \sendmail's success more critical. One of them is quoted in the \name{MMDF} FAQs \citeweb{faqs:mmdf}:
    1.46 -\begin{quotation}
    1.47 +\begin{quote}
    1.48  Sendmail was once compared by one old Internet hand to ``those killer bees that escaped from the laboratory---and now they're everywhere and you can't get rid of 'em''.
    1.49 -\end{quotation}
    1.50 +\end{quote}
    1.51  He definately hints here at \sendmail's many security vulnerabilities that came to light and on its complexity, in particular its obscure configuration file \path{sendmail.cf}.
    1.52  
    1.53  No matter how \sendmail\ is seen, one must admit its influence on \unix\ emailing programs. Most existing substitutes mimic \sendmail's interface and behavior. Most notable, they create a symbolic link named ``sendmail'' pointing to their own executable. The reason herefor are the many programs assuming an executable called ``sendmail'' on every computer system existing.
     2.1 --- a/thesis/tex/1-Masqmail.tex	Thu Nov 06 16:40:27 2008 +0100
     2.2 +++ b/thesis/tex/1-Masqmail.tex	Thu Nov 06 17:50:25 2008 +0100
     2.3 @@ -5,17 +5,17 @@
     2.4  
     2.5  \section{Target field}
     2.6  Its original author, Oliver Kurth, sees \masqmail\ so:
     2.7 -\begin{quotation}
     2.8 +\begin{quote}
     2.9  MasqMail is a mail server designed for hosts that do not have a permanent internet connection eg. a home network or a single host at home. It has special support for connections to different ISPs. It replaces sendmail or other MTAs such as qmail or exim.
    2.10 -\end{quotation}
    2.11 +\end{quote}
    2.12  
    2.13  \masqmail\ is inteded to cover a specific niche: non-permanent internet connection and different \NAME{ISP}s.
    2.14  
    2.15  Although it can basically replace other \MTA{}s, it is not generally aimed to do so. The package description of \debian\citeweb{packages.debian:masqmail} states this more clearly by changing the last sentence to:
    2.16 -\begin{quotation}
    2.17 +\begin{quote}
    2.18  In these cases, MasqMail is a slim replacement for full-blown MTAs such as sendmail, exim, qmail or postfix.
    2.19 -\end{quotation}
    2.20 -\masqmail\ is a good replacement ``in these cases'', but not generally, since is lacks features essential for running on mail servers. It is primarily not secure enough for being accessable from untrusted locations. %Nevertheless has \masqmail\ this field of action, where it is better suited for than other \MTA{}s.
    2.21 +\end{quote}
    2.22 +\masqmail\ is a good replacement ``in these cases'', but not generally, since is lacks features essential for running on mail servers. It is primarily not secure enough for being accessable from untrusted locations.
    2.23  
    2.24  The program is best used in home networks, which are non-permanently connected to the internet. \masqmail\ sends mail to local destinations, like users on the same machine and on other machines in the local net, immediately. Email to recipients outside the local net are queued when offline and sent when a online connection gets established.
    2.25  
    2.26 @@ -34,46 +34,45 @@
    2.27  
    2.28  A better setup is to run \masqmail\ on every machine %FIXME
    2.29  
    2.30 -%How it works
    2.31 -%
    2.32 -%When offline, MasqMail queues all mail with a destination outside of the local network. When you connect to the internet, masqmail will be called with a connection name as an argument. MasqMail then sends the queued mail to the configured mailserver for that ISP. When a message from the local net is received when online, MasqMail delivers it immediately. If there is no mail server for that ISP, MasqMail can also send the mails directly to their destinations.
    2.33 -%
    2.34 -%For each ISP different return addresses can be configured. This makes it possible to get around spam traps which desire your return address to be from the same domain as the host the mail is coming from. This is not a problem if you always connect to a single ISP, but is one if you use different ones from time to time. It also makes it possible to configure your mailer to a return address on your local network which maybe totally unknown outside. So delivery failure messages originating on your local net can be sent directly to you, while those that occur outside will be sent to the configured address. (Note that the return path is different from the From: address or the Reply-to: address. You can still have a single address where you want replys to be sent to).
    2.35 -%
    2.36 -%When offline, MasqMail behaves just like any other ordinary mail server (with a few limitations, but these will be fixed in the future).
    2.37 -%
    2.38 -%To detect its online status, MasqMail can take advantage of the masqdialer system. But it also works well without it.
    2.39 -
    2.40  
    2.41  
    2.42  \section{What makes it special}
    2.43  
    2.44  As main advantage, \masqmail\ makes it easy to set up an \MTA\ on workstations or notebooks without the need to do complex configuration or to be an mail server expert.
    2.45  
    2.46 -Workstations use
    2.47 +Workstations use %FIXME
    2.48 +
    2.49  
    2.50  \section{Alternatives?}
    2.51  % http://anfi.homeunix.org/sendmail/dialup10.html
    2.52  
    2.53 +
    2.54  \section{Structure}
    2.55 +Like its anchestor \sendmail, \masqmail\ is a monolitic program. It consists of only one \emph{setuid root}\footnote{Runs as user root, no matter which user invoked it.}\index{setuid root} binary file, named \path{masqmail}. All functionality is included in it; of course some more comes from dynamic libraries linked.
    2.56 +
    2.57 +The \masqmail\ executable can be called under various names for \name{sendmail-compatibility} reasons. This is commonly organized by creating symbolic links with with different names to the \masqmail\ executable. These are \path{/usr/lib/sendmail} and \path{/usr/sbin/sendmail} because many programs expect a \mta\ to be located there. Further more \sendmail\ provides shortcuts by calling it with a different name instead of supplying command line arguments. The best known of it is \path{mailq}, which is equivilent to calling the \MTA\ with the argument \verb+-bq+. \masqmail\ reacts to the names \path{mailq}, \path{smtpd}, \path{mailrm}, \path{runq}, \path{rmail}, and \path{in.smtpd}. The last four are an addition to \sendmail. Not implemented is the name \path{newaliases} because it is not relevant to \masqmail. To provide the command nonetheless, one may write a shell script located at \path{/usr/bin/newaliases}, that simply invokes \verb+masqmail -bi+.
    2.58 +
    2.59 +%masqmail: mailq, mailrm, runq, rmail, smtpd/in.smtpd
    2.60 +%sendmail: hoststat, mailq, newaliases, purgestat, smtpd
    2.61 +
    2.62 +\masqmail\ is written in the \NAME{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.
    2.63 +
    2.64 +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. (The unsafe \verb+sprintf()+ is one example.) Also it offers handy data containers, easy-to-use implementations of data structures, and much more.
    2.65 +
    2.66 +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.
    2.67 +
    2.68 +\masqmail\ does not provide an interface for modules with additional functionality. There exists no add-on or module system. But the code is separated by function to the various source files, and some functional parts can be included or excluded by defining symbols. This means adding some argument (like \verb+--enable-maildir+) to the \verb+configure+ call. Thus the concerning code gets not removed by the preprocessor.
    2.69  
    2.70  
    2.71  \section{Features}
    2.72 -\begin{itemize}
    2.73 -	\item Delivers only when online to a destination 'outside' your LAN
    2.74 -	\item Support for multiple Providers (ie. Mail Servers, or direct delivery)
    2.75 -	\item Rewriting of Return addresses (Return-Path:, From:, Reply-To:), configurable for each Provider separately
    2.76 -	\item can also be used as a Mail Server on a LAN
    2.77 -	\item alias support
    2.78 -	\item delivery to pipes
    2.79 -	\item delivery to MDAs (eg. procmail)
    2.80 -	\item Maildir support (version >= 0.2.5)
    2.81 -	\item routing depending on sender
    2.82 -	\item AUTH (RFC 2554) support (as client, since version 0.1.0)
    2.83 -	\item SMTP-after-POP
    2.84 -	\item POP3 client
    2.85 -	\item POP3 client daemon (fetch mail in regular intervals if online)
    2.86 -\begin{itemize}
    2.87 +First of all \masqmail\ is an \MTA. Therefor it 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 via \SMTP. Outgoing \SMTP\ connections feature \name{SMTP-Auth} and \name{SMTP-after-POP} authentication, but incoming \SMTP\ does not.
    2.88 +
    2.89 +As \masqmail\ is focused on non-permanent Internet connections, online state can be queried by three methods: reading from a file, reading the output of a command, or by asking an \name{mserver}. Each method may return a string indicating one of the available routes being online, or returning nothing to indicate offline state.
    2.90 +
    2.91 +Delivery to recipients on the local host or in local nets is done at once; delivery to recipients on the Internet is only done when being online, and queued otherwise. Each online route may have a different mail server to which mail is relayed. Return address headers are modified appropriate if wished.
    2.92 +
    2.93 +Additional to the \mta\ job, \masqmail\ also offers mail retrieval services with being a \NAME{POP3} client. Thus it can fetch mail from remote locations, dependent on the active online route.
    2.94 +
    2.95  
    2.96  
    2.97  \section{History}