| MAIL(1) | General Commands Manual | MAIL(1) |
mail, mailx —
mail |
[-EIinv] [-a
file] [-b
bcc-addr] [-c
cc-addr] [-r
rcfile] [-s
subject] to-addr ... [-
sendmail-flags] |
mail |
[-EIiNnv]
[-H[colon-modifier]] -f
[name] |
mail |
[-EIiNnv]
[-H[colon-modifier]] [-u
user] |
mail is an intelligent mail processing system, which has
a command syntax reminiscent of
ed(1) with lines replaced by
messages.
-a-b-c-E-fquit,
mail writes undeleted messages back to this
file.-H:’ and be
followed by one or more of the characters described in the
Specifying messages section
below. E.g., “mail
-H:n” will display just new message
headers.-I~ special character when
sending mail is only active in interactive mode.-imail on noisy phone lines.-N-n-rMAILRC which
in turn overrides the default ~/.mailrc file.-s-s flag is used as a subject; be careful to quote
subjects containing spaces.)-umail -f
/var/mail/user-vmail can be
invoked with arguments which are the names of people to whom the mail will be
sent. You are then expected to type in your message, followed by a
‘control-D’ at the beginning of a line.
Any flags following the list of recipients, will be passed,
together with their arguments, directly to
sendmail(1). For example to
change your From address to
somebody@somewhere.net you can specify:
mail recipient -f
somebody@somewhere.netTo prevent multiple copies of a message being sent to the same address, duplicate addresses (after alias expansion) are removed from the bcc-addr, cc-addr, and to-addr lists. In addition, addresses on the cc-addr and to-addr lists are removed if they occur on the bcc-addr list and addresses on the cc-addr list are removed if they occur on the to-addr list. If the to-addr list is empty after these deletions, most systems will insert the line “To: undisclosed recipients:;”.
The section below
Replying to or
originating mail, describes some features of
mail available to help you compose your letter.
mail is given no arguments and checks
your mail out of the post office, then prints out a one line header of each
message found. The current message is initially the first message (numbered 1)
and can be printed using the print command (which can
be abbreviated p). You can move among the messages
much as you move between lines in
ed(1), with the commands
+ and - moving backwards and
forwards, and simple numbers.
delete
(d) the message or reply
(r) to it. Deletion causes the
mail program to forget about the message. This is not
irreversible; the message can be undeleted
(u) by giving its number, or the
mail session can be aborted by giving the
exit (x) command. Deleted
messages will, however, usually disappear never to be seen again.
delete,
from, and print) accept a list
of messages as an argument. Messages may be specified by their message number,
by a range of messages, or by a pattern string matching certain fields in the
header as described below. These message “specs” may be combined
by the usual binary boolean operations
‘&’,
‘|’, and
‘^’, which denote, respectively, a
logical “and”, “or”, and “xor”.
Logical expressions may be grouped with parentheses
‘(’ and
‘)’ and negated with
‘!’. If the binary operator is missing
between two message specs, it is assumed to be a
‘|’. This is for simplicity, backwards
compatibility, and also to to facilitate using the
‘|’ symbol to denote a pipe. (See
enable-pipes.)
Besides the obvious (base10) message numbers, the characters
‘^’,
‘-’,
‘.’,
‘+’, and
‘$’ denote, respectively, the first
message, the message before the “dot” (the current message),
the “dot” message, the message following the
“dot”, and the last message.
A “message range” consists of two message numbers
separated by a ‘-’. A
‘*’ denotes all messages and is
equivalent to ‘^-$’.
A pattern is a string (not beginning with any of the above special
characters). If it does not begin with a
‘/’, it is compared with the senders
address. If it begins with a ‘/’, and
searchheaders is not defined, the remainder of the
string is compared with the subject field. (See
searchheaders for searching other header fields or the
message body.) If regex-search is not defined, then
the comparison is a simple case insensitive substring match. (See
regex-search for regular expression matches.)
A list of messages may be restricted by a
“colon-modifier” string, i.e., a
‘:’ followed by one or more of the
characters:
d deleted e edited m mboxed n new o old p preserved r read s saved t tagged u unread and not new ! invert the meaning of the colon-modifiers
If there are no address specifications other than colon-modifiers,
the colon-modifiers apply to all messages. Thus
“from netbsd :n” would display the
headers of all new messages with
‘netbsd’ in the sender's address,
while “from :!r” and
“from :nu” would both display all new
and unread messages. Multiple colon-modifiers may be specified and a single
‘:’ with no letters following
indicates the colon-modifier from the preceding command.
For example:
from 1 12 3-5
would display the headers from messages 1, 3, 4, 5, and 12.
from anon & ( /foo | /bar )
would display all headers that had
‘anon’ in the sender's address and
either ‘foo’ or
‘bar’ in the subject line.
Generally, commands cannot select messages that are not displayed,
such as deleted or hidden messages, the exception being the
undelete command.
reply command to set up a response to a
message, sending it back to the person who it was from. Text you then type in,
up to an end-of-file, defines the contents of the message. While you are
composing a message, mail treats lines beginning with
the character ~ specially. For instance, typing
~m (alone on a line) will place a copy of the current
message into the response right shifting it by a tab stop (see
indentprefix variable, below). Other escapes will set up
subject fields, add and delete recipients to the message, and allow you to
escape to an editor to revise the message or to a shell to run some commands.
(These options are given in the summary below.)
mail session with the
quit (q) command. Messages
which have been examined go to your mbox file unless
they have been deleted in which case they are discarded. Unexamined messages
go back to the post office. (See the -f option above).
cohorts” and have
it go to a group of people. Such lists can be defined by placing a line like
alias cohorts bill ozalp jkf mark
kridle@ucbcoryin the file .mailrc in your home
directory. The current list of such aliases can be displayed with the
alias command in mail.
System wide distribution lists can be created by editing
/etc/mail/aliases, see
aliases(5) and
sendmail(1); these are kept
in a different syntax. In mail you send, personal aliases will be expanded
in mail sent to others so that they will be able to
reply to the recipients. System wide
aliases are not expanded when the mail is sent, but
any reply returned to the machine will have the system wide alias expanded
as all mail goes through
sendmail(1).
mail has a number of options which can be
set in the .mailrc file to alter its behavior; thus
“set askcc” enables the
askcc feature. (These options are summarized
below.)
Each command is typed on a line by itself, and may take arguments
following the command word. The command need not be typed in its entirety -
the first command which matches the typed prefix is used. For commands which
take message lists as arguments, if no message list is given, then the next
message forward which satisfies the command's requirements is used. If there
are no messages forward of the current message, the search proceeds
backwards, and if there are no good messages at all,
mail types “No applicable
messages” and aborts the command.
!-=?|Detachdetach but also saves MIME parts that don't
have a filename associated with them. For the unnamed parts, a filename is
suggested containing the message and part numbers, and the subtype.HeaderH) Specify or show additional header fields. This
is intended for adding extra header fields like “Reply-To:”
or “X-Organization:” to the header. For example:
Header X-Mailer: NetBSD mail(1) 9.1
would add the “X-Mailer: NetBSD mail(1) 9.1”
line to the message header. Without any arguments, the extra header
fields are displayed. With only a header name (including the
‘:’), it will delete all extra header fields with that
name. Note: Although some syntax checking is done on the header line,
care should be taken to ensure that it complies with RFC 2821 and 2822.
Also, the extra header lines are not currently displayed by the
~h tilde command when sending mail (use
~:Header to see them).
MoreM) Like more but also
prints out ignored header fields.PagePa) A synonym for
More.PrintP) Like print but also
prints out ignored header fields. See also print,
more, page,
type, view,
ignore, and retain.ReplyR) Reply to originator. Does not reply to other
recipients of the original message. (See
reply.)SaveS) Same as save except
that all header fields are saved ignoring the
saveignore or saveretain
lists.TypeT) Identical to the Print
command.ViewV) Like Print but has the
opposite MIME decoding behavior. (See the
mime-decode-message variable.)aliasa) 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.alternatesalt) 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 alternative names is displayed.bounceDelivered-To’,
‘X-Original-To’ and
‘Status’ fields. The new
‘To’ field contains the bounce
address(es) plus any addresses in the old
‘To’ field minus the user's local
address and any on the alternates list. (See the
alternates command.)chdirc) Changes the user's working directory to that
specified, if given. If no directory is given, then changes to the user's
login directory.copyco) The copy command does
the same thing that save does, except that it does
not mark the messages it is used on for deletion when you quit.deldupsMessage-Id’ field, keeping the
first one in the current sort order. This can be useful with replies to a
mailing list that are also CCed to a subscriber. (The same thing can also
be accomplished with the threading and tagging commands.)deleted) Takes a list of messages as an argument and
marks them all as deleted. Deleted messages will not be saved in
mbox, nor will they be available for most other
commands.detachmail was started in. For
each MIME part in the message list, the filename is displayed for
confirmation or changes. If an empty name is entered, the part is skipped.
If the filename already exists, the user will be prompted before
overwriting it. (See the mime-detach-batch and
mime-detach-overwrite variables to change this
behavior.) Only MIME parts with an associated filename in the
‘Content-Type’ or
‘Content-Disposition’ fields are
decoded. (See Detach to detach all parts.) The
MIME extension hooks and character set conversion are ignored.dpdt) Deletes the current message and prints
the next message. If there is no next message,
mail says “at
EOF”.downedite) Takes a list of messages and points the text
editor at each one in turn. On return from the editor, the message is read
back in.elseif, ifdef, or
ifndef command.endifif, ifdef, or
ifndef command.exitex or x) Effects an
immediate return to the Shell without modifying the user's system mailbox,
his mbox file, or his edit file in
-f.expandaddrexpose%?* ?” format string
does this.filefi) The same as
folder.flattenfoldersfolderfo) The folder command
switches to a new mail file or folder. With no arguments, it tells you
which file you are currently reading. If you give it an argument, it will
write out changes (such as deletions) you have made in the current file
and read in the new file. Some special conventions are recognized for the
name. ‘#’ means the previous file,
‘%’ means your system mailbox,
‘%user’ means user's system mailbox,
‘&’ means your
mbox file, and
‘+file’ means a file in your folder
directory.forwardStatus’ field are
included.fromf) Takes a list of messages and prints their
message headers.headersh) Lists the current range of headers, which is
an 18-message group. If a ‘+’
argument is given, then the next 18-message group is printed, and if a
‘-’ argument is given, the previous
18-message group is printed.help?hidehidetagshidethreadsholdho, also preserve) Takes
a message list and marks each message therein to be saved in the user's
system mailbox instead of in mbox. Does not override
the delete command.ifreceiving’,
‘sending’, and
‘headersonly’. For example, one use
might be something like:
if headersonly
set header-format="%P%Q%3i %-21.20f %m/%d %R %3K \"%q\""
else
set header-format="%P%Q%?& ?%3i %-21.20f %a %b %e %R %3K/%-5O \"%q\""
endif
ifdefifndefignoreType and Print commands
can be used to print a message in its entirety, including ignored fields.
If ignore is executed with no arguments, it lists
the current set of ignored fields.incinvtagsmailm) Takes as argument login names and distribution
group names and sends mail to those people.mboxmbox
in your home directory when you quit. This is the default action for
messages if you do not have the
hold option set.mkreadmk) Takes a message list and marks each message
as having been read.moremo) Takes a message list and invokes the pager on
that list.nextn, like + or CR) Goes to
the next message in sequence and types it. With an argument list, types
the next matching message.pagepa) A synonym for
more.preservepre) A synonym for
hold.printp) Takes a message list and types out each
message on the user's terminal.quitq) Terminates the session, saving all undeleted,
unsaved messages in the user's mbox file in his
login directory, preserving all messages marked with
hold or preserve or never
referenced in his system mailbox, and removing all other messages from his
system mailbox. If new mail has arrived during the session, the message
“You have new mail” is given. If
given while editing a mailbox file with the -f
flag, then the edit file is rewritten. A return to the Shell is effected,
unless the rewrite of edit file fails, in which case the user can escape
with the exit command.replyr) Takes a message list and sends mail to the
sender and all recipients of the specified message. The default message
must not be deleted. (See the Reply command and
the Replyall variable.)respondreply.retainType and Print
commands can be used to print a message in its entirety. If
retain is executed with no arguments, it lists the
current set of retained fields. Retain overrides
save.reversesort
!”.saves) Takes a message list and a filename and
appends each message in turn to the end of the file. The filename in
quotes, followed by the line count and character count is echoed on the
user's terminal.setse) With no arguments, prints all variable
values. Otherwise, sets option. Arguments are of the form
option=value (no space before or after =) or
option. Quotation marks may be placed around any
part of the assignment statement to quote blanks or tabs, i.e.
“set indentprefix="->"”
Inside single quotes everything is parsed literally, including
‘\’ escaped characters. Inside double quotes
‘\’ character escapes are interpreted. This is an extension
as POSIX specifies that ‘\’ should be left uninterpreted for
both single and double quoted strings.saveignoreSaveignore
is to save what ignore is
to print and type. Header
fields thus marked are filtered out when saving a message by
save or when automatically saving to
mbox.saveretainSaveretain
is to save what retain is
to print and type. Header
fields thus marked are the only ones saved with a message when saving by
save or when automatically saving to
mbox. Saveretain overrides
saveignore.shellsh) Invokes an interactive version of the
shell.showsho) Takes a list of variables and prints out
their values in the form option=value. If the list
is empty, all variable values are shown.showtagsshowthreadssizesmoptssmopts settings. The “address-spec”
may be an alias, address, domain (beginning with a
‘@’), or subdomain (beginning with a
‘.’). If mail is sent to multiple
users, the sendmail flags are used only if the flags are the same for each
recipients. If smopts-verify is set, then you will
be asked to verify the sendmail flags (if there are any) before the mail
is sent. Address matching is case insensitive and done from most specific
to least.
For example if you have:
smopts mylist -F "List Maintainer"
smopts @NetBSD.org -f anon@somewhere.net -F "Anon Ymous"
smopts friend@NetBSD.org ""
then mail sent to any of the addresses that the
‘mylist’ alias expands to would
have the sender's name set to ‘List
Maintainer’. Mail sent to anyone at NetBSD.org other than
‘friend@NetBSD.org’ would look
like it was sent from
‘anon@somewhere.net’ by
‘Anon Ymous’. Mail sent to
‘friend@NetBSD.org’ would not have
any sendmail flags set (unless they are set by the
~h escape).
sortsort does nothing. Otherwise it
will sort based on the header field name given as an argument. A few names
are special:
blines sort based on the number of body lines.
hlines sort on the number of header lines.
tlines sort on the total number of lines.
size sort on the message size
sday sent day (ignores the hour/min/sec)
rday received day (ignores the hour/min/sec)
sdate sent date
rdate received date
subject sort on the subject, ignoring "Re:" prefixes.
from sort on the sender's address.
The check for these special names is case sensitive while the header field name comparisons are case insensitive, so changing the case on any of these special names will sort based on the header field ignoring the special keyword.
There are also three modifiers which may precede the argument:
! reverse the sorting order.
^ case insensitive sorting.
- skin the field (removing RFC 822 comments and
keep the address).
The same keywords and modifiers also apply to threading. (See
the thread command.)
Note: sort has no effect on the
threading, sorting only on the heads of the threads if threads
exist.
sourcesource command reads commands from a
file.tagtag is recursivetagbelowthreadIn-Reply-To’ and
‘References’ header fields (intended
for this purpose by RFC 2822). If given an argument, it will thread on
that header field name instead. The same field keywords and modifiers
recognized by the sort command are also recognized here. Display of the
threads is controlled by the hide and
expose commands; navigation of threads is done
with the down, up, and
tset commands.
If recursive-commands is defined, many
commands (e.g., print) act on the entire thread
(when it is hidden), otherwise they act on just the current message.
Note: the ‘In-Reply-To’
and ‘Reference’ header fields are
necessary to do threading correctly. This version of
mail now emits these header fields when
replying.
toptoplines and defaults to five.tsettypet) A synonym for
print.unaliasalias commands
and discards the remembered groups of users. The group names no longer
have any significance.undeleteu) Takes a message list and marks each message as
not being deleted.unreadunr) Takes a message list and marks each message
as not having been read.unsetset.unsmoptssmopts commands and discards them from the smopts
database.untagtag command, untag is
recursive on hidden threads.unthreadupviewvie) Like print but has
the opposite MIME decoding behavior. (See the
mime-decode-message variable.)visualv) Takes a message list and invokes the display
editor on each message.writew) Similar to save,
except that only the message body
(without the header) is saved. Extremely useful for such
tasks as sending and receiving source program text over the message
system.xitx) A synonym for
exit.zmail presents message headers in windowfuls as
described under the headers command. You can move
mail's attention forward to the next window with
the z command. Also, you can move to the previous
window by using z-.escape.
~!command~@
[filelist]~a~A~bname
...~cname
...~d~e~fmessagesignore or
retain command) are not included.~Fmessages~f, except all message headers are
included.~hSmopts), by typing each one in turn and allowing
the user to append text to the end or modify the field by using the
current terminal erase and kill characters. If
editline(3) support is
included, then that line editor is used.~istring~mmessagesignore or
retain command) are not included.~Mmessages~m, except all message headers are
included.~p~qsave is set.~x~rfilename~<filename!’, the rest of the string is taken
as an arbitrary system command and is executed, with the standard output
inserted into the message.~sstring~tname
...~vVISUAL option) on the message collected so far.
Usually, the alternative editor will be a screen editor. After you quit
the editor, you may resume appending text to the end of your message.~wfilename~|commandcommand to rejustify the
message.~:mail-command~~stringset and
unset commands. Options may be either binary, in which
case it is only significant to see whether they are set or not; or string, in
which case the actual value is of interest. The binary options include the
following:
mail to prompt you for the subject of each
message you send. If you respond with simply a newline, no subject field
will be sent.inc command at each
prompt, except that the current message is not reset when new mail
arrives.delete command to behave like
dp - thus, after deleting a message, the next one
will be typed automatically.PAGER will be used for the
print, Print,
type, and Type commands.
Normally these commands do not invoke the pager. (See
page-also.)-d on the command line and causes
mail to output all sorts of information useful for
debugging mail.mail to interpret a period alone on a line as the
terminator of a message you are sending.|’ or
‘>’ character that is not in a
quoted string or in a parenthetical group. This character terminates the
mail command line and the remaining string is passed to the shell. For
example, assuming normal headers, something like
from john@ | fgrep -i ' "Re:' | wc
could be used to count how many replies were made by senders
with ‘john@’ in their address
and
from john@ >> /tmp/john
would append all the headers from such senders to /tmp/john.
Note: With piping enabled, you cannot use the
‘|’ as a logical
“or” operator outside of a parenthetical group. This
should not be a problem as it is the default logical operator. (See the
Specifying messages
section.)
-a will accept a
whitespace delimited list of files. Otherwise, its argument is interpreted
as a single filename. Warning: If enabled, care must be taken to properly
quote files that contain whitespace, both from the shell and from this
second expansion done by mail.~f
or ~F), the text inserted will be decoded
according to the settings of the mime-decode-message
and mime-decode-header variables.More, more,
Page, page,
Print, print,
Type, and type commands
will display decoded the MIME messages. Otherwise, they display the
undecoded message. Recall that the View and
view commands always have the opposite MIME
decoding behavior from these commands.~m or
~M), the text inserted will be decoded according
to the settings of the mime-decode-message and
mime-decode-header variables.ask’), overwriting target files
depending on the setting of
mime-detach-overwrite.-N flag on the command line.mail copies the partial letter to the file
“dead.letter” in your home
directory. Setting the binary option nosave prevents
this.view is in
the list, both view and
View will page.
More Page Print Type View more page print type view
top
Save copy save write
Detach detach
delete dp dt
undelete
hold preserve
mbox mkread touch unread
tag untag invtags
If not defined, or if the threads are “exposed”, commands behave exactly as they do in non-threaded mode, i.e., each operates on individual messages.
reply and
Reply commands.Subject’ header field. If
“y” is omitted, only those messages that contain the field
“x” will be matched. The three forms
“/from:y”, “/to:y”, and
“/body:y” are special. The first will match all messages
which contain the substring “y” in the headline (which is
added locally at receipt time and begins with “From ”). The
second will match all messages containing the substring “y”
in the ‘To’,
‘Cc’, or
‘Bcc’ header fields. The third will
match all messages which contain the substring “y” in a line
of the message body. The check for “from”,
“to”, and “body” is case sensitive, so that
“/From:y” and “/To:y” can be used to search
the ‘From’ and
‘To’ fields, respectively. (See also
regex-search.)~h escape.-v flag on the command line. When mail runs in
verbose mode, the actual delivery of messages is displayed on the user's
terminal.EDITORedit
command and ~e escape. If not defined, then a
default editor is used.LISTERfolders command. Default is
/bin/ls.PAGERmore command
or when crt variable is set. The default paginator
more(1) is used if this option
is not defined.SHELL! command and
the ~! escape. A default shell is used if this
option is not defined.VISUALvisual
command and ~v escape.set el-completion-keys=^I,^D will bind
completion to both the tab and CTRL-D keys. (Requires
editline(3) support.)emacs’ or
‘vi’. If unset, editing is not
enabled. (Requires
editline(3) support.)~ to denote escapes./’,
mail considers it to be an absolute pathname;
otherwise, the folder directory is found relative to your home
directory.key’. Note: if key[0] is
‘-’, ignore the
‘-’ and extract the address
portion of the field (i.e., “skin” the field).string’ n
times. This is intended to be used when displaying an “exposed
thread”.From’ or
‘Sender’ fields).If the format string begins with
‘%??’ then the date will be
extracted from the headline. Otherwise it will be extracted from the
‘Date’ header falling back to the
headline if that extraction fails. For example, the default format
is:
set header-format="%??%P%Q%?* ?%3i %-21.20f %a %b %e %R %3K/%-5O \"%q\""
Note 1: The message status flag
‘%Q’ will display the single
character ‘+’ for the parent of a
subthread. This will be overwritten by a
‘T’,
‘E’,
‘*’,
‘P’,
‘U’,
‘N’,
‘M’ indicating, respectively, a
tagged, modified, saved, preserved, unread, new, or modified message, in
that order with the last matching condition being the one displayed. In
the case of hidden threads, the entire subthread is searched and the
letters above will be displayed in lower case if the property is that of
a hidden child with the case ‘*’
being displayed as ‘&’.
Note 2: %n and %t as used by strftime(3) were redundant with \t and \n, respectively, so nothing is lost using them here.
mail
refuse to accept a ‘control-D’ as
the end of a message. If given a numeric argument n,
a ‘control-D’ will be accepted after
n tries. Ignoreeof also
applies to mail command mode.~m or ~M). The format
syntax is the same as for header-format. For
example, the following:
set indentpreamble=
"On %b %e %T, %Y %z (%Z), %n (%.50N) wrote:\n-- Subject: %.65q\n"
would insert something like
On Oct 27 11:00:07, 2006 -0400 (EDT), anon (Anon Ymous) wrote:
-- Subject: suggestions for mail(1)
before the quoted message.
~m and
~M tilde escapes for indenting messages, in place
of the normal tab character (‘^I’). Be sure to quote the
value if it contains spaces or tabs.~m or ~M). The format
syntax is the same as for header-format. For
example, the following:
set indentpostscript="-- End of excerpt from %.50N"
would insert something like
-- End of excerpt from Anon Ymous
after the quoted message.
Content-Type: TYPE/SUBTYPE’. (See
MIME Enhancements below.)Content-type: text’
messages to this character set or
‘us-ascii’ if the value is empty. If
unset, no character set conversion is done.ask’ the user will be prompted
before overwriting a file. If set to
‘yes’, or to the empty string,
existing target files will be overwritten. If set to
‘no’, no target files will be
overwritten.quoted-printable’ encoding is used
or not. If it has a value, then use it to determine the encoding type.
Allowed values are ‘7bit’,
‘8bit’,
‘binary’,
‘quoted-printable’, or
‘base64’.Content-Type: TYPE/SUBTYPE’. (See
MIME Enhancements below.)Content-Type:
TYPE/SUBTYPE’. (See MIME Enhancements
below.)MBOXmbox” in the
user's home directory.&’ is
used. The format syntax is the same as for
header-format.icase’ to do case
insensitive searches, ‘extended’ to
use extended (rather than basic) regular expressions, and
‘nospec’ to turn off all special
character meanings and do literal string searches. Note that
‘extended’ and
‘nospec’ are not compatible (see
regcomp(3)).reply
or Reply commands). It is useful if you have
multiple email addresses and wish to ensure that replies respect them. If
set, grab the email address(es) from the
‘To’ field of the message being
replied to. If there is only one such address, and if it does not match
any address in the value of ReplyAsRecipient (a
comma or space delimited list of addresses, possibly empty), then use this
address in the ‘From’ field of the
reply. This is accomplished by passing the address to
sendmail(1) with the
-f option. Note: the sendmail options can be
edited with the ~h escape. (See also the
smopts command.)top command; normally, the first five lines
are printed.mail splits a message into a series of its smallest
MIME parts and processes those parts as if they were messages themselves,
passing the header and body through a pipeline of the form:
mail -> MIME-decoder ->
MIME-hook -> pager -> screenThe MIME-decoder decodes
‘base64’ or
‘quoted-printable’ encoding and is
enabled according to the
‘Content-Transfer-Encoding’ of the
part. The MIME-hook is an external program to further
process the part (see below). The pager is the program
that pages the message (see PAGER). Any of these
intermediate pipe stages may be missing and/or different for the head and
body of each MIME part. Certain
‘Content-Types’ may disable the entire
pipeline (e.g.,
‘application/octet’).
The MIME-hook stage is not present unless one of the following variables is set:
mime-hook-TYPE-SUBTYPE applies to the entire MIME part mime-head-TYPE-SUBTYPE applies to the header of the MIME part mime-body-TYPE-SUBTYPE applies to the body of the MIME part
where TYPE and SUBTYPE are the
‘Content-Type’ type and subtype
(respectively) of the MIME part to which the hook applies. If the
“-SUBTYPE” is missing, any subtype is matched. The value of
these variables has the format:
where the command is expected to read from stdin and write to stdout, and the possible flags are
multipart/alternative’ block.
Multipart blocks contain “alternative” versions with the
same information, in increasing order of preference (and decoding
complexity). The last one the mail agent understands is the one to be
displayed. This is typically used for sending a message in both
“plain text” and “html”, but more complex
subtypes are also possible.If your command begins with one of these flags, precede it with a space to signal the end of the flags.
WARNING: automatically running a program is a potential security risk if that program has bugs, so be careful what you run.
Examples: View all
‘Content-Type: image/jpeg’ parts with
xv(1) (assuming it is
installed):
set
mime-body-image-jpeg="/usr/pkg/bin/xv -"Decode all ‘Content-Type:
images/*’ blocks with
uudeview(1) (assuming it is
installed), placing the results in /tmp:
set
mime-hook-image="-/usr/pkg/bin/uudeview -p /tmp -i -a +o -q
-"Read all ‘Content-Type:
text/html’ parts using
lynx(1) (assuming it is
installed) and add this support to
‘multipart/alternative’ blocks:
set mime-body-text-html="+/usr/pkg/bin/lynx -force_html -dump -stdin"
mail uses the HOME,
TMPDIR, and USER environment
variables.
MAIL environment variable.MBOX environment variable.MAILRC environment variable.The Mail Reference Manual.
mail command appeared in
Version 1 AT&T UNIX. This man page is
derived from “The Mail Reference Manual” originally written by
Kurt Shoens.
Historically, mail was just a link to
Mail, which was confusing.
Mail has been removed in NetBSD
9.
The name of the alternates list is
incorrect English (it should be “alternatives”), but is
retained for compatibility.
There must be sufficient space on $TMPDIR for various temporary files.
If an unrecoverable character set conversion error occurs (during display), the message is truncated and a warning is printed. This seems to be rare, but probably the remainder of the message should be printed without conversion.
The internal sh-like parser is not terribly sh-like.
Selecting messages by their content (i.e., with
‘/body:’) is rather slow.
| December 14, 2019 | NetBSD 9.3 |