view INSTALL @ 187:bd7c52a36b0c

improved mservdetect in various ways errors are handled better (no segfaults anymore) copied the relevant part of interface.c into mservdetect.c described how I think the mserver protocol works
author meillo@marmaro.de
date Thu, 15 Jul 2010 00:14:26 +0200
parents b6fc62ea6058
children 89f951be358f
line wrap: on
line source

Additional information may be available in docs/ or on the website.
For installing on GNU/Linux distributions read docs/INSTALL.linux.


Installation instructions
-------------------------

To compile masqmail you need glib (>= 1.2) (http://www.gtk.org). Your
distribution probably provides it. Glib-2.0 works out of the box, for
glib-1.2, you need to adjust configure.ac. See the comment in there.

You need a user and a group for masqmail to run. If

	grep '^mail:' /etc/passwd
	grep '^trusted:' /etc/group

shows that the user `mail' and the group `trusted' exist, it's
probably best to use these. If they don't exist, create them:

	groupadd -g 42 trusted
	useradd -u 23 -g 42 -d / -s /bin/sh -c "Mail Transfer Agent" mail

If you use other names than `mail' and `trusted' use the options
described below for configure. The 23 and 42 are just a suggestion,
you can use any (not yet used) number you like, but preferably one
lower than 100. It does not have to be the same for the user `mail'
and the group `trusted'.


Compiling is a matter of the usual procedure. In the source directory,
after unpacking do:

	./configure
	make
	make install



Additional options for configure
--------------------------------

See the output of

	./configure -h

Here is a selection of the options with additional explanations:

--with-user=USER
sets the user as which masqmail will run. Default is 'mail'. USER has
to exist before you 'make install'.

--with-group=GROUP
sets the group as which masqmail will run. Default is 'trusted'. GROUP
has to exist before you 'make install'.


--with-logdir=LOGDIR
sets the directory where masqmail stores its log files. It will be
created if it does not exist. Default is /var/log/masqmail/.

--with-spooldir=SPOOLDIR
sets the directory where masqmail stores its spool files. It will be
created if it does not exist. Default is /var/spool/masqmail/.

--with-confdir=CONFDIR
sets the default configuration directory to CONFDIR, in case you
prefer another location than /etc/masqmail/.


--enable-auth
enables ESMTP AUTH support (disabled by default)

--enable-maildir
enables qmail style Maildir support (disabled by default)

--enable-ident
enables RFC 1413 support. If you have the libident dynamic library
installed, this will be linked, otherwise it will be statically linked
using the sources included in the package.

--enable-pop3
enables POP3 support (disabled by default)

--disable-resolver
disables resolver support. Without the resolver functions, masqmail
uses only gethostbyname() to resolve DNS names, and you cannot send
mail without a smart host. Not recommended.

--disable-smtp-server
disables SMTP server support. You may want this if you do not need
masqmail to listen. In this case, you cannot use masqmail as a smart
host for other hosts on your LAN, you cannot use mail clients that
send SMTP, you cannot even use pine. In short, use of this option is
discouraged unless your resources are extremely limited.


--with-libcryto
instead of using the md5 and hmac functions within the package, link
dynamically with libcrypto. This applies only if you have POP3 or SMTP
AUTH enabled. Only makes sense if your resources are limited and you
have libcrypto installed. Untested.

--with-glib-static
links with glib statically. This makes the binary larger by around 30K
(i386 architecture), but if masqmail is the only binary using glib,
you save some space in total, because you do not need the shared glib
library installed.


--disable-debug
disables debugging; setting it on the command line or in the
configuration has no effect. Strongly discouraged, since you miss
valuable information if something goes wrong.



Checking the installation
-------------------------

Check that 'make install' worked correctly. The following command:

	ls -ld /usr/sbin/masqmail /etc/masqmail /var/log/masqmail/ \
	       /var/run/masqmail /var/spool/masqmail/ /var/spool/masqmail/*

should give output similar to

	-rwsr-xr-x 1 root root    399356 May 10 12:34 /usr/local/sbin/masqmail
	drwxr-xr-x 2 root root      4096 May 10 12:34 /etc/masqmail
	drwxr-xr-x 2 mail trusted   4096 May 10 12:34 /var/log/masqmail
	drwxr-xr-x 2 mail trusted   4096 May 10 12:34 /var/run/masqmail
	drwxr-xr-x 5 mail trusted   4096 May 10 12:34 /var/spool/masqmail
	drwxr-xr-x 2 mail trusted   4096 May 10 12:34 /var/spool/masqmail/input
	drwxr-xr-x 2 mail trusted   4096 May 10 12:34 /var/spool/masqmail/lock
	drwxr-xr-x 2 mail trusted   4096 May 10 12:34 /var/spool/masqmail/popuidl

Important are the set-user-id bit for /usr/local/sbin/masqmail and
the permissions of all files.



Making masqmail the default
---------------------------

`sendmail' is the de-facto standard name of the system's MTA, no
matter which MTA actually runs. If you want to make masqmail the
system's MTA (i.e. replace sendmail, postfix, etc), make two symbolic
links:

	ln -s /usr/local/sbin/masqmail /usr/lib/sendmail
	ln -s /usr/local/sbin/masqmail /usr/sbin/sendmail

Now every mailer that used to call sendmail will now call masqmail.
If you already had an MTA installed and running, you can kill it and
start masqmail. Probably with:

	/etc/init.d/sendmail restart

If this doesn't work as expected, you might need to add a special init
script for masqmail. Currently none is distributed with masqmail.
(Hopefully this will change soon.) Please ask on the mailing list for
help.

You can also directly start masqmail as daemon with:

	/usr/local/sbin/masqmail -bd -q30m



Basic Configuration
-------------------

The only thing you must configure in order to use masqmail is the
hostname. It's the name under which masqmail operates. In most cases
it is the same as the machine's name, but it can be different.

The script `contrib/guess-hostname' tries to print the hostname of
your machine. The first output line is probably the best choice.

Create a minimal config with:

	echo "host_name = HOSTNAME" >/etc/masqmail/masqmail.conf

(Substitute `HOSTNAME' with the real value, of course.)

Such a setup (i.e. the default one) does:
- deliver mail locally
- accept mail from local (via stdin)
- accept mail on localhost:25 (via SMTP) (if started as daemon)

It does not
- transfer mail to other machines
- accept mail from outside your machine


For more elaborate setups, have a look at docs/*setup and
docs/INSTALL*. You can also take the example configuration files in
examples/ as basis for your own. Take the man pages masqmail.conf(5)
and masqmail.route(5) for reference.

All configuration files should go into /etc/masqmail.



Written by oku.
Improved by meillo.