Go to the first, previous, next, last section, table of contents.


Programs

GNU Mailutils provides a set of programs for handling the email.

IMAP4 daemon

imap4d has two operation modes:

Inetd
The server is started from `/etc/inetd.conf' file:
imap4  stream tcp nowait  root  /usr/local/sbin/imap4d imap4d
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.

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

POP3 daemon

The `pop3d' daemon implements the Post Office Protocol 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.

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

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 following command line options alter the behavior of the program:

`-h'
`--help'
Display short help message and exit.
`-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.
`-v'
`--version'
Display version information and exit

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 See section 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. See section Reading mail for more detail.

Command line options

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.

`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.
`-n'
`--norc'
Do not read the system-wide mailrc file. See section 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.

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 (see section Marking 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:

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 How to alter the behavior of mail).

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.

Please note, that both commands allow you to edit the body of the message, and not its headers. To change message headers, see section Modifying the Headers: ~h, ~t, ~c, ~b, ~s.

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 (see section Controlling header display).

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 (see section Controlling header display).

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 (see section Replying) 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.

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. See section Personal and system-wide configuration files for detailed description of these 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

`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. If the variable crt is set and the number of lines in the message is greater than the number of lines on screen, the message is piped through pager command specified by environment variable PAGER. 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. See section Controlling header display for detailed description of ignored header lists.
`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.arda.org Fri Jun 30 18:11  14/358   The Save c
 U  15 gray@noldor.arda.org  Fri Jun 30 18:30  8/245    Re: The Sa
& Save 14 15
"smith" 22/603
i.e., 22 characters (603 lines) 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.

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

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 

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

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.
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.
Default: True in interactive mode, False otherwise. If True, any messages with number of lines greater than number of lines on terminal screen (as determined by screen variable) will be printed using program set in the environment variable ENVIRON.
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.
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.
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.
quiet

Type: Boolean.
Default: False. When set, suppresses the output of the startup banner.
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 section Personal and system-wide configuration files.
record

Type: String.
Default: Unset. When set, any outgoing message will be saved to the named file.
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.

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

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

readmsg -- Extract messages from a folder.

The program is currently in development

sieve

The program is currently in development

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.

Specifying Scheme Program to Execute

The Scheme program or expression to be executed is passed to `guimb' via the following options:

`-e'
`--expression EXPR'
Execute scheme expression.
`-f'
`--file PROGFILE'
Read and execute program from PROGFILE.

You can specify both of them. In this case, the PROGFILE is executed first.

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 USER [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 its standard input.

Passing Options to Scheme

Sometimes it is necessary to pass some command line options to the scheme procedure. This can be done via `-g' (`--guile-command') command line option. For example:

guimb --guile-command -opt --guile-command 24 --file progfile

In this example, the scheme procedure will see the following command line:

progfile -opt 24

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

All arguments enclosed between `-{' and `-}' are not processed by `guimb', they are instead passed to the Scheme program verbatim.

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

Scheme Procedures and Variables

Address Functions

mu-address-get-personal: ADDRESS NUM
Return personal part of an email address.

mu-address-get-comments: ADDRESS NUM

mu-address-get-email: ADDRESS NUM
Return email part of an email address.

mu-address-get-domain: ADDRESS NUM
Return domain part of an email address

mu-address-get-local: ADDRESS NUM
Return local part of an email address.

mu-address-get-count: ADDRESS
Return number of parts in email address.

Mailbox Functions

mu-mailbox-open: URL MODE
Opens a mailbox specified by URL.

mu-mailbox-close: MBOX
Closes mailbox MBOX

mu-mailbox-get-url: MBOX
Returns the URL of the mailbox.

mu-mailbox-get-port: MBOX MODE
Returns a port associated with the contents of the MBOX. MODE is a string defining operation mode of the stream. It may contain any of the two characters: `r' for reading, `w' for writing.

mu-mailbox-get-message: MBOX MSGNO
Retrieve from MBOX message # MSGNO.

mu-mailbox-messages-count: MBOX
Returns number of messages in the mailbox.

mu-mailbox-expunge: MBOX
Expunges deleted messages from the mailbox.

mu-mailbox-url: MBOX
Returns the URL of the mailbox

mu-mailbox-append-message: MBOX MESG
Appends the message to the mailbox

Message Functions

mu-message-copy: MESG
Creates the copy of the given message.

mu-message-set-header: MESG HEADER VALUE REPLACE
Sets new VALUE to the header HEADER of the message MESG. If the HEADER is already present in the message its value is replaced with the supplied one if the optional REPLACE is #t. Otherwise new header is created and appended.

mu-message-get-size: MESG
Returns the size of the given message.

mu-message-get-lines: MESG
Returns number of lines in the given message.

mu-message-get-sender: MESG
Returns the sender email address for the message MESG.

mu-message-get-header: MESG HEADER
Returns the header value of the HEADER in the MESG.

mu-message-get-header-fields: MESG HEADERS
Returns the list of headers in the MESG. If optional HEADERS is specified it should be a list of header names to restrict return value to.

mu-message-set-header-fields: MESG LIST REPLACE
Set the headers in the message MESG from LIST LIST is a list of (cons HEADER VALUE) Optional parameter REPLACE specifies whether the new header values should replace the headers already present in the message.

mu-message-delete: MESG FLAG
Mark given message as deleted. Optional FLAG allows to toggle deleted mark The message is deleted if it is #t and undeleted if it is #f

mu-message-get-flag: MESG FLAG
Return value of the attribute FLAG.

mu-message-set-flag: MESG FLAG VALUE
Set the given attribute of the message. If optional VALUE is #f, the attribute is unset.

mu-message-get-user-flag: MESG FLAG
Returns value of the user attribute FLAG.

mu-message-set-user-flag: MESG FLAG VALUE
Set the given user attribute of the message. If optional VALUE is #f, the attribute is unset.

mu-message-get-port: MESG MODE FULL
Returns a port associated with the given MESG. MODE is a string defining operation mode of the stream. It may contain any of the two characters: `r' for reading, `w' for writing. If optional FULL argument specified, it should be a boolean value. If it is #t then the returned port will allow access to any part of the message (including headers). If it is #f then the port accesses only the message body (the default).

mu-message-get-body: MESG
Returns the message body for the message MESG.

mu-message-send: MESG MAILER
Sends the message MESG. Optional MAILER overrides default mailer settings in mu-mailer.

MIME Functions

mu-mime-create: FLAGS MESG
Creates a new MIME object.

mu-mime-multipart?: MIME
Returns #t if MIME is a multipart object.

mu-mime-get-num-parts: MIME
Returns number of parts in a MIME object.

mu-mime-get-part: MIME PART
Returns part number PART from a MIME object.

mu-mime-add-part: MIME MESG
Adds MESG to the MIME object.

mu-mime-get-message: MIME
Converts MIME object to a message.

Log Functions

mu-openlog: IDENT OPTION FACILITY
Opens a connection to the system logger for Guile program.

mu-logger: PRIO TEXT
Generates a log message to be distributed via syslogd.

mu-closelog:
Closes the channel to the system logger open by mu-openlog.


Go to the first, previous, next, last section, table of contents.