meillo@59: Additional information may be available in docs/ or on the website. meillo@59: For installing on GNU/Linux distributions read docs/linux-distris. meillo@0: meillo@59: meillo@59: Installation instructions meillo@59: ------------------------- meillo@59: meillo@59: To compile masqmail you need glib 1.2 (http://www.gtk.org). meillo@0: meillo@0: You need a user and a group for masqmail to run, I suggest user meillo@0: 'mail' and group 'trusted'. Say: meillo@0: meillo@59: groupadd -g 42 trusted meillo@59: useradd -u 42 -g 42 -d / -s /bin/sh -c "Mail Transfer Agent" mail meillo@0: meillo@0: If you use other names than 'mail' and 'trusted' use the options meillo@0: described below for configure. The 42 is just a suggestion, you can meillo@0: use any number you like, but preferably one < 100. It does not have meillo@0: to be the same for the user 'mail' and the group 'trusted'. meillo@0: meillo@59: Compliling is a matter of the usual procedure. In the source directory, meillo@59: after unpacking do: meillo@0: meillo@59: ./configure meillo@59: make meillo@59: make install meillo@0: meillo@0: meillo@0: meillo@59: Additional options for configure meillo@59: -------------------------------- meillo@0: meillo@59: See the output of meillo@0: meillo@59: ./configure -h meillo@0: meillo@59: Here is additional, but maybe obsolete, explanation: meillo@0: meillo@0: --with-user=USER sets the user as which MasqMail will run. Default is meillo@0: 'mail'. USER has to exist before you 'make install'. meillo@0: meillo@0: --with-group=GROUP sets the group as which MasqMail will run. Default meillo@0: is 'trusted'. GROUP has to exist before you 'make install'. meillo@0: meillo@0: --with-logdir=LOGDIR sets the directory where MasqMail stores its log meillo@0: files. It will be created if it does not exist. Default is /var/masqmail/. meillo@0: meillo@0: --with-spooldir=SPOOLDIR sets the directory where MasqMail stores its meillo@0: spool files. It will be created if it does not exist. Default is meillo@0: /var/spool/masqmail/. meillo@0: meillo@0: --with-confdir=CONFDIR sets the default configuration directory to meillo@0: CONFDIR, in case you prefer another location than /etc/masqmail/. meillo@0: meillo@0: --enable-auth enables ESMTP AUTH support (disabled by default) meillo@0: meillo@163: --enable-pop3 enables pop3 support (disabled by default) meillo@0: meillo@0: --enable-maildir enables qmail style Maildir support (disabled by default) meillo@0: meillo@0: --enable-ident enable RFC 1413 support. If you have the libident meillo@0: dynamic library installed, this will be linked, otherwise it will be meillo@0: statically linked using the sources included in the package. meillo@0: meillo@0: --disable-resolver disable resolver support. Without the resolver functions, meillo@0: masqmail uses only gethostbyname() to resolve DNS names, and you cannot send meillo@0: mail without a smart host. Not recommended. You save 3K at most. meillo@0: meillo@0: --disable-smtp-server disable SMTP server support. You may want this if you do meillo@0: not need masqmail to listen. In this case, you cannot use masqmail as a smart meillo@0: host for other hosts on your LAN, you cannot use mail clients that send SMTP, meillo@0: you cannot even use pine. In short, use of this option is discouraged unless meillo@0: your resources are extremely limited. meillo@0: meillo@0: --enable-mserver enable online detection by connecting to the mserver meillo@0: (masqdialer system). meillo@0: meillo@0: --with-libcryto instead of using the md5 and hmac functions within the package, meillo@0: link dynamically with libcrypto. This applies only if you have pop3 or SMTP meillo@0: AUTH enabled. Makes only sense if your resources are limited and you have meillo@0: libcrypto installed. Untested. meillo@0: meillo@0: --with-glib-static link with glib statically. This makes the binary larger meillo@0: by around 30K (i386 architecture), but if masqmail is the only binary using meillo@0: glib, you save some space in total, because you do not need the shared glib meillo@0: library installed. meillo@0: meillo@0: --disable-debug disable debugging, setting it on by command line or configuration meillo@0: has no effect. Strongly discouraged, since you miss valuable information if something meillo@0: goes wrong. You save 6K. meillo@0: meillo@0: BTW, to get 3K of space, call meillo@0: strip --remove-section=.comment --remove-section=.note --strip-unneeded src/masqmail meillo@0: meillo@59: meillo@59: meillo@0: after make install: meillo@0: ------------------- meillo@0: meillo@0: You can also use these instructions to omit 'make install' if you do meillo@0: not want to use it. meillo@0: meillo@0: Check that 'make install' worked correctly. The following command: meillo@0: meillo@59: ls -ld /usr/sbin/masqmail /etc/masqmail /var/log/masqmail/ \ meillo@59: /var/run/masqmail /var/spool/masqmail/ /var/spool/masqmail/* meillo@0: meillo@0: should give output similar to meillo@0: meillo@59: -rwsr-xr-x 1 root root 399356 May 10 12:34 /usr/sbin/masqmail meillo@59: drwxr-xr-x 2 root root 4096 May 10 12:34 /etc/masqmail meillo@59: drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/log/masqmail meillo@59: drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/run/masqmail meillo@59: drwxr-xr-x 5 mail trusted 4096 May 10 12:34 /var/spool/masqmail meillo@59: drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/spool/masqmail/input meillo@59: drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/spool/masqmail/lock meillo@59: drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/spool/masqmail/popuidl meillo@0: meillo@0: (important is the set-user-id bit for /usr/sbin/masqmail and the meillo@0: ownership of all items). meillo@0: meillo@0: Use the example configuration files in examples/ to edit your own. The meillo@59: main configuration file `masqmail.conf' and the *.route and *.get files meillo@59: should go into /etc/masqmail. meillo@0: meillo@59: The default destination for the executable `masqmail' is /usr/sbin. meillo@59: Check that it has the set-uid bit set. You can set it with: meillo@59: meillo@59: chmod u+s /usr/sbin/masqmail meillo@0: meillo@0: If you want to replace sendmail, move your old sendmail binary to meillo@59: another name and make a symbolic link: meillo@0: meillo@59: ln -s /usr/sbin/masqmail /usr/sbin/sendmail meillo@0: meillo@59: Now every mailer that used to call sendmail will now call masqmail. You meillo@59: can now kill your old sendmail if it is running and start masqmail. meillo@59: meillo@59: /sbin/init.d/sendmail restart meillo@59: meillo@59: should do that. You can also start masqmail with: meillo@59: meillo@59: /usr/sbin/masqmail -bd -q30m meillo@59: meillo@59: meillo@59: meillo@59: Configuring for online delivery meillo@59: ------------------------------- meillo@59: meillo@59: (This section covers dial-up internet connections.) meillo@59: meillo@59: Now you have to set up the online configuration. The trick is to tell meillo@59: your ip-up script the connection name. You could use the IP number of meillo@59: the far side of the ppp link, but this is a pain and may change each meillo@59: time. But you can give it an additional argument via pppd with ipparam. meillo@59: Somewhere in your dial up script you have a line similar to: meillo@59: meillo@59: /usr/sbin/pppd /dev/ttyS1 connect "/usr/sbin/chat -t 90 -f $CHATFILE" \ meillo@59: -d -d -d user user@somewhere file "$OPTIONS" meillo@59: meillo@59: Just add 'ipparam FastNet' in the command line for pppd if your ISP has meillo@59: the name FastNet. The ip-up script will then get 'FastNet' as a sixth meillo@59: parameter. In your ip-up script you can then call masqmail with meillo@59: meillo@59: /usr/sbin/masqmail -qo "$6" meillo@59: meillo@59: instead of 'sendmail -q', if you had that in the script before. meillo@59: Masqmail will then read the route configuration specified for the meillo@59: connection name 'FastNet' and deliver the mail destined to the internet. meillo@59: See the configuration manual on how to write a route configuration or meillo@59: use one of the examples as a template. meillo@59: meillo@59: I do not know how do configure that for an ISDN adapter, but I am sure meillo@59: you will find something similar in the man pages. meillo@59: meillo@59: If you want mail that is received by masqmail from your local net to be meillo@59: delivered immediately using the route configuration, you have two meillo@59: possibilities: meillo@59: meillo@59: * if you are using the masqdialer system, you just have to set the meillo@92: variables online_detect to pipe and online_pipe to something like meillo@92: /usr/bin/mservdetect localhost 222 meillo@92: if mserver is running on localhost and listens on port 222. See the meillo@92: man page to mservdetect(1). meillo@92: meillo@59: * otherwise you have to add two commands in your ip-up script: meillo@92: echo "$6" >/var/run/masqmail/masqmail-route meillo@92: chmod 644 /var/run/masqmail/masqmail-route meillo@92: and you have to remove the file /var/run/masqmail/masqmail-route in meillo@92: your ip-down script: meillo@92: rm /var/run/masqmail/masqmail-route meillo@59: Then you have to set online_detect to file and online_file to meillo@92: /var/run/masqmail/masqmail-route meillo@59: meillo@59: See the route documentation for more. meillo@59: meillo@59: meillo@59: meillo@59: Written by oku. meillo@59: Updated by meillo.