masqmail

view man/masqmail.conf.5 @ 414:309935f59820

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