masqmail

view man/masqmail.conf.5 @ 309:273f6c9eb6a2

bug fix: off-by-one in pipe aliases
author meillo@marmaro.de
date Sun, 24 Apr 2011 19:02:09 +0200
parents 95d536599fd7
children f10a56dc7481
line source
1 .TH masqmail.conf 5 2010-12-08 masqmail-0.3.1 "File Formats"
3 .SH NAME
4 masqmail.conf \- masqmail configuration file
7 .SH DESCRIPTION
9 This man page describes the syntax of the main configuration file of masqmail.
10 Its usual location is \fI/etc/masqmail/masqmail.conf\fR
12 The configuration consists of lines of the form
14 \fBval\fR = \fIexpression\fR
16 Where \fBval\fR is a variable name and \fIexpression\fR a string,
17 which can be quoted with double quotes `"'.
18 If the expression is on multiple lines or contains characters other than letters,
19 digits or the characters `.', `-', `_', `/', ';', '@', ':', it must be quoted.
20 You can use quotes inside quotes by escaping them with a backslash.
22 Each \fBval\fP has a type, which can be boolean, numeric, string or list.
23 A boolean variable can be set with one of the values `on', `yes', and `true' or `off', `no' and `false'.
24 List items are separated with semicolons `;'.
25 For some values, patterns (like `*',`?') can be used.
26 The spaces in front of and after the equal sign `=' are optional.
28 Most lists (exceptions: \fBlocal_hosts\fR, \fBlocal_nets\fR, \fBlisten_addresses\fR,
29 and \fBonline_routes\fR) accept files.
30 These will be recognized by a leading slash `/'.
31 The contents of these files will be included at the position of the file name,
32 there can be items or other files before and after the file entry.
33 The format of the files is different though, within these files each entry is on another line
34 and the entries are not separated by semicolons.
35 This makes it easy to include large lists which are common in different configuration files,
36 so they do not have to appear in every configuration file.
38 Blank lines and lines starting with a hash `#' are ignored.
41 .SH OPTIONS
43 .TP
44 \fBrun_as_user = \fIboolean\fR
46 If this is set, masqmail runs with the user id of the user who invoked it and never changes it.
47 This is for debugging purposes only.
48 If the user is not root, masqmail will not be able to listen on a port < 1024
49 and will not be able to deliver local mail to others than the user.
51 .TP
52 \fBuse_syslog = \fIboolean\fR
54 If this is set, masqmail uses syslogd for logging.
55 It uses facility MAIL.
56 You still have to set \fBlog_dir\fR for debug files.
58 .TP
59 \fBdebug_level = \fIn\fR
61 Set the debug level.
62 Valid values are 0 to 6, increasing it further makes no difference.
63 Be careful if you set this as high as 5 or higher, the logs may very soon fill your hard drive.
65 .TP
66 \fBlog_dir = \fIfile\fR
68 The directory where logs are stored, if syslog is not used.
69 Debug files are always stored in this directory if debugging is enabled.
70 \fIfile\fR must be an absolute path.
72 Default: \fI/var/log/masqmail\fR
74 .TP
75 \fBmail_dir = \fIfile\fR
77 The directory where local mail is stored, usually \fI/var/spool/mail\fR or \fI/var/mail\fR.
78 \fIfile\fR must be an absolute path.
80 Default: \fI/var/mail\fR
82 .TP
83 \fBspool_dir = \fIfile\fR
85 The directory where masqmail stores its spool files (and later also other stuff).
86 It must have a subdirectory \fIinput\fR.
87 Masqmail needs read and write permissions for this directory.
88 \fIfile\fR must be an absolute path.
90 Default: \fI/var/spool/masqmail\fR
92 .TP
93 \fBlock_dir = \fIfile\fR
95 The directory where masqmail stores its lock files.
96 Masqmail needs read and write permissions for this directory.
97 By default it is a directory ``lock'' inside of \fIspool_dir\fP.
98 \fIfile\fR must be an absolute path.
100 .TP
101 \fBhost_name = \fIstring\fR
103 This is used in different places: Masqmail identifies itself in the greeting banner
104 on incoming connections and in the HELO/EHLO command for outgoing connections with this name,
105 it is used in the Received: header and to qualify the sender of a locally originating message.
107 If the string begins with a slash `/', it it assumed that it is a filename,
108 and the first line of this file will be used.
109 Usually this will be `/etc/mailname' to make masqmail conform to Debian policies.
111 It is not used to find whether an address is local. Use \fBlocal_hosts\fR for that.
113 Default: none; \fBhost_name\fP MUST be set in the config file
115 .TP
116 \fBlocal_hosts = \fIlist\fR
118 A semicolon `;' separated list of hostnames which are considered local.
119 Normally you should set it to "localhost;foo;foo.bar.com" if your host has the
120 fully qualified domain name `foo.bar.com'.
122 Default: localhost ; <value of \fBhost_name\fR cut at the first dot> ; <value of \fBhost_name\fR>
124 Example: \fIlocalhost;foo;foo.example.org\fR
125 (if you have set \fBhost_name\fR to \fIfoo.example.org\fR)
127 .TP
128 \fBlocal_addresses = \fIlist\fR
130 A semicolon `;' separated list of fully qualified email-addresses which are
131 considered local although their domain name part is not in the list of \fBlocal_hosts\fR.
132 This list can be seen as an addition to \fBlocal_hosts\fP.
134 Further more only the local part of the addresses will be regarded,
135 seeing it as a local user.
137 Example: \fIlocal_addresses = "person1@yourdomain;person2@yourdomain"\fP
139 This means mail to person1@yourdomain will effectively go to
140 person1@localhost, if not redirected by an alias.
142 .TP
143 \fBnot_local_addresses = \fIlist\fR
145 A semicolon `;' separated list of fully qualified email-addresses which are
146 considered not local although their domain name part is in the list of \fBlocal_hosts\fR.
147 This list can be seen as a substraction to \fBlocal_hosts\fP.
149 This is the opposite of the previous case.
150 The majority of addresses of a specific domain are local.
151 But some users are not.
152 With this option you can easily exclude these users.
154 Example:
156 local_hosts = "localhost;myhost;mydomain.net"
158 not_local_addresses = "eric@mydomain.net"
160 .TP
161 \fBlocal_nets = \fIlist\fR
163 A semicolon `;' separated list of hostnames which are on the `local' net.
164 Delivery to these hosts is attempted immediately.
165 You can use patterns with `*', e.g. "*.bar.com".
167 .TP
168 \fBlisten_addresses = \fIlist\fR
170 A semicolon `;' separated list of interfaces on which connections will be accepted.
171 An interface ist defined by a hostname, optionally followed by a colon `:' and a number for the port.
172 If this is left out, port 25 will be used.
174 You can set this to "localhost:25;foo:25" if your hostname is `foo'.
176 Note that the names are resolved to IP addreses.
177 If your host has different names which resolve to the same IP,
178 use only one of them, otherwise you will get an error message.
180 Default: \fI127.0.0.1:25\fR (i.e. only local processes can connect)
182 .TP
183 \fBdo_save_envelope_to = \fIboolean\fR
185 If this is set to true, a possibly existing Envelope-to: header in an incoming mail
186 which is received via either pop3 or smtp will be saved as an X-Orig-Envelope-to: header.
188 This is useful if you retrieve mail from a pop3 server with fetchmail,
189 and the server supports Envelope-to: headers,
190 and you want to make use of those with a mail filtering tool, e.g. procmail.
191 It cannot be preserved because masqmail sets such a header by itself.
193 Default is false.
195 .TP
196 \fBdo_relay = \fIboolean\fR
198 If this is set to false, mail with a return path that is not local and a destination
199 that is also not local will not be accepted via smtp and a 550 reply will be given.
200 Default is true.
202 Note that this will not protect you from spammers using open relays,
203 but from users unable to set their address in their mail clients.
205 .TP
206 \fBdo_queue = \fIboolean\fR
208 If this is set, mail will not be delivered immediately when accepted.
209 Same as calling masqmail with the \fB\-odq\fR option.
211 .TP
212 \fBonline_routes.\fIname\fR = \fIlist\fR
214 Replace \fIname\fR with a name to identify a connection.
215 Set this to a filename (or a list of filenames) for the special route configuration for that connection.
216 You will use that name to call masqmail with the \fB\-qo\fR option every time a
217 connection to your ISP is set up.
219 Example: Your ISP has the name FastNet.
220 Then you write the following line in the main configuration:
222 \fBonline_routes.FastNet\fR = \fI"/etc/masqmail/fastnet.route"\fR
224 \fI/etc/masqmail/fastnet.route\fR is the route configuration file, see \fBmasqmail.route(5)\fR.
225 As soon as a link to FastNet has been set up, you call masqmail \fB\-qo \fIFastNet\fR.
226 Masqmail will then read the specified file and send the mails.
228 .TP
229 \fBconnect_route.\fIname\fR = \fIlist\fR
231 Old name for \fBonline_routes\fR.
233 .TP
234 \fBlocal_net_route = \fIfile\fR
236 This is similar to \fBonline_routes.\fIname\fR but used for delilvery to the local net.
237 Recipient addresses that are in local_nets will be routed using this route configuration.
238 Main purpose is to define a mail server with mail_host in your local network.
239 In simple environments this can be left unset.
240 If unset, a default route configuration (named ``default local_net_route'') will be used.
242 .TP
243 \fBalias_file = \fIfile\fR
245 Set this to the location of your alias file.
246 If not set, no aliasing will be done.
248 Default: <not set> (i.e. no aliasing is done)
250 .TP
251 \fBcaseless_matching = \fIboolean\fR
253 If this is set, aliasing and the matching for \fBlocal_addresses\fP and
254 \fBnot_local_addresses\fP will be done caseless.
256 Note: Be sure to change this option only if the queue is empty as
257 correct processing of queued messages is not guaranteed otherwise.
259 Default: false
261 .TP
262 \fBpipe_fromline = \fIboolean\fR
264 If this is set, a from line will be prepended to the output stream whenever
265 a pipe command is called after an alias expansion.
266 Default is false.
268 .TP
269 \fBpipe_fromhack = \fIboolean\fR
271 If this is set, each line beginning with `From ' is replaced with `>From '
272 whenever a pipe command is called after an alias expansion.
273 You probably want this if you have set \fBpipe_fromline\fR above.
274 Default is false.
276 .TP
277 \fBmbox_default = \fIstring\fR
279 The default local delivery method.
280 Can be mbox or mda.
281 You can override this for each user by using the \fBmbox_users\fR or \fBmda_users\fR (see below).
283 Default: mbox.
285 .TP
286 \fBmbox_users = \fIlist\fR
288 A list of users which wish delivery to an mbox style mail folder.
290 .TP
291 \fBmda_users = \fIlist\fR
293 A list of users which wish local delivery to an mda.
294 You have to set \fBmda\fR (see below) as well.
296 .TP
297 \fBmda = \fIexpand string\fR
299 If you want local delivery to be transferred to an mda (Mail Delivery Agent),
300 set this to a command.
301 The argument will be expanded on delivery time,
302 you can use variables beginning with a dolloar sign `$', optionally enclosed in curly braces.
303 Variables you can use are:
305 uid - the unique message id.
306 This is not necessarily identical with the Message ID as given in the Message ID: header.
308 received_host - the host the mail was received from
310 ident - the ident, this is either the ident delivered by the ident protocol
311 or the user id of the sender if the message was received locally.
313 return_path_local - the local part of the return path (sender).
315 return_path_domain - the domain part of the return path (sender).
317 return_path - the complete return path (sender).
319 rcpt_local - the local part of the recipient.
321 rcpt_domain - the domain part of the recipient.
323 rcpt - the complete recipient address.
325 Example:
327 mda="/usr/bin/procmail \-Y \-d ${rcpt_local}"
329 For the mda, as for pipe commands, a few environment variables will be set as well.
330 See \fBmasqmail(8)\fR.
331 To use environment variables for the mda, the dollar sign `$' has to be escaped with a backslash,
332 otherwise they will be tried to be expanded with the internal variables.
334 .TP
335 \fBmda_fromline = \fIboolean\fR
337 If this is set, a from line will be prepended to the output stream whenever
338 a message is delivered to an mda.
339 Default is false.
341 .TP
342 \fBmda_fromhack = \fIboolean\fR
344 If this is set, each line beginning with `From ' is replaced with `>From '
345 whenever a message is delivered to an mda.
346 You probably want this if you have set \fBmda_fromline\fR above.
347 Default is false.
349 .TP
350 \fBonline_detect = \fIstring\fR
352 Defines the method masqmail uses to detect whether there is currently an online connection.
353 It can have the values \fIfile\fR or \fIpipe\fR.
355 When it is set to \fIfile\fR, masqmail first checks for the existence of \fBonline_file\fR
356 (see below) and if it exists, it reads it.
357 The content of the file should be the name of the current connection as defined
358 with \fBconnect_route.\fIname\fR (trailing whitespace is removed).
360 When it is set to \fIpipe\fR, masqmail calls the executable given by the
361 \fBonline_pipe\fR option (see below) and reads the current online status from its standard output.
363 No matter how masqmail detects the online status,
364 only messages that are accepted at online time will be delivered using the connection.
365 The spool still has to be emptied with masqmail \fB\-qo\fIconnection\fR.
367 .TP
368 \fBonline_file = \fIfile\fR
370 This is the name of the file checked for when masqmail determines whether it is online.
371 The file should only exist when there is currently a connection.
372 Create it in your ip-up script with e.g.
374 echo "connection-name" >/var/run/masqmail/masqmail-route
376 chmod 0644 /var/run/masqmail/masqmail-route
378 Do not forget to delete it in your ip-down script.
380 .TP
381 \fBonline_pipe = \fIfile\fR
383 This is the name of the executable which will be called to determine the online status.
384 This executable should just print the name of the current connection to
385 the standard output and return a zero status code.
386 masqmail assumes it is offline if the script returns with a non zero status.
387 Simple example:
389 #!/bin/sh
391 [ \-e /var/run/masqmail/masqmail-route ] || exit 1
393 cat /var/run/masqmail/masqmail-route
395 exit 0
397 Of course, instead of the example above you could as well use \fIfile\fR as
398 the online detection method, but you can do something more sophisticated.
400 \fIfile\fR must contain an absolute path to an executable program.
401 It can contain optional arguments.
403 Example: \fI/bin/echo foo\fR
404 (This tells masqmail to be always online with connection `foo'.)
406 For querying a masqdialer server
407 (= asking it whether a connection exists and what its name is)
408 use:
410 online_method=pipe
412 online_pipe="/usr/bin/mservdetect localhost 224"
415 .TP
416 \fBident_trusted_nets = \fIlist\fR
418 \fIlist\fR is a list of networks of the form a.b.c.d/e (e.g. 192.168.1.0/24),
419 from which the ident given by the ident protocol will be trusted,
420 so a user can delete his mail from the queue if the ident is identical to his login name.
422 .TP
423 \fBerrmsg_file = \fIfile\fR
425 Set this to a template which will be used to generate delivery failure reports.
426 Variable parts within the template begin with a dollar sign and are identical
427 to those which can be used as arguments for the mda command, see \fBmda\fR above.
428 Additional information can be included with @failed_rcpts, @msg_headers and @msg_body,
429 these must be at the beginning of a line and will be replaced with the list of the failed recipients,
430 the message headers and the message body of the failed message.
432 Default is /usr/share/masqmail/tpl/failmsg.tpl.
434 .TP
435 \fBwarnmsg_file = \fIfile\fR
437 Set this to a template which will be used to generate delivery warning reports.
438 It uses the same mechanisms for variables as \fBerrmsg_file\fR, see above.
440 Default is /usr/share/masqmail/tpl/warnmsg.tpl.
442 .TP
443 \fBwarn_intervals\fR = \fIlist\fR
445 Set this to a list of time intervals, at which delivery warnings
446 (starting with the receiving time of the message) shall be generated.
448 A warning will only be generated just after an attempt to deliver the mail
449 and if that attempt failed temporarily.
450 So a warning may be generated after a longer time, if there was no attempt before.
452 Default is "1h;4h;8h;1d;2d;3d"
454 .TP
455 \fBmax_defer_time\fR = \fItime\fR
457 This is the maximum time, in which a temporarily failed mail will be kept in the spool.
458 When this time is exceeded, it will be handled as a delivery failure,
459 and the message will be bounced.
461 The excedence of this time will only be noticed if the message was actually tried to be delivered.
462 If, for example, the message can only be delivered when online,
463 but you have not been online for that time, no bounce will be generated.
465 Default is 4d (4 days)
467 .TP
468 \fBlog_user = \fIname\fR
470 Replace \fIname\fR with a valid local or remote mail address.
472 If this option is set, then a copy of every mail,
473 that passes through the masqmail system will also be sent to the given mail address.
475 For example you can feed your mails into a program like hypermail
476 for archiving purpose by placing an appropriate pipe command in masqmail.alias
478 .TP
479 \fBmax_msg_size\fR = \fIbytes\fR
481 This option sets the maximum size in bytes masqmail will accept for delivery.
482 This value is advertised to the SMTP client by the `SIZE' message during SMTP
483 session setup.
484 Clients pretending to send, or actually send,
485 more than \fIbytes\fR will get a 552 error message.
487 `0' means no fixed maximum size limit is in force.
489 Default is 0 (= unlimited).
491 .TP
492 \fBdefer_all\fR = \fIboolean\fR
494 If set to true, masqmail replies with ``421 service temporarily unavailable''
495 to any SMTP request and shuts the connection down.
496 Note: This option is for debugging purposes only.
498 Default: false
501 .SH AUTHOR
503 Masqmail was written by Oliver Kurth.
504 It is now maintained by Markus Schnalke <meillo@marmaro.de>.
506 You will find the newest version of masqmail at \fBhttp://marmaro.de/prog/masqmail/\fR.
507 There is also a mailing list, you will find information about it at masqmail's main site.
510 .SH BUGS
512 Please report bugs to the mailing list.
515 .SH SEE ALSO
517 \fBmasqmail(8)\fR, \fBmasqmail.route(5)\fR