2 .\" Copyright (c) 1980, 1990, 1993
3 .\" The Regents of the University of California. All rights reserved.
5 .\" Gunnar Ritter. All rights reserved.
6 .\" Copyright (c) 2012 Steffen "Daode" Nurpmeso.
7 .\" All rights reserved.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
17 .\" 3. All advertising materials mentioning features or use of this software
18 .\" must display the following acknowledgement:
19 .\" This product includes software developed by the University of
20 .\" California, Berkeley and its contributors.
21 .\" This product includes software developed by Gunnar Ritter
22 .\" and his contributors.
23 .\" 4. Neither the name of the University nor the names of its contributors
24 .\" may be used to endorse or promote products derived from this software
25 .\" without specific prior written permission.
27 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS '\fIAS IS\fR' AND
28 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 .\" Sccsid: @(#)mailx.1 2.329 (gritter) 10/9/10
41 .TH S-NAIL 1 "2012-06-30" "S-nail; fork of Heirloom mailx 12.5" "User Commands"
43 s-nail \- send and receive Internet mail
48 \fBs-nail\fR [\fB\-BDdEFinOtv~\fR]
49 [\fB\-s\fI\ subject\fR] [\fB\-a\fI\ attachment\fR ]
50 [\fB\-c\fI\ cc-addr\fR] [\fB\-b\fI\ bcc-addr\fR] [\fB\-r\fI\ from-addr\fR]
52 [\fB\-A\fI\ account\fR]
53 [\fB\-S\fI\ variable\fR[\fB=\fIvalue\fR]]
57 \fBs-nail\fR [\fB\-BDdeEHiInNRv~\fR] [\fB\-T\fI\ name\fR]
58 [\fB\-A\fI\ account\fR]
59 [\fB\-S\fI\ variable\fR[\fB=\fIvalue\fR]]
60 \fB\-f\fR [\fIname\fR]
63 \fBs-nail\fR [\fB\-BDdeEinNRv~\fR]
64 [\fB\-A\fI\ account\fR]
65 [\fB\-S\fI\ variable\fR[\fB=\fIvalue\fR]]
71 \fIS-nail\fR is an intelligent mail processing system, which has
72 a command syntax reminiscent of
74 with lines replaced by messages.
75 It is based on Berkeley Mail 8.1,
76 is intended to provide the functionality of the POSIX
80 for MIME, IMAP, POP3, SMTP, and S/MIME.
83 features for interactive use, such as caching and disconnected
84 operation for IMAP, message threading, scoring, and filtering.
85 It is also usable as a mail batch language, both for sending
88 The following options are accepted:
94 for \fIname\fR after the startup files have been read.
97 Attach the given file to the message.
100 Make standard input and standard output line-buffered.
103 Send blind carbon copies to list.
104 List should be a comma-separated
108 Send carbon copies to list of users.
113 mode; see the description for the
118 Enables debugging messages and disables the actual delivery of messages.
121 this option is intended for
126 Just check if mail is present in the system mailbox.
127 If yes, return an exit status of zero,
128 else, a non-zero value.
131 If an outgoing message does not contain any text
132 in its first or only message part,
133 do not send it but discard it silently,
134 effectively setting the
136 variable at program startup.
137 This is useful for sending messages
138 from scripts started by
141 \fB\-f\fR [\fIfile\fR]
142 Read in the contents of the user's mbox
143 (or the specified file)
148 undeleted messages back
150 The string \fIfile\fR is handled
156 Save the message to send
157 in a file named after the local part
158 of the first recipient's address.
161 Print header summaries for all messages and exit.
164 Invoke sendmail with the specified hop count.
165 This option has no effect when SMTP is used for sending mail.
168 Ignore tty interrupt signals.
170 particularly useful when using
171 \fIs-nail\fR on noisy phone lines.
174 Shows the `Newsgroup:' or `Article-Id:' fields
175 in the header summary.
176 Only applicable in combination with
180 Inhibits reading /etc/s-nail.rc upon startup.
181 This option should be activated for
183 scripts that are invoked on more than one machine,
184 because the contents of that file may differ between them.
187 Inhibits the initial display of message headers when reading mail
188 or editing a mail folder.
191 Pass the given option through to sendmail.
192 This option has no effect when SMTP is used for sending mail.
195 Start the message with the contents of the specified file.
196 May be given in send mode only.
201 address. Overrides any
203 variable specified in environment or startup files.
204 Tilde escapes are disabled.
205 The \fI\-r\fI address\fR options are passed to the mail transfer agent
207 This option exists for compatibility only;
208 it is recommended to set the
210 variable directly instead.
213 Opens any folders read-only.
216 Specify subject on command line (only the first argument after the
218 flag is used as a subject; be careful to quote subjects
221 \fB\-S\fI\ variable\fR[\fB=\fIvalue\fR]
222 Sets the internal option
224 and, in case of a string option,
228 These assignments take place after the resource files have been loaded.
231 Writes the `Message-Id:' and `Article-Id:' header fields
232 of each message read in the file
236 Compressed files are handled as described for the
241 The message to be sent is expected to contain a message header
242 with `To:', `Cc:', or `Bcc:' fields giving its recipients.
243 Recipients specified on the command line are ignored.
246 Reads the mailbox of the given user name.
251 delivery are displayed on the user's terminal.
254 Print \fIs-nail\fR's version and exit.
257 Enable tilde escapes even if not in interactive mode.
259 To send a message to one or more people,
260 \fIs-nail\fR can be invoked with arguments
261 which are the names of people
262 to whom the mail will be sent.
263 The user is then expected to type in his message,
264 followed by an `control-D' at the beginning of a line.
265 The section below Replying to
267 describes some features of \fIs-nail\fR
268 available to help when composing letters.
270 In normal usage \fIs-nail\fR is given no arguments
271 and checks the user's mail out of the post office,
272 then prints out a one line header
273 of each message found.
274 The current message is initially
275 the first message (numbered 1)
276 and can be printed using the print command
277 which can be abbreviated `p').
278 The user can move among the messages
279 much as he moves between lines in
281 with the commands `+' and `\-' moving backwards and forwards,
283 .SS "Disposing of mail"
284 After examining a message
285 the user can delete `d') the message
287 Deletion causes the \fIs-nail\fR program
288 to forget about the message.
289 This is not irreversible;
290 the message can be undeleted `u')
291 by giving its number,
292 or the \fIs-nail\fR session can be aborted
293 by giving the exit `x') command.
294 Deleted messages will, however,
295 usually disappear never to be seen again.
296 .SS "Specifying messages"
297 Commands such as print and delete
298 can be given a list of message numbers
299 as arguments to apply to a number of messages at once.
300 Thus `\fIdelete 1 2\fR' deletes messages 1 and 2,
301 while `\fIdelete 1-5\fR' deletes messages 1 through 5.
302 In sorted or threaded mode (see the
307 `\fIdelete 1-5\fR' deletes the messages
308 that are located between (and including) messages 1 through 5
309 in the sorted/threaded order,
310 as shown in the header summary.
311 The following special message names exist:
317 All old messages (any not in state read or new).
323 All deleted messages (for the
331 All `flagged' messages.
334 All answered messages
340 All messages marked as draft.
343 All `killed' messages.
346 All messages classified as junk.
352 The message that was previously the current message.
355 The parent message of the current message,
356 that is the message with the Message-ID
357 given in the `In-Reply-To:' field
358 or the last entry of the `References:' field
359 of the current message.
362 The next previous undeleted message,
363 or the next previous deleted message for the
366 In sorted/threaded mode,
367 the next previous such message in the sorted/threaded order.
370 The next undeleted message,
371 or the next deleted message for the
374 In sorted/threaded mode,
375 the next such message in the sorted/threaded order.
378 The first undeleted message,
379 or the first deleted message
383 In sorted/threaded mode,
384 the first such message in the sorted/threaded order.
388 In sorted/threaded mode,
389 the last message in the sorted/threaded order.
393 selects the message addressed with
397 is any other message specification,
398 and all messages from the thread that begins at it.
399 Otherwise, it is identical to
404 the thread beginning with the current message is selected.
410 All messages that were included in the message list
411 for the previous command.
414 All messages that contain
416 in the subject field (case ignored).
423 the string from the previous specification of that type is used again.
428 By default, this is a case-sensitive search
429 for the complete email address.
433 only the local part of the addresses is evaluated for the comparison.
437 a case-sensitive search for the complete real name
438 of a sender is performed.
441 expression can be used instead
442 if substring matches are desired.
445 All messages that satisfy the given IMAP-style SEARCH
447 This addressing mode is available with all types of folders;
448 for folders not located on IMAP servers,
449 or for servers unable to execute the SEARCH command,
451 will perform the search locally.
452 Strings must be enclosed by double quotes `"' in their entirety
453 if they contain white space or parentheses;
455 only backslash `\e' is recognized as an escape character.
456 All string searches are case-insensitive.
457 When the description indicates
458 that the `envelope' representation of an address field is used,
459 this means that the search string is checked against
460 both a list constructed as
463 \fB("\fIreal name\fB" "\fIsource-route\fB" "\fIlocal-part\fB" "\fIdomain-part\fB")\fR
467 and the addresses without real names
468 from the respective header field.
469 Criteria can be nested using parentheses.
471 \fB(\fIcriterion1 criterion2\fR .\|.\|. \fIcriterionN\fB)\fR
472 All messages that satisfy all of the given criteria.
474 .BI (or " criterion1 criterion2" )
475 All messages that satisfy either
480 To connect more than two criteria using `or',
481 (or) specifications have to be nested using additional parentheses,
482 as with `(or\ a\ (or\ b\ c))';
483 `(or\ a\ b\ c)' means ((a or b) and c).
484 For a simple `or' operation of independent criteria
485 on the lowest nesting level,
486 it is possible to achieve similar effects by using
487 three separate criteria, as with
490 .BI (not " criterion" )
491 All messages that do not satisfy
495 All messages that contain
497 in the `envelope' representation of the
502 All messages that contain
504 in the `envelope' representation of the
508 .BI (from " string" )
509 All messages that contain
511 in the `envelope' representation of the
515 .BI (subject " string" )
516 All messages that contain
523 All messages that contain
525 in the `envelope' representation of the
529 .BI (header " name string" )
530 All messages that contain
536 .BI (body " string" )
537 All messages that contain
541 .BI (text " string" )
542 All messages that contain
544 in their header or body.
546 .BI (larger " size" )
547 All messages that are larger than
551 .BI (smaller " size" )
552 All messages that are smaller than
556 .BI (before " date" )
557 All messages that were received before
561 \fId\fR[\fId\fR]\fB-\fImon\fB-\fIyyyy\fR,
562 where \fId\fR[\fId\fR] is the day of the month
563 as one or two digits,
565 is the name of the month\(emone of
569 `Oct', `Nov', or `Dec',
572 is the year as four digits;
573 e.\|g. "30-Aug-2004".
576 All messages that were received on the specified date.
579 All messages that were received since the specified date.
581 .BI (sentbefore " date" )
582 All messages that were sent on the specified date.
584 .BI (senton " date" )
585 All messages that were sent on the specified date.
587 .BI (sentsince " date" )
588 All messages that were sent since the specified date.
591 The same criterion as for the previous search.
592 This specification cannot be used as part of another criterion.
593 If the previous command line contained more than one independent criterion,
594 the last of those criteria is used.
596 A practical method to read a set of messages
599 command with the search criteria first
600 to check for appropriate messages,
601 and to read each single message then by typing `\fB`\fR' repeatedly.
602 .SS "Replying to or originating mail"
606 to set up a response to a message,
607 sending it back to the person who it was from.
608 Text the user types in then,
609 up to an end-of-file,
610 defines the contents of the message.
611 While the user is composing a message,
612 \fIs-nail\fR treats lines beginning with the character `~' specially.
613 For instance, typing `~m' (alone on a line)
614 will place a copy of the current message into the response
615 right shifting it by a tabstop
619 Other escapes will set up subject fields,
620 add and delete recipients to the message,
622 and allow the user to escape to an editor
623 to revise the message
624 or to a shell to run some commands.
625 (These options are given in the summary below.)
626 .SS "Ending a mail processing session"
627 The user can end a \fIs-nail\fR session
628 with the quit (`q') command.
629 Messages which have been examined
630 go to the user's mbox file
631 unless they have been deleted
632 in which case they are discarded.
633 Unexamined messages go back
635 (See the \-f option above).
636 .SS "Personal and systemwide distribution lists"
637 It is also possible to create
638 a personal distribution lists so that,
639 for instance, the user can send mail
640 to `\fIcohorts\fR' and have it go
641 to a group of people.
642 Such lists can be defined by placing a line like
645 \fBalias\fI cohorts bill ozalp jkf mark kridle@ucbcory\fR
648 in the file .mailrc in the user's home directory.
649 The current list of such aliases
650 can be displayed with the alias command in \fIs-nail\fR.
651 System wide distribution lists can be created
652 by editing /etc/aliases, see
656 these are kept in a different syntax.
657 In mail the user sends,
658 personal aliases will be expanded
659 in mail sent to others so that
660 they will be able to reply to the recipients.
661 System wide aliases are not expanded when the mail is sent,
662 but any reply returned to the machine
663 will have the system wide alias expanded
664 as all mail goes through sendmail.
665 .SS "Recipient address specifications"
666 When an address is used to name a recipient
667 (in any of To, Cc, or Bcc),
668 names of local mail folders
669 and pipes to external commands
670 can also be specified;
671 the message text is then written to them.
672 The rules are: Any name which starts with a
674 character specifies a pipe,
675 the command string following the `|'
676 is executed and the message is sent to its standard input;
677 any other name which contains a
679 character is treated as a mail address;
680 any other name which starts with a
682 character specifies a folder name;
683 any other name which contains a
690 character before also specifies a folder name;
691 what remains is treated as a mail address.
692 Compressed folders are handled as described for the
695 .SS "Network mail (Internet / ARPA, UUCP, Berknet)"
698 for a description of network addresses.
699 \fIS-nail\fR has a number of options
700 which can be set in the .mailrc file
701 to alter its behavior;
702 thus `\fIset askcc\fR' enables the askcc feature.
703 (These options are summarized below).
705 For any outgoing attachment,
706 \fIs-nail\fR tries to determine the content type.
707 It does this by reading MIME type files
708 whose lines have the following syntax:
711 \fItype\fB/\fIsubtype extension \fR[\fIextension \fR.\ .\ .]\fR
714 where type/subtype are strings describing the file contents,
715 and extension is the part of a filename starting after the last dot.
716 Any line not immediately beginning with an ASCII alphabetical character is
717 ignored by \fIs-nail\fR.
718 If there is a match with the extension of the file to attach,
719 the given type/subtype pair is used.
720 Otherwise, or if the filename has no extension,
721 the content types text/plain or application/octet-stream are used,
722 the first for text or international text files,
723 the second for any file that contains formatting characters
724 other than newlines and horizontal tabulators.
727 normally detects the character set of the terminal
728 using the LC_CTYPE locale setting.
729 If the locale cannot be used appropriately,
730 the \fIttycharset\fR variable should be set
731 to provide an explicit value.
732 When reading messages,
733 their text is converted to the terminal character set if possible.
734 Unprintable characters and illegal byte sequences are detected
735 and replaced by Unicode substitute characters or question marks
738 is set at initialization time.
740 The character set for outgoing messages
741 is not necessarily the same
742 as the one used on the terminal.
743 If an outgoing text message
744 contains characters not representable in US-ASCII,
745 the character set being used
746 must be declared within its header.
747 Permissible values can be declared
748 using the \fIsendcharsets\fR variable,
751 tries each of the values in order
752 and uses the first appropriate one.
753 If the message contains characters that cannot be represented
754 in any of the given character sets,
755 the message will not be sent,
756 and its text will be saved to the `dead.letter' file.
757 Messages that contain NUL bytes are not converted.
759 Outgoing attachments are converted if they are plain text.
762 variable contains more than one character set name,
765 tilde escape will ask for the character sets for individual attachments
766 if it is invoked without arguments.
768 Best results are usually achieved
771 is run in a UTF-8 locale
772 on a UTF-8 capable terminal.
774 characters from various countries can be displayed,
775 while it is still possible to use more simple
776 character sets for sending
777 to retain maximum compatibility with older mail clients.
779 Each command is typed on a line by itself,
780 and may take arguments following the command word.
781 The command need not be typed in its entirety \(en
782 the first command which matches the typed prefix is used.
783 For commands which take message lists as arguments,
784 if no message list is given,
785 then the next message forward which satisfies
786 the command's requirements is used.
787 If there are no messages forward of the current message,
788 the search proceeds backwards,
789 and if there are no good messages at all,
790 \fIs-nail\fR types `\fIapplicable messages\fR' and aborts the command.
791 If the command begins with a \fI#\fR sign,
794 The arguments to commands can be quoted, using the following methods:
796 An argument can be enclosed between paired double-quotes
797 "\|" or single-quotes '\|'; any white space, shell
798 word expansion, or backslash characters within the quotes
799 are treated literally as part of the argument.
800 A double-quote will be treated literally within
801 single-quotes and vice versa. These special properties of
802 the quote marks occur only when they are paired at the
803 beginning and end of the argument.
805 A backslash outside of the enclosing quotes is discarded
806 and the following character is treated literally as part of
809 An unquoted backslash at the end of a command line is
810 discarded and the next line continues the command.
812 Filenames, where expected, are subjected to the following
813 transformations, in sequence:
815 If the filename begins with an unquoted plus sign, and
819 the plus sign will be replaced by the value of the
821 variable followed by a slash. If the
824 unset or is set to null, the filename will be unchanged.
826 Shell word expansions are applied to the filename.
827 If more than a single pathname results
828 from this expansion and the command is expecting one
829 file, an error results.
831 The following commands are provided:
834 Print out the preceding message.
835 If given a numeric argument n,
836 goes to the n'th previous message and prints it.
839 Prints a brief summary of commands.
842 Executes the shell (see
846 command which follows.
849 A synonym for the \fIpipe\fR command.
852 (ac) Creates, selects or lists
854 An account is formed by a group of commands,
855 primarily of those to set variables.
857 of which the second is a `{',
858 the first argument gives an account name,
859 and the following lines create a group of commands for that account
860 until a line containing a single `}' appears.
862 the previously created group of commands
863 for the account name is executed,
866 command is executed for the system mailbox or inbox
869 the list of accounts and their contents are printed.
873 \fBaccount\fI myisp\fR \fB{\fR
874 set folder=imaps://mylogin@imap.myisp.example
876 set from="myname@myisp.example (My Name)"
877 set smtp=smtp.myisp.example
881 creates an account named `myisp'
882 which can later be selected by specifying `account myisp'.
885 (a) With no arguments,
886 prints out all currently-defined aliases.
887 With one argument, prints out that alias.
888 With more than one argument,
889 creates a new alias or changes an old one.
892 (alt) The alternates command is useful
893 if the user has accounts on several machines.
894 It can be used to inform \fIs-nail\fR
895 that the listed addresses all belong to the invoking user.
896 When he replies to messages,
897 \fIs-nail\fR will not send a copy of the message
898 to any of the addresses
899 listed on the alternates list.
900 If the alternates command is given
902 the current set of alternate names is displayed.
905 (ans) Takes a message list and marks each message
906 as a having been answered.
907 This mark has no technical meaning in the mail system;
908 it just causes messages to be marked in the header summary,
909 and makes them specially addressable.
912 Only applicable to cached IMAP mailboxes;
913 takes a message list and reads the specified messages
917 Calls a macro (see the
925 Only applicable to S/MIME signed messages.
926 Takes a message list and a file name
927 and saves the certificates contained within the message signatures
928 to the named file in both human-readable and PEM format.
929 The certificates can later be used to send encrypted messages
930 to the messages' originators by setting the
931 .I smime-encrypt-user@host
935 (ch) Changes the user's working directory to that specified,
937 If no directory is given,
938 then changes to the user's login directory.
941 (cl) Takes a list of messages and
942 examines their contents for characteristics of junk mail
943 using Bayesian filtering.
944 Messages considered to be junk are then marked as such.
945 The junk mail database is not changed.
949 Only applicable to threaded mode.
951 and makes all replies to these messages invisible
953 unless they are in state `new'.
956 (conn) If operating in disconnected mode on an IMAP mailbox,
957 switch to online mode and connect to the mail server
958 while retaining the mailbox status.
959 See the description of the
961 variable for more information.
964 (c) The copy command does the same thing that
967 except that it does not mark the messages
968 it is used on for deletion when the user quits.
969 Compressed files and IMAP mailboxes are handled as described for the
976 but saves the messages in a file named after the local part
977 of the sender address of the first message.
980 (dec) For unencrypted messages,
981 this command is identical to
983 Encrypted messages are first decrypted, if possible,
989 but saves the messages in a file named after the local part
990 of the sender address of the first message.
993 (def) Defines a macro.
994 A macro definition is a sequence of commands in the following form:
997 \fBdefine\fR \fIname\fB {\fR
1005 Once defined, a macro can be explicitly invoked using the
1008 or can be implicitly invoked by setting the
1011 .I folder-hook-fullname
1015 Prints the currently defined macros including their contents.
1018 (d) Takes a list of messages as argument
1019 and marks them all as deleted.
1020 Deleted messages will not be saved in mbox,
1021 nor will they be available for most other commands.
1027 (disco) If operating in online mode on an IMAP mailbox,
1028 switch to disconnected mode while retaining the mailbox status.
1029 See the description of the
1031 variable for more information.
1032 A list of messages may optionally be given as argument;
1033 the respective messages are then read into the cache
1034 before the connection is closed.
1035 Thus `disco *' makes the entire current mailbox
1036 available for disconnected use.
1039 Deletes the current message
1040 and prints the next message.
1041 If there is no next message,
1042 \fIs-nail\fR says `\fIat EOF\fR'.
1045 Takes a message list and marks each message
1047 This mark has no technical meaning in the mail system;
1048 it just causes messages to be marked in the header summary,
1049 and makes them specially addressable.
1052 Echoes its arguments,
1053 resolving special names
1054 as documented for the folder command.
1055 The escape sequences
1072 (e) Takes a list of messages
1073 and points the text editor
1074 at each one in turn.
1075 Modified contents are discarded
1081 Marks the end of the then-part
1083 and the beginning of the part
1084 to take effect if the condition
1085 of the if statement is false.
1088 Marks the end of an if statement.
1091 (ex or x) Effects an immediate return to the Shell
1092 without modifying the user's system mailbox,
1094 or his edit file in \-f.
1097 (fi) The same as folder.
1100 (fl) Takes a message list
1101 and marks the messages as `flagged' for urgent/special attention.
1102 This mark has no technical meaning in the mail system;
1103 it just causes messages to be highlighted in the header summary,
1104 and makes them specially addressable.
1108 list the names of the folders in the folder directory.
1109 With an existing folder as an argument,
1110 lists then names of folders below the named folder;
1111 e.\|g. the command `folders @'
1112 lists the folders on the base level of the current IMAP server.
1118 (fold) The folder command switches
1119 to a new mail file or folder.
1120 With no arguments, it tells the user
1121 which file he is currently reading.
1122 If an argument is given,
1123 it will write out changes
1124 (such as deletions) the user has made
1125 in the current file and read in
1127 Some special conventions are recognized for the name.
1128 \fB#\fR means the previous file,
1129 \fB%\fR means the invoking user's system mailbox,
1130 \fB%\fIuser\fR means \fIuser's\fR system mailbox,
1131 \fB&\fR means the invoking user's mbox file,
1132 and \fB+\fIfile\fI means a \fIfile\fR in the folder directory.
1133 \fB%:\fIfilespec\fR expands to the same value as \fIfilespec\fR,
1134 but the file is handled as a system mailbox
1135 e.\ g. by the mbox and save commands.
1136 If the name matches one of the strings defined with the
1139 it is replaced by its long form and expanded.
1140 If the name ends with \fB.gz\fR or \fB.bz2\fR,
1141 it is treated as compressed with
1146 Likewise, if \fIname\fR does not exist,
1147 but either \fIname\fB.gz\fR or \fIname\fB.bz2\fR exists,
1148 the compressed file is used.
1149 If \fIname\fR refers to a directory
1150 with the subdirectories `tmp', `new', and `cur',
1151 it is treated as a folder in
1157 \fIprotocol\fB://\fR[\fIuser\fB@\fR]\fIhost\fR[\fB:\fIport\fR][\fB/\fIfile\fR]
1160 is taken as an Internet mailbox specification.
1161 The supported protocols are currently
1165 (IMAP with SSL/TLS encryption),
1170 (POP3 with SSL/TLS encryption).
1173 contains special characters, in particular `/' or `%',
1174 they must be escaped in URL notation,
1178 part applies to IMAP only;
1180 the default `INBOX' is used.
1181 If \fIs-nail\fR is connected to an IMAP server,
1182 a name of the form \fB@\fImailbox\fR
1183 refers to the \fImailbox\fR on that server.
1184 If the `folder' variable refers to an IMAP account,
1185 the special name `%' selects the `INBOX' on that account.
1190 but saves the message in a file
1191 named after the local part of the first recipient's address.
1196 but saves the message in a file
1197 named after the local part of the first recipient's address.
1202 but responds to all recipients regardless of the
1211 but responds to the sender only regardless of the
1219 Takes a message and the address of a recipient
1220 and forwards the message to him.
1221 The text of the original message is included in the new one,
1222 with the value of the
1224 variable printed before.
1229 commands specify which header fields are included in the new message.
1230 Only the first part of a multipart message is included unless the
1231 .I forward-as-attachment
1238 but saves the message in a file named after
1239 the local part of the recipient's address.
1242 (f) Takes a list of messages
1243 and prints their message headers,
1244 piped through the pager if the output does not fit on the screen.
1247 Specifies which header fields are to be ignored with the
1250 This command has no effect when the
1251 .I forward-as-attachment
1255 Specifies which header fields are to be retained with the
1261 This command has no effect when the
1262 .I forward-as-attachment
1266 (go) Takes a list of messages
1267 and marks all of them as not being junk mail.
1268 Data from these messages is then inserted
1269 into the junk mail database for future classification.
1272 (h) Lists the current range of headers,
1273 which is an 18-message group.
1274 If a `+' argument is given,
1275 then the next 18-message group is printed,
1276 and if a `\-' argument is given,
1277 the previous 18-message group is printed.
1283 (ho, also preserve) Takes a message list
1284 and marks each message therein to be saved
1285 in the user's system mailbox
1287 Does not override the delete command.
1289 deviates from the POSIX standard with this command,
1290 as a `next' command issued after `hold'
1291 will display the following message,
1292 not the current one.
1295 Commands in \fIs-nail\fR's startup files
1296 can be executed conditionally
1297 depending on whether the user is sending
1298 or receiving mail with the if command.
1303 \fIcommands .\ .\ .\fR
1307 An else form is also available:
1311 \fIcommands .\ .\ .\fR
1313 \fIcommands .\ .\ .\fR
1317 Note that the only allowed conditions are
1322 (execute command if standard input is a tty).
1325 Add the list of header fields named to the ignored list.
1326 Header fields in the ignore list are not printed
1327 on the terminal when a message is printed.
1328 This command is very handy for suppression
1329 of certain machine-generated header fields.
1330 The Type and Print commands can be used
1331 to print a message in its entirety,
1332 including ignored fields.
1333 If ignore is executed with no arguments,
1334 it lists the current set of ignored fields.
1337 Sends command strings directly to the current IMAP server.
1338 \fIS-nail\fR operates always in IMAP \fIselected state\fR
1339 on the current mailbox;
1340 commands that change this
1341 will produce undesirable results
1342 and should be avoided.
1343 Useful IMAP commands are:
1347 Takes the name of an IMAP mailbox as an argument
1352 Takes the name of an IMAP mailbox as an argument
1353 and prints the quotas that apply to the mailbox.
1354 Not all IMAP servers support this command.
1358 Takes no arguments and prints the Personal Namespaces,
1359 the Other User's Namespaces,
1360 and the Shared Namespaces.
1361 Each namespace type is printed in parentheses;
1362 if there are multiple namespaces of the same type,
1363 inner parentheses separate them.
1365 a namespace prefix and a hierarchy separator is listed.
1366 Not all IMAP servers support this command.
1374 (j) Takes a list of messages
1375 and marks all of them as junk mail.
1376 Data from these messages is then inserted
1377 into the junk mail database for future classification.
1380 (k) Takes a list of messages and `kills' them.
1381 Killed messages are not printed in header summaries,
1382 and are ignored by the
1387 command also sets the score of the messages to negative infinity,
1390 commands will not unkill them again.
1391 Killing is only effective for the current session on a folder;
1392 when it is quit, all messages are automatically unkilled.
1395 Prints the names of all available commands.
1400 but saves the message in a file
1401 named after the local part of the first recipient's address.
1404 (m) Takes as argument login names
1405 and distribution group names
1406 and sends mail to those people.
1409 Indicate that a list of messages be sent
1410 to mbox in the user's home directory when
1413 This is the default action for messages
1418 deviates from the POSIX standard with this command,
1419 as a `next' command issued after `mbox'
1420 will display the following message,
1421 not the current one.
1426 but marks the messages for deletion
1427 if they were transferred successfully.
1432 but moves the messages to a file named after the local part
1433 of the sender address of the first message.
1436 Checks for new mail in the current folder
1437 without committing any changes before.
1438 If new mail is present, a message is printed.
1442 the headers of each new message are also printed.
1445 (n) like + or CR) Goes to the next message
1446 in sequence and types it.
1447 With an argument list, types the next matching message.
1462 If the current folder is located on an IMAP or POP3 server,
1463 a NOOP command is sent.
1464 Otherwise, no operation is performed.
1470 pipes ignored header fields
1471 and all parts of MIME
1472 .I multipart/alternative
1476 (pi) Takes a message list and a shell command
1477 and pipes the messages through the command.
1478 Without an argument,
1479 the current message is piped
1480 through the command given by the \fIcmd\fR variable.
1481 If the \fI page\fR variable is set,
1482 every message is followed by a formfeed character.
1492 prints out ignored header fields
1493 and all parts of MIME
1494 .I multipart/alternative
1503 (p) Takes a message list and types out each message
1504 on the user's terminal.
1505 If the message is a MIME multipart message,
1506 all parts with a content type of `text' or `message' are shown,
1507 the other are hidden except for their headers.
1508 Messages are decrypted and converted to the terminal character set
1512 (prob) For each word given as argument,
1513 the contents of its junk mail database entry are printed.
1516 (q) Terminates the session, saving all undeleted,
1517 unsaved messages in the user's mbox file in his login directory,
1518 preserving all messages marked with hold or preserve
1519 or never referenced in his system mailbox,
1520 and removing all other messages from his system mailbox.
1521 If new mail has arrived during the session,
1522 the message `\fIYou have new mail\fR' is given.
1523 If given while editing a mailbox file with the \-f flag,
1524 then the edit file is rewritten.
1525 A return to the Shell is effected,
1526 unless the rewrite of edit file fails,
1527 in which case the user can escape
1528 with the exit command.
1539 (rem) Removes the named folders.
1540 The user is asked for confirmation
1541 in interactive mode.
1544 (ren) Takes the name of an existing folder
1545 and the name for the new folder
1546 and renames the first to the second one.
1547 Both folders must be of the same type
1548 and must be located on the current server for IMAP.
1551 (R) Reply to originator.
1552 Does not reply to other recipients
1553 of the original message.
1556 (r) Takes a message list and sends mail
1557 to the sender and all recipients of the specified message.
1558 The default message must not be deleted.
1563 but responds to all recipients regardless of the
1572 but responds to the sender only regardless of the
1581 but does not add any header lines.
1582 This is not a way to hide the sender's identity,
1583 but useful for sending a message again
1584 to the same recipients.
1587 Takes a list of messages and a user name
1588 and sends each message to the named user.
1589 `Resent-From:' and related header fields are prepended
1590 to the new copy of the message.
1609 Add the list of header fields named to the retained list.
1610 Only the header fields in the retain list are shown
1611 on the terminal when a message is printed.
1612 All other header fields are suppressed.
1613 The Type and Print commands can be used
1614 to print a message in its entirety.
1615 If retain is executed with no arguments,
1616 it lists the current set of retained fields.
1622 but saves the messages
1623 in a file named after the local part
1624 of the sender of the first message
1625 instead of taking a filename argument.
1628 (s) Takes a message list and a filename
1629 and appends each message
1630 in turn to the end of the file.
1631 If no filename is given,
1632 the mbox file is used.
1633 The filename in quotes,
1634 followed by the line count and character count
1635 is echoed on the user's terminal.
1636 If editing a system mailbox,
1637 the messages are marked for deletion.
1638 Compressed files and IMAP mailboxes are handled as described for the
1640 command line option above.
1646 Saveignore is to save what ignore is to print and type.
1647 Header fields thus marked are filtered out
1648 when saving a message by save
1649 or when automatically saving to mbox.
1650 This command should only be applied to header fields
1651 that do not contain information needed to decode the message,
1652 as MIME content fields do.
1653 If saving messages on an IMAP account,
1654 ignoring fields makes it impossible
1655 to copy the data directly on the server,
1656 thus operation usually becomes much slower.
1659 Saveretain is to save what retain is to print and type.
1660 Header fields thus marked are the only ones
1661 saved with a message when saving by save
1662 or when automatically saving to mbox.
1663 Saveretain overrides saveignore.
1664 The use of this command is strongly discouraged
1665 since it may strip header fields
1666 that are needed to decode the message correctly.
1669 (sc) Takes a message list and a floating point number
1670 and adds the number to the score of each given message.
1671 All messages start at score 0 when a folder is opened.
1672 When the score of a message becomes negative, it is `killed'
1673 with the effects described for the
1676 otherwise if it was negative before and becomes positive,
1678 Scores only refer to the currently opened instance of a folder.
1681 (se) With no arguments, prints all variable values,
1682 piped through the pager if the output does not fit on the screen.
1683 Otherwise, sets option.
1684 Arguments are of the form option=value
1685 (no space before or after =)
1687 Quotation marks may be placed around any part of the
1688 assignment statement to quote blanks
1689 or tabs, i.\|e. `\fIset indentprefix="\->"\fR'.
1690 If an argument begins with
1692 as in `\fBset no\fIsave\fR',
1693 the effect is the same as invoking the
1695 command with the remaining part of the variable
1696 (`\fIunset \fIsave\fR').
1699 Takes a message list and marks all messages as having been read.
1702 (sh) Invokes an interactive version of the shell.
1705 Defines a shortcut name and its string for expansion,
1706 as described for the
1710 a list of defined shortcuts is printed.
1715 but performs neither MIME decoding nor decryption
1716 so that the raw message text is shown.
1719 Takes a message list and prints out
1720 the size in characters of each message.
1723 Create a sorted representation of the current folder,
1726 command and the addressing modes
1727 such that they refer to messages in the sorted order.
1728 Message numbers are the same as in regular mode.
1732 a header summary in the new order is also printed.
1733 Possible sorting criteria are:
1737 Sort the messages by their `Date:' field,
1738 that is by the time they were sent.
1741 Sort messages by the value of their `From:' field,
1742 that is by the address of the sender.
1746 the sender's real name (if any) is used.
1749 Sort the messages by their size.
1752 Sort the messages by their score.
1755 Sort the messages by their message status
1756 (new, read, old, etc.).
1759 Sort the messages by their subject.
1762 Create a threaded order,
1768 Sort messages by the value of their `To:' field,
1769 that is by the address of the recipient.
1773 the recipient's real name (if any) is used.
1776 If no argument is given,
1777 the current sorting criterion is printed.
1780 The source command reads commands from a file.
1783 (th) Create a threaded representation of the current folder,
1784 i.\|e. indent messages that are replies to other messages
1785 in the header display,
1788 command and the addressing modes
1789 such that they refer to messages in the threaded order.
1790 Message numbers are the same as in unthreaded mode.
1794 a header summary in threaded order is also printed.
1797 Takes a message list and prints the top few lines of each.
1798 The number of lines printed is controlled
1799 by the variable toplines
1800 and defaults to five.
1803 Takes a message list
1804 and marks the messages for saving in the
1808 deviates from the POSIX standard with this command,
1809 as a `next' command issued after `mbox'
1810 will display the following message,
1811 not the current one.
1814 (T) Identical to the Print command.
1817 (t) A synonym for print.
1820 Takes a list of names defined by alias commands
1821 and discards the remembered groups of users.
1822 The group names no longer have any significance.
1825 Takes a message list and marks each message
1826 as not having been answered.
1830 Only applicable to threaded mode.
1831 Takes a message list
1832 and makes the message and all replies to it visible
1833 in header summaries again.
1834 When a message becomes the current message,
1835 it is automatically made visible.
1836 Also when a message with collapsed replies is printed,
1837 all of these are automatically uncollapsed.
1840 Undefines each of the named macros.
1841 It is not an error to use a name that does not belong to
1842 one of the currently defined macros.
1845 (u) Takes a message list and marks each message as not being deleted.
1848 Takes a message list and marks each message
1852 Takes a message list and marks each message as not being `flagged'.
1855 Removes the header field names
1856 from the list of ignored fields for the
1861 Removes the header field names
1862 from the list of retained fields for the
1867 Takes a message list and undoes the effect of a
1869 command that was previously applied on exactly these messages.
1872 Removes the header field names
1873 from the list of ignored fields.
1876 Takes a message list and undoes the effect of a
1878 command that was previously applied on exactly these messages.
1881 Takes a message list and `unkills' each message.
1882 Also sets the score of the messages to 0.
1889 (U) Takes a message list and marks each message
1890 as not having been read.
1893 Removes the header field names
1894 from the list of retained fields.
1897 Removes the header field names
1898 from the list of ignored fields for saving.
1901 Removes the header field names
1902 from the list of retained fields for saving.
1905 Takes a list of option names and discards their remembered
1910 Deletes the shortcut names given as arguments.
1913 Disable sorted or threaded mode (see the
1917 commands), return to normal message order
1922 print a header summary.
1930 Takes a message list and verifies each message.
1931 If a message is not an S/MIME signed message,
1932 verification will fail for it.
1933 The verification process checks
1934 if the message was signed using a valid certificate,
1935 if the message sender's email address matches
1936 one of those contained within the certificate,
1937 and if the message content has been altered.
1940 (v) Takes a message list and invokes the display editor
1942 Modified contents are discarded
1948 (w) For conventional messages,
1949 the body without all headers is written.
1950 The output is decrypted and converted
1951 to its native format, if necessary.
1952 If the output file exists,
1953 the text is appended.\(emIf a message is in MIME multipart format,
1954 its first part is written to the specified file
1955 as for conventional messages,
1956 and the user is asked for a filename
1957 to save each other part;
1958 if the contents of the first part are not to be saved,
1959 `write /dev/null' can be used.
1960 For the second and subsequent parts,
1961 if the filename given starts with a `|' character,
1962 the part is piped through the remainder of the filename
1963 interpreted as a shell command.
1964 In non-interactive mode, only the parts of the multipart message
1965 that have a filename given in the part header are written,
1966 the other are discarded.
1967 The original message is never marked for deletion
1968 in the originating mail folder.
1970 the contents of the destination file are overwritten
1971 if the file previously existed.
1972 No special handling of compressed files is performed.
1975 (x) A synonym for exit.
1978 \fIS-nail\fR presents message headers in windowfuls
1979 as described under the headers command.
1980 The z command scrolls to the next window of messages.
1981 If an argument is given,
1982 it specifies the window to use.
1983 A number prefixed by `+' or `\-' indicates
1984 that the window is calculated in relation
1985 to the current position.
1986 A number without a prefix specifies an
1987 absolute window number,
1988 and a `$' lets \fIs-nail\fR scroll
1989 to the last window of messages.
1994 but scrolls to the next or previous window
1995 that contains at least one new or `flagged' message.
1997 Here is a summary of the tilde escapes,
1998 which are used when composing
1999 messages to perform special functions.
2000 Tilde escapes are only recognized
2001 at the beginning of lines.
2002 The name `\fItilde escape\fR' is somewhat of a misnomer
2003 since the actual escape character can be set
2004 by the option escape.
2007 Execute the indicated shell command,
2008 then return to the message.
2011 Same effect as typing the end-of-file character.
2017 Command is executed using the shell.
2018 Its standard output is inserted into the message.
2020 \fB~@\fR [\fIfilename\fR .\ .\ . ]
2021 With no arguments, edit the attachment list.
2022 First, the user can edit all existing attachment data.
2023 If an attachment's file name is left empty,
2024 that attachment is deleted from the list.
2025 When the end of the attachment list is reached,
2027 will ask for further attachments,
2028 until an empty file name is given.
2029 If \fIfilename\fP arguments are specified,
2030 all of them are appended to the end of the attachment list.
2031 Filenames which contain white space
2032 can only be specified
2033 with the first method (no \fIfilename\fP arguments).
2036 Inserts the string contained in the
2039 (same as `~i Sign').
2040 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
2044 Inserts the string contained in the
2047 (same as `~i sign').
2048 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
2051 .BI ~b "name .\ .\ ."
2052 Add the given names to the list of carbon copy recipients
2053 but do not make the names visible in the Cc: line
2054 (`blind' carbon copy).
2056 .BI ~c "name .\ .\ ."
2057 Add the given names to the list of carbon copy recipients.
2060 Read the file `dead.letter' from the user's home directory
2064 Invoke the text editor on the message collected so far.
2065 After the editing session is finished,
2066 the user may continue appending text
2070 Read the named messages into the message being sent.
2071 If no messages are specified,
2072 read in the current message.
2073 Message headers currently being ignored
2074 (by the ignore or retain command)
2076 For MIME multipart messages,
2077 only the first printable part is included.
2080 Identical to ~f, except all message headers and
2081 all MIME parts are included.
2084 Edit the message header fields
2085 `To:', `Cc:', `Bcc:', and `Subject:'
2086 by typing each one in turn
2087 and allowing the user to append text
2088 to the end or modify the field
2089 by using the current terminal erase and kill characters.
2092 Edit the message header fields
2093 `From:', `Reply-To:', `Sender:', and `Organization:'
2094 in the same manner as described for
2096 The default values for these fields originate from the
2102 If this tilde command has been used,
2103 changing the variables has no effect on the current message anymore.
2106 Insert the value of the specified variable
2107 into the message adding a newline character at the end.
2108 If the variable is unset or empty,
2109 the message remains unaltered.
2110 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
2114 Read the named messages into the message being sent,
2115 indented by a tab or by the value of indentprefix.
2116 If no messages are specified,
2117 read the current message.
2118 Message headers currently being ignored
2119 (by the ignore or retain command)
2121 For MIME multipart messages,
2122 only the first printable part is included.
2125 Identical to ~m, except all message headers and
2126 all MIME parts are included.
2129 Print out the message collected so far,
2130 prefaced by the message header fields
2131 and followed by the attachment list, if any.
2132 If the message text is longer than the screen size,
2133 it is piped through the pager.
2136 Abort the message being sent,
2137 copying the message to
2138 `dead.letter' in the user's home directory
2142 Read the named file into the message.
2145 Cause the named string to become the current subject field.
2147 .BI ~t "name .\ .\ ."
2148 Add the given names to the direct recipient list.
2151 Invoke an alternate editor
2152 (defined by the VISUAL option)
2153 on the message collected so far.
2154 Usually, the alternate editor
2155 will be a screen editor.
2156 After the editor is quit,
2157 the user may resume appending text
2158 to the end of the message.
2161 Write the message onto the named file.
2163 the message is appended to it.
2167 except that the message is not saved to the `dead.letter' file.
2170 Pipe the message through the command as a filter.
2171 If the command gives no output or terminates abnormally,
2172 retain the original text of the message.
2176 as command to rejustify the message.
2178 .BI ~: s-nail-command
2179 Execute the given \fIs-nail\fR command.
2180 Not all commands, however, are allowed.
2182 .BI ~_ s-nail-command
2186 Insert the string of text in the message
2187 prefaced by a single ~.
2188 If the escape character has been changed,
2189 that character must be doubled
2190 in order to send it at the beginning of a line.
2191 .SS "Variable options"
2192 Options are controlled via set and unset commands,
2193 see their entries for a syntax description.
2194 An option is also set
2195 if it is passed to \fIs-nail\fR
2196 as part of the environment
2197 (this is not restricted to specific variables as in the POSIX standard).
2198 A value given in a startup file overrides
2199 a value imported from the environment.
2200 Options may be either binary,
2201 in which case it is only significant
2202 to see whether they are set or not;
2203 or string, in which case the actual value is of interest.
2204 .SS "Binary options"
2206 The binary options include the following:
2209 Causes only the local part to be evaluated
2210 when comparing addresses.
2213 Causes messages saved in mbox to be appended to the end
2214 rather than prepended.
2215 This should always be set.
2217 .BR ask \ or \ asksub
2218 Causes \fIs-nail\fR to prompt for the subject
2219 of each message sent.
2220 If the user responds with simply a newline,
2221 no subject field will be sent.
2224 Causes the prompts for `Cc:' and `Bcc:' lists
2225 to appear after the message has been edited.
2228 If set, \fIs-nail\fR asks for files to attach at the end of each message.
2229 Responding with a newline indicates not to include an attachment.
2232 Causes the user to be prompted
2233 for additional carbon copy recipients
2234 (at the end of each message if
2239 Responding with a newline
2240 indicates the user's satisfaction with the current list.
2243 Causes the user to be prompted
2244 for additional blind carbon copy recipients
2245 (at the end of each message if
2250 Responding with a newline
2251 indicates the user's satisfaction with the current list.
2254 Causes the user to be prompted
2255 if the message is to be signed
2256 at the end of each message.
2259 variable is ignored when this variable is set.
2262 Causes threads to be collapsed automatically when
2263 threaded mode is entered
2273 Causes the delete command to behave like dp \-
2274 thus, after deleting a message,
2275 the next one will be typed automatically.
2278 Causes threaded mode (see the
2280 command) to be entered automatically
2281 when a folder is opened.
2284 Enables the substitution of `\fB!\fR'
2285 by the contents of the last command line
2289 Causes automatic display of a header summary after executing a
2294 Sets some cosmetical features to traditional BSD style;
2295 has the same affect as setting `askatend' and
2296 all other variables prefixed with `bsd',
2297 setting prompt to `&\ ', and changing the default pager to
2301 Changes the letters printed in the first column of a header summary
2302 to traditional BSD style.
2305 Changes the display of columns in a header summary
2306 to traditional BSD style.
2309 Changes some informational messages
2310 to traditional BSD style.
2313 Causes the `Subject:' field to appear
2314 immediately after the `To:' field
2315 in message headers and with the
2320 Changes the output format of the
2322 command to traditional BSD style.
2324 .B chained-junk-tokens
2325 Normally, the Bayesian junk mail filter bases its classifications
2326 on single word tokens extracted from messages.
2327 If this option is set,
2328 adjacent words are combined to pairs,
2329 which are then used as additional tokens.
2330 This usually improves the accuracy of the filter,
2331 but also increases the junk mail database
2335 The date in a header summary
2336 is normally the date of the mailbox `From\ ' line of the message.
2337 If this variable is set,
2338 the date as given in the `Date:' header field is used,
2339 converted to local time.
2342 Prints debugging messages and disables the actual delivery of messages.
2345 this option is intended for
2350 When an IMAP mailbox is selected and this variable is set,
2351 no connection to the server is initiated.
2352 Instead, data is obtained from the local cache (see
2354 Mailboxes that are not present in the cache
2355 and messages that have not yet entirely been fetched from the server
2357 to fetch all messages in a mailbox at once,
2358 the command `copy * /dev/null' can be used
2362 Changes that are made to IMAP mailboxes in disconnected mode
2363 are queued and committed later
2364 when a connection to that server is opened in online mode.
2365 This procedure is not completely reliable
2366 since it cannot be guaranteed that the IMAP unique identifiers (UIDs)
2367 on the server still match the ones in the cache at that time.
2368 Data is saved to `dead.letter' when this problem occurs.
2370 \fBdisconnected-\fIuser\fB@\fIhost\fR
2371 The specified account is handled as described for the
2374 but other accounts are not affected.
2377 The binary option dot causes \fIs-nail\fR to interpret
2378 a period alone on a line
2379 as the terminator of a message the user is sending.
2382 When a message is edited while being composed,
2383 its header is included in the editable text.
2384 `To:', `Cc:', `Bcc:', `Subject:', `From:', `Reply-To:', `Sender:',
2386 fields are accepted within the header,
2387 other fields are ignored.
2390 If set, an empty mailbox file is not removed.
2391 This may improve the interoperability with other mail user agents
2392 when using a common folder directory.
2395 If the mailbox is empty,
2396 \fIs-nail\fR normally prints \fI`No mail for user'\fR
2397 and exits immediately.
2398 If this option is set,
2399 \fIs-nail\fR starts even with an empty mailbox.
2406 commands and vice-versa.
2408 .B forward-as-attachment
2409 Original messages are normally sent as inline text with the
2412 and only the first part of a multipart message is included.
2414 messages are sent as MIME
2417 and all of their parts are included.
2422 options are ignored when the
2423 .I forward-as-attachment
2427 When replying to a message,
2428 \fIs-nail\fR normally removes the comment parts of email addresses,
2429 which by convention contain the full names of the recipients.
2430 If this variable is set,
2431 such stripping is not performed,
2432 and comments are retained.
2435 Causes the header summary to be written at startup
2436 and after commands that affect the number of messages
2437 or the order of messages in the current folder;
2441 This option is used to hold messages
2442 in the system mailbox by default.
2445 Causes interrupt signals from the terminal
2446 to be ignored and echoed as @'s.
2449 An option related to dot is ignoreeof
2450 which makes \fIs-nail\fR refuse to
2451 accept a control-d as the end of a message.
2452 Ignoreeof also applies to \fIs-nail\fR command mode.
2454 .B imap-use-starttls
2457 to issue a STARTTLS command
2458 to make an unencrypted IMAP session SSL/TLS encrypted.
2459 This functionality is not supported by all servers,
2460 and is not used if the session is already encrypted by the IMAPS method.
2462 \fBimap-use-starttls-\fIuser\fB@\fIhost\fR
2464 .I imap-use-starttls
2465 for a specific account.
2468 This option causes \fIs-nail\fR to truncate the user's system mailbox
2469 instead of deleting it when it is empty.
2470 This should always be set,
2471 since it prevents malicious users
2472 from creating fake mail folders
2473 in a world-writable spool directory.
2476 When a message is saved,
2477 it is usually discarded
2478 from the originating folder
2483 causes all saved message to be retained.
2486 When a message is replied to
2487 and this variable is set,
2488 it is marked as having been answered.
2489 This mark has no technical meaning in the mail system;
2490 it just causes messages to be marked in the header summary,
2491 and makes them specially addressable.
2494 Usually, when a group is expanded
2495 that contains the sender,
2496 the sender is removed from the expansion.
2497 Setting this option causes
2498 the sender to be included in the group.
2501 Checks for new mail in the current folder
2502 each time the prompt is printed.
2504 the server is then polled for new mail,
2505 which may result in delayed operation
2506 if the connection to the server is slow.
2509 folder must be re-scanned to determine
2510 if new mail has arrived.
2512 If this variable is set to the special value
2514 an IMAP server is not actively asked for new mail,
2515 but new mail may still be detected and announced
2516 with any other IMAP command that is sent to the server.
2519 folder is not scanned then.
2522 the IMAP server may send notifications about messages
2523 that have been deleted on the server
2524 by another process or client.
2525 In this case, `Expunged \fIn\fR messages' is printed
2526 regardless of this variable,
2527 and message numbers may have changed.
2530 Setting the option noheader is the same
2531 as giving the \-N flag on the command line.
2534 Causes the filename given in the
2537 and the sender-based filenames for the
2542 to be interpreted relative to the directory given in the
2544 variable rather than to the current directory
2545 unless it is an absolute pathname.
2548 If set, each message the \fIpipe\fR command prints out
2549 is followed by a formfeed character.
2552 Send messages to the
2554 command without performing MIME and character set conversions.
2557 If this variable is set,
2558 the APOP authentication method is used
2559 when a connection to a POP3 server is initiated.
2560 The advantage of this method over the usual USER/PASS authentication is
2561 that the password is not sent over the network in clear text.
2562 The connection fails
2563 if the server does not support the APOP command.
2565 \fBpop3-use-apop-\fIuser\fB@\fIhost\fR
2568 for a specific account.
2570 .B pop3-use-starttls
2573 to issue a STLS command
2574 to make an unencrypted POP3 session SSL/TLS encrypted.
2575 This functionality is not supported by all servers,
2576 and is not used if the session is already encrypted by the POP3S method.
2578 \fBpop3-use-starttls-\fIuser\fB@\fIhost\fR
2580 .I pop3-use-starttls
2581 for a specific account.
2584 This option causes all characters to be considered printable.
2585 It is only effective if given in a startup file.
2586 With this option set,
2587 some character sequences in messages
2588 may put the user's terminal in an undefined state
2590 it should only be used as a last resort
2591 if no working system locale can be found.
2593 .B print-alternatives
2594 When a MIME message part of type
2595 .I multipart/alternative
2596 is displayed and it contains a subpart of type
2598 other parts are normally discarded.
2599 Setting this variable causes all subparts to be displayed,
2600 just as if the surrounding part was of type
2601 .IR multipart/mixed .
2604 Suppresses the printing of the version when first invoked.
2607 On group replies, specify only the sender of the original mail
2608 in \fI`To:'\fR and mention it's other recipients in the secondary
2612 If both this variable and the
2619 commands save messages to the
2621 folder as it is normally only done for newly composed messages.
2623 .B reply-in-same-charset
2624 If this variable is set,
2626 first tries to use the same character set
2627 of the original message for replies.
2631 variable is evaluated as usual.
2634 Reverses the sense of reply and Reply commands.
2637 When the user aborts a message
2638 with two RUBOUT (interrupt characters)
2639 \fIs-nail\fR copies the partial letter
2640 to the file `dead.letter' in the home directory.
2641 This option is set by default.
2644 If this option is set, then
2645 a message-list specifier in the form `\fI/x:y\fR'
2646 will expand to all messages containing
2647 the substring `\fIy\fR' in the header field `\fIx\fR'.
2648 The string search is case insensitive.
2651 When sending a message,
2652 wait until the mail transfer agent exits
2653 before accepting further commands.
2654 If the mail transfer agent returns a non-zero exit status,
2655 the exit status of s-nail will also be non-zero.
2658 Setting this option causes \fIs-nail\fR to start at the
2659 last message instead of the first one when opening a mail folder.
2664 to use the sender's real name instead of the plain address
2665 in the header field summary and in message specifications.
2668 Causes the recipient of the message to be shown in the header summary
2669 if the message was sent by the user.
2672 If an outgoing message does not contain any text
2673 in its first or only message part,
2674 do not send it but discard it silently
2679 .B smime-force-encryption
2682 to refuse sending unencrypted messages.
2685 If this variable is set,
2686 outgoing messages are S/MIME signed with the user's private key.
2687 Signing a message enables a recipient to verify
2688 that the sender used a valid certificate,
2689 that the email addresses in the certificate
2690 match those in the message header,
2691 and that the message content has not been altered.
2692 It does not change the message text,
2693 and people will be able to read the message as usual.
2695 .B smime-no-default-ca
2696 Do not load the default CA locations
2697 when verifying S/MIME signed messages.
2698 Only applicable if S/MIME support is built using OpenSSL.
2700 .B smtp-use-starttls
2701 Causes \fIs-nail\fR to issue a STARTTLS command
2702 to make an SMTP session SSL/TLS encrypted.
2703 Not all servers support this command;
2704 because of common implementation defects,
2705 it cannot be automatically determined
2706 whether a server supports it or not.
2708 .B ssl-no-default-ca
2709 Do not load the default CA locations
2710 to verify SSL/TLS server certificates.
2711 Only applicable if SSL/TLS support is built using OpenSSL.
2714 Accept SSLv2 connections.
2715 These are normally not allowed
2716 because this protocol version is insecure.
2719 Inhibits the generation of
2720 the \fI`Message-Id:'\fR and \fI`User-Agent:'\fR
2721 header fields that include obvious references to \fIs-nail\fR.
2722 There are two pitfalls associated with this:
2723 First, the message id of outgoing messages is not known anymore.
2724 Second, an expert may still use the remaining information in the header
2725 to track down the originating mail user agent.
2728 Setting the option verbose is the same
2729 as using the \-v flag on the command line.
2730 When \fIs-nail\fR runs in verbose mode,
2731 details of the actual message delivery
2732 and protocol conversations for IMAP, POP3, and SMTP,
2733 as well as of other internal processes,
2734 are displayed on the user's terminal,
2735 This is sometimes useful to debug problems.
2737 prints all data that is sent to remote servers in clear texts,
2738 including passwords,
2739 so care should be taken that no unauthorized option
2740 can view the screen if this option is enabled.
2743 If this variable is set,
2744 messages modified using the
2748 commands are written back to the current folder when it is quit.
2749 This is only possible for writable folders in
2752 Setting this variable also disables
2753 MIME decoding and decryption for the editing commands.
2754 .SS "String Options"
2756 The string options include the following:
2759 A sequence of characters to print in the `attribute'
2760 column of a header summary,
2761 each for one type of messages in the following order:
2773 start of a collapsed thread,
2776 The default is `NUROSPMFATK+\-J',
2777 or `NU\ \ *HMFATK+\-J' if
2781 environment variable
2785 Specifies a list of recipients to which
2786 a blind carbon copy of each outgoing message
2787 will be sent automatically.
2790 Specifies a list of recipients to which
2791 a carbon copy of each outgoing message
2792 will be sent automatically.
2795 Causes sorted mode (see the
2797 command) to be entered automatically
2798 with the value of this option as sorting method
2799 when a folder is opened.
2802 The default value for the \fIpipe\fR command.
2805 The valued option crt is used as a threshold
2806 to determine how long a message must be
2807 before PAGER is used to read it.
2808 If crt is set without a value,
2809 then the height of the terminal screen stored in the system
2810 is used to compute the threshold (see
2814 The name of the file to use
2815 for saving aborted messages.
2816 This defaults to `dead.letter'
2817 in the user's home directory.
2820 Pathname of the text editor to use
2821 in the edit command and ~e escape.
2823 then a default editor is used.
2826 The default MIME encoding to use
2827 in outgoing text messages and message parts.
2828 Valid values are \fI8bit\fR or \fIquoted-printable\fR.
2829 The default is \fI8bit\fR.
2830 In case the mail transfer system
2831 is not ESMTP compliant,
2832 \fIquoted-printable\fR should be used instead.
2833 If there is no need to encode a message,
2834 \fI7bit\fR transfer mode is used,
2835 without regard to the value of this variable.
2836 Binary data is always encoded in \fIbase64\fR mode.
2839 If defined, the first character of this option
2840 gives the character to use in the place of ~ to denote escapes.
2843 The name of the directory to use
2844 for storing folders of messages.
2845 All folder names that begin with `+'
2846 refer to files below that directory.
2847 If the directory name begins with a `/',
2848 \fIs-nail\fR considers it to be an absolute pathname;
2849 otherwise, the folder directory is found
2850 relative to the user's home directory.
2852 The directory name may also refer to an IMAP account;
2853 any names that begin with `+'
2854 then refer to IMAP mailboxes on that account.
2855 An IMAP folder is normally given in the form
2858 imaps://mylogin@imap.myisp.example
2862 the `+' and `@' prefixes for folder names
2863 have the same effect
2868 Some IMAP servers do not accept the creation of mailboxes
2869 in the hierarchy base;
2870 they require that they are created as subfolders of `INBOX'.
2872 a folder name of the form
2875 imaps://mylogin@imap.myisp.example/INBOX.\&
2879 (the last character is the server's hierarchy delimiter).
2880 Folder names prefixed by `+' will then refer to folders below `INBOX',
2881 while folder names prefixed by `@'
2882 refer to folders below the hierarchy base.
2885 command for a method to detect the appropriate prefix and delimiter.
2888 When a folder is opened and this variable is set,
2889 the macro corresponding to the value of this variable is executed.
2890 The macro is also invoked when new mail arrives,
2891 but message lists for commands executed from the macro
2892 only include newly arrived messages then.
2894 \fBfolder-hook-\fIfullname\fR
2898 the macro corresponding to the value of this variable is executed.
2899 Unlike other folder specifications,
2900 the fully expanded name of a folder, without metacharacters,
2901 is used to avoid ambiguities.
2902 The macro specified with
2904 is not executed if this variable is effective for a folder
2905 (unless it is explicitly invoked within the called macro).
2908 The address (or a list of addresses)
2909 to put into the \fI`From:'\fR field of the message header.
2910 If replying to a message,
2911 these addresses are handled as if they were in the alternates list.
2912 .\" If this variable is set,
2913 .\" a \fI`Sender:'\fR field containing the user's name
2914 .\" is also generated,
2915 .\" unless the variable \fIsmtp\fR is set
2916 .\" and its value differs from \fIlocalhost\fR.
2917 If the machine's hostname is not valid at the Internet
2918 (for example at a dialup machine),
2919 either this variable or
2922 to get correct Message-ID header fields.
2925 contains more than one address,
2928 variable must also be set.
2931 The string to print before the text of a message
2936 .I forward-as-attachment
2938 Defaults to ``-------- Original Message --------'' if unset.
2939 If it is set to the empty string,
2940 no heading is printed.
2943 A format string to use for the header summary,
2947 A `%' character introduces a format specifier.
2948 It may be followed by a number indicating the field width.
2949 If the field is a number,
2950 the width may be negative,
2951 which indicates that it is to be left-aligned.
2952 Valid format specifiers are:
2957 %a Message attributes.
2958 %c The score of the message.
2959 %d The date when the message was received.
2960 %e The indenting level in threaded mode.
2961 %f The address of the message sender.
2962 %i The message thread structure.
2963 %l The number of lines of the message.
2965 %o The number of octets (bytes) in the message.
2966 %s Message subject (if any).
2967 %S Message subject (if any) in double quotes.
2968 %t The position in threaded/sorted order.
2969 %> A `>' for the current message, otherwise ` '.
2970 %< A `<' for the current message, otherwise ` '.
2975 The default is `%>\&%a\&%m\ %18f\ %16d\ %4l/%\-5o\ %i%s',
2976 or `%>\&%a\&%m\ %20f\ \ %16d\ %3l/%\-5o\ %i%S' if
2981 Use this string as hostname
2982 when expanding local addresses
2983 instead of the value obtained from
2986 .IR getaddrinfo (3).
2989 Sets the IMAP authentication method.
2990 Valid values are `login' for the usual password-based authentication
2992 `cram-md5', which is a password-based authentication
2993 that does not send the password over the network in clear text,
2994 and `gssapi' for GSSAPI-based authentication.
2996 \fBimap-auth-\fIuser\fB@\fIhost\fR
2997 Sets the IMAP authentication method for a specific account.
3000 Enables caching of IMAP mailboxes.
3001 The value of this variable must point to a directory
3002 that is either existent or can be created by
3004 All contents of the cache can be deleted by
3007 it is not safe to make assumptions about them.
3010 IMAP servers may close the connection
3011 after a period of inactivity;
3012 the standard requires this to be at least 30 minutes,
3013 but practical experience may vary.
3014 Setting this variable to a numeric
3017 causes a NOOP command to be sent each
3019 seconds if no other operation is performed.
3022 When retrieving the list of folders on an IMAP server, the
3024 command stops after it has reached a certain depth
3025 to avoid possible infinite loops.
3026 The value of this variable sets the maximum depth allowed.
3028 If the folder separator on the current IMAP server is a slash `/',
3029 this variable has no effect,
3032 command does not descend to subfolders.
3035 String used by the `\fI~m\fR' and `\fI~M\fR' tilde escapes
3036 and by the \fIquote\fR option
3037 for indenting messages,
3038 in place of the normal tab character (^I).
3039 Be sure to quote the value
3040 if it contains spaces or tabs.
3043 The location of the junk mail database.
3044 The string is treated like a folder name,
3045 as described for the
3049 The files in the junk mail database are normally stored in
3051 format for saving space.
3052 If processing time is considered more important,
3054 can be used to store them in plain form.
3056 will then work using the uncompressed files.
3059 Pathname of the directory lister
3063 when operating on local mailboxes.
3067 Is used as the user's mailbox, if set.
3068 Otherwise, a system-dependent default is used.
3070 \fIprotocol\fB://\fR
3073 command for more information).
3076 A string to put at the beginning of each new message.
3077 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
3081 A string to put at the end of each new message.
3082 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
3085 .B maximum-unencoded-line-length
3086 Messages that contain lines longer than the value of this variable
3087 are encoded in quoted-printable
3088 even if they contain only ASCII characters.
3089 The maximum effective value is 950.
3091 all ASCII text messages are encoded in quoted-printable.
3092 S/MIME signed messages are always encoded
3093 in quoted-printable regardless of the value of this variable.
3096 The name of the mbox file.
3097 It can be the name of a folder.
3098 The default is `\fImbox\fR'
3099 in the user's home directory.
3102 The name of an optional startup file
3103 to be read after ~/.mailrc.
3104 This variable is ignored if it is imported from the environment;
3105 it has an effect only if it is set in /etc/nail.rc or ~/.mailrc
3106 to allow bypassing the configuration with e. g. `MAILRC=/dev/null'.
3107 Use this file for commands
3108 that are not understood by other s-nail implementations.
3111 If this variable has the value
3113 newly created local folders will be in
3118 A directory that contains the files
3120 to retrieve certificates,
3122 to retrieve private keys,
3127 These are usually taken from Mozilla installations,
3128 so an appropriate value might be
3129 `~/.mozilla/firefox/default.clm'.
3131 opens these files read-only
3132 and does not modify them.
3133 However, if the files are modified by Mozilla
3137 it will print a `Bad database' message.
3138 It may be necessary to create copies of these files
3139 that are exclusively used by
3142 Only applicable if S/MIME and SSL/TLS support is built using
3143 Network Security Services (NSS).
3146 The value to put into the \fI`Organization:'\fR field of the message header.
3149 Pathname of the program to use
3151 or when crt variable is set.
3152 The default paginator
3154 or, in BSD compatibility mode,
3157 if this option is not defined.
3159 \fBpassword-\fIuser\fB@\fIhost\fR
3160 Set the password for
3164 If no such variable is defined for a host,
3165 the user will be asked for a password on standard input.
3166 Specifying passwords in a startup file
3167 is generally a security risk,
3168 the file should be readable
3169 by the invoking user only.
3171 .BI pipe- content/subcontent
3172 When a MIME message part of
3173 .I content/subcontent
3174 type is displayed or it is replied to,
3175 its text is filtered through the value of this variable
3176 interpreted as a shell command.
3177 Special care must be taken when using such commands
3178 as mail viruses may be distributed by this method;
3181 were filtered through the shell, for example,
3182 a message sender could easily execute arbitrary code
3188 POP3 servers may close the connection
3189 after a period of inactivity;
3190 the standard requires this to be at least 10 minutes,
3191 but practical experience may vary.
3192 Setting this variable to a numeric
3195 causes a NOOP command to be sent each
3197 seconds if no other operation is performed.
3200 The string printed when a command is accepted.
3201 Defaults to `\fB?\ \fR',
3202 or to `\fB&\ \fR' if the
3207 If set, \fIs-nail\fR starts a replying message with the original message
3208 prefixed by the value of the variable \fIindentprefix\fR.
3209 Normally, a heading consisting of `Fromheaderfield wrote:' is printed
3210 before the quotation.
3211 If the string \fInoheading\fR is assigned to the \fIquote\fR variable,
3212 this heading is omitted.
3213 If the string \fIheaders\fR is assigned,
3214 the headers selected by the ignore/retain commands
3215 are printed above the message body,
3216 thus \fIquote\fR acts like an automatic ~m command then.
3217 If the string \fIallheaders\fR is assigned,
3218 all headers are printed above the message body,
3219 and all MIME parts are included,
3220 thus \fIquote\fR acts like an automatic ~M command then.
3223 If set in addition to \fIindentprefix\fR, \fIs-nail\fR interprets this
3224 number as the maximum line length of the quotation when replying to a
3226 Setting this turns on a more fancy quotation algorithm in that leading
3227 quotation characters are compressed and overlong lines are folded to
3228 \fIquote-fold\fR characters each, breaking at whitespace as necessary
3229 and starting the follow lines with fillers to pad up to the last
3230 quotation markers width.
3231 The value of \fIquote-fold\fR can't be smaller than the length of
3232 \fIindentprefix\fR plus some additional pad. It is automatically
3233 adjusted to the minimum as necessary.
3236 If defined, gives the pathname of the folder
3237 used to record all outgoing mail.
3239 then outgoing mail is not so saved.
3240 When saving to this folder fails,
3241 the message is not sent
3242 but saved to the `dead.letter' file instead.
3245 A list of addresses to put into the \fI`Reply-To:'\fR field
3246 of the message header.
3247 If replying to a message, such addresses are handled
3248 as if they were in the alternates list.
3251 When \fIs-nail\fR initially prints the message headers,
3252 it determines the number to print
3253 by looking at the speed of the terminal.
3254 The faster the terminal, the more it prints.
3255 This option overrides this calculation
3256 and specifies how many message headers
3258 This number is also used
3259 for scrolling with the z command.
3262 A comma-separated list of character set names
3263 that can be used in Internet mail.
3264 When a message that contains characters not representable in US-ASCII
3265 is prepared for sending,
3267 tries to convert its text
3268 to each of the given character sets in order
3269 and uses the first appropriate one.
3270 The default is `utf-8'.
3272 Character sets assigned to this variable should be ordered
3273 in ascending complexity.
3274 That is, the list should start with e.\|g.
3275 `iso-8859-1' for compatibility with older mail clients,
3276 might contain some other language-specific character sets,
3277 and should end with `utf-8'
3278 to handle messages that combine texts in multiple languages.
3281 An address that is put into the `Sender:' field
3282 of outgoing messages.
3283 This field needs not normally be present.
3284 It is, however, required
3285 if the `From:' field contains more than one address.
3286 It can also be used to indicate that a message
3287 was sent on behalf of somebody other;
3288 in this case, `From:' should contain the address
3289 of the person that took responsibility for the message,
3290 and `Sender:' should contain the address
3291 of the person that actually sent the message.
3294 address is handled as if it were in the
3299 To use an alternate mail delivery system,
3300 set this option to the full pathname
3301 of the program to use.
3302 This should be used with care.
3305 Pathname of the shell to use
3306 in the ! command and the ~! escape.
3307 A default shell is used
3308 if this option is not defined.
3312 A string for use with the
3317 A string for use with the
3322 Must correspond to the name of a readable file if set.
3323 The file's content is then appended to each singlepart message
3324 and to the first part of each multipart message.
3325 Be warned that there is no possibility
3326 to edit the signature for an individual message.
3329 Specifies a directory with CA certificates for verification
3330 of S/MIME signed messages.
3331 The format is the same as described in
3332 .IR SSL_CTX_load_verify_locations (3).
3333 Only applicable if S/MIME support is built using OpenSSL.
3336 Specifies a file with CA certificates for verification
3337 of S/MIME signed messages.
3338 The format is the same as described in
3339 .IR SSL_CTX_load_verify_locations (3).
3340 Only applicable if S/MIME support is built using OpenSSL.
3342 \fBsmime-cipher-\fIuser@host\fR
3343 Specifies a cipher to use when generating S/MIME encrypted messages
3355 (3DES, 112/168 bits).
3356 The default is 3DES.
3357 It is not recommended to use the other ciphers
3358 unless a recipient's client is actually unable to handle 3DES
3359 since they are comparatively weak;
3360 but even so, the recipient should upgrade his software in preference.
3363 Specifies a file that contains a CRL in PEM format
3364 to use when verifying S/MIME messages.
3365 Only applicable if S/MIME support is built using OpenSSL.
3368 Specifies a directory that contains files with CRLs in PEM format
3369 to use when verifying S/MIME messages.
3370 Only applicable if S/MIME support is built using OpenSSL.
3372 \fBsmime-encrypt-\fIuser@host\fR
3373 If this variable is set,
3376 are encrypted before sending.
3377 If S/MIME support is built using OpenSSL,
3378 the value of the variable must be set to the name of a file
3379 that contains a certificate in PEM format.
3380 If S/MIME support is built using NSS,
3381 the value of this variable is ignored,
3382 but if multiple certificates for
3385 .I smime-nickname-user@host
3386 variable should be set.
3387 Otherwise a certificate for the recipient
3388 is automatically retrieved from the certificate database,
3391 If a message is sent to multiple recipients,
3392 each of them for whom a corresponding variable is set
3393 will receive an individually encrypted message;
3394 other recipients will continue to receive the message in plain text
3396 .I smime-force-encryption
3398 It is recommended to sign encrypted messages,
3399 i.\|e. to also set the
3403 \fBsmime-nickname-\fIuser@host\fR
3404 Specifies the nickname of a certificate
3405 to be used when encrypting messages for
3407 Only applicable if S/MIME support is built using NSS.
3410 Points to a file in PEM format
3411 that contains the user's private key
3412 as well as his certificate.
3413 Both are used with S/MIME
3414 for signing and decrypting messages.
3415 Only applicable if S/MIME support is built using OpenSSL.
3417 \fBsmime-sign-cert-\fIuser@host\fR
3420 for the specific addresses.
3421 When signing messages and the value of the
3426 the specific file is used.
3427 When decrypting messages,
3428 their recipient fields (To: and Cc:) are searched for addresses
3429 for which such a variable is set.
3431 always uses the first address that matches,
3432 so if the same message is sent to more than one
3433 of the user's addresses using different encryption keys,
3434 decryption might fail.
3435 Only applicable if S/MIME support is built using OpenSSL.
3437 .B smime-sign-include-certs
3438 If used, this must be set to a comma-separated list of files,
3439 each of which containing a single certificate in PEM format
3440 to be included in the S/MIME message in addition to the
3443 This is most useful for long certificate chains if it is
3444 desired to aid the receiving party's verification process.
3445 Only applicable if S/MIME support is built using OpenSSL.
3447 \fBsmime-sign-include-certs-\fIuser@host\fR
3449 .I smime-sign-include-certs
3450 for the specific addresses.
3451 Refer to the discussion of \fBsmime-sign-cert-\fIuser@host\fR
3452 for more on this topic.
3454 .B smime-sign-nickname
3455 Specifies that the named certificate be used for signing mail.
3456 If this variable is not set,
3457 but a single certificate matching the current
3459 address is found in the database,
3460 that one is used automatically.
3461 Only applicable if S/MIME support is built using NSS.
3463 \fBsmime-sign-nickname-\fIuser@host\fR
3465 .I smime-sign-nickname
3466 for a specific address.
3467 Only applicable if S/MIME support is built using NSS.
3470 Normally, \fIs-nail\fR invokes
3472 directly to transfer messages.
3473 If the \fIsmtp\fR variable is set, a SMTP connection to
3474 the server specified by the value of this variable
3476 If the SMTP server does not use the standard port,
3477 a value of \fIserver:port\fR can be given,
3478 with \fIport\fR as a name or as a number.
3480 There are two possible methods to get SSL/TLS encrypted SMTP sessions:
3481 First, the STARTTLS command can be used to encrypt a session
3482 after it has been initiated,
3483 but before any user-related data has been sent; see
3484 .I \%smtp-use-starttls
3486 Second, some servers accept sessions that are encrypted
3487 from their beginning on. This mode is configured by assigning
3488 \fBsmtps://\fIserver\fR[\fB:\fIport\fR]
3493 The SMTP transfer is executed in a child process;
3499 this process runs asynchronously.
3500 If it receives a TERM signal,
3501 it will abort and save the message to the `dead.letter' file.
3504 Sets the SMTP authentication method.
3506 or if unset and smtp-auth-user is set,
3508 If set to `cram-md5',
3509 AUTH CRAM-MD5 is used;
3513 no SMTP authentication is performed.
3515 \fBsmtp-auth-\fIuser\fB@\fIhost\fR
3518 for specific values of sender addresses,
3523 .B smtp-auth-password
3524 Sets the global password for SMTP AUTH.
3525 Both user and password have to be given
3526 for AUTH LOGIN and AUTH CRAM-MD5.
3528 \fBsmtp-auth-password-\fIuser\fB@\fIhost\fR
3530 .I smtp-auth-password
3531 for specific values of sender addresses,
3537 Sets the global user name for SMTP AUTH.
3538 Both user and password have to be given
3539 for AUTH LOGIN and AUTH CRAM-MD5.
3541 If this variable is set but neither
3542 .I smtp-auth-password
3544 .I smtp-auth-password-user@host
3547 will as for a password on the user's terminal.
3549 \fBsmtp-auth-user-\fIuser\fB@\fIhost\fR
3552 for specific values of sender addresses,
3558 Specifies a directory with CA certificates for verification
3559 of SSL/TLS server certificates.
3561 .IR SSL_CTX_load_verify_locations (3)
3562 for more information.
3563 Only applicable if SSL/TLS support is built using OpenSSL.
3566 Specifies a file with CA certificates for verification
3567 of SSL/TLS server certificates.
3569 .IR SSL_CTX_load_verify_locations (3)
3570 for more information.
3571 Only applicable if SSL/TLS support is built using OpenSSL.
3575 for a SSL/TLS client certificate
3576 required by some servers.
3577 Only applicable if SSL/TLS support is built using OpenSSL.
3579 \fBssl-cert-\fIuser\fB@\fIhost\fR
3580 Sets an account-specific file name
3581 for a SSL/TLS client certificate
3582 required by some servers.
3585 for the specified account.
3586 Only applicable if SSL/TLS support is built using OpenSSL.
3589 Specifies a list of ciphers for SSL/TLS connections.
3590 See ciphers(1) for more information.
3591 Only applicable if SSL/TLS support is built using OpenSSL.
3594 Specifies a file that contains a CRL in PEM format
3595 to use when verifying SSL/TLS server certificates.
3596 Only applicable if SSL/TLS support is built using OpenSSL.
3599 Specifies a directory that contains files with CRLs in PEM format
3600 to use when verifying SSL/TLS server certificates.
3601 Only applicable if SSL/TLS support is built using OpenSSL.
3605 for the private key of a SSL/TLS client certificate.
3606 If unset, the name of the certificate file is used.
3607 The file is expected to be in PEM format.
3608 Only applicable if SSL/TLS support is built using OpenSSL.
3610 \fBssl-key-\fIuser\fB@\fIhost\fR
3611 Sets an account-specific file name
3612 for the private key of a SSL/TLS client certificate.
3615 for the specified account.
3616 Only applicable if SSL/TLS support is built using OpenSSL.
3619 Selects a SSL/TLS protocol version;
3620 valid values are `ssl2', `ssl3', and `tls1'.
3621 If unset, the method is selected automatically,
3624 \fBssl-method-\fIuser\fB@\fIhost\fR
3627 for a specific account.
3630 Gives the pathname to an entropy daemon socket,
3635 Gives the pathname to a file with entropy data,
3637 .IR RAND_load_file (3).
3638 If the file is a regular file writable by the invoking user,
3639 new data is written to it after it has been loaded.
3640 Only applicable if SSL/TLS support is built using OpenSSL.
3643 Sets the action to be performed if an error occurs
3644 during SSL/TLS server certificate validation.
3646 `strict' (fail and close connection immediately),
3647 `ask' (ask whether to continue on standard input),
3648 `warn' (print a warning and continue),
3649 `ignore' (do not perform validation).
3650 The default is `ask'.
3652 \fBssl-verify-\fIuser\fB@\fIhost\fR
3655 for a specific account.
3658 If defined, gives the number of lines
3659 of a message to be printed out
3660 with the top command;
3661 normally, the first five
3665 The character set of the terminal \fIs-nail\fR operates on.
3666 There is normally no need to set this variable
3667 since \fIs-nail\fR can determine this automatically
3668 by looking at the LC_CTYPE locale setting;
3669 if this succeeds, the value is assigned at startup
3670 and will be displayed by the \fIset\fP command.
3671 Note that this is not necessarily a character set name
3672 that can be used in Internet messages.
3675 Pathname of the text editor to use
3676 in the visual command and ~v escape.
3677 .SH ENVIRONMENT VARIABLES
3678 Besides the variables described above, \fIs-nail\fR uses
3679 the following environment strings:
3682 The user's home directory.
3684 \fBLANG\fR, \fBLC_ALL\fR, \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR
3689 Is used as startup file instead of ~/.mailrc if set.
3692 scripts are invoked on behalf of other users,
3693 this variable should be set to `/dev/null'
3694 to avoid side-effects from reading their configuration files.
3697 If this variable is set and
3700 it is read as startup file.
3703 Changes the letters printed in the first column of a header summary.
3706 Used as directory for temporary files instead of /tmp, if set.
3710 File giving initial commands.
3713 System wide initialization file.
3716 Personal MIME types.
3719 System wide MIME types.
3721 .SS "Getting started"
3724 command has two distinct usages, according to whether one
3725 wants to send or receive mail.
3726 Sending mail is simple: to send a
3727 message to a user whose email address is, say,
3728 <bill@host.example>,
3733 $ \fBs-nail\fI bill@host.example\fR
3736 then type your message.
3738 will prompt you for a message
3741 after that, lines typed by you form the body of the message.
3742 When you reach the end of the message, type
3743 an EOT (control\-d) at the beginning of a line, which will cause
3745 to echo `EOT' and return you to the shell.
3747 If, while you are composing the message
3748 you decide that you do not wish to send it after all, you can
3749 abort the letter with a \s-2RUBOUT\s0. Typing a single \s-2RUBOUT\s0
3752 to print `(Interrupt -- one more to kill letter)'.
3754 \s-2RUBOUT\s0 causes
3756 to save your partial letter on the file `dead.letter'
3757 in your home directory and abort the letter.
3759 sent mail to someone, there is no way to undo the act, so be
3762 If you want to send the same message to several other people,
3763 you can list their email addresses on the command line.
3767 $ \fBs-nail\fI sam@workstation.example bob@server.example\fR
3769 Tuition fees are due next Friday. Don't forget!
3775 will send the reminder to \fI<sam@workstation.example>\fR.
3777 \fI<bob@server.example>\fR.
3779 To read your mail, simply type
3786 will respond by typing its version number and date and then listing
3787 the messages you have waiting.
3788 Then it will type a prompt and await your command.
3789 The messages are assigned numbers starting with 1\(emyou
3790 refer to the messages with these numbers.
3792 keeps track of which messages are
3794 (have been sent since you last read your mail) and
3796 (have been read by you). New messages have an
3798 next to them in the header listing and old, but unread messages have
3803 keeps track of new/old and read/unread messages by putting a
3808 To look at a specific message, use the
3810 command, which may be abbreviated to simply
3812 For example, if you had the following messages:
3815 O 1 drfoo@myhost.example Wed Sep 1 19:52 18/631 "Fees"
3816 O 2 sam@friends.example Thu Sep 2 00:08 30/895
3819 you could examine the first message by giving the command:
3827 to respond with, for example:
3831 From drfoo@myhost.example Wed Sep 1 19:52:25 2004
3835 Tuition fees are due next Wednesday. Don't forget!
3841 commands that operate on messages take a message number as an
3845 For these commands, there is a notion of a current message.
3848 program, the current message is initially the first
3849 (or the first recent) one.
3850 Thus, you can often omit the message number and use, for example,
3856 to type the current message.
3857 As a further shorthand, you can type a message
3858 by simply giving its message number.
3865 would type the first message.
3867 Frequently, it is useful to read the messages in your mailbox in order,
3869 You can read the next message in
3871 by simply typing a newline.
3872 As a special case, you can type a newline as your first command to
3874 to type the first message.
3876 If, after typing a message, you wish to immediately send a reply,
3877 you can do so with the
3883 takes a message number as an argument.
3885 then begins a message addressed to the user who sent you the message.
3886 You may then type in your letter in reply, followed by a <control-d>
3887 at the beginning of a line, as before.
3891 copies the subject header from the original message.
3892 This is useful in that correspondence
3893 about a particular matter will tend to retain the same subject heading,
3894 making it easy to recognize.
3895 If there are other header fields in the message,
3897 the information found will also be used.
3899 Sometimes you will receive a message that has been sent to
3900 several people and wish to reply only
3901 to the person who sent it.
3905 replies to a message, but sends a copy to the sender only.
3907 If you wish, while reading your mail, to send a message to someone,
3908 but not as a reply to one of your messages, you can send the message
3911 command, which takes as arguments the names of the recipients you wish
3913 For example, to send a message to <frank@machine.example>,
3917 \fBmail\fI frank@machine.example\fR
3920 To delete a message from the mail folder,
3924 In addition to not saving deleted messages,
3926 will not let you type them, either.
3927 The effect is to make the message disappear
3928 altogether, along with its number.
3932 can be tailored to your liking with the
3937 command has two forms, depending on whether you are setting a
3942 Binary options are either on or off. For example, the
3946 that each time you send a message, you want it to prompt you for
3948 to be included in the message.
3951 option, you would type
3957 Valued options are values which
3959 uses to adapt to your tastes.
3964 where to save messages sent by you,
3968 \fBset\fR record=Sent
3972 Note that no spaces are allowed in
3973 .I "set record=Sent".
3976 includes a simple facility for maintaining groups of messages together
3978 To use the folder facility, you must tell
3980 where you wish to keep your folders.
3981 Each folder of messages will be a single file.
3982 For convenience, all of your folders are kept in
3983 a single directory of your choosing.
3986 where your folder directory is, put a line of the form
3989 \fBset folder=\fIletters\fR
3995 If, as in the example above,
3996 your folder directory does not begin with a `/',
3998 will assume that your folder directory is to be found starting from
3999 your home directory.
4001 Anywhere a file name is expected, you can use a folder name, preceded
4003 For example, to put a message into a folder with the
4005 command, you can use:
4008 \fBsave +\fIclasswork\fR
4011 to save the current message in the
4016 folder does not yet exist, it will be created.
4017 Note that messages which are saved with the
4019 command are automatically removed from your system mailbox.
4021 In order to make a copy of a message in a folder without causing
4022 that message to be removed from your system mailbox, use the
4024 command, which is identical in all other respects to the
4031 can be used to direct
4033 to the contents of a different folder.
4037 \fBfolder +\fIclasswork\fR
4042 to read the contents of the
4045 All of the commands that you can use on your system
4046 mailbox are also applicable to folders, including
4051 To inquire which folder you are currently editing, use simply:
4057 To list your current set of folders, use the
4063 command is available to print out a brief summary of the most important
4067 While typing in a message to be sent to others, it is often
4068 useful to be able to invoke the text editor on the partial message,
4069 print the message, execute a shell command, or do some other
4072 provides these capabilities through
4073 .I "tilde escapes" ,
4074 which consist of a tilde (~) at the beginning of a line, followed by
4075 a single character which indicates the function to be performed.
4076 For example, to print the text of the message so far, use:
4082 which will print a line of dashes, the recipients of your message, and
4083 the text of the message so far.
4084 A list of the most important tilde escapes is available with `~?'.
4085 .SS "IMAP or POP3 client setup"
4086 First you need the following data from your ISP:
4087 the host name of the IMAP or POP3 server,
4088 user name and password for this server,
4089 and a notice whether the server uses SSL/TLS encryption.
4090 Assuming the host name is `server.myisp.example'
4091 and your user name for that server is `mylogin',
4092 you can refer to this account using the
4096 command line option with
4099 \fBimaps://\fImylogin\fB@\fIserver.myisp.example\fR
4102 (This string is not necessarily the same as your Internet mail address.)
4103 You can replace `imaps://' with `imap://'
4104 if the server does not support SSL/TLS.
4105 (If SSL/TLS support is built using NSS, the
4107 variable must be set before a connection can be initiated,
4109 Use `pop3s://' or `pop3://' if the server does not offer IMAP.
4110 You should use IMAP if you can, though;
4111 first because it requires fewer network operations than POP3
4112 to get the contents of the mailbox
4114 and second because message attributes
4115 are maintained by the IMAP server,
4116 so you can easily distinguish new and old messages
4117 each time you connect.
4118 Even if the server does not accept IMAPS or POP3S connections,
4119 it is possible that it supports the STARTTLS method
4120 to make a session SSL/TLS encrypted
4121 after the initial connection has been performed,
4122 but before authentication begins.
4123 The only reliable method to see if this works is to try it; enter one of
4126 \fBset imap-use-starttls\fR
4127 \fBset pop3-use-starttls\fR
4130 before you initiate the connection.
4132 As you probably want messages to be deleted from this account
4134 prefix it with `\fI%:\fR'.
4137 command can be used to avoid typing that many characters
4138 every time you want to connect:
4141 \fBshortcut \fImyisp\fB \fB%:imaps://\fImylogin\fB@\fIserver.myisp.example\fR
4144 You might want to put this string into a startup file.
4147 command is specific to this implementation of
4149 and will confuse other implementations,
4150 it should not be used in
4155 \fBset SNAIL_EXTRA_RC=\fI~/.s-nailrc\fR
4165 You can then access your remote mailbox by invoking
4166 `s-nail \-f \fImyisp\fR' on the command line,
4167 or by executing `fi \fImyisp\fR' within s-nail.
4169 If you want to use more than one IMAP mailbox on a server,
4170 or if you want to use the IMAP server for mail storage too,
4174 (which is also \fIs-nail-\fRspecific)
4175 is more appropriate than the
4178 You can put the following in
4182 \fBaccount \fImyisp \fB{\fR
4183 \fBset folder=imaps://\fImylogin\fB@\fIserver.myisp.example\fR
4184 \fBset record=+\fISent \fBMBOX=+\fImbox \fBoutfolder\fR
4188 and can then access incoming mail for this account by invoking
4189 `s-nail \-A \fImyisp\fR' on the command line,
4190 or by executing `ac \fImyisp\fR' within s-nail.
4192 a command like `copy \fI1\fR +\fIotherfolder\fR'
4193 will refer to \fIotherfolder\fR on the IMAP server.
4195 `fi &' will change to the
4199 `fi +Sent' will show your recorded sent mail,
4200 with both folders located on the IMAP server.
4203 will ask you for a password string
4204 each time you connect to a remote account.
4205 If you can reasonably trust the security
4206 of your workstation,
4207 you can give this password in the startup file as
4210 \fBset password-\fImylogin\fB@\fIserver.myisp.example\fB="\fISECRET\fB"\fR
4213 You should change the permissions of this file to 0600, see
4217 supports different authentication methods for both IMAP and POP3.
4218 If Kerberos is used at your location,
4219 you can try to activate GSSAPI-based authentication by
4222 \fBset imap-auth=gssapi\fR
4225 The advantage of this method is that
4227 does not need to know your password at all,
4228 nor needs to send sensitive data over the network.
4229 Otherwise, the options
4232 \fBset imap-auth=cram-md5\fR
4233 \fBset pop3-use-apop\fR
4236 for IMAP and POP3, respectively,
4237 offer authentication methods
4238 that avoid to send the password in clear text over the network,
4239 which is especially important if SSL/TLS cannot be used.
4240 If the server does not offer any of these authentication methods,
4241 conventional user/password based authentication must be used.
4242 It is sometimes helpful to set the
4244 option when authentication problems occur.
4246 will display all data sent to the server in clear text on the screen
4248 including passwords.
4249 You should thus take care that no unauthorized person
4250 can look at your terminal when this option is set.
4252 If you regularly use the same workstation
4253 to access IMAP accounts,
4254 you can greatly enhance performance
4255 by enabling local caching of IMAP messages.
4256 For any message that has been fully or partially fetched from the server,
4257 a local copy is made and is used when the message is accessed again,
4258 so most data is transferred over the network once only.
4259 To enable the IMAP cache,
4260 select a local directory name and put
4263 \fBset imap-cache=\fI~/localdirectory\fR
4266 in the startup file.
4267 All files within that directory
4268 can be overwritten or deleted by \fIs-nail\fR at any time,
4269 so you should not use the directory to store other information.
4271 Once the cache contains some messages,
4272 it is not strictly necessary anymore
4273 to open a connection to the IMAP server
4275 When \fIs-nail\fR is invoked with the \fI\-D\fR option,
4279 only cached data is used
4280 for any folder you open.
4281 Messages that have not yet been completely cached
4282 are not available then,
4283 but all other messages can be handled
4285 Changes made to IMAP mailboxes in
4287 mode are committed to the IMAP server
4288 next time it is used in
4291 Synchronizing the local status
4292 with the status on the server
4293 is thus partially within your responsibility;
4294 if you forget to initiate a connection to the server again
4295 before you leave your location,
4296 changes made on one workstation
4297 are not available on others.
4298 Also if you alter IMAP mailboxes from a workstation
4299 while uncommitted changes are still pending on another,
4300 the latter data may become invalid.
4301 The same might also happen because of internal server status changes.
4302 You should thus carefully evaluate this feature in your environment
4303 before you rely on it.
4305 Many servers will close the connection
4306 after a short period of inactivity. Use one of
4309 \fBset pop3-keepalive=\fI30\fR
4310 \fBset imap-keepalive=\fI240\fR
4313 to send a keepalive message each 30 seconds for POP3,
4314 or each 4 minutes for IMAP.
4316 If you encounter problems connecting to a SSL/TLS server,
4321 variables (see the OpenSSL FAQ for more information)
4322 or specify the protocol version with
4325 if you need a client certificate
4326 or if verification of the server certificate fails.
4327 If the failed certificate is indeed valid,
4328 fetch its CA certificate by executing the shell command
4331 $ \fBopenssl s_client </dev/null \-showcerts \-connect \e
4332 \fIserver.myisp.example\fB:\fIimaps\fB 2>&1 | tee \fIlog\fR
4337 and put it into the file specified with
4339 The data you need is located at the end of the certificate chain
4340 within (and including) the `BEGIN CERTIFICATE'
4341 and `END CERTIFICATE' lines.
4342 (Note that it is possible to fetch
4343 a forged certificate by this method.
4344 You can only completely rely
4345 on the authenticity of the CA certificate
4346 if you fetch it in a way that is trusted by other means,
4347 such as by personally receiving the certificate on storage media.)
4348 .SS "Creating a score file or message filter"
4349 The scoring commands are best separated
4350 from other configuration for clarity,
4354 It is thus recommended to put them in a separate file
4355 that is sourced from your SNAIL_EXTRA_RC as follows:
4358 \fBsource\fI ~/.scores\fR
4361 The \fI.scores\fR file could then look as follows:
4364 \fBdefine\fR \fIlist\fR {
4365 \fBscore\fR (subject "important discussion") +10
4366 \fBscore\fR (subject "annoying discussion") \-10
4367 \fBscore\fR (from "nicefellow@goodnet") +15
4368 \fBscore\fR (from "badguy@poornet") \-5
4369 \fBmove\fR (header x-spam-flag "+++++") \fI+junk\fR
4371 \fBset folder-hook-\fRimap://user@host/public.list=\fIlist\fR
4375 you would see any mail from `nicefellow@goodnet',
4376 even if the surrounding discussion is annoying;
4377 but you normally would not see mail from `badguy@poornet',
4378 unless he participates in the important discussion.
4379 Messages that are marked with five or more plus characters
4380 in their `X-Spam-Flag' field
4381 (inserted by some server-side filtering software)
4382 are moved to the folder `junk' in the
4386 Be aware that all criteria in (\|) lead to substring matches,
4387 so you would also score messages
4388 from e.\|g. `notsobadguy@poornetmakers' negative here.
4389 It is possible to select addresses exactly using \fI"address"\fR
4390 message specifications,
4391 but these cannot be executed remotely
4392 and will thus cause all headers
4393 to be downloaded from IMAP servers while looking for matches.
4395 When searching messages on an IMAP server,
4396 best performance is usually achieved
4397 by sending as many criteria as possible
4398 in one large (\|) specification,
4399 because each single such specification
4400 will result in a separate network operation.
4401 .SS "Activating the Bayesian filter"
4402 The Bayesian junk mail filter works
4403 by examining the words contained in messages.
4404 You decide yourself what a good and what a bad message is.
4405 Thus the resulting filter is your very personal one;
4406 once it is correctly set up,
4407 it will filter only messages similar to those
4408 previously specified by you.
4410 To use the Bayesian filter,
4411 a location for the junk mail database must be defined first:
4414 \fBset junkdb=\fI~/.junkdb\fR
4417 The junk mail database does not contain
4418 actual words extracted from messages,
4419 but hashed representations of them.
4420 A foreign person who can read the database
4421 could only examine the frequency of previously known words
4424 If you have sufficient disk space (several 10\ MB) available,
4425 it is recommended that you set the
4426 .I chained-junk-tokens
4428 The filter will then also consider two-word tokens,
4429 improving its accuracy.
4431 A set of good messages and junk messages must now be available;
4432 it is also possible to use the incoming new messages for this purpose,
4433 although it will of course take some time
4434 until the filter becomes useful then.
4435 Do not underestimate the amount of statistical data needed;
4436 some hundred messages are typically necessary
4437 to get satisfactory results,
4438 and many thousand messages for best operation.
4439 You have to pass the good messages to the
4442 and the junk messages to the
4445 If you ever accidentally mark a good message as junk or vice-versa,
4450 command to correct this.
4452 Once a reasonable amount of statistics has been collected,
4453 new messages can be classified automatically.
4456 command marks all messages that the filter considers to be junk,
4457 but it does not perform any action on them by default.
4458 It is recommended that you move these messages into a separate
4459 folder just for the case that false positives occur,
4460 or to pass them to the
4462 command later again to further improve the junk mail database.
4463 To automatically move incoming junk messages
4464 every time the inbox is opened,
4465 put lines like the following into your
4467 file (or whatever name you gave to the file in the last example):
4470 \fBdefine\fR \fIjunkfilter\fR {
4471 \fBclassify (smaller \fI20000\fB) :n\fR
4472 \fBmove :j\fR \fI+junk\fR
4474 \fBset folder-hook-\fRimap://user@host/INBOX=\fIjunkfilter\fR
4479 option before running the
4483 prints the words it uses for calculating the junk status
4484 along with their statistical probabilities.
4485 This can help you to find out
4486 why some messages are not classified
4487 as you would like them to be.
4488 To see the statistical probability of a given word,
4493 If a junk message was not recognized as such,
4496 command to correct this.
4497 Also if you encounter a false positive
4498 (a good message that was wrongly classified as junk),
4505 command must examine the entire text
4506 of all new messages in the respective folder,
4507 this will also cause all of them to be downloaded from the IMAP server.
4508 You should thus restrict the size of messages for automatic filtering.
4509 If server-based filtering is also available,
4510 you might try if that works for you first.
4511 .SS "Reading HTML mail"
4517 or another command-line web browser
4518 that can write plain text to standard output.
4521 \fBset pipe-text/html=\fR"w3m -dump -T text/html"
4527 \fBset pipe-text/html=\fR"lynx -dump -force_html /dev/stdin"
4530 will then cause HTML message parts to be converted into a more friendly form.
4531 .SS "Viewing PDF attachments"
4532 Most PDF viewers do not accept input directly from a pipe.
4533 It is thus necessary to store the attachment in a temporary file, as with
4536 \fBset pipe-application/pdf=\fR"cat >/tmp/s-nail$$.pdf; \e
4537 acroread /tmp/s-nail$$.pdf; rm /tmp/s-nail$$.pdf"
4540 Note that security defects are discovered in PDF viewers
4542 Automatical command execution like this
4543 can compromise your system security,
4544 in particular if you stay not always informed
4546 .SS "Signed and encrypted messages with S/MIME"
4547 S/MIME provides two central mechanisms:
4548 message signing and message encryption.
4549 A signed message contains some data in addition
4550 to the regular text.
4551 The data can be used to verify
4552 that the message was sent using a valid certificate,
4553 that the sender's address in the message header
4554 matches that in the certificate,
4555 and that the message text has not been altered.
4556 Signing a message does not change its regular text;
4557 it can be read regardless of whether the recipient's software
4558 is able to handle S/MIME.
4559 It is thus usually possible to sign all outgoing messages
4560 if so desired.\(emEncryption, in contrast,
4561 makes the message text invisible for all people
4562 except those who have access to the secret decryption key.
4563 To encrypt a message,
4564 the specific recipient's public encryption key must be known.
4565 It is thus not possible to send encrypted mail to people
4566 unless their key has been retrieved
4567 from either previous communication or public key directories.
4568 A message should always be signed before it is encrypted.
4569 Otherwise, it is still possible that the encrypted message text
4572 A central concept to S/MIME is that of the certification authority (CA).
4573 A CA is a trusted institution that issues certificates.
4574 For each of these certificates,
4575 it can be verified that it really originates from the CA,
4576 provided that the CA's own certificate is previously known.
4577 A set of CA certificates is usually delivered with OpenSSL
4578 and installed on your system.
4579 If you trust the source of your OpenSSL software installation,
4580 this offers reasonable security for S/MIME on the Internet.
4581 In general, a certificate cannot be more secure
4582 than the method its CA certificate has been retrieved with, though.
4583 Thus if you download a CA certificate from the Internet,
4584 you can only trust the messages you verify using that certificate
4585 as much as you trust the download process.
4587 The first thing you need for participating in S/MIME message exchange
4588 is your personal certificate,
4589 including a private key.
4590 The certificate contains public information,
4591 in particular your name and your email address,
4592 and the public key that is used by others
4593 to encrypt messages for you,
4594 and to verify signed messages they supposedly received from you.
4595 The certificate is included in each signed message you send.
4596 The private key must be kept secret.
4597 It is used to decrypt messages that were
4598 previously encrypted with your public key,
4599 and to sign messages.
4602 it is recommended that you get a S/MIME certificate
4603 from one of the major CAs on the Internet using your WWW browser.
4604 (Many CAs offer such certificates for free.)
4605 You will usually receive
4606 a combined certificate and private key
4607 in PKCS#12 format which
4609 does not directly accept
4610 if S/MIME support is built using OpenSSL.
4611 To convert it to PEM format,
4612 use the following shell command:
4615 $ \fBopenssl pkcs12 \-in \fIcert.p12\fB \-out \fIcert.pem\fB \-clcerts \e
4622 you can specifiy an additional
4623 .I "PEM pass phrase"
4624 for protecting the private key.
4626 will then ask you for that pass phrase
4627 each time it signs or decrypts a message.
4631 \fBset smime-sign-cert-\fImyname@myisp.example\fB=\fIcert.pem\fR
4634 to make this private key and certificate known to
4637 If S/MIME support is built using NSS,
4638 the PKCS#12 file must be installed using Mozilla
4641 is set appropriately,
4643 and no further action is necessary
4644 unless multiple user certificates
4645 for the same email address are installed.
4648 .I smime-sign-nickname
4649 variable has to be set appropriately.
4651 You can now sign outgoing messages.
4655 \fBset smime-sign\fR
4660 From each signed message you send,
4661 the recipient can fetch your certificate
4662 and use it to send encrypted mail back to you.
4663 Accordingly if somebody sends you a signed message,
4664 you can do the same.
4667 command to check the validity of the certificate.
4669 retrieve the certificate and tell
4671 that it should use it for encryption:
4674 \fBcertsave\fI filename\fR
4675 \fBset smime-encrypt-\fIuser@host\fB=\fIfilename\fR
4678 If S/MIME support is built using NSS,
4679 the saved certificate must be installed using Mozilla.
4681 .I smime-encrypt-user@host
4683 but if multiple certificates for the recipient are available,
4685 .I smime-nickname-user@host
4686 variable must be set.
4688 You should carefully consider
4689 if you prefer to store encrypted messages in decrypted form.
4690 If you do, anybody who has access to your mail folders can read them,
4692 you might be unable to read them yourself later
4693 if you happen to lose your private key.
4696 command saves messages in decrypted form,
4702 commands leave them encrypted.
4704 Note that neither S/MIME signing nor encryption
4705 applies to message subjects or other header fields.
4706 Thus they may not contain sensitive information
4707 for encrypted messages,
4708 and cannot be trusted even if the message content
4710 When sending signed messages,
4711 it is recommended to repeat any important header information
4712 in the message text.
4713 .SS "Using CRLs with S/MIME or SSL/TLS"
4714 Certification authorities (CAs) issue
4715 certificate revocation lists (CRLs) on a regular basis.
4716 These lists contain the serial numbers of certificates
4717 that have been declared invalid after they have been issued.
4718 Such usually happens
4719 because the private key for the certificate has been compromised,
4720 because the owner of the certificate has left
4721 the organization that is mentioned in the certificate,
4723 To seriously use S/MIME or SSL/TLS verification,
4724 an up-to-date CRL is required for each trusted CA.
4725 There is otherwise no method
4726 to distinguish between valid and invalidated certificates.
4728 currently offers no mechanism to fetch CRLs,
4729 or to access them on the Internet,
4730 so you have to retrieve them by some external mechanism.
4732 If S/MIME and SSL/TLS support are built using OpenSSL,
4734 accepts CRLs in PEM format only;
4735 CRLs in DER format must be converted,
4736 e.\|g. with the shell command
4739 $ \fBopenssl crl \-inform DER \-in \fIcrl.der\fB \-out \fIcrl.pem\fR
4746 that contains all CRL files
4747 (and no other files)
4753 variables, respectively,
4754 must then be set to point to that directory.
4757 requires a CRL to be present
4758 for each CA that is used
4759 to verify a certificate.
4761 If S/MIME and SSL/TLS support are built using NSS,
4762 CRLs can be imported in Mozilla applications
4765 is set appropriately).
4766 .SS "Sending mail from scripts"
4767 If you want to send mail from scripts,
4768 you must be aware that
4770 reads the user's configuration files by default.
4771 So unless your script is only intended for your own personal use
4772 (as e.g. a cron job),
4773 you need to circumvent this by invoking
4778 \fBMAILRC=/dev/null s-nail \-n\fR
4781 You then need to create a configuration for
4784 This can be done by either pointing the
4786 variable to a custom configuration file,
4787 or by passing the configuration in environment variables.
4788 Since many of the configuration options are not valid shell variables, the
4790 command is useful in this situation.
4791 An invocation could thus look like
4794 \fBenv MAILRC=/dev/null\fR from=\fIscriptreply@domain\fR smtp=\fIhost\fR \e
4795 smtp-auth-user=\fIlogin\fR smtp-auth-password=\fIsecret\fR \e
4796 smtp-auth=\fIlogin\fR \fBs-nail \-n\fR \-s "\fIsubject\fR" \e
4797 \-a \fIattachment_file\fR \fIrecipient@domain\fR <\fIcontent_file\fR
4812 Variables in the environment passed to
4816 The character set conversion relies
4820 Its functionality differs widely
4821 between the various system environments
4822 \fIs-nail\fR runs on.
4823 If the message `Cannot convert from \fIa\fR to \fIb\fR' appears,
4824 either some characters within the message header or text
4825 are not appropriate for the currently selected terminal character set,
4826 or the needed conversion is not supported by the system.
4828 it is necessary to set
4829 an appropriate LC_CTYPE locale (e.\|g. \fIen_US\fR)
4833 In the second case, the
4837 variables must be set to the same value
4838 to inhibit character set conversion.
4841 is not available at all,
4842 the value assigned to
4844 must match the character set that is used on the terminal.
4846 S-nail expects input text to be in Unix format,
4847 with lines separated by
4849 (^J, \en) characters only.
4850 Non-Unix text files that use
4853 characters in addition will be treated as binary data;
4854 to send such files as text, strip these characters e.\ g. by
4857 tr \-d '\e015' <input | s-nail .\ .\ .
4860 or fix the tools that generate them.
4862 Limitations with IMAP mailboxes are:
4863 It is not possible to edit messages,
4864 but it is possible to append them.
4865 Thus to edit a message,
4866 create a local copy of it,
4868 and delete the original.
4869 The line count for the header display
4870 is only appropriate if the entire message has been downloaded
4872 The marking of messages as `new' is performed by the IMAP server;
4877 will not cause it to be reset,
4879 .IR autoinc / newmail
4880 variables are unset,
4881 messages that arrived during a session
4882 will not be in state `new' anymore
4883 when the folder is opened again.
4884 Also if commands queued in disconnected mode are committed,
4885 the IMAP server will delete the `new' flag
4886 for all messages in the changed folder,
4887 and new messages will appear as unread
4888 when it is selected for viewing later.
4889 The `flagged', `answered', and `draft' attributes are usually permanent,
4890 but some IMAP servers are known to drop them without notification.
4891 .\" This is why s-nail does not even check if storing them succeeds.
4892 Message numbers may change with IMAP
4893 every time before the prompt is printed
4894 if \fIs-nail\fR is notified by the server
4895 that messages have been deleted
4896 by some other client or process.
4897 In this case, `Expunged \fIn\fR messages' is printed,
4898 and message numbers may have changed.
4900 Limitations with POP3 mailboxes are:
4901 It is not possible to edit messages,
4902 they can only be copied and deleted.
4903 The line count for the header display
4904 is only appropriate if the entire message has been downloaded
4906 The status field of a message is maintained by the server
4907 between connections;
4908 some servers do not update it at all,
4909 and with a server that does,
4910 the `exit' command will not cause the message status to be reset.
4911 The `newmail' command and the `newmail' variable
4913 It is not possible to rename or to remove POP3 mailboxes.
4917 (interrupt) is typed while an IMAP or POP3 operation is in progress,
4919 will wait until the operation can be safely aborted,
4920 and will then return to the command loop
4921 and print the prompt again.
4926 is waiting for the operation to complete,
4927 the operation itself will be canceled.
4929 data that has not been fetched yet
4930 will have to be fetched
4931 before the next command can be performed.
4932 If the canceled operation
4933 was using an SSL/TLS encrypted channel,
4934 an error in the SSL transport will very likely result,
4935 and the connection is no longer usable.
4937 As \fIs-nail\fR is a mail user agent,
4938 it provides only basic SMTP services.
4939 If it fails to contact its upstream SMTP server,
4940 it will not make further attempts to transfer the message
4942 and it does not leave other information about this condition
4943 than an error message on the terminal
4944 and a `dead.letter' file.
4945 This is usually not a problem if the SMTP server
4946 is located in the same local network
4947 as the computer on which \fIs-nail\fR is run.
4948 However, care should be taken when using a remote server of an ISP;
4949 it might be better to set up a local SMTP server then
4950 which just acts as a proxy.
4952 \fIS-nail\fR immediately contacts the SMTP server (or
4953 .IR \%/usr/lib/sendmail )
4954 even when operating in
4957 It would not make much sense for \fIs-nail\fR to defer outgoing mail
4958 since SMTP servers usually provide
4959 much more elaborated delay handling
4960 than \fIs-nail\fR could perform as a client.
4961 Thus the recommended setup for sending mail in
4963 mode is to configure a local SMTP server
4964 such that it sends outgoing mail
4965 as soon as an external network connection is available again,
4966 i.\|e. to advise it to do that from a network startup script.
4968 The junk mail filter follows the concepts developed by
4969 Paul Graham in his articles,
4970 ``A Plan for Spam'', August 2002,
4971 \%<http://www.paulgraham.com/spam.html>,
4972 and ``Better Bayesian Filtering'', January 2003,
4973 \%<http://www.paulgraham.com/better.html>.
4974 Chained tokens are due to a paper by
4975 Jonathan A. Zdziarski,
4976 ``Advanced Language Classification using Chained Tokens'',
4978 \%<http://www.nuclearelephant.com/papers/chained.html>.
4980 A \fImail\fR command appeared in Version 1 AT&T Unix.
4981 Berkeley Mail was written in 1978 by Kurt Shoens.
4982 This man page is derived from
4983 from The Mail Reference Manual
4984 originally written by Kurt Shoens.
4985 \fIHeirloom Mailx\fR enhancements are maintained and documented
4987 \fIS-nail\fR enhancements are maintained and documented
4988 by Steffen "Daode" Nurpmeso.
4990 Portions of this text are reprinted and reproduced in electronic form
4991 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
4992 \(em Operating System Interface (POSIX), The Open Group Base
4993 Specifications Issue 6, Copyright \(co 2001-2003 by the Institute of
4994 Electrical and Electronics Engineers, Inc and The Open Group. In the
4995 event of any discrepancy between this version and the original IEEE and
4996 The Open Group Standard, the original IEEE and The Open Group Standard
4997 is the referee document. The original Standard can be obtained online at
4998 \%http://www.opengroup.org/unix/online.html\ .
4999 Redistribution of this material is permitted so long as this notice remains