masqmail
view docs/old-manual/docs/masqmail.conf.5.html @ 78:6538aa6969e5
next version will be 0.2.24
author | meillo@marmaro.de |
---|---|
date | Sat, 19 Jun 2010 10:51:23 +0200 |
parents | |
children |
line source
1 <body text="#000000" link="#0000ff" bgcolor="#ffffff"><center><table width="80%">
2 <tr><td><h1>masqmail.conf</h1>
3 <h2>masqmail configuration file</h2>
6 <h2>Description</h2>
8 <p>This man page describes the syntax of the main configuration file
9 of masqmail. Its usual location is <em>/etc/masqmail/masqmail.conf</em></p>
11 <p>The configuration consists of lines of the form</p>
13 <p><b>val</b> = <em>expression</em></p>
15 <p>Where <b>val</b> is a variable name and <em>expression</em> a string,
16 which can be quoted with '"'. If the expression is on multiple lines
17 or contains characters other than letters, digits or the characters
18 '.', '-', '_', '/', it must be quoted. You can use quotes inside quotes
19 by escaping them with a backslash.</p>
21 <p>Each val has a type, which can be boolean, numeric, string
22 or list. A boolean variable can be set with one of the values 'on',
23 'yes', and 'true' or 'off', 'no' and 'false'. List items are separated
24 with ';'. For some values patterns (like '*','?') can be used. The
25 spaces before and after the '=' are optional.</p>
27 <p>Most lists (exceptions: <b>local_hosts</b>,
28 <b>local_nets</b>, <b>listen_addresses</b>, <b>online_routes</b> and <b>online_gets</b>) accept
29 files. These will be recognized by a leading slash '/'. The contents
30 of these files will be included at the position of the file name,
31 there can be items or other files before and after the file entry. The
32 format of the files is different though, within these files each entry
33 is on another line. (And not separated by semicolons). This makes it
34 easy to include large lists which are common in different
35 configuration files, so they do not have to appear in every
36 configuration file.</p>
38 <p>Blank lines and lines starting with '#' are ignored.</p>
43 <h2>Options</h2>
46 <p><b>run_as_user = <em>boolean</em></b></p>
48 <p>If this is set, masqmail runs with the user id of the user who
49 invoked it and never changes it. This is for debugging purposes
50 only. If the user is not root, masqmail will not be able to
51 listen on a port < 1024 and will not be able to deliver local mail
52 to others than the user.</p>
57 <p><b>use_syslog = <em>boolean</em></b></p>
59 <p>If this is set, masqmail uses syslogd for logging. It uses facility
60 MAIL. You still have to set <b>log_dir</b> for debug files.</p>
65 <p><b>debug_level = <em>n</em></b></p>
67 <p>Set the debug level. Valid values are 0 to 6, increasing it further
68 makes no difference. Be careful if you set this as high as 5 or higher,
69 the logs may very soon fill your hard drive.</p>
74 <p><b>mail_dir = <em>file</em></b></p>
76 <p>The directory where local mail is stored,
77 usually <em>/var/spool/mail</em> or <em>/var/mail</em>.</p>
82 <p><b>spool_dir = <em>file</em></b></p>
84 <p>The directory where masqmail stores its spool files (and later also
85 other stuff). It must have a subdirectory <em>input</em>.
86 Masqmail needs read and write permissions for this
87 directory. I suggest to use <em>/var/spool/masqmail</em>.</p>
92 <p><b>host_name = <em>string</em></b></p>
94 <p>This is used in different places: Masqmail identifies itself in the
95 greeting banner on incoming connections and in the HELO/EHLO command
96 for outgoing connections with this name, it is used in the Received:
97 header and to qualify the sender of a locally originating message.</p>
99 <p>If the string begins with a slash '/', it it assumed that it is a
100 filename, and the first line of this file will be used. Usually this will
101 be '/etc/mailname' to make masqmail conform to Debian policies.</p>
103 <p>It is not used to find whether an address is local.
104 Use <b>local_hosts</b> for that.</p>
109 <p><b>remote_port = <em>n</em></b></p>
111 <p>The remote port number to be used. This defaults to port 25.</p>
112 <p>This option is deprecated. Use <b>host_name</b> in the route
113 configuration instead. See <a href="masqmail.route.5.html">masqmail.route</a>.</p>
118 <p><b>local_hosts = <em>list</em></b></p>
120 <p>A semicolon ';' separated list of hostnames which are considered
121 local. Normally you set it to "localhost;foo;foo.bar.com" if your host
122 has the fully qualified domain name 'foo.bar.com'.</p>
127 <p><b>local_nets = <em>list</em></b></p>
129 <p>A semicolon ';' separated list of hostnames which are on the
130 'local' net. Delivery to these hosts is attempted immediately. You can
131 use patterns with '*', eg. "*.bar.com".</p>
136 <p><b>local_addresses = <em>list</em></b></p>
138 <p>A semicolon ';' separated list of fully qualified email-addresses
139 which are considered local although their domain name part is not in
140 the list of <b>local_hosts</b>. </p>
141 <p>For example: There are two people working at your
142 LAN: person1@yourdomain and person2@yourdomain. But there are
143 other persons @yourdomain which are NOT local. So you can not put
144 yourdomain to the list of local_hosts. If person1 now wants
145 to write to person2@yourdomain and this mail should not leave the LAN
146 then you can put</p>
147 <p>local_addresses = "person1@yourdomain;person2@yourdomain"</p>
148 <p>to your masqmail.conf.</p>
153 <p><b>not_local_addresses = <em>list</em></b></p>
155 <p>A semicolon ';' separated list of fully qualified email-addresses
156 which are considered not local although their domain name part is in
157 the list of <b>local_hosts</b>. </p>
158 <p>This ist the opposite of the previous case. The majority of addresses
159 of a specific domain are local. But some users are not. With this
160 option you can easily exclude these users.</p>
161 <p>Example:</p>
162 <p>local_hosts = "localhost;myhost;mydomain.net"</p>
163 <p>not_local_addresses = "eric@mydomain.net"</p>
168 <p><b>listen_addresses = <em>list</em></b></p>
170 <p>A semicolon ';' separated list of interfaces on which connections
171 will be accepted. An interface ist defined by a hostname, optionally
172 followed by a colon ':' and a number for the port. If this is left out,
173 port 25 will be used.</p>
174 <p>You can set this to "localhost:25;foo:25" if your hostname is 'foo'.</p>
175 <p>Note that the names are resolved to IP addreses. If your host has
176 different names which resolve to the same IP, use only one of them,
177 otherwise you will get an error message.
178 </p>
183 <p><b>do_save_envelope_to = <em>boolean</em></b></p>
185 <p>If this is set to true, a possibly existing Envelope-to: header in an
186 incoming mail which is received via either pop3 or smtp will be saved as
187 an X-Orig-Envelope-to: header.</p>
188 <p>This is useful if you retrieve mail from a pop3 server with either masqmail
189 or fetchmail, and the server supports Envelope-to: headers, and you want to make use
190 of those with a mail filtering tool, eg. procmail. It cannot be preserved because
191 masqmail sets such a header by itself.</p>
192 <p>Default is false.</p>
197 <p><b>do_relay = <em>boolean</em></b></p>
199 <p>If this is set to false, mail with a return path that is not local and a
200 destination that is also not local will not be accepted via smtp and a 550
201 reply will be given. Default is true.</p>
202 <p>Note that this will not protect you from spammers using open relays, but from
203 users unable to set their address in their mail clients.</p>
208 <p><b>do_queue = <em>boolean</em></b></p>
210 <p>If this is set, mail will not be delivered immediately when
211 accepted. Same as calling masqmail with the <b>-odq</b> option.</p>
216 <p><b>online_routes.<em>name</em> = <em>list</em></b></p>
219 <p>Replace <em>name</em> with a name to identify a connection. Set this
220 to a filename (or a list of filenames) for the special route configuration for that
221 connection. You will use that name to call masqmail with the
222 <b>-qo</b> option every time a connection to your ISP is set
223 up.</p>
225 <p>Example: Your ISP has the name FastNet. Then you write the
226 following line in the main configuration:</p>
228 <p><b>online_routes.FastNet</b> = <em>"/etc/masqmail/fastnet.route"</em></p>
230 <p><em>/etc/masqmail/fastnet.route</em> is the route configuration
231 file, see <a href="masqmail.route.5.html">masqmail.route</a>. As soon as a link to FastNet has been set up, you
232 call masqmail <b>-qo</b> <em>FastNet</em>. Masqmail will then
233 read the specified file and send the mails.</p>
239 <p><b>connect_route.<em>name</em> = <em>list</em></b></p>
241 <p>Old name for <b>online_routes</b>.</p>
247 <p><b>local_net_route = <em>file</em></b></p>
249 <p>This is similar to <b>online_routes.<em>name</em></b> but for the
250 local net. Recipient addresses that are in local_nets will be
251 routed using this route configuration. Main purpose is to define a
252 mail server with mail_host in your local network. In simple
253 environments this can be left unset. If unset, a default route
254 configuration will be used.</p>
259 <p><b>alias_file = <em>file</em></b></p>
261 <p>Set this to the location of your alias file. If unset, no aliasing
262 will be done.</p>
267 <p><b>alias_local_caseless = <em>boolean</em></b></p>
269 <p>If this is set, local parts in the alias file will be matched
270 disregarding upper/lower case.</p>
275 <p><b>pipe_fromline = <em>boolean</em></b></p>
277 <p>If this is set, a from line will be prepended to the output stream whenever
278 a pipe command is called after an alias expansion. Default is false.</p>
283 <p><b>pipe_fromhack = <em>boolean</em></b></p>
285 <p>If this is set, each line beginning with 'From ' is replaced with '>From ' whenever
286 a pipe command is called after an alias expansion. You probably want this if you have
287 set <b>pipe_fromline</b> above. Default is false.</p>
292 <p><b>mbox_default = <em>string</em></b></p>
294 <p>The default local delivery method. Can be one of mbox, mda or
295 maildir (the latter only if maildir support is enabled at compile
296 time). Default is mbox. You can override this for each user by using
297 the <b>mbox_users</b>, <b>mda_users</b> or <b>maildir_users</b> options
298 (see below).
299 </p>
304 <p><b>mbox_users = <em>list</em></b></p>
306 <p>A list of users which wish delivery to an mbox style mail folder.</p>
311 <p><b>mda_users = <em>list</em></b></p>
313 <p>A list of users which wish local delivery to an mda. You have to
314 set <b>mda</b> (see below) as well.</p>
319 <p><b>maildir_users = <em>list</em></b></p>
321 <p>A list of users which wish delivery to a qmail style maildir. The
322 path to maildir is ~/Maildir/. The maildir will be created if it
323 does not exist.</p>
328 <p><b>mda = <em>expand string</em></b></p>
330 <p>If you want local delivery to be transferred to an mda (Mail
331 Delivery Agent), set this to a command. The argument will be expanded
332 on delivery time, you can use variables beginning with a '$' sign,
333 optionally enclosed in curly braces. Variables you can use are:</p>
334 <p>uid - the unique message id. This is not necessarily identical with
335 the Message ID as given in the Message ID: header.</p>
336 <p>received_host - the host the mail was received from</p>
337 <p>ident - the ident, this is either the ident delivered by the ident
338 protocol or the user id of the sender if the message was received locally.</p>
339 <p>return_path_local - the local part of the return path (sender).</p>
340 <p>return_path_domain - the domain part of the return path (sender).</p>
341 <p>return_path - the complete return path (sender).</p>
342 <p>rcpt_local - the local part of the recipient.</p>
343 <p>rcpt_domain - the domain part of the recipient.</p>
344 <p>rcpt - the complete recipient address.</p>
345 <p>Example:</p><p>mda="/usr/bin/procmail -Y -d ${rcpt_local}"</p>
346 <p>For the mda, as for pipe commands, a few environment variables will
347 be set as well. See <a href="masqmail.8.html">masqmail</a>. To use environment variables for the mda,
348 the '$' sign has to be escaped with a backslash, otherwise they will
349 be tried to be expanded with the internal variables.</p>
355 <p><b>mda_fromline = <em>boolean</em></b></p>
357 <p>If this is set, a from line will be prepended to the output stream whenever
358 a message is delivered to an mda. Default is false.</p>
363 <p><b>mda_fromhack = <em>boolean</em></b></p>
365 <p>If this is set, each line beginning with 'From ' is replaced with '>From ' whenever
366 a message is delivered to an mda. You probably want this if you have
367 set <b>mda_fromline</b> above. Default is false.</p>
372 <p><b>online_detect = <em>string</em></b></p>
374 <p>Defines the method MasqMail uses to detect whether there is
375 currently an online connection. It can have the
376 values <b>file</b>, <b>pipe</b> or <b>mserver</b>.</p>
378 <p>When it is set to <b>file</b>, MasqMail first checks for the
379 existence of <b>online_file</b> (see below) and if it exists, it reads
380 it. The content of the file should be the name of the current
381 connection as defined with <b>connect_route.<em>name</em></b> (without
382 a trailing newline character).</p>
384 <p>When it is set to <b>pipe</b>, MasqMail calls the executable given by
385 the <b>online_pipe</b> option (see below) and reads the current online
386 status from its standard output.</p>
388 <p>When it is set to <b>mserver</b>, MasqMail connects to the
389 masqdialer server using the value of <b>mserver_iface</b> and asks it
390 whether a connection exists and for the name, which should be the name
391 of the current connection as defined with <b>connect_route.<em>name</em></b>.</p>
393 <p>No matter how MasqMail detects the online status, only messages
394 that are accepted at online time will be delivered using the
395 connection. The spool still has to be emptied with masqmail <b>-qo</b>
396 <em>connection</em>.</p>
401 <p><b>online_file = <em>file</em></b></p>
403 <p>This is the name of the file checked for when MasqMail determines
404 whether it is online. The file should only exist when there is
405 currently a connection. Create it in your ip-up script with eg.</p>
407 <p>echo -n <name> > /tmp/connect_route</p>
408 <p>chmod 0644 /tmp/connect_route</p>
410 <p>Do not forget to delete it in your ip-down script.</p>
415 <p><b>online_pipe = <em>file</em></b></p>
417 <p>This is the name of the executable which will be called to determine
418 the online status. This executable should just print the name oif the current
419 connection to the standard output and return a zero status code. masqmail assumes
420 it is offline if the script returns with a non zero status. Simple example:</p>
422 <p>#!/bin/sh</p>
423 <p></p>
424 <p>[ -e /tmp/connect_route ] || exit 1</p>
425 <p>cat /tmp/connect_route</p>
426 <p>exit 0</p>
428 <p>Of course, instead of the example above you could as well use <b>file</b> as
429 the online detection method, but you can do something more sophisticated.</p>
434 <p><b>mserver_iface = <em>interface</em></b></p>
436 <p>The interface the masqdialer server is listening to. Usually this
437 will be "localhost:224" if mserver is running on the same host as
438 masqmail. But using this option, you can also let masqmail run on
439 another host by setting <b>mserver_iface</b> to another hostname,
440 eg. "foo:224".</p>
445 <p><b>get.<em>name</em> = <em>file</em></b></p>
447 <p>Replace <em>name</em> with a name to identify a get
448 configuration. Set this to a filename for the get configuration. These
449 files will be used to retrieve mail when called with the -g option.</p>
454 <p><b>online_gets.<em>name</em> = <em>list</em></b></p>
456 <p>Replace <em>name</em> with a name to identify an online
457 configuration. Set this to a filename (or a list of filenames) for the get configuration. These
458 files will be used to retrieve mail when called with the -go option.</p>
463 <p><b>ident_trusted_nets = <em>list</em></b></p>
465 <p><em>list</em> is a list of networks of the form a.b.c.d/e
466 (eg. 192.168.1.0/24), from which the ident given by the ident protocol
467 will be trusted, so a user can delete his mail from the queue if the
468 ident is identical to his login name.</p>
473 <p><b>errmsg_file = <em>file</em></b></p>
475 <p>Set this to a template which will be used to generate delivery failure
476 reports. Variable parts within the template begin with a dollar sign and
477 are identical to those which can be used as arguments for the mda command,
478 see <b>mda</b> above. Additional information can be included with
479 @failed_rcpts, @msg_headers and @msg_body, these must be at the
480 beginning of a line and will be replaced with the list of the failed recipients,
481 the message headers and the message body of the failed message.</p>
482 <p>Default is /usr/share/masqmail/tpl/failmsg.tpl.</p>
487 <p><b>warnmsg_file = <em>file</em></b></p>
489 <p>Set this to a template which will be used to generate delivery warning
490 reports. It uses the same mechanisms for variables as <b>errmsg_file</b>,
491 see above.
492 </p>
493 <p>Default is /usr/share/masqmail/tpl/warnmsg.tpl.</p>
498 <p><b>warn_intervals</b> = <em>list</em></p>
500 <p>Set this to a list of time intervals, at which delivery warnings (starting
501 with the receiving time of the message) shall be generated.</p>
502 <p>A warning will only be generated just after an attempt to deliver the
503 mail and if that attempt failed temporarily. So a warning may be generated after
504 a longer time, if there was no attempt before.</p>
505 <p>Default is "1h;4h;8h;1d;2d;3d"</p>
510 <p><b>max_defer_time</b> = <em>time</em></p>
512 <p>This is the maximum time, in which a temporarily failed mail will be kept
513 in the spool. When this time is exceeded, it will be handled as a delivery failure,
514 and the message will be bounced.</p>
515 <p>The excedence of this time will only be noticed if the message was actually
516 tried to be delivered. If, for example, the message can only be delivered when
517 online, but you have not been online for that time, no bounce will be generated.</p>
518 <p>Default is 4d (4 days)</p>
523 <p><b>log_user = <em>name</em></b></p>
525 <p>Replace <em>name</em> with a valid local or remote mail address.</p>
526 <p>If this option is not empty, then a copy of every mail,
527 that passes trough the masqmail system will also be sent to the
528 given mail address.</p>
529 <p>For example you can feed your mails into a program like hypermail for
530 archiving purpose by placing an appropriate pipe command in masqmail.alias</p>
536 <h2>Author</h2>
538 <p>masqmail was written by Oliver Kurth
539 <oku@masqmail.cx></p><p>You will find the newest version of
540 masqmail at <a href = "http://masqmail.cx/masqmail/">http://masqmail.cx/masqmail/</a> or search for it
541 in freshmeat (<a href = "http://www.freshmeat.net">http://www.freshmeat.net</a>). There is also a mailing list,
542 you will find information about it at masqmails main site.</p>
546 <h2>Bugs</h2>
548 <p>You should report them to the mailing list.</p>
552 <h2>See also</h2>
554 <p>
555 <a href="masqmail.8.html">masqmail</a>, <a href="masqmail.route.5.html">masqmail.route</a>, <a href="masqmail.get.5.html">masqmail.get</a>
556 </p>
561 <h2>Comments</h2>
563 <p>This man page was written using <a href="http://masqmail.cx/xml2man/">xml2man</a> by the same
564 author.</p>
568 </td></tr></table></center>
569 </body>