Mailutils
Mailutils
Short Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3 Mailutils Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4 Mailutils Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
5 Sieve Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
6 Reporting Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
7 Getting News About GNU Mailutils . . . . . . . . . . . . . . . . . . . . 197
8 Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
A References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
B Date Input Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
C Date/time Format String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
D Configuring Help Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
E GNU Free Documentation License . . . . . . . . . . . . . . . . . . . . . . 219
Function Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Variable Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Keyword Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Program Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Concept Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
iii
Table of Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 What this Book Contains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 A bit of History, and why use this package? . . . . . . . . . . . . . . . . . . . . . 2
2 Mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1 Local Mailboxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Remote Mailboxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 SMTP Mailboxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4 Program Mailboxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 Mailutils Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1 Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1.1 Basic Notions About Command Line Options . . . . . . . . . . . . . . 7
3.1.2 Options That are Common for All Utilities. . . . . . . . . . . . . . . . . 8
3.2 Mailutils Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2.1 Configuration File Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.1.1 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.1.2 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.1.3 Statement Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2.2 Configuration Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2.3 The include Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.4 The program statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.5 The logging Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.6 The debug Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2.7 The mailbox Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2.8 The mime Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2.9 The locking Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.2.10 The mailer Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.2.11 The acl Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.2.12 The tcp-wrappers Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.2.13 Server Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.2.13.1 General Server Configuration . . . . . . . . . . . . . . . . . . . . . . . 28
3.2.13.2 The server Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.2.14 The auth Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.2.15 PAM Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.2.16 The virtdomain Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.2.17 The radius Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.2.18 The sql Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.2.19 The ldap Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.2.20 The tls Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.2.21 The tls-file-checks Statement . . . . . . . . . . . . . . . . . . . . . . . . 42
3.2.22 The gsasl Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
iv GNU Mailutils Manual
3.3 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3.1 Level Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3.2 BNF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.3.3 Debugging Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.4 frm and from — List Headers from a Mailbox . . . . . . . . . . . . . . . . . 46
3.5 mail — Send and Receive Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.5.1 Invoking mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.5.2 Reading Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.5.2.1 Syntax of mail internal commands . . . . . . . . . . . . . . . . . . . 53
3.5.2.2 Quitting the Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.5.2.3 Obtaining Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.5.2.4 Moving Within a Mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.5.2.5 Changing Mailbox/Directory . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.5.2.6 Controlling Header Display . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.5.2.7 Displaying Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.5.2.8 Displaying Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.5.2.9 Marking Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.5.2.10 Disposing of Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.5.2.11 Saving Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.5.2.12 Editing Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.5.2.13 Aliasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.5.2.14 Replying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.5.2.15 Controlling Sender Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.5.2.16 Incorporating New Mail. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.5.2.17 Shell Escapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.5.3 Saving and Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.5.4 Composing Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.5.4.1 Quitting Compose Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.5.4.2 Getting Help on Compose Escapes: ~? . . . . . . . . . . . . . . . 66
3.5.4.3 Editing the Message: ~e and ~v . . . . . . . . . . . . . . . . . . . . . . 66
3.5.4.4 Modifying the Headers: ~h, ~t, ~c, ~b, ~s. . . . . . . . . . . . . 67
3.5.4.5 Enclosing Another Message: ~m and ~M . . . . . . . . . . . . . 67
3.5.4.6 Adding a File to the Message: ~r and ~d . . . . . . . . . . . . . 67
3.5.4.7 Attaching a File to the Message . . . . . . . . . . . . . . . . . . . . . . 67
3.5.4.8 Printing And Saving the Message . . . . . . . . . . . . . . . . . . . . 68
3.5.4.9 Signing the Message: ~a and ~A . . . . . . . . . . . . . . . . . . . . . 68
3.5.4.10 Printing Another Message: ~f and ~F . . . . . . . . . . . . . . . 68
3.5.4.11 Inserting Value of a Mail Variable: ~i . . . . . . . . . . . . . . . 68
3.5.4.12 Executing Other Mail Commands: ~: and ~- . . . . . . . . 68
3.5.4.13 Executing Shell Commands: ~! and ~| . . . . . . . . . . . . . . 69
3.5.5 Composing Multipart Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.5.6 Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.5.7 How to Alter the Behavior of mail . . . . . . . . . . . . . . . . . . . . . . . . 75
3.5.8 Personal and System-wide Configuration Files . . . . . . . . . . . . . 88
3.6 messages — Count the Number of Messages in a Mailbox . . . . . . 89
3.7 movemail — Moves Mail from the User Maildrop to the Local File . . 90
3.7.1 Movemail Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.7.2 Setting Destination Mailbox Ownership . . . . . . . . . . . . . . . . . . . 92
v
8 Acknowledgement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
1 Introduction
GNU Mailutils is a set of libraries and utilities for handling electronic mail. It addresses
a wide audience and can be of interest to application developers, casual users and system
administrators alike.
It provides programmers with a consistent API allowing them to handle a variety of
different mailbox formats transparently and without having to delve into complexities of
their internal structure. While doing so, it also provides interfaces that simplify common
programming tasks, such as handling lists, parsing configuration files, etc. The philosophy
of Mailutils is to have a single and consistent programming interface for various objects
designed to handle the same task. It tries to use their similarities to create an interface
that hides their differences and complexities. This covers a wide variety of programming
tasks: apart from mailbox handling, Mailutils also contains a unified iterface for work with
various DBM databases and much more.
The utilities built upon these libraries share that same distinctive feature: no matter
what is the internal structure of an object, it is always handled the same way as other
objects that do the same task. Again, the most common example of this approach are, of
course, mailboxes. Whatever Mailutils program you use, you can be sure it is able to handle
various mailbox formats. You even don’t have to inform it about what type a mailbox is:
it will do its best to discover it automatically.
This approach sometimes covers entities which are seldom regarded as compatible. For
example, using Mailutils it is possible to treat an SMTP connection as a mailbox opened only
for appending new messages. This in turn, provides a way for extending the functionality
of some utilities. As an example, using this concept of mailboxes, the usual mail delivery
agent becomes able to do things usually reserved for mail transport agents only!
At the core of Mailutils is libmailutils, a library which provides an API for access-
ing a generalized mailbox. A set of complementary libraries provide methods for handling
particular mailbox implementations: UNIX mailbox, Maildir, MH, POP3, IMAP4, even
SMTP. Mailutils offers functions for almost any mail-related task, such as parsing of mes-
sages, email addresses and URLs, handling MIME messages, listing mail folders, mailcap
facilities, extensible Sieve filtering, access control lists. It supports various modern data
security and authentication techniques: TLS encryption, SASL and GSSAPI, to name a
few. Mailutils is able to work with a wide variety of authorization databases, ranging from
traditional system password database up to RADIUS, SQL and LDAP.
The utilities provided by Mailutils include imap4d and pop3d mail servers, mail reporting
utility comsatd, general-purpose mail delivery agent maidag, mail filtering program sieve,
an implementation of MH message handling system and much more.
All utilities share the same subset of command line options and use a unified configuration
mechanism, which allows to easily configure the package as a whole.
This software is part of the GNU Project and is copyrighted by the Free Software Foun-
dation. All libraries are distributed under the terms of the Lesser GNU Public License.
The documentation is licensed under the GNU FDL, and everything else is licensed under
the GNU GPL.
2 GNU Mailutils Manual
===========================================================
This package started off to try and handle large mailbox files more gracefully then
available at that time POP3 servers did. While it handles this task, it also allows you
to support a variety of different mailbox formats without any real effort on your part.
Also, if a new format is added at a later date, your program will support that new format
automatically as soon as it is compiled against the new library.
3
2 Mailbox
The principal object Mailutils operates on is mailbox – a collection of mail messages. The
two main characteristics of a mailbox are its type and path. The type defines how the
messages are stored within a mailbox. The path specifies the location of the mailbox. The
two characteristics are usually combined within a Uniform Resource Locator (URL), which
uniquely identifies the mailbox. The syntax for URL is:
type:[//[user:password@]host[:port]]path[?query][;params]
The square brackets do not appear in a URL, instead they are used to denote optional
parts.
Not all parts are meaningful for all types. Their usage and purpose are described in the
sections that follow.
The URL is
smtps://[user[:pass][;auth=mech,...]@]host[:port][;params]
See the ‘smtp’ type for a detailed description of its types. The only difference
from ‘smtp’ is that the ‘notls’ parameter is not used.
3 Mailutils Programs
GNU Mailutils provides a broad set of utilities for handling electronic mail. These utilities
address the needs of both system administrators and users.
All utilities are built around a single core subsystem and share many common aspects.
All of them are able to work with almost any existing mailbox formats. They use a common
configuration file syntax, and their configuration files are located in a single subdirectory.
In this chapter we will discuss each utility, and give some advices on how to use them
in various real life situations.
First of all we will describe command line and configuration file syntax.
option name either by an equal sign, or by any amount of white space characters. For
example, if the --file option requires an argument, and you wish to supply name as its
argument, then you can do so using any of the following notations: --file=name or --file
name.
In contrast, optional arguments must always be introduced using an equal sign.
error output. This option can be combined with --config-verbose to obtain more detailed
output.
The --config-help command line option produces on the standard output the summary
of all configuration statements understood by the utility, with detailed comments and in the
form suitable for configuration file. For example, the simplest way to write a configuration
file for, say, imap4d is to run
$ imap4d --config-help > imap4d.conf
and to edit the imap4d.conf file with your editor of choice.
The order in which configuration files are loaded defines the precedence of their settings.
Thus, for client utilities, settings from the per-user configuration file override those from
the site-wide configuration.
It is also possible to set or override arbitrary configuration variables in the command
line. It can be done via the --set option. Its argument is a pathname of the variable to
be set, followed by an equals sign and a value. For example, to define the variable ‘syslog’
in section ‘logging’ to ‘no’, do the following:
$ imap4d --set .logging.syslog=no
Configuration pathnames are discussed in detail in Section 3.2.1.3 [Paths], page 14. For
a detailed description of this option, [the –set option], page 14.
The --set options are processed after loading all configuration files.
3.2.1.1 Comments
Comments may appear anywhere where white space may appear in the configuration file.
There are two kinds of comments: single-line and multi-line comments. Single-line com-
ments start with ‘#’ or ‘//’ and continue to the end of the line:
# This is a comment
// This too is a comment
Multi-line or C-style comments start with the two characters ‘/*’ (slash, star) and
continue until the first occurrence of ‘*/’ (star, slash).
Multi-line comments cannot be nested. However, single-line comments may well appear
within multi-line ones.
3.2.1.2 Statements
A simple statement consists of a keyword and value separated by any amount of whitespace.
Simple statement is terminated with a semicolon (‘;’).
The following is a simple statement:
standalone yes;
12 GNU Mailutils Manual
pidfile /var/run/pop3d.pid;
A keyword begins with a letter and may contain letters, decimal digits, underscores (‘_’)
and dashes (‘-’). Examples of keywords are: ‘expression’, ‘output-file’.
A value can be one of the following:
number A number is a sequence of decimal digits.
boolean A boolean value is one of the following: ‘yes’, ‘true’, ‘t’ or ‘1’, meaning true,
and ‘no’, ‘false’, ‘nil’, ‘0’ meaning false.
unquoted string
An unquoted string may contain letters, digits, and any of the following char-
acters: ‘_’, ‘-’, ‘.’, ‘/’, ‘@’, ‘*’, ‘:’.
quoted string
A quoted string is any sequence of characters enclosed in double-quotes (‘"’).
A backslash appearing within a quoted string introduces an escape sequence,
which is replaced with a single character according to the following rules:
<<EOT
A multiline
string
EOT
The body of a here-document is interpreted the same way as a double-quoted
string, unless word is preceded by a backslash (e.g. ‘<<\EOT’) or enclosed in
double-quotes, in which case the text is read as is, without interpretation of
escape sequences.
If word is prefixed with - (a dash), then all leading tab characters are stripped
from input lines and the line containing word. Furthermore, if - is followed
by a single space, all leading whitespace is stripped from them. This allows to
indent here-documents in a natural fashion. For example:
<<- TEXT
The leading whitespace will be
ignored when reading these lines.
TEXT
It is important that the terminating delimiter be the only token on its line.
The only exception to this rule is allowed if a here-document appears as the
last element of a statement. In this case a semicolon can be placed on the same
line with its terminating delimiter, as in:
help-text <<-EOT
A sample help text.
EOT;
facility mail;
}
Values set using this option override those set in the configuration files. This provides a
convenient way for temporarily changing configuration without altering configuration files.
Notice, that when using --set, the ‘=’ sign has two purposes: first it separates statement
path from the value, thus forming an assignment, and secondly it can be used within the path
itself to introduce a tag. To illustrate this, let’s assume you have the following statement
in your configuration file:
program pop3d {
logging {
facility mail;
}
server 0.0.0.0 {
transcript no;
}
}
Now assume you wish to temporarily change logging facility to ‘local1’. The following
option will do this:
--set .program=pop3d.logging.facility=local1
When splitting the argument to --set, the option parser always looks for the rightmost
equals sign. Everything to the right of it is the value, and everything to the left of it - the
path.
If the tag contains dots (as the server statement in the example above), you should
either escape them with slashes or change the pathname separator to some other character,
e.g.:
--set .program=pop3d.server=’0\.0\.0\.0’.transcript=yes
or
--set /program=pop3d/server="0.0.0.0"/transcript=yes
${variable:=word}
Assign Default Values. If variable is unset or null, the expansion of word is
assigned to variable. The value of variable is then substituted.
${variable:?word}
Display Error if Null or Unset. If variable is null or unset, the expansion of
word (or a message to that effect if word is not present) is output to the current
logging channel. Otherwise, the value of variable is substituted.
${variable:+word}
Use Alternate Value. If variable is null or unset, nothing is substituted, other-
wise the expansion of word is substituted.
When a value is subject to variable expansion, it is also subject to command expansion.
Commands are invoked in string values using the following format:
$(cmd arg)
where cmd is the command name, and args is a list of arguments separated by whitespace.
Arguments can in turn contain variable and command references.
The following commands are defined:
localpart string [Command]
Treats string as an email address and returns the part preceding the ‘@’ sign. If there
is no ‘@’ sign, returns string.
domainpart string [Command]
Treats string as an email address and returns the part following the ‘@’ sign. If there
is no ‘@’ sign, returns empty string.
shell cmd args [Command]
Runs the shell command cmd with the given arguments. Returns the standard output
from the command. The command is invoked using /bin/sh -c and can contain any
valid shell constructs.
The subsections below define variable names that are valid for use in each configuration
statement.
program progname {
...
}
The program statement is allowed only in the site-wide configuration file. When en-
countered, its tag (progname) is compared with the name of the program being run. If
two strings are the same, the statements between curly braces are stored in a temporary
memory, otherwise the statement is ignored. When entire configuration file is loaded, the
statements accumulated in the temporary storage are processed.
Notice the difference between this statement and a per-program configuration file loaded
via an include statement. No matter where in the file the program statement is, its content
will be processed after the content of the enclosing file. In the contrast, the per-program
configuration file loaded via include is processed right where it is encountered.
# Log session ID
session-id boolean;
Description
The logging block statement configures where the diagnostic output goes and how verbose
it is.
18 GNU Mailutils Manual
The default syslog facility is determined at compile time, it can be inspected using the
following command (see Section 3.20.3 [mailutils info], page 145):
$ mailutils info log_facility
Description
The ‘debug’ statement controls the amount of additional debugging information output by
Mailutils programs. The ‘level’ statement enables additional debugging information. Its
argument (spec) is a Mailutils debugging specification as described in Section 3.3 [debug-
ging], page 43.
The ‘line-info’ statement, when set to ‘true’ causes debugging messages to be pre-
fixed with locations in Mailutils source files where they appear. Normally, only Mailutils
developers need this option.
Syntax
mailbox {
# Use specified url as a mailspool.
mail-spool url;
Description
The mailbox statement configures the location, name and type of user mailboxes.
The mailbox location can be specified using mail-spool or mail-pattern statements.
mail-spool path [Configuration]
The mail-spool statement specifies directory that holds user mailboxes. Once this
statement is given, the libmailutils library will assume that the mailbox of user
login is kept in file path/login.
Historically, path can contain mailbox type prefix, e.g.: ‘maildir:///var/spool/mail’,
but such usage is discouraged in favor of mailbox-pattern statement.
mailbox-pattern url [Configuration]
The mailbox-pattern statement is a preferred way of configuring mailbox locations.
It supersedes mail-spool statement.
The url must be a valid mailbox URL (see Chapter 2 [Mailbox], page 3), which may
contain references to the ‘user’ variable (see Section 3.2.2 [Variables], page 15). This
variable will be expanded to the actual user name.
Optional URL parameters can be used to configure indexed directory structure. Such
structure is a special way of storing mailboxes, which allows for faster access in case
of very large number of users.
By default, all user mailboxes are stored in a single directory and are named after
user login names. To find the mailbox for a given user, the system scans the directory
for the corresponding file. This usually implies linear search, so the time needed to
locate a mailbox is directly proportional to the ordinal number of the mailbox in the
directory.
GNU Mailutils supports three types of indexed directories: ‘direct’, ‘reverse’, and
‘hashed’.
In direct indexed directory structure, path contains 26 subdirectories named with
lower-case letters of Latin alphabet. The location of the user mailbox is determined
using the following algorithm:
1. Take the first letter of the user name.
20 GNU Mailutils Manual
2. Map it to a lower-case letter using index mapping table. The result gives the
name of a sub-directory where the mailbox is located.
3. Descend into this directory.
For example, using this algorithm, the mailbox of the user ‘smith’ is stored in file
path/s/smith.
If each of single-letter subdirectories contains the indexed directory structure, we
have second level of indexing. In this case the file name of ‘smith’’s mailbox is
path/s/m/smith.
The reverse indexed structure uses the same principles, but the indexing letters are
taken from the end of the user name, instead of from the beginning. For exam-
ple, in the 2nd level reverse indexed structure, the ‘smith’’s mailbox is located in
path/h/t/smith.
Finally, the hashed structure consists of 256 subdirectories under path, named by
2-letter hex codes from ‘00’ to ‘FF’. Mailboxes are stored in these subdirectories. The
name of the subdirectory is computed by hashing first level letters of the user name.
The hashing algorithm is:
1. Take next letter from the user name
2. Add its ASCII value to the hash sum.
3. Continue (1-2) until level letters are processed, or all letters from the file name
are used, whichever occurs first.
4. Convert the computed sum modulo 256 to a hex code.
Indexed directory structures are configured using the following arguments:
type=value
Specifies the type of indexing. Valid values are ‘index’, for direct in-
dexed structure, ‘rev-index’ for reverse indexing, and ‘hash’ for hashed
structure.
param=number
Specifies indexing level.
user=string
Specifies indexing key. The only meaningful value, as of Mailutils version
3.14 is ‘user=${user}’.
Let’s assume the traditional mail layout, in which incoming mails are stored in a UNIX
mailbox named after the recipient user name and located in /var/mail directory. The
mailbox-pattern for this case is:
mailbox-pattern "/var/mail/${user}";
It is entirely equivalent to specifying ‘mail-spool "/var/mail"’.
Now, if the layout is the same, but mailboxes are kept in ‘maildir’ format, then the
corresponding statement is:
mailbox-pattern "maildir:///var/mail/${user}";
Finally, if the mailboxes are stored in a directly-indexed directory with two levels of
indexing, the URL is:
mailbox-pattern "maildir:///var/mail;type=index;param=2;user=${user}";
Chapter 3: Mailutils Programs 21
If neither mailbox-pattern nor mail-spool are given, the mailbox names are deter-
mined using the following algorithm:
1. If environment variable FOLDER is set, use its value.
2. Otherwise, if environment variable MAIL is set, use its value.
3. If neither of these is set, construct the mailbox name by concatenating the built-in mail
spool directory name, a directory separator, and the user name.
The built-in mail spool directory name is determined at compile time, using the
‘_PATH_MAILDIR’ define from the include file paths.h. If this value is not defined,
/var/mail or /usr/spool/mail is used.
mailbox-type type [Configuration]
Specifies the type of mailboxes. By default, ‘mbox’ (UNIX mailbox) is assumed.
This can be changed while configuring the package by setting MU_DEFAULT_SCHEME
configuration variable. The default value can be verified by running mailutils info
scheme.
folder dir [Configuration]
Sets user mail folder directory. Its value is used when expanding ‘plus-notation’,
i.e. such mailbox names as +inbox. The ‘+’ sign is replaced by dir, followed by a
directory separator (‘/’).
The dir argument can contain mailbox type prefix, e.g ‘mh://Mail’.
The default folder name is ‘Mail/’.
Description
The mime compound statement is used by utilities that process MIME messages, in par-
ticular mail, readmsg, and decodemail. As of mailutils version 3.14 it contains only one
statement:
text-type pattern [Configuration]
text-type ( pattern-list ) [Configuration]
Defines additional patterns for recognition of textual message parts. The pattern is
a shell globbing pattern that will be compared against the ‘Content-Type’ header of
a MIME message part in order to determine whether it can be treated as a text part.
In second form, pattern-list is a comma-separated list of such patterns.
In both forms, the new patterns are appended to the built-in textual pattern list,
which contains:
• text/*
22 GNU Mailutils Manual
• application/*shell
• application/shellscript
• */x-csrc
• */x-csource
• */x-diff
• */x-patch
• */x-perl
• */x-php
• */x-python
• */x-sh
# Check if PID of the lock owner is active, steal the lock if it not.
pid-check bool;
Description
This compound statement configures various parameters used when locking UNIX mailboxes
in order to prevent simultaneous writes.
It is important to note, that locking applies only to monolithic mailboxes, i.e. mailboxes
of ‘mbox’ and ‘dotmail’ types (see [mbox], page 3). Other mailbox types don’t require
locking.
type string [Configuration]
Set locking type. Allowed arguments are:
default Default locking type. As of mailutils version 3.14, this is equivalent to
dotlock.
Chapter 3: Mailutils Programs 23
acquire the lock and sees that the lock file already exists, it reads the PID from the
file and checks if a process with that PID still exists in the process table. If it does
not, the process considers the lock file to be stale, removes it and locks the mailbox.
Description
A mailer is a special logical entity GNU Mailutils uses for sending messages. Its internal
representation is discussed in Mailer. The mailer statement configures it.
The mailer statement contains a single sub-statement:
GNU Mailutils supports three types of mailer URLs, described in the table below:
smtp://[user[:pass][;auth=mech,...]@]host[:port][;params]
smtps://[user[:pass][;auth=mech,...]@]host[:port][;params]
Send messages using SMTP protocol. See Section 2.3 [SMTP Mailboxes],
page 5, for a detailed description of the URL and its parts.
sendmail[://progname]
Use sendmail-compatible program progname. Sendmail-compatible means that
the program must support following command line options:
-oi Do not treat ‘.’ as message terminator.
-f addr Use addr as the sender address.
-t Get recipient addresses from the message.
See Section 2.4 [sendmail], page 6, for details.
prog://progname?query
A prog mailer. This is a generalization of ‘sendmail’ mailer that allows to use
arbitrary external programs as mailers.
It is described in detain in Section 2.4 [prog], page 6.
Syntax
acl {
# Allow connections from this IP address.
allow [from] ip;
Description
The ACL statement defines an Access Control List, a special structure that controls who
can access the given Mailutils resource.
The acl block contains a list of access controls. Each control can be regarded as a
function that returns a tree-state value: ‘True’, ‘False’ and ‘Don’t know’. When a remote
party connects to the server, each of controls is tried in turn. If a control returns ‘False’,
access is denied. If it returns ‘True’, access is allowed. If it returns ‘Don’t know’, then the
next control is tried. It is unclear whether to allow access if the last control in list returned
‘Don’t know’. GNU Mailutils 3.14 issues a warning message and allows access. This default
may change in future versions. Users are advised to write their ACLs so that the last control
returns a definite answer (either True or False).
In the discussion below, wherever cidr appears as an argument, it can be replaced by
any of:
• An IPv4 address in dotted-quad notation.
• An IPv6 address in numeric notation
• A CIDR in the form ‘ip/mask’, where ip is an IP address (either IPv4 or IPv6), and
mask is the network mask.
• A symbolic host name.
• A word ‘any’, which matches any IP address.
The following controls are understood:
allow [from] cidr [Configuration]
Allow connections from IP addresses matching this cidr block.
deny [from] cidr [Configuration]
Deny connections from IP addresses matching this cidr block.
26 GNU Mailutils Manual
Description
The tcp-wrappers statements provides an alternative way to control accesses to the re-
sources served by GNU Mailutils. This statement is enabled if Mailutils is compiled with
TCP wrappers library libwrap.
Access control using TCP wrappers is based on two files, called tables, containing access
rules. There are two tables: the allow table, usually stored in file /etc/hosts.allow,
and the deny table, kept in file /etc/hosts.deny. The rules in each table begin with an
identifier called daemon name. A utility that wishes to verify a connection, selects the
entries having its daemon name from the allow table. A connection is allowed if it matches
any of these entries. Otherwise, the utility retrieves all entries with its daemon name from
the deny table. If any of these matches the connection, then it is refused. Otherwise, if
neither table contains matching entries, the connection is allowed.
The description of a TCP wrapper table format lies outside the scope of this document.
Please, see Section “ACCESS CONTROL FILES” in hosts access(5) man page, for details.
enable bool [Configuration]
Enable access control using TCP wrappers. It is on by default.
daemon name [Configuration]
Set daemon name for TCP wrapper lookups. By default, the name of the utility is
used. E.g. imap4d uses ‘imap4d’ as the daemon name.
allow-table file [Configuration]
Use file as allow table. By default, /etc/hosts.allow is used.
deny-table file [Configuration]
Use file as negative table. By default, /etc/hosts.deny is used.
chitecture. First of all, they all support two operating modes: daemon, where a program
disconnects from the controlling terminal and works in background, and inetd, where it
remains in foreground and communicates with the remote party via standard input and
output streams. Secondly, when operating as daemons, they listen to a preconfigured set of
IP addresses and ports, reacting to requests that arrive.
To configure these aspects of functionality, GNU Mailutils provides Server Configuration
Settings, which is describes in this subsection.
Syntax:
# Set daemon mode.
mode ‘inetd|daemon’;
# Run in foreground.
foreground bool;
Syntax:
server ipaddr[:port] {
# Run this server as a single process.
single-process bool;
tls {
# Specify SSL certificate file.
ssl-certificate-file string;
# Specify SSL certificate key file.
ssl-key-file file;
# Specify trusted CAs file.
ssl-ca-file file;
# Set the priorities to use on the ciphers, methods, etc.
ssl-priorities string;
# Set timeout for I/O operations during TLS handshake (seconds).
handshake-timeout n;
}
Description:
The server block statement configures a single TCP or UDP server. It takes effect only
in daemon mode (see [server mode], page 28). The argument to this statement specifies the
IP address, and, optionally, the port, to listen on for requests. The ipaddr part is either
an IPv4 address in dotted-quad form, or a IPv6 address enclosed in square brackets, or a
symbolic host name which can be resolved to such an address. Specifying ‘0.0.0.0’ as the
ipaddr means listen on all available network interfaces. The port argument is either a port
number in decimal, or a symbolic service name, as listed in /etc/services (see Section
“Internet network services list” in services(5) man page). If port is omitted, Mailutils
uses the port set by port statement (see Section 3.2.13.1 [General Server Configuration],
page 28), or, in its absence, the default port number, which depends on a server being used
(e.g. 110, for pop3d, 143, for imap4d, etc.).
Any number of server statements may be specified in a single configuration file, allowing
to set up the same service on several IP addresses and/or port numbers, and with different
configurations.
Statements within the server block statement configure this particular server.
acl [Configuration]
This statement defines a per-server Access Control List. Its syntax is as described
in [ACL Statement], page 24. Per-server ACLs complement, but not override, global
ACLs, i.e. if both global ACL and per-server ACL are used, the connection is allowed
only if both of them allow it, and is denied if any one of them denies it.
Description
Some mail utilities provide access to their services only after verifying that the user is
actually the person he is claiming to be. Such programs are, for example, pop3d and
imap4d. The process of the verification is broken down into two stages: authorization
and authentication. In authorization stage the program retrieves the information about
a particular user. In authentication stage, this information is compared against the user-
supplied credentials. Only if both stages succeed is the user allowed to use the service.
A set of modules is involved in performing each stage. For example, the authorization
stage can retrieve the user description from various sources: system database, SQL database,
virtual domain table, etc. Each module is responsible for retrieving the description from a
particular source of information. The modules are arranged in a module list. The modules
from the list are invoked in turn, until one of them succeeds or the list is exhausted. In the
latter case the authorization fails. Otherwise, the data returned by the succeeded module
are used in authentication.
Similarly, authentication may be performed in several ways. The authentication modules
are also grouped in a list. Each module is tried in turn until either a module succeeds, in
which case the authentication succeeds, or the end of the list is reached.
For example, the authorization list
(system, sql, virtdomains)
means that first the system user database (/etc/password) is searched for a description of
a user in question. If the search fails, the SQL database is searched. Finally, if it also fails,
the search is performed in the virtual domain database.
Note, that some authentication and/or authorization modules may be disabled when
configuring the package before compilation. The names of the disabled modules are never-
theless available for use in runtime configuration options, but they represent a “fail-only”
functionality, e.g. if the package was compiled without SQL support then the module ‘sql’
in the above example will always fail, thus passing the execution on to the next module.
The auth statement configures authentication and authorization.
authorization module-list [Configuration]
Define a sequence of modules to use for authorization. Modules will be tried in the
same order as listed in module-list.
The modules available for use in authorization list are:
system User credentials are retrieved from the system user database
(/etc/password).
sql User credentials are retrieved from a SQL database. A separate config-
uration statement, sql, is used to configure it (see Section 3.2.18 [sql
statement], page 37).
virtdomain
User credentials are retrieved from a “virtual domain” user database.
Virtual domains are configured using virtdomain statement (see
Section 3.2.16 [virtdomain statement], page 34).
radius User credentials are retrieved using RADIUS. See Section 3.2.17 [radius
statement], page 35, for a detailed description on how to configure it.
Chapter 3: Mailutils Programs 33
ldap User credentials are retrieved from an LDAP database. See Section 3.2.19
[ldap statement], page 39, for an information on how to configure it.
Unless overridden by authorization statement, the default list of authorization mod-
ules is:
1. generic
2. system
3. pam
4. sql
5. virtual
6. radius
7. ldap
authentication module-list [Configuration]
Define a sequence of modules to use for authentication. Modules will be tried in the
same order as listed in module-list.
The following table lists modules available for use in module-list:
generic The generic authentication type. User password is hashed and compared
against the hash value returned in authorization stage.
system The hashed value of the user password is retrieved from /etc/shadow file
on systems that support it.
sql The hashed value of the user password is retrieved from a SQL data-
base using query supplied by getpass statement (see Section 3.2.18 [sql
statement], page 37).
pam The user is authenticated via pluggable authentication module (PAM).
The PAM service name to be used is configured in pam statement (see
Section 3.2.15 [pam statement], page 33).
radius The user is authenticated on a remote RADIUS server. See Section 3.2.17
[radius statement], page 35.
ldap The user is authenticated using LDAP. See Section 3.2.19 [ldap state-
ment], page 39.
Unless overridden by authentication statement, the list of authentication modules
is the same as for authorization, i.e.:
1. generic
2. system
3. pam
4. sql
5. virtual
6. radius
7. ldap
Syntax
pam {
# Set PAM service name.
service text;
}
Description
The pam statement configures PAM authentication. It contains a single sub-statement:
This statement takes effect only if ‘pam’ is listed in authentication statement (see
Section 3.2.14 [auth statement], page 31).
Description
Virtual mail domains make it possible to handle several mail domains each having a separate
set of users, on a single server. The domains are completely independent of each other, i.e.
the same user name can be present in several domains and represent different users.
When authenticating to a server with virtual domain support enabled, users must supply
their user names with domain parts. The server strips off the domain part and uses it as
a name of UNIX-format password database file, located in the domain password directory.
The latter is set using passwd-dir statement.
For example, when authenticating user ‘[email protected]’, the server will use pass-
word file named dir/example.com. This file must be in UNIX passwd format (see Section
“password file” in passwd(5) man page), with encrypted passwords stored in it (as of GNU
Mailutils version 3.14, there is no support for shadow files in virtual password directories,
although this is planned for future versions). Here is an example record from this file:
smith:Wbld/G2Q2Le2w:1000:1000:Email Account:/var/mail/domain/smith:/dev/null
Notice, that it must contain user names without domain parts.
The pw_dir field (the 6th field) is used to determine the location of the maildrop for
this user. It is defined as pw_dir/INBOX. In our example, the maildrop for user ‘smith’ will
be located in file /var/mail/domain/smith.
Chapter 3: Mailutils Programs 35
If user did not supply his domain name, or if no matching record was found in the
password file, or if the file matching the domain name does not exist, then GNU Mailutils
falls back to alternative method. First, it tries to determine the IP address of the remote
party. Then the domain name corresponding to that address is looked up in the DNS
system. Finally, this domain name is used as a name of the password file.
Description
The radius block statement configures RADIUS authentication and authorization.
Mailutils uses GNU Radius library, which is configured via raddb/client.conf file
(see Section “Client Configuration” in GNU Radius Reference Manual). Its exact location
depends on configuration settings that were used while compiling GNU Radius. Usually it
is /usr/local/etc, or /etc. This default can also be changed at run time using directory
statement:
directory dir [Configuration]
Set full path name to the GNU Radius configuration directory.
It authorization is used, the Radius dictionary file must declare the the following at-
tributes:
$INCLUDE dict/mailutils.dict
Requests to use for authentication and authorization are configured using three state-
ments: auth, getpwnam and getpwuid. Each statement takes a single argument: a string,
containing a comma-separated list of assignments. An assignment specifies a particular
attribute-value pair (see Section “Overview” in GNU Radius Reference Manual) to send to
the server. The left-hand side of the assignment is a symbolic attribute name, as defined in
one of Radius dictionaries (see Section “dictionary file” in GNU Radius Reference Manual).
The value is specified by the right-hand side of assignment. For example:
"Service-Type = Authenticate-Only, NAS-Identifier = \"mail\""
The assignment may contain references to the following variables (see Section 3.2.2 [Vari-
ables], page 15):
user The actual user name (for auth and getpwnam), or user ID (for getpwuid). For
example:
User-Name = ${user}
passwd User password. For examples:
User-Password = ${passwd}
"Service-Type = Authenticate-Only";
The reply to getpwuid request is the same as to getpwnam request (see above).
Description
The sql statement configures access credentials to SQL database and the queries for au-
thentication and authorization.
GNU Mailutils supports three types of SQL interfaces: MySQL, PostgreSQL and ODBC.
The latter is a standard API for using database management systems, which can be used
to communicate with a wide variety of DBMS.
The database and database access credentials are configured using the following state-
ments:
db arg; [Configuration]
Name of the database.
Description
The ldap statement configures the use of LDAP for authentication.
enable bool [Configuration]
Enables LDAP lookups. If absent, ‘enable On’ is assumed.
url url [Configuration]
Sets the URL of the LDAP server.
base string [Configuration]
Defines base DN for LDAP lookups.
binddn string [Configuration]
Defines the DN for accessing LDAP database.
passwd string [Configuration]
Password for use when binding to the database.
tls bool [Configuration]
Enable the use of TLS when connecting to the server.
debug number [Configuration]
Set LDAP debug level. Please refer to the OpenLDAP documentation, for allowed
number values and their meaning.
field-map map [Configuration]
Defines a map for parsing LDAP replies. The map is a list of mappings1 . Each
mapping is ‘field=attr’, where attr is the name of the LDAP attribute and field is
a field name that declares what information that attribute carries. Available values
for field are:
name User name.
passwd User password.
uid UID of the user.
gid GID of the primary group.
gecos Textual description of the user.
1
For backward compatibility, map can be a string containing colon-delimited list of mappings. Such usage
is, however, deprecated.
Chapter 3: Mailutils Programs 41
Description
The ‘tls’ statement configures TLS parameters to be used by servers. It can appear both
in the global scope and in server scope. Global tls settings are applied for servers that are
declared as supporting TLS encryption, but lack the ‘tls’ substatement.
ssl-certificate-file string [Configuration]
Specify SSL certificate file.
ssl-key-file file [Configuration]
Specify SSL certificate key file.
ssl-ca-file file [Configuration]
Specify the trusted certificate authorities file.
42 GNU Mailutils Manual
handshake-timeout n [Configuration]
Set the timeout (in seconds) for I/O operations during TLS handshake. Default value
is 10 seconds.
Description
This section configures security checks applied to the particular SSL configuration files in
order to decide whether it is safe to use them.
===========================================================
Syntax
gsasl {
# Name of GSASL password file.
cram-passwd file;
# SASL service name.
service string;
# SASL realm name.
realm string;
# SASL host name.
hostname string;
# Anonymous user name.
anonymous-user string;
}
3.3 Debugging
Mailutils debugging output is controlled by a set of levels, each of which can be set
independently of others. Each debug level consists of a category name, which identifies the
part of Mailutils for which additional debugging is desired, and a level number, which
tells Mailutils how verbose should its output be.
Valid debug levels are:
error Displays error conditions which are normally not reported, but passed to the
caller layers for handling.
trace0 through trace9
Ten levels of verbosity, ‘trace0’ producing less output, ‘trace9’ producing the
maximum amount of output.
prot Displays network protocol interaction, where applicable.
Implementation and applicability of each level differs between various categories. The
full list of categories is available in file libmailutils/diag/debcat in the Mailutils source
tree. Most useful categories and levels implemented for them are discussed later in this
article.
both cases, the level is specified as a list of individual levels, delimited with semicolons.
Each individual level can be specified as:
!category Disables all levels for the specified category.
category Enables all levels for the specified category.
category.level
For the given category, enables all levels from ‘error’ to level, inclusive.
category.=level
Enables only the given level for this category.
category.!level
Disables all levels from ‘error’ to level, inclusive, for this category.
category.!=level
Disables only the given level in this category.
category.levelA-levelB
Enables all levels in the range from levelA to levelB, inclusive.
category.!levelA-levelB
Disables all levels in the range from levelA to levelB, inclusive.
Additionally, a comma-separated list of level specifications is allowed after the dot. For
example, the following specification:
acl.prot,!=trace9,!trace2
enables in category ‘acl’ all levels, except ‘trace9’, ‘trace0’, ‘trace1’, and ‘trace2’.
3.3.2 BNF
The following specification in Backus-Naur form describes formally the Mailutils debug
level:
<debug-spec> ::= <level-spec> | <debug-level-list>
<debug-level-list> ::= <debug-level> |
<debug-level-list> ";" <debug-level>
<debug-level> ::= <category> | "!" <category> |
<category> "." <level-list>
<level-list> ::= <level-spec> | <level-list> "," <level-spec>
<level-spec> ::= <level> | <negate-level>
<negate-level> ::= "!" <level>
<level> ::= <level-number> | "=" <level-number> |
<level-number> "-" <level-number>
<level-number> ::= "error" | "trace0" | "trace1" | "trace2" | "trace3" |
"trace4" | "trace5" | "trace6" | "trace7" |
"trace8" | "trace9" | "prot"
===========================================================
GNU mailutils provides two commands for listing messages in a mailbox. These are
from and frm.
The behavior of both programs is affected by the following configuration file statements:
Statement Reference
debug See Section 3.2.6 [debug statement], page 18.
tls See Section 3.2.20 [tls statement], page 41.
mailbox See Section 3.2.7 [mailbox statement], page 18.
locking See Section 3.2.9 [locking statement], page 22.
Chapter 3: Mailutils Programs 47
frm
The frm utility outputs a header information of the selected messages in a mailbox. By
default, frm reads user’s system mailbox and outputs the contents of From and Subject
headers for each message. If a folder is specified in the command line, the program reads
that folder rather than the default mailbox.
The following command line options alter the behavior of the program:
-d
--debug Enable debugging output.
-f string
--field string
Display the header named by string instead of From Subject pair.
-l
--to Include the contents of To header to the output. The output field order is then:
To From Subject.
-n
--number Prefix each line with corresponding message number.
-Q
--Quiet Be very quiet. Nothing is output except error messages. This is useful in shell
scripts where only the return status of the program is important.
-q
--query Print a message only if there are unread messages in the mailbox.
-S
--summary
Print a summary line.
-s attr
--status attr
Only display headers from messages with the given status. Attr may be one of
the following: ‘new’, ‘read’, ‘unread’. It is sufficient to specify only first letter
of an attr. Multiple -s options are allowed.
-t
--align Tidy mode. In this mode frm tries to preserve the alignment of the output
fields. It also enables the use of BIDI algorithm for displaying subject lines
that contain text in right-to-left orientation (such as Arabic or Hebrew).
from
The from utility displays sender and subject of each message in a mailbox. By default, it
reads the user’s system mailbox. If the program is given a single argument, it is interpreted
as a name of the user whose mailbox is to be read. Obviously, permissions are required to
access that user’s mailbox, so such invocations may be used only by superuser.
The option -f (--file) instructs from to read the given mailbox.
The full list of options, supported by from follows:
-c
--count Prints only a count of messages in the mailbox and exit.
48 GNU Mailutils Manual
-d
--debug Prints additional debugging output.
-s string
--sender=string
Prints only mail with ‘From:’ header containing the supplied string.
-f url
--file=url
Examine mailbox from the given url.
Chapter 3: Mailutils Programs 49
===========================================================
Mail is an enhanced version of POSIX mailx program. The program operates in two
modes: read and send.
Mail enters send mode when at least one email address was specified in its command line.
In this mode the program waits until user finishes composing the message, then attempts
to send it to the specified addresses and exits. See Section 3.5.4 [Composing Mail], page 66,
for a detailed description of this behavior.
If the command line contained no email addresses, mail switches to reading mode. In this
mode it allows the user to read and manipulate the contents of the user system mailbox. Use
the --file (-f) option to specify another mailbox name. For more detail, see Section 3.5.2
[Reading Mail], page 51.
In addition to the Mailutils configuration file, mail reads the traditional ‘mailrc’-style
configuration files. See Section 3.5.8 [Mail Configuration Files], page 88, for a detailed
description of their format.
--content-type=type
This options sets the content type to be used by all subsequent --attach op-
tions.
--content-filename=name
Set the ‘filename’ parameter in the ‘Content-Disposition’ header for the
next --attach-fd option.
--content-name=text
Set the ‘name’ parameter (description) in the ‘Content-Type’ header for the
next --attach or --attach-fd option.
-E command
--exec=command
Execute command before opening the mailbox. Any number of --exec options
can be given. The commands will be executed after sourcing configuration files
(see Section 3.5.8 [Mail Configuration Files], page 88), but before opening the
mailbox.
-e
--exist Return true if the mailbox contains some messages. Return false otherwise.
This is useful for writing shell scripts.
--encoding=enc
Sets content transfer encoding for use by the subsequent --attach options.
-F
--byname Record outgoing messages in a file named after the first recipient. The name is
the login-name portion of the address found first on the ‘To:’ line in the mail
header.
-f
--file Operate on the mailbox given by the first non-optional command line argument.
If there is no such argument, read messages from the user’s mbox file. See
Section 3.5.2 [Reading Mail], page 51, for more details about using this option.
-H
--headers
Print header summary to stdout and exit.
-i
--ignore Ignore interrupts when composing the message.
-M
--mime
--no-mime
The --mime option instructs mail to compose MIME messages. It is equivalent
for -E ’set mime’, except that it is processed after all other options. The
--no-mime disables the MIME compose mode, and is a shortcut for -E ’set
nomime’,
-N
--nosum Do not display initial header summary.
Chapter 3: Mailutils Programs 51
-n
--norc Do not read the system-wide mailrc file. See Section 3.5.8 [Mail Configuration
Files], page 88.
-p
--print
--read Print all mail to standard output. It is equivalent to issuing following commands
after starting ‘mail -N’:
print *
quit
except that mail --print does not change status of the messages.
-q
--quit Cause interrupts to terminate program.
-r address
--return-address=address
Sets the return email address for outgoing mail. See [return-address], page 85.
--skip-empty-attachments
--no-skip-empty-attachments
Don’t create attachments that would have zero-size body. This option affects
all attachments created by --attach and --attach-fd options appearing after
it in the command line, as well as the body of the original message.
To cancel its effect, use the --no-skip-empty-attachments option.
-s subj
--subject=subj
Send a message with a Subject of subj. Valid only in sending mode.
-t
--to Read recipients from the message header. Ignore addresses listed in the com-
mand line.
-u user
--user=user
Operate on user’s mailbox. This is equivalent to:
mail -f/spool_path/user
with spool path being the full path to your mailspool directory
(/var/spool/mail or /var/mail on most systems).
The program also understands the common mailutils options (see Section 3.1.2 [Common
Options], page 8.
When called without arguments, mail opens the system mailbox for the invoking user.
The --file (-f) used without arguments instructs mail to operate on the personal mailbox
instead. When this option and a single command line argument are used together, mail
treats the argument as the pathname of the secondary mailbox to operate upon.
Notice that this argument is not an argument to the --file (-f) option itself, but
rather the first non-optional argument on the command line. This means that any number
of additional options are allowed between the --file option and the mailbox file name. For
example, the following three invocations are equivalent:
$ mail -fin mymbox
$ mail -f mymbox -in
$ mail --file -in mymbox
$ mail --file -i mymbox -n
Additionally, for conformance to the GNU standards, the following form is also accepted:
$ mail --file=mymbox -i -n
The --user (-u) option allows the system administrator to assume another user identity
for operating on this user’s mailboxes. Obviously, it is available only to system administra-
tors. For example:
mail --user=tom
reads mail from the system mailbox of the user ‘tom’, and
mail --user=tom --file
reads mail from the personal mailbox of this user.
Unless you have started mail with --norc command line option, it will read the contents
of the system-wide configuration file. Then it will read the contents of user configuration
file, if it exists. For detailed description of these files, see Section 3.5.8 [Mail Configuration
Files], page 88. After this initial setup, mail displays the first page of header lines (unless
the -N option has been given), followed by a prompt, indicating that it is waiting for regular
commands. Upon receiving a command, mail parses and executes it, displays the result on
the screen, prints the prompt and waits for the next command. This process is continued
until mail receives any of the commands ‘quit’, ‘exit’ or the end-of-file character (ASCII
4, or C-D).
Each message in the mailbox has a state that affects how it is retained or deleted upon
closing the mailbox when terminating the program (see [the quit command], page 55) or
when switching to another mailbox (see [the file command], page 56). The state is reflected
in the header listing and can be changed during the session. The states are:
new The message is present in the system mailbox and has not been read by the
user or moved to any other state. When mail terminates, messages in this state
are retained in the system mailbox. If the mailbox is closed, such messages are
moved to the ‘unread’ state.
unread The message has been present in the system mailbox for more than one in-
vocation of mail and has not been read by the user or moved to any other
state. When mail terminates, messages in this state are retained in the system
mailbox.
Chapter 3: Mailutils Programs 53
read The message has been read by the user, i.e. processed by one of the following
commands: copy, mbox, next, pipe, prev, print, Print, struct, top, type,
Type, undelete, or any of the following escapes (in message compose mode):
~f, ~m, ~F, ~M.
When mail terminates, messages in this state are handled depending on the
mailbox they are in.
If mail was operating on the user system mailbox, all messages in state ‘read’
are preserved. The location where they are preserved is determined by the
hold variable (see Section 3.5.7 [Mail Variables], page 75). If it is not set (the
default), the messages are moved to the user’s mbox. If hold is set, the messages
are held in the system mailbox instead.
The ‘read’ messages in any other mailbox will be retained in their current
location.
deleted The message has been processed by one of the following commands: ‘delete’,
‘dp’, ‘dt’. Messages in this state are ignored by any command, excepting
‘undelete’, which changes their state back to ‘read’. When closing the mail-
box, deleted messages are permanently removed from the mailbox.
preserved The message has been processed by the preserve (hold) command. When
closing the mailbox, such messages are retained in the mailbox.
saved The message has been processed by one of the following commands: save,
write. When mail terminates, messages in this state are handled depending
on the mailbox they are in.
If mail was operating on the user system mailbox, the default behavior for
‘saved’ messages is to remove them from the system mailbox. If, however, the
keepsave variable is set, they are preserved using the same rules as for ‘read’
messages (see above).
Saved messages in non-system mailboxes are retained in their current location.
Unless the mailbox is empty, exactly one of its messages will be marked as current
message. Upon startup, current message is set to the first new message, if there is any, or
the first unread message if there is any, or to the first message in the mailbox. In the header
listing, current message is marked with the ‘>’ sign at the beginning of the line. Current
message is changed by any of the following commands: ‘dp’, ‘prev’, ‘next’.
$ [Mail command]
Move to the last undeleted message.
Otherwise, closes the current mailbox and opens the mailbox named by the mailbox
argument. When closing the current mailbox, its messages are processed according
to their state (see [mail message states], page 52).
The mailbox argument can be the name of the existing file, a mailbox URL (see
Chapter 2 [Mailbox], page 3), or any of the following shortcuts:
% The system mailbox for the invoking user.
Chapter 3: Mailutils Programs 57
i.e., 22 lines (603 characters) have been appended to the file “smith”. If the file does
not exist, it is created.
3.5.2.13 Aliasing
alias [alias [address...]] [Mail command]
a [alias [address...]] [Mail command]
group [alias [address...]] [Mail command]
g [alias [address...]] [Mail command]
With no arguments, prints out all currently-defined aliases. With one argument,
prints out that alias. With more than one argument, creates a new alias or changes
an old one.
62 GNU Mailutils Manual
3.5.2.14 Replying
mail [address...] [Mail command]
m [address...] [Mail command]
Switches to compose mode. After composing the message, sends it to the specified
addresses.
If the record variable is set, the composed message will be saved in the folder named
by it.
Mail [address...] [Mail command]
M [address...] [Mail command]
Same as mail, but the name of the file to save the composed message is derived from
its first recipient as outlined below.
If the outfolder variable is set, and has a string value s, the filename is s/recipient.
If it is a boolean, then the folder variable is consulted. If it is set, then the filename
is folder/recipient. Otherwise, the message will not be saved.
The value recipient is derived from the email of the first recipient of the message. By
default it is a local part of that email. If the outfilename variable has the value
‘domain’, the domain part of the email is used. If this variable is set to ‘email’, then
entire email address is used.
See [saving mail by name], page 65, for a detailed discussion.
reply [message] [Mail command]
respond [message] [Mail command]
r [message] [Mail command]
Mail a reply message to all recipients included in the header of the message. The
subject header is formed by concatenating the value of the replyprefix variable and
the subject from the message. If record is set to a filename, the response is saved at
the end of that file.
Reply [msglist] [Mail command]
Respond [msglist] [Mail command]
R [msglist] [Mail command]
Mail a reply message to the sender of each message in the msglist. The subject header
is formed by concatenating the value of the replyprefix variable and the subject
Chapter 3: Mailutils Programs 63
header of from the first message in msglist. If record is set to a filename, the response
is saved at the end of that file.
Notice, that setting mail variable flipr (see Section 3.5.7 [Mail Variables], page 75)
swaps the meanings of the two above commands
By default, mail will preserve personal email parts when forming lists of recipient ad-
dresses. If this is not desired, unset the fullnames variable (see [fullnames], page 78).
To determine the sender of the message mail uses the list of sender fields (see
Section 3.5.2.15 [Controlling Sender Fields], page 64). The first field from this list is
looked up in message headers. If it is found and contains a valid email address, this
address is used as the sender address. If not, the second field is searched and so on. This
process continues until a field is found in the headers, or the sender field list is exhausted,
whichever happens first.
If the previous step did not determine the sender address, the address from SMTP
envelope is used.
Let’s illustrate this. Suppose your mailbox contains the following:
U 1 [email protected] Fri Jun 30 18:30 8/245 Re: The Sa
? Print 1
From: Antonius Block <[email protected]>
To: Smeden Plog <[email protected]>
Date: Tue, 27 Apr 2004 13:23:41 +0300
Reply-To: <[email protected]>
Subject: News
Hi
As you see, the value of Reply-To field was taken as the sender address.
? reply
To: Antonius Block <[email protected]>
Subject: Re: News
If the command sender is used without arguments, it displays the contents of the sender
field list. If arguments are given, each argument is appended to the sender field list. For
example:
? sender
Sender address is obtained from the envelope
? sender mail-followup-to reply-to
? sender
mail-followup-to
reply-to
? sender from
? sender
mail-followup-to
reply-to
from
Command nosender is used to remove items from the sender field list:
Chapter 3: Mailutils Programs 65
? sender
mail-followup-to
reply-to
from
? nosender reply-to
? sender
mail-followup-to
from
This process is controlled by the outfilename variable: if its value is ‘local’, the file is
named by the local part of the email (this is the default). If it is ‘domain’, the domain part
is used instead. Finally, if it’s value is ‘email’, the entire email is used.
As a GNU extension, outfolder can be a string variable. In that case its value names
the directory to use instead of folder.
The mailx variable, if set, disables GNU extensions. In this case, outfolder is used as
a boolean value, and file names are derived from the local part of the email, ignoring the
outfilename value.
The first line of the output shows the content type of the message. Each subsequent
line contains the ordinal number of the attachment, the name of the file, content-type and
transfer encoding used.
The ‘~/’ escape toggles the content type bewteen ‘multipart/mixed’, and
‘multipart/alternative’. The new value of the content type is displayed on the screen.
The ‘~^’ escape removes attachments. Its argument is the number of the attachment to
remove, e.g.:
~^ 1
will display the from lines of all tagged messages. Note, that executing mail-sending
commands from within the compose mode is not allowed. An attempt to execute such a
command will result in diagnostic message “Command not allowed in an escape sequence”
being displayed. Also, when starting compose mode immediately from the shell (e.g. run-
ning ‘mail address@domain’), most mail commands are meaningless, since there is no mail-
box to operate upon. In this case, the only commands that can reasonably be used are:
alias, unalias, alternate, set, and unset.
Chapter 3: Mailutils Programs 69
To change the content type of the message body when sending a message with attach-
ments, use the trailing --content-type option, i.e. the option not followed by another
--attach option:
$ mail --content-type=text/html --attach=in.html \
--content-type=application/x-tar --attach=archive.tar \
--content-type=text/plain
This example adds two attachments with different content types and switched back to the
‘text/plain’ content type for the message body.
The encoding to use is set up by the --encoding option. As well as --content-type,
this option affects all attachments supplied after it in the command line as well as the
message body read from the standard input, until changed by the eventual next instance of
the same option. Extending the above example:
$ mail --content-type=text/html --encoding=quoted-printable \
--attach=in.html \
--content-type=application/x-tar --encoding=base64 \
--attach=archive.tar
A trailing --encoding option sets the encoding of the message body.
Each attachment can also be assigned a description and a file name. Normally, these
are the same as the file name supplied with the --attach option. However, you can change
either or both of them using the --content-name and --content-filename, correspond-
ingly. Both of these options affect only the next --attach (or --attach-fd, see below)
option.
By default, the message will be assigned the content type ‘multipart/mixed’. To change
it to ‘multipart/alternative’, use the --alternative command line option. Using this
option also sets the ‘Content-Disposition’ header of each attached message to ‘inline’.
All the examples above will enter the usual interactive shell, allowing you to compose
the body of the message. If that’s not needed, the non-interactive use can be forced by
redirecting /dev/null to the standard input, e.g.:
$ mail --attach=archive.tar < /dev/null
This will normally produce a message saying:
mail: Null message body; hope that’s ok
To suppress this message, unset the ‘nullbodymsg’ variable, as shown in the example
below:
$ mail -E ’set nonullbodymsg’ --attach=archive.tar < /dev/null
The option --attach=- forces mail to read the file to be attached from the standard in-
put stream. This option disables the interactive mode and sets ‘nonullbodymsg’ implicitly,
so that the above example can be rewritten as:
$ mail --attach=- < archive.tar
Special option is provided to facilitate the use of mail in scripts. The --attach-fd=N
instructs the program to read the data to be attached from the file descriptor N. The above
example is equivalent to:
$ mail --attach-fd=0 < archive.tar
Chapter 3: Mailutils Programs 71
Attachments created with this option have neither filename nor description set, so nor-
mally the use of --content-name and/or --content-filename is advised.
The option --skip-empty-attachments instructs mail to skip creating attachments
that would have zero-size body. This option affects all attachments created by --attach
and --attach-fd options appearing after it in the command line. It also affects the handling
of the original message body. To cancel its effect, use the --no-skip-empty-attachments
option.
Here are some examples illustrating how it works.
First, consider the following command line
$ mail --attach=archive.tar </dev/null
Assume that archive.tar is not empty.
This will create a MIME message of two parts: the first part having ‘text/html’ type and
empty body, and the second part of type ‘application/octet-stream’, with the content
copied from the file archive.tar.
Now, if you do:
$ mail --attach=archive.tar --skip-empty-attachments </dev/null
then the created MIME message will contain only one part: that containing archive.tar.
If the file archive.tar has zero length, the resulting archive will still contain the
‘application/octet-stream’ part of zero length. However, if you place the --skip-empty-
attachments option before --attach, then the produced message will be empty.
The following Perl program serves as an example of using mail from a script to construct
a MIME message on the fly. It scans all mounted file systems for executable files that have
setuid or setgid bits set and reports the names of those files in separate attachments. Each
attachment is named after the mountpoint it describes.
The script begins with the usual prologue stating the modules that will be used:
#!/usr/bin/perl
use strict;
use autodie;
Then global variables are declared. The ‘@rcpt’ array contains the email addresses of
the recipients:
my @rcpt= ’[email protected]’;
The ‘@cmd’ variable holds the mail command line. It will be augmented for each file
system. The initial value is set as follows:
my @cmd = (’mail’,
’-E set nonullbodymsg’,
’--content-type=text/plain’);
The find utility will be used to locate the files. The script will start as many instances
as there are mountpoints. Those instances will be run in parallel and their standard output
streams will be connected to file descriptors passed to mail invocation in --attach-fd
options.
The descriptors will be held in ‘@fds’ array. This will prevent them from being wiped out
by the garbage collector. Furthermore, care should be taken to ensure that the O_CLOEXEC
72 GNU Mailutils Manual
flag be not set for these descriptors. This sample script takes a simplistic approach: it
instructs Perl not to close first 255 descriptors when executing another programs:
my @fds;
$^F = 255;
The following code obtains the list of mount points:
open(my $in, ’-|’, ’mount -t nonfs,noproc,nosysfs,notmpfs’);
while (<$in>) {
chomp;
if (/^\S+ on (?<mpoint>.+) type (?<fstype>.+) /) {
For each mountpoint, the find command line is constructed and launched. The file
descriptor is pushed to the ‘@fds’ array to prevent it from being collected by the garbage
collector:
open(my $fd, ’-|’,
"find $+{mpoint} -xdev -type f"
. " \\( -perm -u+x -o -perm -g+x -o -perm -o+x \\)"
. " \\( -perm -u+s -o -perm -g+s \\) -print");
push @fds, $fd;
Now, the mail command is instructed to create next attachment from that file descriptor:
my $mpname = $+{mpoint};
$mpname =~ tr{/}{%};
push @cmd,
"--content-name=Set[ug]id files on $+{mpoint} (type $+{fstype})",
"--content-filename=$mpname.list",
’--attach-fd=’ . fileno($fd);
}
}
close $in;
Finally, the emails of the recipients are added to the command line, the standard input
is closed to make sure mail won’t enter the interactive mode and the constructed command
is executed:
push @cmd, @rcpt;
close STDIN;
system(@cmd);
3.5.6 Scripting
Comments
The ‘#’ character introduces an end-of-line comment. All characters until and including the
end of line are ignored.
variable, this command prints its name, data type, current value and a short description.
For example:
? variable ask datefield
ask, asksub
Type: boolean
Current value: yes
prompt user for subject before composing the message
datefield
Type: boolean
Current value: [not set]
get date from the ‘Date:’ header, instead of the envelope
Conditional Statements
The conditional statement allows to execute a set of mail commands depending on the mode
the mail program is in. The conditional statement is:
if cond
...
else
...
endif
where ‘...’ represents the set of commands to be executed in each branch of the state-
ment. cond can be one of the following:
‘s’ True if mail is operating in mail sending mode.
‘r’ True if mail is operating in mail reading mode.
‘t’ True if stdout is a terminal device (as opposed to a regular file).
The conditional statements can be nested to arbitrary depth. The minimal abbreviations
for ‘if’, ‘else’ and ‘endif’ commands are ‘i’, ‘el’ and ‘en’.
Example:
if t
set crt prompt="& "
else
unset prompt
endif
Chapter 3: Mailutils Programs 75
if s
alt [email protected] [email protected]
set
Default: True
Comment: Read-Only
Messages saved in mbox are appended to the end, rather than prepended. This is the
default and cannot be changed. This variable exists only for compatibility with other
mailx implementations.
boolean appenddeadletter [mail]
Default: False
If this variable is set, the contents of canceled letter is appended to the user’s
dead.letter file. Otherwise it overwrites its contents.
boolean askbcc [mail]
Default: False
When set to True the user will be prompted to enter Bcc field before composing the
message.
boolean askcc [mail]
Default: True
When set to True the user will be prompted to enter Cc field before composing the
message.
boolean asksub [mail]
Default: True
Automatically incorporate newly arrived messages.
boolean autoprint [mail]
Default: False
Causes the delete command to behave like dp: after deleting a message, the next one
will be typed automatically.
76 GNU Mailutils Manual
Default: False
When set, every occurrence of ! in arguments to ! escape is replaced with the last
executed command.
See Section 3.5.4.13 [Executing Shell Commands], page 69, for details on the ! escape.
boolean datefield [mail]
Default: False
By default the date in a header summary is taken from the SMTP envelope of the
message. Setting this variable tells mail to use the date from Date: header field,
converted to local time. Notice, that for messages lacking this field mail will fall back
to using SMTP envelope.
See [fromfield], page 78.
string charset [mail]
Default: ‘auto’
The value of this variable is the character set used for input and output operations.
If the value is ‘auto’, mail will try to deduce the name of the character set from
the value of LC_ALL environment variable. If the variable contains the character set
part (e.g. ‘nb_NO.utf-8’), it will be used. Otherwise, mail will look up in its built-in
database the value of the character for this language/territory combination. If LC_ALL
is not set, the LANG environment variable is inspected.
The value of charset controls both input and output operations. On input, it is used
to set the value of the ‘charset’ parameter in the ‘Content-Type’ MIME header, if
its value begins with ‘text/’ and the ‘charset’ parameter is not present.
On output, it is used to display values of the header fields encodied using RFC 2047.
If the variable is unset, no decoding is performed and the fields are printed as they
are. Otherwise, they are recoded to that character set.
string cmd [mail]
Default: Unset
Contains default shell command for pipe.
numeric columns [mail]
Default: Detected at startup by querying the terminal device. If this fails, the value
of environment variable COLUMNS is used.
This variable contains the number of columns on terminal screen.
numeric crt [mail]
boolean crt [mail]
The variable crt determines the minimum number of lines the body of the message
must contain in order to be piped through pager command specified by environment
variable PAGER. If crt is set to a numeric value, this value is taken as the threshold.
Otherwise, if crt is set without a value, then the height of the terminal screen is used
to compute the threshold. The number of lines on screen is controlled by screen
variable.
Default: Unset
Sets mailutils debug level. If set to string, the value must be a valid Mailutils debug-
ging specification. See [Debug Statement], page 18, for a description.
If unset (i.e. set nodebug), clears and disables all debugging information. If set to
‘true’ (i.e. set debug), sets maximum debugging (‘<trace7’) on mailbox and its
underlying objects.
Default: ‘none’
This variable controls the way to represent characters that cannot be rendered using
current character set. It can have three values:
‘none’ Such characters are not printed at all. The conversion process stops at
the first character that cannot be rendered.
‘copy-pass’
The characters are displayed ‘as is’. Notice, that depending on your
setup, this may screw-up your terminal settings.
‘copy-octal’
Unprintable characters are represented by their octal codes. Printable
ones are printed ‘as is’.
Default: False
If set, causes mail to interpret a period alone on a line as the terminator of a message
you are sending.
Default: False
When set, mail will include message headers in the text to be the ~e and ~v escapes,
thus allowing you to customize the headers.
Default: False
78 GNU Mailutils Manual
If the mailbox is empty, mail normally prints ‘No mail for user’ and exits immedi-
ately. If this option is set, mail will start no matter is the mailbox empty or not.
Default: ‘~’
Current value of the command escape character.
Default: Unset
If set, the variable flipr swaps the meanings of reply and Reply commands (see
Section 3.5.2.14 [Replying], page 62).
Default: Unset
The name of the directory to use for storing folders of messages. If unset, $HOME is
assumed.
Default: True
By default the sender address is taken from the ‘From’ header. Unsetting this variable
tells mail to obtain it from the SMTP envelope instead.
See [datefield], page 76.
Default: True
Preserve personal parts (comments) of recipient addresses when replying to a message.
When unset, only emails will be used.
See Section 3.5.2.14 [Replying], page 62.
The ‘-’ character immediately following ‘%’ indicates that this field should be left
aligned. The ‘+’ character indicates right alignment. Default alignment depends on
the type of the specifier: the specifiers that produce numeric values (‘%l’, ‘%m’, and
‘%o’) are aligned to the right, whereas the ones producing string or date/time values
are aligned to the left.
A number following ‘%’ or the alignment flag, indicates the field width.
Consider the ‘%m’ specifier as an example:
%m Print current message number. Take as much screen columns as necessary
for output.
%4m
%+4m Print current message number. Use exactly 4 screen columns, truncating
the output if it does not fit that width. Align the output to the right.
%-4m Same as above, but align to the left.
Valid format specifiers are:
%a Message attribute. One of the following letters, or a single horizontal
space, if none of them applies:
‘M’ the message was copied to the mailbox (mbox
command)
‘P’ the message was preserved (hold command)
‘*’ the message was saved (save or Save)
‘T’ the message was tagged (tag)
‘R’ the message was read
‘N’ the message is new (was not seen)
‘U’ the message was seen, but wasn’t read
%d The date when the message was received. It is determined from the mes-
sage header defined by the ‘datefield’ variable (see [datefield], page 76).
If that variable is not set, or the requested header is not present in the
message, the date from the envelope is used.
The output is formatted according to the following format specification
(see Appendix C [Date/time Format String], page 211):
%a %b %e %H:%M
I.e.: abbreviated weekday name, abbreviated month name, day of the
month as a decimal number, followed by hour and minutes. All names
are displayed according to the current locale.
%D{fmt} Same as ‘%d’, but the date is formatted according to the date/time format
fmt. It is essentially a C ‘strftime’ format string, described in detail in
Appendix C [Date/time Format String], page 211.
For example:
set headline="%4m %20D{%Y-%m-%dT%H:%M:%S}"
Note, that the opening ‘{’ must follow the format letter without any
intervening whitespace. If fmt contains ‘{’, ‘}’, or ‘\’, these characters
must be escaped with backslash (e.g. ‘\{’).
80 GNU Mailutils Manual
Default: False
Determines the location where to store the messages in state ‘read’ and (if the
keepsave is also set) ‘saved’. When set, these messages will be retained in the
system mailbox.
When not set (the default), such messages will be stored in the user’s personal mail-
box.
See [read messages], page 52, and See [saved messages], page 53, for a detailed infor-
mation on how such messages are processed when the mailbox is being closed.
See [keepsave], page 81, for the discussion of the keepsave variable.
boolean ignore [mail]
Default: False
When set to True, mail will ignore keyboard interrupts when composing messages.
Otherwise an interrupt will be taken as a signal to abort composing.
boolean ignoreeof [mail]
Default: False
Controls whether typing EOF character terminates the letter being composed.
string indentprefix [mail]
Default: False
If set, mail will expand aliases in the address header field before entering send mode
(see Section 3.5.4 [Composing Mail], page 66). By default, the address header fields
are left intact while composing, the alias expansion takes place immediately before
sending message.
boolean keep [mail]
Comment: Read-Only
Default: True
Truncate the user’s system mailbox when it is empty, instead of removing it. This is
the default and cannot be changed. This variable exists only for compatibility with
other mailx implementations.
boolean keepsave [mail]
Default: False
Controls whether saved messages should be retained. The location where they will
be retained is controlled by the hold variable (see [the hold variable], page 80).
This variable is in effect only when operating upon the user’s system mailbox.
See [saved messages], page 53, for a detailed information on how the saved messages
are processed when the mailbox is being closed.
boolean mailx [mail]
Default: False
When set, enables mailx compatibility mode. This mode has the following effects:
• When composing a message mail will ask for Cc and Bcc addresses after compos-
ing the body. The default behavior is to ask for these values before composing
the body.
• In send mode, if the composition was interrupted, mail will exit with zero status.
By default it exits with zero status only if the message was sent successfully.
• The outfolder variable is treated as boolean. see [outfolder], page 84.
• The value of outfilename is ignored (assumed to be ‘local’). see [outfilename],
page 83.
• The values of folder and record variables are assumed relative to the home
directory, unless they begin with ‘/’, ‘~’, or ‘+’.
• If the value of the sendmail variable does not begin with a scheme specification,
‘sendmail:/’ is assumed. See [sendmail mail variable], page 86.
boolean metamail [mail]
string metamail [mail]
Default: True
82 GNU Mailutils Manual
This variable controls operation of decode command. If it is unset, decode will not
attempt any interpretation of the content of message parts. Otherwise, if metamail
is set to true, decode will use internal metamail support to interpret message parts.
Finally, if metamail is assigned a string, this string is treated as command line of
the external metamail command which will be used to display parts of a multipart
message. For example:
# Disable MIME interpretation:
set nometamail
# Enable built-in MIME support:
set metamail
# Use external program to display MIME parts:
set metamail="metamail -m mail -p"
Default: False
If set, this variable instructs mail to compose MIME messages.
It can be set from the command line using --mime option.
Default: Unset
By default mail asks for confirmation before running interpreter to view a part of the
multi-part message. If this variable is set, its value is treated as a comma-separated
list of MIME types for which no confirmation is needed. Elements of this list may
include shell-style globbing patterns, e.g. setting
set mimenoask=text/*,image/jpeg
will disable prompting before displaying any textual files, no matter what their sub-
type is, and before displaying files with type ‘image/jpeg’.
Default: False
Usually, when an alias is expanded that contains the sender, the sender is removed
from the expansion. Setting this option causes the sender to be included in the group.
Comment: Read-Only
Default: The name of current operation mode.
This variable keeps the name of the current operation mode. Its possible values are:
headers The program is started with the --headers (-H) command line option
(see Section 3.5.1 [Invoking Mail], page 49).
exist The program is started with the --exist (-e) command line option (see
Section 3.5.1 [Invoking Mail], page 49).
Chapter 3: Mailutils Programs 83
print The program is started with the --print (-p) command line option (see
Section 3.5.1 [Invoking Mail], page 49).
read The program operates in read mode. This is the default.
send The program operates in send mode. This means it was given one or
more recipient addresses in the command line.
Default: True
Controls whether mail accepts messages with an empty body. The default value,
true, means such messages are sent, and a warning (traditionally saying ‘Null
message body; hope that’s ok’) is displayed. The text of the warning can be set
using nullbodymsg variable (see below).
If nullbody is unset, mail will silently ignore such messages. This can be useful in
crontab files, to avoid sending mails when nothing important happens. For exam-
ple, the crontab entry below will send mail only if the utility some-prog outputs
something on its standard output or error:
*/5 * * * * some-prog 2>&1 | \
/bin/mail -E’set nonullbody’ -s ’Periodic synchronization’
Default: Unset
This variable is not used. It exists for compatibility with other mailx implementations
and for future use.
Default: Unset
When set as boolean, causes the files used to record outgoing messages to be located
in the directory specified by the folder variable (unless the pathname is absolute).
If set to a string value, names the directory where to store these files.
This variable affects the following commands: Copy, Save, Mail, followup, and
Followup.
In mailx compatibility mode, only boolean value is allowed. see [mailx mail variable],
page 81.
Default: Unset
If set, the pipe command will emit a linefeed character after printing each message.
Comment: Read-Only
Default: PID of the process.
PID of the current mail process.
Default: Unset
This variable is not used. It exists for compatibility with other mailx implementations
and for future use.
boolean rc [mail]
Default: False
When set, mailboxes are opened in readonly mode. In this mode, any mail commands
that alter the contents of the mailbox are disabled. These commands include, but are
not limited to: delete, save and mbox.
Default: Unset
When set, outgoing messages produced by the following commmands will be saved to
the named file: mail, reply, Reply.
See also [outfolder], page 84, and [outfilename], page 83.
Default: True
When set, mail will expand aliases recursively.
Default: True.
If set, enables the use of regular expressions in ‘/.../’ message specifications.
Default: ‘Re: ’
Sets the prefix that will be used when constructing the subject line of a reply message.
Default: ‘^re: *’
Sets the regular expression used to recognize subjects of reply messages. If the
Subject header of the message matches this expression, the value of replyprefix
will not be prepended to it before replying. The value should be a POSIX extended
regular expression. The comparison is case-insensitive.
For example, to recognize usual English, Polish, Norwegian and German reply subject
styles, use:
set replyregex="^(re|odp|aw|ang)(\\[[0-9]+\\])?:[[:blank:]]"
(Notice the quoting of backslash characters).
Default: unset
Sets the return email address to use when sending messages. If unset, return address
is composed from the current user name and the host name.
86 GNU Mailutils Manual
Default: True.
When set, the aborted messages will be stored in the user’s dead.file. See also
appenddeadletter.
Default: Detected at startup by querying the terminal device. If this fails, the value
of environment variable LINES is used.
This variable contains the number of lines on terminal screen. See also [crt], page 76.
Default: ‘sendmail:/usr/lib/sendmail’
Contains URL of the mail transport agent. If the value begins with a scheme specifier,
it must be one of the mailer URL schemes supported by mailutils (see [mailer URL],
page 24). Otherwise, if not in mailx compatibility mode, the value starting with
directory separator (‘/’) is treated as the external command that will be started as is
and the composed message will be piped to its standard input.
In mailx compatibility mode (see [mailx mail variable], page 81), the ‘sendmail:’
prefix is assumed.
Default: Unset
This variable is not used. It exists for compatibility with other mailx implementations
and for future use.
Default: Unset
Contains the filename holding users signature. The contents of this file is appended
to the end of a message being composed by ~A escape.
Default: Unset
Contains the user’s signature. The contents of this variable is appended to the end of
a message being composed by ~a escape. Use Sign variable, if your signature occupies
more than one line.
Default: Unset
If this variable is set, the print command will include the SMTP envelope in its
output.
Chapter 3: Mailutils Programs 87
Default: Unset
If this variable is set, mail will show To: addresses instead of From: for all messages
that come from the user that invoked the program.
Default: Unset
Contains default subject line. This will be used when asksub is off.
Default: 5
Number of lines to be displayed by top and Top commands.
Default: False
If this variable is set, the listing output by set contains short descriptions before each
variable. See [Setting and Unsetting the Variables], page 73.
Default: False
Setting this variable enables strict control over variable settings. In this mode, mail
refuses to set read-only variables. Also, if the user is trying to set an unknown variable,
mail prints a warning.
See [Setting and Unsetting the Variables], page 73.
Default: False
When set, the actual delivery of messages is displayed on the user’s terminal.
Default: True
Controls whether the ‘User-Agent’ header should be added to outgoing messages.
The default value of this header is
User-Agent: mail (GNU Mailutils 3.14)
Statement Reference
debug See Section 3.2.6 [debug statement], page 18.
tls See Section 3.2.20 [tls statement], page 41.
mailbox See Section 3.2.7 [mailbox statement], page 18.
locking See Section 3.2.9 [locking statement], page 22.
In addition to the common mailutils options (see Section 3.1.2 [Common Options],
page 8), the program accepts the following command line options:
-q
--quiet
-s
--silent Be quiet. Display only number of messages per mailbox, without leading text.
90 GNU Mailutils Manual
Statement Reference
debug See Section 3.2.6 [debug statement], page 18.
tls See Section 3.2.20 [tls statement], page 41.
mailbox See Section 3.2.7 [mailbox statement], page 18.
locking See Section 3.2.9 [locking statement], page 22.
pam See Section 3.2.15 [pam statement], page 33.
sql See Section 3.2.18 [sql statement], page 37.
virtdomain See Section 3.2.16 [virtdomain statement], page 34.
radius See Section 3.2.17 [radius statement], page 35.
ldap See Section 3.2.19 [ldap statement], page 39.
auth See Section 3.2.14 [auth statement], page 31.
===========================================================
Statement Reference
debug See [Debug Statement], page 18.
tls See [TLS Statement], page 41.
mailbox See [Mailbox Statement], page 18.
locking See [Locking Statement], page 22.
Chapter 3: Mailutils Programs 97
any original messages that are already in it. This behavior can be changed using the -t
(--truncate) option, described below.
The two mailboxes can be of different types. For example you can read input from an
imap server and store it in local ‘maildir’ box using the following command:
decodemail imap://[email protected] maildir:///var/mail/user
Both arguments can be omitted. If outbox is not supplied, the resulting mailbox will be
printed on the standard output in Unix ‘mbox’ format. If inbox is not supplied, the utility
will open the system inbox for the current user and use it for input.
A consequence of these rules is that there is no simple way to read the input mailbox
from standard input (the input must be seekable). If you need to do this, the normal
procedure would be to save what would be standard input in a temporary file and then give
that file as decodemail’s input.
The following command line options modify the decodemail behavior:
-c, --charset=charset
Convert all textual parts from their original character set to the specified
charset.
-R, --recode
Convert all textual parts from their original character set to the current char-
acter set, as specified by the LC_ALL or LANG environment variable.
--no-recode
Do not convert character sets. This is the default.
-t, --truncate
If the output mailbox exists, truncate it before appending new messages.
--no-truncate
Keep the existing messages in the output mailbox intact. This is the default.
Additionally, the Section 3.1.2 [Common Options], page 8, are also understood.
Statement Reference
mime See Section 3.2.8 [mime statement], page 21.
debug See [Debug Statement], page 18.
mailbox See [Mailbox Statement], page 18.
locking See [Locking Statement], page 22.
Notably, the mime statement can be used to extend the list of types which are decoded.
For example, in the file ~/.decodemail (other locations are possible, see Section 3.2 [con-
figuration], page 9), you could have:
# base64/qp decode these mime types also:
mime {
text-type "application/x-bibtex";
text-type "application/x-tex";
Chapter 3: Mailutils Programs 99
}
Since the list of textual mime types is open-ended, with new types being used at any
time, we do not attempt to make the built-in list comprehensive.
3.10 sieve
===========================================================
Editor’s note:
100 GNU Mailutils Manual
===========================================================
Sieve is a language for filtering e-mail messages at time of final delivery, described in
RFC 3028. GNU Mailutils contains stand-alone sieve interpreter, which is described in
detail below.
-D
--dump Compile the script, dump disassembled code on standard output and exit.
--environment=name=value
Set sieve environment variable name to the value.
-e address
--email address
Override the user email address. This is useful for reject and redirect actions.
By default, the user email address is deduced from the user name and the full
name of the machine where sieve is executed. See also Section 3.10.1.2 [Sieve
Configuration], page 102.
-E,
--expression
Treat the script argument as Sieve program text.
-I dir
--includedir=dir
Append directory dir to the list of directories searched for include files. See
also Section 3.10.1.2 [Sieve Configuration], page 102.
-f
--mbox-url=mbox
Mailbox to sieve (defaults to user’s system mailbox). See also Section 3.10.1.2
[Sieve Configuration], page 102.
-k
--keep-going
Keep on going if execution fails on a message. See also Section 3.10.1.2 [Sieve
Configuration], page 102.
-L dir
--libdir=dir
Append directory dir to the list of directories searched for library files. See also
Section 3.10.1.2 [Sieve Configuration], page 102.
--libdir-prefix=dir
Add dir to the beginning of the list of directories searched for library files.
--line-info=bool
Print source location along with action logs (default).
-M url
--mailer=url
Define the URL of the default mailer.
-n
--no-actions
--dry-run
Dry run: do not execute any actions, just print what would be done.
--no-program-name
Do not prefix diagnostic messages with the program name.
102 GNU Mailutils Manual
-t ticket
--ticket=ticket
Ticket file for mailbox authentication. See also Section 3.10.1.2 [Sieve Config-
uration], page 102.
--variable=name=value
Set Sieve variable name. This option automatically inserts ‘require
"variables"’ at the top of the script.
-v
--verbose
Log all actions executed. See also Section 3.10.1.2 [Sieve Configuration],
page 102.
See also Section 3.1.2 [Common Options], page 8.
Statement Reference
debug See Section 3.2.6 [debug statement], page 18.
tls See Section 3.2.20 [tls statement], page 41.
mailbox See Section 3.2.7 [mailbox statement], page 18.
locking See Section 3.2.9 [locking statement], page 22.
logging See Section 3.2.5 [logging statement], page 17.
mailer See Section 3.2.10 [mailer statement], page 24.
The following statements configure sieve-specific features:
sieve { ... } [Sieve Conf]
This block statement configures search paths sieve uses to locate its loadable mod-
ules. See Section 5.4 [Require Statement], page 173, for a detailed information about
loadable modules.
This statement may contain the following sub-statements:
clear-library-path bool [Sieve Conf]
If bool is ‘true’, clear library search path.
clear-include-path bool [Sieve Conf]
If bool is ‘true’, clear include search path.
library-path path [Sieve Conf]
Add directories to sieve library search path. Argument is a string containing
a colon-separated list of directories.
library-path-prefix path [Sieve Conf]
Add directories to the beginning if the library search path. Argument is a string
containing a colon-separated list of directories.
include-path path [Sieve Conf]
Add directories to the include search path. Argument is a string containing a
colon-separated list of directories.
Chapter 3: Mailutils Programs 103
5. If the module is found, sieve executes its initialization function (see below) and again
looks up the name in the symbol table. If found, search terminates successfully.
6. If either the module is not found, or the symbol wasn’t found after execution of the
module initialization function, search is terminated with an error status. sieve then
displays the following diagnostic message:
source for the required action NAME is not available
106 GNU Mailutils Manual
In the following example we define a module that prints information about each message
is the input mailbox, in a way similar to frm utility:
(define-module (frm)
:export (guimb-message))
This option stops further argument processing, and passes all remaining ar-
guments as the value of args argument to the guimb-getopt function, if it is
defined.
-f module
--file module
Load Scheme source code from module. The remaining arguments are processed
in the usual way. When using this option, you can pass additional options and
or arguments to the module by enclosing them in -{ and -} options (see [Passing
Options to Scheme], page 107).
An experimental option is provided, that evaluates a supplied Scheme expression right
after loading the module:
-e expr
--expression expr
Evaluate scheme expression.
3.12 mda
GNU local mail delivery agent reads a message from its standard input and delivers it to one
or more local recipients listed in the command line. When we speak about local recipients,
we mean that these are system users that are known to the system that runs mda. However,
the mailboxes of these users can be local as well as remote ones. mda is able to deliver mail
to any mailbox format, supported by GNU Mailutils. These formats, among others, include
‘smtp://’, ‘prog://’ and ‘sendmail://’ which are equivalent to forwarding a message over
SMTP to a remote node.
Mda is also able to process incoming messages using Sieve, Scheme or Python scripts
and, based on results of this processing, to take a decision on whether to actually deliver
and where to deliver them. Due to its extensive scripting facilities, mda offers much more
flexibility than other popular MDAs.
# director
110 GNU Mailutils Manual
mda:
driver = localuser
transport = mda_pipe
# Rest of users
plog 26214400
karin 10mB
To use the DBM quota database, specify its absolute name using the database configu-
ration statement in the quota section, e.g.:
quota {
database /etc/mail/quota.db;
}
Other Sieve actions are executed as described in Section 5.7 [Actions], page 182. For
example, to deliver message to another mailbox, use the fileinto action.
Any modifications to headers or body of the message performed by the Sieve code will
be visible in the delivered message.
try:
if ’List-Post’ in hdr and ’Received’ in hdr \
and hdr[’Received’].find (’fencepost.gnu.org’) != -1:
except Exception:
pass
3.12.6 Forwarding
A forward file is a special file in the user’s home directory that contains the email address of
the mailbox where the user wants to forward his mail. Normally, forward files are processed
by MTA. However, there are some MTA that lack this feature. One of them is MeTA1.
Mda provides a forwarding feature that is useful to compensate the lack of it. This feature
is controlled by the forward section in the configuration file:
forward {
# Process forward file.
file name;
# Configure safety checks for the forward file.
file-checks (list);
}
The name of the forward file is given by the file statement in the forward section. A
common usage is:
forward {
file .forward;
}
The forward file is always searched in the recipient home directory.
Before actually using the forward file, a number of safety checks are performed on it.
If the file fails to pass one of these checks, no forwarding is performed and the message is
delivered as usual. These checks are configured using the forward.file-checks statement:
forward {
file .forward;
file-checks (list);
}
Its argument is a list of the following keywords:
groupwritablefile
file iwgrp The file must not be group writable.
worldwritablefile
file iwoth The file must not be world writable.
linkedfileinwritabledir
link The file cannot be a symlink in a writable directory.
fileingroupwritabledir
dir iwgrp The file cannot reside in a group writable directory.
fileinworldwritabledir
dir iwoth The file cannot reside in a world writable directory.
all All of the above checks.
The default is ‘file-checks all’.
Chapter 3: Mailutils Programs 115
Each of these keywords may be prefixed by ‘no’ to disable this particular check. For
example:
forward {
file-checks (nodir_iwoth, nodir_iwgrp);
file .forward;
}
Statement Reference
debug See Section 3.2.6 [debug statement], page 18.
mailbox See Section 3.2.7 [mailbox statement], page 18.
locking See Section 3.2.9 [locking statement], page 22.
pam See Section 3.2.15 [pam statement], page 33.
sql See Section 3.2.18 [sql statement], page 37.
virtdomain See Section 3.2.16 [virtdomain statement], page 34.
radius See Section 3.2.17 [radius statement], page 35.
ldap See Section 3.2.19 [ldap statement], page 39.
auth See Section 3.2.14 [auth statement], page 31.
mailer See Section 3.2.10 [mailer statement], page 24.
stderr bool [MDA Config]
If bool is true, log to standard error instead of syslog.
deliver { ... } [MDA Config]
This section contains general delivery settings:
deliver {
domain string;
exit-multiple-delivery-success arg;
};
domain name [deliver]
Default email domain.
exit-multiple-delivery-success arg; [deliver]
In case of multiple delivery, exit with code 0 if at least one delivery succeeded.
forward { ... } [MDA Config]
Controls the forwarding support:
forward {
file name;
file-checks (list);
}
file name [forward]
Defines the name of the forward file. E.g.:
forward {
116 GNU Mailutils Manual
file .forward;
}
See Section 3.12.6 [Forwarding], page 114, for a detailed description.
sql {
interface mysql;
db mail;
getpwnam "SELECT user as name, mailbox, "
"’x’ as passwd, 500 as uid, 2 as gid, "
"’/nonexistent’ as dir, ’/sbin/nologin’ as shell "
"FROM userdb "
"WHERE user=’${user}’";
}
Then, the following entries in the ‘userdb’ table implement the mailman@yourdomain
mailing list:
mysql> select * from userdb;
+---------------------+---------------------------------------+
| user | mailbox |
+---------------------+---------------------------------------+
| mailman | |/usr/bin/mailman post mailman |
| mailman-admin | |/usr/bin/mailman admin mailman |
| mailman-bounces | |/usr/bin/mailman bounces mailman |
| mailman-confirm | |/usr/bin/mailman confirm mailman |
| mailman-join | |/usr/bin/mailman join mailman |
| mailman-leave | |/usr/bin/mailman leave mailman |
| mailman-owner | |/usr/bin/mailman owner mailman |
| mailman-request | |/usr/bin/mailman request mailman |
| mailman-subscribe | |/usr/bin/mailman subscribe mailman |
| mailman-unsubscribe | |/usr/bin/mailman unsubscribe mailman |
118 GNU Mailutils Manual
+---------------------+---------------------------------------+
Chapter 3: Mailutils Programs 119
3.13 lmtpd
The LMTP is a local mail transport protocol defined in RFC 2033. GNU Mailutils is shipped
with lmtpd - a daemon for delivering messages using this protocol.
The daemon shares most of its codebase and configuration with mda and consequently
provides the same features. See Section 3.12 [mda], page 109, for a detailed description of
these.
The behavior of lmtpd is affected by the following configuration statements:
Statement Reference
server See Section 3.2.13 [Server Settings], page 27,
acl See Section 3.2.11 [acl statement], page 24.
tcp-wrappers See Section 3.2.12 [tcp-wrappers statement], page 27.
debug See Section 3.2.6 [debug statement], page 18.
mailbox See Section 3.2.7 [mailbox statement], page 18.
locking See Section 3.2.9 [locking statement], page 22.
pam See Section 3.2.15 [pam statement], page 33.
sql See Section 3.2.18 [sql statement], page 37.
virtdomain See Section 3.2.16 [virtdomain statement], page 34.
radius See Section 3.2.17 [radius statement], page 35.
ldap See Section 3.2.19 [ldap statement], page 39.
auth See Section 3.2.14 [auth statement], page 31.
mailer See Section 3.2.10 [mailer statement], page 24.
3.14 putmail
The putmail utility reads a message from its standard input and delivers it to the specified
mailbox URL. The usage is:
putmail URL
For example, to deliver mail to a local mailbox /var/spool/mail/test:
putmail /var/spool/mail/test
Of course, this would work only it the test mailbox is writable for the user invoking
putmail.
The smtp mailbox scheme can be used for remote delivery. For example:
putmail ’smtp://mail.example.org;to=ovr’
The program will initiate SMTP dialog with the server ‘mail.example.org’ and will
send the message from its standard input to the user ‘ovr’ on that server.
Statement Reference
debug See Section 3.2.6 [debug statement], page 18.
mailbox See Section 3.2.7 [mailbox statement], page 18.
locking See Section 3.2.9 [locking statement], page 22.
pam See Section 3.2.15 [pam statement], page 33.
sql See Section 3.2.18 [sql statement], page 37.
virtdomain See Section 3.2.16 [virtdomain statement], page 34.
radius See Section 3.2.17 [radius statement], page 35.
ldap See Section 3.2.19 [ldap statement], page 39.
auth See Section 3.2.14 [auth statement], page 31.
mailer See Section 3.2.10 [mailer statement], page 24.
Chapter 3: Mailutils Programs 121
The utility also accepts all MDA configuration statements: See Section 3.12.7 [Conf-
mda], page 115.
122 GNU Mailutils Manual
3.15 mimeview
For each file given in its command line, mimeview attempts to autodetect its type and invoke
an appropriate file viewer.
To detect the file type, mimeview uses mime.types file. This file is a part of Com-
mon UNIX Printing System, Section “mime.types” in mime.types man page. By default
mimeview searches for mime.types in $prefix/etc/cups/1 , however its exact location can
be specified at runtime as well (see --mimetypes below).
Once file MIME type is successfully determined, mimeview consults mailcap files in
order to determine how to display the file. It does so essentially in the same manner as
metamail utility, i.e., it scans all files specified in METAMAIL environment variable until it
finds an entry describing the desired file format or until the list of files is exhausted. If
METAMAIL variable is not set, mimeview uses the following default path instead:
$HOME/.mailcap:/usr/local/etc/mailcap:\
/usr/etc/mailcap:/etc/mailcap:\
/etc/mail/mailcap:/usr/public/lib/mailcap
1
The exact location is determined at configuration time by setting environment variable DEFAULT_CUPS_
CONFDIR. On most sites running
./configure DEFAULT_CUPS_CONFDIR=/etc/cups
should be recommended.
Chapter 3: Mailutils Programs 123
Statement Reference
debug See [Debug Statement], page 18.
Standalone
The server runs as daemon, forking a child for each new connection.
The server operation mode is configured using mode statement (see Section 3.2.13 [Server
Settings], page 27).
3.16.2 Auto-expire
Automatic expiration of messages allows you to limit the period of time users are permitted
to keep their messages on the server. It is enabled by expire configuration statement:
expire n; Enable automatic expiration of messages after n days.
The current implementation works as follows. When a message is downloaded by RETR
or TOP command, it is marked with ‘X-Expire-Timestamp: n’ header, where n is current
value of UNIX timestamp. The exact expiration mechanism depends on you. Mailutils
allows you two options:
1. Expired messages are deleted by pop3d upon closing the mailbox. You specify this
mechanism using delete-expired configuration statement:
delete-expired bool;
If bool is ‘true’, delete expired messages after receiving the QUIT command.
2. Expired messages remain in the mailbox after closing it. The system administrator is
supposed to run a cron job that purges the mailboxes. Such a cron job can be easily
implemented using sieve from GNU Mailutils and the following script:
require "timestamp";
# Replace "5" with the desired expiration period
if timestamp :before "X-Expire-Timestamp" "now - 5 days"
{
discard;
}
This script will remove expired messages 5 days after the retrieval. Replace ‘5’ with the
desired expiration period and make sure it equals the argument to expire configuration
keyword.
The statement expire 0 means the client is not permitted to leave mail on the server.
It always implies delete-expired true.
3.16.3 Bulletins
The bulletin feature allows you to send important announcements to all POP3 users without
mailing them. It works by creating a bulletin source mailbox and sending the announce-
ments to it.
After a user successfully authenticates, pop3d checks the last bulletin number the user
receives. The bulletin number refers to the number of the bulletin message in the bulletin
source mailbox. If the latter contains more messages, these are appended to the user
mailbox.
The user last bulletin number can be kept in two places. First, it can be stored in file
.popbull in his home directory. Secondly, if Mailutils is compiled with DBM support, the
numbers can be kept in a DBM file, supplied via bulletin-db configuration statement.
If both the database and the .popbull file are present, the data from the database take
precedence.
To enable this feature, use the following configuration statements:
bulletin-source mbox
Set the URL of the bulletin source mailbox.
Chapter 3: Mailutils Programs 127
bulletin-db file
Set the name of the database file to keep last bulletin numbers in.
The following example instructs pop3d to look for the bulletin messages in MH folder
/var/spool/bull/mbox and to keep the database of last delivered bulletin numbers in
/var/spool/bull/numbers.db:
bulletin-source mh:/var/spool/bull/mbox;
bulletin-db /var/spool/bull/numbers.db;
Statement Reference
debug See Section 3.2.6 [debug statement], page 18.
tls See Section 3.2.20 [tls statement], page 41.
tls-file-checks See Section 3.2.21 [tls-file-checks statement],
page 42.
mailbox See Section 3.2.7 [mailbox statement], page 18.
locking See Section 3.2.9 [locking statement], page 22.
logging See Section 3.2.5 [logging statement], page 17.
pam See Section 3.2.15 [pam statement], page 33.
sql See Section 3.2.18 [sql statement], page 37.
virtdomain See Section 3.2.16 [virtdomain statement], page 34.
radius See Section 3.2.17 [radius statement], page 35.
ldap See Section 3.2.19 [ldap statement], page 39.
auth See Section 3.2.14 [auth statement], page 31.
server See Section 3.2.13 [Server Settings], page 27.
acl See Section 3.2.11 [acl statement], page 24.
tcp-wrappers See Section 3.2.12 [tcp-wrappers statement], page 27.
tls-mode mode [Pop3d Conf]
Configure the use of TLS encryption for inetd mode.
In daemon mode, this statement sets the type of TLS encryption to use in all server
blocks that lack the tls-mode statement (see Section 3.2.13.2 [Server Statement],
page 29).
Allowed values for mode are:
no TLS is not used. The STLS command won’t be available even if the TLS
configuration is otherwise complete.
ondemand TLS is initiated when the user issues the appropriate command. This is
the default when TLS is configured.
required Same as above, but the use of TLS is mandatory. The authentication
state is entered only after TLS negotiation has succeeded.
connection
TLS is always forced when the connection is established (POP3S proto-
col).
128 GNU Mailutils Manual
3.17.1 Namespace
GNU imap4d supports a notion of namespaces defined in RFC 2342. A namespace can
be regarded as a list of entities, defining locations to which the user has certain access
rights. Each entity includes the prefix, under which the mailboxes can be found, hierarchy
delimiter, a character used to delimit parts of a path to a mailbox, and a directory on the
file system on the server, which actually holds the mailboxes. Among these three values,
only first two are visible to the client using the IMAP ‘NAMESPACE’ command.
There are three namespaces:
Personal Namespace
A namespace that is within the personal scope of the authenticated user on a
particular connection. The user has all permissions on this namespace.
By default, this namespace contains a single prefix:
prefix: ""
delimiter: /
directory: home directory of the user
Other Users’ Namespace
A namespace that consists of mailboxes from the “Personal Namespaces” of
other users. The user can read and list mailboxes from this namespace. How-
ever, he is not allowed to use ‘%’ and ‘*’ wildcards with LIST command, that is
he can access a mailbox only if he knows exactly its location.
By default, this namespace is empty.
Shared Namespace
A namespace that consists of mailboxes that are intended to be shared amongst
users and do not exist within a user’s Personal Namespace. The user has all
permissions on this namespace.
By default, this namespace is empty.
The default values ensure that each user is able to see or otherwise access mailboxes
residing in the directories other than his own home.
These defaults can be changed using the namespace block statement:
namespace name {
mailbox-mode mode;
prefix pfx {
directory path;
delimiter chr;
mailbox-type type;
}
}
130 GNU Mailutils Manual
The name argument to the namespace statement declares which namespace is being
configured. Allowed values are: ‘personal’, ‘other’, and ‘shared’.
The mailbox-mode statement configures the file mode for the mailboxes created within
that namespace (provided that the directory permissions allow the user to create mailboxes).
The mode argument is a comma-delimited list of symbolic mode settings, similar to that
used by chmod. Each setting begins with a letter ‘g’, which means set mode bits for file
group, or ‘o’, which means set mode bits for other users (note, that there is no ‘u’ specifier,
since user ownership of his mailbox cannot be changed). This letter is followed by an ‘=’
(or ‘+’), and a list of modes to be set. This list can contain only two letters: ‘r’ to set read
permission, and ‘w’ to set write permission.
For example, the following statement sets read and write permissions for the group:
mailbox-mode g=rw;
The prefix statement configures available prefixes and determines their mappings to
the server’s file system. The pfx argument defines the prefix which will be visible to the
IMAP client.
The directory statement defines the directory in the file system to which pfx is mapped.
Exactly one directory statement must be present in each prefix block. The inerpretation
of its argument depends on the namespace in which it occurs.
When used in the ‘namespace shared’ block, the argument to this statement is inter-
preted verbatim, as an absolute pathname.
When used in ‘namespace personal’ the argument to directory statement can contain
references to the following variables (see Section 3.2.2 [Variables], page 15):
user Login name of the user.
home Home directory of the user.
For example, the following statement maps the default personal namespace to the direc-
tory ‘imap’ in the user’s home directory:
namespace personal {
prefix "";
directory "$home/imap";
}
If the ‘directory’ statement is used within the ‘namespace other’ block, its value can
contain the ‘$user’ and ‘$home’ variables as well, but their meaning is different. For the
‘other’ namespace, the ‘$user’ variable is expanded to the part of the actual reference
contained between the prefix and first hierarchy delimiter (or the end of the reference, if no
delimiter occurs to the right of the prefix). Correspondingly, ‘$home’ expands to the home
directory of that user. Consider, for example, the following statement:
namespace other {
prefix "~";
directory "/var/imap/$user";
}
If the client issues the following statement:
1 LIST "~smith" "%"
Chapter 3: Mailutils Programs 131
then ‘$user’ will expand to the string ‘smith’ and the server will look for all mailboxes in
the directory /var/imap/smith.
The delimiter statement defines the folder hierarchy delimiter for that prefix. It is
optional, the default value being ‘"/"’.
The mailbox-type statement declares the type of the mailboxes within that prefix. If
present, its argument must be a valid mailbox type (e.g. ‘mailbox’, ‘maildir’, or ‘mh’).
The IMAP LIST command will display only mailboxes of that type. The CREATE command
will create mailboxes of that type.
In the absence of the mailbox-type statement, the IMAP LIST command will display
mailboxes of any type supported by Mailutils. The type of newly-created mailboxes is then
determined by the mailbox-type statement (see [mailbox-type], page 21).
Any number of prefix blocks can be present.
Consider, for example, the following configuration:
namespace personal {
prefix "" {
directory "$home/mailfolder";
}
prefix "#MH:" {
directory "$home/Mail";
delimiter "/";
mailbox-type "mh";
}
}
It defines the personal namespace containing two prefixes. The empty prefix is mapped
to the directory mailfolder in the home directory of the currently authenticated user. Any
type of mailboxes is supported within that prefix.
The prefix ‘#MH:’ is mapped to the directory Mail in the home directory of the user, and
is limited to contain only mailboxes in MH format.
Note that if the prefixes ‘""’ is not defined in the personal namespace, the following
default will be automatically created:
prefix "" {
directory "$home";
}
Statement Reference
debug See Section 3.2.6 [debug statement], page 18.
tls See Section 3.2.20 [tls statement], page 41.
tls-file-checks See Section 3.2.21 [tls-file-checks statement],
page 42.
mailbox See Section 3.2.7 [mailbox statement], page 18.
locking See Section 3.2.9 [locking statement], page 22.
132 GNU Mailutils Manual
Statement Reference
debug See Section 3.2.6 [debug statement], page 18.
logging See Section 3.2.5 [logging statement], page 17.
mailbox See Section 3.2.7 [mailbox statement], page 18.
locking See Section 3.2.9 [locking statement], page 22.
acl See Section 3.2.11 [acl statement], page 24.
In the description above, string denotes any sequence of characters. This sequence must
be enclosed in a pair of double-quotes, if it contains whitespace characters. The ‘\’ character
inside a string starts a C escape sequence. Following meta-characters may be used in strings:
$u Expands to username
$h Expands to hostname
$H{name} Expands to value of message header ‘name’.
$B(c,l) Expands to message body. c and l give maximum number of characters and
lines in the expansion. When omitted, they default to 400, 5.
Example I
Dump to the user’s terminal the contents of ‘From’ and ‘Subject’ headers followed by at
most 5 lines of message body.
echo "Mail to \a$u@$h\a\n---\n\
From: $H{from}\n\
Subject: $H{Subject}\n\
---\n\
$B(,5)\
---\n"
The above example can also be written as:
echo Mail to \a$u@$h\a
echo ---
echo From: $H{From}
echo Subject: $H{Subject}
echo ---
echo $B(,5)
echo ---
Example II
Produce a bell, then pop up the xmessage window on display :0.0 with the text formatted
in the same manner as in the previous example.
beep
exec /usr/X11R6/bin/xmessage \
-display :0.0 -timeout 10 "Mail to $u@$h \n---\n\
From: $H{from}\n\
Subject: $H{Subject}\n\
---\n\
$B(,5)\
---\n"
138 GNU Mailutils Manual
inc
• The -moveto option. The -moveto option instructs inc to move messages
into another folder after incorporating them. This option has effect only if
the -truncate option has also been specified and the underlying mailbox
supports the ‘move’ operation. Currently only ‘imap’ and ‘imaps’ mail-
boxes support it. For example, the following command moves incorporated
messages into the ‘archive’ folder:
inc -file imaps://imap.gmail.com -moveto=archive
The ‘moveto’ URL parameter can be used instead of this option, e.g.:
inc -file ’imaps://imap.gmail.com;moveto=archive’
• Multiple sources Mailutils inc is able to incorporate messages from several
source mailboxes. These are specified via multiple -file options, e.g.:
inc -truncate \
-file ’imaps://imap.gmail.com;moveto=archived’ \
-file pops://mail.gnu.org \
-file /var/mail/root
• URL parameters The following additional parameters can be used in the
mailbox URLs supplied with the -file option:
moveto=folder
Moves incorporated messages into another folder. This was
discussed above.
nomoveto Disables the previous -moveto option.
truncate[=bool]
Controls source mailbox truncation. If bool is not given or it is
‘yes’, the mailbox will be truncated after successful processing.
If bool is ‘no’, the source mailbox will not be truncated.
mhl
The ‘ignores’ keyword can be used in variable list. In that case, if its value
contains more than one component name it must be enclosed in double-quotes,
e.g.:
leftadjust,compwidth=9,"ignores=msgid,message-id,received"
The above is equivalent to the following traditional notation:
leftadjust,compwidth=9
ignores=msgid,message-id,received
The ‘MessageName’ component is not yet implemented.
Interactive prompting is not yet implemented.
The following format variables are silently ignored: ‘center’, ‘split’,
‘datefield’.
mhn
• New option New option -compose forces mhn editing mode. This is also the
default mode. This differs from the standard mhn, which switches to the
editing mode only if no other options were given and the input file name
coincides with the value of mhdraft environment variable.
142 GNU Mailutils Manual
prompter
1. Prompter attempts to use GNU Readline library, if it is installed. Con-
sequently, arguments to -erase and -kill option must follow GNU style
key sequence notation (see Section “Readline Init File Syntax” in GNU
Readline Library).
Chapter 3: Mailutils Programs 143
3.20 mailutils
The mailutils utility is a multi-purpose tool shipped with Mailutils. It can be used for
various mail and database-related tasks, as well as an auxiliary tool for compiling and
linking programs with Mailutils.
ldflags Constructs a ld(1) command line for linking a program with Mailutils.
When used without arguments, it outputs ld arguments which would link only with the
core Mailutils library libmailutils, e.g.:
$ mailutils ldflags
-L/usr/local/lib -lmailutils
This command accepts a number of keywords which allow to select a particular subset
of Mailutils libraries to link with. In particular, the argument ‘all’ instructs it to link in
all available libraries:
$ mailutils ldflags all
-L/usr/local/lib -lmu_mbox -lmu_mh -lmu_maildir -lmu_imap -lmu_pop \
-lmu_mailer -lmu_compat -lmailutils -lmu_auth -lgsasl -lgnutls -lgcrypt \
-lldap -lgnuradius -lpam -ldl
Other available keywords are:
mbox Link in the UNIX mbox format support.
mh Link in the MH format support.
maildir Link in the Maildir format support.
imap Link in the IMAP protocol support.
pop Link in the POP protocol support.
mailer Enable support for mailers.
sieve Link in the support for Sieve mail filtering language.
dbm Link in the support for DBM databases (libmu dbm library).
auth Link in the Mailutils authentication library.
guile Provide Guile language bindings.
python Provide Python language bindings.
The output format is controlled by the --format (-c) option. Its argument is the desired
format string, composed of ordinary characters, which are reporduced on standard output
verbatim, backslash sequences, and format specifiers, beginning with ‘%’.
Backslash sequences are interpreted as in C.
A format specifier consists of a leading ‘%’ followed by a letter. Optional ‘:’ may occur
between ‘%’ and the letter. Its presense instructs the program to print the description of
the corresponding value before the value itself.
The following format sequences are understood:
%f Name of the mailbox as supplied in the command line. If mailutils stat was
used without explicit mailbox argument, ‘%f’ is equivalent to ‘%U’.
%t Type of the mailbox (‘mbox’, ‘maildir’, etc.). The description string is ‘type’.
%p Path to the mailbox. In case of remote mailboxes, it is the path part of the
mailbox URL. Description string: ‘path’.
%U URL of the mailbox. Description string: ‘URL’.
%s Size of the mailbox in octets. Description string: ‘size’.
%c Number of messages in the mailbox. Description string: ‘messages’.
%r Number of recent (unread) messages in the mailbox. Description string:
‘recent messages’.
%u Index of the first unseen message. Description string: ‘first unseen’.
%v The UIDVALIDITY value. Description string: ‘uidvalidity’.
%n The UID value which will be assigned to the new message to be incorporated
into the mailbox. Description string: ‘next uid’.
%a Access time of the mailbox, as a number of seconds since the epoch.
%A Access time of the mailbox in human-readable format.
The --newline (-n) option prints an additional newline character after each line of
output.
instead of the default ‘.acl’. For example, to test ACL in section ‘server 213.130.1.232’
of file /etc/pop3d.conf use:
mailutils acl --file=/etc/pop3d.conf \
--path=/server="213.130.1.232"/acl address
As an example of its use, consider file test.conf with the following contents:
acl {
deny from 10.10.10.1;
deny from 10.10.1.0/24;
log from any "Connect from ${address}";
allow from 10.0.0.0/8;
allow from 192.168.1.0/24;
deny from any;
}
Then, running mailutils acl --file=test.conf 127.0.0.1 you will get:
Testing 127.0.0.1:
mailutils: Connect from 127.0.0.1
127.0.0.1: deny
More examples:
$ mailutils acl --file=test.conf 127.0.0.1 10.10.10.1 \
10.10.1.3 10.5.3.1 192.168.1.0 192.168.2.0
Testing 127.0.0.1:
mailutils: Connect from 127.0.0.1
127.0.0.1: deny
Testing 10.10.10.1:
10.10.10.1: deny
Testing 10.10.1.3:
10.10.1.3: deny
Testing 10.5.3.1:
mailutils: Connect from 10.5.3.1
10.5.3.1: accept
Testing 192.168.1.0:
mailutils: Connect from 192.168.1.0
192.168.1.0: accept
Testing 192.168.2.0:
mailutils: Connect from 192.168.2.0
192.168.2.0: accept
The mailutils option --debug-level will give you a deeper insight into the address
matching algorithm:
$ mailutils --debug-level=acl.trace9 acl --file test.conf 127.0.0.1
Testing 127.0.0.1:
mailutils: Checking sockaddr 127.0.0.1
mailutils: 1:deny: Does 10.10.10.1/255.255.255.255 match 127.0.0.1? no;
mailutils: 2:deny: Does 10.10.1.0/255.255.255.0 match 127.0.0.1? no;
mailutils: 3:log: Does any match 127.0.0.1? yes;
mailutils: Expanding "Connect from ${address}";
Chapter 3: Mailutils Programs 151
Mailutils. For example this is how to convert the database file file.db to the GDBM
database new.db:
mailutils dbm dump file.db | mailutils dbm create gdbm://new.db
Both list and dump subcommands share the same set of options. In fact, they are
pretty similar, except that use different defaults. The list subcommand is designed to
produce a human-readable output, whereas the dump subcommand is oriented towards
backup purposes.
Following this header are actual data. Each record is output in two parts: key and value.
Each part begins with a ‘#:len=n’ construct on a line by itself, where n is the length of the
data in decimal. This line is followed by one or more lines of the actual data, encoded in
base64. The data are formatted so that each line does not exceed 76 bytes in length (not
counting the terminating newline). An example of this format follows:
# Database dump file created by GNU Mailutils 2.99.93 on
# Tue Nov 1 13:28:03 2011
#:version=1.0
#:file=users.db
#:uid=0,user=root,gid=25,group=mail,mode=640
#:len=6
c21pdGgA
#:len=9
cEFzc3dvcmQA
#:len=5
cm9vdAA=
#:len=8
Z3Vlc3NtZQA=
#:len=4
cWVkAA==
#:len=7
Zm9vQmFyAA==
The message argument, if supplied, gives the text to log. If not supplied, the utility
reads lines of text from standard input or a file (if the --file option is given) and sends
them to log:
# Send text to log
$ mailutils logger I am here
# Log each line from file.txt
$ mailutils logger --file file.txt
# Read stdin and log it:
$ mailutils logger
The default logging channel is bound to standard error. To bind it to syslog, use the
--syslog command line option. In that case mailutils uses facility ‘user’ and priority
‘err’. You can change this by using the --priority (-p) option. Its argument is either
a syslog facility name or facility and severity names separated by a dot. For example, the
following invocation will use facility ‘auth’, severity ‘info’:
mailutils logger --priority auth.info
The syslog tag can be set using the --tag (-t) option:
mailutils logger --tag myprog
The default tag is ‘mu-logger’.
The --severity (-s) option sets the Mailutils severity level. Its argument can be any
of the following: ‘debug’, ‘info’, ‘notice’, ‘warning’, ‘error’, ‘crit’, ‘alert’, ‘emerg’.
Finally, the --locus (-l) option binds log messages to a location in a file. Its argument
has the following syntax:
file:line[:col]
where file is the file name, line is the line number and optional col is the column number
in that file.
For example, the following invocation:
mailutils logger --locus mailutils.conf:34 Suspicious statement
will send the following to the log:
mu-logger: mailutils.conf:34: Suspicious statement
command uses port 110 for a plain POP connection or 995 for POPS (if -tls
is given).
stls Start TLS negotiation. This command is valid only after successful unencrypted
connection has been initiated (using connect without -tls argument).
user name Send user name to the server. The pass command must follow.
pass [password]
Send password. This command is valid only after user. If the password argu-
ment is omitted, the shell will ask you to enter it. While entering, both echoing
and history recording will be disabled. Use this to avoid compromising your
password.
apop user [password]
Authenticate with APOP. If the password argument is omitted, you will be
asked to supply it. While entering, both echoing and history recording will be
disabled.
capa [-reread] [name...]
List server capabilities. Any number of arguments is accepted. If given, the
shell will display only the named capabilities, otherwise it displays entire list.
By default capa reuses the response of its previous invocation (if there was
any), instead of resending the ‘CAPA’ command to the server. To force it do so,
use the -reread option.
noop Send a ‘NOOP’ (no operation) command to the server.
stat Get the mailbox size and number of messages in it.
uidl [number]
Shows unique message identifiers. Without arguments, shows identifiers for
each message in the mailbox. If number is given, the command returns the
UIDL of that particular message only.
list [number]
Lists messages. See above for the meaning of number. Each line of the produced
listing contains describes a single message and contains at least the message
number and size in bytes. Depending on the POP3 server implementation,
additional fields may be present. For example, Mailutils pop3d can also output
number of lines in the message in the additional third field.
retr number
Retrieve a message.
top msgno [number]
Display message headers and first number (default 5) of lines of its body.
dele number
Mark message for deletion.
rset Remove deletion marks.
quit Quit pop3 session.
disconnect Close existing connection.
158 GNU Mailutils Manual
Internal commands
verbose [on|off|mask|unmask] [secure [payload]]
Control output verbosity. Without arguments the verbose command shows
current settings.
The argument ‘off’ (the default) turns off all additional output. The ‘verbose
on’ command enables POP3 protocol tracing output. Additional arguments can
be used to provide more verbosity. The ‘secure’ argument enables display of
user passwords in the trace output and the ‘payload’ argument enables showing
payload data (e.g. response body sent in the reply to ‘RETR’ command, etc.)
Thus, the full diagnostics output is obtained by
verbose on secure payload
The ‘mask’ and ‘unmask’ arguments allow to disable and enable such additional
verbosity. For example, supposing the command above is in action, the follow-
ing command will suppress the display of user passwords in the traces:
verbose mask secure
Similarly, verbose unmask secure will turn it back again.
prompt string
Set command prompt. The argument can contain variable references in any of
the following forms:
$name
${name}
where name is the variable name. Such references are expanded to the actual
value of the variable at the time of expansion. The following variables are
defined:
Variable Expansion
user Login name of the authenticated POP3 user. If
the session is not authenticated yet, expands to
‘[nouser]’.
host Name of the remote host, or ‘[nohost]’ if no con-
nection is established.
program-name Name of the program, as typed on the command line
to invoke it.
canonical-program-name ‘mailutils’
package ‘Mailutils’
version Mailutils version number (3.14)
status Session status. One of: ‘disconnected’,
‘connected’ or ‘logged in’.
For example:
prompt "[${user}@$host "
Notice the use of quotes to include the space character in the prompt.
exit Exit the program.
Chapter 3: Mailutils Programs 159
help [command]
? [command]
Without arguments displays a list of commands with possible arguments and
short descriptions.
With one argument, displays a terse description for the given command.
history Shows command history.
Internal commands
The imap shell implements the same set of internal commands as pop shell: See
Section 3.20.14 [mailutils pop], page 156. There is only one imap-specific internal
command:
Initializing connection
connect [-tls] host [port] [smtp command]
Connects to SMTP server at host (IP address or host name). If the -tls option is
given, TLS encryption (also known as SMTPS protocol) will be used. The default port
number is 25 for plain SMTP and 465 for SMTPS. Explicit port argument overrides
the default value.
Connection parameters
A number of parameters is associated with an open connection:
domain Domain name used in EHLO statement. Defaults to the current host name.
The following parameters are used for ESMTP authentication:
username User name.
password User password.
service GSASL service name.
realm Realm name.
host Host name.
url SMTP URL. It can contain all of the above. Default is smtp://
These parameters are manipulated using the following statements:
set param value [param value...] [smtp command]
Sets parameter param to value. Several parameters can be set with one set statement.
clear [param...] [smtp command]
Unset the supplied connection parameters. If used without arguments, unsets all
parameters.
list [param...] [smtp command]
Lists the values of the connection parameters. If used without arguments, lists all
parameters.
SMTP commands
ehlo [domain] [smtp command]
Sends the ESMTP greeting. Unless domain is supplied, the connection parameter
‘domain’ is used.
capa [name...] [smtp command]
Lists the server capabilities.
Chapter 3: Mailutils Programs 163
Internal commands
Internal commands are the same as in pop shell: See Section 3.20.14 [mailutils pop],
page 156.
affected by the two problems described above, it fixes the mailbox on the fly. This process
is completely transparent to the user.
If you operate a site with a large number of mailboxes in ‘maildir’ formats, you may
choose to fix up all of them at once. That’s what the maildir_fixup command is for. It
takes one or more directory names as its arguments and recursively scans these directories in
search for ‘maildir’ mailboxes. Each mailbox found is analyzed and a fix-up is performed,
if necessary. If a mailbox is already in the new format, it remains untouched.
The following options modify the program’s behavior:
-v
--verbose
List each maildir name before processing it.
-n
--dry-run
Don’t touch maildirs, just print their names,
The maildir_fixup tool reads main mailutils configuration file by default. It looks for
program-specific settings in the section ‘program maildir_fixup’. If the include state-
ment is present that has a directory name as its argument, the file maildir_fixup is looked
up in that directory and parsed, if present.
The program uses the following configuration statements:
Statement Reference
debug See Section 3.2.6 [debug statement], page 18.
locking See Section 3.2.9 [locking statement], page 22.
mandatory-locking See mandatory-locking statement.
Chapter 3: Mailutils Programs 165
3.21 dotlock
A stand-alone mailbox-locking utility. It is the default program used by mailutils if
the locking.type configuration statement is set to external (see [external locking type],
page 23).
The program usage syntax is:
# To lock mbox:
dotlock options mbox
# To unlock it:
dotlock -u options mbox
By default the program implements the ‘dotlock’ locking (see [dotlock locking type],
page 23). This can be changed either in the configuration file, or via the command line
options.
The following common configuration statements affect the behavior of dotlock:
Statement Reference
debug See [Debug Statement], page 18.
locking See [Locking Statement], page 22.
The program understands the following command line options:
-d
--debug Print details of failure reasons to stderr.
-f[n]
--force[=n]
If a lock file exists and is more than n minutes old, forcibly remove it and re-lock
the mailbox. Default n is 10 minutes.
-p
--pid-check
Check if the PID of lock owner is still active. If not, break the lock.
-r n
--retry=n
Number of times to retry acquiring the lock, if it is held by another process.
The default is 10 times.
-t n
--delay=n
Sets delay in seconds between two successive locking attempts. The default is
1 second.
-u
--unlock Unlock the mailbox.
167
4 Mailutils Libraries
===========================================================
Editor’s note:
This node is to be written.
===========================================================
169
5 Sieve Language
The input language understood by the GNU Sieve Library is a superset of the Sieve language
as described in RFC 3028.
Lexical Tokens
The basic lexical entities are identifiers and literals.
An identifier is a sequence of letters, digits and underscores, that begins with a letter or
underscore. For example, header and check_822_again are valid identifiers, whereas 1st
is not. A special form of identifier is tag: it is an identifier prefixed with a colon (‘:’), e.g.:
:comparator.
A literal is a data that is not executed, merely evaluated “as is”, to be used as arguments
to commands. There are four kinds of literals:
• Number
Numbers are given as ordinary unsigned decimal numbers. An optional suffix may be
used to indicate a multiple of a power of two. The suffixes are: ‘K’ specifying “kibi-”, or
1,024 (2^10) times the value of the number; ‘M’ specifying “mebi-”, or 1,048,576 (2^20)
times the value of the number; and ‘G’ specifying “tebi-”, or 1,073,741,824 (2^30) times
the value of the number.
The numbers have 32 bits of magnitude.
• String A string is any sequence of characters enclosed in double quotes (‘"’). A string
cannot contain newlines and double quote characters. This limitation will disappear in
future releases.
• Multiline Strings A multiline string is used to represent large blocks of text with em-
bedded newlines and special characters. It starts with the keyword text: followed by
170 GNU Mailutils Manual
a newline and ends with a dot (‘.’) on a newline by itself. Any characters between
these two markers are taken verbatim. For example:
text:
** This is an automatic response from my message **
** filtering program. **
Regards,
Fred
.
Notice that a hashed comment or whitespace may occur between text: and the new-
line. However, when used inside the multiline string a hash sign looses its special
meaning (except in one case, see below) and is taken as is, as well as bracketed com-
ment delimiters. In other words, no comments are allowed within a multiline string.
E.g.:
text: # This is a comment
Sample text
# This line is taken verbatim
/* And this line too */
.
The only exception to this rule is that preprocessor include statement is expanded as
usual when found within a multiline string (see Section 5.3 [Preprocessor], page 173),
e.g.:
text:
#include <myresponse.txt>
.
This results in the contents of file myresponse.txt being read and interpreted as the
contents of the multiline string.
GNU libmu sieve extends the described syntax as follows. If the keyword text: is
immediately followed by a dash (‘-’), then all leading tab characters are stripped from
input lines and the line containing delimiter (‘.’). This allows multiline strings within
scripts to be indented in a natural fashion.
Furthermore, if the text: (optionally followed by ‘-’) is immediately followed by a
word, this word will be used as ending delimiter of multiline string instead of the
default dot. For example:
if header "from" "[email protected]"
{
reject text:-EOT
I do not accept messages from
this address.
.
.
EOT
# Notice that this the multiline string ends here.
# The single dots above will be part of it.
;
}
Chapter 5: Sieve Language 171
• String Lists
A string list is a comma-delimited list of quoted strings, enclosed in a pair of square
brackets, e.g.:
["[email protected]", "[email protected]"]
For convenience, in any context where a list of strings is appropriate, a single string
is allowed without being a member of a list: it is equivalent to a list with a single
member. For example, the following two statements are equivalent:
exists "To";
exists ["To"];
5.2 Syntax
Being designed for the sole purpose of filtering mail, Sieve has a very simple syntax.
5.2.1 Commands
The basic syntax element is a command. It is defined as follows:
command-name [tags] args
where command-name is an identifier representing the name of the command, tags is an
optional list of optional or tagged arguments and args is a list of required or positional
arguments.
Positional arguments are literals delimited with whitespace. They provide the command
with the information necessary to its proper functioning. Each command has a fixed number
of positional arguments. It is an error to supply more arguments to the command or to
give it fewer arguments than it accepts.
Optional arguments allow to modify the behaviour of the command, like command line
options in UNIX do. They are a list of tags (see Section 5.1 [Lexical Structure], page 169)
separated by whitespace. An optional argument may have at most one parameter.
Each command understands a set of optional arguments. Supplying it tags that it does
not understand results in an error.
For example, consider the following command
header :mime :comparator "i;octet" ["to", "from"] "[email protected]"
Here, given that header takes two positional arguments: header is command name, the list
["to", "from"] is first positional argument and the string "[email protected]" is
second positional argument. There are two optional arguments: :mime and :comparator.
The latter has a string "i;octet" as its parameter.
fileinto "mbox";
GNU Sieve provides the full set of actions described in RFC 3028. It also allows to
extend this set using loadable actions. See Section 5.7 [Actions], page 182, for detailed
discussion of actions.
172 GNU Mailutils Manual
discard;
}
5.3 Preprocessor
Preprocessor statements are a GNU extension to the Sieve language. The syntax for a
preprocessor statement is similar to that used in C programming language, i.e. a pound
character (‘#’) followed by a preprocessor directive and its arguments. Any amount of white-
space can be inserted between the ‘#’ and the directive. Currently implemented directives
are include and searchpath.
• keep
• discard
• i;octet
• i;ascii-casemap
Example:
require ["fileinto", "reject"];
require "fileinto";
require "comparator-i;ascii-numeric";
When processing arguments for require statement, GNU libmu sieve uses the following
algorithm:
1. Look up the name in a symbol table. If the name begins with ‘comparator-’ it is
looked up in the comparator table. If it begins with ‘test-’, the test table is used
instead. Otherwise the name is looked up in the action table.
2. If the name is found, the search is terminated.
3. Otherwise, transform the name. First, any ‘comparator-’ or ‘test-’ prefix is stripped.
Then, any character other than alphanumeric characters, ‘.’ and ‘,’ is replaced with
dash (‘-’). The name thus obtained is used as a file name of an external loadable
module.
4. Try to load the module. The module is searched in the following search paths (in the
order given):
1. Mailutils module directory. By default it is $prefix/lib/mailutils.
2. Sieve library path as given with the -L options in the command line
3. Additional search directories specified with the #searchpath directive.
4. The value of the environment variable LTDL_LIBRARY_PATH.
5. System library search path: The system dependent library search path (e.g. on
Linux it is set by the contents of the file /etc/ld.so.conf and the value of the
environment variable LD_LIBRARY_PATH).
The value of LTDL_LIBRARY_PATH and LD_LIBRARY_PATH must be a colon-separated list
of absolute directories, for example, ‘"/usr/lib/mypkg:/lib/foo"’.
In any of these directories, libmu_sieve first attempts to find and load the given
filename. If this fails, it tries to append the following suffixes to the file name:
1. the libtool archive extension ‘.la’
2. the extension used for native dynamic libraries on the host platform, e.g., ‘.so’,
‘.sl’, etc.
5. If the module is found, libmu_sieve executes its initialization function (see below) and
again looks up the name in the symbol table. If found, search terminates successfully.
6. If either the module is not found, or the symbol wasn’t found after execution of the
module initialization function, search is terminated with an error status. libmu_sieve
then issues the following diagnostic message:
source for the required action NAME is not available
Chapter 5: Sieve Language 175
5.5 Comparators
GNU libmu sieve supports the following built-in comparators:
i;octet This comparator simply compares the two arguments octet by octet
i;ascii-casemap
It treats uppercase and lowercase characters in the ascii subset of utf-8 as the
same. This is the default comparator.
i;ascii-numeric
Treats the two arguments as ascii representation of decimal numbers and com-
pares their numeric values. This comparator must be explicitly required prior
to use.
5.6 Tests
This section describes the built-in tests supported by GNU libmu sieve. In the discussion
below the following macro-notations are used:
match-type
This tag specifies the matching type to be used with the test. It can be one of
the following:
:is The :is match type describes an absolute match; if the contents
of the first string are absolutely the same as the contents of the
second string, they match. Only the string “frobnitzm” is the string
“frobnitzm”. The null key “:is” and only “:is” the null value. This
is the default match-type.
:contains
The :contains match type describes a substring match. If the
value argument contains the key argument as a substring, the match
is true. For instance, the string “frobnitzm” contains “frob” and
“nit”, but not “fbm”. The null key “” is contained in all values.
:matches The :matches version specifies a wildcard match using the char-
acters ‘*’ and ‘?’. ‘*’ matches zero or more characters, and ‘?’
matches a single character. ‘?’ and ‘*’ may be escaped as ‘\\?’ and
‘\\*’ in strings to match against themselves. The first backslash
escapes the second backslash; together, they escape the ‘*’.
:regex The :regex version specifies a match using POSIX Extended Reg-
ular Expressions.
:value relation
The :value match type does a relational comparison between
strings. Valid values for relation are:
"eq" Equal
"ne" Not Equal
"gt" Greater Than
176 GNU Mailutils Manual
address-part
This syntax item is used when testing structured Internet addresses. It specifies
which part of an address must be used in comparisons. Exactly one of the
following tags may be used:
:all Use the whole address. This is the default.
:localpart
Use local part of the address.
:domain Use domain part of the address.
Notice, that match-type modifiers interact with comparators. Some comparators are
not suitable for matching with :contains or :matches. If this occurs, sieve issues an
appropriate error message. For example, the statement:
if header :matches :comparator "i;ascii-numeric"
would result in the following error message:
comparator ‘i;ascii-numeric’ is incompatible with match type ‘:matches’
in call to ‘header’
GNU Sieve supports two kinds of tests. Built-in tests are defined within the library and
do not require any external files. External tests are loadable modules that can be linked in
at run time using the require statement (see Section 5.4 [Require Statement], page 173).
The address test matches Internet addresses in structured headers that contain ad-
dresses. It returns true if any header contains any key in the specified part of the
address, as modified by comparator and match-type optional arguments.
This test returns true if any combination of the header-names and key-list arguments
match.
The address primitive never acts on the phrase part of an email address, nor on
comments within that address. Use the header test instead. It also never acts on
group names, although it does act on the addresses within the group construct.
Example:
if address :is :all "from" "[email protected]"
{
discard;
}
Otherwise, the test is true only if the size of the message equals exactly number. This
is a GNU extension.
The size of a message is defined to be the number of octets from the initial header
until the last character in the message body.
The envelope test is true if the specified part of the smtp envelope matches the
specified key.
If the envelope-part strings is (case insensitive) ‘from’, then matching occurs against
the FROM address used in the SMTP MAIL command.
Notice, that due to the limitations imposed by smtp envelope structure the use of
any other values in envelope-parts header is meaningless.
The exists test is true if the headers listed in header-names argument exist within
the message. All of the headers must exist or the test is false.
The following example throws out mail that doesn’t have a From header and a Date
header:
if not exists ["From","Date"]
{
discard;
}
Chapter 5: Sieve Language 179
Tagged arguments:
comparator
Specifies the comparator to be used instead of the default
i;ascii-casemap.
match-type
Specifies the match type to be used instead of the default :is.
:mime This tag instructs header to search through the mime headers in multi-
part messages as well.
Required arguments:
header-names
A list of header names.
key-list A list of header values.
The header test evaluates to true if any header name matches any key. The type
of match is specified by the optional match argument, which defaults to ":is" if not
explicitly given.
The test returns true if any combination of the header-names and key-list arguments
match.
If a header listed in header-names exists, it contains the null key (‘""’). However, if
the named header is not present, it does not contain the null key. So if a message
contained the header
X-Caffeine: C8H10N4O2
Synopsis:
require "test-numaddr";
...
if numaddr args
{
...
}
The numaddr test counts Internet addresses in structured headers that contain ad-
dresses. It returns true if the total number of addresses satisfies the requested relation.
If the tagged argument is ‘:over’ and the number of addresses is greater than count,
the test is true; otherwise, it is false.
If the tagged argument is ‘:under’ and the number of addresses is less than count,
the test is true; otherwise, it is false.
If the tagged argument is not given, ‘:over’ is assumed.
Synopsis:
require "test-pipe";
if pipe command
{
...
}
Description: The pipe test executes a shell command specified by its argument and
pipes the entire message (including envelope) to its standard input. When given, tags
:envelope, :header, and :body control what parts of the message to pipe to the
command.
In the absence of the :exit tag, the test returns true if the command exits with code
0. If :exit is given, the test returns true if the command exits with code equal to its
argument.
The :signal tag determines the result of the test in case if the program exits on
signal. By default, the test returns false. If :signal is given and the number of
signal which caused the program to terminate matches its argument, the test returns
true.
Synopsis:
require "test-spamd";
...
if spamd args
{
# This is spam
...
}
of a floating point number. If the tag :over is used, then the test returns true if the
spam score returned from SpamAssassin is greater than limit. Otherwise, if :under is
used, the test returns true if the spam score is less than limit. The comparison takes
into account three decimal digits.
Tagged argument :user allows to select a specific user profile. If it is not given, the
user name is determined using the effective UID.
Before returning, the spamd test adds the following headers to the message:
X-Spamd-Status
‘YES’ or ‘NO’, depending on whether the message is qualified as spam or
ham.
X-Spamd-Score
Actual spam score value.
X-Spamd-Threshold
Spam score threshold, as configured in SpamAssassin settings.
X-Spamd-Keywords
Comma-separated list of keywords, describing the spam checks that suc-
ceeded for this message.
Example:
request "test-spamd";
Synopsis:
require "test-list";
if list args
{
...
}
Description: The list test evaluates to true if any of headers matches any key from
keys. Each header is regarded as containing a list of keywords. By default, comma
is assumed as list separator. This can be overridden by specifying the :delim tag,
whose value is a string consisting of valid list delimiter characters.
Example:
This test can be used in conjunction with the spamd test described above:
require ["fileinto", "test-spamd", "test-list"];
{
fileinto "~/mail/spam";
}
else
{
discard;
}
}
Synopsis:
require "test-timestamp";
if timestamp arg
{
...
}
Description: The timestamp test compares the value of a structured date header field
(header) with the given date (date).
If the tagged argument is :after and the date from the header is after the specified
date the result is true, otherwise, if the header date is before the given date, the result
is false.
If the tagged argument is :before and the date from the header is before the specified
date the result is true, otherwise, if the header date is after the given date, the result
is false.
If no tagged argument is supplied, :after is assumed.
Almost any date format is understood. See Appendix B [Date Input Formats],
page 203, for a detailed information on date formats.
Example:
The test below succeeds if the date in ‘X-Expire-Timestamp’ header is more than 5
days older than the current date:
require "test-timestamp";
5.7 Actions
There are two groups of GNU Sieve actions: built-in actions, which are defined within the
library, and external actions, i.e. loadable modules that can be linked in at run time using
the require statement (see Section 5.4 [Require Statement], page 173).
• keep
• discard
• fileinto
• reject
• redirect
Among them the first three actions do not need to be explicitly required by a require
statement, while the others do.
These actions are described in detail below.
stop [Action]
The stop action ends all processing. If no actions have been executed, then the keep
action is taken.
keep [Action]
The effect of this action is to preserve the current message in the mailbox. This action
is executed if no other action has been executed.
discard [Action]
Discard silently throws away the current message. No notification is returned to the
sender, the message is deleted from the mailbox.
Example:
if header :contains ["from"] ["[email protected]"]
{
discard;
}
For example, the following instruction creates the mailbox ~/shared which will be
world readable and writable for the group:
fileinto :permissions "g=rw,o=r" "~/shared"
Notice that:
1. The :permissions setting are affected by the current umask value.
2. Only r and w permissions can be set, since other permissions do not seem to
be useful for mailboxes. However, for mailboxes that have a directory structure
(such as maildir and MH), any settings in ‘g’ and ‘o’ sets imply setting the
executable bit.
3. Owner’s permissions cannot be set. The owner always has all permissions on the
mailbox he created.
4. The :permissions settings apply only to local mailboxes. They are ignored for
remote mailboxes.
birdseed, either!
----- =_aaaaaaaaaa0
Content-Type: message/delivery-status
----- =_aaaaaaaaaa0
Content-Type: message/rfc822
From: [email protected]
To: [email protected]
Subject: I have a present for you
Synopsis:
186 GNU Mailutils Manual
require "moderator"
moderator args;
N Content-Type Description
1 text/plain Introduction for the human
reader.
2 message/rfc822 Original submission.
3 message/rfc822 Mailman control message.
Replying to part 3 (keeping the subject intact) instructs Mailman to discard the
original submission.
Replying to part 3 while adding an ‘Approved:’ header with the list password in it
approves the submission.
The moderator action spawns an inferior Sieve machine and filters the original sub-
mission (part 2) through it. If the inferior machine marks the message as deleted,
the action replies to the control message, thereby causing the submission to be dis-
carded. The ‘From:’ address of the reply can be modified using :address tag. After
discarding the message, moderator marks it as deleted, unless it is given :keep tag.
If the :source tag is given, its argument specifies a Sieve source file to be used on
the message. Otherwise, if :program is given, its argument supplies a Sieve program
to be used on this message. At most one of these tags may be specified. Supplying
them both, or supplying several instances of the same tag, is an error. The behavior
of the action in this case is undefined.
If neither :program nor :source is given, moderator will create a copy of the existing
Sieve machine and use it on the message.
The action checks the message structure: it will bail out if the message does not have
exactly 3 MIME parts, or if parts 2 and 3 are not of ‘message/rfc822’ type. It is
the responsibility of the caller to make sure the message is actually a valid Mailman
moderation request (see the example below).
Example:
if allof(header :is "Sender" "[email protected]",
header :is "X-List-Administrivia" "yes")
{
moderator :source "~/.sieve/mailman.sv";
}
Synopsis:
require "pipe";
pipe command
Chapter 5: Sieve Language 187
Description: The pipe action executes a shell command specified by its argument
and pipes the entire message (including envelope) to its standard input. When given,
tags :envelope, :header, and :body control what parts of the message to pipe to
the command.
Example: The example below uses the putmail utility (see Section 3.14 [putmail],
page 120) to forward the message to user ‘gray’ on the machine ‘mail.gnu.org’.
require "pipe";
Syntax:
require "vacation";
vacation args;
Description: The vacation action returns a message with text to the sender. It is
intended to inform the sender that the recipient is not currently reading his mail.
If the :file tag is present, text is treated as the name of the file to read the body
of the reply message from. When used together with tag :rfc2822, the file should
be formatted as a valid RFC 2822 message, i.e. headers followed by empty line and
body. Headers may not contain ‘To’, ‘From’, and ‘Subject’, as these will be generated
automatically.
If the :subject tag is given, its argument sets the subject of the message. Otherwise,
the subject is formed by prefixing original subject with ‘Re:’, or the prefix given with
the :reply_prefix tag. Before prefixing, any original prefixes matching extended
regular expression expr (:reply_regex tag) are stripped from the subject line. If
:reply_regex is not specified, the default regexp is ‘^re: *’.
Another headers can be added using the :header tag. Its argument is a list of header
strings, each one having the form ‘"name:value"’. Additional whitespace is allowed
on both sides of the colon.
The :aliases tag instructs vacation to handle messages for any address in addrlist
in the same manner as those received for the user’s principal email.
Before processing, vacation compares the sender address with its address exclusion
list. Elements of this list are extended case-insensitive regular expressions. If the
sender address matches any of these expressions, the message will not be replied. The
default exclusion list is:
.*-REQUEST@.*
.*-RELAY@.*
188 GNU Mailutils Manual
.*-OWNER@.*
^OWNER-.*
^postmaster@.*
^UUCP@.*
^MAILER@.*
^MAILER-DAEMON@.*
New entries can be added to this list using :noreply tag.
The :days tag sets the reply interval. A reply is sent to each sender once in ndays
days. GNU Sieve keeps track of sender addresses and dates in file .vacation stored
in the user’s home directory. The file name can be changed using the :database tag.
The tag :always_reply instructs vacation to respond to the message regardless of
whether the user email is listed as a recipient for the message.
5.8 Extensions
The following extensions are implemented
The sequence
${unicode: HEXNUM}
where HEXNUM is a list of hexadecimal numbers separated with whitespace, will be re-
placed by the UTF-8 encoding of the specified Unicode characters, which are identified by
the hexadecimal value of HEXNUM. For example, the following string represents a single
‘@’ sign:
"${UNICODE:40}"
Similarly to ‘hex:’, the ‘unicode:’ indicator is case insensitive. The following examples
demonstrate the handling of several valid and invalid encodings:
"${unicode:40}" ⇒ "@"
"${ unicode:40}" ⇒ "${ unicode:40}"
"${UNICODE:40}" ⇒ "@"
"${UnICoDE:0000040}" ⇒ "@"
"${Unicode:40}" ⇒ "@"
"${Unicode:Cool}" ⇒ "${Unicode:Cool}"
"${unicode:200000}" ⇒ error
"${Unicode:DF01} ⇒ error
precedence modifiers
40 :lower or :upper
30 :lowerfirst or :upperfirst
20 :quotewildcard
10 :length
Modifiers having the same precedence (i.e. listed on the same row in the above table)
cannot be used together.
Variables are referenced within text strings using the construct ‘${name}’, where name
is the name of the variable as it appeared in the first parameter to the set statement. For
example:
require "variables";
Chapter 5: Sieve Language 191
5.8.4 environment
The ‘environment’ extension complies with RFC 5183. It is a built-in extension. It intro-
duces the following test:
Utility Location
sieve ‘"MUA"’, or set with the
--environment option.
maidag ‘"MDA"’
inc ‘"MUA"’
name The string ‘GNU Mailutils’
phase The point relative to final delivery where the Sieve script is being evaluated.
Depending on the utility that is evaluating the script it is:
Utility Location
sieve ‘post’ unless set with the
--environment option.
maidag ‘"during"’
inc ‘"post"’
version Mailutils version string (e.g. ‘3.14’).
4. size test
The size test allows to omit the optional argument (:over|:under). In this case exact
equality is assumed.
5. envelope test
The only value that can be meaningfully used as the first required argument of an
envelope test is ‘from’. This limitation may disappear from the subsequent releases.
6. fileinto action
The fileinto action allows to specify permissions on the mailbox, in case it will be
created (see [fileinto], page 183).
7. Match type optional argument.
Along with the usual :is, :matches and :contains matching type, GNU sieve li-
brary understands :regex type. This matching type toggles POSIX Extended Regular
Expression matching.
195
6 Reporting Bugs
Email bug reports to [email protected].
As the purpose of bug reporting is to improve software, please be sure to include maxi-
mum information when reporting a bug. The information needed is:
• Version of the package you are using.
• Compilation options used when configuring the package.
• Conditions under which the bug appears.
The archives of bug-mailutils mailing list are available from http://mail.gnu.org/
mailman/listinfo/bug-mailutils.
197
8 Acknowledgement
In no particular order,
• Jakob Kaivo [email protected],
• Jeff Bailey [email protected],
• Sean Perry [email protected],
• Thomas Fletcher [email protected],
• Dave Inglis [email protected],
• Brian Edmond [email protected],
• Sam Roberts [email protected],
• Sergey Poznyakoff [email protected],
• François Pinard [email protected].
• Jordi Mallach [email protected]
• Wojciech Polak [email protected]
201
Appendix A References
===========================================================
Editor’s note:
This node is to be written.
===========================================================
203
When a month is written this way, it is still considered to be written numerically, instead
of being “spelled in full”; this changes the allowed strings.
In the current implementation, only English is supported for words and abbreviations
like ‘AM’, ‘DST’, ‘EST’, ‘first’, ‘January’, ‘Sunday’, ‘tomorrow’, and ‘year’.
The output of the date command is not always acceptable as a date string, not only
because of the language problem, but also because there is no standard meaning for time
zone items like ‘IST’. When using date to generate a date string intended to be parsed
later, specify a date format that is independent of language and that does not use time zone
items other than ‘UTC’ and ‘Z’. Here are some ways to do this:
$ LC_ALL=C TZ=UTC0 date
Mon Mar 1 00:21:42 UTC 2004
$ TZ=UTC0 date +’%Y-%m-%d %H:%M:%SZ’
2004-03-01 00:21:42Z
$ date --iso-8601=ns | tr T ’ ’ # --iso-8601 is a GNU extension.
2004-02-29 16:21:42,692722128-0800
$ date --rfc-2822 # a GNU extension
Sun, 29 Feb 2004 16:21:42 -0800
$ date +’%Y-%m-%d %H:%M:%S %z’ # %z is a GNU extension.
2004-02-29 16:21:42 -0800
$ date +’@%s.%N’ # %s and %N are GNU extensions.
@1078100502.692722128
Alphabetic case is completely ignored in dates. Comments may be introduced between
round parentheses, as long as included parentheses are properly nested. Hyphens not fol-
lowed by a digit are currently ignored. Leading zeros on numbers are ignored.
Invalid dates like ‘2005-02-29’ or times like ‘24:00’ are rejected. In the typical case
of a host that does not support leap seconds, a time like ‘23:59:60’ is rejected even if it
corresponds to a valid leap second.
9/24
sep 24
Here are the rules.
For numeric months, the iso 8601 format ‘year-month-day’ is allowed, where year is
any positive number, month is a number between 01 and 12, and day is a number between
01 and 31. A leading zero must be present if a number is less than ten. If year is 68 or
smaller, then 2000 is added to it; otherwise, if year is less than 100, then 1900 is added
to it. The construct ‘month/day/year’, popular in the United States, is accepted. Also
‘month/day’, omitting the year.
Literal months may be spelled out in full: ‘January’, ‘February’, ‘March’, ‘April’, ‘May’,
‘June’, ‘July’, ‘August’, ‘September’, ‘October’, ‘November’ or ‘December’. Literal months
may be abbreviated to their first three letters, possibly followed by an abbreviating dot. It
is also permitted to write ‘Sept’ instead of ‘September’.
When months are written literally, the calendar date may be given as any of the following:
day month year
day month
month day year
day-month-year
Or, omitting the year:
month day
Coordinated Universal Time (utc), overriding any previous specification for the time zone
or the local time zone. For example, ‘+0530’ and ‘+05:30’ both stand for the time zone 5.5
hours ahead of utc (e.g., India). This is the best way to specify a time zone correction by
fractional parts of an hour. The maximum zone correction is 24 hours.
Either ‘am’/‘pm’ or a time zone correction may be specified, but not both.
duration. More precise units are ‘fortnight’ which is worth 14 days, ‘week’ worth 7 days,
‘day’ worth 24 hours, ‘hour’ worth 60 minutes, ‘minute’ or ‘min’ worth 60 seconds, and
‘second’ or ‘sec’ worth one second. An ‘s’ suffix on these units is accepted and ignored.
The unit of time may be preceded by a multiplier, given as an optionally signed number.
Unsigned numbers are taken as positively signed. No number at all implies 1 for a multiplier.
Following a relative item by the string ‘ago’ is equivalent to preceding the unit by a multiplier
with value −1.
The string ‘tomorrow’ is worth one day in the future (equivalent to ‘day’), the string
‘yesterday’ is worth one day in the past (equivalent to ‘day ago’).
The strings ‘now’ or ‘today’ are relative items corresponding to zero-valued time dis-
placement, these strings come from the fact a zero-valued time displacement represents the
current time when not otherwise changed by previous items. They may be used to stress
other items, like in ‘12:00 today’. The string ‘this’ also has the meaning of a zero-valued
time displacement, but is preferred in date strings like ‘this thursday’.
When a relative item causes the resulting date to cross a boundary where the clocks
were adjusted, typically for daylight saving time, the resulting date and time are adjusted
accordingly.
The fuzz in units can cause problems with relative items. For example, ‘2003-07-31 -1
month’ might evaluate to 2003-07-01, because 2003-06-31 is an invalid date. To determine
the previous month more reliably, you can ask for the month before the 15th of the current
month. For example:
$ date -R
Thu, 31 Jul 2003 13:02:39 -0700
$ date --date=’-1 month’ +’Last month was %B?’
Last month was July?
$ date --date="$(date +%Y-%m-15) -1 month" +’Last month was %B!’
Last month was June!
Also, take care when manipulating dates around clock changes such as daylight saving
leaps. In a few cases these have added or subtracted as much as 24 hours from the clock,
so it is often wise to adopt universal time by setting the TZ environment variable to ‘UTC0’
before embarking on calendrical calculations.
have your own private time zone, or if you are using a non-GNU host that does not support
the ‘tz’ database, you may need to use a POSIX rule instead. Simple POSIX rules like
‘UTC0’ specify a time zone without daylight saving time; other rules can specify simple
daylight saving regimes. See Section “Specifying the Time Zone with TZ” in The GNU C
Library.
%D Equivalent to ‘%m/%d/%y’.
%g Like ‘%G’, but without century, i.e., with a 2-digit year (00-99).
%h Equivalent to ‘%b’.
212 GNU Mailutils Manual
%n A newline character.
%t A tab character.
Notice, that the description starts on a separate line if opt-doc-col value is too
small.
217
under this License. If a section does not fit the above definition of Secondary then it is
not allowed to be designated as Invariant. The Document may contain zero Invariant
Sections. If the Document does not identify any Invariant Sections then there are none.
The “Cover Texts” are certain short passages of text that are listed, as Front-Cover
Texts or Back-Cover Texts, in the notice that says that the Document is released under
this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may
be at most 25 words.
A “Transparent” copy of the Document means a machine-readable copy, represented
in a format whose specification is available to the general public, that is suitable for
revising the document straightforwardly with generic text editors or (for images com-
posed of pixels) generic paint programs or (for drawings) some widely available drawing
editor, and that is suitable for input to text formatters or for automatic translation to
a variety of formats suitable for input to text formatters. A copy made in an otherwise
Transparent file format whose markup, or absence of markup, has been arranged to
thwart or discourage subsequent modification by readers is not Transparent. An image
format is not Transparent if used for any substantial amount of text. A copy that is
not “Transparent” is called “Opaque”.
Examples of suitable formats for Transparent copies include plain ascii without
markup, Texinfo input format, LaTEX input format, SGML or XML using a publicly
available DTD, and standard-conforming simple HTML, PostScript or PDF designed
for human modification. Examples of transparent image formats include PNG, XCF
and JPG. Opaque formats include proprietary formats that can be read and edited
only by proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the machine-generated HTML,
PostScript or PDF produced by some word processors for output purposes only.
The “Title Page” means, for a printed book, the title page itself, plus such following
pages as are needed to hold, legibly, the material this License requires to appear in the
title page. For works in formats which do not have any title page as such, “Title Page”
means the text near the most prominent appearance of the work’s title, preceding the
beginning of the body of the text.
A section “Entitled XYZ” means a named subunit of the Document whose title either
is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in
another language. (Here XYZ stands for a specific section name mentioned below, such
as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve
the Title” of such a section when you modify the Document means that it remains a
section “Entitled XYZ” according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that
this License applies to the Document. These Warranty Disclaimers are considered to
be included by reference in this License, but only as regards disclaiming warranties:
any other implication that these Warranty Disclaimers may have is void and has no
effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either commercially or
noncommercially, provided that this License, the copyright notices, and the license
notice saying this License applies to the Document are reproduced in all copies, and
Appendix E: GNU Free Documentation License 221
that you add no other conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further copying of the copies
you make or distribute. However, you may accept compensation in exchange for copies.
If you distribute a large enough number of copies you must also follow the conditions
in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly
display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have printed covers) of
the Document, numbering more than 100, and the Document’s license notice requires
Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all
these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify you as the publisher
of these copies. The front cover must present the full title with all words of the title
equally prominent and visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve the title of the
Document and satisfy these conditions, can be treated as verbatim copying in other
respects.
If the required texts for either cover are too voluminous to fit legibly, you should put
the first ones listed (as many as fit reasonably) on the actual cover, and continue the
rest onto adjacent pages.
If you publish or distribute Opaque copies of the Document numbering more than 100,
you must either include a machine-readable Transparent copy along with each Opaque
copy, or state in or with each Opaque copy a computer-network location from which
the general network-using public has access to download using public-standard network
protocols a complete Transparent copy of the Document, free of added material. If
you use the latter option, you must take reasonably prudent steps, when you begin
distribution of Opaque copies in quantity, to ensure that this Transparent copy will
remain thus accessible at the stated location until at least one year after the last time
you distribute an Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the Document well
before redistributing any large number of copies, to give them a chance to provide you
with an updated version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under the conditions
of sections 2 and 3 above, provided that you release the Modified Version under precisely
this License, with the Modified Version filling the role of the Document, thus licensing
distribution and modification of the Modified Version to whoever possesses a copy of
it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct from that of the
Document, and from those of previous versions (which should, if there were any,
be listed in the History section of the Document). You may use the same title as
a previous version if the original publisher of that version gives permission.
222 GNU Mailutils Manual
B. List on the Title Page, as authors, one or more persons or entities responsible for
authorship of the modifications in the Modified Version, together with at least five
of the principal authors of the Document (all of its principal authors, if it has fewer
than five), unless they release you from this requirement.
C. State on the Title page the name of the publisher of the Modified Version, as the
publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications adjacent to the other
copyright notices.
F. Include, immediately after the copyright notices, a license notice giving the public
permission to use the Modified Version under the terms of this License, in the form
shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections and required Cover
Texts given in the Document’s license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled “History”, Preserve its Title, and add to it an item
stating at least the title, year, new authors, and publisher of the Modified Version
as given on the Title Page. If there is no section Entitled “History” in the Docu-
ment, create one stating the title, year, authors, and publisher of the Document
as given on its Title Page, then add an item describing the Modified Version as
stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for public access to
a Transparent copy of the Document, and likewise the network locations given in
the Document for previous versions it was based on. These may be placed in the
“History” section. You may omit a network location for a work that was published
at least four years before the Document itself, or if the original publisher of the
version it refers to gives permission.
K. For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title
of the section, and preserve in the section all the substance and tone of each of the
contributor acknowledgements and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document, unaltered in their text and
in their titles. Section numbers or the equivalent are not considered part of the
section titles.
M. Delete any section Entitled “Endorsements”. Such a section may not be included
in the Modified Version.
N. Do not retitle any existing section to be Entitled “Endorsements” or to conflict in
title with any Invariant Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or appendices that qualify
as Secondary Sections and contain no material copied from the Document, you may at
your option designate some or all of these sections as invariant. To do this, add their
titles to the list of Invariant Sections in the Modified Version’s license notice. These
titles must be distinct from any other section titles.
Appendix E: GNU Free Documentation License 223
You may add a section Entitled “Endorsements”, provided it contains nothing but
endorsements of your Modified Version by various parties—for example, statements of
peer review or that the text has been approved by an organization as the authoritative
definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up
to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified
Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be
added by (or through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or by arrangement
made by the same entity you are acting on behalf of, you may not add another; but
you may replace the old one, on explicit permission from the previous publisher that
added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission
to use their names for publicity for or to assert or imply endorsement of any Modified
Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this License,
under the terms defined in section 4 above for modified versions, provided that you
include in the combination all of the Invariant Sections of all of the original documents,
unmodified, and list them all as Invariant Sections of your combined work in its license
notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and multiple identical
Invariant Sections may be replaced with a single copy. If there are multiple Invariant
Sections with the same name but different contents, make the title of each such section
unique by adding at the end of it, in parentheses, the name of the original author or
publisher of that section if known, or else a unique number. Make the same adjustment
to the section titles in the list of Invariant Sections in the license notice of the combined
work.
In the combination, you must combine any sections Entitled “History” in the vari-
ous original documents, forming one section Entitled “History”; likewise combine any
sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You
must delete all sections Entitled “Endorsements.”
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents released
under this License, and replace the individual copies of this License in the various
documents with a single copy that is included in the collection, provided that you
follow the rules of this License for verbatim copying of each of the documents in all
other respects.
You may extract a single document from such a collection, and distribute it individu-
ally under this License, provided you insert a copy of this License into the extracted
document, and follow this License in all other respects regarding verbatim copying of
that document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate and independent
documents or works, in or on a volume of a storage or distribution medium, is called
224 GNU Mailutils Manual
an “aggregate” if the copyright resulting from the compilation is not used to limit the
legal rights of the compilation’s users beyond what the individual works permit. When
the Document is included an aggregate, this License does not apply to the other works
in the aggregate which are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document,
then if the Document is less than one half of the entire aggregate, the Document’s Cover
Texts may be placed on covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form. Otherwise they
must appear on printed covers that bracket the whole aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may distribute translations
of the Document under the terms of section 4. Replacing Invariant Sections with
translations requires special permission from their copyright holders, but you may
include translations of some or all Invariant Sections in addition to the original versions
of these Invariant Sections. You may include a translation of this License, and all the
license notices in the Document, and any Warranty Disclaimers, provided that you
also include the original English version of this License and the original versions of
those notices and disclaimers. In case of a disagreement between the translation and
the original version of this License or a notice or disclaimer, the original version will
prevail.
If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “His-
tory”, the requirement (section 4) to Preserve its Title (section 1) will typically require
changing the actual title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except as expressly
provided for under this License. Any other attempt to copy, modify, sublicense or
distribute the Document is void, and will automatically terminate your rights under
this License. However, parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such parties remain in full
compliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions of the GNU Free
Documentation License from time to time. Such new versions will be similar in spirit
to the present version, but may differ in detail to address new problems or concerns.
See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document
specifies that a particular numbered version of this License “or any later version”
applies to it, you have the option of following the terms and conditions either of that
specified version or of any later version that has been published (not as a draft) by
the Free Software Foundation. If the Document does not specify a version number of
this License, you may choose any version ever published (not as a draft) by the Free
Software Foundation.
Appendix E: GNU Free Documentation License 225
Function Index
This is an alphabetical list of all Mailutils functions.
$ C
$ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
ca-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
capa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
* capability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 cd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
cert-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
ch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
= chdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
check. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 clear. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
clear-include-path . . . . . . . . . . . . . . . . . . . . . . . . . . 102
clear-library-path . . . . . . . . . . . . . . . . . . . . . . . . . . 102
? close. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 concat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
config-file, --config-file
option, described . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
^ config-file, --config-file
^ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 option, introduced . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
config-help, --config-help
option, described . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
| config-help, --config-help
option, introduced . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
| . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 config-lint, --config-lint
option, described . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
config-lint, --config-lint
A option, introduced . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 config-verbose, --config-verbose
acl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 option, described . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
addheader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 config-verbose, --config-verbose
address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 option, introduced . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
ago in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159, 162
alias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
allow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
allow-biffrc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 create-home-dir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
allow-table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
alt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
alternates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
am in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 D
auth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36, 163
d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
daemon. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
day in date strings . . . . . . . . . . . . . . . . . . . . . . . 206, 207
B db . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40, 103
backlog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 dec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
base . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 decode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58, 138
binddn. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59, 160
bulletin-db . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 delete-expired . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
bulletin-source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 deleteheader" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
delimiter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
228 GNU Mailutils Manual
deliver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 F . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
deny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Followup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
deny-table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
di . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35, 132
discard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57, 183
G
disconnect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 get_date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
domainpart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 getpass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
dp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 getpwnam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36, 38, 41
dt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 getpwuid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36, 39, 41
group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
guimb-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
E guimb-getopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 guimb-message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
edit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
ehlo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 H
email. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27, 40 h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
envelope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 handshake-timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95, 179
ex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
examine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 hel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
exec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
exists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 help, --help option, described. . . . . . . . . . . . . . . . . . 8
exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 ho . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
exit-multiple-delivery-success . . . . . . . . . . . . 115 hold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
exit-tempfail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 home-dir-mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
expire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
expire-timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 hour in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
expunge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
external-locker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
I
F id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
id-fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 ident-encrypt-only . . . . . . . . . . . . . . . . . . . . . . . . . . 133
facility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 ident-keyfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
false. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 ifexec. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
fetch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 ig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
fi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 ignore. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
field-map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39, 40 ignore-errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56, 115 in_reply_to . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
file, --file option, mail option . . . . . . . . . . . . . . 51 include-path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
file-checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
fileinto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
isreply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
first in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . 203
fo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
fold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21, 56, 95 K
folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 keep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
followup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 keep-going . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
foreground . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 key-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
form-feeds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
fortnight in date strings . . . . . . . . . . . . . . . . . . . . . 206
forward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
from . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57, 163
Function Index 229
L no-user-config, --no-user-config
language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 option, introduced . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
last day . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 noon in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
last in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 noop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
library-path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 now in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
library-path-prefix . . . . . . . . . . . . . . . . . . . . . . . . 102 numaddr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
line-info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
list. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55, 160, 162, 181
localpart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 O
login. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 onerror . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
login-delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
overflow-control-interval. . . . . . . . . . . . . . . . . . 136
login-disabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
overflow-delay-time . . . . . . . . . . . . . . . . . . . . . . . . 136
logout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
lsub . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
M P
m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
mail-spool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 package_string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
mailbox-mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 passwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38, 40
mailbox-ownership . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 passwd-dir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
mailbox-pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 password-encryption. . . . . . . . . . . . . . . . . . . . . . . . . . 38
mailbox-type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21, 132 pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
max-children . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 pid-check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
max-lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 pidfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
max-messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 pipe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59, 180, 186
max-requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 pm in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
mb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29, 38
mbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 pre . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
mbox-url . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
preauth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
metamail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
preauth-only . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
midnight in date strings . . . . . . . . . . . . . . . . . . . . . . 205
prefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
mimetypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
minute in date strings . . . . . . . . . . . . . . . . . . . . . . . . 206 preserve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59, 90
mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 prev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
moderator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 previous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
month in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . 206 print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 print-severity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
printhdr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
program-id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
N P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
next day . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 Q
next in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 quit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55, 159, 163
no-config, --no-config option, introduced . . . . . 9 quota. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
no-header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
no-site-config, --no-site-config
option, described . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
no-site-config, --no-site-config
option, introduced . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
no-user-config, --no-user-config
option, described . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
230 GNU Mailutils Manual
R struct. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 su . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
rcpt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 subscribe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
redirect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 syslog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
reject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
rename . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
reply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Reply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
reply_regex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 T
request-control-interval . . . . . . . . . . . . . . . . . . . 136 t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
respond . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Respond . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18, 59
ret . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 text-type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
retain. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 this in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
retry-count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 ticket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
retry-sleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29, 31
retry-timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 timestamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
reverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 tls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31, 40
rset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
tls-mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31, 127
R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
to . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59, 163
today in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . 207
S tomorrow in date strings . . . . . . . . . . . . . . . . . . . . . . 207
top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
tou . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
touch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 transcript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 true . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
send . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22, 58
service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
session-id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162, 190
set, --set option, described . . . . . . . . . . . . . . . . . . . 11
set, --set option, introduced. . . . . . . . . . . . . . . . . . . 9
severity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 U
shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 u . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
show-all-match . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 uid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
show-config-options, uidl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
--show-config-options option, described. . . . . 8 una . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
si . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 unalias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
sieve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 undelete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60, 128
single-process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 unre . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58, 177 unread. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
smtp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
unselect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
spamd. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
unsubscribe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
sql-query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
unt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
ssl-ca-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
ssl-certificate-file . . . . . . . . . . . . . . . . . . . . . . . . 41 untag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
ssl-key-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 url . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24, 40
ssl-priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 usage, --usage option, described . . . . . . . . . . . . . . . 8
starttls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159, 163 user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
stat-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 user, --user option, mail option . . . . . . . . . . . . . . 52
status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
stderr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
store. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Function Index 231
V W . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
vacation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
ve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
verbose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91, 103 X
version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56, 139
version, --version option, described . . . . . . . . . . . 8 xit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
visual. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Y
W year in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 yesterday in date strings . . . . . . . . . . . . . . . . . . . . . 207
wa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
warranty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
weedlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Z
week in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
233
Variable Index
A I
append. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 ignore. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
appenddeadletter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 ignoreeof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
ARGP_HELP_FMT, environment variable . . . . . . . 215 indentprefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
askbcc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 inplacealiases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
askcc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
asksub. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
autoinc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 K
autoprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
keep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
keepsave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
B
bang . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 L
LD_LIBRARY_PATH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
long-opt-col . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
C LTDL_LIBRARY_PATH . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
charset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
cmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 M
crt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 mailx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
metamail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
metoo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
D mime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
datefield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 mimenoask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
decode-fallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 MU_DEFAULT_SCHEME . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
doc-opt-col . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
dot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
dup-args . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 N
dup-args-note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 nullbody . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
nullbodymsg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
E
editheaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 O
emptystart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 onehop. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
escape. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 onehop, mail variable . . . . . . . . . . . . . . . . . . . . . . . . 83
opt-doc-col . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
outfilename . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
F outfolder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
flipr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
folder. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
fromfield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
P
fullnames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
PID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
prompt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
H
header. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
header-col . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 Q
headline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 quiet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
hold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 quit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
234 GNU Mailutils Manual
R string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
subject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
rc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
readonly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
record. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 T
recursivealiases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
regex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 toplines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
TZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
replyprefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
replyregex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
return-address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 U
rmargin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 usage-indent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
useragent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
S V
save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 variable-pretty-print . . . . . . . . . . . . . . . . . . . . . . . 87
screen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 variable-strict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
sendmail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 varpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
sendwait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 varstrict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
short-opt-col . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 verbose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
showenvelope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
showto. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
sign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 X
Sign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 xmailer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
235
Keyword Index
! A
!, mail command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 acl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
all, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
allof. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
and, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
# any . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
#include, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 anyof. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
#searchpath, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . 173 auth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
C
: comparator, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
:all, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 contains, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
:comparator, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . 176 count, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
:contains, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
:count, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
:domain, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
D
:is, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
:localpart, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
:matches, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 domain, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
:mime. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
:over . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177, 180
:regex, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 E
:under . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177, 180 echo, mail command. . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
:value, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 else, mail command. . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
endif, mail command . . . . . . . . . . . . . . . . . . . . . . . . . . 74
~ F
~!, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 file, forward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
~-, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 from . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
~., mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
~:, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
~?, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 G
~|, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 GNU-MU-Dir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
~a, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 GNU-MU-GECOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
~A, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 GNU-MU-GID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
~e, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 GNU-MU-Mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
~f, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 GNU-MU-Quota . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
~F, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 GNU-MU-Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
~i, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 GNU-MU-UID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
~m, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 GNU-MU-User-Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
~M, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 gsasl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
~p, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
~v, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
~w, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 I
~x, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 if, mail command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
if, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
include . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
incorporate, mail command . . . . . . . . . . . . . . . . . . . 65
is, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
236 GNU Mailutils Manual
L R
ldap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 radius. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 rcpt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
line-info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 regex, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
localpart, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 require, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
locking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
S
script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112, 113
sender . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
M sender, mail command . . . . . . . . . . . . . . . . . . . . . . . . . 64
server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
set, mail command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
mailer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
shell, mail command . . . . . . . . . . . . . . . . . . . . . . . . . . 65
matches, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
source, mail command . . . . . . . . . . . . . . . . . . . . . . . . . 73
MBOX, environment variable . . . . . . . . . . . . . . . . . . 51 sql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
mime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 strip-domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
N T
tcp-wrappers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
noauth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 text:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
nosender, mail command . . . . . . . . . . . . . . . . . . . . . . . 64 tls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
not, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 tls-file-checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
notls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 to . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
O U
or, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 unset, mail command . . . . . . . . . . . . . . . . . . . . . . . . . . 73
user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
P V
pam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 value, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
param . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 variable, mail command . . . . . . . . . . . . . . . . . . . . . . . 73
program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 virtdomain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
237
Program Index
C M
comsatd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
mailutils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
mda . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
D messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
decodemail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 mimeview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
dotlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 movemail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
F
frm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 P
from . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
pop3d. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
putmail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
G
guimb. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
R
I readmsg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
imap4d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
L S
lmtpd. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
239
Concept Index
This is a general index of all issues discussed in this manual
~ E
~+, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Eggert, Paul . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
~/, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 epoch, for POSIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
~<, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 escape sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
~^, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Exim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
~b, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
~c, mail escape. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
~d, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
~h, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 F
~l, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
~r, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 FDL, GNU Free Documentation License . . . . . . 219
~s, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 file, mailbox type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
~t, mail escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 forward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
A G
abbreviations for months . . . . . . . . . . . . . . . . . . . . . . 205
action, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 general date syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
authors of get_date . . . . . . . . . . . . . . . . . . . . . . . . . . 209
H
hashed indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
B here-document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
beginning of time, for POSIX . . . . . . . . . . . . . . . . . . 208
Bellovin, Steven M. . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Berets, Jim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Bernstein, D. J. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 I
Berry, K. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 imap, mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
block statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 IMAP4 namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
boolean value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 imaps, mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
include statement, configuration file . . . . . . . . . . . . 16
C indexing, direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
indexing, hashed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
calendar date item . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
indexing, reverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
case, ignored in dates . . . . . . . . . . . . . . . . . . . . . . . . . 204
inetd, server mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Comments in a configuration file . . . . . . . . . . . . . . . 11
comments, in dates . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 iso 8601 date format . . . . . . . . . . . . . . . . . . . . . . . . . . 205
comparator, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 items in date strings . . . . . . . . . . . . . . . . . . . . . . . . . . 203
condition, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
configuration file statements. . . . . . . . . . . . . . . . . . . . 11
configuring servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
L
language, in dates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
D Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
daemon, server mode. . . . . . . . . . . . . . . . . . . . . . . . . . . 28 list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
date format, iso 8601 . . . . . . . . . . . . . . . . . . . . . . . . . 205 local mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
date input formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
day of week item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
direct indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
directory indexing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
displacement of dates . . . . . . . . . . . . . . . . . . . . . . . . . 206
240 GNU Mailutils Manual
M R
MacKenzie, David . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 RAND Corporation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
macro variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 relative items in date strings . . . . . . . . . . . . . . . . . . 206
mailbox URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 remote mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
mailbox, local . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 reverse indexing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
mailbox, mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
mailbox, program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
mailbox, remote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 S
mailbox, SMTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Salz, Rich . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
maildir. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
secondary mailbox, mail . . . . . . . . . . . . . . . . . . . . . . . 51
mailman . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Sendmail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Mailutils configuration file . . . . . . . . . . . . . . . . . . . . . . . 9
sendmail, URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
mailutils.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
server configuration, general . . . . . . . . . . . . . . . . . . . . 28
mailutils.dict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
server settings, configuration . . . . . . . . . . . . . . . . . . . 27
mbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
server statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
MeTA1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Sieve Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Meyering, Jim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Sieve preprocessor statements . . . . . . . . . . . . . . . . . 173
mh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
simple statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
minutes, time zone correction by . . . . . . . . . . . . . . 205
single-line comments . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
month names in date strings . . . . . . . . . . . . . . . . . . 205
smtp, mailbox. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
months, written-out . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
smtps, mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
movemail, configuration . . . . . . . . . . . . . . . . . . . . . . . . 90
statement, block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
multi-line comments . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
statement, simple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
multiline strings, sieve . . . . . . . . . . . . . . . . . . . . . . . . 169
statements, configuration file . . . . . . . . . . . . . . . . . . . 11
string list, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
N string, quoted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
string, unquoted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 strings, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
numbers, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 system mailbox, mail . . . . . . . . . . . . . . . . . . . . . . . . . . 51
numbers, written-out . . . . . . . . . . . . . . . . . . . . . . . . . 203
O T
test, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172, 175
ordinal numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
time formats, output . . . . . . . . . . . . . . . . . . . . . . . . . . 211
time of day item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
P time zone correction . . . . . . . . . . . . . . . . . . . . . . . . . . 205
time zone item . . . . . . . . . . . . . . . . . . . . . . . . . . . 204, 206
personal mailbox, mail . . . . . . . . . . . . . . . . . . . . . . . . . 51
Pinard, F. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
plus expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
pop, mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
U
pops, mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 URL, local . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
preprocessor, sieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 URL, mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
prog, URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 URL, prog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
program mailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 URL, remote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 URL, sendmail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
pure numbers in date strings . . . . . . . . . . . . . . . . . . 207 URL, SMTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Q V
quoted string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 variable expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15