[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. Mailutils Programs

GNU Mailutils provides a set of programs for handling the e-mail.

3.1 Mailutils Configuration File  Common Configuration File.
3.2 Authorization and Authentication Principles  
3.3 frm -- List Headers from a Mailbox  List Headers from a Mailbox.
3.4 mail -- Send and Receive Mail  Send and Receive Mail.
3.5 messages -- Count the Number of Messages in a Mailbox  Count the Number of Messages in a Mailbox.
3.6 movemail -- Moves Mail from the User Maildrop to the Local File  Moves Mail from the User Maildrop to the Local File.
3.7 readmsg -- Extract Messages from a Folder  Extract Messages from a Folder.
3.8 sieve  Mail Filtering Utility.
3.9 guimb -- A Mailbox Scanning and Processing Language  Mailbox Scanning and Processing Language.
3.10 mail.local -- Deliver Mail to the Local Mailbox  Deliver Mail to the Local Mailbox.
3.11 mail.remote -- Pseudo-Sendmail Interface for Mail Delivery  Pseudo-Sendmail Interface for Mail Delivery.
3.12 POP3 Daemon  
3.13 IMAP4 Daemon  
3.14 Comsat Daemon  
3.15 MH -- The MH Message Handling System  The MH Message Handling System.
3.16 mailutils-config -- Get the Information about the Mailutils Build  Get the Information about the Mailutils Build.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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).

3.1.1 Common  Options understood by most GNU utilities.
3.1.2 Mailbox  Specifies the mail spool location, and locking strategy.
3.1.3 Mailer  Sets the mailer URL.
3.1.4 Address  Specifies the default email address and domain.
3.1.5 Daemon  Options common for daemon programs.
3.1.6 Auth  Authentication-specific options.
3.1.7 Encryption  Encryption options.
3.1.8 Logging  Logging control options.
3.1.9 Sieve Specific Options  Sieve specific options
3.1.10 A Sample Configuration File  A sample configuration file.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.3 Mailer

This option group overrides the default mailer URL (sendmail:).

`-m url'
`--mailer url'


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.6 Auth

These options control the authorization and authentication module lists. For a description of authentication concepts, refer to See section 3.2 Authorization and Authentication Principles.

`--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. Currently only MySQL is supported.

`--sql-getpwnam query'
sql query to retrieve a passwd entry based on username
`--sql-getpwuid query'
`--sql-getpass query'
sql query to retrieve a password from the database
`--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


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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 (see section 3.1.6 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 (see section 3.1.6 Auth).
pam
The user is authenticated via pluggable authentication module (pam). The pam service name to be used is configured via `--pam-service' option (see section 3.1.6 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


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3 frm -- List Headers from a Mailbox

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: See section 3.1.2 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. Currently is not implemented. Included for compatibility with frm program from Elm package.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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 3.4.3 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 3.4.4 Reading Mail.

3.4.1 Invoking mail  Command Line Options.
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  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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: See section 3.1.2 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.
`-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. See section 3.4.7 Personal and System-wide 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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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 (see section 3.4.6 How to Alter the Behavior of mail).

Quitting Compose Mode  
Getting Help on Compose Escapes: ~?  
Editing the Message: ~e and ~v  
Modifying the Headers: ~h, ~t, ~c, ~b, ~s  
Enclosing Another Message: ~m and ~M  
Adding a File to the Message: ~r and ~d  
Printing And Saving the Message  
Signing the Message: ~a and ~A  
Printing Another Message: ~f and ~F  
Inserting Value of a Mail Variable: ~i  
Executing Other Mail Commands: ~: and ~-  
Executing Shell Commands: ~! and ~|  

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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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 3.4.7 Personal and System-wide 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  
Obtaining Online Help  
Moving Within a Mailbox  
Changing Mailbox/Directory  
Controlling Header Display  
Displaying Information  
Displaying Messages  
Marking Messages  
Disposing of Messages  
Saving Messages  
Editing Messages  
Aliasing  
Replying  
Incorporating New Mail  
Shell Escapes  

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

`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.

`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.

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 !.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4.6 How to Alter the Behavior of mail

Following variables control the behavior of GNU mail:

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.

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.

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.

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.

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.

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.

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:

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.

noregex

Type: Boolean.
Default: False.

Setting this to True enables use of regular expressions in `/.../' message specifications.

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 3.4.7 Personal and System-wide Configuration Files.

record

Type: String.
Default: Unset.

When set, any outgoing message will be saved to the named file.

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 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.

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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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: See section 3.1.2 Mailbox.

The program accepts following command line options:

