-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
181 lines (117 loc) · 5.36 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
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 '^mail:' /etc/group
shows that the user `mail' and the group `mail' exist, it's probably
best to use these. If they don't exist, create them:
groupadd -g 12 mail
useradd -u 8 -g mail -d /nonexistent -s /bin/false -c "masqmail MTA" mail
The 8 and 12 are common uid/gid for the user and group `mail', but you can
use any (not yet used) number you like, preferably one lower than 100.
If you use other names than `mail' and `mail', you need to use the
configure options described below.
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 'mail'. GROUP
has to exist before you 'make install'.
--with-logdir=LOGDIR
sets the directory where masqmail stores its log files. It will be
created on program startup 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 on program startup 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.
--with-piddir=PIDDIR
sets the directory for the pid file of the daemon. The default and usual
location is /var/run, but some GNU/Linux distributions have converted
to /run. It gets created on program startup if missing.
--with-lockdir=LOCKDIR
sets the default directory for lock file for spooled messages. Default
is /var/lock/masqmail. It gets created on program startup if missing.
--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-auth
disables ESMTP AUTH support (enabled by default)
--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/local/sbin/masqmail /etc/masqmail /var/log/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 mail 4096 May 10 12:34 /var/log/masqmail
drwxr-xr-x 5 mail mail 4096 May 10 12:34 /var/spool/masqmail
Important are the set-user-id bit for /usr/local/sbin/masqmail and
the ownership of the directories.
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 `admin/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 on stdin (plain text)
- accept mail on stdin (SMTP) (if started with -bs)
- accept mail on the local port 25 (SMTP) (if started with -bd)
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.