masqmail

view man/masqmail.conf.5 @ 421:f37384470855

Changed lockdir to /var/lock/masqmail; Create lockdir and piddir on startup. Moved the lockdir out of the spool dir. (When /var/lock is a ramdisk we do well to have the lock files there.) Added the new configure option --with-lockdir to change that location. Nontheless, if we run_as_user, then lock files are always stored in the spool dir directly. Instead of installing the lockdir and piddir at installation time, we create them on startup time now if they are missing. This is necessary if lockdir or piddir are a tmpfs.
author markus schnalke <meillo@marmaro.de>
date Wed, 30 May 2012 09:38:38 +0200
parents 4cbaf6d6793f
children bdbedce60247
line source
1 .TH masqmail.conf 5 2012-01-18 masqmail-0.3.4 "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 .RS 8
15 \fBval\fR = \fIexpression\fR
16 .RE
18 Where \fBval\fR is a variable name and \fIexpression\fR a string,
19 which can be quoted with double quotes `"'.
20 If the expression is on multiple lines or contains characters other
21 than letters,
22 digits or the characters `.', `\-', `_', `/', ';', '@', ':', it must be quoted.
23 You can use quotes inside quotes by escaping them with a backslash.
25 Each \fBval\fP has a type, which can be boolean, numeric, string or list.
26 A boolean variable can be set with one of the values `on', `yes', and `true'
27 or `off', `no' and `false'.
28 List items are separated with semicolons `;'.
29 The spaces around the equal sign `=' are optional.
31 All lists, except
32 \fBquery_routes.\fIname\fR and \fBpermanent_routes\fR, accept absolute
33 pathnames (leading slash `/') as entries, too.
34 They can be intermixed with normal entries.
35 The contents of these files will be included at this position in the list.
36 This makes including large lists more convenient.
37 Within these files, each line is one entry; the semicolon is no separator.
39 Blank lines and lines starting with a hash `#' are ignored.
42 .SH OPTIONS
44 .TP
45 \fBrun_as_user = \fIboolean\fR
47 If this is set, masqmail runs with the user id of the user who
48 invoked it and never changes it.
49 This is for debugging purposes only.
50 If the user is not root, masqmail will not be able to listen on a port < 1024
51 and will not be able to deliver local mail to others than the user.
53 .TP
54 \fBuse_syslog = \fIboolean\fR
56 If this is set, masqmail uses syslogd for logging.
57 It uses facility MAIL.
58 You still have to set \fBlog_dir\fR for debug files.
60 .TP
61 \fBdebug_level = \fIn\fR
63 Set the debug level.
64 Valid values are 0 to 6 and 9.
65 Be careful if you set this as high as 5 or higher,
66 the logs may very soon fill your hard drive.
67 Level 9 enables printing of debug messages to stderr during reading of
68 the config file.
69 The debug file comes available for the first time after this step.
70 Thus nothing but stderr is available.
71 Level 9 is almost never interesting.
73 .TP
74 \fBlog_dir = \fIfile\fR
76 The directory where logs are stored, if syslog is not used.
77 Debug files are always stored in this directory if debugging is enabled.
78 \fIfile\fR must be an absolute path.
80 Default: \fI/var/log/masqmail\fR
82 .TP
83 \fBmail_dir = \fIfile\fR
85 The directory where local mail is stored,
86 usually \fI/var/spool/mail\fR or \fI/var/mail\fR.
87 \fIfile\fR must be an absolute path.
89 Default: \fI/var/mail\fR
91 .TP
92 \fBspool_dir = \fIfile\fR
94 The directory where masqmail stores its spool files
95 (and lock files if \fIrun_as_user\fP).
96 It must have a subdirectory \fIinput\fR.
97 Masqmail needs read and write permissions for this directory.
98 \fIfile\fR must be an absolute path.
100 Default: \fI/var/spool/masqmail\fR
102 .TP
103 \fBlock_dir = \fIfile\fR
105 The directory where masqmail stores its lock files.
106 Masqmail needs read and write permissions for this directory.
107 The default is \fI/var/lock/masqmail\fR for normal operation.
108 \fIfile\fR must be an absolute path.
109 The directory is created on startup if yet missing.
111 If \fIrun_as_user\fP then lock files are stored in the \fIspool_dir\fP
112 directly and the \fBlock_dir\fP setting is ignored.
114 .TP
115 \fBhost_name = \fIstring\fR
117 This is used in different places: Masqmail identifies itself in
118 the greeting banner on incoming connections and in the HELO/EHLO command
119 for outgoing connections with this name, it is used in the Received: header
120 and to qualify the sender of a locally originating message.
122 If the string begins with a slash `/', it it assumed that it is a filename,
123 and the first line of this file will be used.
124 Usually this will be `/etc/mailname' to make masqmail conform to
125 Debian policies.
127 It is not used to find whether an address is local.
128 Use \fBlocal_hosts\fR for that.
130 Default: none; \fBhost_name\fP MUST be set in the config file
132 .TP
133 \fBlocal_hosts = \fIlist\fR
135 A semicolon `;' separated list of hostnames which are considered local.
136 Can contain glob patterns, like
137 `*example.org' or `mail?.*mydomain.net'.
138 Normally you should set it to "localhost;foo;foo.bar.com" if your host has the
139 fully qualified domain name `foo.bar.com'.
141 Default: localhost ; <value of \fBhost_name\fR cut at the first dot> ;
142 <value of \fBhost_name\fR>
144 Example: \fIlocalhost;foo;foo.example.org\fR
145 (if you have set \fBhost_name\fR to \fIfoo.example.org\fR)
147 .TP
148 \fBlocal_addresses = \fIlist\fR
150 A semicolon `;' separated list of fully qualified email-addresses which are
151 considered local although their domain name part is not in the list of
152 \fBlocal_hosts\fR.
153 This list can be seen as an addition to \fBlocal_hosts\fP.
154 .IP
155 Further more only the local part of the addresses will be regarded,
156 seeing it as a local user.
158 Example:
160 .RS 8
161 .nf
162 local_hosts = "localhost;myhost"
163 local_addresses = "bob@somewhere;alice@foo"
164 .fi
165 .RE
166 .IP
167 This means mail to person1@yourdomain will effectively go to
168 person1@localhost, if not redirected by an alias.
170 .TP
171 \fBnot_local_addresses = \fIlist\fR
173 A semicolon `;' separated list of fully qualified email-addresses which are
174 considered not local although their domain name part is in the list of
175 \fBlocal_hosts\fR.
176 This list can be seen as a substraction to \fBlocal_hosts\fP.
178 This is the opposite of the previous case.
179 The majority of addresses of a specific domain are local.
180 But some users are not.
181 With this option you can easily exclude these users.
183 Example:
185 .RS 8
186 .nf
187 local_hosts = "localhost;myhost;mydomain.net"
188 not_local_addresses = "eric@mydomain.net"
189 .fi
190 .RE
191 .IP
193 .TP
194 \fBlisten_addresses = \fIlist\fR
196 A semicolon `;' separated list of interfaces on which connections will
197 be accepted.
198 An interface ist defined by a hostname, optionally followed by a colon `:'
199 and a number for the port.
200 If this is left out, port 25 will be used.
202 You can set this to "localhost:25;foo:25" if your hostname is `foo'.
204 Note that the names are resolved to IP addresses.
205 If your host has different names which resolve to the same IP,
206 use only one of them, otherwise you will get an error message.
208 Default: \fIlocalhost:25\fR (i.e. only local processes can connect)
210 .TP
211 \fBdo_save_envelope_to = \fIboolean\fR
213 If this is set to true, a possibly existing Envelope-to: header in
214 an incoming mail which is received via either pop3 or smtp will be saved
215 as an X-Orig-Envelope-to: header.
217 This is useful if you retrieve mail from a pop3 server with fetchmail,
218 and the server supports Envelope-to: headers,
219 and you want to make use of those with a mail filtering tool, e.g. procmail.
220 It cannot be preserved because masqmail sets such a header by itself.
222 Default is false.
224 .TP
225 \fBdo_relay = \fIboolean\fR
227 If this is set to false, mail with a return path that is not local
228 and a destination that is also not local will not be accepted via smtp
229 and a 550 reply will be given.
230 Default is true.
232 Note that this will not protect you from spammers using open relays,
233 but from users unable to set their address in their mail clients.
235 .TP
236 \fBdo_queue = \fIboolean\fR
238 If this is set, masqmail will not try to deliver mail
239 immediately when accepted.
240 Instead it will always queue it.
241 (Note: Masqmail will always automatically queue mail if neccesary,
242 i.e. if it cannot deliver because no suitable route was available for example.)
244 Same as calling masqmail with the \fB\-odq\fR option.
245 Usually you should leave this option unset.
247 Default: false
249 .TP
250 \fBpermanent_routes\fR = \fIlist\fR
252 Set this to the filename (or a semicolon-separated list of filenames)
253 of the route configuration for always available connections.
254 Main purpose is to define a mail server with mail_host in your local network,
255 or if masqmail should send mail directly to the target host.
256 If you have only a single host, you can leave it unset.
258 A setting `\fBlocal_nets\fR = \fI"*home.net"\fR' in versions <= 0.3.3
259 is in newer versions configured as:
260 `\fBpermanent_routes\fR = \fI"/etc/masqmail/homenet.route"\fR'
261 and the route file `homenet.route' containing:
263 .RS 8
264 .nf
265 allowed_recipients = "*@*home.net"
266 connect_error_fail = true
267 resolve_list = byname
268 .fi
269 .RE
270 .IP
272 This is just as it had been with \fBlocal_net_route\fP,
273 with the exception that the filtering for appropriate addresses
274 is only in the route file and not with \fBlocal_nets\fR.
276 .TP
277 \fBquery_routes.\fIname\fR = \fIlist\fR
279 Replace \fIname\fR with a name to identify the connection.
280 Set this to a filename (or a semicolon-separated list of filenames)
281 for the route configuration for that connection.
283 Routes of this kind cannot be expected to be online always.
284 Masqmail will query which of the routes are online.
286 You can use the name to call masqmail with the \fB\-qo\fR option every time a
287 connection to your ISP is set up, in order to send queued mail through this
288 route.
290 Example: Your ISP has the name FastNet.
291 Then you write the following line in the main configuration:
293 .RS 8
294 .nf
295 \fBquery_routes.\fBFastNet\fR = \fI"/etc/masqmail/fastnet.route"\fR
296 .fi
297 .RE
298 .IP
300 \fI/etc/masqmail/fastnet.route\fR is the route configuration file,
301 see \fBmasqmail.route(5)\fR.
302 As soon as a link to FastNet has been set up,
303 you call `masqmail \fB\-qo \fIFastNet\fR'.
304 Masqmail will then read the specified file and send the mails.
306 See \fBonline_query\fP.
308 .TP
309 \fBalias_file = \fIfile\fR
311 Set this to the location of your alias file.
312 If not set, no aliasing will be done.
314 Default: <not set> (i.e. no aliasing is done)
316 .TP
317 \fBglobalias_file = \fIfile\fR
319 Set this to the location of a glob-pattern alias file.
320 This kind of aliasing matches glob patterns against full email addresses,
321 not strings against local parts like in normal aliasing.
322 You can use this to handle catch-all maildrops (``*@example.org'')
323 and to split between virtual hosts on a single machine
324 (e.g. ``info@foo.ex.org'' and ``info@bar.ex.org'').
326 Glob aliasing is done before normal aliasing.
327 If you have both kinds, glob and normal aliasing, then the results of the
328 glob aliasing may be expanded further by the normal aliasing mechanism.
330 Default: <not set> (i.e. no glob aliasing is done)
332 .TP
333 \fBcaseless_matching = \fIboolean\fR
335 If this is set, aliasing and the matching for \fBlocal_addresses\fP and
336 \fBnot_local_addresses\fP will be done caseless.
338 Note: Be sure to change this option only if the queue is empty as
339 correct processing of queued messages is not guaranteed otherwise.
341 Default: false
343 .TP
344 \fBpipe_fromline = \fIboolean\fR
346 If this is set, a from line will be prepended to the output stream whenever
347 a pipe command is called after an alias expansion.
348 Default is false.
350 .TP
351 \fBpipe_fromhack = \fIboolean\fR
353 If this is set, each line beginning with `From ' is replaced with `>From '
354 whenever a pipe command is called after an alias expansion.
355 You probably want this if you have set \fBpipe_fromline\fR above.
356 Default is false.
358 .TP
359 \fBmbox_default = \fIstring\fR
361 The default local delivery method.
362 Can be mbox or mda.
363 You can override this for each user by using the \fBmbox_users\fR or
364 \fBmda_users\fR (see below).
366 Default: mbox.
368 .TP
369 \fBmbox_users = \fIlist\fR
371 A list of users which wish delivery to an mbox style mail folder.
373 .TP
374 \fBmda_users = \fIlist\fR
376 A list of users which wish local delivery to an mda.
377 You have to set \fBmda\fR (see below) as well.
379 .TP
380 \fBmda = \fIexpand string\fR
382 If you want local delivery to be transferred to an mda (Mail Delivery Agent),
383 set this to a command.
384 The argument will be expanded on delivery time,
385 you can use variables beginning with a dolloar sign `$',
386 optionally enclosed in curly braces.
387 Variables you can use are:
389 .RS 8
390 .TP
391 uid
392 the unique message id.
393 (This is not necessarily identical with the Message ID
394 as given in the Message ID: header.)
396 .TP
397 received_host
398 the host the mail was received from
400 .TP
401 ident
402 the user id of the sender if the message was received locally.
404 .TP
405 return_path_local
406 the local part of the return path (sender).
408 .TP
409 return_path_domain
410 the domain part of the return path (sender).
412 .TP
413 return_path
414 the complete return path (sender).
416 .TP
417 rcpt_local
418 the local part of the recipient.
420 .TP
421 rcpt_domain
422 the domain part of the recipient.
424 .TP
425 rcpt
426 the complete recipient address.
427 .RE
428 .IP
430 Example:
432 .RS 8
433 mda="/usr/bin/procmail \-Y \-d ${rcpt_local}"
434 .RE
435 .IP
437 For the mda, as for pipe commands,
438 a few environment variables will be set as well.
439 See \fBmasqmail(8)\fR.
440 To use environment variables for the mda,
441 the dollar sign `$' has to be escaped with a backslash,
442 otherwise they will be tried to be expanded with the internal variables.
444 .TP
445 \fBmda_fromline = \fIboolean\fR
447 If this is set, a from line will be prepended to the output stream whenever
448 a message is delivered to an mda.
449 Default is false.
451 .TP
452 \fBmda_fromhack = \fIboolean\fR
454 If this is set, each line beginning with `From ' is replaced with `>From '
455 whenever a message is delivered to an mda.
456 You probably want this if you have set \fBmda_fromline\fR above.
457 Default is false.
459 .TP
460 \fBonline_query = \fIcommand line\fR
462 Defines the method masqmail uses to detect whether there exists
463 an online connection currently.
465 Masqmail executes the command given and reads from its standard output.
466 The command should just print a route name, as defined
467 with \fBquery_routes.\fIname\fR, to standard output and return
468 a zero status code.
469 Masqmail assumes it is offline if the script returns with a non-zero status.
470 Leading and trailing whitespace is removed from the output.
472 Simple example:
474 .RS 8
475 .nf
476 #!/bin/sh
477 test \-e /var/tmp/masqmail-route || exit 1
478 cat /var/tmp/masqmail-route
479 exit 0
480 .fi
481 .RE
482 .IP
484 No matter how masqmail detects the online status,
485 only messages that are accepted at online time will be
486 delivered using the connection.
487 The mail spool still needs to be emptied manually
488 (\fB\-qo\fIconnection\fR).
490 \fIcommand line\fR must start with an absolute path to an executable program.
491 It can contain optional arguments.
493 To simulate the old online_method=file, use:
495 .RS 8
496 \fI/bin/cat /path/to/file\fP
497 .RE
498 .IP
500 To be always online with connection `foo', use:
502 .RS 8
503 \fI/bin/echo foo\fP
504 .RE
505 .IP
507 To query a masqdialer server
508 (i.e. asking it whether a connection exists and what its name is)
509 use:
511 .RS 8
512 \fI/usr/bin/mservdetect localhost 224\fP
513 .RE
514 .IP
516 .TP
517 \fBerrmsg_file = \fIfile\fR
519 Set this to a template which will be used to generate delivery failure reports.
520 Variable parts within the template begin with a dollar sign and are identical
521 to those which can be used as arguments for the mda command,
522 see \fBmda\fR above.
523 Additional information can be included with @failed_rcpts,
524 @msg_headers and @msg_body,
525 these must be at the beginning of a line and will be replaced
526 with the list of the failed recipients,
527 the message headers and the message body of the failed message.
529 Default is /usr/share/masqmail/tpl/failmsg.tpl.
531 .TP
532 \fBwarnmsg_file = \fIfile\fR
534 Set this to a template which will be used to generate delivery warning reports.
535 It uses the same mechanisms for variables as \fBerrmsg_file\fR, see above.
537 Default is /usr/share/masqmail/tpl/warnmsg.tpl.
539 .TP
540 \fBwarn_intervals\fR = \fIlist\fR
542 Set this to a list of time intervals, at which delivery warnings
543 (starting with the receiving time of the message) shall be generated.
545 A warning will only be generated just after an attempt to deliver the mail
546 and if that attempt failed temporarily.
547 So a warning may be generated after a longer time,
548 if there was no attempt before.
550 Default is "1h;4h;8h;1d;2d;3d"
552 .TP
553 \fBmax_defer_time\fR = \fItime\fR
555 This is the maximum time,
556 in which a temporarily failed mail will be kept in the spool.
557 When this time is exceeded, it will be handled as a delivery failure,
558 and the message will be bounced.
560 The excedence of this time will only be noticed if the message
561 was actually tried to be delivered.
562 If, for example, the message can only be delivered when online,
563 but you have not been online for that time, no bounce will be generated.
565 Default is 4d (4 days)
567 .TP
568 \fBlog_user = \fIname\fR
570 Replace \fIname\fR with a valid local or remote mail address.
572 If this option is set, then a copy of every mail,
573 that passes through the masqmail system will also be sent
574 to the given mail address.
576 For example you can feed your mails into a program like hypermail
577 for archiving purpose by placing an appropriate pipe command
578 in masqmail.alias.
580 .TP
581 \fBmax_msg_size\fR = \fIbytes\fR
583 This option sets the maximum size in bytes masqmail will accept for delivery.
584 This value is advertised to the SMTP client by the `SIZE' message during SMTP
585 session setup.
586 Clients pretending to send, or actually send,
587 more than \fIbytes\fR will get a 552 error message.
589 A zero value disables the maximum size limit.
591 Default is 0 (= unlimited).
593 .TP
594 \fBdefer_all\fR = \fIboolean\fR
596 If set to true, masqmail replies with ``421 service temporarily unavailable''
597 to any SMTP request and shuts the connection down.
598 Note: This option is for debugging purposes only.
600 Default: false
603 .SH AUTHOR
605 Masqmail was written by Oliver Kurth.
606 It is now maintained by Markus Schnalke <meillo@marmaro.de>.
608 You will find the newest version of masqmail at
609 \fBhttp://marmaro.de/prog/masqmail/\fR.
610 There is also a mailing list,
611 you will find information about it at masqmail's main site.
614 .SH BUGS
616 Please report bugs to the mailing list.
619 .SH SEE ALSO
621 \fBmasqmail(8)\fR, \fBmasqmail.route(5)\fR