10 |
* pop3d:: POP3 daemon. |
* pop3d:: POP3 daemon. |
11 |
* frm:: List headers from a mailbox. |
* frm:: List headers from a mailbox. |
12 |
* mail:: Send and receive mail. |
* mail:: Send and receive mail. |
13 |
|
* mail.local:: Deliver mail to the local mailbox. |
14 |
* messages:: Count the number of messages in a mailbox. |
* messages:: Count the number of messages in a mailbox. |
15 |
* readmsg:: Extract messages from a folder. |
* readmsg:: Extract messages from a folder. |
16 |
* sieve:: Filter a mailbox. |
* sieve:: Filter a mailbox. |
23 |
@section IMAP4 daemon |
@section IMAP4 daemon |
24 |
@pindex imap4d |
@pindex imap4d |
25 |
|
|
26 |
imap4d has two operation modes: |
@command{imap4d} has two operation modes: |
27 |
|
|
28 |
@table @asis |
@table @asis |
29 |
@item Inetd |
@item Inetd |
37 |
|
|
38 |
@item Standalone |
@item Standalone |
39 |
The server runs as daemon, forking a child for each new connection. This |
The server runs as daemon, forking a child for each new connection. This |
40 |
mode is triggered by @samp{-d} command line switch. |
mode is triggered by @option{-d} command line switch. |
41 |
@end table |
@end table |
42 |
|
|
43 |
@subheading Command line options |
@subheading Command line options |
44 |
|
|
45 |
@table @samp |
@table @option |
46 |
@item -d[NUMBER] |
@item -d[@var{number}] |
47 |
@itemx --daemon[=NUMBER] |
@itemx --daemon[=@var{number}] |
48 |
Run in standalone mode. An optional NUMBER specifies the maximum number |
Run in standalone mode. An optional @var{number} specifies the maximum number |
49 |
of child processes the daemon is allowed to fork. When it is omitted, |
of child processes the daemon is allowed to fork. When it is omitted, |
50 |
it defaults to 20 processes. |
it defaults to 20 processes. |
51 |
@emph{Please note}, that there should be no whitespace between the |
@emph{Please note}, that there should be no whitespace between the |
52 |
@samp{-d} and its parameter. |
@option{-d} and its parameter. |
53 |
@item -h |
@item -h |
54 |
@itemx --help |
@itemx --help |
55 |
Display short help message and exit. |
Display short help message and exit. |
56 |
@item -i |
@item -i |
57 |
@itemx --inetd |
@itemx --inetd |
58 |
Run in inetd mode. |
Run in inetd mode. |
59 |
@item -p NUMBER |
@item -m @var{path} |
60 |
@itemx --port NUMBER |
@itemx --maildir=@var{path} |
61 |
Listen on given port NUMBER. This option is meaningful only in |
Set path to the mailspool directory |
62 |
|
@item -O @var{pathlist} |
63 |
|
@itemx --other-namespace=@var{pathlist} |
64 |
|
Set the list of directories forming the ``Other User's'' namespace. |
65 |
|
@var{pathlist} is a list of directory names separated by colons. |
66 |
|
@item -p @var{number} |
67 |
|
@itemx --port @var{number} |
68 |
|
Listen on given port @var{number}. This option is meaningful only in |
69 |
standalone mode. It defaults to port 143. |
standalone mode. It defaults to port 143. |
70 |
@item -t NUMBER |
@item -S @var{pathlist} |
71 |
@itemx --timeout NUMBER |
@itemx --shared-namespace=@var{pathlist} |
72 |
Set idle timeout to given NUMBER of seconds. Default is 1800 seconds (30 |
Set the list of directories, forming the ``Shared'' |
73 |
|
namespace. @var{pathlist} is a list of directory names separated by colons. |
74 |
|
@item -t @var{number} |
75 |
|
@itemx --timeout @var{number} |
76 |
|
Set idle timeout to given @var{number} of seconds. Default is 1800 seconds (30 |
77 |
minutes). The daemon breaks the connection if it receives no commands |
minutes). The daemon breaks the connection if it receives no commands |
78 |
from the client within that number of seconds. |
from the client within that number of seconds. |
79 |
@item -v |
@item -v |
86 |
@section POP3 daemon |
@section POP3 daemon |
87 |
@pindex pop3d |
@pindex pop3d |
88 |
|
|
89 |
The @file{pop3d} daemon implements the Post Office Protocol server. |
The @command{pop3d} daemon implements the Post Office Protocol server. |
90 |
|
|
91 |
pop3d has two operation modes: |
pop3d has two operation modes: |
92 |
|
|
102 |
|
|
103 |
@item Standalone |
@item Standalone |
104 |
The server runs as daemon, forking a child for each new connection. This |
The server runs as daemon, forking a child for each new connection. This |
105 |
mode is triggered by @samp{-d} command line switch. |
mode is triggered by @option{-d} command line switch. |
106 |
@end table |
@end table |
107 |
|
|
108 |
@subheading Command line options |
@subheading Command line options |
109 |
|
|
110 |
@table @samp |
@table @option |
111 |
@item -d[NUMBER] |
@item -d[@var{number}] |
112 |
@itemx --daemon[=NUMBER] |
@itemx --daemon[=@var{number}] |
113 |
Run in standalone mode. An optional NUMBER specifies the maximum number |
Run in standalone mode. An optional @var{number} specifies the maximum number |
114 |
of child processes the daemon is allowed to fork. When it is omitted, |
of child processes the daemon is allowed to fork. When it is omitted, |
115 |
it defaults to 10 processes. |
it defaults to 10 processes. |
116 |
@emph{Please note}, that there should be no whitespace between the |
@emph{Please note}, that there should be no whitespace between the |
117 |
@samp{-d} and its parameter. |
@option{-d} and its parameter. |
118 |
@item -h |
@item -h |
119 |
@itemx --help |
@itemx --help |
120 |
Display short help message and exit. |
Display short help message and exit. |
121 |
@item -i |
@item -i |
122 |
@itemx --inetd |
@itemx --inetd |
123 |
Run in inetd mode. |
Run in inetd mode. |
124 |
@item -p NUMBER |
@item -m @var{path} |
125 |
@itemx --port NUMBER |
@itemx --maildir=@var{path} |
126 |
Listen on given port NUMBER. This option is meaningful only in |
Set path to the mailspool directory |
127 |
|
@item -p @var{number} |
128 |
|
@itemx --port @var{number} |
129 |
|
Listen on given port @var{number}. This option is meaningful only in |
130 |
standalone mode. It defaults to port 110. |
standalone mode. It defaults to port 110. |
131 |
@item -t NUMBER |
@item -t @var{number} |
132 |
@itemx --timeout NUMBER |
@itemx --timeout @var{number} |
133 |
Set idle timeout to given NUMBER of seconds. Default is 600 seconds (10 |
Set idle timeout to given @var{number} of seconds. Default is 600 seconds (10 |
134 |
minutes). The daemon breaks the connection if it receives no commands |
minutes). The daemon breaks the connection if it receives no commands |
135 |
from the client within that number of seconds. |
from the client within that number of seconds. |
136 |
@item -v |
@item -v |
143 |
@section frm --- List headers from a mailbox. |
@section frm --- List headers from a mailbox. |
144 |
@pindex frm |
@pindex frm |
145 |
|
|
146 |
The @file{frm} command outputs a header information of |
The @command{frm} command outputs a header information of |
147 |
the selected messages in a mailbox. By default, @file{frm} reads the |
the selected messages in a mailbox. By default, @command{frm} reads the |
148 |
user's system mailbox and outputs the contents of @code{From} and |
user's system mailbox and outputs the contents of @code{From} and |
149 |
@code{Subject} headers for each message. If a folder is specified in |
@code{Subject} headers for each message. If a folder is specified in |
150 |
the command line, the program reads that folder rather than the default |
the command line, the program reads that folder rather than the default |
152 |
|
|
153 |
The following command line options alter the behavior of the program: |
The following command line options alter the behavior of the program: |
154 |
|
|
155 |
@table @samp |
@table @option |
156 |
@item -h |
@item -h |
157 |
@itemx --help |
@itemx --help |
158 |
Display short help message and exit. |
Display short help message and exit. |
182 |
Only display headers from messages with the given status. |
Only display headers from messages with the given status. |
183 |
ATTR may be one of the following: @samp{new}, @samp{read}, |
ATTR may be one of the following: @samp{new}, @samp{read}, |
184 |
@samp{unread}. It is sufficient to specify only first letter of |
@samp{unread}. It is sufficient to specify only first letter of |
185 |
an ATTR. Multiple @samp{-s} options are allowed. |
an ATTR. Multiple @option{-s} options are allowed. |
186 |
@item -t |
@item -t |
187 |
@itemx --align |
@itemx --align |
188 |
Tidy mode. Currently is not implemented. Included for compatibility with |
Tidy mode. Currently is not implemented. Included for compatibility with |
189 |
@file{frm} program from Elm package. |
@command{frm} program from Elm package. |
190 |
@item -v |
@item -v |
191 |
@itemx --version |
@itemx --version |
192 |
Display version information and exit |
Display version information and exit |
197 |
@section mail --- send and receive mail. |
@section mail --- send and receive mail. |
198 |
@pindex mail |
@pindex mail |
199 |
|
|
200 |
@code{Mail} is an enhanced version of standard @file{/bin/mail} program. |
@command{Mail} is an enhanced version of standard @command{/bin/mail} program. |
201 |
As well as its predecessor, it can be used either in sending mode or |
As well as its predecessor, it can be used either in sending mode or |
202 |
in reading mode. @code{Mail} enters sending mode when one or more |
in reading mode. @command{Mail} enters sending mode when one or more |
203 |
email addresses were specified in this command line. In this mode the |
email addresses were specified in this command line. In this mode the |
204 |
program waits until user finishes composing the message, then attempts |
program waits until user finishes composing the message, then attempts |
205 |
to send it to the specified addresses and exits. |
to send it to the specified addresses and exits. |
206 |
See @ref{Composing Mail}, for a detailed description of this behavior. |
See @ref{Composing Mail}, for a detailed description of this behavior. |
207 |
|
|
208 |
If the command line contained no email addresses, @code{mail} switches |
If the command line contained no email addresses, @command{mail} switches |
209 |
to reading mode. In this mode it allows to read and manipulate the |
to reading mode. In this mode it allows to read and manipulate the |
210 |
contents of a mailbox. The URL of the mailbox to operate upon is |
contents of a mailbox. The URL of the mailbox to operate upon is |
211 |
taken from the argument of @samp{--file} command line option. If it |
taken from the argument of @option{--file} command line option. If it |
212 |
is not specified, the user's system mailbox is assumed. For more |
is not specified, the user's system mailbox is assumed. For more |
213 |
detail, see @ref{Reading Mail}. |
detail, see @ref{Reading Mail}. |
214 |
|
|
224 |
@node Invoking Mail |
@node Invoking Mail |
225 |
@subsection Command line options |
@subsection Command line options |
226 |
|
|
227 |
General usage of @file{mail} program is: |
General usage of @command{mail} program is: |
228 |
|
|
229 |
@example |
@example |
230 |
mail [OPTION...] [address...] |
mail [OPTION...] [address...] |
231 |
@end example |
@end example |
232 |
@noindent |
@noindent |
233 |
If [address...] part is present, @file{mail} switches to mail sending |
If [address...] part is present, @command{mail} switches to mail sending |
234 |
mode, otherwise it operates in mail reading mode. |
mode, otherwise it operates in mail reading mode. |
235 |
|
|
236 |
@file{Mail} understands following command line options: |
@command{Mail} understands following command line options: |
237 |
|
|
238 |
@table @samp |
@table @option |
239 |
@item -e |
@item -e |
240 |
@itemx --exist |
@itemx --exist |
241 |
Return true if the mailbox contains some messages. Return false |
Return true if the mailbox contains some messages. Return false |
247 |
is user's system mailbox. If it is specified without argument, the |
is user's system mailbox. If it is specified without argument, the |
248 |
default is $HOME/mbox. |
default is $HOME/mbox. |
249 |
@emph{Please note}, that there should be no whitespace between the |
@emph{Please note}, that there should be no whitespace between the |
250 |
short variant of the option (@samp{-f}), and its parameter. Similarly, |
short variant of the option (@option{-f}), and its parameter. Similarly, |
251 |
when using long option (@samp{--file}), its argument must be preceded by |
when using long option (@option{--file}), its argument must be preceded by |
252 |
equal sign. |
equal sign. |
253 |
@item -F |
@item -F |
254 |
@itemx --byname |
@itemx --byname |
259 |
@item -i |
@item -i |
260 |
@itemx --ignore |
@itemx --ignore |
261 |
Ignore interrupts. |
Ignore interrupts. |
262 |
|
@item -m @var{path} |
263 |
|
@itemx --maildir=@var{path} |
264 |
|
Set path to the mailspool directory |
265 |
@item -n |
@item -n |
266 |
@itemx --norc |
@itemx --norc |
267 |
Do not read the system-wide mailrc file. @xref{Mail Configuration Files}. |
Do not read the system-wide mailrc file. @xref{Mail Configuration Files}. |
407 |
|
|
408 |
You can compose the message by simply typing the contents of it, line |
You can compose the message by simply typing the contents of it, line |
409 |
by line. But usually this is not enough, you would need to edit |
by line. But usually this is not enough, you would need to edit |
410 |
your text, to quote some messages, etc. @file{Mail} provides these |
your text, to quote some messages, etc. @command{Mail} provides these |
411 |
capabilities through @dfn{compose escapes}. The @dfn{compose escapes} |
capabilities through @dfn{compose escapes}. The @dfn{compose escapes} |
412 |
are single-character commands, preceded by special @dfn{escape character}, |
are single-character commands, preceded by special @dfn{escape character}, |
413 |
which defaults to @samp{~}. The combination @code{escape character + command} |
which defaults to @samp{~}. The combination @code{escape character + command} |
596 |
@subsubsection Executing Shell Commands: ~! and ~| |
@subsubsection Executing Shell Commands: ~! and ~| |
597 |
|
|
598 |
The @samp{~!} escape executes specified command and returns you to |
The @samp{~!} escape executes specified command and returns you to |
599 |
@file{mail} compose mode without altering your message. When used without |
@command{mail} compose mode without altering your message. When used without |
600 |
arguments, it starts your login shell. The @samp{~|} escape pipes the |
arguments, it starts your login shell. The @samp{~|} escape pipes the |
601 |
message composed so far through the given shell command and replaces the |
message composed so far through the given shell command and replaces the |
602 |
message with the output the command produced. If the command produced |
message with the output the command produced. If the command produced |
603 |
no output, @file{mail} assumes that something went wrong and retains |
no output, @command{mail} assumes that something went wrong and retains |
604 |
the old contents of your message. |
the old contents of your message. |
605 |
|
|
606 |
@c ********************************************************************* |
@c ********************************************************************* |
609 |
@subsection Reading mail |
@subsection Reading mail |
610 |
|
|
611 |
To read messages from a given mailbox, use one of the following ways of |
To read messages from a given mailbox, use one of the following ways of |
612 |
invoking @file{mail}: |
invoking @command{mail}: |
613 |
|
|
614 |
@table @code |
@table @code |
615 |
@item mail |
@item mail |
627 |
Similarly, the last but one variant is also greatly affected by the |
Similarly, the last but one variant is also greatly affected by the |
628 |
permissions the target mailbox has. |
permissions the target mailbox has. |
629 |
|
|
630 |
Unless you have started mail with @samp{--norc} command line option, |
Unless you have started mail with @option{--norc} command line option, |
631 |
it will read the contents of the system-wide configuration file. |
it will read the contents of the system-wide configuration file. |
632 |
Then it reads the contents of user configuration file, if any. |
Then it reads the contents of user configuration file, if any. |
633 |
For detailed description of these files, see @ref{Mail Configuration Files}. |
For detailed description of these files, see @ref{Mail Configuration Files}. |
634 |
After this initial setup, @file{mail} displays the first page of header |
After this initial setup, @command{mail} displays the first page of header |
635 |
lines and enters interactive mode. In interactive mode, @file{mail} |
lines and enters interactive mode. In interactive mode, @command{mail} |
636 |
displays its prompt (@samp{?}, if not set otherwise) and executes the |
displays its prompt (@samp{?}, if not set otherwise) and executes the |
637 |
commands the user enters. |
commands the user enters. |
638 |
|
|
663 |
|
|
664 |
@table @samp |
@table @samp |
665 |
@item quit |
@item quit |
666 |
Terminates the session. If @file{mail} was operating upon user's system |
Terminates the session. If @command{mail} was operating upon user's system |
667 |
mailbox, then all undeleted and unsaved messages that have been read and |
mailbox, then all undeleted and unsaved messages that have been read and |
668 |
are not marked with hold flag are saved to the user's mbox file |
are not marked with hold flag are saved to the user's mbox file |
669 |
(@file{$HOME/mbox}). The messages, marked with @code{delete} are removed. |
(@file{$HOME/mbox}). The messages, marked with @code{delete} are removed. |
741 |
@node Controlling Header Display |
@node Controlling Header Display |
742 |
@subsubsection Controlling header display |
@subsubsection Controlling header display |
743 |
|
|
744 |
To control which headers in the message should be displayed, @file{mail} |
To control which headers in the message should be displayed, @command{mail} |
745 |
keeps two lists: a @dfn{retained} header list and an @dfn{ignored} |
keeps two lists: a @dfn{retained} header list and an @dfn{ignored} |
746 |
header list. If @dfn{retained} header list is not empty, only the |
header list. If @dfn{retained} header list is not empty, only the |
747 |
header fields listed in it are displayed when printing the message. |
header fields listed in it are displayed when printing the message. |
1024 |
@subheading Conditional statements |
@subheading Conditional statements |
1025 |
|
|
1026 |
The conditional statement allows to execute a set of mail commands |
The conditional statement allows to execute a set of mail commands |
1027 |
depending on the mode the @file{mail} program is in. The conditional |
depending on the mode the @command{mail} program is in. The conditional |
1028 |
statement is: |
statement is: |
1029 |
|
|
1030 |
@example |
@example |
1041 |
|
|
1042 |
@table @samp |
@table @samp |
1043 |
@item s |
@item s |
1044 |
True if @file{mail} is operating in mail sending mode. |
True if @command{mail} is operating in mail sending mode. |
1045 |
@item r |
@item r |
1046 |
True if @file{mail} is operating in mail reading mode. |
True if @command{mail} is operating in mail reading mode. |
1047 |
@item t |
@item t |
1048 |
True if stdout is a terminal device (as opposed to a regular file). |
True if stdout is a terminal device (as opposed to a regular file). |
1049 |
@end table |
@end table |
1132 |
|
|
1133 |
The @code{incorporate} (@code{inc}) command incorporates newly arrived |
The @code{incorporate} (@code{inc}) command incorporates newly arrived |
1134 |
messages to the displayed list of messages. This is done automatically |
messages to the displayed list of messages. This is done automatically |
1135 |
before returning to @file{mail} command prompt if the variable |
before returning to @command{mail} command prompt if the variable |
1136 |
@code{autoinc} is set. |
@code{autoinc} is set. |
1137 |
|
|
1138 |
@node Shell Escapes |
@node Shell Escapes |
1139 |
@subsubsection Shell escapes |
@subsubsection Shell escapes |
1140 |
|
|
1141 |
To run arbitrary shell command from @file{mail} command prompt, use |
To run arbitrary shell command from @command{mail} command prompt, use |
1142 |
@code{shell} (@code{sh}) command. If no arguments are specified, the |
@code{shell} (@code{sh}) command. If no arguments are specified, the |
1143 |
command starts the user login shell. Otherwise, it uses its first |
command starts the user login shell. Otherwise, it uses its first |
1144 |
argument as a file name to execute and all subsequent arguments are |
argument as a file name to execute and all subsequent arguments are |
1150 |
@node Mail Variables |
@node Mail Variables |
1151 |
@subsection How to alter the behavior of mail |
@subsection How to alter the behavior of mail |
1152 |
|
|
1153 |
Following variables control the behavior of GNU @file{mail}: |
Following variables control the behavior of GNU @command{mail}: |
1154 |
|
|
1155 |
@table @code |
@table @code |
1156 |
@item Sign |
@item Sign |
1227 |
@*Type: Boolean. |
@*Type: Boolean. |
1228 |
@*Default: False. |
@*Default: False. |
1229 |
|
|
1230 |
If @code{True}, causes @file{mail} to interpret a period alone on a line as the |
If @code{True}, causes @command{mail} to interpret a period alone on a line as the |
1231 |
terminator of a message you are sending. |
terminator of a message you are sending. |
1232 |
|
|
1233 |
@item escape |
@item escape |
1246 |
|
|
1247 |
@item header |
@item header |
1248 |
@*Type: Boolean. |
@*Type: Boolean. |
1249 |
@*Default: True, unless started with @samp{--nosum} (@samp{-N}) option. |
@*Default: True, unless started with @option{--nosum} (@option{-N}) option. |
1250 |
|
|
1251 |
Whether to run @code{headers} command automatically after entering |
Whether to run @code{headers} command automatically after entering |
1252 |
interactive mode. |
interactive mode. |
1264 |
@*Type: Boolean. |
@*Type: Boolean. |
1265 |
@*Default: False. |
@*Default: False. |
1266 |
|
|
1267 |
When set to @code{True}, @file{mail} will ignore keyboard interrupts |
When set to @code{True}, @command{mail} will ignore keyboard interrupts |
1268 |
when composing messages. Otherwise an interrupt will be taken as a |
when composing messages. Otherwise an interrupt will be taken as a |
1269 |
signal to abort composing. |
signal to abort composing. |
1270 |
|
|
1339 |
|
|
1340 |
@item quit |
@item quit |
1341 |
@*Type: Boolean. |
@*Type: Boolean. |
1342 |
@*Default: False, unless started with @samp{--quit} (@samp{-q}) option. |
@*Default: False, unless started with @option{--quit} (@option{-q}) option. |
1343 |
|
|
1344 |
When set, causes keyboard interrupts to terminate the program. |
When set, causes keyboard interrupts to terminate the program. |
1345 |
|
|
1346 |
@item rc |
@item rc |
1347 |
@*Type: Boolean. |
@*Type: Boolean. |
1348 |
@*Default: True, unless started with @samp{--norc} (@samp{-N}) option. |
@*Default: True, unless started with @option{--norc} (@option{-N}) option. |
1349 |
|
|
1350 |
When this variable is set, @file{mail} will read the system-wide |
When this variable is set, @command{mail} will read the system-wide |
1351 |
configuration file upon startup. See @ref{Mail Configuration Files}. |
configuration file upon startup. See @ref{Mail Configuration Files}. |
1352 |
|
|
1353 |
@item record |
@item record |
1407 |
@node Mail Configuration Files |
@node Mail Configuration Files |
1408 |
@subsection Personal and system-wide configuration files |
@subsection Personal and system-wide configuration files |
1409 |
|
|
1410 |
Upon startup, @file{mail} reads the contents of the two command files: |
Upon startup, @command{mail} reads the contents of the two command files: |
1411 |
the system-wide configuration file, and the user's configuration |
the system-wide configuration file, and the user's configuration |
1412 |
file. Each line read from these files is processed like a usual |
file. Each line read from these files is processed like a usual |
1413 |
@file{mail} command. |
@command{mail} command. |
1414 |
|
|
1415 |
When run with @samp{--norc} (@samp{-N}) option, @file{mail} does |
When run with @option{--norc} (@option{-N}) option, @command{mail} does |
1416 |
not read the contents of system-wide configuration file. The user's |
not read the contents of system-wide configuration file. The user's |
1417 |
file, if it exists, is always processed. |
file, if it exists, is always processed. |
1418 |
|
|
1419 |
The user's configuration file is located in the user's home |
The user's configuration file is located in the user's home |
1420 |
directory and is named @file{.mailrc}. The location and name of |
directory and is named @file{.mailrc}. The location and name of |
1421 |
the system-wide configuration file is determined when configuring the |
the system-wide configuration file is determined when configuring the |
1422 |
package via @samp{--with-mail-rc} option. It defaults to |
package via @option{--with-mail-rc} option. It defaults to |
1423 |
@file{@var{sysconfdir}/mail.rc}. |
@file{@var{sysconfdir}/mail.rc}. |
1424 |
|
|
1425 |
@page |
@page |
1426 |
|
@node mail.local |
1427 |
|
@section mail.local --- Deliver mail to the local mailbox. |
1428 |
|
@pindex mail.local |
1429 |
|
|
1430 |
|
@command{mail.local} reads the standard input up to an end-of-file |
1431 |
|
and appends the received data to the local mailboxes. |
1432 |
|
|
1433 |
|
@menu |
1434 |
|
* Invocation:: Mail.local options |
1435 |
|
* MTA:: Using mail.local with various MTAs |
1436 |
|
* Mailbox Quotas:: Setting up mailbox quotas. |
1437 |
|
* Filters:: Implementing user-defined mail filters. |
1438 |
|
@end menu |
1439 |
|
|
1440 |
|
@node Invocation |
1441 |
|
@subsection Invoking mail.local |
1442 |
|
|
1443 |
|
@table @option |
1444 |
|
@item -f @var{addr} |
1445 |
|
@itemx --from @var{addr} |
1446 |
|
Specify the sender's name. This option forces @command{mail.local} to |
1447 |
|
add @samp{From } envelope to the beginning of the message. If it is |
1448 |
|
not specified, @command{mail.local} first looks into the first line |
1449 |
|
from the standard input. If it starts with @samp{From }, it is assumed |
1450 |
|
to contain a valid envelope. If it does not, @command{mail.local} |
1451 |
|
creates the envelope by using current user name and date. |
1452 |
|
@item -h |
1453 |
|
@itemx --help |
1454 |
|
Display this help and exit. |
1455 |
|
@item -L |
1456 |
|
@itemx --license |
1457 |
|
Display GNU General Public License and exit. |
1458 |
|
@item -m @var{path} |
1459 |
|
@itemx --maildir @var{path} |
1460 |
|
Specify path to mailspool directory. |
1461 |
|
@item -q |
1462 |
|
@itemx --quota-db @var{file} |
1463 |
|
Specify path to mailbox quota database (@pxref{Mailbox Quotas}). |
1464 |
|
@item -s @var{pattern} |
1465 |
|
@itemx --source @var{pattern} |
1466 |
|
Set name pattern for user-defined mail filters (@pxref{Filters}). The |
1467 |
|
metacharacters @samp{%u} and @samp{%h} in the pattern are expanded to |
1468 |
|
the current recipient user name and home directory correspondingly. |
1469 |
|
@item -t @var{number} |
1470 |
|
@itemx --timeout @var{number} |
1471 |
|
Wait @var{number} seconds for acquiring the lockfile. If it doesn't |
1472 |
|
become available after that amount of time, return failure. The timeout |
1473 |
|
defaults to 5 minutes. |
1474 |
|
@item -x guile |
1475 |
|
@itemx --debug guile |
1476 |
|
Start with guile debugging evaluator and backtraces. This is convenient |
1477 |
|
for debugging user-defined filters (@pxref{Filters}). |
1478 |
|
@item -x @var{number} |
1479 |
|
@itemx --debug @var{number} |
1480 |
|
Set debugging level. |
1481 |
|
@item -v |
1482 |
|
@itemx --version |
1483 |
|
Display program version and exit. |
1484 |
|
@item --ex-multiple-delivery-success |
1485 |
|
Don't return errors when delivering to multiple recipients. |
1486 |
|
@item --ex-quota-tempfail |
1487 |
|
Return temporary failure if disk or mailbox quota is exceeded. By |
1488 |
|
default, 'service unavailable' is returned if the message exceeds |
1489 |
|
the mailbox quota. |
1490 |
|
@end table |
1491 |
|
|
1492 |
|
@node MTA |
1493 |
|
@subsection Using mail.local with various MTAs |
1494 |
|
|
1495 |
|
This section explains how to invoke @command{mail.local} from |
1496 |
|
configuration files of various Mail Transport Agents. |
1497 |
|
|
1498 |
|
All examples in this section suppose that @command{mail.local} |
1499 |
|
must receive following command line switches: |
1500 |
|
|
1501 |
|
@example |
1502 |
|
-s %h/.filter.scm -q /etc/mail/userquota |
1503 |
|
@end example |
1504 |
|
|
1505 |
|
@menu |
1506 |
|
* sendmail:: Using mail.local with sendmail. |
1507 |
|
* exim:: Using mail.local with exim. |
1508 |
|
@end menu |
1509 |
|
|
1510 |
|
@node sendmail |
1511 |
|
@subsubsection Using mail.local with sendmail. |
1512 |
|
|
1513 |
|
The @command{mail.local} must be invoked from the local mailer |
1514 |
|
definition in the @file{sendmail.cf} file. It must have the |
1515 |
|
following flags set @samp{lswS}, meaning the mailer is local, |
1516 |
|
the quote characters should be stripped off the address before |
1517 |
|
invoking the mailer, the user must have a valid account on this |
1518 |
|
machine and the userid should not be reset before calling the |
1519 |
|
mailer. Additionally, @samp{fn} flags may be specified to allow |
1520 |
|
@command{mail.local} to generate usual @samp{From } envelope |
1521 |
|
instead of the one supplied by sendmail. |
1522 |
|
|
1523 |
|
Here is an example of mailer definition in @file{sendmail.cf} |
1524 |
|
|
1525 |
|
@example |
1526 |
|
Mlocal, P=/usr/local/libexec/mail.local, |
1527 |
|
F=lsDFMAw5:/|@@qSPfhn9, |
1528 |
|
S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, |
1529 |
|
T=DNS/RFC822/X-Unix, |
1530 |
|
A=mail -s %h/.filter.scm -q /etc/mail/userquota $u |
1531 |
|
@end example |
1532 |
|
|
1533 |
|
To define local mailer in @samp{mc} source file, it will suffice to |
1534 |
|
set: |
1535 |
|
|
1536 |
|
@example |
1537 |
|
define(`LOCAL_MAILER_PATH', `/usr/local/libexec/mail.local') |
1538 |
|
define(`LOCAL_MAILER_ARGS', |
1539 |
|
`mail -s %h/.filter.scm -q /etc/mail/userquota $u') |
1540 |
|
@end example |
1541 |
|
|
1542 |
|
@node exim |
1543 |
|
@subsubsection Using mail.local with exim. |
1544 |
|
|
1545 |
|
Using @command{mail.local} with exim is quite straightforward. The |
1546 |
|
following example illustrates the definition of appropriate transport |
1547 |
|
and director in @file{exim.conf}: |
1548 |
|
|
1549 |
|
@example |
1550 |
|
# transport |
1551 |
|
mail_local_pipe: |
1552 |
|
driver = pipe |
1553 |
|
command = /usr/local/libexec/mail.local -s %h/.filter.scm \ |
1554 |
|
-q /etc/mail/userquota $local_part |
1555 |
|
return_path_add |
1556 |
|
delivery_date_add |
1557 |
|
envelope_to_add |
1558 |
|
|
1559 |
|
# director |
1560 |
|
mail_local: |
1561 |
|
driver = localuser |
1562 |
|
transport = mail_local_pipe |
1563 |
|
@end example |
1564 |
|
|
1565 |
|
@node Mailbox Quotas |
1566 |
|
@subsection Setting up mailbox quotas |
1567 |
|
|
1568 |
|
@node Filters |
1569 |
|
@subsection Implementing user-defined mail filters. |
1570 |
|
|
1571 |
|
@page |
1572 |
@node messages |
@node messages |
1573 |
@section messages --- Count the number of messages in a mailbox. |
@section messages --- Count the number of messages in a mailbox. |
1574 |
@pindex messages |
@pindex messages |
1575 |
|
|
1576 |
@code{Messages} prints on standard output the number of messages |
@command{Messages} prints on standard output the number of messages |
1577 |
contained in each folder specified in command line. If no folders |
contained in each folder specified in command line. If no folders |
1578 |
are specified, it operates upon user's system mailbox. For each |
are specified, it operates upon user's system mailbox. For each |
1579 |
folder, the following output line is produced: |
folder, the following output line is produced: |
1587 |
|
|
1588 |
The program accepts following command line options: |
The program accepts following command line options: |
1589 |
|
|
1590 |
@table @samp |
@table @option |
1591 |
@item -q |
@item -q |
1592 |
@itemx --quite |
@itemx --quite |
1593 |
@itemx -s |
@itemx -s |
1640 |
|
|
1641 |
@subheading Command line options |
@subheading Command line options |
1642 |
|
|
1643 |
@table @samp |
@table @option |
1644 |
|
|
1645 |
@item -a |
@item -a |
1646 |
@itemx --show-all |
@itemx --show-all |
1686 |
@section guimb --- A mailbox scanning and processing language. |
@section guimb --- A mailbox scanning and processing language. |
1687 |
@pindex guimb |
@pindex guimb |
1688 |
|
|
1689 |
@file{Guimb} is for mailboxes what @file{awk} is for text files. |
@command{Guimb} is for mailboxes what @command{awk} is for text files. |
1690 |
It processes mailboxes, applying the user-supplied scheme procedures |
It processes mailboxes, applying the user-supplied scheme procedures |
1691 |
to each of them in turn and saves the resulting output in mailbox |
to each of them in turn and saves the resulting output in mailbox |
1692 |
format. |
format. |
1703 |
@subsection Specifying Scheme Program to Execute |
@subsection Specifying Scheme Program to Execute |
1704 |
|
|
1705 |
The Scheme program or expression to be executed is passed to |
The Scheme program or expression to be executed is passed to |
1706 |
@file{guimb} via the following options: |
@command{guimb} via the following options: |
1707 |
|
|
1708 |
@table @samp |
@table @option |
1709 |
@item -e |
@item -s @var{file} |
1710 |
@itemx --expression EXPR |
@itemx --source @var{file} |
1711 |
|
Load Scheme source code from @var{file}. |
1712 |
|
@item -c @var{expr} |
1713 |
|
@itemx --code @var{expr} |
1714 |
|
Execute given scheme expression. |
1715 |
|
@end table |
1716 |
|
|
1717 |
|
The above switches stop further argument processing, and pass all |
1718 |
|
remaining arguments as the value of @code{(command-line)}. |
1719 |
|
|
1720 |
|
If the remaining arguments must be processed by @command{guimb} itself, |
1721 |
|
use following options: |
1722 |
|
|
1723 |
|
@table @option |
1724 |
|
@item -e @var{expr} |
1725 |
|
@itemx --expression @var{expr} |
1726 |
Execute scheme expression. |
Execute scheme expression. |
1727 |
@item -f |
@item -f @var{file} |
1728 |
@itemx --file PROGFILE |
@itemx --file @var{file} |
1729 |
Read and execute program from PROGFILE. |
Load Scheme source code from @var{file}. |
1730 |
@end table |
@end table |
1731 |
|
|
1732 |
You can specify both of them. In this case, the PROGFILE is executed |
You can specify both of them. In this case, the @var{file} is read |
1733 |
first. |
first, then @var{expr} is executed. You may still pass any additional |
1734 |
|
arguments to the script using @option{--guile-arg} option |
1735 |
|
(@pxref{Passing Options to Scheme}). |
1736 |
|
|
1737 |
@node Specifying Mailboxes to Operate Upon |
@node Specifying Mailboxes to Operate Upon |
1738 |
@subsection Specifying Mailboxes to Operate Upon |
@subsection Specifying Mailboxes to Operate Upon |
1739 |
|
|
1740 |
There are four basic ways of passing mailboxes to @file{guimb}. |
There are four basic ways of passing mailboxes to @command{guimb}. |
1741 |
|
|
1742 |
@table @code |
@table @code |
1743 |
@item guimb [OPTIONS] [mailbox...] |
@item guimb [@var{options}] [@var{mailbox}...] |
1744 |
The resulting mailbox is not saved, unless the user-supplied |
The resulting mailbox is not saved, unless the user-supplied |
1745 |
scheme program saves it. |
scheme program saves it. |
1746 |
@item guimb [OPTIONS] --mailbox DEFMBOX |
@item guimb [@var{options}] --mailbox @var{defmbox} |
1747 |
The contents of DEFMBOX is processed and is replaced with the resulting |
The contents of @var{defmbox} is processed and is replaced with the resulting |
1748 |
mailbox contents. Useful for applying filters to user's mailbox. |
mailbox contents. Useful for applying filters to user's mailbox. |
1749 |
@item guimb [OPTIONS] --mailbox DEFMBOX mailbox [mailbox...] |
@item guimb [@var{options}] --mailbox @var{defmbox} mailbox [mailbox...] |
1750 |
The contents of specified mailboxes is processed, and the resulting |
The contents of specified mailboxes is processed, and the resulting |
1751 |
mailbox contents is appended to DEFMBOX. |
mailbox contents is appended to @var{defmbox}. |
1752 |
@item guimb [OPTIONS] --user USER [mailbox...] |
@item guimb [@var{options}] --user @var{username} [mailbox...] |
1753 |
The contents of specified mailboxes is processed, and the resulting |
The contents of specified mailboxes is processed, and the resulting |
1754 |
mailbox contents is appended to the user's system mailbox. This allows |
mailbox contents is appended to the user's system mailbox. This allows |
1755 |
to use @file{guimb} as a mail delivery agent. |
to use @command{guimb} as a mail delivery agent. |
1756 |
@end table |
@end table |
1757 |
|
|
1758 |
If no mailboxes are specified in the command line, @file{guimb} reads |
If no mailboxes are specified in the command line, @command{guimb} reads |
1759 |
and processes its standard input. |
and processes the system mailbox of the current user. |
1760 |
|
|
1761 |
@node Passing Options to Scheme |
@node Passing Options to Scheme |
1762 |
@subsection Passing Options to Scheme |
@subsection Passing Options to Scheme |
1763 |
|
|
1764 |
Sometimes it is necessary to pass some command line options to the |
Sometimes it is necessary to pass some command line options to the |
1765 |
scheme procedure. This can be done via @samp{-g} |
scheme procedure. There are three ways of doing so. |
1766 |
(@samp{--guile-command}) command line option. For example: |
|
1767 |
|
When using @option{--source} (@option{-s}) or @option{--code} |
1768 |
|
(@option{-c}) options, all the rest of the command line following |
1769 |
|
the option's argument is passed to Scheme program verbatim. This |
1770 |
|
allows for making guimb scripts executable by the shell. If your system |
1771 |
|
supports @samp{#!} magic at the start of scripts, add the following two |
1772 |
|
lines to the beginning of your script to allow for its immediate execution: |
1773 |
|
|
1774 |
@example |
@example |
1775 |
guimb --guile-command -opt --guile-command 24 --file progfile |
#! /usr/local/bin/guimb -s |
1776 |
|
!# |
1777 |
|
@end example |
1778 |
|
|
1779 |
|
@noindent |
1780 |
|
(replace @samp{/usr/local/bin/} with the actual path to the @command{guimb}). |
1781 |
|
|
1782 |
|
Otherwise, if you use @option{--file} or @option{--expression} oprions, |
1783 |
|
the additional arguments may be passed to the Scheme program @option{-g} |
1784 |
|
(@option{--guile-arg}) command line option. For example: |
1785 |
|
|
1786 |
|
@example |
1787 |
|
guimb --guile-arg -opt --guile-arg 24 --file progfile |
1788 |
@end example |
@end example |
1789 |
|
|
1790 |
In this example, the scheme procedure will see the following command line: |
In this example, the scheme procedure will see the following command line: |
1793 |
progfile -opt 24 |
progfile -opt 24 |
1794 |
@end example |
@end example |
1795 |
|
|
1796 |
If there are many arguments to be passed to Scheme, it is more |
Finally, if there are many arguments to be passed to Scheme, it is more |
1797 |
convenient to enclose them in @samp{-@{} and @samp{-@}} escapes: |
convenient to enclose them in @option{-@{} and @option{-@}} escapes: |
1798 |
|
|
1799 |
@example |
@example |
1800 |
guimb -@{ -opt 24 -@} --file progfile |
guimb -@{ -opt 24 -@} --file progfile |
1801 |
@end example |
@end example |
1802 |
|
|
|
All arguments enclosed between @samp{-@{} and @samp{-@}} are not processed |
|
|
by @file{guimb}, they are instead passed to the Scheme program verbatim. |
|
|
|
|
1803 |
@node Guimb Invocation Summary |
@node Guimb Invocation Summary |
1804 |
@subsection Guimb Invocation Summary |
@subsection Guimb Invocation Summary |
1805 |
|
|
1806 |
This is a short summary of the command line options available to |
This is a short summary of the command line options available to |
1807 |
@file{guimb}. |
@command{guimb}. |
1808 |
|
|
1809 |
@table @samp |
@table @option |
1810 |
@item -d |
@item -d |
1811 |
@itemx --debug |
@itemx --debug |
1812 |
Start with debugging evaluator and backtraces. |
Start with debugging evaluator and backtraces. |
1813 |
@item -e EXPR |
@item -e EXPR |
1814 |
@itemx --expression EXPR |
@itemx --expression EXPR |
1815 |
Execute given Scheme expression. |
Execute given Scheme expression. |
1816 |
|
@item -m @var{path} |
1817 |
|
@itemx --maildir=@var{path} |
1818 |
|
Set path to the mailspool directory |
1819 |
@item -f PROGFILE |
@item -f PROGFILE |
1820 |
@itemx --file PROGFILE |
@itemx --file PROGFILE |
1821 |
Read Scheme program from PROGFILE. |
Read Scheme program from PROGFILE. |
1823 |
@itemx --guile-command ARG |
@itemx --guile-command ARG |
1824 |
Append ARG to the command line passed to Scheme program. |
Append ARG to the command line passed to Scheme program. |
1825 |
@item -@{ ... -@} |
@item -@{ ... -@} |
1826 |
Pass all command line options enclosed between @samp{-@{} and @samp{-@}} |
Pass all command line options enclosed between @option{-@{} and @option{-@}} |
1827 |
to Scheme program. |
to Scheme program. |
1828 |
@item -m |
@item -m |
1829 |
@itemx --mailbox MBOX |
@itemx --mailbox MBOX |
2065 |
@node Starting comsatd |
@node Starting comsatd |
2066 |
@subsection Starting comsatd |
@subsection Starting comsatd |
2067 |
|
|
2068 |
@table @samp |
@table @option |
2069 |
@item -c @var{file} |
@item -c @var{file} |
2070 |
@itemx --config @var{file} |
@itemx --config @var{file} |
2071 |
Read configuration from given @var{file}. For more information about |
Read configuration from given @var{file}. For more information about |
2083 |
@end example |
@end example |
2084 |
|
|
2085 |
This is the default operation mode. |
This is the default operation mode. |
2086 |
|
@item -m @var{path} |
2087 |
|
@itemx --maildir=@var{path} |
2088 |
|
Set path to the mailspool directory |
2089 |
@item -p @var{number} |
@item -p @var{number} |
2090 |
@itemx --port @var{number} |
@itemx --port @var{number} |
2091 |
Specify the port number to listen on. Default is 512. |
Specify the port number to listen on. Default is 512. |
2104 |
configuration file. The file uses line-oriented format: each line |
configuration file. The file uses line-oriented format: each line |
2105 |
contains a single statement. Comments are introduced with the @samp{#} |
contains a single statement. Comments are introduced with the @samp{#} |
2106 |
sign and empty lines are ignored. You can specify the configuration |
sign and empty lines are ignored. You can specify the configuration |
2107 |
file to use by using @samp{-c} or @samp{--config} command line switch. |
file to use by using @option{-c} or @option{--config} command line switch. |
2108 |
|
|
2109 |
The configuration file statements can logically be subdivided into |
The configuration file statements can logically be subdivided into |
2110 |
@dfn{General Settings}, @dfn{Security Settings} and @dfn{Access Control |
@dfn{General Settings}, @dfn{Security Settings} and @dfn{Access Control |
2133 |
@node Security Settings |
@node Security Settings |
2134 |
@subsubsection Security Settings |
@subsubsection Security Settings |
2135 |
|
|
2136 |
These statements control the way @file{comsatd} fights possible |
These statements control the way @command{comsatd} fights possible |
2137 |
flooding attacks. |
flooding attacks. |
2138 |
|
|
2139 |
@table @asis |
@table @asis |
2151 |
@node Access Control Lists |
@node Access Control Lists |
2152 |
@subsubsection Access Control Lists |
@subsubsection Access Control Lists |
2153 |
|
|
2154 |
Access control lists determine from which addresses @file{comsatd} |
Access control lists determine from which addresses @command{comsatd} |
2155 |
will receive mail notification messages. |
will receive mail notification messages. |
2156 |
|
|
2157 |
The access control lists are introduced in configuration file using |
The access control lists are introduced in configuration file using |
2178 |
Denotes any IP address. It is equivalent to @samp{0.0.0.0/0}. |
Denotes any IP address. It is equivalent to @samp{0.0.0.0/0}. |
2179 |
@end table |
@end table |
2180 |
|
|
2181 |
Upon receiving a notification message, @file{comsatd} compares its |
Upon receiving a notification message, @command{comsatd} compares its |
2182 |
source address against each ACL rule in the order of their appearance |
source address against each ACL rule in the order of their appearance |
2183 |
in the configuration file. The first rule that matches the packet |
in the configuration file. The first rule that matches the packet |
2184 |
determines whether the message will be processed or rejected. If |
determines whether the message will be processed or rejected. If |
2201 |
@end example |
@end example |
2202 |
|
|
2203 |
@noindent |
@noindent |
2204 |
which makes @file{comsatd} receive the notification messages from |
which makes @command{comsatd} receive the notification messages from |
2205 |
localhost only. |
localhost only. |
2206 |
|
|
2207 |
@node dot.biffrc |
@node dot.biffrc |
2208 |
@subsection A per-user configuration file. |
@subsection A per-user configuration file. |
2209 |
|
|
2210 |
By default, when a notification arrives, @file{comsatd} prints subject, |
By default, when a notification arrives, @command{comsatd} prints subject, |
2211 |
from headers and the first five lines from the new message to the user's |
from headers and the first five lines from the new message to the user's |
2212 |
tty. The user is allowed to change this behavior by using his own |
tty. The user is allowed to change this behavior by using his own |
2213 |
configuration file. This file should be located in the user's home |
configuration file. This file should be located in the user's home |