/*
* Mail -- a mail program
*
* String data and global state.
*/
#include "mailx.h"
#include "stamp.h"
\tThe Regents of the University of California. All rights reserved.\n\
\n\
Redistribution and use in source and binary forms, with or without\n\
modification, are permitted provided that the following conditions\n\
are met:\n\
\n\
1. Redistributions of source code must retain the above copyright\n\
notice, this list of conditions and the following disclaimer.\n\
2. Redistributions in binary form must reproduce the above copyright\n\
notice, this list of conditions and the following disclaimer in the\n\
3. Neither the name of the University nor the names of its contributors\n\
may be used to endorse or promote products derived from this software\n\
without specific prior written permission.\n\
\n\
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n\
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n\
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n\
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n\
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n\
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n\
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n\
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n\
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n\
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n\
SUCH DAMAGE.\n\
";
/*
* Commands -- sorted ignoring [ and ]
*/
{
X("[ message ... ]\nList the selected messages and all headers as name=value pairs suitable for input to the shell."),
X("[ message ... ]\nCopy the selected messages to a file name derived from the sender of the first message without marking the messages SAVE."),
X("[ message ... ]\nReply to the first message, sending the message to the sender of each selected message. The reply is recorded in a file name derived from the sender of the first message."),
X("[ message ]\nList the status and sender for the selected messages."),
X("[ attachment [ file ... ] ]\nEquivalent to get except the ${MAILCAP} command is not executed."),
X("[ message ...]\nEquivalent to the command sequence Reply ~m ~v."),
X("[ message ... ]\nAn alias for ``mark [ message ... ] nospam''."),
X("[ message ...]\nPipe the selected messages and all headers through ${PAGER}."),
X("[ message ... ]\nEquivalent to More [ message ... ]."),
X("[ message ...]\nList the selected messages and all headers on the standard output."),
X("[ message ... ]\nMail a reply message to the sender of each selected message. The subject will be prefixed with Re:<space> if not already in that form. See reply if ${flipr} is set."),
X("[ message ... ]\nEquivalent to Reply [ message ... ]."),
X("[ message ... ]\nCopy the selected messages to a file name derived from the sender of the first message, marking the messages SAVE."),
X("[ message ... ] start directory\nSplit the messages into files numbered from start in the named directory, marking the messages SAVE. All headers are ignored. Attachments are named n-m. A line containing <path> <n> <lines> <chars> is listed for each message. Optional attachment information is appended to each line: <n>-<m> <name> <type> <lines> <chars>."),
X("[ message ... ]\nEquivalent to Print [ message ... ]"),
X("[ name [ value ] | < file ]\nDeclare an address alias value for name. If value is omitted then the alias for name is listed. If name is omitted then all aliases are listed. < file reads sendmail aliases from file."),
X("[ name ... ]\nDeclare a list of alternate names for the current user. The names are translated to aliases of the current user login name. If name is omitted then the alternate names are listed."),
X("[ message ... ]\nList the selected messages as name=value pairs suitable for input to the shell."),
X("[ directory ]\nChange the current directory. If directory is omitted then ${HOME} is used; if directory is - then the previous current working directory is used; if ${CDPATH} is set then directories not starting with / and whose first component is neither . nor .. then directory is searched for on the : separated list of directories in ${CDPATH}. If directory is - or is found on ${CDPATH} then the full current working directory path is printed."),
X("[ directory ]\nEquivalent to cd [ directory ]."),
X("[ message ... ] [ file ]\nCopy the selected messages to file without marking the messages SAVE. If file is omitted then ${MBOX} is used."),
X("[ message ... ]\nMark the the selected messages to be DELETE from the mailbox. If ${autoprint} is set then the next unREAD message will be listed."),
X("[ header ...]\nEquivalent to ignore [ header ]."),
X("\nList the current message number. Equivalent to `.'."),
X("[ message ...]\nEquivalent to delete [ message ... ] print"),
X("[ message ... ]\nEquivalent to dp."),
X("[ message ... ] address ...\nDuplicate the selected messages to address ... without marking the messages SAVE. The original sender information is preserved. The messages are transferred via SMTP using the ${smtp} host."),
X("[ arg ... ]\nThe arguments are listed after mail and shell file name expansion."),
X("[ message ... ]\nPlace each selected message in a temporary file and invoke ${EDITOR} on the file. The mailbox is not affected."),
X("\nThe else portion of the current if command."),
X("\nExit without changing the mailbox."),
X("[ file ]\nQuit the current mailbox and make file the new mailbox. If file is omitted then the current mailbox status is listed. If file is a directory then mh semantics are assumed."),
X("[ file ]\nEquivalent to file [ file ]."),
X("\nList the contents of the ${folder} directory using ${LISTER}."),
X("[ message ]\nReply to message, recording the reply on a file name derived from the sender of the message."),
X("[ message ]\nList the header summary for the selected messages."),
X("[ attachment [ file ... ] ]\nCopy the attachments in the attachment number list from the current message into file. If file is omitted then the file name from the message attachment line is used. If the content type matches an entry in ${MAILCAP} then the corresponding command is executed. If all arguments are omitted then list the attachment summary for the current message. Valid only after a print or type command has been issued on the current message. A file name of - lists the contents on the standard output. A directory file argument copies the attachment to that directory."),
X("[ name [ value ] ]\nEquivalent to alias [ name [ value ] ]."),
X("[ message ]\nList a page of header summaries that includes the selected message. ${screen} determines the numbers of summaries per page."),
X("[ all | command | ~ [ command ] | set [ all | variable ] ]\nList help information for all or selected commands or variables. Equivalent to `?'."),
X("[ message ... ]\nEquivalent to preserve [ message ... ]"),
X("[ [!] variable | [ d | f ] path | \"a\" [!][=|~] \"b\"\nConditional command execution to be combined with else and endif. r is equivalent to receive and s is equivalent to !receive. d path is true if path is a directory, f path is true if path is a regular file. [!]= is for string [in]equality and [!]~ is for fnmatch(\"b\",\"a\",0)."),
X("[ name ...]\nAdd the name arguments to the list of header field names to be suppressed by the copy, print, and save commands. If name is omitted then the ignored header field names are listed. If both retain and ignore are given then the ignore command is ignored."),
X("[ command ... | dump [ fl[ags] | f[older] | m[essage] | q[ueue] | s[tate] ] ]\nSend command to the IMAP server with message response tracing enabled for the duration of the command, or dump portions of the internal IMAP client state."),
X("\nAppend any new mail to the current mailbox."),
X("[ message ...]\nEquivalent to the command sequence reply ~m ~v."),
X("[ message ... ]\nAn alias for ``mark [ message ... ] spam''."),
X("\nList the software license."),
X("\nList the command names."),
X("[ message .. ]\nEquivalent to headers [ message ...]"),
X("address ...\nCompose and send a message to the address arguments after alias expansion."),
X("address ...\nList the result of alias expansion on the address arguments. map! gives the step-by-step details."),
X("[ message ... ] [no|un]mark[,...]\nSet or clear marks on the selected messages. The marks are: delete, dot (>), mbox (M), new (N), preserve (P), save (*), spam (X), touch, unread (U). Multiple marks may be separated by , or |. If mark is omitted then spam is assumed."),
X("[ message ... ]\nAppend the selected messages to ${MBOX} on normal exit."),
X("[ pattern [;] [ command ] | < file ]\nDeclare a command to be executed by the get command for attachments whose content type matches pattern. If pattern does not contain `/' then it is treated as `pattern/*'; `/*' is the only recognized metacharacter sequence. If command is omitted and `;' is not the command for pattern is deleted, otherwise if `;' is omitted the command for pattern is listed. If command is omitted then all capabilities matching pattern are listed. < file reads mailcap entries from file. Default capabilities are initialized from ${MAILCAP}. `#' is the comment character and `\\' escapes the special meaning of `;', `\\', and <newline>. `%s' in command expands to the attachment file name, `%t' expands to the content type, `%{name}' expands to the value of the name option in the content type header. If `%s' is omitted then attachment is piped to command."),
X("directory\nCreate a new folder directory."),
X("[ message ...]\nPipe the selected messages through ${PAGER}."),
X("\nList the next unREAD message."),
X("[ message ... ]\nEquivalent to more [ message ... ]."),
X("[ [ message ... ] command ]\nPipe the selected messages to command, which must be given as a single, possibly quoted, argument. If command is omitted then ${cmd} is used. If ${page} is set then a <formfeed> is placed between each message on the pipe."),
X("[ message ]\nMark the selected messaged PRESERVE. These messages will not be deleted from the mailbox on exit."),
X("[ message ...]\nList the selected messages on the standard output."),
X("\nPrint the full path of the current working directory."),
X("\nExit, storing READ messages in ${MBOX}, deleting DELETE and SAVE messages from the current mailbox, and retaining all other messages."),
X("[ message ... ]\nEquivalent to replyall."),
X("old new\nRename a folder or folder directory."),
X("[ message ... ]\nMail a reply message to all recipients in the header of each selected message. The subject will be prefixed with Re:<space> if not already in that form. See Reply if ${flipr} is set."),
X("[ message ... ]\nEquivalent to reply, except ${flipr} is ignored."),
X("[ message ... ]\nEquivalent to Reply, except ${flipr} is ignored."),
X("[ message ... ]\nEquivalent to reply [ message ... ]."),
X("[ name ...]\nAdd the name arguments to the list of header field names to be retained by the copy, print, and save commands. Header names not on the retained list are suppressed. If name is omitted then the retained header field names are listed. If both retain and ignore are given then the ignore command is ignored."),
X("directory\nRemove an empty folder directory."),
X("[ message ... ]\nEquivalent to replyall."),
X("[ message ... ] [ file ]\nCopy the selected messages to file, marking the messages SAVE. If file is omitted then ${MBOX} is used."),
X("[ name ... ]\nSimilar to ignore [ name ... ] but only has affect on the save command."),
X("[ name ... ]\nSimilar to retain [ name ... ] but only has affect on the save command."),
X("[no]name[=value] ...\nAssign value to the variable name. If =value is omitted then the name is turned on. noname unsets the value of name. Some unset variables revert to their default values. With no arguments all set variables are listed. set all lists all set and unset variables."),
X("\nInvoke an interactive ${SHELL}."),
X("file\nRead and execute commands from file. Some commands are not valid in source files."),
X("[ message ... ] start directory\nThe same as Split except all headers are retained."),
X("[ message ...]\nList the first ${toplines} lines of the selected messages."),
X("[ message ... ]\nTouch the selected messages by placing unDELETE and unSAVE messages in ${MBOX} on normal exit."),
X("[ message ... ]\nEquivalent to print [ message ... ]"),
X("[ name ... ]\nDelete the aliases for the name arguments."),
X("[ message ... ]\nRestore the selected messages by removing the DELETE mark. If no messages are specified then the most recent DELETE message is restored. If ${autoprint} is on then the last restored message is listed."),
X("[ name ... ]\nEquivalent to unalias [ name ... ]."),
X("[ message ... ]\nRemove the READ mark from the selected messages. If no messages are specified then the most recent DELETE message is restored."),
X("name ...\nEquivalent to set noname no... With no arguments all unset variables are listed. unset all lists all set and unset variables."),
X("\nList the current program version."),
X("[ message ... ]\nPlace each selected message in a temporary file and invoke ${VISUAL} on the file. The mailbox is not affected."),
X("[ message ... ] file\nCopy the selected messages to file minus the message headers, marking the messages SAVE. write! overwrites file instead of appending."),
X("\nEquivalent to exit."),
X("[ + | - ]\nScroll the header summary forward (+ or no argument), or backward (-) by ${screen} lines."),
0, 0, 0, 0, 0, 0
};
/*
* Escape commands -- sorted
*/
{
"!", X("command\tInvoke command."),
".", X("\tSimulate EOF."),
":", X("command\tExecute command level command."),
"_", X("command\tEquivalent to ~_."),
"?", X("[command]\tEscape command help."),
"A", X("\tEquivalent to ~iSign."),
"F", X("[message...]\tSame as ~f, but retain all headers."),
"M", X("[message...]\tSame as ~m, but retain all headers."),
"a", X("\tEquivalent to ~isign."),
"b", X("name...\tAdd names to Bcc: list."),
"c", X("name...\tAdd names to Cc: list."),
"d", X("\tRead in ${DEAD}."),
"e", X("\tInvoke ${EDITOR} on message."),
"f", X("[message...]\tRead in messages."),
"g", X("file\tInterpolate a multipart attachment from file."),
"h", X("\tPrompt for To:, Subject:, and Cc: lists."),
"i", X("name\tInsert ${name}<newline>."),
"m", X("[message...]\tRead in messages, indented by ${indentprefix}."),
"p", X("\tPrint the message buffer."),
"q", X("\tQuit from input mode as if an interrupt was raised."),
"r", X("file|!cmd\tRead file|pipeline into the message buffer."),
"s", X("subject\tSet Subject:."),
"t", X("name...\tAdd names to To: list."),
"v", X("\tInvoke ${VISUAL} on message."),
"w", X("file\tWrite message onto file without headers."),
"x", X("\tLike ~q but message not saved in ${DEAD}."),
"<", X("file\tEquivalent to ~rfile."),
"|", X("command\tPipe the message through command."),
"~", X("\tQuote a single tilde."),
0, 0
};
/*
* Variables -- sorted
*/
{
X(": separated list of directories to search for `cd' command."),
X("Save partial messages on interrupt or delivery error in this file."),
X("The utility invoked for the edit and ~e commands."),
X("The user's home directory, also named \"~\"."),
X("IMAP host and authentication file. Each line with `host name LOGIN name password' or `host name AUTHENTICATE method'."),
X("The utility invoked for the folders command."),
X("The system mailbox path."),
"MAILCAP", &state.var.mailcap, E, "~/.mailcap:/usr/local/etc/mailcap:/usr/etc/mailcap:/etc/mailcap:/etc/mail/mailcap:/usr/public/lib/mailcap",set_mailcap,
X("A `:' separated list of MIME mailcap files. The get command matches attachment content types to ${MAILCAP} entries to determine any special command(s) for content viewing."),
X("The user start-up file."),
X("Save READ system mailbox messages in this file."),
X("The full path of the previous current working directory."),
X("The utility invoked for terminal output pagination."),
X("The full path of the current working directory."),
X("flipr"),
X("The preferred command interpreter."),
X("The string inserted by the ~A command."),
X("The utility invoked for the visual and ~v commands."),
X("Treat network names with matching login components as identical."),
X("Append messages at the end of ${MBOX} instead of the beginning."),
X("asksub"),
X("Prompt for a Bcc: line on outgoing mail if not already specified."),
X("Prompt for a Cc: line on outgoing mail if not already specified."),
X("Prompt for this list of header names on outgoing mail if not already specified."),
X("Prompt for a Subject: line on outgoing mail if not already specified."),
X("Place relative ouput files for the get and Get commands in this directory."),
X("Check for new mail at each prompt."),
X("Print the next unREAD message after the delete and undelete commands."),
X("Disable the special meaning of ! in the escape command."),
X("The default command invoked by the pipe command."),
X("Run in mode where stdin and stdout are pipes."),
X("Pipe messages longer than this through ${PAGER}. Negative values cause all messages to be paged."),
X("Enable verbose debugging diagnostics and do not deliver messages."),
X("The local mail address domain."),
X("Make . on a line by itself equivalent to EOF on mail input."),
X("Place this list of headers in files to be edited by ~e and ~v."),
X("The command escape character. Null means no command escapes."),
X("Add these header lines to outgoing messages."),
X("Reverse the meanings of the reply and Reply commands."),
X("The default directory for saving mail files, also named \"+\"."),
X("The default file save directory for the followup and Followup commands."),
X("Write a header summary when entering receive mode."),
X("Ignore blank lines in message headers."),
X("Fake initial ``From '' line to read message from another mailer."),
X("Preserve all READ messages in the system mailbox rather than in ${MBOX}."),
X("The local host name."),
X("Ignore interrupts on message input."),
X("Ignore the EOF char on message input. `.' or ~. must terminate the message."),
X("IMAP host and authentication file. Each line with `host name LOGIN name password' or `host name AUTHENTICATE method'."),
X("mh incoming mailbox. If ${inbox} is a directory then SAVE messages are removed on exit."),
X("Prefix this string to each line of messages inserted by ~m or ~M."),
X("Interactive mode."),
X("Exit 0 if there is new mail, 1 otherwise."),
X("Print the status and sender for the specified number of most recent messages and exit."),
X("Print a new message header summary and exit."),
X("Truncate an empty mailbox to zero length instead of removing it."),
X("Keep SAVE system mailbox messages instead of deleting them."),
X("List of domain name suffixes to delete from all addresses."),
X("System mailbox lock hang seconds delay. If the lock hangs longer than this then it is ignored -- just for the NFS lock daemon."),
X("Log outgoing messages in this file."),
X("The master initialization file."),
X("Don't delete the current user name when sending to an alias or replying."),
X("Enable the internal pager using this string as the prompt."),
X("Treat mail files as netnews article folders."),
X("A no-op just for the standard."),
X("Place relative output message record files in the folder directory."),
X("Insert a <formfeed> between each message sent to the pipe command."),
X("The interactive command mode prompt."),
X("Suppress the opening message and version on program entry."),
X("Set if currently in receive mode."),
X("If all messages have been read then the default current message is set to the last message."),
X("log"),
X("flipr"),
X("Place this string after ${editheaders} for the ~e and ~v commands."),
X("Save messages in ${DEAD} on interrupt or delivery error."),
X("The number of header lines printed by the z command."),
X("Accept /header:string in message addresses."),
X("Interpret headers in send mode messages."),
X("The utility invoked to deliver messages. smtp://[host] uses SMTP to host or to ${smtp} if host is omitted."),
X("Wait for sendmail to complete before returning."),
X("showto"),
X("Show To: info instead of From if message sender is the current user."),
X("The string inserted by the ~a command."),
X("Read the default value for ${sign} from this file."),
X("The SMTP server host name. Used by the duplicate command and sendmail=\"smtp://\"."),
X("Mark candidate spam messages X. All spam matching patterns are case-insensitive ksh(1) patterns."),
X("`|' separated message body spam strings that must match exactly at the beginning of a message body text line."),
X("Maximum seconds delay between hops."),
X("Case-insensitive candidate spammer address list."),
X("Case-insensitive non-spammer address list."),
X("Log system mailbox spam messages in this file."),
X("spamfromok"),
X("Case-insensitive candidate spam Subject: word prefix list."),
X("Spam subject heading list edit expression."),
X("Spam test mask -- see the source, Luke."),
X("Case-insensitive candidate spam recipient address list."),
X("Case-insensitive non-spam recipient address list."),
X("Case-insensitive spammer host hop address list."),
X("Case-insensitive non-spam host hop address list."),
X("The number of lines written by the top command."),
X("Enable implementation dependent tracing."),
X("The login name of the current user."),
X("Enable verbose diagnostic messages."),
0, 0, 0, 0,0
};
/*
* Standard header labels -- layout order
*/
{
"To: ", GTO,
"Subject: ", GSUB,
"Cc: ", GCC,
"Bcc: ", GBCC,
"Status: ", GSTATUS,
0, 0
};
{
id,
terms + 5,
"",
GTO,
};