General-Purpose Mail Package
|Official GNU Software|
General usage of
mail [option...] [address...]
If [address...] part is present,
Attach file to the composed message. The encoding, content type, and content description are controlled by the --encoding, --content-type, and --content-name options, correspondingly.
The option --attach=- instructs
Read attachment body from the file descriptor fd. The
descriptor must be open for reading. This option is useful when
See the options --encoding, --content-type, --content-name, and --content-filename.
Append the given header to the composed message.
This options sets the content type to be used by all subsequent --attach options.
Set the ‘filename’ parameter in the ‘Content-Disposition’ header for the next --attach-fd option.
Set the ‘name’ parameter (description) in the ‘Content-Type’ header for the next --attach or --attach-fd option.
Execute command before opening the mailbox. Any number of --exec options can be given. The commands will be executed after sourcing configuration files (see Mail Configuration Files), but before opening the mailbox.
Return true if the mailbox contains some messages. Return false otherwise.
This is useful for writing shell scripts.
Sets content transfer encoding for use by the subsequent --attach options.
Record outgoing messages in a file named after the first recipient. The name is the login-name portion of the address found first on the ‘To:’ line in the mail header. This option sets the ‘byname’ variable, which see (see byname).
Operate on the mailbox given by the first non-optional command line argument. If there is no such argument, read messages from the user’s mbox file. See Reading Mail, for more details about using this option.
Print header summary to stdout and exit.
Ignore interrupts when composing the message.
The --mime option instructs
Do not display initial header summary.
Do not read the system-wide mailrc file. See Mail Configuration Files.
Print all mail to standard output. It is equivalent to issuing following commands after starting ‘mail -N’:
print * quit
mail --print does not change status of the messages.
Cause interrupts to terminate program.
Sets the return email address for outgoing mail. See return-address.
Don’t create attachments that would have zero-size body. This option affects all attachments created by --attach and --attach-fd options appearing after it in the command line, as well as the body of the original message.
To cancel its effect, use the --no-skip-empty-attachments option.
Send a message with a Subject of subj. Valid only in sending mode.
Read recipients from the message header. Ignore addresses listed in the command line.
Operate on user’s mailbox. This is equivalent to:
with spool_path being the full path to your mailspool directory
(/var/spool/mail or /var/mail on most systems).
The program also understands the common mailutils options (see Common Options.
This document was generated on October 27, 2018 using makeinfo.Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.