Short Contents ************** 1 GNU Mailutils 2 Introduction 3 Mailutils Programs 4 Mailutils Libraries 5 Sieve Language 6 Reporting Bugs 7 Getting News About GNU Mailutils 8 Acknowledgement Appendix A References Appendix B GNU Free Documentation License Function Index Variable Index Keyword Index Program Index Concept Index Table of Contents ***************** 1 GNU Mailutils 2 Introduction 3 Mailutils Programs 3.1 Mailutils Configuration File 3.1.1 Common 3.1.2 Mailbox 3.1.3 Mailer 3.1.4 Address 3.1.5 Daemon 3.1.6 Auth 3.1.7 Encryption 3.1.8 Logging 3.1.9 Sieve Specific Options 3.1.10 A Sample Configuration File 3.2 Authorization and Authentication Principles 3.3 `frm' and `from' -- List Headers from a Mailbox 3.4 `mail' -- Send and Receive Mail 3.4.1 Invoking `mail' 3.4.2 How to Specify Message Sets 3.4.3 Composing Mail 3.4.4 Reading Mail 3.4.5 Scripting 3.4.6 How to Alter the Behavior of `mail' 3.4.7 Personal and System-wide Configuration Files 3.5 `messages' -- Count the Number of Messages in a Mailbox 3.6 `movemail' -- Moves Mail from the User Maildrop to the Local File 3.6.1 Movemail Options 3.6.2 Summary of Movemail Usage 3.7 `readmsg' -- Extract Messages from a Folder 3.8 `sieve' 3.8.1 A Sieve Interpreter 3.8.2 A Sieve to Scheme Translator and Filter 3.9 `guimb' -- A Mailbox Scanning and Processing Language 3.10 `mail.local' -- Deliver Mail to the Local Mailbox 3.10.1 Invoking `mail.local' 3.10.2 Using `mail.local' with Various MTAs 3.10.3 Setting up Mailbox Quotas 3.10.3.1 Keeping Quotas in DBM Database 3.10.3.2 Keeping Quotas in SQL Database 3.10.4 Implementing User-defined Sieve Mail Filters 3.10.5 Implementing User-defined Scheme Mail Filters 3.11 `mail.remote' -- Pseudo-Sendmail Interface for Mail Delivery 3.12 mimeview 3.13 POP3 Daemon 3.13.1 Login delay 3.13.2 Auto-expire 3.13.3 Bulletins 3.13.4 Command line options 3.14 IMAP4 Daemon 3.14.1 Namespace 3.14.2 Starting `imap4d' 3.15 Comsat Daemon 3.15.1 Starting `comsatd' 3.15.2 Configuring `comsatd' 3.16 MH -- The MH Message Handling System 3.16.1 Major differences between Mailutils MH and other MH implementations 3.16.1.1 New and Differing MH Format Specifications 3.16.1.2 New MH Profile Variables 3.16.1.3 Differences in MH Program Behavior 3.17 `mailutils-config' -- Get the Information about the Mailutils Build 4 Mailutils Libraries 4.1 Framework 4.1.1 Folder 4.1.2 Mailbox 4.1.3 Mailer 4.1.4 Message 4.1.5 Envelope 4.1.6 Headers 4.1.7 Body 4.1.8 Attribute 4.1.9 Stream 4.1.10 Iterator 4.1.11 Authenticator 4.1.12 Address 4.1.13 Locker 4.1.14 URL 4.1.15 Parse822 4.1.16 Mailcap 4.2 Authentication Library 4.2.1 Data Types 4.2.2 Initializing `libmuauth' 4.2.3 Module Creation and Destruction 4.2.4 Obtaining Authorization Information 4.2.5 Existing Modules 4.2.6 Using `libmuauth' in Your Programs 4.3 Mailutils to Scheme Interface 4.3.1 Address Functions 4.3.2 Mailbox Functions 4.3.3 Message Functions 4.3.4 MIME Functions 4.3.5 Logging Functions 4.3.6 Other Functions 4.3.7 Direct Linking 4.3.8 Dynamic Linking 4.4 Sieve Library 4.4.1 Sieve Data Types 4.4.2 Manipulating the Sieve Machine 4.4.3 Logging and Diagnostic Functions 4.4.4 Symbol Space Functions 4.4.5 Memory Allocation 4.4.6 Compiling and Executing the Script 4.4.7 Writing Loadable Commands 5 Sieve Language 5.1 Lexical Structure 5.2 Syntax 5.2.1 Commands 5.2.2 Actions Described 5.2.3 Control Flow 5.2.4 Tests and Conditions 5.3 Preprocessor 5.4 Require Statement 5.5 Comparators 5.6 Tests 5.7 Actions 5.8 GNU Extensions 6 Reporting Bugs 7 Getting News About GNU Mailutils 8 Acknowledgement Appendix A References Appendix B GNU Free Documentation License B.1 ADDENDUM: How to use this License for your documents Function Index Variable Index Keyword Index Program Index Concept Index 1 GNU Mailutils *************** This edition of the `GNU Mailutils Manual', last updated 19 May 2005, documents GNU Mailutils Version 1.2. 2 Introduction ************** GNU Mailutils contains a series of useful mail clients, servers, and libraries. These are the primary mail utilities of the GNU system. Specifically, this package contains a POP3 server, an IMAP4 server, and a Sieve mail filter. It also provides a POSIX `mailx' client, and a collection of other tools. The central library is capable of accessing different mailbox formats and mailers as well as off of local or remote POP3 and IMAP4 servers. This software is part of the GNU Project and belongs to the Free Software Foundation. All libraries are licensed using the GNU LGPL. The documentation is licensed under the GNU FDL, and everything else is licensed using the GNU GPL. Why use this package? --------------------- This package started off to try and handle large mailbox files more gracefully then current 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 Mailutils Programs ******************** GNU Mailutils provides a set of programs for handling the e-mail. 3.1 Mailutils Configuration File ================================ There are some command line options that are used so often that it is inconvenient to specify them in the command line each time you run a Mailutils utility. The "configuration files" provide a way to add default command line arguments without having to type them in the command line. Upon startup, each Mailutils utility scans and processes the contents of the three startup files, none of which are required to exist: 1. the site-wide configuration file `mailutils.rc', found in your your system configuration directory (usually `/etc' or `/usr/local/etc'). 2. the user-specific configuration file Usually `~/.mailutils', unless `~/.mailutils' is a directory, in which case `~/.mailutils/mailutils' is used. 3. the programs-specific configuration file Usually `~/.mu.PROGRAMrc', unless `~/.mailutils' is a directory, in which case `~/.mailutils/PROGRAMrc' is used (where PROGRAM means the program name). These files have simple line-oriented syntax. Comments begin with the pound sign (`#') and extend through the end of the line (1). Very long lines may be split across several lines by escaping final newline with a backslash (`\') character. In the non-program-specific configuration files, any configuration line must start with a "tag". In the program-specific configuration file the tag must not be present, all options are for that specific program. A tag is either a name of a particular Mailutils utility or "option group", prefixed with colon (`:'). The command line options common for several Mailutils programs are divided into "option groups" or "capabilities", e.g. the options `--mail-spool' and `--lock-flags' form group `mailbox'. These groups are discussed in detail below. When processing the non-program-specific configuration files, a Mailutils utility selects those lines whose tag is either the name of that utility or the name of the option group supported by it. In the program-specific configuration file, all lines are selected. For each line found, its tag (if present) is stripped away, and the rest of the line is split up into words. These words are regarded as command line options and are inserted to the program arguments _before_ any options from the command line. Thus the options from `.mailutils' take precedence over those from `mailutils.rc', and the options from the command line take precedence over those from all three configuration files. The word splitting occurs at whitespace characters and is similar to that performed by the shell. If an option must contain embedded whitespace, it should be enclosed in a pair of quotes (either double or single quotes). ---------- Footnotes ---------- (1) If `#' is not the first character on the line, it should be separated from the previous word by any amount of whitespace. 3.1.1 Common ------------ Each program understands the following informational options: `-u' `--usage' Display a short usage message and exit. `-h' `--help' Display help message and exit. `-L' `--license' Display GNU General Public License and exit. `-v' `--version' Display program version and exit. 3.1.2 Mailbox ------------- Option group `mailbox' consists of options used to specify the location of the mail spool, and the locking strategy. `-m PATH' `--mail-spool=PATH' Set path to the mailspool directory `--lock-flags=FLAGS' Set the default mailbox lock flags (E=external, R=retry, T=time, P=pid). 3.1.3 Mailer ------------ This option group overrides the default mailer URL (`sendmail:'). `-m URL' `--mailer URL' 3.1.4 Address ------------- Option group `address' consists of options used to specify how to qualify email addresses. An unqualified address (one without an @) is qualified by appending @DEFAULTDOMAIN. DEFAULTDOMAIN is the return of `gethostname()', or the result of `gethostbyname()' on the return of `gethostname()' (if the DNS lookup is successful). If the email address of the current user is needed, either the address set by `--email-addr' is returned, or the current uid is looked up in the user database, and qualified with the DEFAULTDOMAIN. `-E EMAIL' `--email-addr=EMAIL' Set the current user's email address, this it makes more sense to use this in one of the per-user configuration files. `-D DOMAIN' `--email-domain=DOMAIN' Set the default email domain, this might make sense to use in either the global or one of the per-user configuration files. 3.1.5 Daemon ------------ `-d[NUMBER]' `--daemon[=NUMBER]' Run in standalone mode. An optional NUMBER specifies the maximum number of child processes the daemon is allowed to fork. When it is omitted, it defaults to 20 processes. _Please note_, that there should be no whitespace between the `-d' and its parameter. `-i' `--inetd' Run in inetd mode. `-p NUMBER' `--port NUMBER' Listen on given port NUMBER. This option is meaningful only in standalone mode. It defaults to port 143. `-t NUMBER' `--timeout NUMBER' Set idle timeout to given NUMBER of seconds. The daemon breaks the connection if it receives no commands from the client within that number of seconds. 3.1.6 Auth ---------- These options control the authorization and authentication module lists. For a description of authentication concepts, refer to *Note authentication::. `--authorization MODLIST' This option allows to set up a list of modules to be used for authorization. MODLIST is a colon-separated list of modules. Valid modules are: system User credentials are retrieved from the system user database (`/etc/password'). sql User credentials are retrieved from the sql database. The set of `--sql-' options (see below) is used to configure access to the database. virtdomain User credentials are retrieved from a "virtual domain" user database. `--authentication MODLIST' This option allows to set up a list of modules to be used for authentication. MODLIST is a colon-separated list of modules. Valid modules are: 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 the sql database using query supplied by `--sql-getpass' option (see below). pam The user is authenticated via pluggable authentication module (pam). The pam service name to be used is configured via `--pam-service' option (see below). `--pam-service NAME' When compiled with pam support, this option specifies the name of pam service to be used when authenticating. The following options exist in this group if the package was configured with `--enable-sql' option. They take effect only if the `sql' module is used in authentication and/or authorization. `--sql-interface IFACE' Specify SQL interface to use. IFACE is either `mysql' or `postgres'. This allows to select SQL subsystem on runtime if `mailutils' was compiled with support for several SQL drivers. If this option is omitted, `mailutils' will use the first available SQL driver. `--sql-host NAME' Name or IP of MySQL server to connect to. `--sql-user NAME' sql user name `--sql-passwd STRING' sql connection password `--sql-db STRING' Name of the database to connect to. `--sql-port NUMBER' Port to use `--sql-getpwnam QUERY' sql query to retrieve a passwd entry based on username `--sql-getpwuid QUERY' sql query to retrieve a passwd entry based on user ID `--sql-getpass QUERY' sql query to retrieve a password from the database 3.1.7 Encryption ---------------- These options control TLS/SSL encryption in `imap4d' and `pop3d' daemons. `--ssl-cert FILE' This option specifies the file name of the server side SSL certificate (accepts PEM format). `--ssl-key FILE' This option specifies the file name of the server side private SSL key (accepts PEM format). The key must be protected with 0600 file permissions (u=rw,g=,o=), otherwise `imap4d' or `pop3d' daemons will refuse to support TLS/SSL encryption. `--ssl-cafile FILE' This option specifies a file containing the list of trusted CAs (PEM list) in order to verify client's certificates. This option is not required. 3.1.8 Logging ------------- `--log-facility FACILITY' Output logs to the specified `syslog' facility. The following facility names are recognized: `user', `daemon', `mail', `auth' and `local0' through `local7'. These names are case-insensitive. 3.1.9 Sieve Specific Options ---------------------------- The following options comprise this group: `-I DIR' `--includedir=DIR' Append directory DIR to the list of directories searched for include files. `-L DIR' `--libdir=DIR' Append directory DIR to the list of directories searched for library files. 3.1.10 A Sample Configuration File ---------------------------------- The following configuration file specifies that all Mailutils programs should use `/var/spool/mail' as a local mailspool directory. Programs performing authentication will use pam service `mailutils'. All programs, except `imap4d' will issue log messages via `mail' facility, `imap4d' will use facility `local1'. :mailbox --mail-spool /var/spool/mail :auth --authentication pam --pam-service mailutils :logging --log-facility mail imap4d --daemon=20 --timeout=1800 --log-facility local1 3.2 Authorization and Authentication Principles =============================================== 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 either a one of them succeeds or the list is exhausted. In 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. We represent the module lists as column-separated lists of module names. 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 nevertheless 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 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 the sql database. The set of `--sql-' options (*note auth::) is used to configure access to the database. virtdomain User credentials are retrieved from a "virtual domain" user database. The modules available for use in authentication list are: 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 the sql database using query supplied by `--sql-getpass' option (*note auth::). pam The user is authenticated via pluggable authentication module (pam). The pam service name to be used is configured via `--pam-service' option (*note auth::) Unless overridden by `--authentication' command line option, the list of authentication modules is: generic:system:pam:sql Unless overridden by `--authorization' command line option, the list of authorization modules is: system:sql:virtdomains 3.3 `frm' and `from' -- List Headers from a Mailbox =================================================== GNU mailutils provides two commands for listing messages in a mailbox. These are `from' and `frm'. `frm' ----- The `frm' command outputs a header information of the selected messages in a mailbox. By default, `frm' reads the 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 program uses following option groups: *Note mailbox::. The following command line options alter the behavior of the program: `-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 user name 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. Option `-f' (`--file') instructs the program 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. `-d' `--debug' Prints additional debugging outut. `-s STRING' `--sender=STRING' Prints only mail from addresses containing the supplied string. FIXME: only `From:' header is examined. `-f URL' `--file=URL' Examine mailbox from the given URL. 3.4 `mail' -- Send and Receive Mail =================================== `Mail' is an enhanced version of standard `/bin/mail' program. As well as its predecessor, it can be used either in sending mode or in reading mode. `Mail' enters sending mode when one or more email addresses were specified in this 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 *note Composing Mail::, 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 to read and manipulate the contents of a mailbox. The URL of the mailbox to operate upon is taken from the argument of `--file' command line option. If it is not specified, the user's system mailbox is assumed. For more detail, see *note Reading Mail::. 3.4.1 Invoking `mail' --------------------- General usage of `mail' program is: mail [OPTION...] [ADDRESS...] If [ADDRESS...] part is present, `mail' switches to mail sending mode, otherwise it operates in mail reading mode. The program uses following option groups: *Note mailbox::. `Mail' understands following command line options: `-e' `--exist' Return true if the mailbox contains some messages. Return false otherwise. This is useful for writing shell scripts. `-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 (*note Mail Configuration Files::), but before opening the mailbox. `--exec' `-f[FILE]' `--file[=FILE]' Operate on mailbox FILE. If this option is not specified, the default is user's system mailbox. If it is specified without argument, the default is `$HOME/mbox'. _Please note_, that there should be no whitespace between the short variant of the option (`-f'), and its parameter. Similarly, when using long option (`--file'), its argument must be preceded by equal sign. `-F' `--byname' Save messages according to sender. Currently this option is not implemented. `-H' `--headers' Print header summary to stdout and exit. `-i' `--ignore' Ignore interrupts. `-m PATH' `--mail-spool=PATH' Set path to the mailspool directory `-n' `--norc' Do not read the system-wide mailrc file. *Note Mail Configuration Files::. `-N' `--nosum' Do not display initial header summary. `-p' `--print' `-r' `--read' Print all mail to standard output. It is equivalent to issuing following commands after starting `mail -N': print * quit `-q' `--quit' Cause interrupts to terminate program. `-s SUBJ' `--subject=SUBJ' Send a message with a Subject of SUBJ. Valid only in sending mode. `-t' `--to' Switch to sending mode. `-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). `-?' `--help' Display a help message. `--usage' Display a short usage summary. `-V' `--version' Print program version and exit. 3.4.2 How to Specify Message Sets --------------------------------- Many mail commands such as print and delete can be given a "message list" to operate upon. Wherever the message list is omitted, the command operates on the current message. The "message list" in its simplest form is one of: . Selects current message. It is equivalent to empty message list. * Selects all messages in the mailbox. ^ Selects first non-deleted message. $ Selects last non-deleted message. In its complex form, the "message list" is a comma or whitespace-separated list of "message specifiers". A "message specifier" is one of Message Number This specifier addresses the message with the given ordinal number in the mailbox. Message range "Message range" is specified as two message numbers separated by a dash. It selects all messages with the number lying within that range. Attribute specifier An "Attribute specifier" is a colon followed by a single letter. The "Attribute specifier" addresses all messages in the mailbox that have the given attribute. These are the valid attribute specifiers: `:d' Selects all deleted messages. `:n' Selects all recent messages, i.e. the messages that have not been neither read not seen so far. `:o' Selects all messages that have been seen. `:r' Selects all messages that have been read. `:u' Selects all messages that have _not_ been read. `:t' Selects all tagged messages. `:T' Selects all untagged messages. Header match The "header match" is a string in the form: [HEADER:]/STRING/ It selects all messages that contain header field HEADER matching given REGEXP. If the variable `regexp' is set, the STRING is assumed to be a POSIX regexp. Otherwise, a header is considered to match STRING if the latter constitutes a substring of the former (comparison is case-insensitive). If HEADER: part is omitted, it is assumed to be `Subject:'. Message body match The "message body match" is a string in the form: :/STRING/ It selects all messages whose body matches the string. The matching rules are the same as described under "Header match". A "message specifier" can be followed by "message part specifier", enclosed in a pair of brackets. A "message part specifier" controls which part of a message should be operated upon. It is meaningful only for multipart messages. A "message part specifier" is a comma or whitespace - separated list of part numbers or ranges. Each part number can in turn be "message part specifier", thus allowing for operating upon multiply-encoded messages. The following are the examples of valid message lists: 3.4.3 Composing Mail -------------------- You can compose the message by simply typing the contents of it, line by line. But usually this is not enough, you would need to edit your text, to quote some messages, etc. `Mail' provides these capabilities through "compose escapes". The "compose escapes" are single-character commands, preceded by special "escape character", which defaults to `~'. The combination `escape character + command' is recognized as a compose escape only if it occurs at the beginning of a line. If the escape character must appear at the beginning of a line, enter it twice. The actual escape character may be changed by setting the value of `escape' mail variable (*note Mail Variables::). Quitting Compose Mode ..................... There are several commands allowing you to quit the compose mode. Typing the end-of-file character (`C-D') on a line alone finishes compose mode and sends the message to its destination. The `C-D' character looses its special meaning if `ignoreeof' mail variable is set. If mail variable `dot' is set, typing dot (`.') on a line alone achieves the same effect as `C-D' above. Finally, using `~.' escape always quits compose mode and sends out the composed message. To abort composing of a message without sending it, type interrupt character (by default, `C-C') twice. This behavior is disabled when mail variable `ignore' is set. In this case, you can use `~x' escape to achieve the same effect. Getting Help on Compose Escapes: ~? ................................... The `~?' escape prints on screen a brief summary of the available compose escapes. _Please note_, that `~h' escape prompts for changing the header values, and does _not_ give help. Editing the Message: ~e and ~v .............................. If you are not satisfied with the message as it is, you can edit it using a text editor specified either by `EDITOR' or by `VISUAL' environment variables. The `~e' uses the former, and `~v' uses the latter. By default both escapes allow you to edit only the body of the message. However, if the `editheaders' variable is set, `mail' will load into the editor the complete text of the message with headers included, thus allowing you to change the headers as well. Modifying the Headers: ~h, ~t, ~c, ~b, ~s ......................................... To add new addresses to the list of message recipients, use `~t' command, e.g.: ~t name1@domain.net name2 To add addresses to `Cc' or `Bcc', use `~c' or `~b' escapes respectively. To change the `Subject' header, use `~s' escape, e.g.: ~s "Re: your message" Finally, to edit all headers, type `~h' escape. This will present you with the values of `To', `Cc', `Bcc', and `Subject' headers allowing to edit them with normal text editing commands. Enclosing Another Message: ~m and ~M .................................... If you are sending mail from within mail command mode, you can enclose the contents of any message sent to you by using `~m' or `~M' commands. Typing `~m' alone will enclose the contents of the current message, typing `~m 12' will enclose the contents of message #12 and so on. The `~m' uses retained and ignored lists when enclosing headers, the `~M' encloses all header fields. In both cases, the contents of `indentprefix' mail variable is prepended to each line enclosed. Adding a File to the Message: ~r and ~d ....................................... To append the contents of file FILENAME to the message, type ~r FILENAME or ~< FILENAME The `~d' escape is a shorthand for ~r dead.letter Printing And Saving the Message ............................... The `~p' escape types the contents of the message entered so far, including headers, on your terminal. You can save the message to an arbitrary file using `~w' escape. It takes the filename as its argument. Signing the Message: ~a and ~A .............................. To save you the effort of typing your signature at the end of each message, you can use `~a' or `~A' escapes. If your signature occupies one line only, save it to the variable `sign' and use `~a' escape to insert it. Otherwise, if it is longer than one line, save it to a file, store the name of this file in the variable `Sign', and use `~A' escape to insert it into the message. Printing Another Message: ~f and ~F ................................... Sometimes it is necessary to view the contents of another message, while composing. These two escapes allow it. Both take the message list as their argument. If they are used without argument, the contents of the current message is printed. The difference between `~f' and `~F' is that the former uses ignored and retained lists to select headers to be displayed, whereas the latter prints all headers. Inserting Value of a Mail Variable: ~i ...................................... The `~i' escape enters the value of the named mail variable into the body of the message being composed. Executing Other Mail Commands: ~: and ~- ........................................ You can execute a mail command from within compose mode using `~:' or `~-' escapes. For example, typing ~: from :t 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. running `mail address@domain'), most mail commands are meaningless, since there is no mailbox to operate upon. In this case, the only commands that can reasonably be used are: `alias', `unalias', `alternate', `set', and `unset'. Executing Shell Commands: ~! and ~| ................................... The `~!' escape executes specified command and returns you to `mail' compose mode without altering your message. When used without arguments, it starts your login shell. The `~|' escape pipes the message composed so far through the given shell command and replaces the message with the output the command produced. If the command produced no output, `mail' assumes that something went wrong and retains the old contents of your message. 3.4.4 Reading Mail ------------------ To read messages from a given mailbox, use one of the following ways of invoking `mail': `mail' To read messages from your system mailbox. `mail --file' To read messages from your mailbox (`$HOME/mbox'). `mail --file=PATH_TO_MAILBOX' To read messages from the specified mailbox. `mail --user=USER' To read messages from the system mailbox belonging to USER. _Please note_, that usual mailbox permissions won't allow you to use the last variant of invocation, unless you are a super-user. Similarly, the last but one variant is also greatly affected by the permissions the target mailbox has. Unless you have started mail with `--norc' command line option, it will read the contents of the system-wide configuration file. Then it reads the contents of user configuration file, if any. For detailed description of these files, see *note Mail Configuration Files::. After this initial setup, `mail' displays the first page of header lines and enters interactive mode. In interactive mode, `mail' displays its prompt (`?', if not set otherwise) and executes the commands the user enters. Quitting the Program .................... Following commands quit the program: `quit' Terminates the session. If `mail' was operating upon user's system mailbox, then all undeleted and unsaved messages that have been read and are not marked with hold flag are saved to the user's mbox file (`$HOME/mbox'). The messages, marked with `delete' are removed. The program exits to the Shell, unless saving the mailbox fails, in which case user can escape with the exit command. `exit' `ex' `xit' Program exits to the Shell without modifying the mailbox it operates upon. Typing EOF (`C-D') alone is equivalent to `quit'. Obtaining Online Help ..................... Following commands can be used during the session to request online help: `help [COMMAND]' `hel [COMMAND]' `? [COMMAND]' Display detailed command synopsis. If no COMMAND is given, help for all available commands is displayed. `list' `*' Print a list of available commands. `version' `ve' Display program version. `warranty' `wa' Display program warranty statement. Moving Within a Mailbox ....................... `^' Move to the first undeleted message. `$' Move to the last undeleted message. `next' `n' Move to the next message. `previous' `prev' Move to the previous message. Changing Mailbox/Directory .......................... `cd [DIR]' `chdir [DIR]' `ch [DIR]' Change to the specified directory. If DIR is omitted, `$HOME' is assumed. `file [MAILBOX]' `fi [MAILBOX]' `folder [MAILBOX]' `fold [MAILBOX]' Read in the contents of the specified MAILBOX. The current mailbox is updated as if `quit' command has been issued. If MAILBOX is omitted, the command prints the current mailbox name followed by the summary information regarding it, e.g.: & fold "/var/spool/mail/gray": 23 messages 22 unread Controlling Header Display .......................... To control which headers in the message should be displayed, `mail' keeps two lists: a "retained" header list and an "ignored" header list. If "retained" header list is not empty, only the header fields listed in it are displayed when printing the message. Otherwise, if "ignored" header list is not empty, only the headers _not listed_ in this list are displayed. The uppercase variants of message-displaying commands can be used to print all the headers. The following commands modify and display the contents of both lists. `discard [HEADER-FIELD-LIST]' `di [HEADER-FIELD-LIST]' `ignore [HEADER-FIELD-LIST]' `ig [HEADER-FIELD-LIST]' Add HEADER-FIELD-LIST to the ignored list. When used without arguments, this command prints the contents of ignored list. `retain [HEADER-FIELD-LIST]' `ret [HEADER-FIELD-LIST]' Add HEADER-FIELD-LIST to the retained list. When used without arguments, this command prints the contents of retained list. Displaying Information ...................... `=' Displays the current message number. `headers [MSGLIST]' `h [MSGLIST]' Lists the current pageful of headers. `from [MSGLIST]' `f [MSGLIST]' Lists the contents of `From' headers for a given set of messages. `z [ARG]' Presents message headers in pagefuls as described for `headers' command. When ARG is `.', it is generally equivalent to `headers'. When ARG is omitted or is `+', the next pageful of headers is displayed. If ARG is `-', the previous pageful of headers is displayed. The latter two forms of `z' command may also take a numerical argument meaning the number of pages to skip before displaying the headers. For example: & z +2 will skip two pages of messages before displaying the header summary. `size [MSGLIST]' `si [MSGLIST]' Lists the message number and message size in bytes for each message in MSGLIST. `folders' Displays the value of `folder' variable. `summary' `su' Displays current mailbox summary. E.g.: & summary "/var/spool/mail/gray": 23 messages 22 unread Displaying Messages ................... `print [MSGLIST]' `p [MSGLIST]' `type [MSGLIST]' `t [MSGLIST]' Prints out the messages from MSGLIST. 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 minimum number of lines. 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. `Print [MSGLIST]' `P [MSGLIST]' `Type [MSGLIST]' `T [MSGLIST]' Like print but also prints out ignored header fields. `decode [MSGLIST]' `dec [MSGLIST]' Print a multipart message. The `decode' command decodes and prints out specified message parts. E.g. & decode 15[2] +--------------------------------------- | Message=15[2] | Type=message/delivery-status | encoding=7bit +--------------------------------------- Content-Type: message/delivery-status ... `top [MSGLIST]' `to [MSGLIST]' Prints the top few lines of each message in MSGLIST. The number of lines printed is controlled by the variable `toplines' and defaults to five. `pipe [MSGLIST] [SHELL-COMMAND]' `| [MSGLIST] [SHELL-COMMAND]' Pipe the contents of specified messages through SHELL-COMMAND. If SHELL-COMMAND is empty but the string variable `cmd' is set, the value of this variable is used as a command name. Marking Messages ................ `tag [MSGLIST]' `ta [MSGLIST]' Tag messages. The tagged messages can be referred to in message list using `:t' notation. `untag [MSGLIST]' `unt [MSGLIST]' Clear tags from specified messages. To untag all messages tagged so far type & untag :t `hold [MSGLIST]' `ho [MSGLIST]' `preserve [MSGLIST]' `pre [MSGLIST]' Marks each message to be held in user's system mailbox. This command does not override the effect of `delete' command. Disposing of Messages ..................... `delete [MSGLIST]' `d [MSGLIST]' Mark messages as deleted. Upon exiting with `quit' command these messages will be deleted from the mailbox. Until the end of current session the deleted messages can be referred to in message lists using :d notation. `undelete [MSGLIST]' `u [MSGLIST]' Clear delete mark from the specified messages. `dp [MSGLIST]' `dt [MSGLIST]' Deletes the current message and prints the next message. If MSGLIST is specified, deletes all messages from the list and prints the message, immediately following last deleted one. Saving Messages ............... `save [[MSGLIST] FILE]' `s [[MSGLIST] FILE]' Takes a message list and a file name and appends each message in turn to the end of the file. The name of file and number of characters appended to it is echoed on the terminal. Each saved message is marked for deletion as if with `delete' command, unless the variable `keepsave' is set. `Save [MSGLIST]' `S [MSGLIST]' Like `save', but the file to append messages to is named after the sender of the first message in MSGLIST. For example: & from 14 15 U 14 smith@noldor.org Fri Jun 30 18:11 14/358 The Save c U 15 gray@noldor.org Fri Jun 30 18:30 8/245 Re: The Sa & Save 14 15 "smith" 22/603 i.e., 22 lines (603 characters) have been appended to the file "smith". If the file does not exist, it is created. `write [[MSGLIST] FILE]' `w [[MSGLIST] FILE]' Similar to `save', except that only message body (without the header) is saved. `Write [MSGLIST]' `W [MSGLIST]' Similar to `Save', except that only message body (without the header) is saved. `mbox [MSGLIST]' `mb [MSGLIST]' `touch [MSGLIST]' `tou [MSGLIST]' Mark list of messages to be saved in the user's mailbox (`$HOME/mbox') upon exiting via `quit' command. This is the default action for all read messages, unless you have variable `hold' set. `copy [[MSGLIST] FILE]' `c [[MSGLIST] FILE]' Similar to `save', except that saved messages are not marked for deletion. `Copy [MSGLIST]' `C [MSGLIST]' Similar to `Save', except that saved messages are not marked for deletion. Editing Messages ................ These command allow to edit messages in a mailbox. _Please note_, that modified messages currently do not replace original ones. i.e. you have to save them explicitly using your editor's `save' command if you do not want the effects of your editing to be lost. `edit [MSGLIST]' `e [MSGLIST]' Edits each message in MSGLIST with the editor, specified in `EDITOR' environment variable. `visual [MSGLIST]' `v [MSGLIST]' Edits each message in MSGLIST with the editor, specified in `VISUAL' environment variable. Aliasing ........ `alias [alias [ADDRESS...]]' `a [alias [ADDRESS...]]' `group [alias [ADDRESS...]]' `g [alias [ADDRESS...]]' 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. `unalias [ALIAS...]' `una [ALIAS...]' Takes a list of names defined by alias commands and discards the remembered groups of users. The alias names no longer have any significance. `alternates NAME...' `alt NAME...' The alternates command is useful if you have accounts on several machines. It can be used to inform mail that the listed addresses are really you. When you reply to messages, mail will not send a copy of the message to any of the addresses listed on the alternates list. If the alternates command is given with no argument, the current set of alternate names is displayed. Replying ........ `mail [ADDRESS...]' `m [ADDRESS...]' Switches to compose mode. After composing the message, sends messages to the specified addresses. `reply [MSGLIST]' `respond [MSGLIST]' `r [MSGLIST]' For each message in MSGLIST, switches to compose mode and sends the composed message to the sender and all recipients of the message. `Reply [MSGLIST]' `Respond [MSGLIST]' `R [MSGLIST]' Like `reply', except that the composed message is sent only to originators of the specified messages. Notice, that setting mail variable `flipr' (*note Mail Variables::) swaps the meanings of the two above commands, so that `reply' sends the message to the sender and all recipients of the message, whereas `Reply' sends it to originators only. `followup [MSGLIST]' `fo [MSGLIST]' Switches to compose mode. After composing, sends the message to the originators and recipients of all messages in MSGLIST. `Followup [MSGLIST]' `F [MSGLIST]' Similar to `followup', but reply message is sent only to originators of messages in MSGLIST. To determine the sender of the message `mail' uses the list of sender fields (*note Controlling Sender Fields::). 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 block@helsingor.org Fri Jun 30 18:30 8/245 Re: The Sa & Print 1 From: Antonius Block To: Smeden Plog Date: Tue, 27 Apr 2004 13:23:41 +0300 Reply-To: Subject: News Hi Now, you issue the following commands: & sender mail-followup-to reply-to from & reply To: Subject: Re: News As you see, the value of `Reply-To' field was taken as the sender address. Now, let's try the following command sequence: # Clear the sender list & nosender # Set new sender list & sender From Now, the `From' address will be taken: & reply To: Antonius Block Subject: Re: News Controlling Sender Fields ......................... Commands `sender' and `nosender' are used to manipulate the contents of the sender field list. 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: & sender mail-followup-to reply-to from & nosender reply-to & sender mail-followup-to from When used without arguments, this command clears the list: & nosender Sender address is obtained from the envelope Incorporating New Mail ...................... The `incorporate' (`inc') command incorporates newly arrived messages to the displayed list of messages. This is done automatically before returning to `mail' command prompt if the variable `autoinc' is set. Shell Escapes ............. To run arbitrary shell command from `mail' command prompt, use `shell' (`sh') command. If no arguments are specified, the command starts the user login shell. Otherwise, it uses its first argument as a file name to execute and all subsequent arguments are passed as positional parameters to this command. The `shell' command can also be spelled as `!'. 3.4.5 Scripting --------------- Comments ........ The `#' character introduces an end-of-line comment. All characters until and including the end of line are ignored. Displaying Arbitrary Text ......................... The `echo' (`ec') command prints its arguments to stdout. Sourcing External Command Files ............................... The command `source FILENAME' reads commands from the named file. Its minimal abbreviation is `so'. Setting and Unsetting the Variables ................................... The mail variables may be set using `set' (`se') command. The command takes a list of assignments. The syntax of an assignment is `NAME=STRING' Assign a string value to the variable. If STRING contains whitespace characters it must be enclosed in a pair of double-quote characters (`"') `NAME=NUMBER' Assign a numeric value to the variable. `NAME' Assign boolean `True' value. `noNAME' Assign boolean `False' value. Example: & set askcc nocrt indentprefix="> " This statement sets `askcc' to `True', `crt' to `False', and `indentprefix' to "> ". To unset mail variables use `unset'(`uns') command. The command takes a list of variable names to unset. Example: To undo the effect of the previous example, do: & unset askcc crt indentprefix Setting and Unsetting Shell Environment Variables ................................................. Shell environment may be modified using `setenv' (`sete') command. The command takes a list of assignments. The syntax of an assignment is: `NAME=VALUE' If variable NAME does not already exist in the environment, then it is added to the environment with the value VALUE. If NAME does exist, then its value in the environment is changed to VALUE. `NAME' Delete the variable NAME from the environment ("unset" it). 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 statement. 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 if s alt gray@farlep.net gray@mirddin.farlep.net set 3.4.6 How to Alter the Behavior of `mail' ----------------------------------------- Following variables control the behavior of GNU `mail': `appenddeadletter' Type: Boolean. Default: False. If this variable is `True', the contents of canceled letter is appended to the user's `dead.letter' file. Otherwise it overwrites its contents. `askbcc' Type: Boolean. Default: False. When set to `True' the user will be prompted to enter `Bcc' field before composing the message. `askcc' Type: Boolean. Default: True. When set to `True' the user will be prompted to enter `Cc' field before composing the message. `asksub' Type: Boolean. Default: True in interactive mode, False otherwise. When set to `True' the user will be prompted to enter `Subject' field before composing the message. `autoinc' Type: Boolean. Default: True. Automatically incorporate newly arrived messages. `autoprint' Type: Boolean. Default: False. Causes the delete command to behave like dp - thus, after deleting a message, the next one will be typed automatically. `bang' Type: Boolean. Default: False. When set, every occurrence of `!' in arguments to `!' command is replaced with the last executed command. `datefield' Type: Boolean. 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 localtime. Notice, that for messages lacking this field `mail' will fall back to using SMTP envelope. `charset' Type: string Default: `auto' The value of this variable controls the output character set for the header fields encoding using RFC 2047. If the variable is unset, no decoding is performed and the fields are printed as they are. If the variable is set to `auto', `mail' tries to deduce the name of the character set from the value of `LC_ALL' environment variable. Otherwise, its value is taken as the name of the charset. `cmd' Type: String. Default: Unset. Contains default shell command for `pipe'. `columns' Type: Numeric. 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. `crt' Type: Boolean or Numeric Default: True in interactive mode, False otherwise. 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. `decode-fallback' Type: String. 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'. `dot' Type: Boolean. Default: False. If `True', causes `mail' to interpret a period alone on a line as the terminator of a message you are sending. `emptystart' Type: Boolean. Default: False. If the mailbox is empty, `mail' normally prints `No mail for user' and exits immediately. If this option is set, `mail' will start no matter is the mailbox empty or not. `editheaders' Type: Boolean. 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. `escape' Type: String. Default: ~ If defined, the first character of this option gives the character to denoting escapes. `flipr' Type: Boolean Default: Unset The variable `flipr' if set swaps the meanings of `reply' and `Reply' commands (*note Replying::). `folder' Type: String. Default: Unset. The name of the directory to use for storing folders of messages. If unset, `$HOME' is assumed. `header' Type: Boolean. Default: True, unless started with `--nosum' (`-N') option. Whether to run `headers' command automatically after entering interactive mode. `hold' Type: Boolean. Default: False. When set to `True', the read or saved messages will be stored in user's mailbox (`$HOME/mbox'). Otherwise, they will be held in system mailbox also. This option is in effect only when operating upon user's system mailbox. `ignore' Type: Boolean. 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. `ignoreeof' Type: Boolean. Default: False. Controls whether typing EOF character terminates the letter being composed. `indentprefix' Type: String. Default: "\t" (a tab character). String used by the `~m' tilde escape for indenting quoted messages. `inplacealiases' Type: Boolean Default: False If set, `mail' will expand aliases in the address header field before entering send mode (*note Composing Mail::). By default, the address header fields are left intact while composing, the alias expansion takes place immediately before sending message. `keepsave' Type: Boolean. Default: False. Controls whether saved messages should be kept in system mailbox too. This variable is in effect only when operating upon a user's system mailbox. `mailx' Type: Boolean. 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 composing 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. `metamail' Type: Boolean or String. Default: True. 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" `mimenoask' Type: String Default: Empty By default `mail' asks for comnfirmation 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 subtype is, and before displaying files with type `image/jpeg'. `metoo' Type: Boolean. 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. `mode' Type: String. Default: The name of current operation mode. Setting this variable does not affect the operation mode of the program. `nullbody' Type: Boolean 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 example, 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' `nullbodymsg' Type: String Default: Null message body; hope that's ok Keeps the text of the warning, displayed by `mail' before sending an empty message. When available, the translation of this text, in accordance with the current locale, is displayed. Unsetting this variable disables the warning. `outfolder' Type: String. Default: Unset. Contains the directory in which files created by `save', `write', etc. commands will be stored. When unset, current directory is assumed. `page' Type: Boolean. Default: False. If set to `True', the `pipe' command will emit a linefeed character after printing each message. `prompt' Type: String. Default: "? " Contains the command prompt sequence. `quit' Type: Boolean. Default: False, unless started with `--quit' (`-q') option. When set, causes keyboard interrupts to terminate the program. `rc' Type: Boolean. Default: True, unless started with `--norc' (`-N') option. When this variable is set, `mail' will read the system-wide configuration file upon startup. See *note Mail Configuration Files::. `record' Type: String. Default: Unset. When set, any outgoing message will be saved to the named file. `recursivealiases' Type: Boolean Default: True When set, `mail' will expand aliases recursively. `regex' Type: Boolean. Default: True. Setting this to `True' enables use of regular expressions in `/.../' message specifications. `replyprefix' Type: String Default: `Re: ' Sets the prefix that will be used when constructing the subject line of a reply message. `replyregex' Type: String 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 expression 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). `save' Type: Boolean. Default: True. When set, the aborted messages will be stored in the user's `dead.file'. See also `appenddeadletter'. `screen' Type: Numeric. 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. `sendmail' Type: String. Default: sendmail:/usr/lib/sendmail Contains the URL of mail transport agent. `Sign' Type: String. 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. `sign' Type: String. 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. `showto' Type: Boolean 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. `subject' Type: String. Default: Unset. Contains default subject line. This will be used when `asksub' is off. `toplines' Type: Numeric. Default: 5 Number of lines to be displayed by `top' and `Top' commands. `verbose' Type: Boolean. Default: False. When set, the actual delivery of messages is displayed on the user's terminal. `xmailer' Type: Boolean. Default: Set. Controls whether the header `X-Mailer' should be added to outgoing messages. The default value of this header is X-Mailer: mail (GNU Mailutils 1.2) 3.4.7 Personal and System-wide Configuration Files -------------------------------------------------- Upon startup, `mail' reads the contents of the two command files: the system-wide configuration file, and the user's configuration file. Each line read from these files is processed like a usual `mail' command. When run with `--norc' (`-N') option, `mail' does not read the contents of system-wide configuration file. The user's file, if it exists, is always processed. The user's configuration file is located in the user's home directory and is named `.mailrc'. The location and name of the system-wide configuration file is determined when configuring the package via `--with-mail-rc' option. It defaults to `SYSCONFDIR/mail.rc'. 3.5 `messages' -- Count the Number of Messages in a Mailbox =========================================================== `Messages' prints on standard output the number of messages contained in each folder specified in command line. If no folders are specified, it operates upon user's system mailbox. For each folder, the following output line is produced: Number of messages in FOLDER: NUMBER where FOLDER represents the folder name, NUMBER represents the number of messages. The program uses following option groups: *Note mailbox::. The program accepts following command line options: `-q' `--quiet' `-s' `--silent' Be quiet. Display only number of messages per mailbox, without leading text. `-?' `--help' Output help message and exit. `--usage' Output short usage summary and exit. `-V' `--version' Output program version and exit. 3.6 `movemail' -- Moves Mail from the User Maildrop to the Local File ===================================================================== The purpose of `movemail', as its name implies, is to move mail from one location to another. For example, the following invocation: movemail /var/mail/smith INBOX moves messages from file `/var/mail/smith' to file `INBOX'. You will probably never have to run this program manually. It is intended as a replacement for `movemail' from GNU Emacs. The `movemail' program is run by Emacs `Rmail' module. *Note Rmail: (emacs)Rmail, for detailed description of `Rmail' interface. Mailutils version of `movemail' is completely backward-compatible with its Emacs predecessor, so it should run flawlessly with older versions of Emacs. Emacs version 21.4, which is being developed at the time of this writing, will contain improved `Rmail' interface for work with mailutils `movemail'. 3.6.1 Movemail Options ---------------------- This subsection discusses `movemail' options from the point of view of an Emacs `Rmail' user. To set various options to `movemail' from `Rmail', use `rmail-movemail-flags' variable, or `Rmail Movemail Flags' section from the menu. Some POP servers return messages in reversed order. To fix the order, use `-p' option or its synonym `--reverse'. If the remote server supports TLS encryption, use `--tls' to instruct `movemail' to initiate encrypted connection. Quite a few options control how `movemail' handles mail locking (a way of preventing simultaneous access to the source mailbox). By default, before accessing mailbox FILE, `movemail' will first see if the file named `FILE.lock' (so called "lock file") exists. If so, it will assume that the mailbox is being used by another program and will sleep one second. If `FILE.lock' file disappears after this wait period, the program will proceed. Otherwise, it will repeat this action ten times. If after ten wait periods the lock file does not disappear, `movemail' gives up and exits. If the lock file does not exist, `movemail' will create it, thereby indicating to other programs that the mailbox is being used, and will proceed to copying messages to the destination file. When finished, `movemail' closes the mailbox and removes the lock file. Several options control this behavior. To change the default sleep period use `--lock-retry-timeout'. Its argument is the timeout value in seconds. To change number of retries, use `--lock-retry-count'. For example, setting `rmail-movemail-flags' to --lock-retry-timeout=2 --lock-retry-count=5 instructs `movemail' to make five attempts to acquire the lock file, with two-second intervals between the attempts. You may also force `movemail' to remove the lock file if it is older than a given amount of time (a so called "stale lock file"). To do so, use the following option: --lock-expire-timeout=SECONDS The `--lock-expire-timeout' sets the number of seconds after which a lock file is considered stale. There are special programs that can be used to lock and unlock mailboxes. A common example of such programs is `dotlock'. If you wish to use such "external locking program" instead of the default mailutils locking mechanism, use option `--external-locker'. Argument to this option specifies the full name of the external program to use. 3.6.2 Summary of Movemail Usage ------------------------------- movemail [OPTION...] INBOX DESTFILE [REMOTE-PASSWORD] The first argument, INBOX, is the url (*note URL::) of the source mailbox. The second argument, DESTFILE, traditionally means destination file, i.e. the UNIX mailbox to copy messages to. However, mailutils `movemail' extends the meaning of this parameter. You may actually specify any valid url as DESTFILE parameter.(1). Finally, optional third argument is a traditional way of specifying user passwords for remote (POP or IMAP) mailboxes. Following is the summary of available command line options: `--emacs' Output information used by Emacs rmail interface `-p' `--preserve' `--keep-messages' Preserve the source mailbox `-r' `--reverse' Reverse the sorting order `--license' Print GPL license and exit `--external-locker=PROGRAM' Use given PROGRAM as the external locker program. `--lock-expire-timeout=SECONDS' Set number of seconds after which the lock expires `--lock-flags=FLAGS' Set locker flags. FLAGS is composed of the following letters: `E' - use external locker program `dotlock', `R' - retry 10 times if acquiring of the lock failed (see also `--lock-retry-count' below), `T' - remove stale locks after 10 minutes (see also `--lock-expire-timeout', and `P' - write process PID to the lock file. `--lock-retry-count=NUMBER' Set the maximum number of times to retry acquiring the lockfile `--lock-retry-timeout=SECONDS' Set timeout for acquiring the lockfile `-m URL' `--mail-spool URL' Use specified URL as a mailspool directory `--tls[=BOOL]' Enable (default) or disable TLS support ---------- Footnotes ---------- (1) Rmail does not use this feature 3.7 `readmsg' -- Extract Messages from a Folder =============================================== The program, readmsg, extracts with the selection argument messages from a mailbox. Selection can be specify by: 1. A lone "*" means select all messages in the mailbox. 2. A list of message numbers may be specified. Values of "0" and "$" in the list both mean the last message in the mailbox. For example: readmsg 1 3 0 extracts three messages from the folder: the first, the third, and the last. 3. Finally, the selection may be some text to match. This will select a mail message which exactly matches the specified text. For example, readmsg staff meeting extracts the message which contains the words "staff meeting." Note that it will not match a message containing "Staff Meeting" - the matching is case sensitive. Normally only the first message which matches the pattern will be printed. Command line options .................... `-a' `--show-all' If a pattern is use for selection show all messages that match pattern by default only the first one is presented. `-d' `--debug' Display mailbox debugging information. `-f MAILBOX' `--folder=MAILBOX' Specified the default mailbox. `-h' `--header' Show the entire header and ignore the weedlist. `-n' `--no-header' Do not print the message header. `-p' `--form-feed' Put form-feed (Control-L) between messages instead of newline. `-w WEEDLIST' `--weedlist=WEEDLIST' A whitespace or coma separated list of header names to show per message. Default is -weedlist="From Subject Date To CC Apparently-" 3.8 `sieve' =========== Sieve is a language for filtering e-mail messages at time of final delivery, described in RFC 3028. GNU Mailutils provides two implementations of this language: a stand-alone "sieve interpreter" and a "sieve translator and filter". The following sections describe these utilities in detail. 3.8.1 A Sieve Interpreter ------------------------- Sieve interpreter `sieve' allows to apply Sieve scripts to an arbitrary number of mailboxes. GNU `sieve' implements a superset of the Sieve language as described in RFC 3028. *Note Sieve Language::, for a description of the Sieve language. *Note GNU Extensions::, for a discussion of differences between the GNU implementation of Sieve and its standard. Invoking `sieve' ................ The `sieve' invocation syntax is: sieve [OPTIONS] SCRIPT where SCRIPT denotes the filename of the sieve program to parse, and OPTIONS is one or more of the following: `-c' `--compile-only' Compile script and exit. `-d[FLAGS]' `--debug[=FLAGS]' Specify debug flags. The FLAGS argument is a sequence of one or more of the following letters: `g' Enable main parser traces `T' Enable mailutil traces `P' Trace network protocols `t' Enable sieve trace `i' Trace the program instructions `-D' `--dump' Compile the script, dump disassembled code on standard output and exit. `-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. `-f' `--mbox-url=MBOX' Mailbox to sieve (defaults to user's system mailbox) `-k' `--keep-going' Keep on going if execution fails on a message `-n' `--no-actions' Dry run: do not execute any actions, just print what would be done. `-t TICKET' `--ticket=TICKET' Ticket file for mailbox authentication `-v' `--verbose' Log all actions executed. Apart from these, `sieve' understands the options from the following groups: `sieve', `mailbox', `mailer', `logging'. Logging and debugging ..................... The default behavior of `sieve' is to remain silent about anything except errors. However, it is sometimes necessary to see which actions are executed and on which messages. This is particularly useful when debugging the sieve scripts. The `--verbose' (`-v') option outputs log of every action executed. Option `--debug' allows to produce even more detailed debugging information. This option takes an argument specifying the debugging level to be enabled. The argument can consist of the following letters: ``t'' This flag enables sieve tracing. It means that every test will be logged when executed. ``T'' This flag enables debugging of underlying `mailutils' library. ``P'' Trace network protocols: produces log of network transactions executed while running the script. ``g'' Enable main parser traces. This is useful for debugging the sieve grammar. ``i'' Trace the program instructions. It is the most extensive debugging level. It produces the full execution log of a sieve program, showing each instruction and states of the sieve machine. It is only useful for debugging the code generator. _Note_, that there should be no whitespace between the short variant of the option (`-d'), and its argument. Similarly, when using long option (`--debug'), its argument must be preceded by equal sign. If the argument to `--debug' is omitted, it defaults to `TPt'. Option `--dump' produces the disassembled dump of the compiled sieve program. By default `sieve' output all diagnostics on standard error and verbose logs on standard output. This behaviour is changed when `--log-facility' is given in the command line (*note logging::). This option causes `sieve' to output its diagnostics to the given syslog facility. Extending `sieve' ................. The basic set of sieve actions, tests and comparators may be extended using loadable extensions. Usual `require' mechanism is used for that. When processing arguments for `require' statement, `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. The value of the environment variable `LTDL_LIBRARY_PATH'. 3. Additional search directories specified with the `#searchpath' directive. 4. 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, `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, `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 3.8.2 A Sieve to Scheme Translator and Filter --------------------------------------------- A Sieve to Scheme Translator `sieve.scm' translates a given Sieve script into an equivalent Scheme program and optionally executes it. The program itself is written in Scheme and requires presence of Guile 1.4 on the system. For more information on Guile refer to *note Overview: (guile)Top. `-f FILENAME' `--file FILENAME' Set input file name. `-o FILENAME' `--output FILENAME' Set output file name `-L DIRNAME' `--lib-dir DIRNAME' Set sieve library directory name `-d LEVEL' `--debug LEVEL' Set debugging level The Scheme programs produced by `sieve.scm' can be used with `guimb' or `mail.local'. 3.9 `guimb' -- A Mailbox Scanning and Processing Language ========================================================= `Guimb' is for mailboxes what `awk' is for text files. It processes mailboxes, applying the user-supplied scheme procedures to each of them in turn and saves the resulting output in mailbox format. The program uses following option groups: *Note mailbox::. Specifying Scheme Program to Execute ------------------------------------ The Scheme program or expression to be executed is passed to `guimb' via the following options: `-s FILE' `--source FILE' Load Scheme source code from FILE. `-c EXPR' `--code EXPR' Execute given scheme expression. The above switches stop further argument processing, and pass all remaining arguments as the value of `(command-line)'. If the remaining arguments must be processed by `guimb' itself, use following options: `-e EXPR' `--expression EXPR' Execute scheme expression. `-f FILE' `--file FILE' Load Scheme source code from FILE. You can specify both of them. In this case, the FILE is read first, then EXPR is executed. You may still pass any additional arguments to the script using `--guile-arg' option. Specifying Mailboxes to Operate Upon ------------------------------------ There are four basic ways of passing mailboxes to `guimb'. `guimb [OPTIONS] [MAILBOX...]' The resulting mailbox is not saved, unless the user-supplied scheme program saves it. `guimb [OPTIONS] --mailbox DEFMBOX' The contents of DEFMBOX is processed and is replaced with the resulting mailbox contents. Useful for applying filters to user's mailbox. `guimb [OPTIONS] --mailbox DEFMBOX MAILBOX [MAILBOX...]' The contents of specified mailboxes is processed, and the resulting mailbox contents is appended to DEFMBOX. `guimb [OPTIONS] --user USERNAME [MAILBOX...]' The contents of specified mailboxes is processed, and the resulting mailbox contents is appended to the user's system mailbox. This allows to use `guimb' as a mail delivery agent. If no mailboxes are specified in the command line, `guimb' reads and processes the system mailbox of the current user. Passing Options to Scheme ------------------------- Sometimes it is necessary to pass some command line options to the scheme procedure. There are three ways of doing so. When using `--source' (`-s') or `--code' (`-c') options, all the rest of the command line following the option's argument is passed to Scheme program verbatim. This allows for making guimb scripts executable by the shell. If your system supports `#!' magic at the start of scripts, add the following two lines to the beginning of your script to allow for its immediate execution: #! /usr/local/bin/guimb -s !# (replace `/usr/local/bin/' with the actual path to the `guimb'). Otherwise, if you use `--file' or `--expression' options, the additional arguments may be passed to the Scheme program `-g' (`--guile-arg') command line option. For example: guimb --guile-arg -opt --guile-arg 24 --file PROGFILE In this example, the scheme procedure will see the following command line: PROGFILE -opt 24 Finally, if there are many arguments to be passed to Scheme, it is more convenient to enclose them in `-{' and `-}' escapes: guimb -{ -opt 24 -} --file PROGFILE Command Line Option Summary --------------------------- This is a short summary of the command line options available to `guimb'. `-d' `--debug' Start with debugging evaluator and backtraces. `-e EXPR' `--expression EXPR' Execute given Scheme expression. `-m PATH' `--mail-spool=PATH' Set path to the mailspool directory `-f PROGFILE' `--file PROGFILE' Read Scheme program from PROGFILE. `-g ARG' `--guile-command ARG' Append ARG to the command line passed to Scheme program. `-{ ... -}' Pass all command line options enclosed between `-{' and `-}' to Scheme program. `-m' `--mailbox MBOX' Set default mailbox name. `-u' `--user NAME' Act as local MDA for user NAME. `-h' `--help' Display help message. `-v' `--version' Display program version. 3.10 `mail.local' -- Deliver Mail to the Local Mailbox ====================================================== `mail.local' reads the standard input up to an end-of-file and appends the received data to the local mailboxes. 3.10.1 Invoking `mail.local' ---------------------------- General usage of `mail.local' program is: mail.local [OPTION...] RECIPIENT [RECIPIENT ...] If recipient part is present is a FQDN, `mail.local' will attempt to deliver to a virtual host. The program uses following option groups: *Note mailbox::, *Note auth::, *Note logging::, *Note sieve::. `-f ADDR' `--from ADDR' Specify the sender's name. This option forces `mail.local' to add `From ' envelope to the beginning of the message. If it is not specified, `mail.local' first looks into the first line from the standard input. If it starts with `From ', it is assumed to contain a valid envelope. If it does not, `mail.local' creates the envelope by using current user name and date. `-h' `--help' Display usage summary and exit. `-L' `--license' Display GNU General Public License and exit. `-m PATH' `--mail-spool PATH' Specify path to mailspool directory. `-q' `--quota-db FILE' Specify path to DBM mailbox quota database (*note Mailbox Quotas::). `--quota-query' Specify SQL query that should be used to obtain user mailbox quotas from the SQL database (*note Mailbox Quotas::). `-s PATTERN' `--source PATTERN' Set name pattern for user-defined mail filters written in Scheme (*note Scheme Filters::). The metacharacters `%u' and `%h' in the pattern are expanded to the current recipient user name and home directory correspondingly. This option is available only if the package has been configured to use Guile extension language. `-S PATTERN' `--sieve PATTERN' Set name pattern for user-defined mail filters written is Sieve (*note Sieve Filters::). The metacharacters `%u' and `%h' in the pattern are expanded to the current recipient user name and home directory correspondingly. `-t NUMBER' `--timeout NUMBER' Wait NUMBER seconds for acquiring the lockfile. If it doesn't become available after that amount of time, return failure. The timeout defaults to 5 minutes. `-x FLAGS' `--debug FLAGS' Enable debugging. The debugging information will be output using syslog. The FLAGS is a string consisting of the following flags: Debug flags are: `g' Start with guile debugging evaluator and backtraces. This is convenient for debugging user-defined filters (*note Scheme Filters::). `T' Enable libmailutil traces (`MU_DEBUG_TRACE'). `P' Enable network protocol traces (`MU_DEBUG_PROT') `t' Enable sieve trace (`MU_SIEVE_DEBUG_TRACE') `l' Enable sieve action logs The digits in the range `0' - `9' used in FLAGS set `mail.local' debugging level. `-v' `--version' Display program version and exit. `--ex-multiple-delivery-success' Don't return errors when delivering to multiple recipients. `--ex-quota-tempfail' Return temporary failure if disk or mailbox quota is exceeded. By default, 'service unavailable' is returned if the message exceeds the mailbox quota. 3.10.2 Using `mail.local' with Various MTAs ------------------------------------------- This section explains how to invoke `mail.local' from configuration files of various Mail Transport Agents. All examples in this section suppose that `mail.local' must receive following command line switches: -s %h/.filter.scm -q /etc/mail/userquota Using `mail.local' with Sendmail ................................ The `mail.local' must be invoked from the local mailer definition in the `sendmail.cf' file. It must have the following flags set `lswS', meaning the mailer is local, the quote characters should be stripped off the address before invoking the mailer, the user must have a valid account on this machine and the userid should not be reset before calling the mailer. Additionally, `fn' flags may be specified to allow `mail.local' to generate usual `From ' envelope instead of the one supplied by sendmail. If you wish to use mail.local with SQL authentication, you may wish to remove the `w' flag, since in that case the user is not required to have a valid account on the machine that runs `sendmail'. Here is an example of mailer definition in `sendmail.cf' Mlocal, P=/usr/local/libexec/mail.local, F=lsDFMAw5:/|@qSPfhn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, T=DNS/RFC822/X-Unix, A=mail $u To define local mailer in `mc' source file, it will suffice to set: define(`LOCAL_MAILER_PATH', `/usr/local/libexec/mail.local') define(`LOCAL_MAILER_ARGS', `mail $u') Using `mail.local' with Exim ............................ Using `mail.local' with Exim is quite straightforward. The following example illustrates the definition of appropriate transport and director in `exim.conf': # transport mail_local_pipe: driver = pipe command = /usr/local/libexec/mail.local $local_part return_path_add delivery_date_add envelope_to_add # director mail_local: driver = localuser transport = mail_local_pipe 3.10.3 Setting up Mailbox Quotas -------------------------------- Sometimes it is necessary to limit the maximum size of a user's mailbox. Such maximum size is called "mailbox quota" for this user. When delivering a message, `mail.local' first cheks if the mailbox quota is specified for the recipient. If so, `mail.local' computes the difference between the quota value and the actual size of the recipient's mailbox. This difference represents the maximum size of the message the receipient's mailbox is able to accomodate. Let's call it MSIZE. Depending on its value, `mail.local' takes decision on whether to deliver the message. There are three possible cases: 1. MSIZE equals zero. This means that the mailbox size has reached its limit). In this case the message is not delivered and the sender receives following notification message: USER: mailbox quota exceeded for this recipient 2. MSIZE is less than the size of the message `mail.local' is about to deliver. In this case the message is not delivered and the sender receives following notification message: USER: message would exceed maximum mailbox size for this recipient 3. MSIZE is greater than or equal to the size of the message. In this case `mail.local' does deliver the message. Version 1.2 of GNU mailutils is able to retrieve mailbox quotas from a DBM or SQL database. 3.10.3.1 Keeping Quotas in DBM Database ....................................... To use the DBM quota database, your copy of `mailutils' must be compiled with DBM support (one of `--with-gdbm', `--with-db2', `--with-ndbm', `--with-dbm' options to `configure'). Examine the of `mail.local --show-config-options' if not sure. The quota database should have the following structure: Key Key represents the user name. Special key `DEFAULT' means default quota value, i.e. the one to be used if the user is not explicitely listed in the database. Value The mailbox quota for this user. If it is a number, it represents the maximum mailbox size in bytes. A number may optionally be followed by `kb' or `mb', meaning kilobytes and megabytes, respectively. A special value `NONE' means no mailbox size limitation for this user. Here is an example of a valid quota database # Default quota value: DEFAULT 5mb # Following users have unlimited mailbox size root NONE smith NONE # Rest of users plog 26214400 karin 10mB To use the DBM database, specify its full name using `-q' or `--quota-db' in the invocation of `mail.local'. For example, in `sendmail' `.mc' file: define(`LOCAL_MAILER_PATH', `/usr/local/libexec/mail.local') define(`LOCAL_MAILER_ARGS', `mail -q /etc/mail/quota.db $u') 3.10.3.2 Keeping Quotas in SQL Database ....................................... Option `--quota-query' allows to specify a special query to retrieve the quota from the database. Currently (as of mailutils version 1.2) it is assumed that this table can be accessed using the same credentials as SQL authentication tables (*Note daemon::, for the detailed discussion of `--sql-' options). For example, suppose you have the following quota table: create table mailbox_quota ( user_name varchar(32) binary not null, quota int, unique (user_name) ); To retrieve the quota for user `%u' you may then use the following query: SELECT quota FROM mailbox_quota WHERE user_name='%u' There is no special provisions for specifying group quotas, similar to `DEFAULT' in DBM databases. This is because group quotas can easily be implemented using SQL language. `Mail.local' always uses the first tuple from the set returned by mailbox quota query. So, you may add a special entry to the `mailbox_quota' table that would keep the group quota. For the following discussion, it is important that the `user_name' column for this entry be lexicographically less than any other user name in the table. Let's suppose the group quota name is `00DEFAULT'. Then the following query: SELECT quota FROM mailbox_quota WHERE user_name IN ('%u','00DEFAULT') ORDER BY user_name DESC will return two tuples if user `%u' is found in `mailbox_quota'. Due to `ORDER' statement, the first tuple will contain the quota for the user, which will be used by `mail.local'. On the other hand, if user name `%u' is not present in the table, the above query will return a single tuple containing the group quota. To summarize this, here is a working `mailutils.rc' entry for `mail.local': :mail.local \ --sql-db MAILAUTH \ --sql-host some.host.net \ --sql-user mail.local \ --sql-passwd guessme \ --quota-query "SELECT quota \ FROM mailbox_quota \ WHERE user_name IN ('%u','00DEFAULT') \ ORDER BY user_name DESC" 3.10.4 Implementing User-defined Sieve Mail Filters --------------------------------------------------- 3.10.5 Implementing User-defined Scheme Mail Filters ---------------------------------------------------- 3.11 `mail.remote' -- Pseudo-Sendmail Interface for Mail Delivery ================================================================= [FIXME] 3.12 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 Common UNIX Printing System, see `man mime.types' for the description of its syntax. [FIXME: provide an xref to CUPS]. 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 The following table summarizes options specific for `mimeview': `-a[TYPE-LIST]' `--no-ask[=TYPE-LIST]' By default `mimeview' asks for comnfirmation before running interpreter to view a message. If this option is used without argument, it disables the default behavior for all message types. Otherwise, if argument TYPE-LIST is given, it specifies a comma-separated list of MIME types for which no questions should be asked. Elements of this list may include shell-style globbing patterns, e.g. setting --no-ask='text/*,image/jpeg' will disable prompting before displaying any textual files, no matter what their subtype is, and before displaying files with type `image/jpeg'. Notice, that when the long form is used, its argument must be separated from the option by a single equal sign, as shown in the example above. When the short form (`-a') is used, its argument must follow the option immediately, without any intervening whitespace, e.g. `-a'text/*''). `-d[FLAGS]' `--debug[=FLAGS]' Enables debugging output. FLAGS is a sequence of characters specifying the desired debugging level. Following characters are meaningful in FLAGS: g Enables debugging of `mime.types' parser l Enables debugging of `mime.types' lexical analyzer (warning: produces _very_ copious output) 1 Prints basic information about actions to be executed and reports about exit status of executed commands. 2 Additionally displays each file name along with its MIME type 3 Additionally traces the process of looking up the matching entry in `mailcap' files. digits from 4 to 9 The same as 3, currently. If FLAGS are not given, the default `9' is assumed. `--metamail[=FILE]' Run `metamail' to display files, instead of using the internal mechanisms. If FILE is specified, it is taken as `metamail' command line. `-h' `--no-interactive' `--print' This options tells `mimeview' that it should run in non-interactive mode. In this mode prompting is disabled, and the normal mailcap `command' field is not executed. Instead `mimeview' will execute the command specified in the `print' field. If there is nothing in the print field, the mailcap entry is ignored and the search continues for a matching mailcap entry that does have a `print' field. Notice, that unlike in `metamail -h', this option does not force `mimeview' to send the output to the printer daemon. When used with `--metamail' option, this option passes `-h' flag to the invocation of `metamail'. By default `mimeview' behaves as if given `--no-interactive' option whenever its standard input is not a tty device. `-n' `--dry-run' Do not do anything, just print what whould be done. Implies `--debug=1', unless the debugging level is set up explicitely. `-t FILE' `--mimetypes FILE' Use FILE as `mime.types' file. If FILE is a directory, use `FILE/mime.types' ---------- Footnotes ---------- (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. 3.13 POP3 Daemon ================ The `pop3d' daemon implements the Post Office Protocol Version 3 server. `pop3d' has two operation modes: Inetd The server is started from `/etc/inetd.conf' file: pop3 stream tcp nowait root /usr/local/sbin/pop3d pop3d This is the default operation mode. Standalone The server runs as daemon, forking a child for each new connection. This mode is triggered by `-d' command line switch. The program uses following option groups: *Note mailbox::, *Note daemon::, *Note logging::, *Note auth::. 3.13.1 Login delay ------------------ POP3 clients often login frequently to check for new mail. Each new connection implies authenticating the user and opening his maildrop and can be very resource consuming. To reduce server load, it is possible to impose a minimum delay between any two consecutive logins. This is called `LOGIN-DELAY' capability and is described in RFC 2449. As of version 1.2, GNU Mailutils `pop3d' allows to set global login delay, i.e. such enforcement will affect all POP3 users. If a user attempts to log in before the specified login delay expires, he will get the following error message: -ERR [LOGIN-DELAY] Attempt to log in within the minimum login delay interval The message will be issued after a valid password is entered. This prevents this feature from being used by malicious clients for account harvesting. To enable the login delay capability, specify the minimum delay in seconds with `--login-delay' option, for example: $ pop3d --login-delay=60 The `pop3d' utility keeps each user's last login time in a special DBM file, called "login statistics database", so to be able to use this feature, Mailutils must be compiled with DBM support. By default, the login statistics database is called `/var/run/pop3-login.db'. You can change its name at run time using `--stat-file': $ pop3d --login-delay=60 --stat-file=/tmp/pop.login Notice, that there is no need to include the `.db' suffix in the file name. The login delay facility will be enabled only if `pop3d' is able to access the statistics database for both reading and writing. If it is not, it will report this using `syslog' and start up without login delay restrictions. The common error message looks like: Unable to open statistics db: Operation not permitted You can check whether your `pop3d' uses login delays by connecting to it and issuing the `CAPA' command. If login delays are in use, there response will contain the string `LOGIN-DELAY N', where N is the actual login delay value. 3.13.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' command line option: $ pop3d --expire=DAYS Here, DAYS specifies the minimum server retention period, in days, for retrieved messages on the server. 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' command line option. 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' command. The option `--expire=0' means the client is not permitted to leave mail on the server. It always implies `--delete-expired'. 3.13.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 announcements 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' command line option. If both the database and the `.popbull' file are present, the data from the database take precedence. To enable this feature, use the following command line options: `--bulletin-source=MBOX' Set the URL of the bulletin source mailbox. `--bulletin-db=FILE' Set the name of the database file to keep last bulletin numbers in. Be sure not to specify `.db' extension. 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': $ pop3d --bulletin-source=mh:/var/spool/bull/mbox \ --bulletin-db=/var/spool/bull/numbers 3.13.4 Command line options --------------------------- The following table summarizes all `pop3d' command line options. `--bulletin-db=FILE' Set the name of the database file to keep last bulletin numbers in. Be sure not to specify `.db' extension. *Note Bulletins::. `--bulletin-source=MBOX' Set the URL of the bulletin source mailbox. *Note Bulletins::. `-d[NUMBER]' `--daemon[=NUMBER]' Run in standalone mode. An optional NUMBER specifies the maximum number of child processes allowed to run simultaneously. When it is omitted, it defaults to 10 processes. _Please note_, that there should be no whitespace between the `-d' and its parameter. `--delete-expired' Delete expired messages upon closing the mailbox. *Note Auto-expire::. `--expire=DAYS' Expire read messages after the given number of days. If DAYS is 0, this option implies `--delete-expired'. *Note Auto-expire::. `-i' `--inetd' Run in inetd mode. `-h' `--help' Display short help message and exit. `--login-delay=SECONDS' Sets the minimum allowed delay between closing a pop3d session and opening it again with the same user name. *Note Login delay::. `-m PATH' `--mail-spool=PATH' Set path to the mailspool directory `-p NUMBER' `--port NUMBER' Listen on given port NUMBER. This option is meaningful only in standalone mode. It defaults to port 110. `--stat-file=FILENAME' Sets the name of the login timestamp database, used with `--login-delay'. By default, these data are kept in `/var/run/pop3-login'. Be sure to specify the file name _without_ DBM-specific suffix. *Note Login delay::. `-t NUMBER' `--timeout NUMBER' Set idle timeout to given NUMBER of seconds. Default is 600 seconds (10 minutes). The daemon breaks the connection if it receives no commands from the client within that number of seconds. `--tls-required' Always require `STLS' command before entering authentication phase. `-v' `--version' Display program version and exit. `--undelete' Remove all deletion marks from the messages after opening the mailbox. 3.14 IMAP4 Daemon ================= GNU `imap4d' is a daemon implementing IMAP4 rev1 protocol for accessing and handling electronic mail messages on a server. It can be run either as a standalone program or from `inetd.conf' file. 3.14.1 Namespace ---------------- GNU `imap4d' supports a notion of "namespaces" defined in RFC 2342. A namespace is a set of directories upon which the user has certain permissions. It should be understood that these permissions apply only if the underlying filesystem allows them. The three namespaces supported by `imap4d' are: 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. 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. However, 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. 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, `imap4d' starts with the following namespaces: Personal Namespace The home directory of the user, if exists. Other Users' Namespace Empty Shared Namespace Empty _Note_, that this means that by default, a user won't be able to see or otherwise access mailboxes residing in the directories other than his own home. To change these defaults, use `--shared-namespace' and `--other-namespace' options. 3.14.2 Starting `imap4d' ------------------------ `imap4d' may run either in "standalone" or in "inetd" operation modes. When run in "standalone" mode, the server disconnects from the terminal and runs as a daemon, forking a child for each new connection. The "inetd" mode allows to start the server from `/etc/inetd.conf' file. This is the default operation mode. imap4 stream tcp nowait root /usr/local/sbin/imap4d imap4d The program uses following option groups: *Note mailbox::, *Note daemon::, *Note logging::, *Note auth::. Command Line Options -------------------- `--create-home-dir[=MODE]' If a user logs in and his home directory does not exist, create it. Optional MODE is an octal number specifying the permissions to be set on the created directory. It is not modified by the current `umask' value. The default value for MODE is `700' (`drwx------' in `ls' terms). `-d[NUMBER]' `--daemon[=NUMBER]' Run in standalone mode. An optional NUMBER specifies the maximum number of child processes the daemon is allowed to fork. When it is omitted, it defaults to 20 processes. _Please note_, that there should be no whitespace between the `-d' and its parameter. `-h' `--help' Display short help message and exit. `-i' `--inetd' Run in inetd mode. `-m PATH' `--mail-spool=PATH' Set path to the mailspool directory `-O PATHLIST' `--other-namespace=PATHLIST' Set the list of directories forming the "Other User's" namespace. PATHLIST is a list of directory names separated by colons. `-p NUMBER' `--port NUMBER' Listen on given port NUMBER. This option is meaningful only in standalone mode. It defaults to port 143. `-S PATHLIST' `--shared-namespace=PATHLIST' Set the list of directories, forming the "Shared" namespace. PATHLIST is a list of directory names separated by colons. `-t NUMBER' `--timeout NUMBER' Set idle timeout to given NUMBER of seconds. Default is 1800 seconds (30 minutes). The daemon breaks the connection if it receives no commands from the client within that number of seconds. `-v' `--version' Display program version and exit. 3.15 Comsat Daemon ================== Comsatd is the server which receives reports of incoming mail and notifies users, wishing to get this service. It can be started either from `inetd.conf' or as a standalone daemon. 3.15.1 Starting `comsatd' ------------------------- `Comsatd' uses following option groups: *Note mailbox::, *Note daemon::, *Note logging::. `-c FILE' `--config FILE' Read configuration from given FILE. For more information about comsatd configuration files, see *note Configuring comsatd::. `-d' `--daemon' Run as a standalone daemon. `-i' `--inetd' The server is started from `/etc/inetd.conf' file: comsat dgram udp wait root /usr/sbin/comsatd \ comsatd -c /etc/comsat.conf This is the default operation mode. `-m PATH' `--mail-spool=PATH' Set path to the mailspool directory `-p NUMBER' `--port NUMBER' Specify the port number to listen on. Default is 512. `-v' `--version' Output version and exit successfully. `-h' `--help' Display short help message and exit. 3.15.2 Configuring `comsatd' ---------------------------- The configuration parameters for `comsatd' are kept in a single configuration file. The file uses line-oriented format: each line contains a single statement. Comments are introduced with the `#' sign and empty lines are ignored. You can specify the configuration file to use by using `-c' or `--config' command line switch. The configuration file statements can logically be subdivided into "General Settings", "Security Settings" and "Access Control Lists". The following sections address each of these statement group in detail. General Settings ................ These statements control the general behavior of the comsat daemon: max-lines NUMBER Set maximum number of message body lines to be output. allow-biffrc ( yes | no ) Enable or disable processing of user's `.biffrc' file. By default, it is enabled. Security Settings ................. These statements control the way `comsatd' fights possible flooding attacks. max-requests NUMBER Set maximum number of incoming requests per `request-control-interval'. request-control-interval NUMBER Set the request control interval (seconds). overflow-delay-time NUMBER Set the initial amount of time to sleep, after the first overflow occurs. overflow-control-interval NUMBER Set the overflow control interval. If two consecutive overflows happen within NUMBER seconds, the overflow-delay-time is doubled. Access Control Lists .................... Access control lists determine from which addresses `comsatd' will receive mail notification messages. The access control lists are introduced in configuration file using keyword `acl'. General format for an ACL rule is acl ACTION NETLIST Here, ACTION specifies the action to be taken when a request arrives from one of the networks, listed in NETLIST. There are two possible actions: `allow' and `deny'. The NETLIST is a whitespace-separated list of network numbers. Each network number may be specified in one of the following forms: NETNUM Means a single host with IP address NETNUM. NETNUM/NETMASK NETNUM/MASKLEN `any' Denotes any IP address. It is equivalent to `0.0.0.0/0'. Upon receiving a notification message, `comsatd' compares its source address against each ACL rule in the order of their appearance in the configuration file. The first rule that matches the packet determines whether the message will be processed or rejected. If no matching rule was found, the default rule applies. Currently, default rule is acl allow any If you don't need such behavior, specify the default rule explicitly. For example, the common use would be: acl allow 127.0.0.1 acl deny any which makes `comsatd' receive the notification messages from localhost only. A per-user Configuration File ----------------------------- By default, when a notification arrives, `comsatd' prints subject, from headers and the first five lines from the new message to the user's tty. The user is allowed to change this behavior by using his own configuration file. This file should be located in the user's home directory and should be named `.biffrc'. It must be owned by the user and have its permissions bits set to 0600. (_Please note_, that the use of per-user configuration files may be disabled, by specifying `allow-biffrc no' in the main configuration file, see *note Configuring comsatd::). The `.biffrc' file consists of a series of statements. Each statement occupies one line and defines an action to be taken upon arrival of a new mail. Very long lines may be split using `\' as the last character on the line. As usual, comments may be introduced with `#' character. The actions specified in `.biffrc' file are executed in turn. The following actions are defined: beep Produce an audible signal. echo [-n] STRING [STRING...] Output the arguments to the user's terminal device. If several arguments are given they will be output separated by single spaces. The newline character will be printed at the end of the output, unless the `-n' option is used. exec PROG ARGLIST Execute program PROG with arguments from ARGLIST. PROG must be specified with absolute pathname. It may not be a setuid or setgid program. 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" 3.16 MH -- The MH Message Handling System ========================================= The primary aim of this implementation is to provide an interface between Mailutils and Emacs using mh-e module. To use Mailutils MH with Emacs, add the following line to your site-start.el or .emacs file: (load "mailutils-mh") For the information about the current state of Mailutils MH implementation please refer to file `mh/TODO' in the Mailutils distribution directory. [FIXME] 3.16.1 Major differences between Mailutils MH and other MH implementations -------------------------------------------------------------------------- 1. All programs use usual GNU long options. The support for MH single-dash options is provided for backward compatibility; 2. UUCP addresses are not supported; 3. Mailutils supports a set of new format specifications (*note Format String Diffs::); 4. Mailutils provides a set of new profile variables (*note Profile Variable Diffs::); 5. Several programs behave differently (*note Program Diffs::); 3.16.1.1 New and Differing MH Format Specifications ................................................... -- MH Format: string decode (string STR) Decodes the input string STR as per RFC 2047. Useful in printing `From:', `To:' and `Subject:' headers. Notice that, unlike the similar NMH function, `decode' checks the value of the global profile variable `Charset' (*note Charset variable::) to determine the charset to output the result in. If this variable is not set, `decode' returns its argument without any change. If this variable is set to `auto', `decode' tries to determine the charset name from the setting of `LC_ALL' environment variable. Otherwise, the value of `Charset' is taken to be the name of the character set. -- MH Format: string package () Returns package name (string `mailutils'). -- MH Format: string package_string () Returns full package string (e.g. `GNU Mailutils 2.1') -- MH Format: string version () Returns mailutils version. -- MH Format: string unre (string STR) The function removes any leading whitespace and eventual `Re:' prefix from its argument. Useful for creating subjects in reply messages: %<{subject}Subject: Re: %(unre{subject})\\n%> -- MH Format: void reply_regex (string R) Sets the regular expression used to recognize reply messages. The argument R should be a POSIX extended regular expression. Matching is case insensitive. For example, the following invocation %(reply_regex ^\(re|aw|ang|odp\)\(\\[[0-9]+\\]\)?:[[:blank:]]) corresponds to English `Re', Polish `Odp', Norwegian `Aw' or German `Ang', optionally followed by a number in brackets, followed by colon and any amount of whitespace. Notice proper quoting of the regex metacharacters. See also `Reply-Regex' (*note Reply-Regex variable::) and `isreply' (*note isreply MH function::) below. -- MH Format: boolean isreply ([string STR]) If STR is not given, the value of `Subject:' header is taken. The function returns true if its argument matches the "reply subject" regular expression. This expression is set via the global profile variable `Reply-Regex' (*note Reply-Regex variable::) or via the format function `reply_regex'. This function is useful for creating `Subject:' headers in reply messages. For example, consider the following construction: %<{subject}%(lit)%<(isreply)%?\ (profile reply-prefix)%(concat)%|%(concat Re:)%>\ %(concat{subject})%(printhdr Subject: )\n%> If the `Subject:' header already contained reply prefix, this construct leaves it unchanged. Otherwise it prepends to it the value of `Reply-Prefix' profile variable, or, if it is unset, the string `Re:'. This expression is used in default `replcomps' and `replgroupcomps' files. -- MH Format: boolean rcpt (`to' | `cc' | `me' | `all') This function returns true if the given element is present in the recipient mask (as modified by `--cc' or `--nocc' options) and false otherwise. It is used in default formats for `repl' and `comp', e.g.: %(lit)%<(rcpt to)%(formataddr{to})%> Notice that this means that usual `replcomps' file will be ignoring `--cc' and `--nocc' options, unless it has been modified as shown above. -- MH Format: string concat () Appends whitespace + arg to string register. -- MH Format: string printhdr (string STR) Prints the value of string register, prefixed by STR. The output is formatted as a RFC 822 header, i.e. it is split at whitespace characters nearest to the width boundary and each subsequent segment is prefixed with horizontal tabulation. -- MH Format: string in_reply_to () Generates the value for `In-reply-to:' header according to RFC 2822. -- MH Format: string references () Generates the value for `References:' header according to RFC 2822. 3.16.1.2 New MH Profile Variables ................................. -- Variable: MH Variable string Charset Controls the character set in which the components decoded via the `decode' (*note decode function::) format function should be output. -- Variable: MH Variable string Reply-Regex Keeps the regular expression used to recognize reply messages. The argument should be a POSIX extended regular expression. Matching is case insensitive. For more information, please see *Note reply_regex function::. 3.16.1.3 Differences in MH Program Behavior ........................................... `burst' The utility is able to burst both RFC 934 digest messages and MIME multipart messages. It provides two additional command line options: `--recurse' and `--length'. The `--recurse' option instructs the utility to recursively expand the digest. The `--length' option can be used to set the minimal encapsulation boundary length for RFC 934 digests. Default length is 1, i.e. encountering one dash immediately following a newline triggers digest decoding. It is OK for messages that follow RFC 934 specification. However, many user agents do not precisely follow it, in particular, they often do not escape lines starting with a dash by `- ' sequence. `Mailman' is one of such agents. To cope with such digests you can set encapsulation boundary length to a higher value. For example, `bounce --length=8' has been found to be sufficient for most Mailman-generated digests. `comp' Understands `--build' option. `fmtdump' This command is not provided. Use `fmtcheck' instead. `mhl' If the argument to `ignores' contains more than one component name it must be enclosed in double-quotes. Dangling equal sign is an error, to set a string variable to the empty value assign it an empty string, e.g.: `overflowtext=""' (see the supplied `mhl.format' file). Ineractive prompting is not yet implemented. `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. * Show mode (`--show') If an appropriate mhn-show-type[/subtype] was not found, GNU `mhn' prints the decoded message content using `moreproc' variable. Standard `mhn' in this case used to print `don't know how to display content' diagnostic. The default behaviour is to pipe the content to the standard input of the mhn-show-type[/subtype] command. This is altered to using a temporary file if the command contains `%f' or `%F' escapes. * Store mode (`--store') If the `Content-Disposition' header contains `filename=', and `mhn' is invoked with `--auto' switch, it transforms the file name into the absolute notation and uses it only if it lies below the current mhn-storage directory. Standard `mhn' only requires that the file name do not begin with `/'. Before saving a message part, GNU `mhn' checks if the file already exists. If so, it asks whether the user wishes to rewrite it. This behaviour is disabled when `--quiet' option was given. `mhparam' The `--all' mode does not display commented out entries. `repl' Understands `--use' option. Disposition shell provides `use' command. `rmm' 1. Different behaviour if one of the messages in the list does not exist: Mailutils `rmm' does not delete any messages. Standard `rmm' in this case deletes all messages preceeding the non-existent one. 2. The `rmmproc' profile component is not used. `pick' The non-standard command line syntax `--FIELD STRING'), where FIELD is any string, is deprecated. It is recognized only if `pick' is called from within another program, so that existing application continue to work. Please use the following syntax instead: pick --component FIELD --pattern STRING New command line option `--cflags' allows to control the type of regular expressions used. The option must occur right before `--pattern' or `--component' option (or one of its aliases, like `--cc', `--from', etc.) The argument to this option is a string of type specifications: B Use basic regular expressions E Use extended regular expressions I Ignore case C Case sensitive Default is `EI'. The flags remain in effect until the next occurrence of `--cflags' option. Sample usage: pick --cflag BC --subject '*a string' The date comparison options (`--before' and `--after' accept date specifications in a wide variety of formats, e.g.: pick --after 20030301 pick --after 2003-03-01 pick --after 01-mar-2003 pick --after 2003-mar-01 pick --before '1 year ago' etc... `refile' 1. Linking messages between folders goes against the logic of Mailutils, so `refile' never makes links even if called with `--link' option. The latter is actually a synonym for `--copy', which preserves the original message. 2. The `--preserve' option is not implemented. It is retained for backward compatibility only. 3. Message specs and folder names may be interspersed. `sortm' New option `--numfield' specifies numeric comp