`-q'
`--quite'
`-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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.6 movemail -- Moves Mail from the User Maildrop to the Local File

[FIXME]


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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-"


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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  
3.8.2 A Sieve to Scheme Translator and Filter  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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. See section 5. Sieve Language, for a description of the Sieve language. See section 5.8 GNU Extensions, for a discussion of differences between the GNU implementation of Sieve and its standard.

Invoking sieve  
Logging and debugging  
Extending sieve  

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 (see section 3.1.8 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
    


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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 section `Overview' in The Guile Reference Manual.

`-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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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: See section 3.1.2 Mailbox.

Specifying Scheme Program to Execute  
Specifying Mailboxes to Operate Upon  
Passing Options to Scheme  
Command Line Option Summary  

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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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  Mail.local options
3.10.2 Using mail.local with Various MTAs  Using mail.local with various MTAs
3.10.3 Setting up Mailbox Quotas  Setting up mailbox quotas.
3.10.4 Implementing User-defined Sieve Mail Filters  Implementing user-defined Sieve mail filters.
3.10.5 Implementing User-defined Scheme Mail Filters  Implementing user-defined Scheme mail filters.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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: See section 3.1.2 Mailbox, See section 3.1.6 Auth, See section 3.1.8 Logging, See section 3.8 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 this help 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 mailbox quota database (see section 3.10.3 Setting up Mailbox Quotas).
`-s pattern'
`--source pattern'
Set name pattern for user-defined mail filters written in Scheme (see section 3.10.5 Implementing User-defined Scheme Mail 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 (see section 3.10.4 Implementing User-defined Sieve Mail 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 (see section 3.10.5 Implementing User-defined Scheme Mail 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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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  
Using mail.local with Exim  

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 -s %h/.filter.scm -q /etc/mail/userquota $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 -s %h/.filter.scm -q /etc/mail/userquota $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 -s %h/.filter.scm \
              -q /etc/mail/userquota $local_part
  return_path_add
  delivery_date_add
  envelope_to_add
  
# director
mail_local:
  driver = localuser
  transport = mail_local_pipe


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.10.3 Setting up Mailbox Quotas


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.10.4 Implementing User-defined Sieve Mail Filters


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.10.5 Implementing User-defined Scheme Mail Filters


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.11 mail.remote -- Pseudo-Sendmail Interface for Mail Delivery

[FIXME]


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.12 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: See section 3.1.2 Mailbox, See section 3.1.5 Daemon, See section 3.1.8 Logging, See section 3.1.6 Auth.

Command line options

`-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 10 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
`-p number'
`--port number'
Listen on given port number. This option is meaningful only in standalone mode. It defaults to port 110.
`-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.
`-v'
`--version'
Display program version and exit.
`--undelete'
Remove all deletion marks from the messages after opening the mailbox.
`--login-delay=seconds'
Sets the minimum allowed delay between closing a pop3d session and opening it again with the same user name.
`--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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.13 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.13.1 Namespace  
3.13.2 Starting imap4d  Invocation Options.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.13.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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.13.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: See section 3.1.2 Mailbox, See section 3.1.5 Daemon, See section 3.1.8 Logging, See section 3.1.6 Auth.

Command Line Options

`-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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.14 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.14.1 Starting comsatd  Invocation.
3.14.2 Configuring comsatd  Configuration of comsatd.
A per-user Configuration File  A per-user configuration file.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.14.1 Starting comsatd

Comsatd uses following option groups: See section 3.1.2 Mailbox, See section 3.1.5 Daemon, See section 3.1.8 Logging.

`-c file'
`--config file'
Read configuration from given file. For more information about comsatd configuration files, see 3.14.2 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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.14.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  
Security Settings  
Access Control Lists  

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 see section 3.14.2 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 string
Output string to user's terminal device.
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"

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"


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.15 MH -- The MH Message Handling System

[FIXME]


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.16 mailutils-config -- Get the Information about the Mailutils Build

This program is designed for developers wishing to link their programs against libmailbox. It allows to examine the particulars of the current build of Mailutils and to get the command line parameters necessary for compiling and linking an application with Mailutils libraries.

Getting Compiler Flags  
Getting Loader Flags  
Obtaining General Build Information  

Getting Compiler Flags

When invoked with the option `--compile', or its short form `-c', mailutils-config prints the flags that must be given to the compiler for compiling the program using Mailutils functions. An example usage:

 
cc -omyprog.o `mailutils-config --compile` myprog.c

Getting Loader Flags

The `--link', or its short form `-l' prints to the standard output the loader flags necessary to link a program against Mailutils libraries.

