masqmail
view man/masqmail.conf.5 @ 427:c96a755b5fc4
Typo fix in man page. Reported via Debian.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Mon, 04 Jun 2012 20:02:31 +0200 |
parents | bdbedce60247 |
children | 34c919a8d74e |
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 Masqmail needs read and write permissions for this directory.
97 \fIfile\fR must be an absolute path.
99 Default: \fI/var/spool/masqmail\fR
101 .TP
102 \fBlock_dir = \fIfile\fR
104 The directory where masqmail stores its lock files.
105 Masqmail needs read and write permissions for this directory.
106 The default is \fI/var/lock/masqmail\fR for normal operation.
107 \fIfile\fR must be an absolute path.
108 The directory is created on startup if yet missing.
110 If \fIrun_as_user\fP then lock files are stored in the \fIspool_dir\fP
111 directly and the \fBlock_dir\fP setting is ignored.
113 .TP
114 \fBhost_name = \fIstring\fR
116 This is used in different places: Masqmail identifies itself in
117 the greeting banner on incoming connections and in the HELO/EHLO command
118 for outgoing connections with this name, it is used in the Received: header
119 and to qualify the sender of a locally originating message.
121 If the string begins with a slash `/', it it assumed that it is a filename,
122 and the first line of this file will be used.
123 Usually this will be `/etc/mailname' to make masqmail conform to
124 Debian policies.
126 It is not used to find whether an address is local.
127 Use \fBlocal_hosts\fR for that.
129 Default: none; \fBhost_name\fP MUST be set in the config file
131 .TP
132 \fBlocal_hosts = \fIlist\fR
134 A semicolon `;' separated list of hostnames which are considered local.
135 Can contain glob patterns, like
136 `*example.org' or `mail?.*mydomain.net'.
137 Normally you should set it to "localhost;foo;foo.bar.com" if your host has the
138 fully qualified domain name `foo.bar.com'.
140 Default: localhost ; <value of \fBhost_name\fR cut at the first dot> ;
141 <value of \fBhost_name\fR>
143 Example: \fIlocalhost;foo;foo.example.org\fR
144 (if you have set \fBhost_name\fR to \fIfoo.example.org\fR)
146 .TP
147 \fBlocal_addresses = \fIlist\fR
149 A semicolon `;' separated list of fully qualified email-addresses which are
150 considered local although their domain name part is not in the list of
151 \fBlocal_hosts\fR.
152 This list can be seen as an addition to \fBlocal_hosts\fP.
153 .IP
154 Further more only the local part of the addresses will be regarded,
155 seeing it as a local user.
157 Example:
159 .RS 8
160 .nf
161 local_hosts = "localhost;myhost"
162 local_addresses = "bob@somewhere;alice@foo"
163 .fi
164 .RE
165 .IP
166 This means mail to person1@yourdomain will effectively go to
167 person1@localhost, if not redirected by an alias.
169 .TP
170 \fBnot_local_addresses = \fIlist\fR
172 A semicolon `;' separated list of fully qualified email-addresses which are
173 considered not local although their domain name part is in the list of
174 \fBlocal_hosts\fR.
175 This list can be seen as a substraction to \fBlocal_hosts\fP.
177 This is the opposite of the previous case.
178 The majority of addresses of a specific domain are local.
179 But some users are not.
180 With this option you can easily exclude these users.
182 Example:
184 .RS 8
185 .nf
186 local_hosts = "localhost;myhost;mydomain.net"
187 not_local_addresses = "eric@mydomain.net"
188 .fi
189 .RE
190 .IP
192 .TP
193 \fBlisten_addresses = \fIlist\fR
195 A semicolon `;' separated list of interfaces on which connections will
196 be accepted.
197 An interface ist defined by a hostname, optionally followed by a colon `:'
198 and a number for the port.
199 If this is left out, port 25 will be used.
201 You can set this to "localhost:25;foo:25" if your hostname is `foo'.
203 Note that the names are resolved to IP addresses.
204 If your host has different names which resolve to the same IP,
205 use only one of them, otherwise you will get an error message.
207 Default: \fIlocalhost:25\fR (i.e. only local processes can connect)
209 .TP
210 \fBdo_save_envelope_to = \fIboolean\fR
212 If this is set to true, a possibly existing Envelope-to: header in
213 an incoming mail which is received via either pop3 or smtp will be saved
214 as an X-Orig-Envelope-to: header.
216 This is useful if you retrieve mail from a pop3 server with fetchmail,
217 and the server supports Envelope-to: headers,
218 and you want to make use of those with a mail filtering tool, e.g. procmail.
219 It cannot be preserved because masqmail sets such a header by itself.
221 Default is false.
223 .TP
224 \fBdo_relay = \fIboolean\fR
226 If this is set to false, mail with a return path that is not local
227 and a destination that is also not local will not be accepted via smtp
228 and a 550 reply will be given.
229 Default is true.
231 Note that this will not protect you from spammers using open relays,
232 but from users unable to set their address in their mail clients.
234 .TP
235 \fBdo_queue = \fIboolean\fR
237 If this is set, masqmail will not try to deliver mail
238 immediately when accepted.
239 Instead it will always queue it.
240 (Note: Masqmail will always automatically queue mail if necessary,
241 i.e. if it cannot deliver because no suitable route was available for example.)
243 Same as calling masqmail with the \fB\-odq\fR option.
244 Usually you should leave this option unset.
246 Default: false
248 .TP
249 \fBpermanent_routes\fR = \fIlist\fR
251 Set this to the filename (or a semicolon-separated list of filenames)
252 of the route configuration for always available connections.
253 Main purpose is to define a mail server with mail_host in your local network,
254 or if masqmail should send mail directly to the target host.
255 If you have only a single host, you can leave it unset.
257 A setting `\fBlocal_nets\fR = \fI"*home.net"\fR' in versions <= 0.3.3
258 is in newer versions configured as:
259 `\fBpermanent_routes\fR = \fI"/etc/masqmail/homenet.route"\fR'
260 and the route file `homenet.route' containing:
262 .RS 8
263 .nf
264 allowed_recipients = "*@*home.net"
265 connect_error_fail = true
266 resolve_list = byname
267 .fi
268 .RE
269 .IP
271 This is just as it had been with \fBlocal_net_route\fP,
272 with the exception that the filtering for appropriate addresses
273 is only in the route file and not with \fBlocal_nets\fR.
275 .TP
276 \fBquery_routes.\fIname\fR = \fIlist\fR
278 Replace \fIname\fR with a name to identify the connection.
279 Set this to a filename (or a semicolon-separated list of filenames)
280 for the route configuration for that connection.
282 Routes of this kind cannot be expected to be online always.
283 Masqmail will query which of the routes are online.
285 You can use the name to call masqmail with the \fB\-qo\fR option every time a
286 connection to your ISP is set up, in order to send queued mail through this
287 route.
289 Example: Your ISP has the name FastNet.
290 Then you write the following line in the main configuration:
292 .RS 8
293 .nf
294 \fBquery_routes.\fBFastNet\fR = \fI"/etc/masqmail/fastnet.route"\fR
295 .fi
296 .RE
297 .IP
299 \fI/etc/masqmail/fastnet.route\fR is the route configuration file,
300 see \fBmasqmail.route(5)\fR.
301 As soon as a link to FastNet has been set up,
302 you call `masqmail \fB\-qo \fIFastNet\fR'.
303 Masqmail will then read the specified file and send the mails.
305 See \fBonline_query\fP.
307 .TP
308 \fBalias_file = \fIfile\fR
310 Set this to the location of your alias file.
311 If not set, no aliasing will be done.
313 Default: <not set> (i.e. no aliasing is done)
315 .TP
316 \fBglobalias_file = \fIfile\fR
318 Set this to the location of a glob-pattern alias file.
319 This kind of aliasing matches glob patterns against full email addresses,
320 not strings against local parts like in normal aliasing.
321 You can use this to handle catch-all maildrops (``*@example.org'')
322 and to split between virtual hosts on a single machine
323 (e.g. ``info@foo.ex.org'' and ``info@bar.ex.org'').
325 Glob aliasing is done before normal aliasing.
326 If you have both kinds, glob and normal aliasing, then the results of the
327 glob aliasing may be expanded further by the normal aliasing mechanism.
329 Default: <not set> (i.e. no glob aliasing is done)
331 .TP
332 \fBcaseless_matching = \fIboolean\fR
334 If this is set, aliasing and the matching for \fBlocal_addresses\fP and
335 \fBnot_local_addresses\fP will be done caseless.
337 Note: Be sure to change this option only if the queue is empty as
338 correct processing of queued messages is not guaranteed otherwise.
340 Default: false
342 .TP
343 \fBpipe_fromline = \fIboolean\fR
345 If this is set, a from line will be prepended to the output stream whenever
346 a pipe command is called after an alias expansion.
347 Default is false.
349 .TP
350 \fBpipe_fromhack = \fIboolean\fR
352 If this is set, each line beginning with `From ' is replaced with `>From '
353 whenever a pipe command is called after an alias expansion.
354 You probably want this if you have set \fBpipe_fromline\fR above.
355 Default is false.
357 .TP
358 \fBmbox_default = \fIstring\fR
360 The default local delivery method.
361 Can be mbox or mda.
362 You can override this for each user by using the \fBmbox_users\fR or
363 \fBmda_users\fR (see below).
365 Default: mbox.
367 .TP
368 \fBmbox_users = \fIlist\fR
370 A list of users which wish delivery to an mbox style mail folder.
372 .TP
373 \fBmda_users = \fIlist\fR
375 A list of users which wish local delivery to an mda.
376 You have to set \fBmda\fR (see below) as well.
378 .TP
379 \fBmda = \fIexpand string\fR
381 If you want local delivery to be transferred to an mda (Mail Delivery Agent),
382 set this to a command.
383 The argument will be expanded on delivery time,
384 you can use variables beginning with a dolloar sign `$',
385 optionally enclosed in curly braces.
386 Variables you can use are:
388 .RS 8
389 .TP
390 uid
391 the unique message id.
392 (This is not necessarily identical with the Message ID
393 as given in the Message ID: header.)
395 .TP
396 received_host
397 the host the mail was received from
399 .TP
400 ident
401 the user id of the sender if the message was received locally.
403 .TP
404 return_path_local
405 the local part of the return path (sender).
407 .TP
408 return_path_domain
409 the domain part of the return path (sender).
411 .TP
412 return_path
413 the complete return path (sender).
415 .TP
416 rcpt_local
417 the local part of the recipient.
419 .TP
420 rcpt_domain
421 the domain part of the recipient.
423 .TP
424 rcpt
425 the complete recipient address.
426 .RE
427 .IP
429 Example:
431 .RS 8
432 mda="/usr/bin/procmail \-Y \-d ${rcpt_local}"
433 .RE
434 .IP
436 For the mda, as for pipe commands,
437 a few environment variables will be set as well.
438 See \fBmasqmail(8)\fR.
439 To use environment variables for the mda,
440 the dollar sign `$' has to be escaped with a backslash,
441 otherwise they will be tried to be expanded with the internal variables.
443 .TP
444 \fBmda_fromline = \fIboolean\fR
446 If this is set, a from line will be prepended to the output stream whenever
447 a message is delivered to an mda.
448 Default is false.
450 .TP
451 \fBmda_fromhack = \fIboolean\fR
453 If this is set, each line beginning with `From ' is replaced with `>From '
454 whenever a message is delivered to an mda.
455 You probably want this if you have set \fBmda_fromline\fR above.
456 Default is false.
458 .TP
459 \fBonline_query = \fIcommand line\fR
461 Defines the method masqmail uses to detect whether there exists
462 an online connection currently.
464 Masqmail executes the command given and reads from its standard output.
465 The command should just print a route name, as defined
466 with \fBquery_routes.\fIname\fR, to standard output and return
467 a zero status code.
468 Masqmail assumes it is offline if the script returns with a non-zero status.
469 Leading and trailing whitespace is removed from the output.
471 Simple example:
473 .RS 8
474 .nf
475 #!/bin/sh
476 test \-e /var/tmp/masqmail-route || exit 1
477 cat /var/tmp/masqmail-route
478 exit 0
479 .fi
480 .RE
481 .IP
483 No matter how masqmail detects the online status,
484 only messages that are accepted at online time will be
485 delivered using the connection.
486 The mail spool still needs to be emptied manually
487 (\fB\-qo\fIconnection\fR).
489 \fIcommand line\fR must start with an absolute path to an executable program.
490 It can contain optional arguments.
492 To simulate the old online_method=file, use:
494 .RS 8
495 \fI/bin/cat /path/to/file\fP
496 .RE
497 .IP
499 To be always online with connection `foo', use:
501 .RS 8
502 \fI/bin/echo foo\fP
503 .RE
504 .IP
506 To query a masqdialer server
507 (i.e. asking it whether a connection exists and what its name is)
508 use:
510 .RS 8
511 \fI/usr/bin/mservdetect localhost 224\fP
512 .RE
513 .IP
515 .TP
516 \fBerrmsg_file = \fIfile\fR
518 Set this to a template which will be used to generate delivery failure reports.
519 Variable parts within the template begin with a dollar sign and are identical
520 to those which can be used as arguments for the mda command,
521 see \fBmda\fR above.
522 Additional information can be included with @failed_rcpts,
523 @msg_headers and @msg_body,
524 these must be at the beginning of a line and will be replaced
525 with the list of the failed recipients,
526 the message headers and the message body of the failed message.
528 Default is /usr/share/masqmail/tpl/failmsg.tpl.
530 .TP
531 \fBwarnmsg_file = \fIfile\fR
533 Set this to a template which will be used to generate delivery warning reports.
534 It uses the same mechanisms for variables as \fBerrmsg_file\fR, see above.
536 Default is /usr/share/masqmail/tpl/warnmsg.tpl.
538 .TP
539 \fBwarn_intervals\fR = \fIlist\fR
541 Set this to a list of time intervals, at which delivery warnings
542 (starting with the receiving time of the message) shall be generated.
544 A warning will only be generated just after an attempt to deliver the mail
545 and if that attempt failed temporarily.
546 So a warning may be generated after a longer time,
547 if there was no attempt before.
549 Default is "1h;4h;8h;1d;2d;3d"
551 .TP
552 \fBmax_defer_time\fR = \fItime\fR
554 This is the maximum time,
555 in which a temporarily failed mail will be kept in the spool.
556 When this time is exceeded, it will be handled as a delivery failure,
557 and the message will be bounced.
559 The excedence of this time will only be noticed if the message
560 was actually tried to be delivered.
561 If, for example, the message can only be delivered when online,
562 but you have not been online for that time, no bounce will be generated.
564 Default is 4d (4 days)
566 .TP
567 \fBlog_user = \fIname\fR
569 Replace \fIname\fR with a valid local or remote mail address.
571 If this option is set, then a copy of every mail,
572 that passes through the masqmail system will also be sent
573 to the given mail address.
575 For example you can feed your mails into a program like hypermail
576 for archiving purpose by placing an appropriate pipe command
577 in masqmail.alias.
579 .TP
580 \fBmax_msg_size\fR = \fIbytes\fR
582 This option sets the maximum size in bytes masqmail will accept for delivery.
583 This value is advertised to the SMTP client by the `SIZE' message during SMTP
584 session setup.
585 Clients pretending to send, or actually send,
586 more than \fIbytes\fR will get a 552 error message.
588 A zero value disables the maximum size limit.
590 Default is 0 (= unlimited).
592 .TP
593 \fBdefer_all\fR = \fIboolean\fR
595 If set to true, masqmail replies with ``421 service temporarily unavailable''
596 to any SMTP request and shuts the connection down.
597 Note: This option is for debugging purposes only.
599 Default: false
602 .SH AUTHOR
604 Masqmail was written by Oliver Kurth.
605 It is now maintained by Markus Schnalke <meillo@marmaro.de>.
607 You will find the newest version of masqmail at
608 \fBhttp://marmaro.de/prog/masqmail/\fR.
609 There is also a mailing list,
610 you will find information about it at masqmail's main site.
613 .SH BUGS
615 Please report bugs to the mailing list.
618 .SH SEE ALSO
620 \fBmasqmail(8)\fR, \fBmasqmail.route(5)\fR