1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<head>
<title>Mail Avenger Installation Instructions</title>
<style type="text/css">
<!--
body {
margin: 4em 10% 4em 10%;
background-color:white;
color:black;
font-family: sans-serif;
}
#title {
font-size: xx-large;
//font-size: 250%;
font-weight: bold;
}
.file {
font-family: monospace;
}
.env {
font-size: 80%;
font-weight: bold;
}
.config {
color: olive;
}
.man {
color: red;
font-style: italic;
text-decoration: none;
}
.textlink {
color: red;
text-decoration: none;
}
.url {
color: red;
text-decoration: none;
font-family: monospace;
}
.avenger {
color: black;
text-decoration: underline;
}
.warning {
color: red;
//font-weight: bold;
font-style: italic;
}
.cmd {
font-family: monospace;
font-variant: normal;
color: navy;
}
ul.spaced > li {
margin: .8em 0px;
}
ol.spaced > li {
margin: .8em 0px;
}
ol.spaced {
margin: 0px 0px 1.5em 0px;
}
.samp {
margin: 1em 0px 1em 2em;
}
a { text-decoration: none }
//-->
</style>
</head>
<body>
<h1><a class="avenger" href="http://www.mailavenger.org/">Mail
Avenger</a> Installation Instructions</h1>
The following is a brief list of things to do to install and configure
Mail Avenger.
<p>
<b>Installation:</b> Follow these steps to compile and install Mail
Avenger from source. If your operating system comes with a port or
package of mail avenger, you can skip ahead to <a
href="#config" class="textlink">Configuration</a>.
<ol start="0" class="spaced">
<li>
Install BerkeleyDB database version 4.1 or later, if you do not
already have it. Most operating systems come with an optional
port/package for BerkeleyDB, making it easy to install. (Check for a
package name like "db" or"db4".) Alternatively, you can download and
install BerkeleyDB from <a class="url"
href="http://www.sleepycat.com/">http://www.sleepycat.com/</a>.
<li>
Compile <a class="textlink"
href="http://www.mailavenger.org/dist/">the software</a> using the
standard GNU autoconf script, which requires running the following
commands:
<pre class="samp">
gzip -dc <a class="textlink" href="http://www.mailavenger.org/avenger.tar.gz">avenger-x.x.tar.gz</a> | tar xvf -
cd avenger-x.x
./configure
make
</pre>
Note that if you want Mail Avenger to support SASL authentication, you
should first install the Cyrus SASL2 library from <a class="url"
href="ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/">ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/</a>,
then, when following the above instructions, configure Mail Avenger
using the command:
<pre class="samp">
./configure --enable-sasl
</pre>
<li>Install the software by running the following command as root:
<pre class="samp">
make install
</pre>
</ol>
<a name="config">
<p><b>Configuration:</b> Once Mail Avenger is installed, you must
configure <span class="cmd">asmtpd</span>, the avenger SMTP daemon.
<ol class="spaced" start="3">
<li>
Create a user called avenger on your system. This is the user ID
under which system-wide avenger scripts will run. (If you wish to use
a name other than "avenger", you can put the directive "<span
class="config">AvengerUser</span> <username>" in the
<tt>asmtpd.conf</tt> configuration file when you create that.)
<p>
<li>
If you run <span class="cmd">sendmail</span>, make sure the avenger
user you just created has permission to read the sendmail alias
database (by default <tt>/etc/mail/aliases.db</tt>). On some systems,
sendmail will stubbornly keep changing the alias database so that it
is only readable by group wheel, in which case you must add the
avenger user to the wheel group.
<p>
<li>Create the directory <tt>/etc/avenger</tt> and populate it with
sample configuration files with the following commands:
<pre class="samp">
mkdir /etc/avenger
cp /usr/local/share/avenger/asmtpd.conf /etc/avenger/
cp /usr/local/share/avenger/unknown /etc/avenger/
</pre>
<p>
<li>Edit the file <tt>/etc/avenger/asmtpd.conf</tt>. By default, it
is configured for sendmail. You will almost certainly need to edit it
if you are using another MTA, and even with sendmail you will probably
want to look over all the configuration options anyway. See the <a
href="http://www.mailavenger.org/asmtpd.conf.html"
class="man">asmtpd.conf(5)</a> man page for more information about the
format of this file.
<p>
<li>
Edit the file <tt>/etc/avenger/unknown</tt> to handle unknown users
properly. This script governs what happens to mail for users who are
not in the password file, who have uid 0, or who don't have valid
shells.
<p>
<ul>
<li>If you are running <span class="cmd">sendmail</span> and your alias file is
<tt>/etc/mail/aliases.db</tt>, the sample file is okay <span
class="warning">as long as the avenger user can read the
<tt>aliases.db</tt> file</span>.
<p>
<li>If you are running <span class="cmd">qmail</span>, you must
uncomment the <tt>QMAIL_OPT</tt> line. However, <span
class="warning">this only works if you are not using the qmail
<tt>users/assign</tt> file</span>.
<p>
<li>If you are running any other MTA, or are using qmail with the
<tt>users/assign</tt> file, you will have to write your own, custom
<tt>/etc/avenger/unknown</tt> script.
<p>
You can alternatively just delete <tt>/etc/avenger/unknown</tt>
entirely. You won't lose mail, but your system will then send back
bounce messages for unknown users, which is less efficient than
rejecting mail during the SMTP transaction. (Of course, <span
class="cmd">asmtpd</span> will still use SPF to reject forged mail
outright.)
</ul>
<li>
Create a file <tt>/etc/avenger/domains</tt>. List each domain for
which you would like to receive mail, followed by a colon, one per
line. For example:
<pre class="samp">
my.first.domain:
my.second.domain:
</pre>
<li>
Fire it up! Run the command <span class="cmd">asmtpd</span> as root.
You may also want to set things up to run this command automatically
on system startup.
</ol>
<p>
<b>Optional steps:</b> Once you have the Avenger SMTP daemon up and
running, you may wish to do any of the following.
<ul class="spaced">
<li>
Publish SPF records for your domains, if you haven't already. See <a
class="url" href="http://www.openspf.org/">http://www.openspf.org/</a>
or the handy configuration wizard at <a class="url"
href="http://www.openspf.org/wizard.html">http://www.openspf.org/wizard.html</a>
for more information on SPF.
<li>
Play with more scripts. Read the man page for <a
href="http://www.mailavenger.org/avenger.html"
class="man">avenger(1)</a>, create a <tt>.avenger/rcpt</tt> file in
your home directory, and maybe create a site-wide default file
<tt>/etc/avenger/default</tt>.
<li>
Configure the avenger local delivery agent, <span
class="cmd">avenger.local</span>. (See the <a
href="http://www.mailavenger.org/avenger.local.html"
class="man">avenger.local(8)</a> man page for more information.)
<ul class="spaced">
<li>If you use <span class="cmd">sendmail</span>, include <a
href="http://www.mailavenger.org/avsendmail.m4"
class="textlink"><tt>/usr/local/share/avenger/avsendmail.m4</tt></a>
towards the end of the "<tt>.mc</tt>" file you use to generate
<tt>sendmail.cf</tt> with the following line:
<pre class="samp">
include(`/usr/local/share/avenger/avsendmail.m4')
</pre>
<li>If you use <span class="cmd">postfix</span>, add the following
lines to <tt>/etc/postfix/mail.cf</tt>, but be sure to substitute the
correct path for <span class="cmd">mail.local</span>:
<pre class="samp">
prepend_delivered_header = forward, file
mailbox_command = /usr/local/libexec/avenger.local
--fallback /usr/libexec/mail.local
-D "$RECIPIENT" -d "$LOCAL"
</pre>
<li>If you use <span class="cmd">qmail</span>, you don't really need
to install <span class="cmd">avenger.local</span>, because qmail
already has a similar mechanism for delivering extension addresses.
</ul>
</ul>
</ul>
</body>
|