Mailfromd README Copyright (C) 2005, 2006 Sergey Poznyakoff See the end of file for copying conditions. * Introduction This file contains brief information about configuring, testing and running Mailfromd. It is *not* intended as a replacement for the documentation, it is provided as a brief reference only. The complete documentation for Mailfromd is available in doc/ subdirectory. To read it without installing the package run `info -f doc/mailfromd.info'. After the package is installed the documentation can be accessed running `info mailfromd'. The online copy of the documentation in various formats is available at http://gray.gnu.org.ua/software/mailfromd/manual. * Overview Mailfromd is a Sendmail filter that checks validity of a sender email address. Sender address verification, implemented by mailfromd allows you to block a sender address if it is not deliverable, thereby cutting off a large amount of spam. It is also useful to block mail for undeliverable recipients, for example on a mail relay host that does not have a list of all the valid recipient addresses. This prevents undeliverable junk mail from entering the queue, so that your MTA doesn't have to waste resources trying to send `MAILER-DAEMON' messages back. The program runs as a daemon, communicating with Sendmail via Milter interface. * Building Building the package is described in detail in the accompanying documentation (chapter `Building'). To simplify the task for those of you who do not have GNU info installed (you should, anyway), here is the copy of this chapter: 1. Make sure you have the necessary software installed. To build `mailfromd' you will need to have following packages on your machine: A. Sendmail 8.12.9 or newer B. `libmilter' library. It comes with Sendmail, but is not built by default. To build Sendmail with `libmilter' support, add following two lines to your `devtools/Site/site.config.m4': APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER') APPENDDEF(`confENVDEF', `-DBROKEN_PTHREAD_SLEEP') After running `make install', change to the directory `libmilter' and run `make' there. _Important note:_ make sure that `libmilter' is compiled with `BROKEN_PTHREAD_SLEEP' defined. If this symbol is not defined, `libmilter' will use `sleep' in signal-handler thread, which may cause various program misbehaviors, including coredumps. This problem has been asserted on (at least) GNU/Linux and FreeBSD systems. The `mailfromd' package comes with a patch to `libmilter' that changes its multi-process model from "pthreads" to "forks". It has been reported that `mailfromd' shows better performance when linked with this modified version. If you decide to try it, notice that it will be installed under the name `libmilter-fork.a', so that your original version of `libmilter.a' remains untouched. The patch was created for Sendmail version 8.13.1 and is located in the `etc' subdirectory of `mailfromd' distribution, in file `sendmail-8.13.1.diff' To apply the patch: cd sendmail-8.13.1 patch -p0 < PATH-TO/mailfromd-1.3/etc/sendmail-8.13.1.diff Then, proceed as described above in this section. To build `mailfromd' with the modified version of `libmilter' use `--with-forks' option to `configure': ./configure --with-forks If you installed `libmilter-fork.a' to an unusual location, or renamed it, you can specify its full file name with this option, e.g.: ./configure --with-forks=/usr/local/lib/libmilter-fork.a C. GNU mailutils version 0.6.94 (CVS) or newer. It is available from `http://www.gnu.org/software/mailutils'. D. A DBM library. `Mailfromd' is able to link with almost any existing library: old style `libdbm', `libndbm', Berkeley DB, `gdbm'. Notice that you can compile `mailfromd' without DBM too, but this is not recommended, since it will disable caching. Using `mailfromd' without caching can lead to increase in CPU usage, traffic outage and other disastrous effects. Besides, DBM is necessary for limiting user send rates. You have been warned. So, you want to select DBM implementation to use. The following table will help you do that. Column `DB type' lists types of DBM databases supported by `mailfromd'. Column `confMAPDEF' lists the value of `confMAPDEF' Sendmail configuration variable corresponding to that database type. It is here because it is usually wise to configure `mailfromd' to use the same database type as your Sendmail (If you don't know what `confMAPDEF' is, you probably are wasting your time reading this. Refer to Sendmail configuration guide first). `N/A' in this column means there is no support for this database in Sendmail. Finally, column `configure option' lists the option you should give to `configure' to enable using this database. DB type confMAPDEF configure option DBM N/A `--with-dbm' NDBM `-NNDBM' `--with-ndbm' Berkeley DB `-NNEWDB' `--with-db2' GDBM N/A `--with-gdbm' 2. Decide what user privileges will be used to run `mailfromd' The program will refuse to run as root. By default it switches to the privileges of user `mail', group `mail'. If there is no such user on your system, or you wish to use another user account for this purpose, override it using DEFAULT_USER environment variable. For example to use the privileges of user `nobody', run ./configure DEFAULT_USER=nobody 3. Decide where to install `mailfromd' and where its configuration and data files will be located. As usual, default value for installation prefix is `/usr/local'. If it does not suit you, specify another location using `--prefix' option, e.g.: `--prefix=/usr'. During installation phase, the build system will install several files. These files are: File Purpose `PREFIX/libexec/mailfromd' Main daemon `PREFIX/etc/mailfromd.rc' Configuration file(1) `PREFIX/info/mailfromd.info' Documentation ---------- Footnotes ---------- (1) The configuration file will be installed only if it is not already there. Thus, if you are upgrading to a newer version of `mailfromd', your old configuration file will be preserved with all your changes. ------------------------------- At startup, `mailfromd' will look up its configuration defaults in file `PREFIX/etc/mailfromd.rc'. It is advisable to use the same settings for file name prefixes as those you used when configuring `mailutils'. In particular, try to use the same `--sysconfdir', since it will facilitate configuring the whole system. Another important point is the location of "local state directory", i.e. a directory where `mailfromd' will keep its data files (communication socket, pidfile and cache database). This directory is `LOCALSTATEDIR/mailfromd'. 4. Select default communication socket. This is the socket used to communicate with `sendmail'. The default value is `unix:LOCALSTATEDIR/mailfromd/mailfrom'. To alter this, use DEFAULT_SOCKET environment variable, e.g.: ./configure DEFAULT_SOCKET=inet:999@localhost 5. Select default expiration interval. The default value is 86400 seconds, i.e. 24 hours. It is OK for most sites. If, however, you wish to change it, use DEFAULT_EXPIRE_INTERVAL environment variable. 6. Run `configure' with all the desired options. For example, the following command: ./configure DEFAULT_SOCKET=inet:999@localhost --with-db2 will configure the package to use Berkeley DB2 database, and `inet:999@localhost' as the default communication socket. 7. Run `make'. 8. Run `make' install. 9. Make sure `LOCALSTATEDIR/mailfromd' has right owner and mode. 10. Examine configuration file (`SYSCONFDIR/mailfromd.etc') and edit it, if necessary. If you are upgrading from an oldest copy of `mailfromd', your configuration file will remain untouched. * Configuring and Running Please, see mailfromd documentation. * Bug reporting. Send bug reports to . * Copyright information: Copyright (C) 2005, 2006 Sergey Poznyakoff Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the copyright notice and this permission notice are preserved, thus giving the recipient permission to redistribute in turn. Permission is granted to distribute modified versions of this document, or of portions of it, under the above conditions, provided also that they carry prominent notices stating who last changed them. Local Variables: mode: outline paragraph-separate: "[ ]*$" version-control: never End: