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,
230 Writes the `Message-Id:' and `Article-Id:' header fields
231 of each message read in the file
235 Compressed files are handled as described for the
240 The message to be sent is expected to contain a message header
241 with `To:', `Cc:', or `Bcc:' fields giving its recipients.
242 Recipients specified on the command line are ignored.
245 Reads the mailbox of the given user name.
250 delivery are displayed on the user's terminal.
253 Print \fIs-nail\fR's version and exit.
256 Enable tilde escapes even if not in interactive mode.
258 To send a message to one or more people,
259 \fIs-nail\fR can be invoked with arguments
260 which are the names of people
261 to whom the mail will be sent.
262 The user is then expected to type in his message,
263 followed by an `control-D' at the beginning of a line.
264 The section below Replying to
266 describes some features of \fIs-nail\fR
267 available to help when composing letters.
269 In normal usage \fIs-nail\fR is given no arguments
270 and checks the user's mail out of the post office,
271 then prints out a one line header
272 of each message found.
273 The current message is initially
274 the first message (numbered 1)
275 and can be printed using the print command
276 which can be abbreviated `p').
277 The user can move among the messages
278 much as he moves between lines in
280 with the commands `+' and `\-' moving backwards and forwards,
282 .SS "Disposing of mail"
283 After examining a message
284 the user can delete `d') the message
286 Deletion causes the \fIs-nail\fR program
287 to forget about the message.
288 This is not irreversible;
289 the message can be undeleted `u')
290 by giving its number,
291 or the \fIs-nail\fR session can be aborted
292 by giving the exit `x') command.
293 Deleted messages will, however,
294 usually disappear never to be seen again.
295 .SS "Specifying messages"
296 Commands such as print and delete
297 can be given a list of message numbers
298 as arguments to apply to a number of messages at once.
299 Thus `\fIdelete 1 2\fR' deletes messages 1 and 2,
300 while `\fIdelete 1-5\fR' deletes messages 1 through 5.
301 In sorted or threaded mode (see the
306 `\fIdelete 1-5\fR' deletes the messages
307 that are located between (and including) messages 1 through 5
308 in the sorted/threaded order,
309 as shown in the header summary.
310 The following special message names exist:
316 All old messages (any not in state read or new).
322 All deleted messages (for the
330 All `flagged' messages.
333 All answered messages
339 All messages marked as draft.
342 All `killed' messages.
345 All messages classified as junk.
351 The message that was previously the current message.
354 The parent message of the current message,
355 that is the message with the Message-ID
356 given in the `In-Reply-To:' field
357 or the last entry of the `References:' field
358 of the current message.
361 The next previous undeleted message,
362 or the next previous deleted message for the
365 In sorted/threaded mode,
366 the next previous such message in the sorted/threaded order.
369 The next undeleted message,
370 or the next deleted message for the
373 In sorted/threaded mode,
374 the next such message in the sorted/threaded order.
377 The first undeleted message,
378 or the first deleted message
382 In sorted/threaded mode,
383 the first such message in the sorted/threaded order.
387 In sorted/threaded mode,
388 the last message in the sorted/threaded order.
392 selects the message addressed with
396 is any other message specification,
397 and all messages from the thread that begins at it.
398 Otherwise, it is identical to
403 the thread beginning with the current message is selected.
409 All messages that were included in the message list
410 for the previous command.
413 All messages that contain
415 in the subject field (case ignored).
422 the string from the previous specification of that type is used again.
427 By default, this is a case-sensitive search
428 for the complete email address.
432 only the local part of the addresses is evaluated for the comparison.
436 a case-sensitive search for the complete real name
437 of a sender is performed.
440 expression can be used instead
441 if substring matches are desired.
444 All messages that satisfy the given IMAP-style SEARCH
446 This addressing mode is available with all types of folders;
447 for folders not located on IMAP servers,
448 or for servers unable to execute the SEARCH command,
450 will perform the search locally.
451 Strings must be enclosed by double quotes `"' in their entirety
452 if they contain white space or parentheses;
454 only backslash `\e' is recognized as an escape character.
455 All string searches are case-insensitive.
456 When the description indicates
457 that the `envelope' representation of an address field is used,
458 this means that the search string is checked against
459 both a list constructed as
462 \fB("\fIreal name\fB" "\fIsource-route\fB" "\fIlocal-part\fB" "\fIdomain-part\fB")\fR
466 and the addresses without real names
467 from the respective header field.
468 Criteria can be nested using parentheses.
470 \fB(\fIcriterion1 criterion2\fR .\|.\|. \fIcriterionN\fB)\fR
471 All messages that satisfy all of the given criteria.
473 .BI (or " criterion1 criterion2" )
474 All messages that satisfy either
479 To connect more than two criteria using `or',
480 (or) specifications have to be nested using additional parentheses,
481 as with `(or\ a\ (or\ b\ c))';
482 `(or\ a\ b\ c)' means ((a or b) and c).
483 For a simple `or' operation of independent criteria
484 on the lowest nesting level,
485 it is possible to achieve similar effects by using
486 three separate criteria, as with
489 .BI (not " criterion" )
490 All messages that do not satisfy
494 All messages that contain
496 in the `envelope' representation of the
501 All messages that contain
503 in the `envelope' representation of the
507 .BI (from " string" )
508 All messages that contain
510 in the `envelope' representation of the
514 .BI (subject " string" )
515 All messages that contain
522 All messages that contain
524 in the `envelope' representation of the
528 .BI (header " name string" )
529 All messages that contain
535 .BI (body " string" )
536 All messages that contain
540 .BI (text " string" )
541 All messages that contain
543 in their header or body.
545 .BI (larger " size" )
546 All messages that are larger than
550 .BI (smaller " size" )
551 All messages that are smaller than
555 .BI (before " date" )
556 All messages that were received before
560 \fId\fR[\fId\fR]\fB-\fImon\fB-\fIyyyy\fR,
561 where \fId\fR[\fId\fR] is the day of the month
562 as one or two digits,
564 is the name of the month\(emone of
568 `Oct', `Nov', or `Dec',
571 is the year as four digits;
572 e.\|g. "30-Aug-2004".
575 All messages that were received on the specified date.
578 All messages that were received since the specified date.
580 .BI (sentbefore " date" )
581 All messages that were sent on the specified date.
583 .BI (senton " date" )
584 All messages that were sent on the specified date.
586 .BI (sentsince " date" )
587 All messages that were sent since the specified date.
590 The same criterion as for the previous search.
591 This specification cannot be used as part of another criterion.
592 If the previous command line contained more than one independent criterion,
593 the last of those criteria is used.
595 A practical method to read a set of messages
598 command with the search criteria first
599 to check for appropriate messages,
600 and to read each single message then by typing `\fB`\fR' repeatedly.
601 .SS "Replying to or originating mail"
605 to set up a response to a message,
606 sending it back to the person who it was from.
607 Text the user types in then,
608 up to an end-of-file,
609 defines the contents of the message.
610 While the user is composing a message,
611 \fIs-nail\fR treats lines beginning with the character `~' specially.
612 For instance, typing `~m' (alone on a line)
613 will place a copy of the current message into the response
614 right shifting it by a tabstop
618 Other escapes will set up subject fields,
619 add and delete recipients to the message,
621 and allow the user to escape to an editor
622 to revise the message
623 or to a shell to run some commands.
624 (These options are given in the summary below.)
625 .SS "Ending a mail processing session"
626 The user can end a \fIs-nail\fR session
627 with the quit (`q') command.
628 Messages which have been examined
629 go to the user's mbox file
630 unless they have been deleted
631 in which case they are discarded.
632 Unexamined messages go back
634 (See the \-f option above).
635 .SS "Personal and systemwide distribution lists"
636 It is also possible to create
637 a personal distribution lists so that,
638 for instance, the user can send mail
639 to `\fIcohorts\fR' and have it go
640 to a group of people.
641 Such lists can be defined by placing a line like
644 \fBalias\fI cohorts bill ozalp jkf mark kridle@ucbcory\fR
647 in the file .mailrc in the user's home directory.
648 The current list of such aliases
649 can be displayed with the alias command in \fIs-nail\fR.
650 System wide distribution lists can be created
651 by editing /etc/aliases, see
655 these are kept in a different syntax.
656 In mail the user sends,
657 personal aliases will be expanded
658 in mail sent to others so that
659 they will be able to reply to the recipients.
660 System wide aliases are not expanded when the mail is sent,
661 but any reply returned to the machine
662 will have the system wide alias expanded
663 as all mail goes through sendmail.
664 .SS "Recipient address specifications"
665 When an address is used to name a recipient
666 (in any of To, Cc, or Bcc),
667 names of local mail folders
668 and pipes to external commands
669 can also be specified;
670 the message text is then written to them.
671 The rules are: Any name which starts with a
673 character specifies a pipe,
674 the command string following the `|'
675 is executed and the message is sent to its standard input;
676 any other name which contains a
678 character is treated as a mail address;
679 any other name which starts with a
681 character specifies a folder name;
682 any other name which contains a
689 character before also specifies a folder name;
690 what remains is treated as a mail address.
691 Compressed folders are handled as described for the
694 .SS "Network mail (Internet / ARPA, UUCP, Berknet)"
697 for a description of network addresses.
698 \fIS-nail\fR has a number of options
699 which can be set in the .mailrc file
700 to alter its behavior;
701 thus `\fIset askcc\fR' enables the askcc feature.
702 (These options are summarized below).
704 For any outgoing attachment,
705 \fIs-nail\fR tries to determine the content type.
706 It does this by reading MIME type files
707 whose lines have the following syntax:
710 \fItype\fB/\fIsubtype extension \fR[\fIextension \fR.\ .\ .]\fR
713 where type/subtype are strings describing the file contents,
714 and extension is the part of a filename starting after the last dot.
715 Any line not immediately beginning with an ASCII alphabetical character is
716 ignored by \fIs-nail\fR.
717 If there is a match with the extension of the file to attach,
718 the given type/subtype pair is used.
719 Otherwise, or if the filename has no extension,
720 the content types text/plain or application/octet-stream are used,
721 the first for text or international text files,
722 the second for any file that contains formatting characters
723 other than newlines and horizontal tabulators.
726 normally detects the character set of the terminal
727 using the LC_CTYPE locale setting.
728 If the locale cannot be used appropriately,
729 the \fIttycharset\fR variable should be set
730 to provide an explicit value.
731 When reading messages,
732 their text is converted to the terminal character set if possible.
733 Unprintable characters and illegal byte sequences are detected
734 and replaced by Unicode substitute characters or question marks
737 is set at initialization time.
739 The character set for outgoing messages
740 is not necessarily the same
741 as the one used on the terminal.
742 If an outgoing text message
743 contains characters not representable in US-ASCII,
744 the character set being used
745 must be declared within its header.
746 Permissible values can be declared
747 using the \fIsendcharsets\fR variable,
750 tries each of the values in order
751 and uses the first appropriate one.
752 If the message contains characters that cannot be represented
753 in any of the given character sets,
754 the message will not be sent,
755 and its text will be saved to the `dead.letter' file.
756 Messages that contain NUL bytes are not converted.
758 Outgoing attachments are converted if they are plain text.
761 variable contains more than one character set name,
764 tilde escape will ask for the character sets for individual attachments
765 if it is invoked without arguments.
767 Best results are usually achieved
770 is run in a UTF-8 locale
771 on a UTF-8 capable terminal.
773 characters from various countries can be displayed,
774 while it is still possible to use more simple
775 character sets for sending
776 to retain maximum compatibility with older mail clients.
778 Each command is typed on a line by itself,
779 and may take arguments following the command word.
780 The command need not be typed in its entirety \(en
781 the first command which matches the typed prefix is used.
782 For commands which take message lists as arguments,
783 if no message list is given,
784 then the next message forward which satisfies
785 the command's requirements is used.
786 If there are no messages forward of the current message,
787 the search proceeds backwards,
788 and if there are no good messages at all,
789 \fIs-nail\fR types `\fIapplicable messages\fR' and aborts the command.
790 If the command begins with a \fI#\fR sign,
793 The arguments to commands can be quoted, using the following methods:
795 An argument can be enclosed between paired double-quotes
796 "\|" or single-quotes '\|'; any white space, shell
797 word expansion, or backslash characters within the quotes
798 are treated literally as part of the argument.
799 A double-quote will be treated literally within
800 single-quotes and vice versa. These special properties of
801 the quote marks occur only when they are paired at the
802 beginning and end of the argument.
804 A backslash outside of the enclosing quotes is discarded
805 and the following character is treated literally as part of
808 An unquoted backslash at the end of a command line is
809 discarded and the next line continues the command.
811 Filenames, where expected, are subjected to the following
812 transformations, in sequence:
814 If the filename begins with an unquoted plus sign, and
818 the plus sign will be replaced by the value of the
820 variable followed by a slash. If the
823 unset or is set to null, the filename will be unchanged.
825 Shell word expansions are applied to the filename.
826 If more than a single pathname results
827 from this expansion and the command is expecting one
828 file, an error results.
830 The following commands are provided:
833 Print out the preceding message.
834 If given a numeric argument n,
835 goes to the n'th previous message and prints it.
838 Prints a brief summary of commands.
841 Executes the shell (see
845 command which follows.
848 A synonym for the \fIpipe\fR command.
851 (ac) Creates, selects or lists
853 An account is formed by a group of commands,
854 primarily of those to set variables.
856 of which the second is a `{',
857 the first argument gives an account name,
858 and the following lines create a group of commands for that account
859 until a line containing a single `}' appears.
861 the previously created group of commands
862 for the account name is executed,
865 command is executed for the system mailbox or inbox
868 the list of accounts and their contents are printed.
872 \fBaccount\fI myisp\fR \fB{\fR
873 set folder=imaps://mylogin@imap.myisp.example
875 set from="myname@myisp.example (My Name)"
876 set smtp=smtp.myisp.example
880 creates an account named `myisp'
881 which can later be selected by specifying `account myisp'.
884 (a) With no arguments,
885 prints out all currently-defined aliases.
886 With one argument, prints out that alias.
887 With more than one argument,
888 creates a new alias or changes an old one.
891 (alt) The alternates command is useful
892 if the user has accounts on several machines.
893 It can be used to inform \fIs-nail\fR
894 that the listed addresses all belong to the invoking user.
895 When he replies to messages,
896 \fIs-nail\fR will not send a copy of the message
897 to any of the addresses
898 listed on the alternates list.
899 If the alternates command is given
901 the current set of alternate names is displayed.
904 (ans) Takes a message list and marks each message
905 as a having been answered.
906 This mark has no technical meaning in the mail system;
907 it just causes messages to be marked in the header summary,
908 and makes them specially addressable.
911 Only applicable to cached IMAP mailboxes;
912 takes a message list and reads the specified messages
916 Calls a macro (see the
924 Only applicable to S/MIME signed messages.
925 Takes a message list and a file name
926 and saves the certificates contained within the message signatures
927 to the named file in both human-readable and PEM format.
928 The certificates can later be used to send encrypted messages
929 to the messages' originators by setting the
930 .I smime-encrypt-user@host
934 (ch) Changes the user's working directory to that specified,
936 If no directory is given,
937 then changes to the user's login directory.
940 (cl) Takes a list of messages and
941 examines their contents for characteristics of junk mail
942 using Bayesian filtering.
943 Messages considered to be junk are then marked as such.
944 The junk mail database is not changed.
948 Only applicable to threaded mode.
950 and makes all replies to these messages invisible
952 unless they are in state `new'.
955 (conn) If operating in disconnected mode on an IMAP mailbox,
956 switch to online mode and connect to the mail server
957 while retaining the mailbox status.
958 See the description of the
960 variable for more information.
963 (c) The copy command does the same thing that
966 except that it does not mark the messages
967 it is used on for deletion when the user quits.
968 Compressed files and IMAP mailboxes are handled as described for the
975 but saves the messages in a file named after the local part
976 of the sender address of the first message.
979 (dec) For unencrypted messages,
980 this command is identical to
982 Encrypted messages are first decrypted, if possible,
988 but saves the messages in a file named after the local part
989 of the sender address of the first message.
992 (def) Defines a macro.
993 A macro definition is a sequence of commands in the following form:
996 \fBdefine\fR \fIname\fB {\fR
1004 Once defined, a macro can be explicitly invoked using the
1007 or can be implicitly invoked by setting the
1010 .I folder-hook-fullname
1014 Prints the currently defined macros including their contents.
1017 (d) Takes a list of messages as argument
1018 and marks them all as deleted.
1019 Deleted messages will not be saved in mbox,
1020 nor will they be available for most other commands.
1026 (disco) If operating in online mode on an IMAP mailbox,
1027 switch to disconnected mode while retaining the mailbox status.
1028 See the description of the
1030 variable for more information.
1031 A list of messages may optionally be given as argument;
1032 the respective messages are then read into the cache
1033 before the connection is closed.
1034 Thus `disco *' makes the entire current mailbox
1035 available for disconnected use.
1038 Deletes the current message
1039 and prints the next message.
1040 If there is no next message,
1041 \fIs-nail\fR says `\fIat EOF\fR'.
1044 Takes a message list and marks each message
1046 This mark has no technical meaning in the mail system;
1047 it just causes messages to be marked in the header summary,
1048 and makes them specially addressable.
1051 Echoes its arguments,
1052 resolving special names
1053 as documented for the folder command.
1054 The escape sequences
1071 (e) Takes a list of messages
1072 and points the text editor
1073 at each one in turn.
1074 Modified contents are discarded
1080 Marks the end of the then-part
1082 and the beginning of the part
1083 to take effect if the condition
1084 of the if statement is false.
1087 Marks the end of an if statement.
1090 (ex or x) Effects an immediate return to the Shell
1091 without modifying the user's system mailbox,
1093 or his edit file in \-f.
1096 (fi) The same as folder.
1099 (fl) Takes a message list
1100 and marks the messages as `flagged' for urgent/special attention.
1101 This mark has no technical meaning in the mail system;
1102 it just causes messages to be highlighted in the header summary,
1103 and makes them specially addressable.
1107 list the names of the folders in the folder directory.
1108 With an existing folder as an argument,
1109 lists then names of folders below the named folder;
1110 e.\|g. the command `folders @'
1111 lists the folders on the base level of the current IMAP server.
1117 (fold) The folder command switches
1118 to a new mail file or folder.
1119 With no arguments, it tells the user
1120 which file he is currently reading.
1121 If an argument is given,
1122 it will write out changes
1123 (such as deletions) the user has made
1124 in the current file and read in
1126 Some special conventions are recognized for the name.
1127 \fB#\fR means the previous file,
1128 \fB%\fR means the invoking user's system mailbox,
1129 \fB%\fIuser\fR means \fIuser's\fR system mailbox,
1130 \fB&\fR means the invoking user's mbox file,
1131 and \fB+\fIfile\fI means a \fIfile\fR in the folder directory.
1132 \fB%:\fIfilespec\fR expands to the same value as \fIfilespec\fR,
1133 but the file is handled as a system mailbox
1134 e.\ g. by the mbox and save commands.
1135 If the name matches one of the strings defined with the
1138 it is replaced by its long form and expanded.
1139 If the name ends with \fB.gz\fR or \fB.bz2\fR,
1140 it is treated as compressed with
1145 Likewise, if \fIname\fR does not exist,
1146 but either \fIname\fB.gz\fR or \fIname\fB.bz2\fR exists,
1147 the compressed file is used.
1148 If \fIname\fR refers to a directory
1149 with the subdirectories `tmp', `new', and `cur',
1150 it is treated as a folder in
1156 \fIprotocol\fB://\fR[\fIuser\fB@\fR]\fIhost\fR[\fB:\fIport\fR][\fB/\fIfile\fR]
1159 is taken as an Internet mailbox specification.
1160 The supported protocols are currently
1164 (IMAP with SSL/TLS encryption),
1169 (POP3 with SSL/TLS encryption).
1172 contains special characters, in particular `/' or `%',
1173 they must be escaped in URL notation,
1177 part applies to IMAP only;
1179 the default `INBOX' is used.
1180 If \fIs-nail\fR is connected to an IMAP server,
1181 a name of the form \fB@\fImailbox\fR
1182 refers to the \fImailbox\fR on that server.
1183 If the `folder' variable refers to an IMAP account,
1184 the special name `%' selects the `INBOX' on that account.
1189 but saves the message in a file
1190 named after the local part of the first recipient's address.
1195 but saves the message in a file
1196 named after the local part of the first recipient's address.
1201 but responds to all recipients regardless of the
1210 but responds to the sender only regardless of the
1218 Takes a message and the address of a recipient
1219 and forwards the message to him.
1220 The text of the original message is included in the new one,
1221 with the value of the
1223 variable printed before.
1228 commands specify which header fields are included in the new message.
1229 Only the first part of a multipart message is included unless the
1230 .I forward-as-attachment
1237 but saves the message in a file named after
1238 the local part of the recipient's address.
1241 (f) Takes a list of messages
1242 and prints their message headers,
1243 piped through the pager if the output does not fit on the screen.
1246 Specifies which header fields are to be ignored with the
1249 This command has no effect when the
1250 .I forward-as-attachment
1254 Specifies which header fields are to be retained with the
1260 This command has no effect when the
1261 .I forward-as-attachment
1265 (go) Takes a list of messages
1266 and marks all of them as not being junk mail.
1267 Data from these messages is then inserted
1268 into the junk mail database for future classification.
1271 (h) Lists the current range of headers,
1272 which is an 18-message group.
1273 If a `+' argument is given,
1274 then the next 18-message group is printed,
1275 and if a `\-' argument is given,
1276 the previous 18-message group is printed.
1282 (ho, also preserve) Takes a message list
1283 and marks each message therein to be saved
1284 in the user's system mailbox
1286 Does not override the delete command.
1288 deviates from the POSIX standard with this command,
1289 as a `next' command issued after `hold'
1290 will display the following message,
1291 not the current one.
1294 Commands in \fIs-nail\fR's startup files
1295 can be executed conditionally
1296 depending on whether the user is sending
1297 or receiving mail with the if command.
1302 \fIcommands .\ .\ .\fR
1306 An else form is also available:
1310 \fIcommands .\ .\ .\fR
1312 \fIcommands .\ .\ .\fR
1316 Note that the only allowed conditions are
1321 (execute command if standard input is a tty).
1324 Add the list of header fields named to the ignored list.
1325 Header fields in the ignore list are not printed
1326 on the terminal when a message is printed.
1327 This command is very handy for suppression
1328 of certain machine-generated header fields.
1329 The Type and Print commands can be used
1330 to print a message in its entirety,
1331 including ignored fields.
1332 If ignore is executed with no arguments,
1333 it lists the current set of ignored fields.
1336 Sends command strings directly to the current IMAP server.
1337 \fIS-nail\fR operates always in IMAP \fIselected state\fR
1338 on the current mailbox;
1339 commands that change this
1340 will produce undesirable results
1341 and should be avoided.
1342 Useful IMAP commands are:
1346 Takes the name of an IMAP mailbox as an argument
1351 Takes the name of an IMAP mailbox as an argument
1352 and prints the quotas that apply to the mailbox.
1353 Not all IMAP servers support this command.
1357 Takes no arguments and prints the Personal Namespaces,
1358 the Other User's Namespaces,
1359 and the Shared Namespaces.
1360 Each namespace type is printed in parentheses;
1361 if there are multiple namespaces of the same type,
1362 inner parentheses separate them.
1364 a namespace prefix and a hierarchy separator is listed.
1365 Not all IMAP servers support this command.
1373 (j) Takes a list of messages
1374 and marks all of them as junk mail.
1375 Data from these messages is then inserted
1376 into the junk mail database for future classification.
1379 (k) Takes a list of messages and `kills' them.
1380 Killed messages are not printed in header summaries,
1381 and are ignored by the
1386 command also sets the score of the messages to negative infinity,
1389 commands will not unkill them again.
1390 Killing is only effective for the current session on a folder;
1391 when it is quit, all messages are automatically unkilled.
1394 Prints the names of all available commands.
1399 but saves the message in a file
1400 named after the local part of the first recipient's address.
1403 (m) Takes as argument login names
1404 and distribution group names
1405 and sends mail to those people.
1408 Indicate that a list of messages be sent
1409 to mbox in the user's home directory when
1412 This is the default action for messages
1417 deviates from the POSIX standard with this command,
1418 as a `next' command issued after `mbox'
1419 will display the following message,
1420 not the current one.
1425 but marks the messages for deletion
1426 if they were transferred successfully.
1431 but moves the messages to a file named after the local part
1432 of the sender address of the first message.
1435 Checks for new mail in the current folder
1436 without committing any changes before.
1437 If new mail is present, a message is printed.
1441 the headers of each new message are also printed.
1444 (n) like + or CR) Goes to the next message
1445 in sequence and types it.
1446 With an argument list, types the next matching message.
1461 If the current folder is located on an IMAP or POP3 server,
1462 a NOOP command is sent.
1463 Otherwise, no operation is performed.
1469 pipes ignored header fields
1470 and all parts of MIME
1471 .I multipart/alternative
1475 (pi) Takes a message list and a shell command
1476 and pipes the messages through the command.
1477 Without an argument,
1478 the current message is piped
1479 through the command given by the \fIcmd\fR variable.
1480 If the \fI page\fR variable is set,
1481 every message is followed by a formfeed character.
1491 prints out ignored header fields
1492 and all parts of MIME
1493 .I multipart/alternative
1502 (p) Takes a message list and types out each message
1503 on the user's terminal.
1504 If the message is a MIME multipart message,
1505 all parts with a content type of `text' or `message' are shown,
1506 the other are hidden except for their headers.
1507 Messages are decrypted and converted to the terminal character set
1511 (prob) For each word given as argument,
1512 the contents of its junk mail database entry are printed.
1515 (q) Terminates the session, saving all undeleted,
1516 unsaved messages in the user's mbox file in his login directory,
1517 preserving all messages marked with hold or preserve
1518 or never referenced in his system mailbox,
1519 and removing all other messages from his system mailbox.
1520 If new mail has arrived during the session,
1521 the message `\fIYou have new mail\fR' is given.
1522 If given while editing a mailbox file with the \-f flag,
1523 then the edit file is rewritten.
1524 A return to the Shell is effected,
1525 unless the rewrite of edit file fails,
1526 in which case the user can escape
1527 with the exit command.
1538 (rem) Removes the named folders.
1539 The user is asked for confirmation
1540 in interactive mode.
1543 (ren) Takes the name of an existing folder
1544 and the name for the new folder
1545 and renames the first to the second one.
1546 Both folders must be of the same type
1547 and must be located on the current server for IMAP.
1550 (R) Reply to originator.
1551 Does not reply to other recipients
1552 of the original message.
1555 (r) Takes a message list and sends mail
1556 to the sender and all recipients of the specified message.
1557 The default message must not be deleted.
1562 but responds to all recipients regardless of the
1571 but responds to the sender only regardless of the
1580 but does not add any header lines.
1581 This is not a way to hide the sender's identity,
1582 but useful for sending a message again
1583 to the same recipients.
1586 Takes a list of messages and a user name
1587 and sends each message to the named user.
1588 `Resent-From:' and related header fields are prepended
1589 to the new copy of the message.
1608 Add the list of header fields named to the retained list.
1609 Only the header fields in the retain list are shown
1610 on the terminal when a message is printed.
1611 All other header fields are suppressed.
1612 The Type and Print commands can be used
1613 to print a message in its entirety.
1614 If retain is executed with no arguments,
1615 it lists the current set of retained fields.
1621 but saves the messages
1622 in a file named after the local part
1623 of the sender of the first message
1624 instead of taking a filename argument.
1627 (s) Takes a message list and a filename
1628 and appends each message
1629 in turn to the end of the file.
1630 If no filename is given,
1631 the mbox file is used.
1632 The filename in quotes,
1633 followed by the line count and character count
1634 is echoed on the user's terminal.
1635 If editing a system mailbox,
1636 the messages are marked for deletion.
1637 Compressed files and IMAP mailboxes are handled as described for the
1639 command line option above.
1645 Saveignore is to save what ignore is to print and type.
1646 Header fields thus marked are filtered out
1647 when saving a message by save
1648 or when automatically saving to mbox.
1649 This command should only be applied to header fields
1650 that do not contain information needed to decode the message,
1651 as MIME content fields do.
1652 If saving messages on an IMAP account,
1653 ignoring fields makes it impossible
1654 to copy the data directly on the server,
1655 thus operation usually becomes much slower.
1658 Saveretain is to save what retain is to print and type.
1659 Header fields thus marked are the only ones
1660 saved with a message when saving by save
1661 or when automatically saving to mbox.
1662 Saveretain overrides saveignore.
1663 The use of this command is strongly discouraged
1664 since it may strip header fields
1665 that are needed to decode the message correctly.
1668 (sc) Takes a message list and a floating point number
1669 and adds the number to the score of each given message.
1670 All messages start at score 0 when a folder is opened.
1671 When the score of a message becomes negative, it is `killed'
1672 with the effects described for the
1675 otherwise if it was negative before and becomes positive,
1677 Scores only refer to the currently opened instance of a folder.
1680 (se) With no arguments, prints all variable values,
1681 piped through the pager if the output does not fit on the screen.
1682 Otherwise, sets option.
1683 Arguments are of the form option=value
1684 (no space before or after =)
1686 Quotation marks may be placed around any part of the
1687 assignment statement to quote blanks
1688 or tabs, i.\|e. `\fIset indentprefix="\->"\fR'.
1689 If an argument begins with
1691 as in `\fBset no\fIsave\fR',
1692 the effect is the same as invoking the
1694 command with the remaining part of the variable
1695 (`\fIunset \fIsave\fR').
1698 Takes a message list and marks all messages as having been read.
1701 (sh) Invokes an interactive version of the shell.
1704 Defines a shortcut name and its string for expansion,
1705 as described for the
1709 a list of defined shortcuts is printed.
1714 but performs neither MIME decoding nor decryption
1715 so that the raw message text is shown.
1718 Takes a message list and prints out
1719 the size in characters of each message.
1722 Create a sorted representation of the current folder,
1725 command and the addressing modes
1726 such that they refer to messages in the sorted order.
1727 Message numbers are the same as in regular mode.
1731 a header summary in the new order is also printed.
1732 Possible sorting criteria are:
1736 Sort the messages by their `Date:' field,
1737 that is by the time they were sent.
1740 Sort messages by the value of their `From:' field,
1741 that is by the address of the sender.
1745 the sender's real name (if any) is used.
1748 Sort the messages by their size.
1751 Sort the messages by their score.
1754 Sort the messages by their message status
1755 (new, read, old, etc.).
1758 Sort the messages by their subject.
1761 Create a threaded order,
1767 Sort messages by the value of their `To:' field,
1768 that is by the address of the recipient.
1772 the recipient's real name (if any) is used.
1775 If no argument is given,
1776 the current sorting criterion is printed.
1779 The source command reads commands from a file.
1782 (th) Create a threaded representation of the current folder,
1783 i.\|e. indent messages that are replies to other messages
1784 in the header display,
1787 command and the addressing modes
1788 such that they refer to messages in the threaded order.
1789 Message numbers are the same as in unthreaded mode.
1793 a header summary in threaded order is also printed.
1796 Takes a message list and prints the top few lines of each.
1797 The number of lines printed is controlled
1798 by the variable toplines
1799 and defaults to five.
1802 Takes a message list
1803 and marks the messages for saving in the
1807 deviates from the POSIX standard with this command,
1808 as a `next' command issued after `mbox'
1809 will display the following message,
1810 not the current one.
1813 (T) Identical to the Print command.
1816 (t) A synonym for print.
1819 Takes a list of names defined by alias commands
1820 and discards the remembered groups of users.
1821 The group names no longer have any significance.
1824 Takes a message list and marks each message
1825 as not having been answered.
1829 Only applicable to threaded mode.
1830 Takes a message list
1831 and makes the message and all replies to it visible
1832 in header summaries again.
1833 When a message becomes the current message,
1834 it is automatically made visible.
1835 Also when a message with collapsed replies is printed,
1836 all of these are automatically uncollapsed.
1839 Undefines each of the named macros.
1840 It is not an error to use a name that does not belong to
1841 one of the currently defined macros.
1844 (u) Takes a message list and marks each message as not being deleted.
1847 Takes a message list and marks each message
1851 Takes a message list and marks each message as not being `flagged'.
1854 Removes the header field names
1855 from the list of ignored fields for the
1860 Removes the header field names
1861 from the list of retained fields for the
1866 Takes a message list and undoes the effect of a
1868 command that was previously applied on exactly these messages.
1871 Removes the header field names
1872 from the list of ignored fields.
1875 Takes a message list and undoes the effect of a
1877 command that was previously applied on exactly these messages.
1880 Takes a message list and `unkills' each message.
1881 Also sets the score of the messages to 0.
1888 (U) Takes a message list and marks each message
1889 as not having been read.
1892 Removes the header field names
1893 from the list of retained fields.
1896 Removes the header field names
1897 from the list of ignored fields for saving.
1900 Removes the header field names
1901 from the list of retained fields for saving.
1904 Takes a list of option names and discards their remembered
1909 Deletes the shortcut names given as arguments.
1912 Disable sorted or threaded mode (see the
1916 commands), return to normal message order
1921 print a header summary.
1929 Takes a message list and verifies each message.
1930 If a message is not an S/MIME signed message,
1931 verification will fail for it.
1932 The verification process checks
1933 if the message was signed using a valid certificate,
1934 if the message sender's email address matches
1935 one of those contained within the certificate,
1936 and if the message content has been altered.
1939 (v) Takes a message list and invokes the display editor
1941 Modified contents are discarded
1947 (w) For conventional messages,
1948 the body without all headers is written.
1949 The output is decrypted and converted
1950 to its native format, if necessary.
1951 If the output file exists,
1952 the text is appended.\(emIf a message is in MIME multipart format,
1953 its first part is written to the specified file
1954 as for conventional messages,
1955 and the user is asked for a filename
1956 to save each other part;
1957 if the contents of the first part are not to be saved,
1958 `write /dev/null' can be used.
1959 For the second and subsequent parts,
1960 if the filename given starts with a `|' character,
1961 the part is piped through the remainder of the filename
1962 interpreted as a shell command.
1963 In non-interactive mode, only the parts of the multipart message
1964 that have a filename given in the part header are written,
1965 the other are discarded.
1966 The original message is never marked for deletion
1967 in the originating mail folder.
1969 the contents of the destination file are overwritten
1970 if the file previously existed.
1971 No special handling of compressed files is performed.
1974 (x) A synonym for exit.
1977 \fIS-nail\fR presents message headers in windowfuls
1978 as described under the headers command.
1979 The z command scrolls to the next window of messages.
1980 If an argument is given,
1981 it specifies the window to use.
1982 A number prefixed by `+' or `\-' indicates
1983 that the window is calculated in relation
1984 to the current position.
1985 A number without a prefix specifies an
1986 absolute window number,
1987 and a `$' lets \fIs-nail\fR scroll
1988 to the last window of messages.
1993 but scrolls to the next or previous window
1994 that contains at least one new or `flagged' message.
1996 Here is a summary of the tilde escapes,
1997 which are used when composing
1998 messages to perform special functions.
1999 Tilde escapes are only recognized
2000 at the beginning of lines.
2001 The name `\fItilde escape\fR' is somewhat of a misnomer
2002 since the actual escape character can be set
2003 by the option escape.
2006 Execute the indicated shell command,
2007 then return to the message.
2010 Same effect as typing the end-of-file character.
2016 Command is executed using the shell.
2017 Its standard output is inserted into the message.
2019 \fB~@\fR [\fIfilename\fR .\ .\ . ]
2020 With no arguments, edit the attachment list.
2021 First, the user can edit all existing attachment data.
2022 If an attachment's file name is left empty,
2023 that attachment is deleted from the list.
2024 When the end of the attachment list is reached,
2026 will ask for further attachments,
2027 until an empty file name is given.
2028 If \fIfilename\fP arguments are specified,
2029 all of them are appended to the end of the attachment list.
2030 Filenames which contain white space
2031 can only be specified
2032 with the first method (no \fIfilename\fP arguments).
2035 Inserts the string contained in the
2038 (same as `~i Sign').
2039 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
2043 Inserts the string contained in the
2046 (same as `~i sign').
2047 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
2050 .BI ~b "name .\ .\ ."
2051 Add the given names to the list of carbon copy recipients
2052 but do not make the names visible in the Cc: line
2053 (`blind' carbon copy).
2055 .BI ~c "name .\ .\ ."
2056 Add the given names to the list of carbon copy recipients.
2059 Read the file `dead.letter' from the user's home directory
2063 Invoke the text editor on the message collected so far.
2064 After the editing session is finished,
2065 the user may continue appending text
2069 Read the named messages into the message being sent.
2070 If no messages are specified,
2071 read in the current message.
2072 Message headers currently being ignored
2073 (by the ignore or retain command)
2075 For MIME multipart messages,
2076 only the first printable part is included.
2079 Identical to ~f, except all message headers and
2080 all MIME parts are included.
2083 Edit the message header fields
2084 `To:', `Cc:', `Bcc:', and `Subject:'
2085 by typing each one in turn
2086 and allowing the user to append text
2087 to the end or modify the field
2088 by using the current terminal erase and kill characters.
2091 Edit the message header fields
2092 `From:', `Reply-To:', `Sender:', and `Organization:'
2093 in the same manner as described for
2095 The default values for these fields originate from the
2101 If this tilde command has been used,
2102 changing the variables has no effect on the current message anymore.
2105 Insert the value of the specified variable
2106 into the message adding a newline character at the end.
2107 If the variable is unset or empty,
2108 the message remains unaltered.
2109 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
2113 Read the named messages into the message being sent,
2114 indented by a tab or by the value of indentprefix.
2115 If no messages are specified,
2116 read the current message.
2117 Message headers currently being ignored
2118 (by the ignore or retain command)
2120 For MIME multipart messages,
2121 only the first printable part is included.
2124 Identical to ~m, except all message headers and
2125 all MIME parts are included.
2128 Print out the message collected so far,
2129 prefaced by the message header fields
2130 and followed by the attachment list, if any.
2131 If the message text is longer than the screen size,
2132 it is piped through the pager.
2135 Abort the message being sent,
2136 copying the message to
2137 `dead.letter' in the user's home directory
2141 Read the named file into the message.
2144 Cause the named string to become the current subject field.
2146 .BI ~t "name .\ .\ ."
2147 Add the given names to the direct recipient list.
2150 Invoke an alternate editor
2151 (defined by the VISUAL option)
2152 on the message collected so far.
2153 Usually, the alternate editor
2154 will be a screen editor.
2155 After the editor is quit,
2156 the user may resume appending text
2157 to the end of the message.
2160 Write the message onto the named file.
2162 the message is appended to it.
2166 except that the message is not saved to the `dead.letter' file.
2169 Pipe the message through the command as a filter.
2170 If the command gives no output or terminates abnormally,
2171 retain the original text of the message.
2175 as command to rejustify the message.
2177 .BI ~: s-nail-command
2178 Execute the given \fIs-nail\fR command.
2179 Not all commands, however, are allowed.
2181 .BI ~_ s-nail-command
2185 Insert the string of text in the message
2186 prefaced by a single ~.
2187 If the escape character has been changed,
2188 that character must be doubled
2189 in order to send it at the beginning of a line.
2190 .SS "Variable options"
2191 Options are controlled via set and unset commands,
2192 see their entries for a syntax description.
2193 An option is also set
2194 if it is passed to \fIs-nail\fR
2195 as part of the environment
2196 (this is not restricted to specific variables as in the POSIX standard).
2197 A value given in a startup file overrides
2198 a value imported from the environment.
2199 Options may be either binary,
2200 in which case it is only significant
2201 to see whether they are set or not;
2202 or string, in which case the actual value is of interest.
2203 .SS "Binary options"
2205 The binary options include the following:
2208 Causes only the local part to be evaluated
2209 when comparing addresses.
2212 Causes messages saved in mbox to be appended to the end
2213 rather than prepended.
2214 This should always be set.
2216 .BR ask \ or \ asksub
2217 Causes \fIs-nail\fR to prompt for the subject
2218 of each message sent.
2219 If the user responds with simply a newline,
2220 no subject field will be sent.
2223 Causes the prompts for `Cc:' and `Bcc:' lists
2224 to appear after the message has been edited.
2227 If set, \fIs-nail\fR asks for files to attach at the end of each message.
2228 Responding with a newline indicates not to include an attachment.
2231 Causes the user to be prompted
2232 for additional carbon copy recipients
2233 (at the end of each message if
2238 Responding with a newline
2239 indicates the user's satisfaction with the current list.
2242 Causes the user to be prompted
2243 for additional blind carbon copy recipients
2244 (at the end of each message if
2249 Responding with a newline
2250 indicates the user's satisfaction with the current list.
2253 Causes the user to be prompted
2254 if the message is to be signed
2255 at the end of each message.
2258 variable is ignored when this variable is set.
2261 Causes threads to be collapsed automatically when
2262 threaded mode is entered
2272 Causes the delete command to behave like dp \-
2273 thus, after deleting a message,
2274 the next one will be typed automatically.
2277 Causes threaded mode (see the
2279 command) to be entered automatically
2280 when a folder is opened.
2283 Enables the substitution of `\fB!\fR'
2284 by the contents of the last command line
2288 Causes automatic display of a header summary after executing a
2293 Sets some cosmetical features to traditional BSD style;
2294 has the same affect as setting `askatend' and
2295 all other variables prefixed with `bsd',
2296 setting prompt to `&\ ', and changing the default pager to
2300 Changes the letters printed in the first column of a header summary
2301 to traditional BSD style.
2304 Changes the display of columns in a header summary
2305 to traditional BSD style.
2308 Changes some informational messages
2309 to traditional BSD style.
2312 Causes the `Subject:' field to appear
2313 immediately after the `To:' field
2314 in message headers and with the
2319 Changes the output format of the
2321 command to traditional BSD style.
2323 .B chained-junk-tokens
2324 Normally, the Bayesian junk mail filter bases its classifications
2325 on single word tokens extracted from messages.
2326 If this option is set,
2327 adjacent words are combined to pairs,
2328 which are then used as additional tokens.
2329 This usually improves the accuracy of the filter,
2330 but also increases the junk mail database
2334 The date in a header summary
2335 is normally the date of the mailbox `From\ ' line of the message.
2336 If this variable is set,
2337 the date as given in the `Date:' header field is used,
2338 converted to local time.
2341 Prints debugging messages and disables the actual delivery of messages.
2344 this option is intended for
2349 When an IMAP mailbox is selected and this variable is set,
2350 no connection to the server is initiated.
2351 Instead, data is obtained from the local cache (see
2353 Mailboxes that are not present in the cache
2354 and messages that have not yet entirely been fetched from the server
2356 to fetch all messages in a mailbox at once,
2357 the command `copy * /dev/null' can be used
2361 Changes that are made to IMAP mailboxes in disconnected mode
2362 are queued and committed later
2363 when a connection to that server is opened in online mode.
2364 This procedure is not completely reliable
2365 since it cannot be guaranteed that the IMAP unique identifiers (UIDs)
2366 on the server still match the ones in the cache at that time.
2367 Data is saved to `dead.letter' when this problem occurs.
2369 \fBdisconnected-\fIuser\fB@\fIhost\fR
2370 The specified account is handled as described for the
2373 but other accounts are not affected.
2376 The binary option dot causes \fIs-nail\fR to interpret
2377 a period alone on a line
2378 as the terminator of a message the user is sending.
2381 When a message is edited while being composed,
2382 its header is included in the editable text.
2383 `To:', `Cc:', `Bcc:', `Subject:', `From:', `Reply-To:', `Sender:',
2385 fields are accepted within the header,
2386 other fields are ignored.
2389 If set, an empty mailbox file is not removed.
2390 This may improve the interoperability with other mail user agents
2391 when using a common folder directory.
2394 If the mailbox is empty,
2395 \fIs-nail\fR normally prints \fI`No mail for user'\fR
2396 and exits immediately.
2397 If this option is set,
2398 \fIs-nail\fR starts even with an empty mailbox.
2405 commands and vice-versa.
2407 .B forward-as-attachment
2408 Original messages are normally sent as inline text with the
2411 and only the first part of a multipart message is included.
2413 messages are sent as MIME
2416 and all of their parts are included.
2421 options are ignored when the
2422 .I forward-as-attachment
2426 When replying to a message,
2427 \fIs-nail\fR normally removes the comment parts of email addresses,
2428 which by convention contain the full names of the recipients.
2429 If this variable is set,
2430 such stripping is not performed,
2431 and comments are retained.
2434 Causes the header summary to be written at startup
2435 and after commands that affect the number of messages
2436 or the order of messages in the current folder;
2440 This option is used to hold messages
2441 in the system mailbox by default.
2444 Causes interrupt signals from the terminal
2445 to be ignored and echoed as @'s.
2448 An option related to dot is ignoreeof
2449 which makes \fIs-nail\fR refuse to
2450 accept a control-d as the end of a message.
2451 Ignoreeof also applies to \fIs-nail\fR command mode.
2453 .B imap-use-starttls
2456 to issue a STARTTLS command
2457 to make an unencrypted IMAP session SSL/TLS encrypted.
2458 This functionality is not supported by all servers,
2459 and is not used if the session is already encrypted by the IMAPS method.
2461 \fBimap-use-starttls-\fIuser\fB@\fIhost\fR
2463 .I imap-use-starttls
2464 for a specific account.
2467 This option causes \fIs-nail\fR to truncate the user's system mailbox
2468 instead of deleting it when it is empty.
2469 This should always be set,
2470 since it prevents malicious users
2471 from creating fake mail folders
2472 in a world-writable spool directory.
2475 When a message is saved,
2476 it is usually discarded
2477 from the originating folder
2482 causes all saved message to be retained.
2485 When a message is replied to
2486 and this variable is set,
2487 it is marked as having been answered.
2488 This mark has no technical meaning in the mail system;
2489 it just causes messages to be marked in the header summary,
2490 and makes them specially addressable.
2493 Usually, when a group is expanded
2494 that contains the sender,
2495 the sender is removed from the expansion.
2496 Setting this option causes
2497 the sender to be included in the group.
2500 Checks for new mail in the current folder
2501 each time the prompt is printed.
2503 the server is then polled for new mail,
2504 which may result in delayed operation
2505 if the connection to the server is slow.
2508 folder must be re-scanned to determine
2509 if new mail has arrived.
2511 If this variable is set to the special value
2513 an IMAP server is not actively asked for new mail,
2514 but new mail may still be detected and announced
2515 with any other IMAP command that is sent to the server.
2518 folder is not scanned then.
2521 the IMAP server may send notifications about messages
2522 that have been deleted on the server
2523 by another process or client.
2524 In this case, `Expunged \fIn\fR messages' is printed
2525 regardless of this variable,
2526 and message numbers may have changed.
2529 Setting the option noheader is the same
2530 as giving the \-N flag on the command line.
2533 Causes the filename given in the
2536 and the sender-based filenames for the
2541 to be interpreted relative to the directory given in the
2543 variable rather than to the current directory
2544 unless it is an absolute pathname.
2547 If set, each message the \fIpipe\fR command prints out
2548 is followed by a formfeed character.
2551 Send messages to the
2553 command without performing MIME and character set conversions.
2556 If this variable is set,
2557 the APOP authentication method is used
2558 when a connection to a POP3 server is initiated.
2559 The advantage of this method over the usual USER/PASS authentication is
2560 that the password is not sent over the network in clear text.
2561 The connection fails
2562 if the server does not support the APOP command.
2564 \fBpop3-use-apop-\fIuser\fB@\fIhost\fR
2567 for a specific account.
2569 .B pop3-use-starttls
2572 to issue a STLS command
2573 to make an unencrypted POP3 session SSL/TLS encrypted.
2574 This functionality is not supported by all servers,
2575 and is not used if the session is already encrypted by the POP3S method.
2577 \fBpop3-use-starttls-\fIuser\fB@\fIhost\fR
2579 .I pop3-use-starttls
2580 for a specific account.
2583 This option causes all characters to be considered printable.
2584 It is only effective if given in a startup file.
2585 With this option set,
2586 some character sequences in messages
2587 may put the user's terminal in an undefined state
2589 it should only be used as a last resort
2590 if no working system locale can be found.
2592 .B print-alternatives
2593 When a MIME message part of type
2594 .I multipart/alternative
2595 is displayed and it contains a subpart of type
2597 other parts are normally discarded.
2598 Setting this variable causes all subparts to be displayed,
2599 just as if the surrounding part was of type
2600 .IR multipart/mixed .
2603 Suppresses the printing of the version when first invoked.
2606 On group replies, specify only the sender of the original mail
2607 in \fI`To:'\fR and mention it's other recipients in the secondary
2611 If both this variable and the
2618 commands save messages to the
2620 folder as it is normally only done for newly composed messages.
2622 .B reply-in-same-charset
2623 If this variable is set,
2625 first tries to use the same character set
2626 of the original message for replies.
2630 variable is evaluated as usual.
2633 Reverses the sense of reply and Reply commands.
2636 When the user aborts a message
2637 with two RUBOUT (interrupt characters)
2638 \fIs-nail\fR copies the partial letter
2639 to the file `dead.letter' in the home directory.
2640 This option is set by default.
2643 If this option is set, then
2644 a message-list specifier in the form `\fI/x:y\fR'
2645 will expand to all messages containing
2646 the substring `\fIy\fR' in the header field `\fIx\fR'.
2647 The string search is case insensitive.
2650 When sending a message,
2651 wait until the mail transfer agent exits
2652 before accepting further commands.
2653 If the mail transfer agent returns a non-zero exit status,
2654 the exit status of s-nail will also be non-zero.
2657 Setting this option causes \fIs-nail\fR to start at the
2658 last message instead of the first one when opening a mail folder.
2663 to use the sender's real name instead of the plain address
2664 in the header field summary and in message specifications.
2667 Causes the recipient of the message to be shown in the header summary
2668 if the message was sent by the user.
2671 If an outgoing message does not contain any text
2672 in its first or only message part,
2673 do not send it but discard it silently
2678 .B smime-force-encryption
2681 to refuse sending unencrypted messages.
2684 If this variable is set,
2685 outgoing messages are S/MIME signed with the user's private key.
2686 Signing a message enables a recipient to verify
2687 that the sender used a valid certificate,
2688 that the email addresses in the certificate
2689 match those in the message header,
2690 and that the message content has not been altered.
2691 It does not change the message text,
2692 and people will be able to read the message as usual.
2694 .B smime-no-default-ca
2695 Do not load the default CA locations
2696 when verifying S/MIME signed messages.
2697 Only applicable if S/MIME support is built using OpenSSL.
2699 .B smtp-use-starttls
2700 Causes \fIs-nail\fR to issue a STARTTLS command
2701 to make an SMTP session SSL/TLS encrypted.
2702 Not all servers support this command;
2703 because of common implementation defects,
2704 it cannot be automatically determined
2705 whether a server supports it or not.
2707 .B ssl-no-default-ca
2708 Do not load the default CA locations
2709 to verify SSL/TLS server certificates.
2710 Only applicable if SSL/TLS support is built using OpenSSL.
2713 Accept SSLv2 connections.
2714 These are normally not allowed
2715 because this protocol version is insecure.
2718 Inhibits the generation of
2719 the \fI`Message-Id:'\fR and \fI`User-Agent:'\fR
2720 header fields that include obvious references to \fIs-nail\fR.
2721 There are two pitfalls associated with this:
2722 First, the message id of outgoing messages is not known anymore.
2723 Second, an expert may still use the remaining information in the header
2724 to track down the originating mail user agent.
2727 Setting the option verbose is the same
2728 as using the \-v flag on the command line.
2729 When \fIs-nail\fR runs in verbose mode,
2730 details of the actual message delivery
2731 and protocol conversations for IMAP, POP3, and SMTP,
2732 as well as of other internal processes,
2733 are displayed on the user's terminal,
2734 This is sometimes useful to debug problems.
2736 prints all data that is sent to remote servers in clear texts,
2737 including passwords,
2738 so care should be taken that no unauthorized option
2739 can view the screen if this option is enabled.
2742 If this variable is set,
2743 messages modified using the
2747 commands are written back to the current folder when it is quit.
2748 This is only possible for writable folders in
2751 Setting this variable also disables
2752 MIME decoding and decryption for the editing commands.
2753 .SS "String Options"
2755 The string options include the following:
2758 A sequence of characters to print in the `attribute'
2759 column of a header summary,
2760 each for one type of messages in the following order:
2772 start of a collapsed thread,
2775 The default is `NUROSPMFATK+\-J',
2776 or `NU\ \ *HMFATK+\-J' if
2780 environment variable
2784 Specifies a list of recipients to which
2785 a blind carbon copy of each outgoing message
2786 will be sent automatically.
2789 Specifies a list of recipients to which
2790 a carbon copy of each outgoing message
2791 will be sent automatically.
2794 Causes sorted mode (see the
2796 command) to be entered automatically
2797 with the value of this option as sorting method
2798 when a folder is opened.
2801 The default value for the \fIpipe\fR command.
2804 The valued option crt is used as a threshold
2805 to determine how long a message must be
2806 before PAGER is used to read it.
2807 If crt is set without a value,
2808 then the height of the terminal screen stored in the system
2809 is used to compute the threshold (see
2813 The name of the file to use
2814 for saving aborted messages.
2815 This defaults to `dead.letter'
2816 in the user's home directory.
2819 Pathname of the text editor to use
2820 in the edit command and ~e escape.
2822 then a default editor is used.
2825 The default MIME encoding to use
2826 in outgoing text messages and message parts.
2827 Valid values are \fI8bit\fR or \fIquoted-printable\fR.
2828 The default is \fI8bit\fR.
2829 In case the mail transfer system
2830 is not ESMTP compliant,
2831 \fIquoted-printable\fR should be used instead.
2832 If there is no need to encode a message,
2833 \fI7bit\fR transfer mode is used,
2834 without regard to the value of this variable.
2835 Binary data is always encoded in \fIbase64\fR mode.
2838 If defined, the first character of this option
2839 gives the character to use in the place of ~ to denote escapes.
2842 The name of the directory to use
2843 for storing folders of messages.
2844 All folder names that begin with `+'
2845 refer to files below that directory.
2846 If the directory name begins with a `/',
2847 \fIs-nail\fR considers it to be an absolute pathname;
2848 otherwise, the folder directory is found
2849 relative to the user's home directory.
2851 The directory name may also refer to an IMAP account;
2852 any names that begin with `+'
2853 then refer to IMAP mailboxes on that account.
2854 An IMAP folder is normally given in the form
2857 imaps://mylogin@imap.myisp.example
2861 the `+' and `@' prefixes for folder names
2862 have the same effect
2867 Some IMAP servers do not accept the creation of mailboxes
2868 in the hierarchy base;
2869 they require that they are created as subfolders of `INBOX'.
2871 a folder name of the form
2874 imaps://mylogin@imap.myisp.example/INBOX.\&
2878 (the last character is the server's hierarchy delimiter).
2879 Folder names prefixed by `+' will then refer to folders below `INBOX',
2880 while folder names prefixed by `@'
2881 refer to folders below the hierarchy base.
2884 command for a method to detect the appropriate prefix and delimiter.
2887 When a folder is opened and this variable is set,
2888 the macro corresponding to the value of this variable is executed.
2889 The macro is also invoked when new mail arrives,
2890 but message lists for commands executed from the macro
2891 only include newly arrived messages then.
2893 \fBfolder-hook-\fIfullname\fR
2897 the macro corresponding to the value of this variable is executed.
2898 Unlike other folder specifications,
2899 the fully expanded name of a folder, without metacharacters,
2900 is used to avoid ambiguities.
2901 The macro specified with
2903 is not executed if this variable is effective for a folder
2904 (unless it is explicitly invoked within the called macro).
2907 The address (or a list of addresses)
2908 to put into the \fI`From:'\fR field of the message header.
2909 If replying to a message,
2910 these addresses are handled as if they were in the alternates list.
2911 .\" If this variable is set,
2912 .\" a \fI`Sender:'\fR field containing the user's name
2913 .\" is also generated,
2914 .\" unless the variable \fIsmtp\fR is set
2915 .\" and its value differs from \fIlocalhost\fR.
2916 If the machine's hostname is not valid at the Internet
2917 (for example at a dialup machine),
2918 either this variable or
2921 to get correct Message-ID header fields.
2924 contains more than one address,
2927 variable must also be set.
2930 The string to print before the text of a message
2935 .I forward-as-attachment
2937 Defaults to ``-------- Original Message --------'' if unset.
2938 If it is set to the empty string,
2939 no heading is printed.
2942 A format string to use for the header summary,
2946 A `%' character introduces a format specifier.
2947 It may be followed by a number indicating the field width.
2948 If the field is a number,
2949 the width may be negative,
2950 which indicates that it is to be left-aligned.
2951 Valid format specifiers are:
2956 %a Message attributes.
2957 %c The score of the message.
2958 %d The date when the message was received.
2959 %e The indenting level in threaded mode.
2960 %f The address of the message sender.
2961 %i The message thread structure.
2962 %l The number of lines of the message.
2964 %o The number of octets (bytes) in the message.
2965 %s Message subject (if any).
2966 %S Message subject (if any) in double quotes.
2967 %t The position in threaded/sorted order.
2968 %> A `>' for the current message, otherwise ` '.
2969 %< A `<' for the current message, otherwise ` '.
2974 The default is `%>\&%a\&%m\ %18f\ %16d\ %4l/%\-5o\ %i%s',
2975 or `%>\&%a\&%m\ %20f\ \ %16d\ %3l/%\-5o\ %i%S' if
2980 Use this string as hostname
2981 when expanding local addresses
2982 instead of the value obtained from
2985 .IR getaddrinfo (3).
2988 Sets the IMAP authentication method.
2989 Valid values are `login' for the usual password-based authentication
2991 `cram-md5', which is a password-based authentication
2992 that does not send the password over the network in clear text,
2993 and `gssapi' for GSSAPI-based authentication.
2995 \fBimap-auth-\fIuser\fB@\fIhost\fR
2996 Sets the IMAP authentication method for a specific account.
2999 Enables caching of IMAP mailboxes.
3000 The value of this variable must point to a directory
3001 that is either existent or can be created by
3003 All contents of the cache can be deleted by
3006 it is not safe to make assumptions about them.
3009 IMAP servers may close the connection
3010 after a period of inactivity;
3011 the standard requires this to be at least 30 minutes,
3012 but practical experience may vary.
3013 Setting this variable to a numeric
3016 causes a NOOP command to be sent each
3018 seconds if no other operation is performed.
3021 When retrieving the list of folders on an IMAP server, the
3023 command stops after it has reached a certain depth
3024 to avoid possible infinite loops.
3025 The value of this variable sets the maximum depth allowed.
3027 If the folder separator on the current IMAP server is a slash `/',
3028 this variable has no effect,
3031 command does not descend to subfolders.
3034 String used by the `\fI~m\fR' and `\fI~M\fR' tilde escapes
3035 and by the \fIquote\fR option
3036 for indenting messages,
3037 in place of the normal tab character (^I).
3038 Be sure to quote the value
3039 if it contains spaces or tabs.
3042 The location of the junk mail database.
3043 The string is treated like a folder name,
3044 as described for the
3048 The files in the junk mail database are normally stored in
3050 format for saving space.
3051 If processing time is considered more important,
3053 can be used to store them in plain form.
3055 will then work using the uncompressed files.
3058 Pathname of the directory lister
3062 when operating on local mailboxes.
3066 Is used as the user's mailbox, if set.
3067 Otherwise, a system-dependent default is used.
3069 \fIprotocol\fB://\fR
3072 command for more information).
3075 A string to put at the beginning of each new message.
3076 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
3080 A string to put at the end of each new message.
3081 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
3084 .B maximum-unencoded-line-length
3085 Messages that contain lines longer than the value of this variable
3086 are encoded in quoted-printable
3087 even if they contain only ASCII characters.
3088 The maximum effective value is 950.
3090 all ASCII text messages are encoded in quoted-printable.
3091 S/MIME signed messages are always encoded
3092 in quoted-printable regardless of the value of this variable.
3095 The name of the mbox file.
3096 It can be the name of a folder.
3097 The default is `\fImbox\fR'
3098 in the user's home directory.
3101 The name of an optional startup file
3102 to be read after ~/.mailrc.
3103 This variable is ignored if it is imported from the environment;
3104 it has an effect only if it is set in /etc/nail.rc or ~/.mailrc
3105 to allow bypassing the configuration with e. g. `MAILRC=/dev/null'.
3106 Use this file for commands
3107 that are not understood by other s-nail implementations.
3110 If this variable has the value
3112 newly created local folders will be in
3117 A directory that contains the files
3119 to retrieve certificates,
3121 to retrieve private keys,
3126 These are usually taken from Mozilla installations,
3127 so an appropriate value might be
3128 `~/.mozilla/firefox/default.clm'.
3130 opens these files read-only
3131 and does not modify them.
3132 However, if the files are modified by Mozilla
3136 it will print a `Bad database' message.
3137 It may be necessary to create copies of these files
3138 that are exclusively used by
3141 Only applicable if S/MIME and SSL/TLS support is built using
3142 Network Security Services (NSS).
3145 The value to put into the \fI`Organization:'\fR field of the message header.
3148 Pathname of the program to use
3150 or when crt variable is set.
3151 The default paginator
3153 or, in BSD compatibility mode,
3156 if this option is not defined.
3158 \fBpassword-\fIuser\fB@\fIhost\fR
3159 Set the password for
3163 If no such variable is defined for a host,
3164 the user will be asked for a password on standard input.
3165 Specifying passwords in a startup file
3166 is generally a security risk,
3167 the file should be readable
3168 by the invoking user only.
3170 .BI pipe- content/subcontent
3171 When a MIME message part of
3172 .I content/subcontent
3173 type is displayed or it is replied to,
3174 its text is filtered through the value of this variable
3175 interpreted as a shell command.
3176 Special care must be taken when using such commands
3177 as mail viruses may be distributed by this method;
3180 were filtered through the shell, for example,
3181 a message sender could easily execute arbitrary code
3187 POP3 servers may close the connection
3188 after a period of inactivity;
3189 the standard requires this to be at least 10 minutes,
3190 but practical experience may vary.
3191 Setting this variable to a numeric
3194 causes a NOOP command to be sent each
3196 seconds if no other operation is performed.
3199 The string printed when a command is accepted.
3200 Defaults to `\fB?\ \fR',
3201 or to `\fB&\ \fR' if the
3206 If set, \fIs-nail\fR starts a replying message with the original message
3207 prefixed by the value of the variable \fIindentprefix\fR.
3208 Normally, a heading consisting of `Fromheaderfield wrote:' is printed
3209 before the quotation.
3210 If the string \fInoheading\fR is assigned to the \fIquote\fR variable,
3211 this heading is omitted.
3212 If the string \fIheaders\fR is assigned,
3213 the headers selected by the ignore/retain commands
3214 are printed above the message body,
3215 thus \fIquote\fR acts like an automatic ~m command then.
3216 If the string \fIallheaders\fR is assigned,
3217 all headers are printed above the message body,
3218 and all MIME parts are included,
3219 thus \fIquote\fR acts like an automatic ~M command then.
3222 If set in addition to \fIindentprefix\fR, \fIs-nail\fR interprets this
3223 number as the maximum line length of the quotation when replying to a
3225 Setting this turns on a more fancy quotation algorithm in that leading
3226 quotation characters are compressed and overlong lines are folded to
3227 \fIquote-fold\fR characters each, breaking at whitespace as necessary
3228 and starting the follow lines with fillers to pad up to the last
3229 quotation markers width.
3230 The value of \fIquote-fold\fR can't be smaller than the length of
3231 \fIindentprefix\fR plus some additional pad. It is automatically
3232 adjusted to the minimum as necessary.
3235 If defined, gives the pathname of the folder
3236 used to record all outgoing mail.
3238 then outgoing mail is not so saved.
3239 When saving to this folder fails,
3240 the message is not sent
3241 but saved to the `dead.letter' file instead.
3244 A list of addresses to put into the \fI`Reply-To:'\fR field
3245 of the message header.
3246 If replying to a message, such addresses are handled
3247 as if they were in the alternates list.
3250 When \fIs-nail\fR initially prints the message headers,
3251 it determines the number to print
3252 by looking at the speed of the terminal.
3253 The faster the terminal, the more it prints.
3254 This option overrides this calculation
3255 and specifies how many message headers
3257 This number is also used
3258 for scrolling with the z command.
3261 A comma-separated list of character set names
3262 that can be used in Internet mail.
3263 When a message that contains characters not representable in US-ASCII
3264 is prepared for sending,
3266 tries to convert its text
3267 to each of the given character sets in order
3268 and uses the first appropriate one.
3269 The default is `utf-8'.
3271 Character sets assigned to this variable should be ordered
3272 in ascending complexity.
3273 That is, the list should start with e.\|g.
3274 `iso-8859-1' for compatibility with older mail clients,
3275 might contain some other language-specific character sets,
3276 and should end with `utf-8'
3277 to handle messages that combine texts in multiple languages.
3280 An address that is put into the `Sender:' field
3281 of outgoing messages.
3282 This field needs not normally be present.
3283 It is, however, required
3284 if the `From:' field contains more than one address.
3285 It can also be used to indicate that a message
3286 was sent on behalf of somebody other;
3287 in this case, `From:' should contain the address
3288 of the person that took responsibility for the message,
3289 and `Sender:' should contain the address
3290 of the person that actually sent the message.
3293 address is handled as if it were in the
3298 To use an alternate mail delivery system,
3299 set this option to the full pathname
3300 of the program to use.
3301 This should be used with care.
3304 Pathname of the shell to use
3305 in the ! command and the ~! escape.
3306 A default shell is used
3307 if this option is not defined.
3311 A string for use with the
3316 A string for use with the
3321 Must correspond to the name of a readable file if set.
3322 The file's content is then appended to each singlepart message
3323 and to the first part of each multipart message.
3324 Be warned that there is no possibility
3325 to edit the signature for an individual message.
3328 Specifies a directory with CA certificates for verification
3329 of S/MIME signed messages.
3330 The format is the same as described in
3331 .IR SSL_CTX_load_verify_locations (3).
3332 Only applicable if S/MIME support is built using OpenSSL.
3335 Specifies a file with CA certificates for verification
3336 of S/MIME signed messages.
3337 The format is the same as described in
3338 .IR SSL_CTX_load_verify_locations (3).
3339 Only applicable if S/MIME support is built using OpenSSL.
3341 \fBsmime-cipher-\fIuser@host\fR
3342 Specifies a cipher to use when generating S/MIME encrypted messages
3354 (3DES, 112/168 bits).
3355 The default is 3DES.
3356 It is not recommended to use the other ciphers
3357 unless a recipient's client is actually unable to handle 3DES
3358 since they are comparatively weak;
3359 but even so, the recipient should upgrade his software in preference.
3362 Specifies a file that contains a CRL in PEM format
3363 to use when verifying S/MIME messages.
3364 Only applicable if S/MIME support is built using OpenSSL.
3367 Specifies a directory that contains files with CRLs in PEM format
3368 to use when verifying S/MIME messages.
3369 Only applicable if S/MIME support is built using OpenSSL.
3371 \fBsmime-encrypt-\fIuser@host\fR
3372 If this variable is set,
3375 are encrypted before sending.
3376 If S/MIME support is built using OpenSSL,
3377 the value of the variable must be set to the name of a file
3378 that contains a certificate in PEM format.
3379 If S/MIME support is built using NSS,
3380 the value of this variable is ignored,
3381 but if multiple certificates for
3384 .I smime-nickname-user@host
3385 variable should be set.
3386 Otherwise a certificate for the recipient
3387 is automatically retrieved from the certificate database,
3390 If a message is sent to multiple recipients,
3391 each of them for whom a corresponding variable is set
3392 will receive an individually encrypted message;
3393 other recipients will continue to receive the message in plain text
3395 .I smime-force-encryption
3397 It is recommended to sign encrypted messages,
3398 i.\|e. to also set the
3402 \fBsmime-nickname-\fIuser@host\fR
3403 Specifies the nickname of a certificate
3404 to be used when encrypting messages for
3406 Only applicable if S/MIME support is built using NSS.
3409 Points to a file in PEM format
3410 that contains the user's private key
3411 as well as his certificate.
3412 Both are used with S/MIME
3413 for signing and decrypting messages.
3414 Only applicable if S/MIME support is built using OpenSSL.
3416 \fBsmime-sign-cert-\fIuser@host\fR
3419 for the specific addresses.
3420 When signing messages and the value of the
3425 the specific file is used.
3426 When decrypting messages,
3427 their recipient fields (To: and Cc:) are searched for addresses
3428 for which such a variable is set.
3430 always uses the first address that matches,
3431 so if the same message is sent to more than one
3432 of the user's addresses using different encryption keys,
3433 decryption might fail.
3434 Only applicable if S/MIME support is built using OpenSSL.
3436 .B smime-sign-include-certs
3437 If used, this must be set to a comma-separated list of files,
3438 each of which containing a single certificate in PEM format
3439 to be included in the S/MIME message in addition to the
3442 This is most useful for long certificate chains if it is
3443 desired to aid the receiving party's verification process.
3444 Only applicable if S/MIME support is built using OpenSSL.
3446 \fBsmime-sign-include-certs-\fIuser@host\fR
3448 .I smime-sign-include-certs
3449 for the specific addresses.
3450 Refer to the discussion of \fBsmime-sign-cert-\fIuser@host\fR
3451 for more on this topic.
3453 .B smime-sign-nickname
3454 Specifies that the named certificate be used for signing mail.
3455 If this variable is not set,
3456 but a single certificate matching the current
3458 address is found in the database,
3459 that one is used automatically.
3460 Only applicable if S/MIME support is built using NSS.
3462 \fBsmime-sign-nickname-\fIuser@host\fR
3464 .I smime-sign-nickname
3465 for a specific address.
3466 Only applicable if S/MIME support is built using NSS.
3469 Normally, \fIs-nail\fR invokes
3471 directly to transfer messages.
3472 If the \fIsmtp\fR variable is set, a SMTP connection to
3473 the server specified by the value of this variable
3475 If the SMTP server does not use the standard port,
3476 a value of \fIserver:port\fR can be given,
3477 with \fIport\fR as a name or as a number.
3479 There are two possible methods to get SSL/TLS encrypted SMTP sessions:
3480 First, the STARTTLS command can be used to encrypt a session
3481 after it has been initiated,
3482 but before any user-related data has been sent; see
3483 .I \%smtp-use-starttls
3485 Second, some servers accept sessions that are encrypted
3486 from their beginning on. This mode is configured by assigning
3487 \fBsmtps://\fIserver\fR[\fB:\fIport\fR]
3492 The SMTP transfer is executed in a child process;
3498 this process runs asynchronously.
3499 If it receives a TERM signal,
3500 it will abort and save the message to the `dead.letter' file.
3503 Sets the SMTP authentication method.
3505 or if unset and smtp-auth-user is set,
3507 If set to `cram-md5',
3508 AUTH CRAM-MD5 is used;
3512 no SMTP authentication is performed.
3514 \fBsmtp-auth-\fIuser\fB@\fIhost\fR
3517 for specific values of sender addresses,
3522 .B smtp-auth-password
3523 Sets the global password for SMTP AUTH.
3524 Both user and password have to be given
3525 for AUTH LOGIN and AUTH CRAM-MD5.
3527 \fBsmtp-auth-password-\fIuser\fB@\fIhost\fR
3529 .I smtp-auth-password
3530 for specific values of sender addresses,
3536 Sets the global user name for SMTP AUTH.
3537 Both user and password have to be given
3538 for AUTH LOGIN and AUTH CRAM-MD5.
3540 If this variable is set but neither
3541 .I smtp-auth-password
3543 .I smtp-auth-password-user@host
3546 will as for a password on the user's terminal.
3548 \fBsmtp-auth-user-\fIuser\fB@\fIhost\fR
3551 for specific values of sender addresses,
3557 Specifies a directory with CA certificates for verification
3558 of SSL/TLS server certificates.
3560 .IR SSL_CTX_load_verify_locations (3)
3561 for more information.
3562 Only applicable if SSL/TLS support is built using OpenSSL.
3565 Specifies a file with CA certificates for verification
3566 of SSL/TLS server certificates.
3568 .IR SSL_CTX_load_verify_locations (3)
3569 for more information.
3570 Only applicable if SSL/TLS support is built using OpenSSL.
3574 for a SSL/TLS client certificate
3575 required by some servers.
3576 Only applicable if SSL/TLS support is built using OpenSSL.
3578 \fBssl-cert-\fIuser\fB@\fIhost\fR
3579 Sets an account-specific file name
3580 for a SSL/TLS client certificate
3581 required by some servers.
3584 for the specified account.
3585 Only applicable if SSL/TLS support is built using OpenSSL.
3588 Specifies a list of ciphers for SSL/TLS connections.
3589 See ciphers(1) for more information.
3590 Only applicable if SSL/TLS support is built using OpenSSL.
3593 Specifies a file that contains a CRL in PEM format
3594 to use when verifying SSL/TLS server certificates.
3595 Only applicable if SSL/TLS support is built using OpenSSL.
3598 Specifies a directory that contains files with CRLs in PEM format
3599 to use when verifying SSL/TLS server certificates.
3600 Only applicable if SSL/TLS support is built using OpenSSL.
3604 for the private key of a SSL/TLS client certificate.
3605 If unset, the name of the certificate file is used.
3606 The file is expected to be in PEM format.
3607 Only applicable if SSL/TLS support is built using OpenSSL.
3609 \fBssl-key-\fIuser\fB@\fIhost\fR
3610 Sets an account-specific file name
3611 for the private key of a SSL/TLS client certificate.
3614 for the specified account.
3615 Only applicable if SSL/TLS support is built using OpenSSL.
3618 Selects a SSL/TLS protocol version;
3619 valid values are `ssl2', `ssl3', and `tls1'.
3620 If unset, the method is selected automatically,
3623 \fBssl-method-\fIuser\fB@\fIhost\fR
3626 for a specific account.
3629 Gives the pathname to an entropy daemon socket,
3634 Gives the pathname to a file with entropy data,
3636 .IR RAND_load_file (3).
3637 If the file is a regular file writable by the invoking user,
3638 new data is written to it after it has been loaded.
3639 Only applicable if SSL/TLS support is built using OpenSSL.
3642 Sets the action to be performed if an error occurs
3643 during SSL/TLS server certificate validation.
3645 `strict' (fail and close connection immediately),
3646 `ask' (ask whether to continue on standard input),
3647 `warn' (print a warning and continue),
3648 `ignore' (do not perform validation).
3649 The default is `ask'.
3651 \fBssl-verify-\fIuser\fB@\fIhost\fR
3654 for a specific account.
3657 If defined, gives the number of lines
3658 of a message to be printed out
3659 with the top command;
3660 normally, the first five
3664 The character set of the terminal \fIs-nail\fR operates on.
3665 There is normally no need to set this variable
3666 since \fIs-nail\fR can determine this automatically
3667 by looking at the LC_CTYPE locale setting;
3668 if this succeeds, the value is assigned at startup
3669 and will be displayed by the \fIset\fP command.
3670 Note that this is not necessarily a character set name
3671 that can be used in Internet messages.
3674 Pathname of the text editor to use
3675 in the visual command and ~v escape.
3676 .SH ENVIRONMENT VARIABLES
3677 Besides the variables described above, \fIs-nail\fR uses
3678 the following environment strings:
3681 The user's home directory.
3683 \fBLANG\fR, \fBLC_ALL\fR, \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR
3688 Is used as startup file instead of ~/.mailrc if set.
3691 scripts are invoked on behalf of other users,
3692 this variable should be set to `/dev/null'
3693 to avoid side-effects from reading their configuration files.
3696 If this variable is set and
3699 it is read as startup file.
3702 Changes the letters printed in the first column of a header summary.
3705 Used as directory for temporary files instead of /tmp, if set.
3709 File giving initial commands.
3712 System wide initialization file.
3715 Personal MIME types.
3718 System wide MIME types.
3720 .SS "Getting started"
3723 command has two distinct usages, according to whether one
3724 wants to send or receive mail.
3725 Sending mail is simple: to send a
3726 message to a user whose email address is, say,
3727 <bill@host.example>,
3732 $ \fBs-nail\fI bill@host.example\fR
3735 then type your message.
3737 will prompt you for a message
3740 after that, lines typed by you form the body of the message.
3741 When you reach the end of the message, type
3742 an EOT (control\-d) at the beginning of a line, which will cause
3744 to echo `EOT' and return you to the shell.
3746 If, while you are composing the message
3747 you decide that you do not wish to send it after all, you can
3748 abort the letter with a \s-2RUBOUT\s0. Typing a single \s-2RUBOUT\s0
3751 to print `(Interrupt -- one more to kill letter)'.
3753 \s-2RUBOUT\s0 causes
3755 to save your partial letter on the file `dead.letter'
3756 in your home directory and abort the letter.
3758 sent mail to someone, there is no way to undo the act, so be
3761 If you want to send the same message to several other people,
3762 you can list their email addresses on the command line.
3766 $ \fBs-nail\fI sam@workstation.example bob@server.example\fR
3768 Tuition fees are due next Friday. Don't forget!
3774 will send the reminder to \fI<sam@workstation.example>\fR.
3776 \fI<bob@server.example>\fR.
3778 To read your mail, simply type
3785 will respond by typing its version number and date and then listing
3786 the messages you have waiting.
3787 Then it will type a prompt and await your command.
3788 The messages are assigned numbers starting with 1\(emyou
3789 refer to the messages with these numbers.
3791 keeps track of which messages are
3793 (have been sent since you last read your mail) and
3795 (have been read by you). New messages have an
3797 next to them in the header listing and old, but unread messages have
3802 keeps track of new/old and read/unread messages by putting a
3807 To look at a specific message, use the
3809 command, which may be abbreviated to simply
3811 For example, if you had the following messages:
3814 O 1 drfoo@myhost.example Wed Sep 1 19:52 18/631 "Fees"
3815 O 2 sam@friends.example Thu Sep 2 00:08 30/895
3818 you could examine the first message by giving the command:
3826 to respond with, for example:
3830 From drfoo@myhost.example Wed Sep 1 19:52:25 2004
3834 Tuition fees are due next Wednesday. Don't forget!
3840 commands that operate on messages take a message number as an
3844 For these commands, there is a notion of a current message.
3847 program, the current message is initially the first
3848 (or the first recent) one.
3849 Thus, you can often omit the message number and use, for example,
3855 to type the current message.
3856 As a further shorthand, you can type a message
3857 by simply giving its message number.
3864 would type the first message.
3866 Frequently, it is useful to read the messages in your mailbox in order,
3868 You can read the next message in
3870 by simply typing a newline.
3871 As a special case, you can type a newline as your first command to
3873 to type the first message.
3875 If, after typing a message, you wish to immediately send a reply,
3876 you can do so with the
3882 takes a message number as an argument.
3884 then begins a message addressed to the user who sent you the message.
3885 You may then type in your letter in reply, followed by a <control-d>
3886 at the beginning of a line, as before.
3890 copies the subject header from the original message.
3891 This is useful in that correspondence
3892 about a particular matter will tend to retain the same subject heading,
3893 making it easy to recognize.
3894 If there are other header fields in the message,
3896 the information found will also be used.
3898 Sometimes you will receive a message that has been sent to
3899 several people and wish to reply only
3900 to the person who sent it.
3904 replies to a message, but sends a copy to the sender only.
3906 If you wish, while reading your mail, to send a message to someone,
3907 but not as a reply to one of your messages, you can send the message
3910 command, which takes as arguments the names of the recipients you wish
3912 For example, to send a message to <frank@machine.example>,
3916 \fBmail\fI frank@machine.example\fR
3919 To delete a message from the mail folder,
3923 In addition to not saving deleted messages,
3925 will not let you type them, either.
3926 The effect is to make the message disappear
3927 altogether, along with its number.
3931 can be tailored to your liking with the
3936 command has two forms, depending on whether you are setting a
3941 Binary options are either on or off. For example, the
3945 that each time you send a message, you want it to prompt you for
3947 to be included in the message.
3950 option, you would type
3956 Valued options are values which
3958 uses to adapt to your tastes.
3963 where to save messages sent by you,
3967 \fBset\fR record=Sent
3971 Note that no spaces are allowed in
3972 .I "set record=Sent".
3975 includes a simple facility for maintaining groups of messages together
3977 To use the folder facility, you must tell
3979 where you wish to keep your folders.
3980 Each folder of messages will be a single file.
3981 For convenience, all of your folders are kept in
3982 a single directory of your choosing.
3985 where your folder directory is, put a line of the form
3988 \fBset folder=\fIletters\fR
3994 If, as in the example above,
3995 your folder directory does not begin with a `/',
3997 will assume that your folder directory is to be found starting from
3998 your home directory.
4000 Anywhere a file name is expected, you can use a folder name, preceded
4002 For example, to put a message into a folder with the
4004 command, you can use:
4007 \fBsave +\fIclasswork\fR
4010 to save the current message in the
4015 folder does not yet exist, it will be created.
4016 Note that messages which are saved with the
4018 command are automatically removed from your system mailbox.
4020 In order to make a copy of a message in a folder without causing
4021 that message to be removed from your system mailbox, use the
4023 command, which is identical in all other respects to the
4030 can be used to direct
4032 to the contents of a different folder.
4036 \fBfolder +\fIclasswork\fR
4041 to read the contents of the
4044 All of the commands that you can use on your system
4045 mailbox are also applicable to folders, including
4050 To inquire which folder you are currently editing, use simply:
4056 To list your current set of folders, use the
4062 command is available to print out a brief summary of the most important
4066 While typing in a message to be sent to others, it is often
4067 useful to be able to invoke the text editor on the partial message,
4068 print the message, execute a shell command, or do some other
4071 provides these capabilities through
4072 .I "tilde escapes" ,
4073 which consist of a tilde (~) at the beginning of a line, followed by
4074 a single character which indicates the function to be performed.
4075 For example, to print the text of the message so far, use:
4081 which will print a line of dashes, the recipients of your message, and
4082 the text of the message so far.
4083 A list of the most important tilde escapes is available with `~?'.
4084 .SS "IMAP or POP3 client setup"
4085 First you need the following data from your ISP:
4086 the host name of the IMAP or POP3 server,
4087 user name and password for this server,
4088 and a notice whether the server uses SSL/TLS encryption.
4089 Assuming the host name is `server.myisp.example'
4090 and your user name for that server is `mylogin',
4091 you can refer to this account using the
4095 command line option with
4098 \fBimaps://\fImylogin\fB@\fIserver.myisp.example\fR
4101 (This string is not necessarily the same as your Internet mail address.)
4102 You can replace `imaps://' with `imap://'
4103 if the server does not support SSL/TLS.
4104 (If SSL/TLS support is built using NSS, the
4106 variable must be set before a connection can be initiated,
4108 Use `pop3s://' or `pop3://' if the server does not offer IMAP.
4109 You should use IMAP if you can, though;
4110 first because it requires fewer network operations than POP3
4111 to get the contents of the mailbox
4113 and second because message attributes
4114 are maintained by the IMAP server,
4115 so you can easily distinguish new and old messages
4116 each time you connect.
4117 Even if the server does not accept IMAPS or POP3S connections,
4118 it is possible that it supports the STARTTLS method
4119 to make a session SSL/TLS encrypted
4120 after the initial connection has been performed,
4121 but before authentication begins.
4122 The only reliable method to see if this works is to try it; enter one of
4125 \fBset imap-use-starttls\fR
4126 \fBset pop3-use-starttls\fR
4129 before you initiate the connection.
4131 As you probably want messages to be deleted from this account
4133 prefix it with `\fI%:\fR'.
4136 command can be used to avoid typing that many characters
4137 every time you want to connect:
4140 \fBshortcut \fImyisp\fB \fB%:imaps://\fImylogin\fB@\fIserver.myisp.example\fR
4143 You might want to put this string into a startup file.
4146 command is specific to this implementation of
4148 and will confuse other implementations,
4149 it should not be used in
4154 \fBset SNAIL_EXTRA_RC=\fI~/.s-nailrc\fR
4164 You can then access your remote mailbox by invoking
4165 `s-nail \-f \fImyisp\fR' on the command line,
4166 or by executing `fi \fImyisp\fR' within s-nail.
4168 If you want to use more than one IMAP mailbox on a server,
4169 or if you want to use the IMAP server for mail storage too,
4173 (which is also \fIs-nail-\fRspecific)
4174 is more appropriate than the
4177 You can put the following in
4181 \fBaccount \fImyisp \fB{\fR
4182 \fBset folder=imaps://\fImylogin\fB@\fIserver.myisp.example\fR
4183 \fBset record=+\fISent \fBMBOX=+\fImbox \fBoutfolder\fR
4187 and can then access incoming mail for this account by invoking
4188 `s-nail \-A \fImyisp\fR' on the command line,
4189 or by executing `ac \fImyisp\fR' within s-nail.
4191 a command like `copy \fI1\fR +\fIotherfolder\fR'
4192 will refer to \fIotherfolder\fR on the IMAP server.
4194 `fi &' will change to the
4198 `fi +Sent' will show your recorded sent mail,
4199 with both folders located on the IMAP server.
4202 will ask you for a password string
4203 each time you connect to a remote account.
4204 If you can reasonably trust the security
4205 of your workstation,
4206 you can give this password in the startup file as
4209 \fBset password-\fImylogin\fB@\fIserver.myisp.example\fB="\fISECRET\fB"\fR
4212 You should change the permissions of this file to 0600, see
4216 supports different authentication methods for both IMAP and POP3.
4217 If Kerberos is used at your location,
4218 you can try to activate GSSAPI-based authentication by
4221 \fBset imap-auth=gssapi\fR
4224 The advantage of this method is that
4226 does not need to know your password at all,
4227 nor needs to send sensitive data over the network.
4228 Otherwise, the options
4231 \fBset imap-auth=cram-md5\fR
4232 \fBset pop3-use-apop\fR
4235 for IMAP and POP3, respectively,
4236 offer authentication methods
4237 that avoid to send the password in clear text over the network,
4238 which is especially important if SSL/TLS cannot be used.
4239 If the server does not offer any of these authentication methods,
4240 conventional user/password based authentication must be used.
4241 It is sometimes helpful to set the
4243 option when authentication problems occur.
4245 will display all data sent to the server in clear text on the screen
4247 including passwords.
4248 You should thus take care that no unauthorized person
4249 can look at your terminal when this option is set.
4251 If you regularly use the same workstation
4252 to access IMAP accounts,
4253 you can greatly enhance performance
4254 by enabling local caching of IMAP messages.
4255 For any message that has been fully or partially fetched from the server,
4256 a local copy is made and is used when the message is accessed again,
4257 so most data is transferred over the network once only.
4258 To enable the IMAP cache,
4259 select a local directory name and put
4262 \fBset imap-cache=\fI~/localdirectory\fR
4265 in the startup file.
4266 All files within that directory
4267 can be overwritten or deleted by \fIs-nail\fR at any time,
4268 so you should not use the directory to store other information.
4270 Once the cache contains some messages,
4271 it is not strictly necessary anymore
4272 to open a connection to the IMAP server
4274 When \fIs-nail\fR is invoked with the \fI\-D\fR option,
4278 only cached data is used
4279 for any folder you open.
4280 Messages that have not yet been completely cached
4281 are not available then,
4282 but all other messages can be handled
4284 Changes made to IMAP mailboxes in
4286 mode are committed to the IMAP server
4287 next time it is used in
4290 Synchronizing the local status
4291 with the status on the server
4292 is thus partially within your responsibility;
4293 if you forget to initiate a connection to the server again
4294 before you leave your location,
4295 changes made on one workstation
4296 are not available on others.
4297 Also if you alter IMAP mailboxes from a workstation
4298 while uncommitted changes are still pending on another,
4299 the latter data may become invalid.
4300 The same might also happen because of internal server status changes.
4301 You should thus carefully evaluate this feature in your environment
4302 before you rely on it.
4304 Many servers will close the connection
4305 after a short period of inactivity. Use one of
4308 \fBset pop3-keepalive=\fI30\fR
4309 \fBset imap-keepalive=\fI240\fR
4312 to send a keepalive message each 30 seconds for POP3,
4313 or each 4 minutes for IMAP.
4315 If you encounter problems connecting to a SSL/TLS server,
4320 variables (see the OpenSSL FAQ for more information)
4321 or specify the protocol version with
4324 if you need a client certificate
4325 or if verification of the server certificate fails.
4326 If the failed certificate is indeed valid,
4327 fetch its CA certificate by executing the shell command
4330 $ \fBopenssl s_client </dev/null \-showcerts \-connect \e
4331 \fIserver.myisp.example\fB:\fIimaps\fB 2>&1 | tee \fIlog\fR
4336 and put it into the file specified with
4338 The data you need is located at the end of the certificate chain
4339 within (and including) the `BEGIN CERTIFICATE'
4340 and `END CERTIFICATE' lines.
4341 (Note that it is possible to fetch
4342 a forged certificate by this method.
4343 You can only completely rely
4344 on the authenticity of the CA certificate
4345 if you fetch it in a way that is trusted by other means,
4346 such as by personally receiving the certificate on storage media.)
4347 .SS "Creating a score file or message filter"
4348 The scoring commands are best separated
4349 from other configuration for clarity,
4353 It is thus recommended to put them in a separate file
4354 that is sourced from your SNAIL_EXTRA_RC as follows:
4357 \fBsource\fI ~/.scores\fR
4360 The \fI.scores\fR file could then look as follows:
4363 \fBdefine\fR \fIlist\fR {
4364 \fBscore\fR (subject "important discussion") +10
4365 \fBscore\fR (subject "annoying discussion") \-10
4366 \fBscore\fR (from "nicefellow@goodnet") +15
4367 \fBscore\fR (from "badguy@poornet") \-5
4368 \fBmove\fR (header x-spam-flag "+++++") \fI+junk\fR
4370 \fBset folder-hook-\fRimap://user@host/public.list=\fIlist\fR
4374 you would see any mail from `nicefellow@goodnet',
4375 even if the surrounding discussion is annoying;
4376 but you normally would not see mail from `badguy@poornet',
4377 unless he participates in the important discussion.
4378 Messages that are marked with five or more plus characters
4379 in their `X-Spam-Flag' field
4380 (inserted by some server-side filtering software)
4381 are moved to the folder `junk' in the
4385 Be aware that all criteria in (\|) lead to substring matches,
4386 so you would also score messages
4387 from e.\|g. `notsobadguy@poornetmakers' negative here.
4388 It is possible to select addresses exactly using \fI"address"\fR
4389 message specifications,
4390 but these cannot be executed remotely
4391 and will thus cause all headers
4392 to be downloaded from IMAP servers while looking for matches.
4394 When searching messages on an IMAP server,
4395 best performance is usually achieved
4396 by sending as many criteria as possible
4397 in one large (\|) specification,
4398 because each single such specification
4399 will result in a separate network operation.
4400 .SS "Activating the Bayesian filter"
4401 The Bayesian junk mail filter works
4402 by examining the words contained in messages.
4403 You decide yourself what a good and what a bad message is.
4404 Thus the resulting filter is your very personal one;
4405 once it is correctly set up,
4406 it will filter only messages similar to those
4407 previously specified by you.
4409 To use the Bayesian filter,
4410 a location for the junk mail database must be defined first:
4413 \fBset junkdb=\fI~/.junkdb\fR
4416 The junk mail database does not contain
4417 actual words extracted from messages,
4418 but hashed representations of them.
4419 A foreign person who can read the database
4420 could only examine the frequency of previously known words
4423 If you have sufficient disk space (several 10\ MB) available,
4424 it is recommended that you set the
4425 .I chained-junk-tokens
4427 The filter will then also consider two-word tokens,
4428 improving its accuracy.
4430 A set of good messages and junk messages must now be available;
4431 it is also possible to use the incoming new messages for this purpose,
4432 although it will of course take some time
4433 until the filter becomes useful then.
4434 Do not underestimate the amount of statistical data needed;
4435 some hundred messages are typically necessary
4436 to get satisfactory results,
4437 and many thousand messages for best operation.
4438 You have to pass the good messages to the
4441 and the junk messages to the
4444 If you ever accidentally mark a good message as junk or vice-versa,
4449 command to correct this.
4451 Once a reasonable amount of statistics has been collected,
4452 new messages can be classified automatically.
4455 command marks all messages that the filter considers to be junk,
4456 but it does not perform any action on them by default.
4457 It is recommended that you move these messages into a separate
4458 folder just for the case that false positives occur,
4459 or to pass them to the
4461 command later again to further improve the junk mail database.
4462 To automatically move incoming junk messages
4463 every time the inbox is opened,
4464 put lines like the following into your
4466 file (or whatever name you gave to the file in the last example):
4469 \fBdefine\fR \fIjunkfilter\fR {
4470 \fBclassify (smaller \fI20000\fB) :n\fR
4471 \fBmove :j\fR \fI+junk\fR
4473 \fBset folder-hook-\fRimap://user@host/INBOX=\fIjunkfilter\fR
4478 option before running the
4482 prints the words it uses for calculating the junk status
4483 along with their statistical probabilities.
4484 This can help you to find out
4485 why some messages are not classified
4486 as you would like them to be.
4487 To see the statistical probability of a given word,
4492 If a junk message was not recognized as such,
4495 command to correct this.
4496 Also if you encounter a false positive
4497 (a good message that was wrongly classified as junk),
4504 command must examine the entire text
4505 of all new messages in the respective folder,
4506 this will also cause all of them to be downloaded from the IMAP server.
4507 You should thus restrict the size of messages for automatic filtering.
4508 If server-based filtering is also available,
4509 you might try if that works for you first.
4510 .SS "Reading HTML mail"
4516 or another command-line web browser
4517 that can write plain text to standard output.
4520 \fBset pipe-text/html=\fR"w3m -dump -T text/html"
4526 \fBset pipe-text/html=\fR"lynx -dump -force_html /dev/stdin"
4529 will then cause HTML message parts to be converted into a more friendly form.
4530 .SS "Viewing PDF attachments"
4531 Most PDF viewers do not accept input directly from a pipe.
4532 It is thus necessary to store the attachment in a temporary file, as with
4535 \fBset pipe-application/pdf=\fR"cat >/tmp/s-nail$$.pdf; \e
4536 acroread /tmp/s-nail$$.pdf; rm /tmp/s-nail$$.pdf"
4539 Note that security defects are discovered in PDF viewers
4541 Automatical command execution like this
4542 can compromise your system security,
4543 in particular if you stay not always informed
4545 .SS "Signed and encrypted messages with S/MIME"
4546 S/MIME provides two central mechanisms:
4547 message signing and message encryption.
4548 A signed message contains some data in addition
4549 to the regular text.
4550 The data can be used to verify
4551 that the message was sent using a valid certificate,
4552 that the sender's address in the message header
4553 matches that in the certificate,
4554 and that the message text has not been altered.
4555 Signing a message does not change its regular text;
4556 it can be read regardless of whether the recipient's software
4557 is able to handle S/MIME.
4558 It is thus usually possible to sign all outgoing messages
4559 if so desired.\(emEncryption, in contrast,
4560 makes the message text invisible for all people
4561 except those who have access to the secret decryption key.
4562 To encrypt a message,
4563 the specific recipient's public encryption key must be known.
4564 It is thus not possible to send encrypted mail to people
4565 unless their key has been retrieved
4566 from either previous communication or public key directories.
4567 A message should always be signed before it is encrypted.
4568 Otherwise, it is still possible that the encrypted message text
4571 A central concept to S/MIME is that of the certification authority (CA).
4572 A CA is a trusted institution that issues certificates.
4573 For each of these certificates,
4574 it can be verified that it really originates from the CA,
4575 provided that the CA's own certificate is previously known.
4576 A set of CA certificates is usually delivered with OpenSSL
4577 and installed on your system.
4578 If you trust the source of your OpenSSL software installation,
4579 this offers reasonable security for S/MIME on the Internet.
4580 In general, a certificate cannot be more secure
4581 than the method its CA certificate has been retrieved with, though.
4582 Thus if you download a CA certificate from the Internet,
4583 you can only trust the messages you verify using that certificate
4584 as much as you trust the download process.
4586 The first thing you need for participating in S/MIME message exchange
4587 is your personal certificate,
4588 including a private key.
4589 The certificate contains public information,
4590 in particular your name and your email address,
4591 and the public key that is used by others
4592 to encrypt messages for you,
4593 and to verify signed messages they supposedly received from you.
4594 The certificate is included in each signed message you send.
4595 The private key must be kept secret.
4596 It is used to decrypt messages that were
4597 previously encrypted with your public key,
4598 and to sign messages.
4601 it is recommended that you get a S/MIME certificate
4602 from one of the major CAs on the Internet using your WWW browser.
4603 (Many CAs offer such certificates for free.)
4604 You will usually receive
4605 a combined certificate and private key
4606 in PKCS#12 format which
4608 does not directly accept
4609 if S/MIME support is built using OpenSSL.
4610 To convert it to PEM format,
4611 use the following shell command:
4614 $ \fBopenssl pkcs12 \-in \fIcert.p12\fB \-out \fIcert.pem\fB \-clcerts \e
4621 you can specifiy an additional
4622 .I "PEM pass phrase"
4623 for protecting the private key.
4625 will then ask you for that pass phrase
4626 each time it signs or decrypts a message.
4630 \fBset smime-sign-cert-\fImyname@myisp.example\fB=\fIcert.pem\fR
4633 to make this private key and certificate known to
4636 If S/MIME support is built using NSS,
4637 the PKCS#12 file must be installed using Mozilla
4640 is set appropriately,
4642 and no further action is necessary
4643 unless multiple user certificates
4644 for the same email address are installed.
4647 .I smime-sign-nickname
4648 variable has to be set appropriately.
4650 You can now sign outgoing messages.
4654 \fBset smime-sign\fR
4659 From each signed message you send,
4660 the recipient can fetch your certificate
4661 and use it to send encrypted mail back to you.
4662 Accordingly if somebody sends you a signed message,
4663 you can do the same.
4666 command to check the validity of the certificate.
4668 retrieve the certificate and tell
4670 that it should use it for encryption:
4673 \fBcertsave\fI filename\fR
4674 \fBset smime-encrypt-\fIuser@host\fB=\fIfilename\fR
4677 If S/MIME support is built using NSS,
4678 the saved certificate must be installed using Mozilla.
4680 .I smime-encrypt-user@host
4682 but if multiple certificates for the recipient are available,
4684 .I smime-nickname-user@host
4685 variable must be set.
4687 You should carefully consider
4688 if you prefer to store encrypted messages in decrypted form.
4689 If you do, anybody who has access to your mail folders can read them,
4691 you might be unable to read them yourself later
4692 if you happen to lose your private key.
4695 command saves messages in decrypted form,
4701 commands leave them encrypted.
4703 Note that neither S/MIME signing nor encryption
4704 applies to message subjects or other header fields.
4705 Thus they may not contain sensitive information
4706 for encrypted messages,
4707 and cannot be trusted even if the message content
4709 When sending signed messages,
4710 it is recommended to repeat any important header information
4711 in the message text.
4712 .SS "Using CRLs with S/MIME or SSL/TLS"
4713 Certification authorities (CAs) issue
4714 certificate revocation lists (CRLs) on a regular basis.
4715 These lists contain the serial numbers of certificates
4716 that have been declared invalid after they have been issued.
4717 Such usually happens
4718 because the private key for the certificate has been compromised,
4719 because the owner of the certificate has left
4720 the organization that is mentioned in the certificate,
4722 To seriously use S/MIME or SSL/TLS verification,
4723 an up-to-date CRL is required for each trusted CA.
4724 There is otherwise no method
4725 to distinguish between valid and invalidated certificates.
4727 currently offers no mechanism to fetch CRLs,
4728 or to access them on the Internet,
4729 so you have to retrieve them by some external mechanism.
4731 If S/MIME and SSL/TLS support are built using OpenSSL,
4733 accepts CRLs in PEM format only;
4734 CRLs in DER format must be converted,
4735 e.\|g. with the shell command
4738 $ \fBopenssl crl \-inform DER \-in \fIcrl.der\fB \-out \fIcrl.pem\fR
4745 that contains all CRL files
4746 (and no other files)
4752 variables, respectively,
4753 must then be set to point to that directory.
4756 requires a CRL to be present
4757 for each CA that is used
4758 to verify a certificate.
4760 If S/MIME and SSL/TLS support are built using NSS,
4761 CRLs can be imported in Mozilla applications
4764 is set appropriately).
4765 .SS "Sending mail from scripts"
4766 If you want to send mail from scripts,
4767 you must be aware that
4769 reads the user's configuration files by default.
4770 So unless your script is only intended for your own personal use
4771 (as e.g. a cron job),
4772 you need to circumvent this by invoking
4777 \fBMAILRC=/dev/null s-nail \-n\fR
4780 You then need to create a configuration for
4783 This can be done by either pointing the
4785 variable to a custom configuration file,
4786 or by passing the configuration in environment variables.
4787 Since many of the configuration options are not valid shell variables, the
4789 command is useful in this situation.
4790 An invocation could thus look like
4793 \fBenv MAILRC=/dev/null\fR from=\fIscriptreply@domain\fR smtp=\fIhost\fR \e
4794 smtp-auth-user=\fIlogin\fR smtp-auth-password=\fIsecret\fR \e
4795 smtp-auth=\fIlogin\fR \fBs-nail \-n\fR \-s "\fIsubject\fR" \e
4796 \-a \fIattachment_file\fR \fIrecipient@domain\fR <\fIcontent_file\fR
4811 Variables in the environment passed to
4815 The character set conversion relies
4819 Its functionality differs widely
4820 between the various system environments
4821 \fIs-nail\fR runs on.
4822 If the message `Cannot convert from \fIa\fR to \fIb\fR' appears,
4823 either some characters within the message header or text
4824 are not appropriate for the currently selected terminal character set,
4825 or the needed conversion is not supported by the system.
4827 it is necessary to set
4828 an appropriate LC_CTYPE locale (e.\|g. \fIen_US\fR)
4832 In the second case, the
4836 variables must be set to the same value
4837 to inhibit character set conversion.
4840 is not available at all,
4841 the value assigned to
4843 must match the character set that is used on the terminal.
4845 S-nail expects input text to be in Unix format,
4846 with lines separated by
4848 (^J, \en) characters only.
4849 Non-Unix text files that use
4852 characters in addition will be treated as binary data;
4853 to send such files as text, strip these characters e.\ g. by
4856 tr \-d '\e015' <input | s-nail .\ .\ .
4859 or fix the tools that generate them.
4861 Limitations with IMAP mailboxes are:
4862 It is not possible to edit messages,
4863 but it is possible to append them.
4864 Thus to edit a message,
4865 create a local copy of it,
4867 and delete the original.
4868 The line count for the header display
4869 is only appropriate if the entire message has been downloaded
4871 The marking of messages as `new' is performed by the IMAP server;
4876 will not cause it to be reset,
4878 .IR autoinc / newmail
4879 variables are unset,
4880 messages that arrived during a session
4881 will not be in state `new' anymore
4882 when the folder is opened again.
4883 Also if commands queued in disconnected mode are committed,
4884 the IMAP server will delete the `new' flag
4885 for all messages in the changed folder,
4886 and new messages will appear as unread
4887 when it is selected for viewing later.
4888 The `flagged', `answered', and `draft' attributes are usually permanent,
4889 but some IMAP servers are known to drop them without notification.
4890 .\" This is why s-nail does not even check if storing them succeeds.
4891 Message numbers may change with IMAP
4892 every time before the prompt is printed
4893 if \fIs-nail\fR is notified by the server
4894 that messages have been deleted
4895 by some other client or process.
4896 In this case, `Expunged \fIn\fR messages' is printed,
4897 and message numbers may have changed.
4899 Limitations with POP3 mailboxes are:
4900 It is not possible to edit messages,
4901 they can only be copied and deleted.
4902 The line count for the header display
4903 is only appropriate if the entire message has been downloaded
4905 The status field of a message is maintained by the server
4906 between connections;
4907 some servers do not update it at all,
4908 and with a server that does,
4909 the `exit' command will not cause the message status to be reset.
4910 The `newmail' command and the `newmail' variable
4912 It is not possible to rename or to remove POP3 mailboxes.
4916 (interrupt) is typed while an IMAP or POP3 operation is in progress,
4918 will wait until the operation can be safely aborted,
4919 and will then return to the command loop
4920 and print the prompt again.
4925 is waiting for the operation to complete,
4926 the operation itself will be canceled.
4928 data that has not been fetched yet
4929 will have to be fetched
4930 before the next command can be performed.
4931 If the canceled operation
4932 was using an SSL/TLS encrypted channel,
4933 an error in the SSL transport will very likely result,
4934 and the connection is no longer usable.
4936 As \fIs-nail\fR is a mail user agent,
4937 it provides only basic SMTP services.
4938 If it fails to contact its upstream SMTP server,
4939 it will not make further attempts to transfer the message
4941 and it does not leave other information about this condition
4942 than an error message on the terminal
4943 and a `dead.letter' file.
4944 This is usually not a problem if the SMTP server
4945 is located in the same local network
4946 as the computer on which \fIs-nail\fR is run.
4947 However, care should be taken when using a remote server of an ISP;
4948 it might be better to set up a local SMTP server then
4949 which just acts as a proxy.
4951 \fIS-nail\fR immediately contacts the SMTP server (or
4952 .IR \%/usr/lib/sendmail )
4953 even when operating in
4956 It would not make much sense for \fIs-nail\fR to defer outgoing mail
4957 since SMTP servers usually provide
4958 much more elaborated delay handling
4959 than \fIs-nail\fR could perform as a client.
4960 Thus the recommended setup for sending mail in
4962 mode is to configure a local SMTP server
4963 such that it sends outgoing mail
4964 as soon as an external network connection is available again,
4965 i.\|e. to advise it to do that from a network startup script.
4967 The junk mail filter follows the concepts developed by
4968 Paul Graham in his articles,
4969 ``A Plan for Spam'', August 2002,
4970 \%<http://www.paulgraham.com/spam.html>,
4971 and ``Better Bayesian Filtering'', January 2003,
4972 \%<http://www.paulgraham.com/better.html>.
4973 Chained tokens are due to a paper by
4974 Jonathan A. Zdziarski,
4975 ``Advanced Language Classification using Chained Tokens'',
4977 \%<http://www.nuclearelephant.com/papers/chained.html>.
4979 A \fImail\fR command appeared in Version 1 AT&T Unix.
4980 Berkeley Mail was written in 1978 by Kurt Shoens.
4981 This man page is derived from
4982 from The Mail Reference Manual
4983 originally written by Kurt Shoens.
4984 \fIHeirloom Mailx\fR enhancements are maintained and documented
4986 \fIS-nail\fR enhancements are maintained and documented
4987 by Steffen "Daode" Nurpmeso.
4989 Portions of this text are reprinted and reproduced in electronic form
4990 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
4991 \(em Operating System Interface (POSIX), The Open Group Base
4992 Specifications Issue 6, Copyright \(co 2001-2003 by the Institute of
4993 Electrical and Electronics Engineers, Inc and The Open Group. In the
4994 event of any discrepancy between this version and the original IEEE and
4995 The Open Group Standard, the original IEEE and The Open Group Standard
4996 is the referee document. The original Standard can be obtained online at
4997 \%http://www.opengroup.org/unix/online.html\ .
4998 Redistribution of this material is permitted so long as this notice remains