docs/diploma

view thesis/pieces/old/1-Masqmail.tex @ 148:5f7beb2142d6

small corrections
author meillo@marmaro.de
date Tue, 16 Dec 2008 14:09:23 +0100
parents eed87bfa622d
children
line source
1 \chapter{\masqmail}
3 %TODO: have text by oliver here?
6 \section{Target field}
7 Its original author, Oliver Kurth, sees \masqmail\ so:
8 \begin{quote}
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.
10 \end{quote}
12 \masqmail\ is inteded to cover a specific niche: non-permanent internet connection and different \NAME{ISP}s.
14 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:
15 \begin{quote}
16 In these cases, MasqMail is a slim replacement for full-blown MTAs such as sendmail, exim, qmail or postfix.
17 \end{quote}
18 \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.
20 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.
22 Further more does \masqmail\ respect online connections through different \NAME{ISP}s; a common thing for dial-up connections. In particular can different sender addresses be set, dependent on the \NAME{ISP} that is used. This prevents mail to be likely classified as spam.
26 \section{Typical usage}
27 This section describes situations that make senseful use of \masqmail.
29 A home network consisting of some workstations without a server. The network is connected to the internet by dial-up or broadband. Going online is initiated by computers inside the local net. \NAME{IP} addresses change at least once every day.
31 Every workstation would be equiped with \masqmail. Mail transfer within the same machine or within the local net works straight forward. Outgoing mail to the internet is sent, to the concerning \NAME{ISP} for relaying, whenever the router goes online. Receiving of mail from outside needs to be done by a mail fetch program, like the \masqmail\ internal \NAME{POP3} client or \name{fetchmail} for example. The configuration for \masqmail\ would be the same on every computer, except the hostname.
33 For the same network but having a server, one could have \masqmail\ running on the server and using simple forwarders (see \ref{subsec:relay-only}) to the server on the workstations. This setup does only support mail transfer to the server, but not back to a workstation; also sending mail to another user on the same workstation is not possible.
35 A better setup is to run \masqmail\ on every machine %FIXME
39 \section{What makes it special}
41 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.
43 Workstations use %FIXME
46 \section{Alternatives?}
47 % http://anfi.homeunix.org/sendmail/dialup10.html
50 \section{Structure}
51 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.
53 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+.
55 %masqmail: mailq, mailrm, runq, rmail, smtpd/in.smtpd
56 %sendmail: hoststat, mailq, newaliases, purgestat, smtpd
58 \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.
60 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.
62 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.
64 \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.
67 \section{Features}
68 This overview regards \masqmail version 0.2.21, the state this document starts off.
70 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.
72 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.
74 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.
76 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.
80 \section{History}
81 %TODO: let oliver prove read it!
82 %FIXME: add references
83 %FIXME: where does the name come from: masqdialer (guessed)
85 The date of the first release (version 0.0.1) is unknown.
86 The only information available is, that it was packaged for \debian\ at 15\nth\ of September in 1999.
87 Further releases were made every few weeks or month during 2000, 2001 and 2002.
88 Development ended in mid-2003 in a hard stop.
89 The last ordinary release known to me is version 0.2.20, released on 4\nth\ of June in 2003.
91 During the time of development, Oliver released 53 versions.
92 That means a new release in less than every 20 days in average!
94 Mentionable are the four \emph{beta} releases of version 0.1.8 (named with the trailing letters `a' to `d') in winter 2000/2001 and the security-fix 0.1.15.1 in 2002.
96 One extra release (version 0.2.21) was made by him in November 2005.
97 This one is only available from the \debian\ pool.
98 Comparing it to version 0.2.20 shows, that no source code was altered.
99 Only building documents (like Makefiles) and \debian\ packageing documents were changed.
100 That leeds to the assumption that this last release was specificly created for the needs of \debian---to fix some errors in the package.
102 In May 2000 the minor version number increased to `1'.
103 Nothing special is mentioned in the documentation about that.
104 When it increased again to start the 0.2.x releases, Oliver titled them as the ``development branch'' of \masqmail.
105 At that second time, he started developing the 0.2.x ``development branch'', continuing to work on the 0.1.x series.
106 His parallel work on both branches lasted for four month, and one additional last release, numbered 0.1.17, one more year later.