Documented new configuration file mechanism.
Showing
1 changed file
with
182 additions
and
42 deletions
... | @@ -27,45 +27,171 @@ GNU Mailutils provides a set of programs for handling the email. | ... | @@ -27,45 +27,171 @@ GNU Mailutils provides a set of programs for handling the email. |
27 | 27 | ||
28 | There are some command line options that are used so often that it is | 28 | There are some command line options that are used so often that it is |
29 | inconvenient to specify them in the command line each time you run | 29 | inconvenient to specify them in the command line each time you run |
30 | a mailutils utility. The @file{mailutils.rc} provides a way to | 30 | a mailutils utility. The @dfn{configuration files} provide a way to |
31 | add default command line arguments without having to type them in | 31 | add default command line arguments without having to type them in |
32 | the command line. The file is located in your system configuration | 32 | the command line. Upon startup, each mailutils utility scans and |
33 | directory (usually, @file{/etc} or @file{/usr/local/etc}). | 33 | processes the contents of the two startup files: the site-wide |
34 | @footnote{Currently, the mailutils programs that use @file{mailutils.rc} | 34 | configuration file @file{mailutils.rc} and user-specific configuration |
35 | are: | 35 | file @file{.mailutils}. The site-wide configuration file is searched |
36 | 36 | in your system configuration directory (usually, @file{/etc} or | |
37 | @itemize @bullet | 37 | @file{/usr/local/etc}), the user-specific configuration file is searched |
38 | @item imap4d | 38 | in user home directory. |
39 | @item pop3d | 39 | |
40 | @item mail.local | 40 | Both files have simple line-oriented syntax. Comments begin with the |
41 | @item comsatd | 41 | pound sign (@samp{#}) and extend through the end of the line |
42 | @end itemize | 42 | @footnote{If @samp{#} is not the first character on the line, it |
43 | } | 43 | should be separated from the previous word by any amount of whitespace.}. |
44 | 44 | Very long lines may be split across several lines by escaping final newline | |
45 | The @file{mailutils.rc} has a simple line-oriented syntax. Upon | 45 | with a backslash (@samp{\}) character. |
46 | startup, each mailutils program scans this file for a line that | 46 | |
47 | begins either with a program name or with word `mailutils'. When | 47 | Any non-comment line starts with a @dfn{tag}. A tag is either a name |
48 | found, the rest of the line following the first word is split up | 48 | of a particular mailutils utility or @dfn{option group}, prefixed with |
49 | at whitespace characters and resulting words are added to the | 49 | colon (@samp{:}). The command line options common for several mailutils |
50 | program arguments @emph{before} the command line options. Thus, | 50 | programs are divided into @dfn{option groups} or @dfn{capabilities}, |
51 | the options specified in the command line override those from | 51 | e.g. the options @option{--maildir} and @option{--license} form group |
52 | @file{mailutils.rc} file. | 52 | @samp{mailutils}. These groups are discussed in detail below. |
53 | 53 | ||
54 | The very long lines may be split across several lines of text by | 54 | When processing the configuration file, a mailutils utility selects |
55 | escaping final newline with a backslash (@samp{\}) character. | 55 | those lines, whose tag is either the name of that utility or the name |
56 | The @samp{#} character introduces a comment (it must be | 56 | of the option group supported by it. For each line found, its tag |
57 | preceeded by whitespace). | 57 | is stripped away, and the rest of the line is split up into words. |
58 | 58 | These words are regarded as command line options and are inserted to | |
59 | Here is an example of a simple @file{mailutils.rc} file. It tells | 59 | the program arguments @emph{before} any options from the command line. |
60 | all mailutils programs to use @file{/var/spool/mail} as a mailspool | 60 | Thus the options from @file{.mailutils} take precedence over those |
61 | directory. All programs, except @command{imap4d} will issue diagnostics | 61 | from @file{mailutils.rc}, and the options from the command line take |
62 | via @code{local1} @file{syslog} facility. @command{imap4d} will use | 62 | precedence over those from both configuration files. |
63 | @code{local2}. | 63 | |
64 | The word splitting occurs at whitespace characters and is similar to | ||
65 | that performed by the shell. If an option must contain embedded | ||
66 | whitespace, it should be enclosed in a pair of quotes (either double | ||
67 | or single quotes). | ||
68 | |||
69 | @menu | ||
70 | * mailutils:: Options common for all utilities. | ||
71 | * daemon:: Options common for daemon programs. | ||
72 | * auth:: Authentication-specific options. | ||
73 | * logging:: Logging control options. | ||
74 | * config sample:: A sample configuration file. | ||
75 | @end menu | ||
76 | |||
77 | @node mailutils | ||
78 | @subsection mailutils --- Options common for all utilities. | ||
79 | @cindex :mailutils | ||
80 | |||
81 | Option group @samp{mailutils} consists of options common for all | ||
82 | utilities in the package: | ||
83 | |||
84 | @table @option | ||
85 | @item -m @var{path} | ||
86 | @itemx --maildir=@var{path} | ||
87 | Set path to the mailspool directory | ||
88 | @end table | ||
89 | |||
90 | Each program also understands the following informational options: | ||
91 | |||
92 | @table @option | ||
93 | @item -u | ||
94 | @itemx --usage | ||
95 | Display a short usage message and exit. | ||
96 | @item -h | ||
97 | @itemx --help | ||
98 | Display help message and exit. | ||
99 | @item -L | ||
100 | @itemx --license | ||
101 | Display GNU General Public License and exit. | ||
102 | @item -v | ||
103 | @itemx --version | ||
104 | Display program version and exit. | ||
105 | @end table | ||
106 | |||
107 | @node daemon | ||
108 | @subsection daemon --- Options common for daemon programs. | ||
109 | @cindex :daemon | ||
110 | |||
111 | @table @option | ||
112 | @item -d[@var{number}] | ||
113 | @itemx --daemon[=@var{number}] | ||
114 | Run in standalone mode. An optional @var{number} specifies the maximum number | ||
115 | of child processes the daemon is allowed to fork. When it is omitted, | ||
116 | it defaults to 20 processes. | ||
117 | @emph{Please note}, that there should be no whitespace between the | ||
118 | @option{-d} and its parameter. | ||
119 | @item -i | ||
120 | @itemx --inetd | ||
121 | Run in inetd mode. | ||
122 | @item -p @var{number} | ||
123 | @itemx --port @var{number} | ||
124 | Listen on given port @var{number}. This option is meaningful only in | ||
125 | standalone mode. It defaults to port 143. | ||
126 | @item -t @var{number} | ||
127 | @itemx --timeout @var{number} | ||
128 | Set idle timeout to given @var{number} of seconds. The daemon breaks the | ||
129 | connection if it receives no commands from the client within that number | ||
130 | of seconds. | ||
131 | @end table | ||
132 | |||
133 | @node auth | ||
134 | @subsection auth --- Authentication-specific options. | ||
135 | @cindex :auth | ||
136 | |||
137 | @table @option | ||
138 | @item --pam-service @var{name} | ||
139 | When compiled with @acronym{pam} support, this option specifies the | ||
140 | name of @acronym{pam} service to be used when authenticating. | ||
141 | @end table | ||
142 | |||
143 | The following options exist in this group if the package was configured | ||
144 | with @samp{--enable-sql} option: | ||
145 | |||
146 | @table @option | ||
147 | @item sql-getpwnam @var{query} | ||
148 | SQL query to retrieve a passwd entry based on username | ||
149 | @item sql-getpwuid @var{query} | ||
150 | @item sql-getpass @var{query} | ||
151 | SQL query to retrieve a password from the database | ||
152 | @item sql-host @var{name} | ||
153 | Name or IP of MySQL server to connect to. | ||
154 | @item sql-user @var{name} | ||
155 | SQL user name | ||
156 | @item sql-passwd @var{string} | ||
157 | SQL connection password | ||
158 | @item sql-db @var{string} | ||
159 | Name of the database to connect to. | ||
160 | @item sql-port @var{number} | ||
161 | Port to use | ||
162 | @end table | ||
163 | |||
164 | @node logging | ||
165 | @subsection logging --- Logging control options. | ||
166 | @cindex :logging | ||
167 | |||
168 | @table @option | ||
169 | @item log-facility @var{facility} | ||
170 | Output logs to the specified @command{syslog} facility. The following | ||
171 | facility names are recognized: @samp{user}, @samp{daemon}, @samp{mail}, | ||
172 | @samp{auth} and @samp{local0} through @samp{local7}. These names are | ||
173 | case-insensitive. | ||
174 | @end table | ||
175 | |||
176 | @node config sample | ||
177 | @subsection A sample configuration file. | ||
178 | @cindex mailutils.rc, an example | ||
179 | |||
180 | The following configuration file specifies that all mailutils programs | ||
181 | should use @file{/var/spool/mail} as a local mailspool | ||
182 | directory. Programs performing authentication will use @acronym{pam} | ||
183 | service @samp{mailutils}. All programs, except @command{imap4d} will | ||
184 | issue log messages via @samp{mail} facility, @command{imap4d} will use | ||
185 | facility @samp{local1}. | ||
64 | 186 | ||
65 | @example | 187 | @example |
66 | mailutils --log-facility local1 --maildir /var/spool/mail | 188 | @group |
67 | imap4d --log-facility local2 --daemon=10 | 189 | :mailutils --maildir /var/spool/mail |
68 | @end example | 190 | :auth --pam-service mailutils |
191 | :logging --log-facility mail | ||
192 | imap4d --daemon=20 --timeout=1800 --log-facility local1 | ||
193 | @end group | ||
194 | @end example | ||
69 | 195 | ||
70 | @page | 196 | @page |
71 | @node imap4d | 197 | @node imap4d |
... | @@ -89,6 +215,9 @@ The server runs as daemon, forking a child for each new connection. This | ... | @@ -89,6 +215,9 @@ The server runs as daemon, forking a child for each new connection. This |
89 | mode is triggered by @option{-d} command line switch. | 215 | mode is triggered by @option{-d} command line switch. |
90 | @end table | 216 | @end table |
91 | 217 | ||
218 | The program uses following option groups: @xref{mailutils}, | ||
219 | @xref{daemon}, @xref{logging}, @xref{auth}. | ||
220 | |||
92 | @subheading Command line options | 221 | @subheading Command line options |
93 | 222 | ||
94 | @table @option | 223 | @table @option |
... | @@ -154,6 +283,9 @@ The server runs as daemon, forking a child for each new connection. This | ... | @@ -154,6 +283,9 @@ The server runs as daemon, forking a child for each new connection. This |
154 | mode is triggered by @option{-d} command line switch. | 283 | mode is triggered by @option{-d} command line switch. |
155 | @end table | 284 | @end table |
156 | 285 | ||
286 | The program uses following option groups: @xref{mailutils}, | ||
287 | @xref{daemon}, @xref{logging}, @xref{auth}. | ||
288 | |||
157 | @subheading Command line options | 289 | @subheading Command line options |
158 | 290 | ||
159 | @table @option | 291 | @table @option |
... | @@ -199,12 +331,11 @@ user's system mailbox and outputs the contents of @code{From} and | ... | @@ -199,12 +331,11 @@ user's system mailbox and outputs the contents of @code{From} and |
199 | the command line, the program reads that folder rather than the default | 331 | the command line, the program reads that folder rather than the default |
200 | mailbox. | 332 | mailbox. |
201 | 333 | ||
334 | The program uses following option groups: @xref{mailutils}. | ||
335 | |||
202 | The following command line options alter the behavior of the program: | 336 | The following command line options alter the behavior of the program: |
203 | 337 | ||
204 | @table @option | 338 | @table @option |
205 | @item -h | ||
206 | @itemx --help | ||
207 | Display short help message and exit. | ||
208 | @item -f STRING | 339 | @item -f STRING |
209 | @item --field STRING | 340 | @item --field STRING |
210 | Display the header named by STRING instead of @code{From} @code{Subject} pair. | 341 | Display the header named by STRING instead of @code{From} @code{Subject} pair. |
... | @@ -236,9 +367,6 @@ an ATTR. Multiple @option{-s} options are allowed. | ... | @@ -236,9 +367,6 @@ an ATTR. Multiple @option{-s} options are allowed. |
236 | @itemx --align | 367 | @itemx --align |
237 | Tidy mode. Currently is not implemented. Included for compatibility with | 368 | Tidy mode. Currently is not implemented. Included for compatibility with |
238 | @command{frm} program from Elm package. | 369 | @command{frm} program from Elm package. |
239 | @item -v | ||
240 | @itemx --version | ||
241 | Display version information and exit | ||
242 | @end table | 370 | @end table |
243 | 371 | ||
244 | @page | 372 | @page |
... | @@ -282,6 +410,8 @@ General usage of @command{mail} program is: | ... | @@ -282,6 +410,8 @@ General usage of @command{mail} program is: |
282 | If [address...] part is present, @command{mail} switches to mail sending | 410 | If [address...] part is present, @command{mail} switches to mail sending |
283 | mode, otherwise it operates in mail reading mode. | 411 | mode, otherwise it operates in mail reading mode. |
284 | 412 | ||
413 | The program uses following option groups: @xref{mailutils}. | ||
414 | |||
285 | @command{Mail} understands following command line options: | 415 | @command{Mail} understands following command line options: |
286 | 416 | ||
287 | @table @option | 417 | @table @option |
... | @@ -1489,6 +1619,9 @@ and appends the received data to the local mailboxes. | ... | @@ -1489,6 +1619,9 @@ and appends the received data to the local mailboxes. |
1489 | @node Invocation | 1619 | @node Invocation |
1490 | @subsection Invoking mail.local | 1620 | @subsection Invoking mail.local |
1491 | 1621 | ||
1622 | The program uses following option groups: @xref{mailutils}, @xref{auth}, | ||
1623 | @xref{logging}. | ||
1624 | |||
1492 | @table @option | 1625 | @table @option |
1493 | @item -f @var{addr} | 1626 | @item -f @var{addr} |
1494 | @itemx --from @var{addr} | 1627 | @itemx --from @var{addr} |
... | @@ -1634,6 +1767,8 @@ folder, the following output line is produced: | ... | @@ -1634,6 +1767,8 @@ folder, the following output line is produced: |
1634 | where @var{folder} represents the folder name, @var{number} represents | 1767 | where @var{folder} represents the folder name, @var{number} represents |
1635 | the number of messages. | 1768 | the number of messages. |
1636 | 1769 | ||
1770 | The program uses following option groups: @xref{mailutils}. | ||
1771 | |||
1637 | The program accepts following command line options: | 1772 | The program accepts following command line options: |
1638 | 1773 | ||
1639 | @table @option | 1774 | @table @option |
... | @@ -1740,6 +1875,8 @@ It processes mailboxes, applying the user-supplied scheme procedures | ... | @@ -1740,6 +1875,8 @@ It processes mailboxes, applying the user-supplied scheme procedures |
1740 | to each of them in turn and saves the resulting output in mailbox | 1875 | to each of them in turn and saves the resulting output in mailbox |
1741 | format. | 1876 | format. |
1742 | 1877 | ||
1878 | The program uses following option groups: @xref{mailutils}. | ||
1879 | |||
1743 | @menu | 1880 | @menu |
1744 | * Specifying Scheme Program to Execute:: | 1881 | * Specifying Scheme Program to Execute:: |
1745 | * Specifying Mailboxes to Operate Upon:: | 1882 | * Specifying Mailboxes to Operate Upon:: |
... | @@ -2114,6 +2251,9 @@ either from @file{inetd.conf} or as a standalone daemon. | ... | @@ -2114,6 +2251,9 @@ either from @file{inetd.conf} or as a standalone daemon. |
2114 | @node Starting comsatd | 2251 | @node Starting comsatd |
2115 | @subsection Starting comsatd | 2252 | @subsection Starting comsatd |
2116 | 2253 | ||
2254 | @command{Comsatd} uses following option groups: @xref{mailutils}, | ||
2255 | @xref{daemon}, @xref{logging}. | ||
2256 | |||
2117 | @table @option | 2257 | @table @option |
2118 | @item -c @var{file} | 2258 | @item -c @var{file} |
2119 | @itemx --config @var{file} | 2259 | @itemx --config @var{file} | ... | ... |
-
Please register or sign in to post a comment