comparison INSTALL @ 165:f72de1e00fa5

updated and improved INSTALL
author meillo@marmaro.de
date Thu, 08 Jul 2010 22:02:22 +0200
parents 5b621742b2e7
children 25b769efafe6
comparison
equal deleted inserted replaced
164:5b621742b2e7 165:f72de1e00fa5
3 3
4 4
5 Installation instructions 5 Installation instructions
6 ------------------------- 6 -------------------------
7 7
8 To compile masqmail you need glib 1.2 (http://www.gtk.org). 8 To compile masqmail you need glib (>= 1.2) (http://www.gtk.org). Your
9 9 distribution probably provides it.
10 You need a user and a group for masqmail to run, I suggest user 10
11 'mail' and group 'trusted'. Say: 11 You need a user and a group for masqmail to run. If
12
13 grep '^mail:' /etc/passwd
14 grep '^trusted:' /etc/group
15
16 shows that the user `mail' and the group `trusted' exist, it's
17 probably best to use these. If they don't exist, create them:
12 18
13 groupadd -g 42 trusted 19 groupadd -g 42 trusted
14 useradd -u 42 -g 42 -d / -s /bin/sh -c "Mail Transfer Agent" mail 20 useradd -u 23 -g 42 -d / -s /bin/sh -c "Mail Transfer Agent" mail
15 21
16 If you use other names than 'mail' and 'trusted' use the options 22 If you use other names than `mail' and `trusted' use the options
17 described below for configure. The 42 is just a suggestion, you can 23 described below for configure. The 23 and 42 are just a suggestion,
18 use any number you like, but preferably one < 100. It does not have 24 you can use any (not yet used) number you like, but preferably one
19 to be the same for the user 'mail' and the group 'trusted'. 25 lower than 100. It does not have to be the same for the user `mail'
26 and the group `trusted'.
27
20 28
21 Compliling is a matter of the usual procedure. In the source directory, 29 Compliling is a matter of the usual procedure. In the source directory,
22 after unpacking do: 30 after unpacking do:
23 31
24 ./configure 32 ./configure
32 40
33 See the output of 41 See the output of
34 42
35 ./configure -h 43 ./configure -h
36 44
37 Here is additional, but maybe obsolete, explanation: 45 Here is a selection of the options with additional explanations:
38 46
39 --with-user=USER sets the user as which MasqMail will run. Default is 47 --with-user=USER
40 'mail'. USER has to exist before you 'make install'. 48 sets the user as which masqmail will run. Default is 'mail'. USER has
41 49 to exist before you 'make install'.
42 --with-group=GROUP sets the group as which MasqMail will run. Default 50
43 is 'trusted'. GROUP has to exist before you 'make install'. 51 --with-group=GROUP
44 52 sets the group as which masqmail will run. Default is 'trusted'. GROUP
45 --with-logdir=LOGDIR sets the directory where MasqMail stores its log 53 has to exist before you 'make install'.
46 files. It will be created if it does not exist. Default is /var/masqmail/. 54
47 55
48 --with-spooldir=SPOOLDIR sets the directory where MasqMail stores its 56 --with-logdir=LOGDIR
49 spool files. It will be created if it does not exist. Default is 57 sets the directory where masqmail stores its log files. It will be
50 /var/spool/masqmail/. 58 created if it does not exist. Default is /var/log/masqmail/.
51 59
52 --with-confdir=CONFDIR sets the default configuration directory to 60 --with-spooldir=SPOOLDIR
53 CONFDIR, in case you prefer another location than /etc/masqmail/. 61 sets the directory where masqmail stores its spool files. It will be
54 62 created if it does not exist. Default is /var/spool/masqmail/.
55 --enable-auth enables ESMTP AUTH support (disabled by default) 63
56 64 --with-confdir=CONFDIR
57 --enable-pop3 enables pop3 support (disabled by default) 65 sets the default configuration directory to CONFDIR, in case you
58 66 prefer another location than /etc/masqmail/.
59 --enable-maildir enables qmail style Maildir support (disabled by default) 67
60 68
61 --enable-ident enable RFC 1413 support. If you have the libident 69 --enable-auth
62 dynamic library installed, this will be linked, otherwise it will be 70 enables ESMTP AUTH support (disabled by default)
63 statically linked using the sources included in the package. 71
64 72 --enable-maildir
65 --disable-resolver disable resolver support. Without the resolver functions, 73 enables qmail style Maildir support (disabled by default)
66 masqmail uses only gethostbyname() to resolve DNS names, and you cannot send 74
67 mail without a smart host. Not recommended. You save 3K at most. 75 --enable-ident
68 76 enable RFC 1413 support. If you have the libident dynamic library
69 --disable-smtp-server disable SMTP server support. You may want this if you do 77 installed, this will be linked, otherwise it will be statically linked
70 not need masqmail to listen. In this case, you cannot use masqmail as a smart 78 using the sources included in the package.
71 host for other hosts on your LAN, you cannot use mail clients that send SMTP, 79
72 you cannot even use pine. In short, use of this option is discouraged unless 80 --enable-pop3
73 your resources are extremely limited. 81 enables pop3 support (disabled by default)
74 82
75 --with-libcryto instead of using the md5 and hmac functions within the package, 83 --disable-resolver
76 link dynamically with libcrypto. This applies only if you have pop3 or SMTP 84 disable resolver support. Without the resolver functions, masqmail
77 AUTH enabled. Makes only sense if your resources are limited and you have 85 uses only gethostbyname() to resolve DNS names, and you cannot send
78 libcrypto installed. Untested. 86 mail without a smart host. Not recommended.
79 87
80 --with-glib-static link with glib statically. This makes the binary larger 88 --disable-smtp-server
81 by around 30K (i386 architecture), but if masqmail is the only binary using 89 disable SMTP server support. You may want this if you do not need
82 glib, you save some space in total, because you do not need the shared glib 90 masqmail to listen. In this case, you cannot use masqmail as a smart
91 host for other hosts on your LAN, you cannot use mail clients that
92 send SMTP, you cannot even use pine. In short, use of this option is
93 discouraged unless your resources are extremely limited.
94
95
96 --with-libcryto
97 instead of using the md5 and hmac functions within the package, link
98 dynamically with libcrypto. This applies only if you have pop3 or SMTP
99 AUTH enabled. Makes only sense if your resources are limited and you
100 have libcrypto installed. Untested.
101
102 --with-glib-static
103 link with glib statically. This makes the binary larger by around 30K
104 (i386 architecture), but if masqmail is the only binary using glib,
105 you save some space in total, because you do not need the shared glib
83 library installed. 106 library installed.
84 107
85 --disable-debug disable debugging, setting it on by command line or configuration 108
86 has no effect. Strongly discouraged, since you miss valuable information if something 109 --disable-debug
87 goes wrong. You save 6K. 110 disable debugging, setting it on by command line or configuration has
88 111 no effect. Strongly discouraged, since you miss valuable information
89 BTW, to get 3K of space, call 112 if something goes wrong.
90 strip --remove-section=.comment --remove-section=.note --strip-unneeded src/masqmail 113
91 114
92 115
93 116 Checking the installation
94 after make install: 117 -------------------------
95 -------------------
96
97 You can also use these instructions to omit 'make install' if you do
98 not want to use it.
99 118
100 Check that 'make install' worked correctly. The following command: 119 Check that 'make install' worked correctly. The following command:
101 120
102 ls -ld /usr/sbin/masqmail /etc/masqmail /var/log/masqmail/ \ 121 ls -ld /usr/local/sbin/masqmail /etc/masqmail /var/log/masqmail/ \
103 /var/run/masqmail /var/spool/masqmail/ /var/spool/masqmail/* 122 /var/run/masqmail /var/spool/masqmail/ /var/spool/masqmail/*
104 123
105 should give output similar to 124 should give output similar to
106 125
107 -rwsr-xr-x 1 root root 399356 May 10 12:34 /usr/sbin/masqmail 126 -rwsr-xr-x 1 root root 399356 May 10 12:34 /usr/local/sbin/masqmail
108 drwxr-xr-x 2 root root 4096 May 10 12:34 /etc/masqmail 127 drwxr-xr-x 2 root root 4096 May 10 12:34 /etc/masqmail
109 drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/log/masqmail 128 drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/log/masqmail
110 drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/run/masqmail 129 drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/run/masqmail
111 drwxr-xr-x 5 mail trusted 4096 May 10 12:34 /var/spool/masqmail 130 drwxr-xr-x 5 mail trusted 4096 May 10 12:34 /var/spool/masqmail
112 drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/spool/masqmail/input 131 drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/spool/masqmail/input
113 drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/spool/masqmail/lock 132 drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/spool/masqmail/lock
114 drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/spool/masqmail/popuidl 133 drwxr-xr-x 2 mail trusted 4096 May 10 12:34 /var/spool/masqmail/popuidl
115 134
116 (important is the set-user-id bit for /usr/sbin/masqmail and the 135 Important are the set-user-id bit for /usr/local/sbin/masqmail and
117 ownership of all items). 136 the permissions of all files.
118 137
119 Use the example configuration files in examples/ to edit your own. The 138
120 main configuration file `masqmail.conf' and the *.route and *.get files 139
121 should go into /etc/masqmail. 140 Making masqmail the default
122 141 ---------------------------
123 The default destination for the executable `masqmail' is /usr/sbin. 142
124 Check that it has the set-uid bit set. You can set it with: 143 `sendmail' is the de-facto standard name of the system's MTA, no
125 144 matter which MTA actually runs. If you want to make masqmail the
126 chmod u+s /usr/sbin/masqmail 145 system's MTA (i.e. replace sendmail, postfix, etc), make a symbolic
127 146 link:
128 If you want to replace sendmail, move your old sendmail binary to 147
129 another name and make a symbolic link: 148 ln -s /usr/local/sbin/masqmail /usr/lib/sendmail
130 149
131 ln -s /usr/sbin/masqmail /usr/sbin/sendmail 150 Now every mailer that used to call sendmail will now call masqmail.
132 151 If you already had an MTA installed and running, you can kill it and
133 Now every mailer that used to call sendmail will now call masqmail. You 152 start masqmail. Probably with:
134 can now kill your old sendmail if it is running and start masqmail. 153
135 154 /etc/init.d/sendmail restart
136 /sbin/init.d/sendmail restart 155
137 156 If this doesn't work as expected, you might need to add a special init
138 should do that. You can also start masqmail with: 157 script for masqmail. Currently none is distributed with masqmail.
139 158 (Hopefully this will change soon.) Please ask on the mailing list for
140 /usr/sbin/masqmail -bd -q30m 159 help.
141 160
142 161 You can also directly start masqmail as daemon with:
143 162
144 Configuring for online delivery 163 /usr/local/sbin/masqmail -bd -q30m
145 ------------------------------- 164
146 165
147 (This section covers dial-up internet connections.) 166
148 167 Basic Configuration
149 Now you have to set up the online configuration. The trick is to tell 168 -------------------
150 your ip-up script the connection name. You could use the IP number of 169
151 the far side of the ppp link, but this is a pain and may change each 170 The only thing you must configure in order to use masqmail is the
152 time. But you can give it an additional argument via pppd with ipparam. 171 hostname. It's the name under which masqmail operates. In most cases
153 Somewhere in your dial up script you have a line similar to: 172 it is the same as the machine's name, but it can be different.
154 173
155 /usr/sbin/pppd /dev/ttyS1 connect "/usr/sbin/chat -t 90 -f $CHATFILE" \ 174 The script `contrib/guess-hostname' tries to print the hostname of
156 -d -d -d user user@somewhere file "$OPTIONS" 175 your machine. The first output line is probably the best choice.
157 176
158 Just add 'ipparam FastNet' in the command line for pppd if your ISP has 177 Create a minimal config with:
159 the name FastNet. The ip-up script will then get 'FastNet' as a sixth 178
160 parameter. In your ip-up script you can then call masqmail with 179 echo "host_name = HOSTNAME" >/etc/masqmail/masqmail.conf
161 180
162 /usr/sbin/masqmail -qo "$6" 181 (Substitute `HOSTNAME' with the real value, of course.)
163 182
164 instead of 'sendmail -q', if you had that in the script before. 183 Such a setup (i.e. the default one) does:
165 Masqmail will then read the route configuration specified for the 184 - deliver mail locally
166 connection name 'FastNet' and deliver the mail destined to the internet. 185 - accept mail from local (via stdin)
167 See the configuration manual on how to write a route configuration or 186 - accept mail on localhost:25 (via SMTP)
168 use one of the examples as a template. 187 It does not
169 188 - transfer any mail to other machines
170 I do not know how do configure that for an ISDN adapter, but I am sure 189 - accept mail from outside your machine
171 you will find something similar in the man pages. 190
172 191
173 If you want mail that is received by masqmail from your local net to be 192 For more elaborate setups, have a look at docs/*setup and
174 delivered immediately using the route configuration, you have two 193 docs/INSTALL*. You can also take the example configuration files in
175 possibilities: 194 examples/ as basis for your own. Take the man pages masqmail.conf(5)
176 195 and masqmail.route(5) for reference.
177 * if you are using the masqdialer system, you just have to set the 196
178 variables online_detect to pipe and online_pipe to something like 197 All configuration files should go into /etc/masqmail.
179 /usr/bin/mservdetect localhost 224
180 if mserver is running on localhost and listens on port 224. See the
181 man page to mservdetect(1).
182
183 * otherwise you have to add two commands in your ip-up script:
184 echo "$6" >/var/run/masqmail/masqmail-route
185 chmod 644 /var/run/masqmail/masqmail-route
186 and you have to remove the file /var/run/masqmail/masqmail-route in
187 your ip-down script:
188 rm /var/run/masqmail/masqmail-route
189 Then you have to set online_detect to file and online_file to
190 /var/run/masqmail/masqmail-route
191
192 See the route documentation for more.
193 198
194 199
195 200
196 Written by oku. 201 Written by oku.
197 Updated by meillo. 202 Improved by meillo.