docs/diploma

annotate thesis/attic/old/1-Masqmail.tex @ 329:c4d78cd40827

new ipc state diagram pic
author meillo@marmaro.de
date Fri, 23 Jan 2009 21:55:37 +0100
parents 3b5ba7331eb5
children
rev   line source
meillo@34 1 \chapter{\masqmail}
meillo@27 2
meillo@27 3 %TODO: have text by oliver here?
meillo@27 4
meillo@27 5
meillo@26 6 \section{Target field}
meillo@74 7 Its original author, Oliver Kurth, sees \masqmail\ so:
meillo@78 8 \begin{quote}
meillo@74 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.
meillo@78 10 \end{quote}
meillo@74 11
meillo@74 12 \masqmail\ is inteded to cover a specific niche: non-permanent internet connection and different \NAME{ISP}s.
meillo@74 13
meillo@74 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:
meillo@78 15 \begin{quote}
meillo@74 16 In these cases, MasqMail is a slim replacement for full-blown MTAs such as sendmail, exim, qmail or postfix.
meillo@78 17 \end{quote}
meillo@78 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.
meillo@74 19
meillo@74 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.
meillo@74 21
meillo@74 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.
meillo@74 23
meillo@27 24
meillo@27 25
meillo@26 26 \section{Typical usage}
meillo@74 27 This section describes situations that make senseful use of \masqmail.
meillo@74 28
meillo@74 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.
meillo@74 30
meillo@74 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.
meillo@74 32
meillo@74 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.
meillo@74 34
meillo@74 35 A better setup is to run \masqmail\ on every machine %FIXME
meillo@74 36
meillo@27 37
meillo@27 38
meillo@26 39 \section{What makes it special}
meillo@27 40
meillo@74 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.
meillo@74 42
meillo@78 43 Workstations use %FIXME
meillo@78 44
meillo@27 45
meillo@26 46 \section{Alternatives?}
meillo@58 47 % http://anfi.homeunix.org/sendmail/dialup10.html
meillo@27 48
meillo@78 49
meillo@26 50 \section{Structure}
meillo@78 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.
meillo@78 52
meillo@78 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+.
meillo@78 54
meillo@78 55 %masqmail: mailq, mailrm, runq, rmail, smtpd/in.smtpd
meillo@78 56 %sendmail: hoststat, mailq, newaliases, purgestat, smtpd
meillo@78 57
meillo@78 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.
meillo@78 59
meillo@78 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.
meillo@78 61
meillo@78 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.
meillo@78 63
meillo@78 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.
meillo@27 65
meillo@27 66
meillo@26 67 \section{Features}
meillo@83 68 This overview regards \masqmail version 0.2.21, the state this document starts off.
meillo@83 69
meillo@78 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.
meillo@78 71
meillo@78 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.
meillo@78 73
meillo@78 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.
meillo@78 75
meillo@78 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.
meillo@78 77
meillo@27 78
meillo@27 79
meillo@26 80 \section{History}
meillo@27 81 %TODO: let oliver prove read it!
meillo@27 82 %FIXME: add references
meillo@84 83 %FIXME: where does the name come from: masqdialer (guessed)
meillo@26 84
meillo@47 85 The date of the first release (version 0.0.1) is unknown.
meillo@47 86 The only information available is, that it was packaged for \debian\ at 15\nth\ of September in 1999.
meillo@47 87 Further releases were made every few weeks or month during 2000, 2001 and 2002.
meillo@47 88 Development ended in mid-2003 in a hard stop.
meillo@62 89 The last ordinary release known to me is version 0.2.20, released on 4\nth\ of June in 2003.
meillo@27 90
meillo@47 91 During the time of development, Oliver released 53 versions.
meillo@47 92 That means a new release in less than every 20 days in average!
meillo@27 93
meillo@27 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.
meillo@27 95
meillo@47 96 One extra release (version 0.2.21) was made by him in November 2005.
meillo@47 97 This one is only available from the \debian\ pool.
meillo@47 98 Comparing it to version 0.2.20 shows, that no source code was altered.
meillo@47 99 Only building documents (like Makefiles) and \debian\ packageing documents were changed.
meillo@47 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.
meillo@27 101
meillo@47 102 In May 2000 the minor version number increased to `1'.
meillo@47 103 Nothing special is mentioned in the documentation about that.
meillo@47 104 When it increased again to start the 0.2.x releases, Oliver titled them as the ``development branch'' of \masqmail.
meillo@47 105 At that second time, he started developing the 0.2.x ``development branch'', continuing to work on the 0.1.x series.
meillo@47 106 His parallel work on both branches lasted for four month, and one additional last release, numbered 0.1.17, one more year later.
meillo@27 107