Mercurial > docs > diploma
comparison thesis/tex/1-Introduction.tex @ 374:3445852ed736
applied comments by henry atting and jochen roth
author | meillo@marmaro.de |
---|---|
date | Mon, 02 Feb 2009 12:04:32 +0100 |
parents | d51894e48762 |
children | 91eb129dd695 |
comparison
equal
deleted
inserted
replaced
373:d51894e48762 | 374:3445852ed736 |
---|---|
50 | 50 |
51 Today most of the email is transferred using the \name{Simple Mail Transfer Protocol}\index{smtp} (short: \SMTP), which is defined in \RFC\,821 and the successors \RFC\,2821 and \RFC\,5321. A good entry point for further information is \citeweb{wikipedia:smtp}. | 51 Today most of the email is transferred using the \name{Simple Mail Transfer Protocol}\index{smtp} (short: \SMTP), which is defined in \RFC\,821 and the successors \RFC\,2821 and \RFC\,5321. A good entry point for further information is \citeweb{wikipedia:smtp}. |
52 | 52 |
53 A selection of important concepts of \SMTP\index{smtp!concepts of} is explained here. | 53 A selection of important concepts of \SMTP\index{smtp!concepts of} is explained here. |
54 | 54 |
55 First the \name{store and forward}\index{smtp!store and forward} transfer concept. This means mail messages are sent from \MTA\ to \MTA, until the final \MTA\ (the one which is responsible for the recipient) is reached. The message is gets stored for some time on each \MTA, until it is forwarded to the next \MTA. | 55 First the \name{store and forward}\index{smtp!store and forward} transfer concept. This means mail messages are sent from \MTA\ to \MTA, until the final \MTA\ (the one which is responsible for the recipient) is reached. The message is stored for some time on each \MTA, until it is forwarded to the next \MTA. |
56 | 56 |
57 This leads to the concept of \name{responsibility}\index{smtp!responsibility}. A mail message is always in the responsibility of one system. First it is the \MUA\index{mua}. When it is transferred to an \MTA, this \MTA\ takes over the responsibility for the message too. The \MUA{} can then delete its copy of the message. This is the same for each transfer---from \MTA\ to \MTA\ and finally from \MTA\ to the \MDA{}---the message gets transferred and if the transfer was successful, the responsibility for the message is transferred as well. The responsibility chain ends at a user's mailbox where he himself has control on the message. | 57 This leads to the concept of \name{responsibility}\index{smtp!responsibility}. A mail message is always in the responsibility of one system. First it is the \MUA\index{mua}. When it is transferred to an \MTA, this \MTA\ takes over the responsibility for the message too. The \MUA{} can then delete its copy of the message. This is the same for each transfer---from \MTA\ to \MTA\ and finally from \MTA\ to the \MDA{}---the message gets transferred and if the transfer was successful, the responsibility for the message is transferred as well. The responsibility chain ends at a user's mailbox where he himself has control on the message. |
58 | 58 |
59 A third concept is about failure handling. At any step on the way an \MTA\ may receive a message it is unable to handle. In such a case this receiving \MTA\ will \name{reject}\index{smtp!rejecting} the message before it takes responsibility for it. The sending \MTA\ still has responsibility for the message and may try other ways for sending the message. If none succeeds the \MTA\ will send a \name{bounce message}\index{smtp!bouncing} back to the original sender with information on the type of failure. Bounces are only sent if the failure is expected to be permanent or if the transfer still was unsuccessful after many tries. | 59 A third concept is about failure handling. At any step on the way an \MTA\ may receive a message it is unable to handle. In such a case this receiving \MTA\ will \name{reject}\index{smtp!rejecting} the message before it takes responsibility for it. The sending \MTA\ still has responsibility for the message and may try other ways for sending the message. If none succeeds the \MTA\ will send a \name{bounce message}\index{smtp!bouncing} back to the original sender with information on the type of failure. Bounces are only sent if the failure is expected to be permanent or if the transfer still was unsuccessful after many tries. |
60 | 60 |
74 | 74 |
75 Email messages are put into \name{envelopes}\index{mail message!envelope} for transfer. This concept is also derived from the real world so it is easy to understand. The envelope is used to route the message from sender to recipient. It contains the sender's address and addresses of one or more recipients. Envelopes are generated by \MTA{}s, usually from mail header data. The user has not to deal with them. | 75 Email messages are put into \name{envelopes}\index{mail message!envelope} for transfer. This concept is also derived from the real world so it is easy to understand. The envelope is used to route the message from sender to recipient. It contains the sender's address and addresses of one or more recipients. Envelopes are generated by \MTA{}s, usually from mail header data. The user has not to deal with them. |
76 | 76 |
77 Each \MTA\ on the way reads envelopes it receives and generates new ones. If a message has recipients on different hosts, then the message gets copied and sent within multiple envelopes, one for each host. | 77 Each \MTA\ on the way reads envelopes it receives and generates new ones. If a message has recipients on different hosts, then the message gets copied and sent within multiple envelopes, one for each host. |
78 | 78 |
79 The sample message would would lead to two envelopes\index{mail message!more envelopes}, one from \name{markus@host01} to \name{alice@host02}, the other from \name{markus@host01} to \name{bob@host03}. Both envelopes would contain the same message. | 79 The sample message would lead to two envelopes\index{mail message!more envelopes}, one from \name{markus@host01} to \name{alice@host02}, the other from \name{markus@host01} to \name{bob@host03}. Both envelopes would contain the same message. |
80 | 80 |
81 | 81 |
82 | 82 |
83 | 83 |
84 | 84 |
112 Although it can basically replace other \MTA{}s it is not \emph{generally} aimed to do so. The package description of \masqmail\ within \debian\ states this more clearly by changing the last sentence to: | 112 Although it can basically replace other \MTA{}s it is not \emph{generally} aimed to do so. The package description of \masqmail\ within \debian\ states this more clearly by changing the last sentence to: |
113 \begin{quote} | 113 \begin{quote} |
114 In these cases, MasqMail is a slim replacement for full-blown \MTA{}s such as sendmail, exim, qmail or postfix. | 114 In these cases, MasqMail is a slim replacement for full-blown \MTA{}s such as sendmail, exim, qmail or postfix. |
115 \hfill\citeweb{packages.debian:masqmail} | 115 \hfill\citeweb{packages.debian:masqmail} |
116 \end{quote} | 116 \end{quote} |
117 The program is a good replacement ``in these cases'', but not generally, since is lacks essential features for running on mail servers. It is primarily not secure enough for being accessible from untrusted locations. | 117 The program is a good replacement ``in these cases'', but not generally, since it lacks essential features for running on mail servers. It is primarily not secure enough for being accessible from untrusted locations. |
118 | 118 |
119 \masqmail\ is best used in home networks, which are non-permanently connected to the Internet. It is easy configurable for situations which are rarely solvable with the common \MTA{}s. Such include different handling of mail to local or remote destination and respecting different routes of being online connection. These features are explained in more detail in the following \name{Features} section on page \ref{sec:masqmail-features}. %fixme: is it still called ``features''? | 119 \masqmail\ is best used in home networks, which are non-permanently connected to the Internet. It is easy configurable for situations which are rarely solvable with the common \MTA{}s. Such include different handling of mail to local or remote destination and respecting different routes of being online connection. These features are explained in more detail in the following \name{Features} section on page \ref{sec:masqmail-features}. %fixme: is it still called ``features''? |
120 | 120 |
121 While many other \MTA{}s are general purpose \MTA{}s, \masqmail\ aims on special situations. Nevertheless, it can be used as general purpose \MTA, too. Especially this was a design goal of \masqmail: To be a replacement for \sendmail, or similar well known \MTA{}s. | 121 While many other \MTA{}s are general purpose \MTA{}s, \masqmail\ aims on special situations. Nevertheless, it can be used as general purpose \MTA, too. Especially this was a design goal of \masqmail: To be a replacement for \sendmail, or similar well known \MTA{}s. |
122 | 122 |
124 | 124 |
125 | 125 |
126 | 126 |
127 \subsubsection*{Typical usage scenarios} | 127 \subsubsection*{Typical usage scenarios} |
128 | 128 |
129 This section describes three common setups that makes sensible use of \masqmail. The first two are shown in figure \ref{fig:masqmail-typical-usage}. | 129 This section describes three common setups that make sensible use of \masqmail. The first two are shown in figure \ref{fig:masqmail-typical-usage}. |
130 | 130 |
131 \begin{figure} | 131 \begin{figure} |
132 \begin{center} | 132 \begin{center} |
133 \includegraphics[scale=0.75]{img/masqmail-typical-usage.eps} | 133 \includegraphics[scale=0.75]{img/masqmail-typical-usage.eps} |
134 \end{center} | 134 \end{center} |
152 \label{scenario3} | 152 \label{scenario3} |
153 A third scenario is unrelated as it is about notebooks. Notebooks are usually used as mobile workstations. One uses them to work at different locations. With the increasing popularity of wireless networks this becomes more and more common. Different networks demand for different setups: In one network it is best to send mail to an \NAME{ISP} for relay. In another network it might be preferred to use a local mail server. A third network may have no Internet access at all, hence using a local mail server is required. All these different setups can be configured once and then used by simply telling the online state to \masqmail, even automatically within a network setup script. | 153 A third scenario is unrelated as it is about notebooks. Notebooks are usually used as mobile workstations. One uses them to work at different locations. With the increasing popularity of wireless networks this becomes more and more common. Different networks demand for different setups: In one network it is best to send mail to an \NAME{ISP} for relay. In another network it might be preferred to use a local mail server. A third network may have no Internet access at all, hence using a local mail server is required. All these different setups can be configured once and then used by simply telling the online state to \masqmail, even automatically within a network setup script. |
154 \end{description} | 154 \end{description} |
155 | 155 |
156 | 156 |
157 In general, all kinds of usage scenarios within a trusted network are possible. Important to notice is that mail can not be send from outside into the trusted network then. For using \masqmail\ on notebooks it is suggested to only accept mail from local users because notebooks are often in untrusted environments. | 157 In general, all kinds of usage scenarios within a trusted network are possible. Important to notice is that mail can not be sent from outside into the trusted network then. For using \masqmail\ on notebooks it is suggested to only accept mail from local users because notebooks are often in untrusted environments. |
158 | 158 |
159 | 159 |
160 | 160 |
161 | 161 |
162 \subsubsection*{Limitations} | 162 \subsubsection*{Limitations} |
185 | 185 |
186 | 186 |
187 | 187 |
188 \subsection{Features} | 188 \subsection{Features} |
189 | 189 |
190 Here regarded is version 0.2.21 of \masqmail. This is the last version released by \person{Oliver Kurth}. | 190 This thesis regards version 0.2.21 of \masqmail. This is the last version released by \person{Oliver Kurth}. |
191 | 191 |
192 | 192 |
193 \subsubsection*{The source code} | 193 \subsubsection*{The source code} |
194 | 194 |
195 \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 which contain about 9\,000 lines of code\footnote{Measured with \name{sloccount} by David A.\ Wheeler \citeweb{sloccount}.}. 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 has higher precedence in linking, though. | 195 \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 which contain about 9\,000 lines of code\footnote{Measured with \name{sloccount} by David A.\ Wheeler \citeweb{sloccount}.}. 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 has higher precedence in linking, though. |
232 | 232 |
233 Outgoing \SMTP\ connections feature \SMTP-\NAME{AUTH} and \SMTP-after-\NAME{POP} authentication but incoming connections do not. Using wrappers for outgoing connections is supported. This allows encrypted communication through a gateway application like \name{openssl}. | 233 Outgoing \SMTP\ connections feature \SMTP-\NAME{AUTH} and \SMTP-after-\NAME{POP} authentication but incoming connections do not. Using wrappers for outgoing connections is supported. This allows encrypted communication through a gateway application like \name{openssl}. |
234 | 234 |
235 Mail queuing is essential for \masqmail\ and thus supported of course, alias expansion is also supported. | 235 Mail queuing is essential for \masqmail\ and thus supported of course, alias expansion is also supported. |
236 | 236 |
237 The \masqmail\ executable can be called by various names for sendmail-compatibility reasons. As many programs expect the \MTA\ to be located at \path{/usr/lib/sendmail} or \path{/usr/sbin/sendmail}, symbolic links are pointing from there to the \masqmail\ executable. Further more does \sendmail\ supports calling it with a different name instead of supplying command line arguments. The best known of these shortcuts is \path{mailq} which is equivalent to calling it with the argument \verb+-bq+. \masqmail\ recognizes the shortcuts \path{mailq}, \path{smtpd}, \path{mailrm}, \path{runq}, \path{rmail}, and \path{in.smtpd}. The first two are inspired by \sendmail. Not implemented yet is the shortcut \path{newaliases} because \masqmail\ does not generate binary representations of the alias file.\footnote{A shell script named \path{newaliases} that invokes \texttt{masqmail -bi} can provide the command to satisfy strict requirements.} \path{hoststat} and \path{purgestat} are missing for complete sendmail-compatibility. | 237 The \masqmail\ executable can be called by various names for sendmail-compatibility reasons. As many programs expect the \MTA\ to be located at \path{/usr/lib/sendmail} or \path{/usr/sbin/sendmail}, symbolic links are pointing from there to the \masqmail\ executable. Furthermore does \sendmail\ supports calling it with a different name instead of supplying command line arguments. The best known of these shortcuts is \path{mailq} which is equivalent to calling it with the argument \verb+-bq+. \masqmail\ recognizes the shortcuts \path{mailq}, \path{smtpd}, \path{mailrm}, \path{runq}, \path{rmail}, and \path{in.smtpd}. The first two are inspired by \sendmail. Not implemented yet is the shortcut \path{newaliases} because \masqmail\ does not generate binary representations of the alias file.\footnote{A shell script named \path{newaliases} that invokes \texttt{masqmail -bi} can provide the command to satisfy strict requirements.} \path{hoststat} and \path{purgestat} are missing for complete sendmail-compatibility. |
238 %masqmail: mailq, mailrm, runq, rmail, smtpd/in.smtpd | 238 %masqmail: mailq, mailrm, runq, rmail, smtpd/in.smtpd |
239 %sendmail: hoststat, mailq, newaliases, purgestat, smtpd | 239 %sendmail: hoststat, mailq, newaliases, purgestat, smtpd |
240 | 240 |
241 Additional to the \MTA\ job, \masqmail\ also offers mail retrieval services by acting as a \NAME{POP3} client. It can fetch mail from different remote locations, also dependent on the active online connection. Such functionality is especially useful in a setup like \name{Scenario 2} on page \pageref{scenario2}. | 241 Additional to the \MTA\ job, \masqmail\ also offers mail retrieval services by acting as a \NAME{POP3} client. It can fetch mail from different remote locations, also dependent on the active online connection. Such functionality is especially useful in a setup like \name{Scenario 2} on page \pageref{scenario2}. |
242 | 242 |
257 \item Reading from a file | 257 \item Reading from a file |
258 \item Reading the output of a command | 258 \item Reading the output of a command |
259 \item Querying an \name{mserver} system | 259 \item Querying an \name{mserver} system |
260 \end{enumerate} | 260 \end{enumerate} |
261 | 261 |
262 Each method may return a string naming the routes that is online or returning nothing to indicate offline state. | 262 Each method may return a string naming the route that is online or returning nothing to indicate offline state. |
263 | 263 |
264 | 264 |
265 Mail for hosts inside the local network or for users on the local machine is not touched by this concept; such mail is always sent immediately. | 265 Mail for hosts inside the local network or for users on the local machine is not touched by this concept; such mail is always sent immediately. |
266 | 266 |
267 | 267 |