When invoked without arguments, it produces the flags necessary to link against the basic library of Mailutils: `libmailbox'. Arguments may be given that alter this behavior. These are:

`auth'
Print flags to link against `libmuauth', the library adding new authentication methods to `libmailbox'.

`guile'
Print flags to link against `libmu_scm', the Guile interface library.

`mbox'
Link against mbox format library.

`mh'
Link against mh format library.

`maildir'
Link against maildir format library.

`imap'
Link against imap format library.

`pop'
Link against pop format library.

`all'
Link against all Mailutils format libraries.

The order of arguments does not matter.

For example, if you wrote a program `myprog.c' that uses standard UNIX mailbox format, MH format and the Guile interface, then you would link it with the following command:

 
cc -omyprog myprog.o `mailutils-config --link mbox mh guile`

Obtaining General Build Information

The `--info', or `-i' retrieves the options (flags) used when building Mailutils. It may be used with or without arguments.

When used without arguments, it prints the list of all build flags, e.g.:

 
$ mailutils-config --info
VERSION=0.4.1
USE_LIBPAM
HAVE_LIBLTDL
WITH_GDBM
WITH_GNUTLS
WITH_GSASL
WITH_GUILE
WITH_PTHREAD
WITH_READLINE
HAVE_MYSQL
ENABLE_VIRTUAL_DOMAINS
ENABLE_IMAP
ENABLE_POP
ENABLE_MH
ENABLE_MAILDIR
ENABLE_SMTP
ENABLE_SENDMAIL

This option also accepts any number of arguments. When these are given, each argument is treated as a name of a build flag. Mailutils-config checks if such a flag was defined and prints its full name if so. It exits with zero code if all the flags given on the command line are defined. Otherwise, it exits with code of 1.

The comparison of the flag names is case-insensitive. The arguments given need not include the leading prefix (i.e. the characters up to and including the first underscore character).

Given the previous example, the invocation

 
$ mailutils --info readline use_libpam pop

will produce the following output:

 
WITH_READLINE
USE_LIBPAM
ENABLE_POP

and will exit with a zero status.

The following command:

 
$ mailutils --info readline gssapi pop

will exit with status 1, and will print:

 
WITH_READLINE
ENABLE_POP

since WITH_GSSAPI flag is not defined.

The flags and their meanings are:

USE_LIBPAM
The Mailutils uses PAM libraries.

HAVE_LIBLTDL
The GNU wrapper library `libltdl' is present and is used by Mailutils. See section `Using libltdl' in Using libltdl, for more information on `libltdl' library.

WITH_BDB2
Support for Berkeley DB is compiled in (the package was configured with `--with-db2' option).

WITH_NDBM
Support for NDBM is compiled in (the package was configured with `--with-ndbm' option).

WITH_OLD_DBM
Support for old style DBM is compiled in (the package was configured with `--with-dbm' option).

WITH_GDBM
Support for GNU DBM is compiled in (the package was configured with `--with-gdbm' option). See section `Introduction' in The GNU DBM Manual, for more information about this library.

WITH_GNUTLS
Support for GnuTLS (a Transport Layer Security Library) is compiled in (the package was configured with `--with-gnutls' option).

WITH_GSASL
Support for GNU SASL is compiled in (the package was configured with `--with-gsasl' option). See section `Introduction' in The GNU SASL Manual, for more information about this library.

WITH_GSSAPI
Support for GSSAPI is compiled in (the package was configured with `--with-gssapi' option).

WITH_GUILE
Support for Guile extension language is built (the package was configured with `--with-guile' option). See section `Overview' in The Guile Reference Manual, for more information about Guile.

WITH_PTHREAD
The POSIX thread support is compiled in.

WITH_READLINE
The readline support is enabled (the package was configured with `--with-readline' option). See section `Top' in The GNU Readline Library, for more information.

HAVE_MYSQL
Authentication via MySQL is supported (the package was configured with `--enable-mysql' option).

ENABLE_VIRTUAL_DOMAINS
Support for mail virtual domains is enabled (the package was configured with `--enable-virtual-domains' option).

ENABLE_IMAP
Support for IMAP4 protocol is enabled.

ENABLE_POP
Support for POP3 protocol is enabled.

ENABLE_MH
Support for mailboxes in MH format is enabled.

ENABLE_MAILDIR
Support for mailboxes in MAILDIR format is enabled.

ENABLE_SMTP
Support for SMTP mailer is enabled.

ENABLE_SENDMAIL
Support for Sendmail mailer is enabled.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Jordi Mallach on April, 16 2004 using texi2html