emailrelay/doc/readme.html
Graeme Walker 2a4d620121 v2.5
2023-08-10 12:00:00 +00:00

241 lines
7.7 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>E-MailRelay Readme</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" href="emailrelay.css" type="text/css">
</head>
<body>
<!-- index:0::::E-MailRelay Readme -->
<div class="div-main">
<h1><a class="a-header" name="H_1">E-MailRelay Readme</a></h1> <!-- index:1:H:E-MailRelay Readme -->
<h2><a class="a-header" name="SH_1_1">Introduction</a></h2> <!-- index:2:SH:1:1:Introduction -->
<p>
E-MailRelay is a lightweight SMTP store-and-forward mail server with POP access
to spooled messages. It can be used as a personal internet mail server with
SpamAssassin spam filtering and DNSBL connection blocking. Forwarding can be
to a fixed smarthost or using DNS MX routing. External scripts can be used for
address validation and e-mail message processing.
</p>
<img src="whatisit.png" alt="image">
<p>
E-MailRelay runs as a single process using the same non-blocking i/o model as
Squid and nginx giving excellent scalability and resource usage.
</p>
<h2><a class="a-header" name="SH_1_2">Quick start</a></h2> <!-- index:2:SH:1:2:Quick start -->
<p>
E-MailRelay can be run straight from the command-line, and on Windows you can
run <em>emailrelay.exe</em> or <em>emailrelay-textmode.exe</em> from the zip file without
going through the installation process.
</p>
<p>
To use E-MailRelay in store-and-forward mode use the <em>--as-server</em> option to
start the storage daemon in the background, and then do delivery of spooled
messages by running with <em>--as-client</em>.
</p>
<img src="serverclient.png" alt="image">
<p>
For example, to start a storage daemon in the background listening on port 10025
use a command like this:
</p>
<div class="div-pre">
<pre>emailrelay --as-server --port 10025 --spool-dir /tmp
</pre>
</div><!-- div-pre -->
<p>
On Windows use <em>c:/temp</em> for testing, rather than <em>/tmp</em>.
</p>
<p>
Or to run it in the foreground:
</p>
<div class="div-pre">
<pre>emailrelay --log --no-daemon --port 10025 --spool-dir /tmp
</pre>
</div><!-- div-pre -->
<p>
And then to forward the spooled mail to <em>smtp.example.com</em> run something
like this:
</p>
<div class="div-pre">
<pre>emailrelay --as-client smtp.example.com:25 --spool-dir /tmp
</pre>
</div><!-- div-pre -->
<p>
To forward continuously you can add the <em>--poll</em> and <em>--forward-to</em> options to
the server command-line:
</p>
<img src="forwardto.png" alt="image">
<p>
For example, this starts a server that also forwards spooled-up e-mail every
minute:
</p>
<div class="div-pre">
<pre>emailrelay --as-server --poll 60 --forward-to smtp.example.com:25
</pre>
</div><!-- div-pre -->
<p>
Or for a server that forwards each message as soon as it has been received, you
can use <em>--forward-on-disconnect</em>:
</p>
<div class="div-pre">
<pre>emailrelay --as-server --forward-on-disconnect --forward-to smtp.example.com:25
</pre>
</div><!-- div-pre -->
<p>
To edit or filter e-mail as it passes through the server specify your filter
program with the <em>--filter</em> option, something like this:
</p>
<div class="div-pre">
<pre>emailrelay --as-server --filter /tmp/set-from.js
</pre>
</div><!-- div-pre -->
<p>
Look for example filter scripts in the <em>examples</em> directory.
</p>
<p>
E-MailRelay can also be used as a personal internet mail server:
</p>
<img src="mailserver.png" alt="image">
<p>
Use <em>--remote-clients</em> (<em>-r</em>) to allow connections from outside the local
network, define your domain name with <em>--domain</em> and use an address verifier as
a first line of defense against spammers:
</p>
<div class="div-pre">
<pre>emailrelay --as-server -v -r --domain=example.com --address-verifier=account:
</pre>
</div><!-- div-pre -->
<p>
Then enable POP access to the incoming e-mails with <em>--pop</em>, <em>--pop-port</em> and
<em>--pop-auth</em>:
</p>
<div class="div-pre">
<pre>emailrelay ... --pop --pop-port 10110 --pop-auth /etc/emailrelay.auth
</pre>
</div><!-- div-pre -->
<p>
Set up the POP account with a user-id and password in the <em>--pop-auth</em> secrets
file. The secrets file should contain a single line of text like this:
</p>
<div class="div-pre">
<pre>server plain &lt;userid&gt; &lt;password&gt;
</pre>
</div><!-- div-pre -->
<p>
For more information on the command-line options refer to the reference guide
or run:
</p>
<div class="div-pre">
<pre>emailrelay --help --verbose</pre>
</div><!-- div-pre -->
<h2><a class="a-header" name="SH_1_3">Autostart</a></h2> <!-- index:2:SH:1:3:Autostart -->
<p>
To install E-MailRelay on Windows run the <em>emailrelay-setup</em> program and choose
the automatic startup option on the last page so that E-MailRelay runs as a
Windows service. Use the Windows <em>Services</em> utility to configure the E-MailRelay
service as automatic or manual startup.
</p>
<p>
To install E-MailRelay on Linux from a RPM package:
</p>
<div class="div-pre">
<pre>sudo rpm -i emailrelay*.rpm
</pre>
</div><!-- div-pre -->
<p>
Or from a DEB package:
</p>
<div class="div-pre">
<pre>sudo dpkg -i emailrelay*.deb
</pre>
</div><!-- div-pre -->
<p>
To get the E-MailRelay server to start automatically you should check the
configuration file <em>/etc/emailrelay.conf</em> is as you want it and then run the
following commands to activate the <em>systemd</em> service:
</p>
<div class="div-pre">
<pre>systemctl enable emailrelay
systemctl start emailrelay
systemctl status emailrelay
</pre>
</div><!-- div-pre -->
<p>
On other Linux systems try some combination of these commands to set up and
activate the E-MailRelay service:
</p>
<div class="div-pre">
<pre>cp /usr/lib/emailrelay/init/emailrelay /etc/init.d/
update-rc.d emailrelay enable
rc-update add emailrelay
invoke-rc.d emailrelay start
service emailrelay start
tail /var/log/messages
tail /var/log/syslog
</pre>
</div><!-- div-pre -->
<p>
On BSD systems add this line to /etc/rc.conf:
</p>
<div class="div-pre">
<pre>emailrelay_enable="YES"</pre>
</div><!-- div-pre -->
<h2><a class="a-header" name="SH_1_4">Documentation</a></h2> <!-- index:2:SH:1:4:Documentation -->
<p>
The following documentation is provided:
</p>
<ul>
<li>README -- this document</li>
<li>COPYING -- the GNU General Public License</li>
<li>INSTALL -- generic build & install instructions</li>
<li>AUTHORS -- authors, credits and additional copyrights</li>
<li>userguide.txt -- user guide</li>
<li>reference.txt -- reference document</li>
<li>ChangeLog -- change log for releases</li>
</ul>
<p>
Source code documentation will be generated when building from source if
<em>doxygen</em> is available.
</p>
<h2><a class="a-header" name="SH_1_5">Feedback</a></h2> <!-- index:2:SH:1:5:Feedback -->
<p>
To give feedback, including reviews, bug reports and feature requests, please
use the SourceForge project website at https://sourceforge.net/p/emailrelay
</p>
</div> <!-- div-main -->
</body>
</html>
<!-- Copyright (C) 2001-2023 Graeme Walker <graeme_walker@users.sourceforge.net>. All rights reserved. -->