Bump S-nail v14.9.1.ar ("Crested tit"), 2017-07-31
[s-mailx.git] / nail.1
blob476a4642874db264ca415ade0213280a0cac01d1
1 .\"@ nail.1 - S-nail(1) reference manual.
2 .\"
3 .\" Copyright (c) 2000-2008 Gunnar Ritter, Freiburg i. Br., Germany.
4 .\" Copyright (c) 2012 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
5 .\"
6 .\" Copyright (c) 1980, 1990, 1993
7 .\"      The Regents of the University of California.  All rights reserved.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
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. Neither the name of the University nor the names of its contributors
18 .\"    may be used to endorse or promote products derived from this software
19 .\"    without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .\"@ S-nail v14.9.1 / 2017-07-31
34 .Dd July 31, 2017
35 .ds VV \\%v14.9.1
36 .\"--MKMAN-START--
37 .ds UU \\%S-NAIL
38 .ds UA \\%S-nail
39 .ds uA \\%s-nail
40 .ds UR \\%s-nail.rc
41 .\"--MKMAN-END--
42 .ds ur \\%~/.mailrc
43 .ds OB [Obsolete]
44 .ds OP [Option]
45 .ds IN [v15-compat]
46 .ds OU [no v15-compat]
47 .ds ID [v15 behaviour may differ]
48 .ds NQ [Only new quoting rules]
49 .ds BO (Boolean)
50 .ds RO (Read-only)
51 .Dt "\*(UU" 1
52 .Os
53 .\" Uncomment for mandoc(1) compat.:
54 .\".ds mx-toc-name TABLE OF CONTENTS
55 .Mx -enable -preprocessed
56 .Mx -anchor-spass Sh "NAME" 1
57 .Mx -anchor-spass Sh "SYNOPSIS" 2
58 .Mx -anchor-spass Sh "\*[mx-toc-name]" 3
59 .Mx -anchor-spass Sh "DESCRIPTION" 4
60 .Mx -anchor-spass Ss "Options" 4
61 .Mx -anchor-spass Ss "A starter" 4
62 .Mx -anchor-spass Ss "On sending mail, and non-interactive mode" 4
63 .Mx -anchor-spass Ss "On reading mail, and interactive mode" 4
64 .Mx -anchor-spass Ss "HTML mail and MIME attachments" 4
65 .Mx -anchor-spass Ss "Mailing lists" 4
66 .Mx -anchor-spass Ss "Signed and encrypted messages with S/MIME" 4
67 .Mx -anchor-spass Ss "On URL syntax and credential lookup" 4
68 .Mx -anchor-spass Ss "Character sets" 4
69 .Mx -anchor-spass Ss "Message states" 4
70 .Mx -anchor-spass Ss "Specifying messages" 4
71 .Mx -anchor-spass Ss "On terminal control and line editor" 4
72 .Mx -anchor-spass Ss "Coloured display" 4
73 .Mx -anchor-spass Ss "Handling spam" 4
74 .Mx -anchor-spass Sh "COMMANDS" 5
75 .Mx -anchor-spass Ss "Command modifiers" 5
76 .Mx -anchor-spass Ss "Message list arguments" 5
77 .Mx -anchor-spass Ss "Old-style argument quoting" 5
78 .Mx -anchor-spass Ss "Shell-style argument quoting" 5
79 .Mx -anchor-spass Ss "Raw data arguments for codec commands" 5
80 .Mx -anchor-spass Ss "Filename transformations" 5
81 .Mx -anchor-spass Ss "Commands" 5
82 .Mx -anchor-spass Sh "COMMAND ESCAPES" 6
83 .Mx -anchor-spass Sh "INTERNAL VARIABLES" 7
84 .Mx -anchor-spass Ss "Initial settings" 7
85 .Mx -anchor-spass Ss "Variables" 7
86 .Mx -anchor-spass Sh "ENVIRONMENT" 8
87 .Mx -anchor-spass Sh "FILES" 9
88 .Mx -anchor-spass Ss "Resource files" 9
89 .Mx -anchor-spass Ss "The mime.types files" 9
90 .Mx -anchor-spass Ss "The Mailcap files" 9
91 .Mx -anchor-spass Ss "The .netrc file" 9
92 .Mx -anchor-spass Sh "EXAMPLES" 10
93 .Mx -anchor-spass Ss "An example configuration" 10
94 .Mx -anchor-spass Ss "S/MIME step by step" 10
95 .Mx -anchor-spass Ss "Using CRLs with S/MIME or SSL/TLS" 10
96 .Mx -anchor-spass Sh "FAQ" 11
97 .Mx -anchor-spass Ss "\*(UA shortly hangs on startup" 11
98 .Mx -anchor-spass Ss "I cannot login to Google mail aka GMail" 11
99 .Mx -anchor-spass Ss "Not \(dqdefunctional\(dq, but the editor key does not work" 11
100 .Mx -anchor-spass Sh "IMAP CLIENT" 12
101 .Mx -anchor-spass Sh "SEE ALSO" 13
102 .Mx -anchor-spass Sh "HISTORY" 14
103 .Mx -anchor-spass Sh "AUTHORS" 15
104 .Mx -anchor-spass Sh "CAVEATS" 16
105 .Mx -anchor-spass Sh "BUGS" 17
106 .Mx -anchor-spass Fl ":"
107 .Mx -anchor-spass Fl "A"
108 .Mx -anchor-spass Fl "a"
109 .Mx -anchor-spass ixsx "character set specification"
110 .Mx -anchor-spass Fl "b"
111 .Mx -anchor-spass Fl "c"
112 .Mx -anchor-spass Fl "d"
113 .Mx -anchor-spass Fl "E"
114 .Mx -anchor-spass Fl "e"
115 .Mx -anchor-spass Fl "F"
116 .Mx -anchor-spass Fl "f"
117 .Mx -anchor-spass Fl "H"
118 .Mx -anchor-spass Fl "h"
119 .Mx -anchor-spass Fl "i"
120 .Mx -anchor-spass Fl "L"
121 .Mx -anchor-spass Fl "M"
122 .Mx -anchor-spass Fl "m"
123 .Mx -anchor-spass Fl "N"
124 .Mx -anchor-spass Fl "n"
125 .Mx -anchor-spass Fl "q"
126 .Mx -anchor-spass Fl "R"
127 .Mx -anchor-spass Fl "r"
128 .Mx -anchor-spass Fl "S"
129 .Mx -anchor-spass Fl "s"
130 .Mx -anchor-spass Fl "t"
131 .Mx -anchor-spass Fl "u"
132 .Mx -anchor-spass Fl "V"
133 .Mx -anchor-spass Fl "v"
134 .Mx -anchor-spass Fl "X"
135 .Mx -anchor-spass Fl "~"
136 .Mx -anchor-spass Fl "#"
137 .Mx -anchor-spass Fl "."
138 .Mx -anchor-spass Cd "mle-go-home"
139 .Mx -anchor-spass Cd "mle-go-bwd"
140 .Mx -anchor-spass Cd "mle-del-fwd"
141 .Mx -anchor-spass Cd "mle-go-end"
142 .Mx -anchor-spass Cd "mle-go-fwd"
143 .Mx -anchor-spass Cd "mle-reset"
144 .Mx -anchor-spass Cd "mle-del-bwd"
145 .Mx -anchor-spass Cd "mle-complete"
146 .Mx -anchor-spass Cd "mle-commit"
147 .Mx -anchor-spass Cd "mle-snarf-end"
148 .Mx -anchor-spass Cd "mle-repaint"
149 .Mx -anchor-spass Cd "mle-hist-fwd"
150 .Mx -anchor-spass Cd "mle-hist-bwd"
151 .Mx -anchor-spass Cd "mle-quote-rndtrip"
152 .Mx -anchor-spass Cd "mle-hist-srch-bwd"
153 .Mx -anchor-spass Cd "mle-hist-srch-fwd"
154 .Mx -anchor-spass Cd "mle-paste"
155 .Mx -anchor-spass Cd "mle-snarf-line"
156 .Mx -anchor-spass Cd "mle-prompt-char"
157 .Mx -anchor-spass Cd "mle-snarf-word-bwd"
158 .Mx -anchor-spass Cd "mle-go-word-fwd"
159 .Mx -anchor-spass Cd "mle-go-word-bwd"
160 .Mx -anchor-spass Cd "mle-cancel"
161 .Mx -anchor-spass Cd "mle-snarf-word-fwd"
162 .Mx -anchor-spass Cd "mle-fullreset"
163 .Mx -anchor-spass Cd "mle-bell"
164 .Mx -anchor-spass Cm "\e"
165 .Mx -anchor-spass Cm "ignerr"
166 .Mx -anchor-spass Cm "vput"
167 .Mx -anchor-spass Cm "wysh"
168 .Mx -anchor-spass ixsx "primary system mailbox"
169 .Mx -anchor-spass ixsx "secondary mailbox"
170 .Mx -anchor-spass Ic "!"
171 .Mx -anchor-spass Ic "#"
172 .Mx -anchor-spass Ic "+"
173 .Mx -anchor-spass Ic "-"
174 .Mx -anchor-spass Ic "="
175 .Mx -anchor-spass Ic "?"
176 .Mx -anchor-spass Ic "|"
177 .Mx -anchor-spass Ic "account"
178 .Mx -anchor-spass Ic "unaccount"
179 .Mx -anchor-spass Ic "addrcodec"
180 .Mx -anchor-spass Ic "alias"
181 .Mx -anchor-spass Ic "unalias"
182 .Mx -anchor-spass Ic "alternates"
183 .Mx -anchor-spass Ic "unalternates"
184 .Mx -anchor-spass Ic "answered"
185 .Mx -anchor-spass Ic "unanswered"
186 .Mx -anchor-spass Ic "bind"
187 .Mx -anchor-spass Ic "unbind"
188 .Mx -anchor-spass Ic "call"
189 .Mx -anchor-spass Ic "call_if"
190 .Mx -anchor-spass Ic "cd"
191 .Mx -anchor-spass Ic "certsave"
192 .Mx -anchor-spass Ic "charsetalias"
193 .Mx -anchor-spass Ic "uncharsetalias"
194 .Mx -anchor-spass Ic "chdir"
195 .Mx -anchor-spass Ic "collapse"
196 .Mx -anchor-spass Ic "uncollapse"
197 .Mx -anchor-spass Ic "colour"
198 .Mx -anchor-spass Ic "uncolour"
199 .Mx -anchor-spass Ic "commandalias"
200 .Mx -anchor-spass Ic "uncommandalias"
201 .Mx -anchor-spass Ic "Copy"
202 .Mx -anchor-spass Ic "copy"
203 .Mx -anchor-spass Ic "cwd"
204 .Mx -anchor-spass Ic "Decrypt"
205 .Mx -anchor-spass Ic "decrypt"
206 .Mx -anchor-spass Ic "define"
207 .Mx -anchor-spass Ic "undefine"
208 .Mx -anchor-spass Ic "delete"
209 .Mx -anchor-spass Ic "undelete"
210 .Mx -anchor-spass Ic "discard"
211 .Mx -anchor-spass Ic "dp"
212 .Mx -anchor-spass Ic "dt"
213 .Mx -anchor-spass Ic "dotmove"
214 .Mx -anchor-spass Ic "draft"
215 .Mx -anchor-spass Ic "undraft"
216 .Mx -anchor-spass Ic "echo"
217 .Mx -anchor-spass Ic "echoerr"
218 .Mx -anchor-spass Ic "echon"
219 .Mx -anchor-spass Ic "echoerrn"
220 .Mx -anchor-spass Ic "edit"
221 .Mx -anchor-spass Ic "elif"
222 .Mx -anchor-spass Ic "else"
223 .Mx -anchor-spass Ic "endif"
224 .Mx -anchor-spass Ic "environ"
225 .Mx -anchor-spass Ic "errors"
226 .Mx -anchor-spass Ic "eval"
227 .Mx -anchor-spass Ic "exit"
228 .Mx -anchor-spass Ic "File"
229 .Mx -anchor-spass Ic "file"
230 .Mx -anchor-spass Ic "filetype"
231 .Mx -anchor-spass Ic "unfiletype"
232 .Mx -anchor-spass Ic "flag"
233 .Mx -anchor-spass Ic "unflag"
234 .Mx -anchor-spass Ic "folder"
235 .Mx -anchor-spass Ic "folders"
236 .Mx -anchor-spass Ic "Followup"
237 .Mx -anchor-spass Ic "followup"
238 .Mx -anchor-spass Ic "followupall"
239 .Mx -anchor-spass Ic "followupsender"
240 .Mx -anchor-spass Ic "Forward"
241 .Mx -anchor-spass Ic "forward"
242 .Mx -anchor-spass Ic "from"
243 .Mx -anchor-spass Ic "headerpick"
244 .Mx -anchor-spass Ic "unheaderpick"
245 .Mx -anchor-spass Ic "headers"
246 .Mx -anchor-spass Ic "help"
247 .Mx -anchor-spass Ic "history"
248 .Mx -anchor-spass Ic "hold"
249 .Mx -anchor-spass Ic "if"
250 .Mx -anchor-spass Ic "ignore"
251 .Mx -anchor-spass Ic "list"
252 .Mx -anchor-spass Ic "localopts"
253 .Mx -anchor-spass Ic "Lreply"
254 .Mx -anchor-spass Ic "Mail"
255 .Mx -anchor-spass Ic "mail"
256 .Mx -anchor-spass Ic "mbox"
257 .Mx -anchor-spass Ic "mimetype"
258 .Mx -anchor-spass Ic "unmimetype"
259 .Mx -anchor-spass Ic "mlist"
260 .Mx -anchor-spass Ic "unmlist"
261 .Mx -anchor-spass Ic "mimeview"
262 .Mx -anchor-spass Ic "mlsubscribe"
263 .Mx -anchor-spass Ic "unmlsubscribe"
264 .Mx -anchor-spass Ic "Move"
265 .Mx -anchor-spass Ic "move"
266 .Mx -anchor-spass Ic "More"
267 .Mx -anchor-spass Ic "more"
268 .Mx -anchor-spass Ic "netrc"
269 .Mx -anchor-spass Ic "newmail"
270 .Mx -anchor-spass Ic "next"
271 .Mx -anchor-spass Ic "New"
272 .Mx -anchor-spass Ic "new"
273 .Mx -anchor-spass Ic "noop"
274 .Mx -anchor-spass Ic "Page"
275 .Mx -anchor-spass Ic "page"
276 .Mx -anchor-spass Ic "Pipe"
277 .Mx -anchor-spass Ic "pipe"
278 .Mx -anchor-spass Ic "preserve"
279 .Mx -anchor-spass Ic "Print"
280 .Mx -anchor-spass Ic "print"
281 .Mx -anchor-spass Ic "quit"
282 .Mx -anchor-spass Ic "read"
283 .Mx -anchor-spass Ic "readctl"
284 .Mx -anchor-spass Ic "remove"
285 .Mx -anchor-spass Ic "rename"
286 .Mx -anchor-spass Ic "Reply"
287 .Mx -anchor-spass Ic "reply"
288 .Mx -anchor-spass Ic "replyall"
289 .Mx -anchor-spass Ic "replysender"
290 .Mx -anchor-spass Ic "Resend"
291 .Mx -anchor-spass Ic "resend"
292 .Mx -anchor-spass Ic "Respond"
293 .Mx -anchor-spass Ic "respond"
294 .Mx -anchor-spass Ic "respondall"
295 .Mx -anchor-spass Ic "respondsender"
296 .Mx -anchor-spass Ic "retain"
297 .Mx -anchor-spass Ic "return"
298 .Mx -anchor-spass Ic "Save"
299 .Mx -anchor-spass Ic "save"
300 .Mx -anchor-spass Ic "search"
301 .Mx -anchor-spass Ic "seen"
302 .Mx -anchor-spass Ic "set"
303 .Mx -anchor-spass Ic "unset"
304 .Mx -anchor-spass Ic "shcodec"
305 .Mx -anchor-spass Ic "shell"
306 .Mx -anchor-spass Ic "shortcut"
307 .Mx -anchor-spass Ic "unshortcut"
308 .Mx -anchor-spass Ic "shift"
309 .Mx -anchor-spass Ic "show"
310 .Mx -anchor-spass Ic "size"
311 .Mx -anchor-spass Ic "sleep"
312 .Mx -anchor-spass Ic "sort"
313 .Mx -anchor-spass Ic "unsort"
314 .Mx -anchor-spass Ic "source"
315 .Mx -anchor-spass Ic "source_if"
316 .Mx -anchor-spass Ic "spamclear"
317 .Mx -anchor-spass Ic "spamforget"
318 .Mx -anchor-spass Ic "spamham"
319 .Mx -anchor-spass Ic "spamrate"
320 .Mx -anchor-spass Ic "spamset"
321 .Mx -anchor-spass Ic "spamspam"
322 .Mx -anchor-spass Ic "Top"
323 .Mx -anchor-spass Ic "top"
324 .Mx -anchor-spass Ic "touch"
325 .Mx -anchor-spass Ic "Type"
326 .Mx -anchor-spass Ic "type"
327 .Mx -anchor-spass Ic "unignore"
328 .Mx -anchor-spass Ic "Unread"
329 .Mx -anchor-spass Ic "unread"
330 .Mx -anchor-spass Ic "unretain"
331 .Mx -anchor-spass Ic "urlcodec"
332 .Mx -anchor-spass Ic "varedit"
333 .Mx -anchor-spass Ic "varshow"
334 .Mx -anchor-spass Ic "verify"
335 .Mx -anchor-spass Ic "version"
336 .Mx -anchor-spass Ic "vexpr"
337 .Mx -anchor-spass Ic "vpospar"
338 .Mx -anchor-spass Ic "visual"
339 .Mx -anchor-spass Ic "write"
340 .Mx -anchor-spass Ic "xcall"
341 .Mx -anchor-spass Ic "xit"
342 .Mx -anchor-spass Ic "z"
343 .Mx -anchor-spass Ic "Z"
344 .Mx -anchor-spass Ic "~~"
345 .Mx -anchor-spass Ic "~!"
346 .Mx -anchor-spass Ic "~."
347 .Mx -anchor-spass Ic "~:"
348 .Mx -anchor-spass Ic "~?"
349 .Mx -anchor-spass Ic "~<"
350 .Mx -anchor-spass Ic "~<!"
351 .Mx -anchor-spass Ic "~@"
352 .Mx -anchor-spass Ic "~A"
353 .Mx -anchor-spass Ic "~a"
354 .Mx -anchor-spass Ic "~b"
355 .Mx -anchor-spass Ic "~c"
356 .Mx -anchor-spass Ic "~d"
357 .Mx -anchor-spass Ic "~e"
358 .Mx -anchor-spass Ic "~F"
359 .Mx -anchor-spass Ic "~f"
360 .Mx -anchor-spass Ic "~H"
361 .Mx -anchor-spass Ic "~h"
362 .Mx -anchor-spass Ic "~I"
363 .Mx -anchor-spass Ic "~i"
364 .Mx -anchor-spass Ic "~M"
365 .Mx -anchor-spass Ic "~m"
366 .Mx -anchor-spass Ic "~p"
367 .Mx -anchor-spass Ic "~q"
368 .Mx -anchor-spass Ic "~R"
369 .Mx -anchor-spass Ic "~r"
370 .Mx -anchor-spass Ic "~s"
371 .Mx -anchor-spass Ic "~t"
372 .Mx -anchor-spass Ic "~U"
373 .Mx -anchor-spass Ic "~u"
374 .Mx -anchor-spass Ic "~v"
375 .Mx -anchor-spass Ic "~w"
376 .Mx -anchor-spass Ic "~x"
377 .Mx -anchor-spass Ic "~|"
378 .Mx -anchor-spass Ic "~^"
379 .Mx -anchor-spass Va "?"
380 .Mx -anchor-spass Va "!"
381 .Mx -anchor-spass Va "^"
382 .Mx -anchor-spass Va "^ERR"
383 .Mx -anchor-spass Va "^ERRDOC"
384 .Mx -anchor-spass Va "^ERRNAME"
385 .Mx -anchor-spass Va "*"
386 .Mx -anchor-spass Va "@"
387 .Mx -anchor-spass Va "#"
388 .Mx -anchor-spass Va "0"
389 .Mx -anchor-spass Va "1"
390 .Mx -anchor-spass Va "account"
391 .Mx -anchor-spass Va "add-file-recipients"
392 .Mx -anchor-spass Va "allnet"
393 .Mx -anchor-spass Va "append"
394 .Mx -anchor-spass Va "ask"
395 .Mx -anchor-spass Va "askatend"
396 .Mx -anchor-spass Va "askattach"
397 .Mx -anchor-spass Va "askcc"
398 .Mx -anchor-spass Va "askbcc"
399 .Mx -anchor-spass Va "asksign"
400 .Mx -anchor-spass Va "asksub"
401 .Mx -anchor-spass Va "attrlist"
402 .Mx -anchor-spass Va "autobcc"
403 .Mx -anchor-spass Va "autocc"
404 .Mx -anchor-spass Va "autocollapse"
405 .Mx -anchor-spass Va "autoprint"
406 .Mx -anchor-spass Va "autosort"
407 .Mx -anchor-spass Va "bang"
408 .Mx -anchor-spass Va "bind-timeout"
409 .Mx -anchor-spass Va "bsdcompat"
410 .Mx -anchor-spass Va "bsdflags"
411 .Mx -anchor-spass Va "bsdheadline"
412 .Mx -anchor-spass Va "bsdmsgs"
413 .Mx -anchor-spass Va "bsdorder"
414 .Mx -anchor-spass Va "build-os"
415 .Mx -anchor-spass Va "build-osenv"
416 .Mx -anchor-spass Va "charset-7bit"
417 .Mx -anchor-spass Va "charset-8bit"
418 .Mx -anchor-spass Va "charset-unknown-8bit"
419 .Mx -anchor-spass Va "cmd"
420 .Mx -anchor-spass Va "colour-disable"
421 .Mx -anchor-spass Va "colour-pager"
422 .Mx -anchor-spass Va "contact-mail"
423 .Mx -anchor-spass Va "contact-web"
424 .Mx -anchor-spass Va "crt"
425 .Mx -anchor-spass Va "customhdr"
426 .Mx -anchor-spass Va "datefield"
427 .Mx -anchor-spass Va "datefield-markout-older"
428 .Mx -anchor-spass Va "debug"
429 .Mx -anchor-spass Va "disposition-notification-send"
430 .Mx -anchor-spass Va "dot"
431 .Mx -anchor-spass Va "dotlock-ignore-error"
432 .Mx -anchor-spass Va "editalong"
433 .Mx -anchor-spass Va "editheaders"
434 .Mx -anchor-spass Va "emptystart"
435 .Mx -anchor-spass Va "errexit"
436 .Mx -anchor-spass Va "escape"
437 .Mx -anchor-spass Va "expandaddr"
438 .Mx -anchor-spass Va "expandargv"
439 .Mx -anchor-spass Va "features"
440 .Mx -anchor-spass Va "flipr"
441 .Mx -anchor-spass Va "folder"
442 .Mx -anchor-spass Va "folder-hook"
443 .Mx -anchor-spass Va "folder-hook-FOLDER"
444 .Mx -anchor-spass Va "folder-resolved"
445 .Mx -anchor-spass Va "followup-to"
446 .Mx -anchor-spass Va "followup-to-honour"
447 .Mx -anchor-spass Va "forward-as-attachment"
448 .Mx -anchor-spass Va "forward-inject-head"
449 .Mx -anchor-spass Va "from"
450 .Mx -anchor-spass Va "fullnames"
451 .Mx -anchor-spass Va "header"
452 .Mx -anchor-spass Va "headline"
453 .Mx -anchor-spass Va "headline-bidi"
454 .Mx -anchor-spass Va "history-file"
455 .Mx -anchor-spass Va "history-gabby"
456 .Mx -anchor-spass Va "history-gabby-persist"
457 .Mx -anchor-spass Va "history-size"
458 .Mx -anchor-spass Va "hold"
459 .Mx -anchor-spass Va "hostname"
460 .Mx -anchor-spass Va "idna-disable"
461 .Mx -anchor-spass Va "ifs"
462 .Mx -anchor-spass Va "ifs-ws"
463 .Mx -anchor-spass Va "ignore"
464 .Mx -anchor-spass Va "ignoreeof"
465 .Mx -anchor-spass Va "inbox"
466 .Mx -anchor-spass Va "indentprefix"
467 .Mx -anchor-spass Va "keep"
468 .Mx -anchor-spass Va "keep-content-length"
469 .Mx -anchor-spass Va "keepsave"
470 .Mx -anchor-spass Va "line-editor-disable"
471 .Mx -anchor-spass Va "line-editor-no-defaults"
472 .Mx -anchor-spass Va "log-prefix"
473 .Mx -anchor-spass Va "mailbox-display"
474 .Mx -anchor-spass Va "mailbox-resolved"
475 .Mx -anchor-spass Va "mailx-extra-rc"
476 .Mx -anchor-spass Va "markanswered"
477 .Mx -anchor-spass Va "mbox-rfc4155"
478 .Mx -anchor-spass Va "memdebug"
479 .Mx -anchor-spass Va "message-id-disable"
480 .Mx -anchor-spass Va "message-inject-head"
481 .Mx -anchor-spass Va "message-inject-tail"
482 .Mx -anchor-spass Va "metoo"
483 .Mx -anchor-spass Va "mime-allow-text-controls"
484 .Mx -anchor-spass Va "mime-alternative-favour-rich"
485 .Mx -anchor-spass Va "mime-counter-evidence"
486 .Mx -anchor-spass Va "mime-encoding"
487 .Mx -anchor-spass Va "mimetypes-load-control"
488 .Mx -anchor-spass Va "mta"
489 .Mx -anchor-spass Va "mta-arguments"
490 .Mx -anchor-spass Va "mta-no-default-arguments"
491 .Mx -anchor-spass Va "mta-argv0"
492 .Mx -anchor-spass Va "netrc-lookup"
493 .Mx -anchor-spass Va "netrc-pipe"
494 .Mx -anchor-spass Va "newfolders"
495 .Mx -anchor-spass Va "newmail"
496 .Mx -anchor-spass Va "outfolder"
497 .Mx -anchor-spass Va "on-compose-cleanup"
498 .Mx -anchor-spass Va "on-compose-enter"
499 .Mx -anchor-spass Va "on-compose-leave"
500 .Mx -anchor-spass Va "on-compose-splice"
501 .Mx -anchor-spass Va "on-compose-splice-shell"
502 .Mx -anchor-spass Va "on-resend-cleanup"
503 .Mx -anchor-spass Va "on-resend-enter"
504 .Mx -anchor-spass Va "page"
505 .Mx -anchor-spass Va "password"
506 .Mx -anchor-spass Va "piperaw"
507 .Mx -anchor-spass Va "pipe-TYPE/SUBTYPE"
508 .Mx -anchor-spass Ev "MAILX_CONTENT"
509 .Mx -anchor-spass Ev "MAILX_CONTENT_EVIDENCE"
510 .Mx -anchor-spass Ev "MAILX_FILENAME"
511 .Mx -anchor-spass Ev "MAILX_FILENAME_GENERATED"
512 .Mx -anchor-spass Ev "MAILX_FILENAME_TEMPORARY"
513 .Mx -anchor-spass Va "pipe-EXTENSION"
514 .Mx -anchor-spass Va "pop3-auth"
515 .Mx -anchor-spass Va "pop3-bulk-load"
516 .Mx -anchor-spass Va "pop3-keepalive"
517 .Mx -anchor-spass Va "pop3-no-apop"
518 .Mx -anchor-spass Va "pop3-no-apop-HOST"
519 .Mx -anchor-spass Va "pop3-use-starttls"
520 .Mx -anchor-spass Va "posix"
521 .Mx -anchor-spass Va "print-alternatives"
522 .Mx -anchor-spass Va "prompt"
523 .Mx -anchor-spass Va "prompt2"
524 .Mx -anchor-spass Va "quiet"
525 .Mx -anchor-spass Va "quote"
526 .Mx -anchor-spass Va "quote-as-attachment"
527 .Mx -anchor-spass Va "quote-fold"
528 .Mx -anchor-spass Va "r-option-implicit"
529 .Mx -anchor-spass Va "recipients-in-cc"
530 .Mx -anchor-spass Va "record"
531 .Mx -anchor-spass Va "record-files"
532 .Mx -anchor-spass Va "record-resent"
533 .Mx -anchor-spass Va "reply-in-same-charset"
534 .Mx -anchor-spass Va "reply-strings"
535 .Mx -anchor-spass Va "replyto"
536 .Mx -anchor-spass Va "reply-to-honour"
537 .Mx -anchor-spass Va "rfc822-body-from_"
538 .Mx -anchor-spass Va "save"
539 .Mx -anchor-spass Va "screen"
540 .Mx -anchor-spass Va "searchheaders"
541 .Mx -anchor-spass Va "sendcharsets"
542 .Mx -anchor-spass Va "sendcharsets-else-ttycharset"
543 .Mx -anchor-spass Va "sender"
544 .Mx -anchor-spass Va "sendwait"
545 .Mx -anchor-spass Va "showlast"
546 .Mx -anchor-spass Va "showname"
547 .Mx -anchor-spass Va "showto"
548 .Mx -anchor-spass Va "Sign"
549 .Mx -anchor-spass Va "sign"
550 .Mx -anchor-spass Va "signature"
551 .Mx -anchor-spass Va "skipemptybody"
552 .Mx -anchor-spass Va "smime-ca-dir"
553 .Mx -anchor-spass Va "smime-ca-file"
554 .Mx -anchor-spass Va "smime-ca-flags"
555 .Mx -anchor-spass Va "smime-ca-no-defaults"
556 .Mx -anchor-spass Va "smime-cipher"
557 .Mx -anchor-spass Va "smime-crl-dir"
558 .Mx -anchor-spass Va "smime-crl-file"
559 .Mx -anchor-spass Va "smime-encrypt-USER@HOST"
560 .Mx -anchor-spass Va "smime-force-encryption"
561 .Mx -anchor-spass Va "smime-sign"
562 .Mx -anchor-spass Va "smime-sign-cert"
563 .Mx -anchor-spass Va "smime-sign-include-certs"
564 .Mx -anchor-spass Va "smime-sign-message-digest"
565 .Mx -anchor-spass Va "smtp-auth"
566 .Mx -anchor-spass Va "smtp-hostname"
567 .Mx -anchor-spass Va "smtp-use-starttls"
568 .Mx -anchor-spass Va "socks-proxy"
569 .Mx -anchor-spass Va "spam-interface"
570 .Mx -anchor-spass Va "spam-maxsize"
571 .Mx -anchor-spass Va "spamc-command"
572 .Mx -anchor-spass Va "spamc-arguments"
573 .Mx -anchor-spass Va "spamc-user"
574 .Mx -anchor-spass Va "spamfilter-ham"
575 .Mx -anchor-spass Va "spamfilter-noham"
576 .Mx -anchor-spass Va "spamfilter-nospam"
577 .Mx -anchor-spass Va "spamfilter-rate"
578 .Mx -anchor-spass Va "spamfilter-spam"
579 .Mx -anchor-spass Va "spamfilter-rate-scanscore"
580 .Mx -anchor-spass Va "ssl-ca-dir"
581 .Mx -anchor-spass Va "ssl-ca-file"
582 .Mx -anchor-spass Va "ssl-ca-flags"
583 .Mx -anchor-spass Va "ssl-ca-no-defaults"
584 .Mx -anchor-spass Va "ssl-cert"
585 .Mx -anchor-spass Va "ssl-cipher-list"
586 .Mx -anchor-spass Va "ssl-config-file"
587 .Mx -anchor-spass Va "ssl-curves"
588 .Mx -anchor-spass Va "ssl-crl-dir"
589 .Mx -anchor-spass Va "ssl-crl-file"
590 .Mx -anchor-spass Va "ssl-key"
591 .Mx -anchor-spass Va "ssl-protocol"
592 .Mx -anchor-spass Va "ssl-rand-egd"
593 .Mx -anchor-spass Va "ssl-rand-file"
594 .Mx -anchor-spass Va "ssl-verify"
595 .Mx -anchor-spass Va "stealthmua"
596 .Mx -anchor-spass Va "termcap"
597 .Mx -anchor-spass Va "termcap-ca-mode"
598 .Mx -anchor-spass Va "termcap-disable"
599 .Mx -anchor-spass Va "toplines"
600 .Mx -anchor-spass Va "topsqueeze"
601 .Mx -anchor-spass Va "ttycharset"
602 .Mx -anchor-spass Va "typescript-mode"
603 .Mx -anchor-spass Va "umask"
604 .Mx -anchor-spass Va "user"
605 .Mx -anchor-spass Va "v15-compat"
606 .Mx -anchor-spass Va "verbose"
607 .Mx -anchor-spass Va "version"
608 .Mx -anchor-spass Va "version-date"
609 .Mx -anchor-spass Va "version-major"
610 .Mx -anchor-spass Va "version-minor"
611 .Mx -anchor-spass Va "version-update"
612 .Mx -anchor-spass Va "writebackedited"
613 .Mx -anchor-spass Ev "COLUMNS"
614 .Mx -anchor-spass Ev "DEAD"
615 .Mx -anchor-spass Ev "EDITOR"
616 .Mx -anchor-spass Ev "HOME"
617 .Mx -anchor-spass Ev "LC_ALL"
618 .Mx -anchor-spass Ev "LC_CTYPE"
619 .Mx -anchor-spass Ev "LANG"
620 .Mx -anchor-spass Ev "LINES"
621 .Mx -anchor-spass Ev "LISTER"
622 .Mx -anchor-spass Ev "LOGNAME"
623 .Mx -anchor-spass Ev "MAIL"
624 .Mx -anchor-spass Ev "MAILCAPS"
625 .Mx -anchor-spass Ev "MAILRC"
626 .Mx -anchor-spass Ev "MAILX_NO_SYSTEM_RC"
627 .Mx -anchor-spass Ev "MBOX"
628 .Mx -anchor-spass Ev "NETRC"
629 .Mx -anchor-spass Ev "PAGER"
630 .Mx -anchor-spass Ev "PATH"
631 .Mx -anchor-spass Ev "POSIXLY_CORRECT"
632 .Mx -anchor-spass Ev "SHELL"
633 .Mx -anchor-spass Ev "SOURCE_DATE_EPOCH"
634 .Mx -anchor-spass Ev "TERM"
635 .Mx -anchor-spass Ev "TMPDIR"
636 .Mx -anchor-spass Ev "USER"
637 .Mx -anchor-spass Ev "VISUAL"
638 .Mx -anchor-spass Pa "~/.mailcap"
639 .Mx -anchor-spass Pa "/etc/mailcap"
640 .Mx -anchor-spass Pa "~/mbox"
641 .Mx -anchor-spass Pa "~/.mime.types"
642 .Mx -anchor-spass Pa "/etc/mime.types"
643 .Mx -anchor-spass Pa "~/.netrc"
644 .Mx -anchor-spass Pa "/dev/null"
645 .Mx -anchor-spass Pa "\*(UR"
646 .Mx -anchor-spass Pa "\*(ur"
647 .Mx -anchor-spass Cd "needsterminal"
648 .Mx -anchor-spass Cd "copiousoutput"
649 .Mx -anchor-spass Cd "x-mailx-even-if-not-interactive"
650 .Mx -anchor-spass Cd "x-mailx-noquote"
651 .Mx -anchor-spass Cd "x-mailx-async"
652 .Mx -anchor-spass Cd "x-mailx-test-once"
653 .Mx -anchor-spass Cd "x-mailx-tmpfile"
654 .Mx -anchor-spass Cd "x-mailx-tmpfile-fill"
655 .Mx -anchor-spass Cd "x-mailx-tmpfile-unlink"
656 .Mx -anchor-spass Cd "x-mailx-tmpfile-keep"
657 .Mx -anchor-spass Ic "cache"
658 .Mx -anchor-spass Ic "connect"
659 .Mx -anchor-spass Ic "disconnect"
660 .Mx -anchor-spass Ic "imap"
661 .Mx -anchor-spass Ic "imapcodec"
662 .Mx -anchor-spass Va "disconnected"
663 .Mx -anchor-spass Va "imap-auth"
664 .Mx -anchor-spass Va "imap-cache"
665 .Mx -anchor-spass Va "imap-delim"
666 .Mx -anchor-spass Va "imap-keepalive"
667 .Mx -anchor-spass Va "imap-list-depth"
668 .Mx -anchor-spass Va "imap-use-starttls"
669 .Sh NAME
670 .Nm \*(UA \%[\*(VV]
671 .Nd send and receive Internet mail
672 .Sh SYNOPSIS
673 .Nm \*(uA
674 .Fl h | Fl Fl help
676 .Nm \*(uA
677 .Bk -words
678 .Op Fl BdEFinv~#
679 .Op Fl \&: Ar spec
680 .Op Fl A Ar account
681 .Op : Ns Fl a Ar attachment Ns \&:
682 .Op : Ns Fl b Ar bcc-addr Ns \&:
683 .Op : Ns Fl c Ar cc-addr Ns \&:
684 .Op Fl M Ar type | Fl m Ar file | Fl q Ar file | Fl t
685 .Op Fl r Ar from-addr
686 .Oo : Ns
687 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
688 .Pf \&: Oc
689 .Op Fl s Ar subject
690 .Op : Ns Fl X Ar cmd Ns \&:
691 .Op Fl \&.
692 .Pf : Ar to-addr Ns \&:
693 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
696 .Nm \*(uA
697 .Bk -words
698 .Op Fl BdEeHiNnRv~#
699 .Op Fl \&: Ar spec
700 .Op Fl A Ar account
701 .Op Fl L Ar spec
702 .Op Fl r Ar from-addr
703 .Oo : Ns
704 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
705 .Pf \&: Oc
706 .Op Fl u Ar user
707 .Op : Ns Fl X Ar cmd Ns \&:
708 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
710 .Nm \*(uA
711 .Bk -words
712 .Op Fl BdEeHiNnRv~#
713 .Op Fl \&: Ar spec
714 .Op Fl A Ar account
715 .Fl f
716 .Op Fl L Ar spec
717 .Op Fl r Ar from-addr
718 .Oo : Ns
719 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
720 .Pf \&: Oc
721 .Op : Ns Fl X Ar cmd Ns \&:
722 .Op Ar file
723 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
725 .Mx -toc -tree html pdf ps xhtml
726 .Sh DESCRIPTION
727 .Bd -filled -compact -offset indent
728 .Sy Compatibility note:
729 S-nail (\*(UA) will wrap up into \%S-mailx in v15.0 (circa 2019).
730 Backward incompatibility has to be expected \(en
731 .Sx COMMANDS
732 will use
733 .Sx "Shell-style argument quoting"
734 rules, for example, and shell metacharacters will become meaningful.
735 New and old behaviour is flagged \*(IN and \*(OU, and setting
736 .Va v15-compat ,
737 one of the many
738 .Sx "INTERNAL VARIABLES" ,
739 will choose new behaviour when applicable.
740 \*(OB flags what will vanish, and enabling
741 .Fl d
743 .Fl v
744 enables obsoletion warnings.
747 \*(UA provides a simple and friendly environment for sending and
748 receiving mail.
749 It is intended to provide the functionality of the POSIX
750 .Xr mailx 1
751 command, but is MIME capable and optionally offers extensions for
752 line editing, S/MIME, SMTP and POP3, among others.
753 \*(UA divides incoming mail into its constituent messages and allows
754 the user to deal with them in any order.
755 It offers many
756 .Sx COMMANDS
758 .Sx "INTERNAL VARIABLES"
759 for manipulating messages and sending mail.
760 It provides the user simple editing capabilities to ease the composition
761 of outgoing messages, and increasingly powerful and reliable
762 non-interactive scripting capabilities.
763 .Ss "Options"
764 .Bl -tag -width ".It Fl BaNg"
766 .It Fl \&: Ar spec
767 Explicitly control which of the
768 .Sx "Resource files"
769 shall be loaded: if the letter
770 .Ql s
771 is (case-insensitively) part of the
772 .Ar spec
773 then the system wide
774 .Pa \*(UR
775 is loaded, likewise the letter
776 .Ql u
777 controls loading of the user's personal
778 .Pa \*(ur
779 file, whereas the letters
780 .Ql -
782 .Ql /
783 explicitly forbid loading of any resource files.
784 This option should be used by scripts: to avoid environmental noise they
785 should
786 .Dq detach
787 from any configuration files and create a script-local environment,
788 explicitly setting any of the desired
789 .Sx "INTERNAL VARIABLES"
791 .Fl S .
792 This option overrides
793 .Fl n .
795 .It Fl A Ar account
796 Executes an
797 .Ic account
798 command for the given user email
799 .Ar account
800 after program startup is complete (all resource files are loaded, any
801 .Fl S
802 setting is being established; only
803 .Fl X
804 commands have not been evaluated yet).
805 Being a special incarnation of
806 .Ic define Ns d
807 macros for the purpose of bundling longer-lived
808 .Ic set Ns
809 tings, activating such an email account also switches to the accounts
810 .Mx -sx
811 .Sx "primary system mailbox"
812 (most likely the
813 .Va inbox ) .
815 .It Fl a Ar file Ns Op Ar =input-charset Ns Op Ar #output-charset
816 Attach
817 .Ar file
818 to the message (for compose mode opportunities refer to
819 .Ic ~@
821 .Ic ~^ ) .
822 .Sx "Filename transformations"
823 (also see
824 .Ic file )
825 will be performed, but shell word expansion is restricted to the tilde
826 .Ql ~ .
827 Shall
828 .Ar file
829 not be accessible but contain a
830 .Ql =
831 character, then anything before the
832 .Ql =
833 will be used as the filename, anything thereafter as a character set
834 specification.
836 If an input character set is specified,
837 .Mx -ix "character set specification"
838 but no output character set, then the given input character set is fixed
839 as-is, and no conversion will be applied;
840 giving the empty string or the special string hyphen-minus
841 .Ql -
842 will be treated as if
843 .Va ttycharset
844 has been specified (the default).
846 If an output character set has also been given then the conversion will
847 be performed exactly as specified and on-the-fly, not considering the
848 file's type and content.
849 As an exception, if the output character set is specified as the empty
850 string or hyphen-minus
851 .Ql - ,
852 then the default conversion algorithm (see
853 .Sx "Character sets" )
854 is applied (therefore no conversion is performed on-the-fly,
855 .Ar file
856 will be MIME-classified and its contents will be inspected first) \(em
857 without support for character set conversions
858 .Pf ( Va features
859 does not include the term
860 .Ql +iconv )
861 only this argument is supported.
862 .It Fl B
863 (\*(OB: \*(UA will always use line-buffered output, to gain
864 line-buffered input even in batch mode enable batch mode via
865 .Fl # . )
867 .It Fl b Ar addr
868 Send a blind carbon copy to
869 .Ar addr Ns
870 ess, if the
871 .Ic set Ns
872 ting of
873 .Va expandaddr ,
874 one of the
875 .Sx "INTERNAL VARIABLES" ,
876 allows.
877 The option may be used multiple times.
878 Also see the section
879 .Sx "On sending mail, and non-interactive mode" .
881 .It Fl c Ar addr
882 Send carbon copies to the given receiver, if so allowed by
883 .Va expandaddr .
884 May be used multiple times.
886 .It Fl d
887 .Ic set
888 the internal variable
889 .Va debug
890 which enables debug messages and disables message delivery,
891 among others; effectively turns almost any operation into a dry-run.
893 .It Fl E
894 .Ic set
895 .Va skipemptybody
896 and thus discard messages with an empty message part body.
897 This command line option is \*(OB.
899 .It Fl e
900 Just check if mail is present (in the system
901 .Va inbox
902 or the one specified via
903 .Fl f ) :
904 if yes, return an exit status of zero, a non-zero value otherwise.
905 To restrict the set of mails to consider in this evaluation a message
906 specification can be added with the option
907 .Fl L .
909 .It Fl F
910 Save the message to send in a file named after the local part of the
911 first recipient's address (instead of in
912 .Va record Ns ).
914 .It Fl f
915 Read in the contents of the user's
916 .Mx -sx
917 .Sx "secondary mailbox"
918 .Ev MBOX
919 (or the specified file) for processing;
920 when \*(UA is quit, it writes undeleted messages back to this file
921 (but be aware of the
922 .Va hold
923 option).
924 The optional
925 .Ar file
926 argument will undergo some special
927 .Sx "Filename transformations"
928 (also see
929 .Ic file ) .
930 Note that
931 .Ar file
932 is not an argument to the flag
933 .Fl \&\&f ,
934 but is instead taken from the command line after option processing has
935 been completed.
936 In order to use a
937 .Ar file
938 that starts with a hyphen-minus, prefix with a relative path, as in
939 .Ql ./-hyphenbox.mbox .
941 .It Fl H
942 Display a summary of
943 .Ic headers
944 and exit; a configurable summary view is available via the
945 .Fl L
946 option.
948 .It Fl h
949 Show a short usage summary.
951 .It Fl i
952 .Ic set
953 .Va ignore
954 to ignore tty interrupt signals.
956 .It Fl L Ar spec
957 Display a summary of
958 .Ic headers
959 of all messages that match the given
960 .Ar spec ,
961 then exit.
962 See the section
963 .Sx "Specifying messages"
964 for the format of
965 .Ar spec .
966 If the
967 .Fl e
968 option has been given in addition no header summary is produced,
969 but \*(UA will instead indicate via its exit status whether
970 .Ar spec
971 matched any messages
972 .Pf ( Ql 0 )
973 or not
974 .Pf ( Ql 1 ) ;
975 note that any verbose output is suppressed in this mode and must instead
976 be enabled explicitly (e.g., by using the option
977 .Fl v ) .
979 .It Fl M Ar type
980 Special send mode that will flag standard input with the MIME
981 .Ql Content-Type:
982 set to the given
983 .Ar type
984 and use it as the main message body.
985 \*(ID Using this option will bypass processing of
986 .Va message-inject-head ,
987 .Va signature
989 .Va message-inject-tail .
990 Also see
991 .Fl q , m , t .
993 .It Fl m Ar file
994 Special send mode that will MIME classify the specified
995 .Ar file
996 and use it as the main message body.
997 \*(ID Using this option will bypass processing of
998 .Va message-inject-head ,
999 .Va signature
1001 .Va message-inject-tail .
1002 Also see
1003 .Fl q , M , t .
1005 .It Fl N
1006 inhibit the initial display of message headers when reading mail or
1007 editing a mailbox
1008 .Ic folder
1009 by calling
1010 .Ic unset
1011 for the internal variable
1012 .Va header .
1014 .It Fl n
1015 Standard flag that inhibits reading the system wide
1016 .Pa \*(UR
1017 upon startup.
1018 The option
1019 .Fl \&:
1020 allows more control over the startup sequence; also see
1021 .Sx "Resource files" .
1023 .It Fl q Ar file
1024 Special send mode that will initialize the message body with the
1025 contents of the specified
1026 .Ar file ,
1027 which may be standard input
1028 .Ql -
1029 only in non-interactive context.
1030 Also see
1031 .Fl M , m , t .
1033 .It Fl R
1034 Any mailbox
1035 .Ic folder
1036 opened will be in read-only mode.
1038 .It Fl r Ar from-addr
1039 Whereas the source address that appears in the
1040 .Va from
1041 header of a message (or in the
1042 .Va sender
1043 header if the former contains multiple addresses) is honoured by the
1044 builtin SMTP transport, it is not used by a file-based
1045 .Va mta
1046 (Mail-Transfer-Agent) for the RFC 5321 reverse-path used for relaying
1047 and delegating a message to its destination(s), for delivery errors
1048 etc., but it instead uses the local identity of the initiating user.
1050 When this command line option is used the given
1051 .Ar from-addr
1052 will be assigned to the internal variable
1053 .Va from ,
1054 but in addition the command line option
1055 .Fl \&\&f Ar from-addr
1056 will be passed to a file-based
1057 .Va mta
1058 whenever a message is sent.
1059 Shall
1060 .Ar from-addr
1061 include a user name the address components will be separated and
1062 the name part will be passed to a file-based
1063 .Va mta
1064 individually via
1065 .Fl \&\&F Ar name .
1067 If an empty string is passed as
1068 .Ar from-addr
1069 then the content of the variable
1070 .Va from
1071 (or, if that contains multiple addresses,
1072 .Va sender )
1073 will be evaluated and used for this purpose whenever the file-based
1074 .Va mta
1075 is contacted.
1076 By default, without
1077 .Fl \&\&r
1078 that is, neither
1079 .Fl \&\&f
1081 .Fl \&\&F
1082 command line options are used when contacting a file-based MTA, unless
1083 this automatic deduction is enforced by
1084 .Ic set Ns
1085 ing the internal variable
1086 .Va r-option-implicit .
1088 Remarks: many default installations and sites disallow overriding the
1089 local user identity like this unless either the MTA has been configured
1090 accordingly or the user is member of a group with special privileges.
1092 .It Fl S Ar var Ns Op = Ns value
1093 .Ic set
1094 the internal
1095 .Ar var Ns
1096 iable and, in case of a non-boolean variable which has a value, assign
1097 .Ar value
1098 to it.
1099 Even though
1100 .Sx "INTERNAL VARIABLES"
1101 .Ic \&\&set
1103 .Fl \&\&S
1104 may be overwritten from within resource files,
1105 the command line setting will be reestablished after all resource files
1106 have been loaded.
1107 (\*(ID In the future such a setting may instead become
1108 .Dq frozen
1109 until the startup is complete.)
1111 .It Fl s Ar subject
1112 Specify the subject of the message to be sent.
1113 Newline (NL) and carriage-return (CR) bytes are invalid and will be
1114 normalized to space (SP) characters.
1116 .It Fl t
1117 The message given (on standard input) is expected to contain, separated
1118 from the message body by an empty line, a message header with
1119 .Ql To: ,
1120 .Ql Cc: ,
1122 .Ql Bcc:
1123 fields giving its recipients, which will be added to any recipients
1124 specified on the command line.
1125 If a message subject is specified via
1126 .Ql Subject:
1127 then it will be used in favour of one given on the command line.
1129 Also understood are
1130 .Ql Reply-To:
1131 (possibly overriding
1132 .Va replyto ) ,
1133 .Ql Sender:
1134 .Pf ( Va sender ) ,
1135 .Ql From:
1136 .Pf ( Va from
1137 and / or option
1138 .Fl r ) .
1139 .Ql Message-ID: ,
1140 .Ql In-Reply-To: ,
1141 .Ql References:
1143 .Ql Mail-Followup-To: ,
1144 by default created automatically dependent on message context, will
1145 be used if specified (a special address massage will however still occur
1146 for the latter).
1147 Any other custom header field (also see
1148 .Va customhdr
1150 .Ic ~^ )
1151 is passed through entirely
1152 unchanged, and in conjunction with the options
1153 .Fl ~
1155 .Fl #
1156 it is possible to embed
1157 .Sx "COMMAND ESCAPES" .
1158 Also see
1159 .Fl M , m , q .
1161 .It Fl u Ar user
1162 Initially read the
1163 .Mx -sx
1164 .Sx "primary system mailbox"
1166 .Ar user ,
1167 appropriate privileges presumed; effectively identical to
1168 .Ql Fl \&\&f Ns \0%user .
1170 .It Fl V
1171 Show \*(UA's
1172 .Va version
1173 and exit.
1174 The command
1175 .Ic version
1176 will also show the list of
1177 .Va features :
1178 .Ql $ \*(uA -Xversion -Xx .
1180 .It Fl v
1181 .Ic set Ns
1182 ting the internal variable
1183 .Va verbose
1184 enables display of some informational context messages.
1185 Using it twice increases the level of verbosity.
1187 .It Fl X Ar cmd
1188 Add the given (or multiple for a multiline argument)
1189 .Ar cmd
1190 to the list of commands to be executed,
1191 as a last step of program startup, before normal operation starts.
1192 This is the only possibility to execute commands in non-interactive mode
1193 when reading startup files is actively prohibited.
1194 The commands will be evaluated as a unit, just as via
1195 .Ic source .
1196 Correlates with
1197 .Fl #
1199 .Va errexit .
1201 .It Fl ~
1202 Enable
1203 .Sx "COMMAND ESCAPES"
1204 in compose mode even in non-interactive use cases.
1205 This can be used to, e.g., automatically format the composed message
1206 text before sending the message:
1207 .Bd -literal -offset indent
1208 $ ( echo 'line    one. Word.     Word2.';\e
1209     echo '~| /usr/bin/fmt -tuw66' ) |\e
1210   LC_ALL=C \*(uA -d~:/ -Sttycharset=utf-8 bob@exam.ple
1213 .It Fl #
1214 Enables batch mode: standard input is made line buffered, the complete
1215 set of (interactive) commands is available, processing of
1216 .Sx "COMMAND ESCAPES"
1217 is enabled in compose mode, and diverse
1218 .Sx "INTERNAL VARIABLES"
1219 are adjusted for batch necessities, exactly as if done via
1220 .Fl S :
1221 .Va emptystart ,
1222 .Pf no Va errexit ,
1223 .Pf no Va header ,
1224 .Pf no Va posix ,
1225 .Va quiet ,
1226 .Va sendwait ,
1227 .Va typescript-mode
1228 as well as
1229 .Ev MAIL ,
1230 .Ev MBOX
1232 .Va inbox
1233 (the latter three to
1234 .Pa /dev/null ) .
1235 The following prepares an email message in a batched dry run:
1236 .Bd -literal -offset indent
1237 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' |\e
1238   LC_ALL=C \*(uA -d#:/ -X'alias bob bob@exam.ple'
1241 .It Fl \&.
1242 This flag forces termination of option processing in order to prevent
1243 .Dq option injection
1244 (attacks).
1245 It also forcefully puts \*(UA into send mode, see
1246 .Sx "On sending mail, and non-interactive mode" .
1249 All given
1250 .Ar to-addr
1251 arguments and all receivers established via
1252 .Fl b
1254 .Fl c
1255 are subject to the checks established by
1256 .Va expandaddr ,
1257 one of the
1258 .Sx "INTERNAL VARIABLES" .
1259 If the setting of
1260 .Va expandargv
1261 allows their recognition all
1262 .Ar mta-option
1263 arguments given at the end of the command line after a
1264 .Ql --
1265 separator will be passed through to a file-based
1266 .Va mta
1267 (Mail-Transfer-Agent) and persist for the entire session.
1268 .Va expandargv
1269 constraints do not apply to the content of
1270 .Va mta-arguments .
1271 .Ss "A starter"
1272 \*(UA is a direct descendant of
1274 Mail, itself a successor of the Research
1276 mail which
1277 .Dq was there from the start
1278 according to
1279 .Sx HISTORY .
1280 It thus represents the user side of the
1282 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
1283 traditionally taken by
1284 .Xr sendmail 8 ,
1285 and most MTAs provide a binary of this name for compatibility purposes.
1286 If the \*(OPal SMTP
1287 .Va mta
1288 is included in the
1289 .Va features
1290 of \*(UA then the system side is not a mandatory precondition for mail
1291 delivery.
1293 Because \*(UA strives for compliance with POSIX
1294 .Xr mailx 1
1295 it is likely that some configuration settings have to be adjusted before
1296 using it is a smooth experience.
1297 (Rather complete configuration examples can be found in the section
1298 .Sx EXAMPLES . )
1299 The default global
1300 .Pa \*(UR
1301 resource file bends those standard imposed settings of the
1302 .Sx "INTERNAL VARIABLES"
1303 a bit towards more user friendliness and safety already.
1305 For example, it
1306 .Ic set Ns s
1307 .Va hold
1309 .Va keepsave
1310 in order to suppress the automatic moving of messages to the
1311 .Mx -sx
1312 .Sx "secondary mailbox"
1313 .Ev MBOX
1314 that would otherwise occur (see
1315 .Sx "Message states" ) ,
1317 .Va keep
1318 to not remove empty system MBOX mailbox files in order not to mangle
1319 file permissions when files eventually get recreated (all empty (MBOX)
1320 mailbox files will be removed unless this variable is set whenever
1321 .Ev POSIXLY_CORRECT
1322 mode has been enabled).
1324 It also enables
1325 .Va sendwait
1326 in order to synchronize \*(UA with the exit status report of the used
1327 .Va mta
1328 when sending mails.
1330 .Ic set Ns
1332 .Va emptystart
1333 to enter interactive startup even if the initial mailbox is empty,
1334 .Va editheaders
1335 to allow editing of headers as well as
1336 .Va fullnames
1337 to not strip down addresses in compose mode, and
1338 .Va quote
1339 to include the message that is being responded to when
1340 .Ic reply Ns
1341 ing.
1343 It should be remarked that the file mode creation mask can be
1344 explicitly managed via the variable
1345 .Va umask .
1346 \*(UA will not follow symbolic links when opening files for writing,
1347 sufficient system support provided.
1348 .Ss "On sending mail, and non-interactive mode"
1349 To send a message to one or more people, using a local or a built-in
1350 .Va mta
1351 (Mail-Transfer-Agent) transport to actually deliver the generated mail
1352 message, \*(UA can be invoked with arguments which are the names of
1353 people to whom the mail will be sent, and the command line options
1354 .Fl b
1356 .Fl c
1357 can be used to add (blind) carbon copy receivers:
1358 .Bd -literal -offset indent
1359 # Via sendmail(1)
1360 $ \*(uA -s ubject -a ttach.txt bill@exam.ple
1362 # But... try it in an isolated dry-run mode (-d) first
1363 $ LC_ALL=C \*(uA -d -:/ -Ssendwait -Sttycharset=utf8 \e
1364    -b bcc@exam.ple -c cc@exam.ple \e
1365    -. '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
1367 # With SMTP
1368 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
1369     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
1370     -S from=scriptreply@exam.ple \e
1371     -a /etc/mail.rc \e
1372     -. eric@exam.ple
1375 If standard input is a terminal rather than the message to be sent,
1376 the user is expected to type in the message contents.
1377 In this compose mode \*(UA treats lines beginning with the character
1378 .Ql ~
1379 special \(en these are so-called
1380 .Sx "COMMAND ESCAPES" ,
1381 which can be used to read in files, process shell commands, add and edit
1382 attachments and more; e.g., the command escape
1383 .Ic ~e
1384 will start the text editor to revise the message in its current state,
1385 .Ic ~h
1386 allows editing of the most important message headers, with
1387 .Ic ~^
1388 custom headers can be created (more specifically than with
1389 .Va customhdr ) .
1390 .Ic ~?
1391 gives an overview of most other available command escapes.
1392 Typing
1393 .Ql control-D
1394 .Pf ( Ql ^D )
1395 at the beginning of an empty line leaves compose mode and causes the
1396 message to be sent, whereas typing
1397 .Ql control-C
1398 .Pf ( Ql ^C )
1399 twice will abort the current letter (saving its contents in the file
1400 denoted by
1401 .Ev DEAD
1402 unless
1403 .Pf no Va save
1404 is set).
1406 A number of
1407 .Sx ENVIRONMENT
1409 .Sx "INTERNAL VARIABLES"
1410 can be used to alter default behavior.
1411 E.g., messages are sent asynchronously, without supervision, unless the
1412 internal variable
1413 .Va sendwait
1414 is set, therefore send errors will not be recognizable until then.
1415 .Ic set Ns
1416 ting (also via
1417 .Fl S )
1418 .Va editalong
1419 will automatically startup a text editor when compose mode is entered,
1420 .Va editheaders
1421 allows editing of headers additionally to plain body content, whereas
1422 .Va askcc
1424 .Va askbcc
1425 will cause the user to be prompted actively for (blind) carbon-copy
1426 recipients, respectively, if the given list is empty.
1428 Especially when using public mail provider accounts with the SMTP
1429 .Va mta
1430 it is often necessary to set
1431 .Va from
1432 and/or
1433 .Va hostname
1434 (even finer control via
1435 .Va smtp-hostname ) ,
1436 which (even if empty) also causes creation of
1437 .Ql Message-ID:
1439 .Ql Content-ID:
1440 header fields unless
1441 .Va stealthmua
1442 is set.
1443 Saving a copy of sent messages in a
1444 .Va record
1445 mailbox may be desirable \(en as for most mailbox
1446 .Ic file
1447 targets the value will undergo
1448 .Sx "Filename transformations" .
1449 Defining user email
1450 .Ic account Ns s
1451 for the purpose of arranging a complete environment of settings that can
1452 be switched to with a single command or command line option may be
1453 useful.
1454 .Pf ( Sx EXAMPLES
1455 has example configurations for some of the well-known public mail
1456 providers, and also gives a compact overview on how to setup a secure
1457 SSL/TLS environment.)
1458 Some introductional
1459 .Fl d
1461 .Va debug
1462 sandbox dry-run tests will prove correctness.
1464 The section
1465 .Sx "On URL syntax and credential lookup"
1466 will spread light on the different ways of how to specify user email
1467 account credentials, the
1468 .Ql USER@HOST
1469 variable chains, and accessing protocol-specific resources,
1470 the section
1471 .Sx "Character sets"
1472 goes into the details of character encodings, and how to use them for
1473 interpreting the input data given in
1474 .Va ttycharset
1475 and representing messages and MIME part contents in
1476 .Va sendcharsets ,
1477 and reading the section
1478 .Sx "The mime.types files"
1479 should help to understand how the MIME-type of outgoing attachments are
1480 classified, and what can be done for fine-tuning.
1481 Over the wire a configurable
1482 .Va mime-encoding
1483 .Pf ( Ql Content-Transfer-Encoding: )
1484 may be applied to the message data.
1486 Message recipients (as specified on the command line or defined in
1487 .Ql To: ,
1488 .Ql Cc:
1490 .Ql Bcc: )
1491 may not only be email addressees but can also be names of mailboxes and
1492 even complete shell command pipe specifications.
1493 If the variable
1494 .Va expandaddr
1495 is not set then only network addresses (see
1496 .Xr mailaddr 7
1497 for a description of mail addresses) and plain user names (including MTA
1498 aliases) may be used, other types will be filtered out, giving a warning
1499 message.
1500 The command
1501 .Ic addrcodec
1502 can be used to generate standard compliant network addresses.
1504 If the variable
1505 .Va expandaddr
1506 is set then extended recipient addresses will optionally be accepted:
1507 Any name which starts with a vertical bar
1508 .Ql |
1509 character specifies a command pipe \(en the command string following the
1510 .Ql |
1511 is executed and the message is sent to its standard input;
1512 Likewise, any name that starts with the character solidus
1513 .Ql /
1514 or the character sequence dot solidus
1515 .Ql ./
1516 is treated as a file, regardless of the remaining content;
1517 likewise a name that solely consists of a hyphen-minus
1518 .Ql - .
1519 Any other name which contains a commercial at
1520 .Ql @
1521 character is treated as a network address;
1522 Any other name which starts with a plus sign
1523 .Ql +
1524 character specifies a mailbox name;
1525 Any other name which contains a solidus
1526 .Ql /
1527 character but no exclamation mark
1528 .Ql \&!
1529 or percent sign
1530 .Ql %
1531 character before also specifies a mailbox name;
1532 What remains is treated as a network address.
1533 .Bd -literal -offset indent
1534 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1535 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1536 $ echo safe | LC_ALL=C \e
1537     \*(uA -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
1538       -Sexpandaddr=fail,-all,+addr,failinvaddr -s test \e
1539       -. bob@exam.ple
1542 It is possible to create personal distribution lists via the
1543 .Ic alias
1544 command, so that, for instance, the user can send mail to
1545 .Ql cohorts
1546 and have it go to a group of people.
1547 These aliases have nothing in common with the system wide aliases that
1548 may be used by the MTA, which are subject to the
1549 .Ql name
1550 constraint of
1551 .Va expandaddr
1552 and are often tracked in a file
1553 .Pa /etc/aliases
1554 (and documented in
1555 .Xr aliases 5
1557 .Xr sendmail 1 ) .
1558 Personal aliases will be expanded by \*(UA before the message is sent,
1559 and are thus a convenient alternative to specifying each addressee by
1560 itself; they correlate with the active set of
1561 .Ic alternates
1562 and are subject to
1563 .Va metoo
1564 filtering.
1566 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
1568 .Va on-compose-enter , on-compose-leave
1570 .Va on-compose-cleanup
1571 hook variables may be set to
1572 .Ic define Ns
1573 d macros to automatically adjust some settings dependent
1574 on receiver, sender or subject contexts, and via the
1575 .Va on-compose-splice
1576 as well as
1577 .Va on-compose-splice-shell
1578 variables, the former also to be set to a
1579 .Ic define Ns
1580 d macro, increasingly powerful mechanisms to perform automated message
1581 adjustments are available.
1582 (\*(ID These hooks work for commands which newly create messages, namely
1583 .Ic forward , mail , reply
1584 and variants;
1585 .Ic resend
1587 .Ic Resend
1588 for now provide only the hooks
1589 .Va on-resend-enter
1591 .Va on-resend-cleanup . )
1593 To avoid environmental noise scripts should
1594 .Dq detach
1595 \*(UA from any configuration files and create a script-local
1596 environment, ideally with the command line options
1597 .Fl \&:
1598 to disable any configuration file in conjunction with repetitions of
1599 .Fl S
1600 to specify variables:
1601 .Bd -literal -offset indent
1602 $ env LC_ALL=C \*(uA -:/ \e
1603     -Sv15-compat -Ssendwait -Sttycharset=utf-8 \e
1604     -Sexpandaddr=fail,-all,failinvaddr \e
1605     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1606     -S from=scriptreply@exam.ple \e
1607     -s 'Subject to go' -a attachment_file \e
1608     -. 'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1609     < content_file
1612 As shown, scripts can
1613 .Dq fake
1614 a locale environment, the above specifies the all-compatible 7-bit clean
1615 .Ev LC_ALL
1616 .Dq C ,
1617 but will nonetheless take and send UTF-8 in the message text by using
1618 .Va ttycharset .
1619 In interactive mode, which is introduced in the next section, messages
1620 can be sent by calling the
1621 .Ic mail
1622 command with a list of recipient addresses:
1623 .Bd -literal -offset indent
1624 $ \*(uA -d -Squiet -Semptystart
1625 "/var/spool/mail/user": 0 messages
1626 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1628 ? # Will do the right thing (tm)
1629 ? m rec1@exam.ple rec2@exam.ple
1631 .Ss "On reading mail, and interactive mode"
1632 When invoked without addressees \*(UA enters interactive mode in which
1633 mails may be read.
1634 When used like that the user's system
1635 .Va inbox
1636 (for more on mailbox types please see the command
1637 .Ic file )
1638 is read in and a one line header of each message therein is displayed if
1639 the variable
1640 .Va header
1641 is set.
1642 The visual style of this summary of
1643 .Ic headers
1644 can be adjusted through the variable
1645 .Va headline
1646 and the possible sorting criterion via
1647 .Va autosort .
1648 Scrolling through
1649 .Va screen Ns
1650 fuls of
1651 .Ic headers
1652 can be performed with the command
1653 .Ic z .
1654 If the initially opened mailbox is empty \*(UA will instead exit
1655 immediately (after displaying a message) unless the variable
1656 .Va emptystart
1657 is set.
1659 At the
1660 .Va prompt
1661 the command
1662 .Ic list
1663 will give a listing of all available commands and
1664 .Ic help
1665 will give a summary of some common ones.
1666 If the \*(OPal documentation strings are available one can type
1667 .Ql help X
1668 .Pf "(or " Ql ?X )
1669 and see the actual expansion of
1670 .Ql X
1671 and what its purpose is, i.e., commands can be abbreviated
1672 (note that POSIX defines some abbreviations, so that the alphabetical
1673 order of commands does not necessarily relate to the abbreviations; it is
1674 however possible to define overwrites with
1675 .Ic commandalias ) .
1676 These commands can also produce a more
1677 .Va verbose
1678 output.
1680 Messages are given numbers (starting at 1) which uniquely identify
1681 messages; the current message \(en the
1682 .Dq dot
1683 \(en will either be the first new message, or the first unread message,
1684 or the first message of the mailbox; the internal variable
1685 .Va showlast
1686 will instead cause usage of the last message for this purpose.
1687 The command
1688 .Ic headers
1689 will display a
1690 .Va screen Ns
1691 ful of header summaries containing the
1692 .Dq dot ,
1693 whereas
1694 .Ic from
1695 will display only the summaries of the given messages, defaulting to the
1696 .Dq dot .
1698 Message content can be displayed with the command
1699 .Ic type
1700 .Pf ( Ql t ,
1701 alias
1702 .Ic print ) .
1703 Here the variable
1704 .Va crt
1705 controls whether and when \*(UA will use the configured
1706 .Ev PAGER
1707 for display instead of directly writing to the user terminal
1708 .Va screen ,
1709 the sole difference to the command
1710 .Ic more ,
1711 which will always use the
1712 .Ev PAGER .
1713 The command
1714 .Ic top
1715 will instead only show the first
1716 .Va toplines
1717 of a message (maybe even compressed if
1718 .Va topsqueeze
1719 is set).
1720 Message display experience may improve by setting and adjusting
1721 .Va mime-counter-evidence ,
1722 and also see
1723 .Sx "HTML mail and MIME attachments" .
1725 By default the current message
1726 .Pf ( Dq dot )
1727 is displayed, but like with many other commands it is possible to give
1728 a fancy message specification (see
1729 .Sx "Specifying messages" ) ,
1730 e.g.,
1731 .Ql t:u
1732 will display all unread messages,
1733 .Ql t.
1734 will display the
1735 .Dq dot ,
1736 .Ql t 1 5
1737 will type the messages 1 and 5,
1738 .Ql t 1-5
1739 will type the messages 1 through 5, and
1740 .Ql t-
1742 .Ql t+
1743 will display the last and the next message, respectively.
1744 The command
1745 .Ic search
1746 (a more substantial alias for
1747 .Ic from )
1748 will display a header summary of the given message specification list
1749 instead of their content, e.g., the following will search for subjects:
1751 .Dl ? from "'@Some subject to search for'"
1753 In the default setup all header fields of a message will be
1754 .Ic type Ns
1755 d, but fields can be white- or blacklisted for a variety of
1756 applications by using the command
1757 .Ic headerpick ,
1758 e.g., to restrict their display to a very restricted set for
1759 .Ic type :
1760 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1761 In order to display all header fields of a message regardless of
1762 currently active ignore or retain lists, use the commands
1763 .Ic Type
1765 .Ic Top ;
1766 .Ic Show
1767 will show the raw message content.
1768 Note that historically the global
1769 .Pa \*(UR
1770 not only adjusts the list of displayed headers, but also sets
1771 .Va crt .
1773 Dependent upon the configuration a line editor (see the section
1774 .Sx "On terminal control and line editor" )
1775 aims at making the user experience with the many
1776 .Sx COMMANDS
1777 a bit nicer.
1778 When reading the system
1779 .Va inbox
1780 or when
1781 .Fl f
1783 .Ic file )
1784 specified a mailbox explicitly prefixed with the special
1785 .Ql %:
1786 modifier (propagating the mailbox to a
1787 .Mx -sx
1788 .Sx "primary system mailbox" ) ,
1789 then messages which have been read will be automatically moved to a
1790 .Mx -sx
1791 .Sx "secondary mailbox" ,
1792 the users
1793 .Ev MBOX
1794 file, when the mailbox is left, either by changing the
1795 active mailbox or by quitting \*(UA (also see
1796 .Sx "Message states" )
1797 \(en this automatic moving from a system or primary to the secondary
1798 mailbox is not performed when the variable
1799 .Va hold
1800 is set.
1801 Messages can also be explicitly
1802 .Ic move Ns
1803 d to other mailboxes, whereas
1804 .Ic copy
1805 keeps the original message.
1806 .Ic write
1807 can be used to write out data content of specific parts of messages.
1809 After examining a message the user can
1810 .Ic reply Ql r
1811 to the sender and all recipients (which will also be placed in
1812 .Ql To:
1813 unless
1814 .Va recipients-in-cc
1815 is set) or
1816 .Ic Reply Ql R
1817 exclusively to the sender(s).
1818 .Ic forward Ns
1819 ing a message will allow editing the new message: the original message
1820 will be contained in the message body, adjusted according to
1821 .Ic headerpick .
1822 When replying to or forwarding a message recipient addresses will be
1823 stripped from comments and names unless the internal variable
1824 .Va fullnames
1825 is set.
1826 It is possible to
1827 .Ic resend
1829 .Ic Resend
1830 messages: the former will add a series of
1831 .Ql Resent-
1832 headers, whereas the latter will not; different to newly created
1833 messages editing is not possible and no copy will be saved even with
1834 .Va record
1835 unless the additional variable
1836 .Va record-resent
1837 is set.
1838 Of course messages can be
1839 .Ic delete Ql d ,
1840 and they can spring into existence again via
1841 .Ic undelete
1842 or when the \*(UA session is ended via the
1843 .Ic exit Ql x
1844 command.
1846 To end a mail processing session one may either issue
1847 .Ic quit Ql q
1848 to cause a full program exit, which possibly includes
1849 automatic moving of read messages to the
1850 .Mx -sx
1851 .Sx "secondary mailbox"
1852 .Ev MBOX
1853 as well as updating the \*(OPal line editor
1854 .Va history-file ,
1855 or use the command
1856 .Ic exit Ql x
1857 instead in order to prevent any of these actions.
1858 .Ss "HTML mail and MIME attachments"
1859 Messages which are HTML-only become more and more common and of course
1860 many messages come bundled with a bouquet of MIME (Multipurpose Internet
1861 Mail Extensions) parts for, e.g., attachments.
1862 To get a notion of MIME types, \*(UA will first read
1863 .Sx "The mime.types files"
1864 (as configured and allowed by
1865 .Va mimetypes-load-control ) ,
1866 and then add onto that types registered directly with
1867 .Ic mimetype .
1868 It (normally) has a default set of types built-in, too.
1869 To improve interaction with faulty MIME part declarations which are
1870 often seen in real-life messages, setting
1871 .Va mime-counter-evidence
1872 will allow \*(UA to verify the given assertion and possibly provide
1873 an alternative MIME type.
1875 Whereas \*(UA \*(OPally supports a simple HTML-to-text converter for
1876 HTML messages, it cannot handle MIME types other than plain text itself.
1877 Instead programs need to become registered to deal with specific MIME
1878 types or file extensions.
1879 These programs may either prepare plain text versions of their input in
1880 order to enable \*(UA to integrate their output neatlessly in its own
1881 message visualization (a mode which is called
1882 .Cd copiousoutput ) ,
1883 or display the content themselves, for example in an external graphical
1884 window: such handlers will only be considered by and for the command
1885 .Ic mimeview .
1887 To install a handler program for a specific MIME type an according
1888 .Va pipe-TYPE/SUBTYPE
1889 variable needs to be set; to instead define a handler for a specific
1890 file extension the respective
1891 .Va pipe-EXTENSION
1892 variable can be used \(en these handlers take precedence.
1893 \*(OPally \*(UA supports mail user agent configuration as defined in
1894 RFC 1524; this mechanism (see
1895 .Sx "The Mailcap files" )
1896 will be queried for display or quote handlers if none of the former two
1897 did; it will be the sole source for handlers of other purpose.
1898 A last source for handlers is the MIME type definition itself, when
1899 a (\*(UA specific) type-marker was registered with the command
1900 .Ic mimetype
1901 (which many built-in MIME types do).
1903 E.g., to display a HTML message inline (that is, converted to a more
1904 fancy plain text representation than the built-in converter is capable to
1905 produce) with either of the text-mode browsers
1906 .Xr lynx 1
1908 .Xr elinks 1 ,
1909 teach \*(UA about MathML documents and make it display them as plain
1910 text, and to open PDF attachments in an external PDF viewer,
1911 asynchronously and with some other magic attached:
1912 .Bd -literal -offset indent
1913 ? if [ "$features" !% +filter-html-tagsoup ]
1914 ?  #set pipe-text/html='@* elinks -force-html -dump 1'
1915 ?  set pipe-text/html='@* lynx -stdin -dump -force_html'
1916 ?  # Display HTML as plain text instead
1917 ?  #set pipe-text/html=@
1918 ? endif
1919 ? mimetype @ application/mathml+xml mathml
1920 ? wysh set pipe-application/pdf='@&=@ \e
1921     trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1922     trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1923     mupdf "${MAILX_FILENAME_TEMPORARY}"'
1925 .Ss "Mailing lists"
1926 \*(UA offers some support to ease handling of mailing lists.
1927 The command
1928 .Ic mlist
1929 promotes all given arguments to known mailing lists, and
1930 .Ic mlsubscribe
1931 sets their subscription attribute, creating them first as necessary.
1932 (On the other hand
1933 .Ic unmlsubscribe
1934 does not
1935 .Ic unmlist
1936 automatically, but only resets the subscription attribute.)
1937 Using the commands without arguments will show (a subset of) all
1938 currently defined mailing lists.
1940 .Va headline
1941 format
1942 .Ql \&%T
1943 can be used to mark out messages with configured list addresses
1944 in the header display.
1946 \*(OPally mailing lists may also be specified as (extended) regular
1947 expressions, which allows matching of many addresses with a single
1948 expression.
1949 However, all fully qualified list addresses are matched via a fast
1950 dictionary, whereas expressions are placed in (a) list(s) which is
1951 (are) matched sequentially.
1952 .Bd -literal -offset indent
1953 ? set followup-to followup-to-honour=ask-yes \e
1954     reply-to-honour=ask-yes
1955 ? wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1956 ? mlsubscribe a4@b4.c4 exact@lists.c3
1959 The variable
1960 .Va followup-to-honour
1961 will ensure that a
1962 .Ql Mail-\:Followup-\:To:
1963 header is honoured when the message is being replied to (via
1964 .Ic reply
1966 .Ic Lreply )
1968 .Va followup-to
1969 controls whether this header is created when sending mails; it will be
1970 created automatically for a couple of reasons, too, like when the
1971 special
1972 .Dq mailing list specific
1973 respond command
1974 .Ic Lreply
1975 is used, when
1976 .Ic reply
1977 is used to respond to a message with its
1978 .Ql Mail-Followup-To:
1979 being honoured etc.
1981 A difference in between the handling of known and subscribed lists is
1982 that the address of the sender is usually not part of a generated
1983 .Ql Mail-Followup-To:
1984 when addressing the latter, whereas it is for the former kind of lists.
1985 Usually because there are exceptions: say, if multiple lists are
1986 addressed and not all of them are subscribed lists.
1988 For convenience \*(UA will, temporarily, automatically add a list
1989 address that is presented in the
1990 .Ql List-Post:
1991 header of a message that is being responded to to the list of known
1992 mailing lists.
1993 Shall that header have existed \*(UA will instead, dependent on the
1994 variable
1995 .Va reply-to-honour ,
1996 use an also set
1997 .Ql Reply-To:
1998 for this purpose in order to accept a list administrators' wish that
1999 is supposed to have been manifested like that (but only if it provides
2000 a single address which resides on the same domain as what is stated in
2001 .Ql List-Post: ) .
2002 .Ss "Signed and encrypted messages with S/MIME"
2003 \*(OP S/MIME provides two central mechanisms:
2004 message signing and message encryption.
2005 A signed message contains some data in addition to the regular text.
2006 The data can be used to verify that the message was sent using a valid
2007 certificate, that the sender's address in the message header matches
2008 that in the certificate, and that the message text has not been altered.
2009 Signing a message does not change its regular text;
2010 it can be read regardless of whether the recipient's software is able to
2011 handle S/MIME.
2012 It is thus usually possible to sign all outgoing messages if so desired.
2014 Encryption, in contrast, makes the message text invisible for all people
2015 except those who have access to the secret decryption key.
2016 To encrypt a message, the specific recipient's public encryption key
2017 must be known.
2018 It is therefore not possible to send encrypted mail to people unless their
2019 key has been retrieved from either previous communication or public key
2020 directories.
2021 A message should always be signed before it is encrypted.
2022 Otherwise, it is still possible that the encrypted message text is
2023 altered.
2025 A central concept to S/MIME is that of the certification authority (CA).
2026 A CA is a trusted institution that issues certificates.
2027 For each of these certificates it can be verified that it really
2028 originates from the CA, provided that the CA's own certificate is
2029 previously known.
2030 A set of CA certificates is usually delivered with OpenSSL and installed
2031 on your system.
2032 If you trust the source of your OpenSSL software installation,
2033 this offers reasonable security for S/MIME on the Internet.
2034 Otherwise set
2035 .Va smime-ca-no-defaults
2036 to avoid using the default certificates and point
2037 .Va smime-ca-file
2038 and/or
2039 .Va smime-ca-dir
2040 to a trusted pool of certificates.
2041 In general, a certificate cannot be more secure than the method its CA
2042 certificate has been retrieved with.
2044 This trusted pool of certificates is used by the command
2045 .Ic verify
2046 to ensure that the given S/MIME messages can be trusted.
2047 If so, verified sender certificates that were embedded in signed
2048 messages can be saved locally with the command
2049 .Ic certsave ,
2050 and used by \*(UA to encrypt further communication with these senders:
2051 .Bd -literal -offset indent
2052 ? certsave FILENAME
2053 ? set smime-encrypt-USER@HOST=FILENAME \e
2054     smime-cipher-USER@HOST=AES256
2057 To sign outgoing messages in order to allow receivers to verify the
2058 origin of these messages a personal S/MIME certificate is required.
2059 \*(UA supports password-protected personal certificates (and keys),
2060 for more on this, and its automatization, please see the section
2061 .Sx "On URL syntax and credential lookup" .
2062 The section
2063 .Sx "S/MIME step by step"
2064 shows examplarily how such a private certificate can be obtained.
2065 In general, if such a private key plus certificate
2066 .Dq pair
2067 is available, all that needs to be done is to set some variables:
2068 .Bd -literal -offset indent
2069 ? set smime-sign-cert=ME@HERE.com.paired \e
2070     smime-sign-message-digest=SHA256 \e
2071     smime-sign
2074 Variables of interest for S/MIME in general are
2075 .Va smime-ca-dir ,
2076 .Va smime-ca-file ,
2077 .Va smime-ca-flags ,
2078 .Va smime-ca-no-defaults ,
2079 .Va smime-crl-dir ,
2080 .Va smime-crl-file .
2081 For S/MIME signing of interest are
2082 .Va smime-sign ,
2083 .Va smime-sign-cert ,
2084 .Va smime-sign-include-certs
2086 .Va smime-sign-message-digest .
2087 Additional variables of interest for S/MIME en- and decryption:
2088 .Va smime-cipher
2090 .Va smime-encrypt-USER@HOST .
2092 \*(ID Note that neither S/MIME signing nor encryption applies to
2093 message subjects or other header fields yet.
2094 Thus they may not contain sensitive information for encrypted messages,
2095 and cannot be trusted even if the message content has been verified.
2096 When sending signed messages,
2097 it is recommended to repeat any important header information in the
2098 message text.
2099 .Ss "On URL syntax and credential lookup"
2100 \*(IN For accessing protocol-specific resources usage of Uniform
2101 Resource Locators (URL, RFC 1738) has become omnipresent.
2102 \*(UA expects and understands URLs in the following form;
2103 parts in brackets
2104 .Ql []
2105 denote optional parts, optional either because there also exist other
2106 ways to define the information in question or because support of the
2107 part is protocol-specific (e.g.,
2108 .Ql /path
2109 is used by the local maildir and the IMAP protocol, but not by POP3);
2110 If any of
2111 .Ql USER
2113 .Ql PASSWORD
2114 are specified they must be given in URL percent encoded form (RFC 3986;
2115 the command
2116 .Ic urlcodec
2117 may be helpful):
2119 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
2121 Note that these \*(UA URLs most often do not conform to any real
2122 standard, but instead represent a normalized variant of RFC 1738 \(en
2123 they are not used in data exchange but only meant as a compact,
2124 easy-to-use way of defining and representing information in
2125 a well-known notation.
2127 Many internal variables of \*(UA exist in multiple versions, called
2128 variable chains for the rest of this document: the plain
2129 .Ql variable
2130 as well as
2131 .Ql variable-HOST
2133 .Ql variable-USER@HOST .
2134 Here
2135 .Ql HOST
2136 indeed means
2137 .Ql server:port
2138 if a
2139 .Ql port
2140 had been specified in the respective URL, otherwise it refers to the plain
2141 .Ql server .
2142 Also,
2143 .Ql USER
2144 is not truly the
2145 .Ql USER
2146 that had been found when doing the user chain lookup as is described
2147 below, i.e., this
2148 .Ql USER
2149 will never be in URL percent encoded form, whether it came from an URL
2150 or not; i.e., variable chain name extensions of
2151 .Sx "INTERNAL VARIABLES"
2152 must not be URL percent encoded.
2154 For example, whether an hypothetical URL
2155 .Ql smtp://hey%3Ayou@our.house
2156 had been given that includes a user, or whether the URL was
2157 .Ql smtp://our.house
2158 and the user had been found differently, to lookup the variable chain
2159 .Va smtp-use-starttls
2160 \*(UA first looks for whether
2161 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
2162 is defined, then whether
2163 .Ql smtp-\:use-\:starttls-\:our.house
2164 exists before finally ending up looking at the plain variable itself.
2166 \*(UA obeys the following logic scheme when dealing with the
2167 necessary credential information of an account:
2168 .Bl -bullet
2170 If no
2171 .Ql USER
2172 has been given in the URL the variables
2173 .Va user-HOST
2175 .Va user
2176 are looked up; if no such variable(s) can be found then \*(UA will,
2177 when enforced by the \*(OPal variables
2178 .Va netrc-lookup-HOST
2180 .Va netrc-lookup ,
2181 search the users
2182 .Pa .netrc
2183 file for a
2184 .Ql HOST
2185 specific entry which provides a
2186 .Ql login
2187 name: this lookup will only succeed if unambiguous (one possible matching
2188 entry for
2189 .Ql HOST ) .
2190 It is possible to load encrypted
2191 .Pa .netrc
2192 files via
2193 .Va netrc-pipe .
2195 If there is still no
2196 .Ql USER
2197 then \*(UA will fall back to the user who is supposed to run \*(UA,
2198 the identity of which has been fixated during \*(UA startup and is
2199 known to be a valid user on the current host.
2201 Authentication: unless otherwise noted this will lookup the
2202 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
2203 variable chain, falling back to a protocol-specific default should this
2204 have no success.
2206 If no
2207 .Ql PASSWORD
2208 has been given in the URL, then if the
2209 .Ql USER
2210 has been found through the \*(OPal
2211 .Va netrc-lookup
2212 that may have already provided the password, too.
2213 Otherwise the variable chain
2214 .Va password-USER@HOST , password-HOST , password
2215 is looked up and used if existent.
2217 Afterwards the complete \*(OPal variable chain
2218 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
2219 is looked up.
2220 If set, the
2221 .Ic netrc
2222 cache is searched for a password only (multiple user accounts for
2223 a single machine may exist as well as a fallback entry without user
2224 but with a password).
2226 If at that point there is still no password available, but the
2227 (protocols') chosen authentication type requires a password, then in
2228 interactive mode the user will be prompted on the terminal.
2231 .Sy Note:
2232 S/MIME verification works relative to the values found in the
2233 .Ql From:
2235 .Ql Sender: )
2236 header field(s), which means that the values of
2237 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
2239 .Va smime-sign-message-digest
2240 will not be looked up using the
2241 .Ql USER
2243 .Ql HOST
2244 chains from above but instead use the corresponding values from the
2245 message that is being worked on.
2246 In unusual cases multiple and different
2247 .Ql USER
2249 .Ql HOST
2250 combinations may therefore be involved \(en on the other hand those
2251 unusual cases become possible.
2252 The usual case is as short as:
2254 .Dl set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
2255 .Dl \ \ \ \ smime-sign smime-sign-cert=+smime.pair
2257 The section
2258 .Sx EXAMPLES
2259 contains complete example configurations.
2260 .Ss "Character sets"
2261 \*(OP \*(UA detects the character set of the terminal by using
2262 mechanisms that are controlled by the
2263 .Ev LC_CTYPE
2264 environment variable
2265 (in fact
2266 .Ev LC_ALL ,
2267 .Ev \&\&LC_CTYPE ,
2268 .Ev LANG ,
2269 in that order, see there).
2270 The internal variable
2271 .Va ttycharset
2272 will be set to the detected terminal character set accordingly,
2273 and will thus show up in the output of commands like, e.g.,
2274 .Ic set
2276 .Ic varshow .
2278 However, the user may give a value for
2279 .Va ttycharset
2280 during startup, so that it is possible to send mail in a completely
2281 .Dq faked
2282 locale environment, an option which can be used to generate and send,
2283 e.g., 8-bit UTF-8 input data in a pure 7-bit US-ASCII
2284 .Ql LC_ALL=C
2285 environment (an example of this can be found in the section
2286 .Sx "On sending mail, and non-interactive mode" ) .
2287 Changing the value does not mean much beside that, because several
2288 aspects of the real character set are implied by the locale environment
2289 of the system, which stays unaffected by
2290 .Va ttycharset .
2292 If the \*(OPal character set conversion capabilities are not available
2293 .Pf ( Va features
2294 does not include the term
2295 .Ql +iconv ) ,
2296 then
2297 .Va ttycharset
2298 will be the only supported character set,
2299 it is simply assumed that it can be used to exchange 8-bit messages
2300 (over the wire an intermediate, configurable
2301 .Va mime-encoding
2302 may be applied),
2303 and the rest of this section does not apply;
2304 it may however still be necessary to explicitly set it if automatic
2305 detection fails, since in that case it defaults to
2306 LATIN1 a.k.a. ISO-8859-1.
2308 \*(OP When reading messages, their text is converted into
2309 .Va ttycharset
2310 as necessary in order to display them on the users terminal.
2311 Unprintable characters and invalid byte sequences are detected
2312 and replaced by proper substitution characters.
2313 Character set mappings for source character sets can be established with
2314 the command
2315 .Ic charsetalias ,
2316 which may be handy to work around faulty character set catalogues (e.g.,
2317 to add a missing LATIN1 to ISO-8859-1 mapping), or to enforce treatment
2318 of one character set as another one (e.g., to interpret LATIN1 as CP1252).
2319 Also see
2320 .Va charset-unknown-8bit
2321 to deal with another hairy aspect of message interpretation.
2323 When sending messages all their parts and attachments are classified.
2324 Whereas no character set conversion is performed on those parts which
2325 appear to be binary data,
2326 the character set being used must be declared within the MIME header of
2327 an outgoing text part if it contains characters that do not conform to
2328 the set of characters that are allowed by the email standards.
2329 Permissible values for character sets used in outgoing messages can be
2330 declared using the
2331 .Va sendcharsets
2332 variable, and
2333 .Va charset-8bit ,
2334 which defines a catch-all last-resort fallback character set that is
2335 implicitly appended to the list of character sets in
2336 .Va sendcharsets .
2338 When replying to a message and the variable
2339 .Va reply-in-same-charset
2340 is set, then the character set of the message being replied to
2341 is tried first (still being a subject of
2342 .Ic charsetalias ) .
2343 And it is also possible to make \*(UA work even more closely related to
2344 the current locale setting automatically by using the variable
2345 .Va sendcharsets-else-ttycharset ,
2346 please see there for more information.
2348 All the specified character sets are tried in order unless the
2349 conversion of the part or attachment succeeds.
2350 If none of the tried (8-bit) character sets is capable to represent the
2351 content of the part or attachment,
2352 then the message will not be sent and its text will optionally be
2353 .Va save Ns d
2355 .Ev DEAD .
2356 In general, if a message saying
2357 .Dq cannot convert from a to b
2358 appears, either some characters are not appropriate for the currently
2359 selected (terminal) character set,
2360 or the needed conversion is not supported by the system.
2361 In the first case, it is necessary to set an appropriate
2362 .Ev LC_CTYPE
2363 locale and/or the variable
2364 .Va ttycharset .
2366 The best results are usually achieved when \*(UA is run in a UTF-8
2367 locale on an UTF-8 capable terminal, in which case the full Unicode
2368 spectrum of characters is available.
2369 In this setup characters from various countries can be displayed,
2370 while it is still possible to use more simple character sets for sending
2371 to retain maximum compatibility with older mail clients.
2373 On the other hand the POSIX standard defines a locale-independent 7-bit
2374 .Dq portable character set
2375 that should be used when overall portability is an issue, the even more
2376 restricted subset named
2377 .Dq portable filename character set
2378 consists of A-Z, a-z, 0-9, period
2379 .Ql \&. ,
2380 underscore
2381 .Ql _
2382 and hyphen-minus
2383 .Ql - .
2384 .Ss "Message states"
2385 \*(UA differentiates in between several different message states;
2386 the current state will be reflected in header summary displays if
2387 .Va headline
2388 is configured to do so (via the internal variable
2389 .Va attrlist ) ,
2390 and messages can also be selected and be acted upon depending on their
2391 state (see
2392 .Sx "Specifying messages" ) .
2393 When operating on the system
2394 .Va inbox ,
2395 or in any other
2396 .Mx -sx
2397 .Sx "primary system mailbox" ,
2398 special actions, like the automatic moving of messages to the
2399 .Mx -sx
2400 .Sx "secondary mailbox"
2401 .Ev MBOX ,
2402 may be applied when the mailbox is left (also implicitly via
2403 a successful exit of \*(UA, but not if the special command
2404 .Ic exit
2405 is used) \(en however, because this may be irritating to users which
2406 are used to
2407 .Dq more modern
2408 mail-user-agents, the default global
2409 .Pa \*(UR
2410 sets the internal
2411 .Va hold
2413 .Va keepsave
2414 variables in order to suppress this behaviour.
2415 .Bl -hang -width ".It Ql new"
2416 .It Ql new
2417 Message has neither been viewed nor moved to any other state.
2418 Such messages are retained even in the
2419 .Mx -sx
2420 .Sx "primary system mailbox" .
2421 .It Ql unread
2422 Message has neither been viewed nor moved to any other state, but the
2423 message was present already when the mailbox has been opened last:
2424 Such messages are retained even in the
2425 .Mx -sx
2426 .Sx "primary system mailbox" .
2427 .It Ql read
2428 The message has been processed by one of the following commands:
2429 .Ic ~f ,
2430 .Ic ~m ,
2431 .Ic ~F ,
2432 .Ic ~M ,
2433 .Ic copy ,
2434 .Ic mbox ,
2435 .Ic next ,
2436 .Ic pipe  ,
2437 .Ic Print ,
2438 .Ic print ,
2439 .Ic top ,
2440 .Ic Type ,
2441 .Ic type ,
2442 .Ic undelete .
2443 The commands
2444 .Ic dp
2446 .Ic dt
2447 will always try to automatically
2448 .Dq step
2450 .Ic type
2452 .Dq next
2453 logical message, and may thus mark multiple messages as read, the
2454 .Ic delete
2455 command will do so if  the internal variable
2456 .Va autoprint
2457 is set.
2458 Except when the
2459 .Ic exit
2460 command is used, messages that are in a
2461 .Mx -sx
2462 .Sx "primary system mailbox"
2463 and are in
2464 .Ql read
2465 state when the mailbox is left will be saved in the
2466 .Mx -sx
2467 .Sx "secondary mailbox"
2468 .Ev MBOX
2469 unless the internal variable
2470 .Va hold
2471 it set.
2472 .It Ql deleted
2473 The message has been processed by one of the following commands:
2474 .Ic delete ,
2475 .Ic dp ,
2476 .Ic dt .
2477 Only
2478 .Ic undelete
2479 can be used to access such messages.
2480 .It Ql preserved
2481 The message has been processed by a
2482 .Ic preserve
2483 command and it will be retained in its current location.
2484 .It Ql saved
2485 The message has been processed by one of the following commands:
2486 .Ic save
2488 .Ic write .
2489 Unless when the
2490 .Ic exit
2491 command is used, messages that are in a
2492 .Mx -sx
2493 .Sx "primary system mailbox"
2494 and are in
2495 .Ql saved
2496 state when the mailbox is left will be deleted; they will be saved in the
2497 .Mx -sx
2498 .Sx "secondary mailbox"
2499 .Ev MBOX
2500 when the internal variable
2501 .Va keepsave
2502 is set.
2505 In addition to these message states, flags which otherwise have no
2506 technical meaning in the mail system except allowing special ways of
2507 addressing them when
2508 .Sx "Specifying messages"
2509 can be set on messages.
2510 These flags are saved with messages and are thus persistent, and are
2511 portable between a set of widely used MUAs.
2512 .Bl -hang -width ".It Ic answered"
2513 .It Ic answered
2514 Mark messages as having been answered.
2515 .It Ic draft
2516 Mark messages as being a draft.
2517 .It Ic flag
2518 Mark messages which need special attention.
2520 .Ss "Specifying messages"
2521 Commands such as
2522 .Ic from ,
2523 .Ic type
2525 .Ic delete
2526 can be given a list of message numbers as arguments to apply to a number
2527 of messages at once.
2528 Thus
2529 .Ql delete 1 2
2530 deletes messages 1 and 2,
2531 whereas
2532 .Ql delete 1-5
2533 will delete the messages 1 through 5.
2534 In sorted or threaded mode (see the
2535 .Ic sort
2536 command),
2537 .Ql delete 1-5
2538 will delete the messages that are located between (and including)
2539 messages 1 through 5 in the sorted/threaded order, as shown in the
2540 .Ic headers
2541 summary.
2542 The following special message names exist:
2543 .Bl -tag -width ".It Ar BaNg"
2544 .It Ar \&.
2545 The current message, the so-called
2546 .Dq dot .
2547 .It Ar \&;
2548 The message that was previously the current message.
2549 .It Ar \&,
2550 The parent message of the current message,
2551 that is the message with the Message-ID given in the
2552 .Ql In-Reply-To:
2553 field or the last entry of the
2554 .Ql References:
2555 field of the current message.
2556 .It Ar -
2557 The next previous undeleted message,
2558 or the next previous deleted message for the
2559 .Ic undelete
2560 command.
2561 In sorted/threaded mode,
2562 the next previous such message in the sorted/threaded order.
2563 .It Ar +
2564 The next undeleted message,
2565 or the next deleted message for the
2566 .Ic undelete
2567 command.
2568 In sorted/threaded mode,
2569 the next such message in the sorted/threaded order.
2570 .It Ar ^
2571 The first undeleted message,
2572 or the first deleted message for the
2573 .Ic undelete
2574 command.
2575 In sorted/threaded mode,
2576 the first such message in the sorted/threaded order.
2577 .It Ar $
2578 The last message.
2579 In sorted/threaded mode,
2580 the last message in the sorted/threaded order.
2581 .It Ar & Ns Ar x
2582 In threaded mode,
2583 selects the message addressed with
2584 .Ar x ,
2585 where
2586 .Ar x
2587 is any other message specification,
2588 and all messages from the thread that begins at it.
2589 Otherwise it is identical to
2590 .Ar x .
2592 .Ar x
2593 is omitted,
2594 the thread beginning with the current message is selected.
2595 .It Ar *
2596 All messages.
2597 .It Ar `
2598 All messages that were included in the
2599 .Sx "Message list arguments"
2600 of the previous command.
2601 .It Ar x-y
2602 An inclusive range of message numbers.
2603 Selectors that may also be used as endpoints include any of
2604 .Ar .;-+^$ .
2605 .It Ar address
2606 A case-insensitive
2607 .Dq any substring matches
2608 search against the
2609 .Ql From:
2610 header, which will match addresses (too) even if
2611 .Va showname
2612 is set (and POSIX says
2613 .Dq any address as shown in a header summary shall be matchable in this form ) ;
2614 However, if the
2615 .Va allnet
2616 variable is set, only the local part of the address is evaluated
2617 for the comparison, not ignoring case, and the setting of
2618 .Va showname
2619 is completely ignored.
2620 For finer control and match boundaries use the
2621 .Ql @
2622 search expression.
2623 .It Ar / Ns Ar string
2624 All messages that contain
2625 .Ar string
2626 in the subject field (case ignored).
2627 See also the
2628 .Va searchheaders
2629 variable.
2631 .Ar string
2632 is empty,
2633 the string from the previous specification of that type is used again.
2634 .It Xo Op Ar @ Ns Ar name-list Ns
2635 .Ar @ Ns Ar expr
2637 All messages that contain the given case-insensitive search
2638 .Ar expr Ns
2639 ession; if the \*(OPal regular expression (see
2640 .Xr re_format 7 )
2641 support is available
2642 .Ar expr
2643 will be interpreted as (an extended) one if any of the
2644 .Dq magical
2645 (extended) regular expression characters is seen: in this case this
2646 should match strings correctly which are in the locale
2647 .Ev LC_CTYPE
2648 encoding.
2649 If the optional
2650 .Ar @ Ns Ar name-list
2651 part is missing, the search is restricted to the subject field body,
2652 but otherwise
2653 .Ar name-list
2654 specifies a comma-separated list of header fields to search, as in
2656 .Dl '@to,from,cc@Someone i ought to know'
2658 In order to search for a string that includes a
2659 .Ql @
2660 (commercial at) character the
2661 .Ar name-list
2662 is effectively non-optional, but may be given as the empty string.
2663 Some special header fields may be abbreviated:
2664 .Ql f ,
2665 .Ql t ,
2666 .Ql c ,
2667 .Ql b
2669 .Ql s
2670 will match
2671 .Ql From ,
2672 .Ql To ,
2673 .Ql Cc ,
2674 .Ql Bcc
2676 .Ql Subject ,
2677 respectively and case-insensitively.
2678 The special names
2679 .Ql header
2681 .Ql <
2682 can be used to search in (all of) the header(s) of the message, and the
2683 special names
2684 .Ql body
2686 .Ql >
2688 .Ql text
2690 .Ql =
2691 can be used to perform full text searches \(en whereas the former
2692 searches only the body, the latter also searches the message header.
2694 This message specification performs full text comparison, but even with
2695 regular expression support it is almost impossible to write a search
2696 expression that savely matches only a specific address domain.
2697 To request that the content of the header is treated as a list of
2698 addresses, and to strip those down to the plain email address which the
2699 search expression is to be matched against, prefix the header name
2700 (abbreviation) with a tilde
2701 .Ql ~ :
2703 .Dl @~f@@a\e.safe\e.domain\e.match$
2704 .It Ar :c
2705 All messages of state
2706 .Ql c ,
2707 where
2708 .Ql c
2709 is one or multiple of the following colon modifiers:
2711 .Bl -tag -compact -width ".It Ar :M"
2712 .It Ar n
2713 .Ql new
2714 messages.
2715 .It Ar o
2716 Old messages (any not in state
2717 .Ql read
2719 .Ql new ) .
2720 .It Ar u
2721 .Ql unread
2722 messages.
2723 .It Ar d
2724 .Ql deleted
2725 messages (for the
2726 .Ic undelete
2728 .Ic from
2729 commands only).
2730 .It Ar r
2731 .Ql read
2732 messages.
2733 .It Ar f
2734 .Ic flag Ns
2735 ged messages.
2736 .It Ar a
2737 .Ic answered
2738 messages (cf. the variable
2739 .Va markanswered ) .
2740 .It Ar t
2741 Messages marked as
2742 .Ic draft .
2743 .It Ar s
2744 \*(OP Messages classified as spam (see
2745 .Sx "Handling spam" . )
2746 .It Ar S
2747 \*(OP Messages with unsure spam classification.
2751 \*(OP IMAP-style SEARCH expressions may also be used.
2752 This addressing mode is available with all types of mailbox
2753 .Ic folder Ns
2754 s; \*(UA will perform the search locally as necessary.
2755 Strings must be enclosed by double quotes
2756 .Ql \&"
2757 in their entirety if they contain whitespace or parentheses;
2758 within the quotes, only reverse solidus
2759 .Ql \e
2760 is recognized as an escape character.
2761 All string searches are case-insensitive.
2762 When the description indicates that the
2763 .Dq envelope
2764 representation of an address field is used,
2765 this means that the search string is checked against both a list
2766 constructed as
2767 .Bd -literal -offset indent
2768 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
2771 for each address,
2772 and the addresses without real names from the respective header field.
2773 These search expressions can be nested using parentheses, see below for
2774 examples.
2776 .Bl -tag -compact -width ".It Ar _n_u"
2777 .It Ar ( criterion )
2778 All messages that satisfy the given
2779 .Ar criterion .
2780 .It Ar ( criterion1 criterion2 ... criterionN )
2781 All messages that satisfy all of the given criteria.
2782 .It Ar ( or criterion1 criterion2 )
2783 All messages that satisfy either
2784 .Ar criterion1
2786 .Ar criterion2 ,
2787 or both.
2788 To connect more than two criteria using
2789 .Ql or
2790 specifications have to be nested using additional parentheses,
2791 as with
2792 .Ql (or a (or b c)) ,
2793 since
2794 .Ql (or a b c)
2795 really means
2796 .Ql ((a or b) and c) .
2797 For a simple
2798 .Ql or
2799 operation of independent criteria on the lowest nesting level,
2800 it is possible to achieve similar effects by using three separate
2801 criteria, as with
2802 .Ql (a) (b) (c) .
2803 .It Ar ( not criterion )
2804 All messages that do not satisfy
2805 .Ar criterion .
2806 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
2807 All messages that contain
2808 .Ar string
2809 in the envelope representation of the
2810 .Ql Bcc:
2811 field.
2812 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
2813 All messages that contain
2814 .Ar string
2815 in the envelope representation of the
2816 .Ql Cc:
2817 field.
2818 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
2819 All messages that contain
2820 .Ar string
2821 in the envelope representation of the
2822 .Ql From:
2823 field.
2824 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
2825 All messages that contain
2826 .Ar string
2827 in the
2828 .Ql Subject:
2829 field.
2830 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2831 All messages that contain
2832 .Ar string
2833 in the envelope representation of the
2834 .Ql To:
2835 field.
2836 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2837 All messages that contain
2838 .Ar string
2839 in the specified
2840 .Ql Name:
2841 field.
2842 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2843 All messages that contain
2844 .Ar string
2845 in their body.
2846 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2847 All messages that contain
2848 .Ar string
2849 in their header or body.
2850 .It Ar ( larger size )
2851 All messages that are larger than
2852 .Ar size
2853 (in bytes).
2854 .It Ar ( smaller size )
2855 All messages that are smaller than
2856 .Ar size
2857 (in bytes).
2858 .It Ar ( before date )
2859 All messages that were received before
2860 .Ar date ,
2861 which must be in the form
2862 .Ql d[d]-mon-yyyy ,
2863 where
2864 .Ql d
2865 denotes the day of the month as one or two digits,
2866 .Ql mon
2867 is the name of the month \(en one of
2868 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2870 .Ql yyyy
2871 is the year as four digits, e.g.,
2872 .Ql 28-Dec-2012 .
2873 .It Ar ( on date )
2874 All messages that were received on the specified date.
2875 .It Ar ( since date )
2876 All messages that were received since the specified date.
2877 .It Ar ( sentbefore date )
2878 All messages that were sent on the specified date.
2879 .It Ar ( senton date )
2880 All messages that were sent on the specified date.
2881 .It Ar ( sentsince date )
2882 All messages that were sent since the specified date.
2883 .It Ar ()
2884 The same criterion as for the previous search.
2885 This specification cannot be used as part of another criterion.
2886 If the previous command line contained more than one independent
2887 criterion then the last of those criteria is used.
2889 .Ss "On terminal control and line editor"
2890 \*(OP Terminal control will be realized through one of the standard
2892 libraries, either the
2893 .Lb libtermcap ,
2894 or, alternatively, the
2895 .Lb libterminfo ,
2896 both of which will be initialized to work with the environment variable
2897 .Ev TERM .
2898 Terminal control will enhance or enable interactive usage aspects, e.g.,
2899 .Sx "Coloured display" ,
2900 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
2901 byte-sequences of keys like the cursor and function keys.
2903 The internal variable
2904 .Va termcap
2905 can be used to overwrite settings or to learn (correct(ed)) keycodes.
2906 \*(UA may also become a fullscreen application by entering the
2907 so-called ca-mode and switching to an alternative exclusive screen
2908 (content) shall the terminal support it and the internal variable
2909 .Va termcap-ca-mode
2910 has been set explicitly.
2911 Actual interaction with the chosen library can be disabled completely by
2912 setting the internal variable
2913 .Va termcap-disable ;
2914 .Va termcap
2915 will be queried regardless, which is true even if the \*(OPal library
2916 support has not been enabled at configuration time as long as some other
2917 \*(OP which (may) query terminal control sequences has been enabled.
2919 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
2920 environments which comply to the ISO C standard
2921 .St -isoC-amd1 ,
2922 and will support wide glyphs if possible (the necessary functionality
2923 had been removed from ISO C, but was included in
2924 .St -xpg4 ) .
2925 Prevent usage of a line editor in interactive mode by setting the
2926 internal variable
2927 .Va line-editor-disable .
2928 Especially if the \*(OPal terminal control support is missing setting
2929 entries in the internal variable
2930 .Va termcap
2931 will help shall the MLE misbehave, see there for more.
2932 The MLE can support a little bit of
2933 .Ic colour .
2935 \*(OP If the
2936 .Ic history
2937 feature is available then input from line editor prompts will be saved
2938 in a history list that can be searched in and be expanded from.
2939 Such saving can be prevented by prefixing input with any amount of
2940 whitespace.
2941 Aspects of history, like allowed content and maximum size, as well as
2942 whether history shall be saved persistently, can be configured with the
2943 internal variables
2944 .Va history-file ,
2945 .Va history-gabby ,
2946 .Va history-gabby-persist
2948 .Va history-size .
2950 The MLE supports a set of editing and control commands.
2951 By default (as) many (as possible) of these will be assigned to a set of
2952 single-letter control codes, which should work on any terminal (and can
2953 be generated by holding the
2954 .Dq control
2955 key while pressing the key of desire, e.g.,
2956 .Ql control-D ) .
2957 If the \*(OPal
2958 .Ic bind
2959 command is available then the MLE commands can also be accessed freely
2960 by assigning the command name, which is shown in parenthesis in the list
2961 below, to any desired key-sequence, and the MLE will instead and also use
2962 .Ic bind
2963 to establish its built-in key bindings
2964 (more of them if the \*(OPal terminal control is available),
2965 an action which can then be suppressed completely by setting
2966 .Va line-editor-no-defaults .
2967 .Sx "Shell-style argument quoting"
2968 notation is used in the following;
2969 combinations not mentioned either cause job control signals or do not
2970 generate a (unique) keycode:
2972 .Bl -tag -compact -width ".It Ql \eBa"
2973 .It Ql \ecA
2974 Go to the start of the line
2976 .Pf ( Cd mle-go-home ) .
2977 .It Ql \ecB
2978 Move the cursor backward one character
2980 .Pf ( Cd mle-go-bwd ) .
2981 .It Ql \ecD
2982 Forward delete the character under the cursor;
2983 quits \*(UA if used on the empty line unless the internal variable
2984 .Va ignoreeof
2985 is set
2987 .Pf ( Cd mle-del-fwd ) .
2988 .It Ql \ecE
2989 Go to the end of the line
2991 .Pf ( Cd mle-go-end ) .
2992 .It Ql \ecF
2993 Move the cursor forward one character
2995 .Pf ( Cd mle-go-fwd ) .
2996 .It Ql \ecG
2997 Cancel current operation, full reset.
2998 If there is an active history search or tabulator expansion then this
2999 command will first reset that, reverting to the former line content;
3000 thus a second reset is needed for a full reset in this case
3002 .Pf ( Cd mle-reset ) .
3003 .It Ql \ecH
3004 Backspace: backward delete one character
3006 .Pf ( Cd mle-del-bwd ) .
3007 .It Ql \ecI
3008 \*(NQ
3009 Horizontal tabulator:
3010 try to expand the word before the cursor, supporting the usual
3011 .Sx "Filename transformations"
3013 .Pf ( Cd mle-complete ) .
3014 This is affected by
3015 .Cd mle-quote-rndtrip .
3016 .It Ql \ecJ
3017 Newline:
3018 commit the current line
3020 .Pf ( Cd mle-commit ) .
3021 .It Ql \ecK
3022 Cut all characters from the cursor to the end of the line
3024 .Pf ( Cd mle-snarf-end ) .
3025 .It Ql \ecL
3026 Repaint the line
3028 .Pf ( Cd mle-repaint ) .
3029 .It Ql \ecN
3030 \*(OP Go to the next history entry
3032 .Pf ( Cd mle-hist-fwd ) .
3033 .It Ql \ecO
3034 (\*(OPally context-dependent) Invokes the command
3035 .Ic dt .
3036 .It Ql \ecP
3037 \*(OP Go to the previous history entry
3039 .Pf ( Cd mle-hist-bwd ) .
3040 .It Ql \ecQ
3041 Toggle roundtrip mode shell quotes, where produced,
3042 on and off
3044 .Pf ( Cd mle-quote-rndtrip ) .
3045 This setting is temporary, and will be forgotten once the command line
3046 is committed; also see
3047 .Ic shcodec .
3048 .It Ql \ecR
3049 \*(OP Complete the current line from (the remaining) older history entries
3051 .Pf ( Cd mle-hist-srch-bwd ) .
3052 .It Ql \ecS
3053 \*(OP Complete the current line from (the remaining) newer history entries
3055 .Pf ( Cd mle-hist-srch-fwd ) .
3056 .It Ql \ecT
3057 Paste the snarf buffer
3059 .Pf ( Cd mle-paste ) .
3060 .It Ql \ecU
3061 The same as
3062 .Ql \ecA
3063 followed by
3064 .Ql \ecK
3066 .Pf ( Cd mle-snarf-line ) .
3067 .It Ql \ecV
3068 Prompts for a Unicode character (its hexadecimal number) to be inserted
3070 .Pf ( Cd mle-prompt-char ) .
3071 Note this command needs to be assigned to a single-letter control code
3072 in order to become recognized and executed during input of
3073 a key-sequence (only three single-letter control codes can be used for
3074 that shortcut purpose); this control code is special-treated and cannot
3075 be part of any other sequence, because any occurrence will perform the
3076 .Cd mle-prompt-char
3077 function immediately.
3078 .It Ql \ecW
3079 Cut the characters from the one preceding the cursor to the preceding
3080 word boundary
3082 .Pf ( Cd mle-snarf-word-bwd ) .
3083 .It Ql \ecX
3084 Move the cursor forward one word boundary
3086 .Pf ( Cd mle-go-word-fwd ) .
3087 .It Ql \ecY
3088 Move the cursor backward one word boundary
3090 .Pf ( Cd mle-go-word-bwd ) .
3091 .It Ql \ec[
3092 Escape: reset a possibly used multibyte character input state machine
3093 and \*(OPally a lingering, incomplete key binding
3095 .Pf ( Cd mle-cancel ) .
3096 This command needs to be assigned to a single-letter control code in
3097 order to become recognized and executed during input of a key-sequence
3098 (only three single-letter control codes can be used for that shortcut
3099 purpose).
3100 This control code may also be part of a multi-byte sequence, but if
3101 a sequence is active and the very control code is currently also an
3102 expected input, then it will first be consumed by the active sequence.
3103 .It Ql \ec\e
3104 (\*(OPally context-dependent) Invokes the command
3105 .Ql Ic z Ns + .
3106 .It Ql \ec]
3107 (\*(OPally context-dependent) Invokes the command
3108 .Ql Ic z Ns $ .
3109 .It Ql \ec^
3110 (\*(OPally context-dependent) Invokes the command
3111 .Ql Ic z Ns 0 .
3112 .It Ql \ec_
3113 Cut the characters from the one after the cursor to the succeeding word
3114 boundary
3116 .Pf ( Cd mle-snarf-word-fwd ) .
3117 .It Ql \ec?
3118 Backspace:
3119 .Cd mle-del-bwd .
3120 .It \(en
3122 .Cd mle-fullreset :
3123 different to
3124 .Cd mle-reset
3125 this will immediately reset a possibly active search etc.
3126 .It \(en
3128 .Cd mle-bell :
3129 ring the audible bell.
3131 .Ss "Coloured display"
3132 \*(OP \*(UA can be configured to support a coloured display and font
3133 attributes by emitting ANSI a.k.a. ISO 6429 SGR (select graphic
3134 rendition) escape sequences.
3135 Usage of colours and font attributes solely depends upon the
3136 capability of the detected terminal type that is defined by the
3137 environment variable
3138 .Ev TERM
3139 and which can be fine-tuned by the user via the internal variable
3140 .Va termcap .
3142 On top of what \*(UA knows about the terminal the boolean variable
3143 .Va colour-pager
3144 defines whether the actually applicable colour and font attribute
3145 sequences should also be generated when output is going to be paged
3146 through the external program defined by the environment variable
3147 .Ev PAGER
3148 (also see
3149 .Va crt Ns
3151 This is not enabled by default because different pager programs need
3152 different command line switches or other configuration in order to
3153 support those sequences.
3154 \*(UA however knows about some widely used pagers and in a clean
3155 environment it is often enough to simply set
3156 .Va colour-pager ;
3157 please refer to that variable for more on this topic.
3159 If the variable
3160 .Va colour-disable
3161 is set then any active usage of colour and font attribute sequences
3162 is suppressed, but without affecting possibly established
3163 .Ic colour
3164 mappings.
3166 To define and control colours and font attributes a single multiplexer
3167 command family exists:
3168 .Ic colour
3169 shows or defines colour mappings for the given colour type (e.g.,
3170 monochrome) and
3171 .Ic uncolour
3172 can be used to remove mappings of a given colour type.
3173 Since colours are only available in interactive mode, it may make
3174 sense to conditionalize the colour setup by encapsulating it with
3175 .Ic if :
3176 .Bd -literal -offset indent
3177 if terminal && [ "$features" =% +colour ]
3178   colour iso view-msginfo ft=bold,fg=green
3179   colour iso view-header ft=bold,fg=red from,subject
3180   colour iso view-header fg=red
3182   uncolour iso view-header from,subject
3183   colour iso view-header ft=bold,fg=magenta,bg=cyan
3184   colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
3185   colour mono view-header ft=bold
3186   colour mono view-header ft=bold,ft=reverse subject,from
3187 endif
3189 .Ss "Handling spam"
3190 \*(OP \*(UA can make use of several spam interfaces for the purpose of
3191 identification of, and, in general, dealing with spam messages.
3192 A precondition of most commands in order to function is that the
3193 .Va spam-interface
3194 variable is set to one of the supported interfaces.
3195 Once messages have been identified as spam their (volatile)
3196 .Ql is-spam
3197 state can be prompted: the
3198 .Ql Ar :s
3200 .Ql Ar :S
3201 message specifications will address respective messages and their
3202 .Va attrlist
3203 entries will be used when displaying the
3204 .Va headline
3205 in the header display.
3206 .Bl -bullet
3208 .Ic spamrate
3209 rates the given messages and sets their
3210 .Ql is-spam
3211 flag accordingly.
3212 If the spam interface offers spam scores those can also be displayed in
3213 the header display by including the
3214 .Ql %$
3215 format in the
3216 .Va headline
3217 variable.
3219 .Ic spamham ,
3220 .Ic spamspam
3222 .Ic spamforget
3223 will interact with the Bayesian filter of the chosen interface and learn
3224 the given messages as
3225 .Dq ham
3227 .Dq spam ,
3228 respectively; the last command can be used to cause
3229 .Dq unlearning
3230 of messages; it adheres to their current
3231 .Ql is-spam
3232 state and thus reverts previous teachings.
3234 .Ic spamclear
3236 .Ic spamset
3237 will simply set and clear, respectively, the mentioned volatile
3238 .Ql is-spam
3239 message flag, without any interface interaction.
3243 .Xr spamassassin 1
3244 based
3245 .Va spam-interface
3246 .Ql spamc
3247 requires a running instance of the
3248 .Xr spamd 1
3249 server in order to function, started with the option
3250 .Fl -allow-tell
3251 shall Bayesian filter learning be possible.
3252 .Bd -literal -offset indent
3253 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
3254 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
3255     --daemonize [--local] [--allow-tell]
3258 Thereafter \*(UA can make use of these interfaces:
3259 .Bd -literal -offset indent
3260 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3261     -Sspamc-command=/usr/local/bin/spamc \e
3262     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
3264 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3265     -Sspamc-command=/usr/local/bin/spamc \e
3266     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
3269 Using the generic filter approach allows usage of programs like
3270 .Xr bogofilter 1 .
3271 Here is an example, requiring it to be accessible via
3272 .Ev PATH :
3273 .Bd -literal -offset indent
3274 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
3275     -Sspamfilter-ham="bogofilter -n" \e
3276     -Sspamfilter-noham="bogofilter -N" \e
3277     -Sspamfilter-nospam="bogofilter -S" \e
3278     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
3279     -Sspamfilter-spam="bogofilter -s" \e
3280     -Sspamfilter-rate-scanscore="1;^(.+)$"
3283 Because messages must exist on local storage in order to be scored (or
3284 used for Bayesian filter training), it is possibly a good idea to
3285 perform the local spam check last:
3286 .Bd -literal -offset indent
3287 define spamdelhook {
3288   # Server side DCC
3289   spamset (header x-dcc-brand-metrics "bulk")
3290   # Server-side spamassassin(1)
3291   spamset (header x-spam-flag "YES")
3292   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
3293   move :S +maybe-spam
3294   spamrate :u
3295   del :s
3296   move :S +maybe-spam
3298 set folder-hook-FOLDER=spamdelhook
3301 See also the documentation for the variables
3302 .Va spam-interface , spam-maxsize ,
3303 .Va spamc-command , spamc-arguments , spamc-user ,
3304 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
3305   spamfilter-rate
3307 .Va spamfilter-rate-scanscore .
3308 .Sh COMMANDS
3309 \*(UA reads input in lines.
3310 An unquoted reverse solidus
3311 .Ql \e
3312 at the end of a command line
3313 .Dq escapes
3314 the newline character: it is discarded and the next line of input is
3315 used as a follow-up line, with all leading whitespace removed;
3316 once an entire line is completed, the whitespace characters
3317 .Cm space , tabulator , newline
3318 as well as those defined by the variable
3319 .Va ifs
3320 are removed from the beginning and end.
3321 Placing any whitespace characters at the beginning of a line will
3322 prevent a possible addition of the command line to the \*(OPal
3323 .Ic history .
3325 The beginning of such input lines is then scanned for the name of
3326 a known command: command names may be abbreviated, in which case the
3327 first command that matches the given prefix will be used.
3328 .Sx "Command modifiers"
3329 may prefix a command in order to modify its behaviour.
3330 A name may also be a
3331 .Ic commandalias ,
3332 which will become expanded until no more expansion is possible.
3333 Once the command that shall be executed is known, the remains of the
3334 input line will be interpreted according to command-specific rules:
3335 (\*(ID) some commands use
3336 .Sx "Shell-style argument quoting" ,
3337 so that a single input line may actually consist of multiple commands,
3338 but others pass it unchanged as
3339 .Sx "Raw data arguments for codec commands" .
3341 The command
3342 .Ic list
3343 can be used to show the list of all commands, either alphabetically
3344 sorted or in prefix search order (these do not match, also because the
3345 POSIX standard prescribes a set of abbreviations).
3346 \*(OPally the command
3347 .Ic help
3349 .Ic \&? ) ,
3350 when given an argument, will show a documentation string for the
3351 command matching the expanded argument, as in
3352 .Ql ?t ,
3353 which should be a shorthand of
3354 .Ql ?type ;
3355 with these documentation strings both commands support a more
3356 .Va verbose
3357 listing mode which includes the argument type of the command and other
3358 information which applies; a handy suggestion might thus be:
3359 .Bd -literal -offset indent
3360 ? define __xv {
3361   # Before v15: need to enable sh(1)ell-style on _entire_ line!
3362   localopts 1;wysh set verbose;ignerr eval "${@}";return ${?}
3364 ? commandalias xv '\ecall __xv'
3365 ? xv help set
3367 .Ss "Command modifiers"
3368 Commands may be prefixed by one or multiple command modifiers.
3369 .Bl -bullet
3371 The modifier reverse solidus
3373 .Cm \e ,
3374 to be placed first, prevents
3375 .Ic commandalias
3376 expansions on the remains of the line, e.g.,
3377 .Ql \eecho
3378 will always evaluate the command
3379 .Ic echo ,
3380 even if an (command)alias of the same name exists.
3381 .Ic commandalias
3382 content may itself contain further command modifiers, including
3383 an initial reverse solidus to prevent further expansions.
3385 The modifier
3387 .Cm ignerr
3388 indicates that any error generated by the following command should be
3389 ignored by the state machine and not cause a program exit with enabled
3390 .Va errexit
3391 or for the standardized exit cases in
3392 .Ev POSIXLY_CORRECT
3393 mode.
3394 .Va \&? ,
3395 one of the
3396 .Sx "INTERNAL VARIABLES" ,
3397 will be set to the real exit status of the command regardless.
3399 Some commands support the
3401 .Cm vput
3402 modifier: if used, they expect the name of a variable, which can itself
3403 be a variable, i.e., shell expansion is applied, as their first
3404 argument, and will place their computation result in it instead of the
3405 default location (it is usually written to standard output).
3407 The given name will be tested for being a valid
3408 .Xr sh 1
3409 variable name, and may therefore only consist of upper- and lowercase
3410 characters, digits, and the underscore; the hyphen-minus may be used as
3411 a non-portable extension; digits may not be used as first, hyphen-minus
3412 may not be used as last characters.
3413 In addition the name may either not be one of the known
3414 .Sx "INTERNAL VARIABLES" ,
3415 or must otherwise refer to a writable (non-boolean) value variable.
3416 The actual put operation may fail nonetheless, e.g., if the variable
3417 expects a number argument only a number will be accepted.
3418 Any error during these operations causes the command as such to fail,
3419 and the error number
3420 .Va \&!
3421 will be set to
3422 .Va ^ERR Ns -NOTSUP ,
3423 the exit status
3424 .Va \&?
3425 should be set to
3426 .Ql -1 .
3428 Last, but not least, the modifier
3430 .Cm wysh
3431 can be used for some old and established commands to choose the new
3432 .Sx "Shell-style argument quoting"
3433 rules over the traditional
3434 .Sx "Old-style argument quoting" .
3436 .Ss "Message list arguments"
3437 Some commands expect arguments that represent messages (actually
3438 their symbolic message numbers), as has been documented above under
3439 .Sx "Specifying messages"
3440 already.
3441 If no explicit message list has been specified, the next message
3442 forward that satisfies the command's requirements will be used,
3443 and if there are no messages forward of the current message,
3444 the search proceeds backwards;
3445 if there are no good messages at all to be found, an error message is
3446 shown and the command is aborted.
3447 .Ss "Old-style argument quoting"
3448 \*(ID This section documents the old, traditional style of quoting
3449 non-message-list arguments to commands which expect this type of
3450 arguments: whereas still used by the majority of such commands, the new
3451 .Sx "Shell-style argument quoting"
3452 may be available even for those via
3453 .Cm wysh ,
3454 one of the
3455 .Sx "Command modifiers" .
3456 Nonetheless care must be taken, because only new commands have been
3457 designed with all the capabilities of the new quoting rules in mind,
3458 which can, e.g., generate control characters.
3459 .Bl -bullet -offset indent
3461 An argument can be enclosed between paired double-quotes
3462 .Ql """argument"""
3464 single-quotes
3465 .Ql 'argument' ;
3466 any whitespace, shell word expansion, or reverse solidus characters
3467 (except as described next) within the quotes are treated literally as
3468 part of the argument.
3469 A double-quote will be treated literally within single-quotes and vice
3470 versa.
3471 Inside such a quoted string the actually used quote character can be
3472 used nonetheless by escaping it with a reverse solidus
3473 .Ql \e ,
3474 as in
3475 .Ql """y\e""ou""" .
3477 An argument that is not enclosed in quotes, as above, can usually still
3478 contain space characters if those spaces are reverse solidus escaped, as in
3479 .Ql you\e are .
3481 A reverse solidus outside of the enclosing quotes is discarded
3482 and the following character is treated literally as part of the argument.
3484 .Ss "Shell-style argument quoting"
3485 Commands which don't expect message-list arguments use
3486 .Xr sh 1 Ns
3487 ell-style, and therefore POSIX standardized, argument parsing and
3488 quoting rules.
3489 \*(ID Most new commands only support these new rules and are flagged
3490 \*(NQ, some elder ones can use them with the command modifier
3491 .Cm wysh ;
3492 in the future only this type of argument quoting will remain.
3494 A command line is parsed from left to right and an input token is
3495 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3496 Metacharacters are vertical bar
3497 .Cm \&| ,
3498 ampersand
3499 .Cm & ,
3500 semicolon
3501 .Cm \&; ,
3502 as well as all characters from the variable
3503 .Va ifs ,
3504 and / or
3505 .Cm space , tabulator , newline .
3506 The additional metacharacters left and right parenthesis
3507 .Cm \&( , \&)
3508 and less-than and greater-than signs
3509 .Cm < , >
3510 that the
3511 .Xr sh 1
3512 supports are not used, and are treated as ordinary characters: for one
3513 these characters are a vivid part of email addresses, and it seems
3514 highly unlikely that their function will become meaningful to \*(UA.
3515 .Bd -filled -offset indent
3516 .Sy Compatibility note:
3517 \*(ID Please note that even many new-style commands do not yet honour
3518 .Va ifs
3519 to parse their arguments: whereas the
3520 .Xr sh 1 Ns
3521 ell is a language with syntactic elements of clearly defined semantics,
3522 \*(UA parses entire input lines and decides on a per-command base what
3523 to do with the rest of the line.
3524 This also means that whenever an unknown command is seen all that \*(UA
3525 can do is cancellation of the processing of the remains of the line.
3527 It also often depends on an actual subcommand of a multiplexer command
3528 how the rest of the line should be treated, and until v15 we are not
3529 capable to perform this deep inspection of arguments.
3530 Nonetheless, at least the following commands which work with positional
3531 parameters fully support
3532 .Va ifs
3533 for an almost shell-compatible field splitting:
3534 .Ic call , call_if , read , vpospar , xcall .
3537 Any unquoted number sign
3538 .Ql #
3539 at the beginning of a new token starts a comment that extends to the end
3540 of the line, and therefore ends argument processing.
3541 An unquoted dollar sign
3542 .Ql $
3543 will cause variable expansion of the given name, which must be a valid
3544 .Xr sh 1 Ns
3545 ell-style variable name (see
3546 .Cm vput ) :
3547 .Sx "INTERNAL VARIABLES"
3548 as well as
3549 .Sx ENVIRONMENT
3550 (shell) variables can be accessed through this mechanism, brace
3551 enclosing the name is supported (i.e., to subdivide a token).
3553 Whereas the metacharacters
3554 .Cm space , tabulator , newline
3555 only complete an input token, vertical bar
3556 .Cm \&| ,
3557 ampersand
3558 .Cm &
3559 and semicolon
3560 .Cm \&;
3561 also act as control operators and perform control functions.
3562 For now supported is semicolon
3563 .Cm \&; ,
3564 which terminates a single command, therefore sequencing the command line
3565 and making the remainder of the line a subject to reevaluation.
3566 With sequencing, multiple command argument types and quoting rules may
3567 therefore apply to a single line, which can become problematic before
3568 v15: e.g., the first of the following will cause surprising results.
3570 .Dl ? echo one; set verbose; echo verbose=$verbose.
3571 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
3573 Quoting is a mechanism that will remove the special meaning of
3574 metacharacters and reserved words, and will prevent expansion.
3575 There are four quoting mechanisms: the escape character, single-quotes,
3576 double-quotes and dollar-single-quotes:
3577 .Bl -bullet -offset indent
3579 The literal value of any character can be preserved by preceding it
3580 with the escape character reverse solidus
3581 .Ql \e .
3583 Arguments which are enclosed in
3584 .Ql 'single-\:quotes'
3585 retain their literal value.
3586 A single-quote cannot occur within single-quotes.
3588 The literal value of all characters enclosed in
3589 .Ql \(dqdouble-\:quotes\(dq
3590 is retained, with the exception of dollar sign
3591 .Ql $ ,
3592 which will cause variable expansion, as above, backquote (grave accent)
3593 .Ql ` ,
3594 (which not yet means anything special), reverse solidus
3595 .Ql \e ,
3596 which will escape any of the characters dollar sign
3597 .Ql $
3598 (to prevent variable expansion), backquote (grave accent)
3599 .Ql ` ,
3600 double-quote
3601 .Ql \(dq
3602 (to prevent ending the quote) and reverse solidus
3603 .Ql \e
3604 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3605 but has no special meaning otherwise.
3607 Arguments enclosed in
3608 .Ql $'dollar-\:single-\:quotes'
3609 extend normal single quotes in that reverse solidus escape sequences are
3610 expanded as follows:
3612 .Bl -tag -compact -width "Ql \eNNN"
3613 .It Ql \ea
3614 bell control character (ASCII and ISO-10646 BEL).
3615 .It Ql \eb
3616 backspace control characer (ASCII and ISO-10646 BS).
3617 .It Ql \eE
3618 escape control character (ASCII and ISO-10646 ESC).
3619 .It Ql \ee
3620 the same.
3621 .It Ql \ef
3622 form feed control character (ASCII and ISO-10646 FF).
3623 .It Ql \en
3624 line feed control character (ASCII and ISO-10646 LF).
3625 .It Ql \er
3626 carriage return control character (ASCII and ISO-10646 CR).
3627 .It Ql \et
3628 horizontal tabulator control character (ASCII and ISO-10646 HT).
3629 .It Ql \ev
3630 vertical tabulator control character (ASCII and ISO-10646 VT).
3631 .It Ql \e\e
3632 emits a reverse solidus character.
3633 .It Ql \e'
3634 single quote.
3635 .It Ql \e"
3636 double quote (escaping is optional).
3637 .It Ql \eNNN
3638 eight-bit byte with the octal value
3639 .Ql NNN
3640 (one to three octal digits), optionally prefixed by an additional
3641 .Ql 0 .
3642 A 0 byte will suppress further output for the quoted argument.
3643 .It Ql \exHH
3644 eight-bit byte with the hexadecimal value
3645 .Ql HH
3646 (one or two hexadecimal characters).
3647 A 0 byte will suppress further output for the quoted argument.
3648 .It Ql \eUHHHHHHHH
3649 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3650 .Ql HHHHHHHH
3651 (one to eight hexadecimal digits) \(em note that Unicode defines the
3652 maximum codepoint ever to be supported as
3653 .Ql 0x10FFFF
3654 (in planes of
3655 .Ql 0xFFFF
3656 characters each).
3657 This escape is only supported in locales that support Unicode (see
3658 .Sx "Character sets" ) ,
3659 in other cases the sequence will remain unexpanded unless the given code
3660 point is ASCII compatible or (if the \*(OPal character set conversion is
3661 available) can be represented in the current locale.
3662 The character NUL will suppress further output for the quoted argument.
3663 .It Ql \euHHHH
3664 Identical to
3665 .Ql \eUHHHHHHHH
3666 except it takes only one to four hexadecimal digits.
3667 .It Ql \ecX
3668 Emits the non-printable (ASCII and compatible) C0 control codes
3669 0 (NUL) to 31 (US), and 127 (DEL).
3670 Printable representations of ASCII control codes can be created by
3671 mapping them to a different part of the ASCII character set, which is
3672 possible by adding the number 64 for the codes 0 to 31, e.g., 7 (BEL) is
3673 .Ql 7 + 64 = 71 = G .
3674 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3675 .Ic vexpr ) ,
3676 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3677 .Ql ? vexpr ^ 127 64 .
3679 Whereas historically circumflex notation has often been used for
3680 visualization purposes of control codes, e.g.,
3681 .Ql ^G ,
3682 the reverse solidus notation has been standardized:
3683 .Ql \ecG .
3684 Some control codes also have standardized (ISO-10646, ISO C) aliases,
3685 as shown above (e.g.,
3686 .Ql \ea ,
3687 .Ql \en ,
3688 .Ql \et ) :
3689 whenever such an alias exists it will be used for display purposes.
3690 The control code NUL
3691 .Pf ( Ql \ec@ ,
3692 a non-standard extension) will suppress further output for the remains
3693 of the token (which may extend beyond the current quote), or, depending
3694 on the context, the remains of all arguments for the current command.
3695 .It Ql \e$NAME
3696 Non-standard extension: expand the given variable name, as above.
3697 Brace enclosing the name is supported.
3698 .It Ql \e`{command}
3699 Not yet supported, just to raise awareness: Non-standard extension.
3703 Caveats:
3704 .Bd -literal -offset indent
3705 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3706 ? echo Quotes ${HOME} and tokens differ! # comment
3707 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3709 .Ss "Raw data arguments for codec commands"
3710 A special set of commands, which all have the string
3711 .Dq codec
3712 in their name, e.g.,
3713 .Ic addrcodec ,
3714 .Ic shcodec ,
3715 .Ic urlcodec ,
3716 take raw string data as input, which means that the content of the
3717 command input line is passed completely unexpanded and otherwise
3718 unchanged: like this the effect of the actual codec is visible without
3719 any noise of possible shell quoting rules etc., i.e., the user can input
3720 one-to-one the desired or questionable data.
3721 To gain a level of expansion, the entire command line can be
3722 .Ic eval Ns
3723 uated first, e.g.,
3724 .Bd -literal -offset indent
3725 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
3726 ? echo $res
3727 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3728 ? shcodec d $res
3729 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3730 ? eval shcodec d $res
3731 /usr/Sch\[:o]nes Wetter/heute.txt
3733 .Ss "Filename transformations"
3734 Filenames, where expected, and unless documented otherwise, are
3735 subsequently subject to the following filename transformations, in
3736 sequence:
3737 .Bl -bullet -offset indent
3739 If the given name is a registered
3740 .Ic shortcut ,
3741 it will be replaced with the expanded shortcut.
3743 The filename is matched against the following patterns or strings:
3745 .Bl -hang -compact -width ".Ar %user"
3746 .It Ar #
3747 (Number sign) is expanded to the previous file.
3748 .It Ar %
3749 (Percent sign) is replaced by the invoking
3750 .Mx -ix "primary system mailbox"
3751 user's primary system mailbox, which either is the (itself expandable)
3752 .Va inbox
3753 if that is set, the standardized absolute pathname indicated by
3754 .Ev MAIL
3755 if that is set, or a built-in compile-time default otherwise.
3756 .It Ar %user
3757 Expands to the primary system mailbox of
3758 .Ar user
3759 (and never the value of
3760 .Va inbox ,
3761 regardless of its actual setting).
3762 .It Ar &
3763 (Ampersand) is replaced with the invoking users
3764 .Mx -ix "secondary mailbox"
3765 secondary mailbox, the
3766 .Ev MBOX .
3767 .It Ar +file
3768 Refers to a
3769 .Ar file
3770 in the
3771 .Va folder
3772 directory (if that variable is set).
3773 .It Ar %:filespec
3774 Expands to the same value as
3775 .Ar filespec ,
3776 but has special meaning when used with, e.g., the command
3777 .Ic file :
3778 the file will be treated as a primary system mailbox by, e.g., the
3779 .Ic mbox
3781 .Ic save
3782 commands, meaning that messages that have been read in the current
3783 session will be moved to the
3784 .Ev MBOX
3785 mailbox instead of simply being flagged as read.
3788 Meta expansions are applied to the resulting filename, as applicable to
3789 the resulting file access protocol (also see
3790 .Sx "On URL syntax and credential lookup" ) .
3791 If the fully expanded filename results in multiple pathnames and the
3792 command is expecting only one file, an error results.
3794 For the file-protocol, a leading tilde
3795 .Ql ~
3796 character will be replaced by the expansion of
3797 .Ev HOME ,
3798 except when followed by a valid user name, in which case the home
3799 directory of the given user is used instead.
3801 In addition a shell expansion as if specified in double-quotes (see
3802 .Sx "Shell-style argument quoting" )
3803 is applied, so that any occurrence of
3804 .Ql $VARIABLE
3806 .Ql ${VARIABLE} )
3807 will be replaced by the expansion of the variable, if possible;
3808 .Sx "INTERNAL VARIABLES"
3809 as well as
3810 .Sx ENVIRONMENT
3811 (shell) variables can be accessed through this mechanism.
3813 In interactive context, in order to allow simple value acceptance (via
3814 .Dq ENTER ) ,
3815 arguments will usually be displayed in a properly quoted form, e.g., a file
3816 .Ql diet\e is \ecurd.txt
3817 may be displayed as
3818 .Ql 'diet\e is \ecurd.txt' .
3820 .Ss "Commands"
3821 The following commands are available:
3822 .Bl -tag -width ".It Ic BaNg"
3824 .It Ic \&!
3825 Executes the
3826 .Ev SHELL
3827 command which follows, replacing unescaped exclamation marks with the
3828 previously executed command if the internal variable
3829 .Va bang
3830 is set.
3831 This command supports
3832 .Cm vput
3833 as documented in
3834 .Sx "Command modifiers" ,
3835 and manages the error number
3836 .Va \&! .
3837 A 0 or positive exit status
3838 .Va \&?
3839 reflects the exit status of the command, negative ones that
3840 an error happened before the command was executed, or that the program
3841 did not exit cleanly, but, e.g., due to a signal: the error number is
3842 .Va ^ERR Ns -CHILD ,
3843 then.
3845 In conjunction with the
3846 .Cm vput
3847 modifier the following special cases exist:
3848 a negative exit status occurs if the collected data could not be stored
3849 in the given variable, which is a
3850 .Va ^ERR Ns -NOTSUP
3851 error that should otherwise not occur.
3852 .Va ^ERR Ns -CANCELED
3853 indicates that no temporary file could be created to collect the command
3854 output at first glance.
3855 In case of catchable out-of-memory situations
3856 .Va ^ERR Ns -NOMEM
3857 will occur and \*(UA will try to store the empty string, just like with
3858 all other detected error conditions.
3860 .It Ic #
3861 The comment-command causes the entire line to be ignored.
3862 .Sy Note:
3863 this really is a normal command which' purpose is to discard its
3864 arguments, not a
3865 .Dq comment-start
3866 indicating special character, which means that, e.g., trailing comments
3867 on a line are not possible.
3869 .It Ic +
3870 Goes to the next message in sequence and types it
3871 (like
3872 .Dq ENTER ) .
3874 .It Ic -
3875 Display the preceding message, or the n'th previous message if given
3876 a numeric argument n.
3878 .It Ic =
3879 Show the current message number (the
3880 .Dq dot ) .
3882 .It Ic \&?
3883 Show a brief summary of commands.
3884 \*(OP Given an argument a synopsis for the command in question is
3885 shown instead; commands can be abbreviated in general and this command
3886 can be used to see the full expansion of an abbreviation including the
3887 synopsis, try, e.g.,
3888 .Ql ?h ,
3889 .Ql ?hel
3891 .Ql ?help
3892 and see how the output changes.
3893 This mode also supports a more
3894 .Va verbose
3895 output, which will provide the informations documented for
3896 .Ic list .
3898 .It Ic \&|
3899 A synonym for the
3900 .Ic pipe
3901 command.
3904 .It Ic account , unaccount
3905 (ac, una) Creates, selects or lists (an) account(s).
3906 Accounts are special incarnations of
3907 .Ic define Ns d
3908 macros and group commands and variable settings which together usually
3909 arrange the environment for the purpose of creating an email account.
3910 Different to normal macros settings which are covered by
3911 .Ic localopts
3912 \(en here by default enabled! \(en will not be reverted before the
3913 .Ic account
3914 is changed again.
3915 The special account
3916 .Ql null
3917 (case-insensitive) always exists, and all but it can be deleted by the
3918 latter command, and in one operation with the special name
3919 .Ql * .
3921 Without arguments a listing of all defined accounts is shown.
3922 With one argument the given account is activated: the system
3923 .Va inbox
3924 of that account will be activated (as via
3925 .Ic file ) ,
3926 a possibly installed
3927 .Va folder-hook
3928 will be run, and the internal variable
3929 .Va account
3930 will be updated.
3931 The two argument form is identical to defining a macro as via
3932 .Ic define :
3933 .Bd -literal -offset indent
3934 account myisp {
3935   set folder=~/mail inbox=+syste.mbox record=+sent.mbox
3936   set from='(My Name) myname@myisp.example'
3937   set mta=smtp://mylogin@smtp.myisp.example
3941 .It Ic addrcodec
3942 Perform email address codec transformations on raw-data argument, rather
3943 according to email standards (RFC 5322; \*(ID will furtherly improve).
3944 Supports
3945 .Cm vput
3946 (see
3947 .Sx "Command modifiers" ) ,
3948 and manages the error number
3949 .Va \&! .
3950 The first argument must be either
3951 .Ar [+[+[+]]]e[ncode] ,
3952 .Ar d[ecode]
3954 .Ar s[kin] ,
3955 and specifies the operation to perform on the rest of the line.
3957 Decoding will show how a standard-compliant MUA will display the given
3958 argument, which should be an email address.
3959 Please be aware that most MUAs have difficulties with the address
3960 standards, and vary wildly when (comments) in parenthesis,
3961 .Dq double-quoted
3962 strings, or quoted-pairs, as below, become involved.
3963 \*(ID \*(UA currently does not perform decoding when displaying addresses.
3965 Skinning is identical to decoding but only outputs the plain address,
3966 without any string, comment etc. components.
3967 Another difference is that it may fail with the error number
3968 .Va \&!
3969 set to
3970 .Va ^ERR Ns -INVAL
3971 if decoding fails to find a(n) (valid) email address, in which case the
3972 unmodified input will be output again.
3974 Encoding supports four different modes, lesser automated versions can be
3975 chosen by prefixing one, two or three plus signs: the standard imposes
3976 a special meaning on some characters, which thus have to be transformed
3977 to so-called quoted-pairs by pairing them with a reverse solidus
3978 .Ql \e
3979 in order to remove the special meaning; this might change interpretation
3980 of the entire argument from what has been desired, however!
3981 Specify one plus sign to remark that parenthesis shall be left alone,
3982 two for not turning double quotation marks into quoted-pairs, and three
3983 for also leaving any user-specified reverse solidus alone.
3984 The result will always be valid, if a successful exit status is reported.
3985 \*(ID Addresses need to be specified in between angle brackets
3986 .Ql < ,
3987 .Ql >
3988 if the construct becomes more difficult, otherwise the current parser
3989 will fail; it is not smart enough to guess right.
3990 .Bd -literal -offset indent
3991 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
3992 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3993 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3994 "Hey, you", \e out\e there <diet@exam.ple>
3995 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3996 diet@exam.ple
4000 .It Ic alias , unalias
4001 (a, una) Aliases are a method of creating personal distribution lists
4002 that map a single alias name to none to multiple real receivers;
4003 these aliases become expanded after message composing is completed.
4004 The latter command removes the given list of aliases, the special name
4005 .Ql *
4006 will discard all existing aliases.
4007 The former command shows all currently defined aliases when used without
4008 arguments, and with one argument the expansion of the given alias.
4009 With more than one argument, creates or appends to the alias name given
4010 as the first argument the remaining arguments.
4011 Alias names are restricted to alphabetic characters, digits, the
4012 underscore, hyphen-minus, the number sign, colon, commercial at and
4013 period, the last character can also be the dollar sign:
4014 .Ql [[:alnum:]_#:@.-]+$? .
4017 .It Ic alternates , unalternates
4018 \*(NQ (alt) Manage a list of alternate addresses or names of the active user,
4019 members of which will be removed from recipient lists.
4020 The latter command removes the given list of alternates, the special name
4021 .Ql *
4022 will discard all existing aliases.
4023 The former command manages the error number
4024 .Va \&!
4025 and shows the current set of alternates when used without arguments; in
4026 this mode it supports
4027 .Cm vput
4028 (see
4029 .Sx "Command modifiers" ) .
4030 Otherwise the given arguments (after being checked for validity) are
4031 appended to the list of alternate names; in
4032 .Va posix
4033 mode they replace that list instead.
4034 There is a set of implicit alternates which is formed of the values of
4035 .Ev LOGNAME ,
4036 .Va from ,
4037 .Va sender
4039 .Va replyto .
4042 .It Ic answered , unanswered
4043 Take a message lists and mark each message as having been answered,
4044 having not been answered, respectively.
4045 Messages will be marked answered when being
4046 .Ic reply Ns d
4047 to automatically if the
4048 .Va markanswered
4049 variable is set.
4050 See the section
4051 .Sx "Message states" .
4054 .It Ic bind , unbind
4055 \*(OP\*(NQ The bind command extends the MLE (see
4056 .Sx "On terminal control and line editor" )
4057 with freely configurable key bindings.
4058 The latter command removes from the given context the given key binding,
4059 both of which may be specified as a wildcard
4060 .Ql * ,
4061 so that, e.g.,
4062 .Ql unbind * *
4063 will remove all bindings of all contexts.
4064 Due to initialization order unbinding will not work for built-in key
4065 bindings upon program startup, however: please use
4066 .Va line-editor-no-defaults
4067 for this purpose instead.
4069 With one argument the former command shows all key bindings for the
4070 given context, specifying an asterisk
4071 .Ql *
4072 will show the bindings of all contexts; a more verbose listing will be
4073 produced if either of
4074 .Va debug
4076 .Va verbose
4077 are set.
4078 With two or more arguments a binding is (re)established:
4079 the first argument is the context to which the binding shall apply,
4080 the second argument is a comma-separated list of the
4081 .Dq keys
4082 which form the binding, and any remaining arguments form the expansion.
4083 To indicate that a binding shall not be auto-committed, but that the
4084 expansion shall instead be furtherly editable by the user, a commercial at
4085 .Ql @
4086 (that will be removed) can be placed last in the expansion, from which
4087 leading and trailing whitespace will finally be removed.
4088 Reverse solidus cannot be used as the last character of expansion.
4090 Contexts define when a binding applies, i.e., a binding will not be seen
4091 unless the context for which it is defined for is currently active.
4092 This is not true for the shared binding
4093 .Ql base ,
4094 which is the foundation for all other bindings and as such always
4095 applies, its bindings, however, only apply secondarily.
4096 The available contexts are the shared
4097 .Ql base ,
4099 .Ql default
4100 context which is used in all not otherwise documented situations, and
4101 .Ql compose ,
4102 which applies to compose mode only.
4104 .Dq Keys
4105 which form the binding are specified as a comma-separated list of
4106 byte-sequences, where each list entry corresponds to one key(press).
4107 A list entry may, indicated by a leading colon character
4108 .Ql \&: ,
4109 also refer to the name of a terminal capability; several dozen names
4110 will be compiled in and may be specified either by their
4111 .Xr terminfo 5 ,
4112 or, if existing, by their
4113 .Xr termcap 5
4114 name, regardless of the actually used \*(OPal terminal control library.
4115 It is possible to use any capability, as long as the name is resolvable
4116 by the \*(OPal control library or was defined via the internal variable
4117 .Va termcap .
4118 Input sequences are not case-normalized, so that an exact match is
4119 required to update or remove a binding.
4120 Examples:
4121 .Bd -literal -offset indent
4122 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
4123 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc, Delete
4124 ? bind default $'\ecA',:khome,w 'echo An editable binding@'
4125 ? bind default a,b,c rm -irf / @  # Another editable binding
4126 ? bind default :kf1 File %
4127 ? bind compose :kf1 ~e
4130 Note that the entire comma-separated list is first parsed (over) as a
4131 shell-token with whitespace as the field separator, before being parsed
4132 and expanded for real with comma as the field separator, therefore
4133 whitespace needs to be properly quoted, see
4134 .Sx "Shell-style argument quoting" .
4135 Using Unicode reverse solidus escape sequences renders a binding
4136 defunctional if the locale does not support Unicode (see
4137 .Sx "Character sets" ) ,
4138 and using terminal capabilities does so if no (corresponding) terminal
4139 control support is (currently) available.
4141 The following terminal capability names are built-in and can be used in
4142 .Xr terminfo 5
4143 or (if available) the two-letter
4144 .Xr termcap 5
4145 notation.
4146 See the respective manual for a list of capabilities.
4147 The program
4148 .Xr infocmp 1
4149 can be used to show all the capabilities of
4150 .Ev TERM
4151 or the given terminal type;
4152 using the
4153 .Fl \&\&x
4154 flag will also show supported (non-standard) extensions.
4156 .Bl -tag -compact -width kcuuf_or_kcuuf
4157 .It Cd kbs Ns \0or Cd kb
4158 Backspace.
4159 .It Cd kdch1 Ns \0or Cd kD
4160 Delete character.
4161 .It Cd kDC Ns \0or Cd *4
4162 \(em shifted variant.
4163 .It Cd kel Ns \0or Cd kE
4164 Clear to end of line.
4165 .It Cd kext Ns \0or Cd @9
4166 Exit.
4167 .It Cd kich1 Ns \0or Cd kI
4168 Insert character.
4169 .It Cd kIC Ns \0or Cd #3
4170 \(em shifted variant.
4171 .It Cd khome Ns \0or Cd kh
4172 Home.
4173 .It Cd kHOM Ns \0or Cd #2
4174 \(em shifted variant.
4175 .It Cd kend Ns \0or Cd @7
4176 End.
4177 .It Cd knp Ns \0or Cd kN
4178 Next page.
4179 .It Cd kpp Ns \0or Cd kP
4180 Previous page.
4181 .It Cd kcub1 Ns \0or Cd kl
4182 Left cursor (with more modifiers: see below).
4183 .It Cd kLFT Ns \0or Cd #4
4184 \(em shifted variant.
4185 .It Cd kcuf1 Ns \0or Cd kr
4186 Right cursor (ditto).
4187 .It Cd kRIT Ns \0or Cd %i
4188 \(em shifted variant.
4189 .It Cd kcud1 Ns \0or Cd kd
4190 Down cursor (ditto).
4191 .It Cd kDN
4192 \(em shifted variant (only terminfo).
4193 .It Cd kcuu1 Ns \0or Cd ku
4194 Up cursor (ditto).
4195 .It Cd kUP
4196 \(em shifted variant (only terminfo).
4197 .It Cd kf0 Ns \0or Cd k0
4198 Function key 0.
4199 Add one for each function key up to
4200 .Cd kf9
4202 .Cd k9 ,
4203 respectively.
4204 .It Cd kf10 Ns \0or Cd k;
4205 Function key 10.
4206 .It Cd kf11 Ns \0or Cd F1
4207 Function key 11.
4208 Add one for each function key up to
4209 .Cd kf19
4211 .Cd F9 ,
4212 respectively.
4215 Some terminals support key-modifier combination extensions, e.g.,
4216 .Ql Alt+Shift+xy .
4217 For example, the delete key,
4218 .Cd kdch1 :
4219 in its shifted variant, the name is mutated to
4220 .Cd  kDC ,
4221 then a number is appended for the states
4222 .Ql Alt
4223 .Pf ( Cd kDC3 ) ,
4224 .Ql Shift+Alt
4225 .Pf ( Cd kDC4 ) ,
4226 .Ql Control
4227 .Pf ( Cd kDC5 ) ,
4228 .Ql Shift+Control
4229 .Pf ( Cd kDC6 ) ,
4230 .Ql Alt+Control
4231 .Pf ( Cd kDC7 ) ,
4232 finally
4233 .Ql Shift+Alt+Control
4234 .Pf ( Cd kDC8 ) .
4235 The same for the left cursor key,
4236 .Cd kcub1 :
4237 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
4239 It is advisable to use an initial escape or other control character (e.g.,
4240 .Ql \ecA )
4241 for bindings which describe user key combinations (as opposed to purely
4242 terminal capability based ones), in order to avoid ambiguities whether
4243 input belongs to key sequences or not; it also reduces search time.
4244 Adjusting
4245 .Va bind-timeout
4246 may help shall keys and sequences be falsely recognized.
4248 .It Ic call
4249 \*(NQ Calls the given macro, which must have been created via
4250 .Ic define ,
4251 otherwise a
4252 .Va ^ERR Ns -NOENT
4253 error occurs.
4254 Parameters given to macros are implicitly local to the macro's scope, and
4255 may be accessed via special (positional) parameters, e.g.,
4256 .Va 1 ,
4257 .Va * ,
4258 .Va @ ,
4259 .Va # .
4260 The positional parameters may be removed by
4261 .Ic shift Ns
4262 ing them off the stack (exceeding the supported number of arguments
4263 results in a
4264 .Va ^ERR Ns -OVERFLOW ) ,
4265 and are otherwise controllable via
4266 .Ic vpospar .
4267 Changes to other
4268 .Sx ENVIRONMENT
4269 as well as
4270 .Sx "INTERNAL VARIABLES"
4271 can be reverted before the current level regains control by setting
4272 .Ic localopts
4273 for called macro(s) (or in them, of course).
4274 Macro execution can be terminated at any time by calling
4275 .Ic return .
4277 Calling macros recursively will at some time excess the stack size
4278 limit, causing a hard program abortion; if recursively calling a macro
4279 is the last command of the current macro, consider to use the command
4280 .Ic xcall ,
4281 which will first release all resources of the current macro before
4282 replacing the current macro with the called one.
4283 Numeric and string operations can be performed via
4284 .Ic vexpr ,
4286 .Ic eval
4287 may be helpful to recreate argument lists.
4288 .Bd -literal -offset indent
4289 define exmac {
4290   echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
4291   return 1000 0
4293 call exmac Hello macro exmac!
4296 .It Ic call_if
4297 Identical to
4298 .Ic call
4299 if the given macro has been created via
4300 .Ic define ,
4301 but doesn't fail nor warn if the macro doesn't exist.
4303 .It Ic cd
4304 (ch) Change the working directory to
4305 .Ev HOME
4306 or the given argument.
4307 Synonym for
4308 .Ic chdir .
4310 .It Ic certsave
4311 \*(OP Only applicable to S/MIME signed messages.
4312 Takes a message list and a filename and saves the certificates
4313 contained within the message signatures to the named file in both
4314 human-readable and PEM format.
4315 The certificates can later be used to send encrypted messages to the
4316 respective message senders by setting
4317 .Va smime-encrypt-USER@HOST
4318 variables.
4321 .It Ic charsetalias , uncharsetalias
4322 \*(NQ Manage (character set conversion) character set alias mappings,
4323 as documented in the section
4324 .Sx "Character sets" .
4325 Character set aliases are expanded recursively, but no expansion is
4326 performed on values of the user-settable variables, e.g.,
4327 .Va charset-8bit .
4328 These are effectively no-operations if character set conversion
4329 is not available (i.e., no
4330 .Ql +iconv
4332 .Va features ) .
4333 Without arguments the list of all currently defined aliases is shown,
4334 with one argument the expansion of the given alias.
4335 Otherwise all given arguments are treated as pairs of character sets and
4336 their desired target alias name, creating new or changing already
4337 existing aliases, as necessary.
4339 The latter deletes all aliases given as arguments, the special argument
4340 .Ql *
4341 will remove all aliases.
4343 .It Ic chdir
4344 (ch) Change the working directory to
4345 .Ev HOME
4346 or the given argument.
4347 Synonym for
4348 .Ic cd .
4351 .It Ic collapse , uncollapse
4352 Only applicable to threaded mode.
4353 Takes a message list and makes all replies to these messages invisible
4354 in header summaries, except for
4355 .Ql new
4356 messages and the
4357 .Dq dot .
4358 Also when a message with collapsed replies is displayed,
4359 all of these are automatically uncollapsed.
4360 The latter command undoes collapsing.
4363 .It Ic colour , uncolour
4364 \*(OP\*(NQ Manage colour mappings of and for a
4365 .Sx "Coloured display" .
4366 The type of colour is given as the (case-insensitive) first argument,
4367 which must be one of
4368 .Ql 256
4369 for 256-colour terminals,
4370 .Ql 8 ,
4371 .Ql ansi
4373 .Ql iso
4374 for the standard 8-colour ANSI / ISO 6429 color palette and
4375 .Ql 1
4377 .Ql mono
4378 for monochrome terminals.
4379 Monochrome terminals cannot deal with colours, but only (some) font
4380 attributes.
4382 Without further arguments the list of all currently defined mappings
4383 for the given colour type is shown (as a special case giving
4384 .Ql all
4386 .Ql *
4387 will show the mappings of all types).
4388 Otherwise the second argument defines the mappable slot, and the third
4389 argument a (comma-separated list of) colour and font attribute
4390 specification(s), and the optional fourth argument can be used to
4391 specify a precondition: if conditioned mappings exist they are tested in
4392 (creation) order unless a (case-insensitive) match has been found, and
4393 the default mapping (if any has been established) will only be chosen as
4394 a last resort.
4395 The types of precondition available depend on the mappable slot (see
4396 .Sx "Coloured display"
4397 for some examples), the following of which exist:
4399 Mappings prefixed with
4400 .Ql mle-
4401 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
4402 .Sx "On terminal control and line editor" )
4403 and do not support preconditions.
4405 .Bl -tag -compact -width view-partinfo
4406 .It Ar mle-position
4407 This mapping is used for the position indicator that is visible when
4408 a line cannot be fully displayed on the screen.
4409 .It Ar mle-prompt
4410 Used for the
4411 .Va prompt .
4414 Mappings prefixed with
4415 .Ql sum-
4416 are used in header summaries, and they all understand the preconditions
4417 .Ql dot
4418 (the current message) and
4419 .Ql older
4420 for elder messages (only honoured in conjunction with
4421 .Va datefield-markout-older ) .
4423 .Bl -tag -compact -width view-partinfo
4424 .It Ar sum-dotmark
4425 This mapping is used for the
4426 .Dq dotmark
4427 that can be created with the
4428 .Ql %>
4430 .Ql %<
4431 formats of the variable
4432 .Va headline .
4433 .It Ar sum-header
4434 For the complete header summary line except the
4435 .Dq dotmark
4436 and the thread structure.
4437 .It Ar sum-thread
4438 For the thread structure which can be created with the
4439 .Ql %i
4440 format of the variable
4441 .Va headline .
4444 Mappings prefixed with
4445 .Ql view-
4446 are used when displaying messages.
4448 .Bl -tag -compact -width view-partinfo
4449 .It Ar view-from_
4450 This mapping is used for so-called
4451 .Ql From_
4452 lines, which are MBOX file format specific header lines.
4453 .It Ar view-header
4454 For header lines.
4455 A comma-separated list of headers to which the mapping applies may be
4456 given as a precondition; if the \*(OPal regular expression support is
4457 available then if any of the
4458 .Dq magical
4459 (extended) regular expression characters is seen the precondition will
4460 be evaluated as (an extended) one.
4461 .It Ar view-msginfo
4462 For the introductional message info line.
4463 .It Ar view-partinfo
4464 For MIME part info lines.
4467 The following (case-insensitive) colour definitions and font attributes
4468 are understood, multiple of which can be specified in a comma-separated
4469 list:
4470 .Bl -tag -width ft=
4471 .It Ar ft=
4472 a font attribute:
4473 .Ql bold ,
4474 .Ql reverse
4476 .Ql underline .
4477 It is possible (and often applicable) to specify multiple font
4478 attributes for a single mapping.
4479 .It Ar fg=
4480 foreground colour attribute:
4481 .Ql black ,
4482 .Ql blue ,
4483 .Ql green ,
4484 .Ql red ,
4485 .Ql brown ,
4486 .Ql magenta ,
4487 .Ql cyan
4489 .Ql white .
4490 To specify a 256-color mode a decimal number colour specification in
4491 the range 0 to 255, inclusive, is supported, and interpreted as follows:
4493 .Bl -tag -compact -width "999 - 999"
4494 .It 0 - 7
4495 the standard ISO 6429 colors, as above.
4496 .It 8 - 15
4497 high intensity variants of the standard colors.
4498 .It 16 - 231
4499 216 colors in tuples of 6.
4500 .It 232 - 255
4501 grayscale from black to white in 24 steps.
4503 .Bd -literal -offset indent
4504 #!/bin/sh -
4505 fg() { printf "\e033[38;5;${1}m($1)"; }
4506 bg() { printf "\e033[48;5;${1}m($1)"; }
4508 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
4509 printf "\e033[0m\en"
4511 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
4512 printf "\e033[0m\en"
4514 .It Ar bg=
4515 background colour attribute (see
4516 .Cd fg=
4517 for possible values).
4520 The command
4521 .Ic \&uncolour
4522 will remove for the given colour type (the special type
4523 .Ql *
4524 selects all) the given mapping; if the optional precondition argument is
4525 given only the exact tuple of mapping and precondition is removed.
4526 The special name
4527 .Ql *
4528 will remove all mappings (no precondition allowed), thus
4529 .Ql uncolour * *
4530 will remove all established mappings.
4533 .It Ic commandalias , uncommandalias
4534 \*(NQ Define or list, and remove, respectively, command aliases.
4535 An (command)alias can be used everywhere a normal command can be used,
4536 but always takes precedence: any arguments that are given to the command
4537 alias are joined onto the alias expansion, and the resulting string
4538 forms the command line that is, in effect, executed.
4539 The latter command removes all given aliases, the special name
4540 .Ql *
4541 will remove all existing aliases.
4542 When used without arguments the former shows a list of all currently
4543 known aliases, with one argument only the expansion of the given one.
4545 With two or more arguments a command alias is defined or updated: the
4546 first argument is the name under which the remaining command line should
4547 be accessible, the content of which can be just about anything.
4548 An alias may itself expand to another alias, but to avoid expansion loops
4549 further expansion will be prevented if an alias refers to itself or if
4550 an expansion depth limit is reached.
4551 Explicit expansion prevention is available via reverse solidus
4552 .Cm \e ,
4553 one of the
4554 .Sx "Command modifiers" .
4555 .Bd -literal -offset indent
4556 ? commandalias xx
4557 \*(uA: `commandalias': no such alias: xx
4558 ? commandalias xx echo hello,
4559 ? commandalias xx
4560 commandalias xx 'echo hello,'
4561 ? xx
4562 hello,
4563 ? xx world
4564 hello, world
4567 .It Ic Copy
4568 (C) Copy messages to files whose names are derived from the author of
4569 the respective message and do not mark them as being saved;
4570 otherwise identical to
4571 .Ic Save .
4573 .It Ic copy
4574 (c) Copy messages to the named file and do not mark them as being saved;
4575 otherwise identical to
4576 .Ic save .
4578 .It Ic cwd
4579 Show the name of the current working directory, as reported by
4580 .Xr getcwd 3 .
4581 Supports
4582 .Cm vput
4583 (see
4584 .Sx "Command modifiers" ) .
4585 The return status is tracked via
4586 .Va \&! .
4588 .It Ic Decrypt
4589 \*(OP For unencrypted messages this command is identical to
4590 .Ic Copy ;
4591 Encrypted messages are first decrypted, if possible, and then copied.
4593 .It Ic decrypt
4594 \*(OP For unencrypted messages this command is identical to
4595 .Ic copy ;
4596 Encrypted messages are first decrypted, if possible, and then copied.
4599 .It Ic define , undefine
4600 Without arguments the current list of macros, including their content,
4601 is shown, otherwise a macro is defined, replacing an existing macro of
4602 the same name.
4603 A macro definition is a sequence of commands in the following form:
4604 .Bd -literal -offset indent
4605 define name {
4606   command1
4607   command2
4608   ...
4609   commandN
4613 A defined macro can be invoked explicitly by using the
4614 .Ic call ,
4615 .Ic call_if
4617 .Ic xcall
4618 commands, or implicitly if a macro hook is triggered, e.g., a
4619 .Va folder-hook .
4620 It is possible to localize adjustments, like creation, deletion and
4621 modification of
4622 .Sx "INTERNAL VARIABLES" ,
4623 by using the
4624 .Ic localopts
4625 command; the scope which is localized depends on how (i.e.,
4626 .Dq as what :
4627 normal macro, folder hook, hook,
4628 .Ic account
4629 switch) the macro is invoked.
4630 Execution of a macro body can be stopped from within by calling
4631 .Ic return .
4632 Inside a
4633 .Ic call Ns
4634 ed macro, given positional parameters can be
4635 .Ic shift Ns
4636 ed, or become completely replaced, removed etc. via
4637 .Ic vpospar .
4639 The latter command deletes the given macro, the special name
4640 .Ql *
4641 will discard all existing macros.
4642 Creation and deletion of (a) macro(s) can be performed from within
4643 a running macro.
4646 .It Ic delete , undelete
4647 (d, u) Marks the given message list as being or not being
4648 .Ql deleted ,
4649 respectively; if no argument has been specified then the usual search
4650 for a visible message is performed, as documented for
4651 .Sx "Message list arguments" ,
4652 showing only the next input prompt if the search fails.
4653 Deleted messages will neither be saved in the
4654 .Mx -sx
4655 .Sx "secondary mailbox"
4656 .Ev MBOX
4657 nor will they be available for most other commands.
4658 If the
4659 .Va autoprint
4660 variable is set, the new
4661 .Dq dot
4662 or the last message restored, respectively, is automatically
4663 .Ic type Ns
4664 d; also see
4665 .Ic dp ,
4666 .Ic dt .
4668 .It Ic discard
4669 (di) Identical to
4670 .Ic ignore .
4671 Superseded by the multiplexer
4672 .Ic headerpick .
4675 .It Ic dp , dt
4676 Delete the given messages and automatically
4677 .Ic type
4678 the new
4679 .Dq dot
4680 if one exists, regardless of the setting of
4681 .Va autoprint .
4683 .It Ic dotmove
4684 Move the
4685 .Dq dot
4686 up or down by one message when given
4687 .Ql +
4689 .Ql -
4690 argument, respectively.
4693 .It Ic draft , undraft
4694 Take message lists and mark each given message as being draft, or not
4695 being draft, respectively, as documented in the section
4696 .Sx "Message states" .
4698 .It Ic echo
4699 \*(NQ (ec) Echoes arguments to standard output and writes a trailing
4700 newline, whereas the otherwise identical
4701 .Ic echon
4702 does not.
4703 .Sx "Shell-style argument quoting"
4704 is used,
4705 .Sx "Filename transformations"
4706 are applied to the expanded arguments.
4708 .It Ic echoerr
4709 \*(NQ Identical to
4710 .Ic echo
4711 except that is echoes to standard error.
4712 Also see
4713 .Ic echoerrn .
4714 In interactive sessions the \*(OPal message ring queue for
4715 .Ic errors
4716 will be used instead, if available.
4718 .It Ic echon
4719 \*(NQ Identical to
4720 .Ic echo ,
4721 but does not write a trailing newline.
4723 .It Ic echoerrn
4724 \*(NQ Identical to
4725 .Ic echoerr ,
4726 but does not write a trailing newline.
4728 .It Ic edit
4729 (e) Point the text editor (as defined in
4730 .Ev EDITOR )
4731 at each message from the given list in turn.
4732 Modified contents are discarded unless the
4733 .Va writebackedited
4734 variable is set, and are not used unless the mailbox can be written to
4735 and the editor returns a successful exit status.
4737 .It Ic elif
4738 Part of the
4739 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4740 conditional \(em if the condition of a preceding
4741 .Ic if
4742 was false, check the following condition and execute the following block
4743 if it evaluates true.
4745 .It Ic else
4746 (el) Part of the
4747 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4748 conditional \(em if none of the conditions of the preceding
4749 .Ic if
4751 .Ic elif
4752 commands was true, the
4753 .Ic else
4754 block is executed.
4756 .It Ic endif
4757 (en) Marks the end of an
4758 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4759 conditional execution block.
4761 .It Ic environ
4762 \*(NQ \*(UA has a strict notion about which variables are
4763 .Sx "INTERNAL VARIABLES"
4764 and which are managed in the program
4765 .Sx ENVIRONMENT .
4766 Since some of the latter are a vivid part of \*(UAs functioning,
4767 however, they are transparently integrated into the normal handling of
4768 internal variables via
4769 .Ic set
4771 .Ic unset .
4772 To integrate other environment variables of choice into this
4773 transparent handling, and also to export internal variables into the
4774 process environment where they normally are not, a
4775 .Ql link
4776 needs to become established with this command, as in, e.g.,
4778 .Dl environ link PERL5LIB TZ
4780 Afterwards changing such variables with
4781 .Ic set
4782 will cause automatic updates of the program environment, and therefore
4783 be inherited by newly created child processes.
4784 Sufficient system support provided (it was in BSD as early as 1987, and
4785 is standardized since Y2K) removing such variables with
4786 .Ic unset
4787 will remove them also from the program environment, but in any way
4788 the knowledge they ever have been
4789 .Ql link Ns
4790 ed will be lost.
4791 Note that this implies that
4792 .Ic localopts
4793 may cause loss of such links.
4795 The command
4796 .Ql unlink
4797 will remove an existing link, but leaves the variables as such intact.
4798 Additionally the subcommands
4799 .Ql set
4801 .Ql unset
4802 are provided, which work exactly the same as the documented commands
4803 .Ic set
4805 .Ic unset ,
4806 but (additionally un)link the variable(s) with the program environment
4807 and thus immediately export them to, or remove them from (if possible),
4808 respectively, the program environment.
4810 .It Ic errors
4811 \*(OP Since \*(UA uses the console as a user interface it can happen
4812 that messages scroll by too fast to become recognized.
4813 An error message ring queue is available which stores duplicates of any
4814 error message and notifies the user in interactive sessions whenever
4815 a new error has occurred.
4816 The queue is finite: if its maximum size is reached any new message
4817 replaces the eldest.
4818 The command
4819 .Ic errors
4820 can be used to manage this message queue: if given
4821 .Ar show
4822 or no argument the queue will be displayed and cleared,
4823 .Ar clear
4824 will only clear all messages from the queue.
4826 .It Ic eval
4827 \*(NQ Construct a command by concatenating the arguments, separated with
4828 a single space character, and then evaluate the result.
4829 This command passes through the exit status
4830 .Va \&?
4831 and error number
4832 .Va \&!
4833 of the evaluated command; also see
4834 .Ic call .
4835 .Bd -literal -offset indent
4836 define xxx {
4837   echo "xxx arg <$1>"
4838   shift
4839   if [ $# -gt 0 ]
4840     \excall xxx "$@"
4841   endif
4843 define yyy {
4844   eval "$@ ' ball"
4846 call yyy '\ecall xxx' "b\e$'\et'u ' "
4847 call xxx arg <b      u>
4848 call xxx arg <  >
4849 call xxx arg <ball>
4852 .It Ic exit
4853 (ex or x) Exit from \*(UA without changing the active mailbox and skip
4854 any saving of messages in the
4855 .Mx -sx
4856 .Sx "secondary mailbox"
4857 .Ev MBOX ,
4858 as well as a possibly tracked line editor
4859 .Va history-file .
4860 The optional status number argument will be passed through to
4861 .Xr exit 3 .
4862 \*(ID For now it can happen that the given status will be overwritten,
4863 later this will only occur if a later error needs to be reported onto an
4864 otherwise success indicating status.
4866 .It Ic File
4867 (Fi) Like
4868 .Ic file ,
4869 but open the mailbox read-only.
4871 .It Ic file
4872 (fi) The file command switches to a new mailbox.
4873 Without arguments it shows status information of the current mailbox.
4874 If an argument is given, it will write out changes (such as deletions)
4875 the user has made, open a new mailbox, update the internal variables
4876 .Va mailbox-resolved
4878 .Va mailbox-display ,
4879 and optionally display a summary of
4880 .Ic headers
4881 if the variable
4882 .Va header
4883 is set.
4885 .Sx "Filename transformations"
4886 will be applied to the
4887 .Ar name
4888 argument, and
4889 .Ql protocol://
4890 prefixes are, i.e., URL syntax is understood, e.g.,
4891 .Ql maildir:///tmp/mdirbox :
4892 if a protocol prefix is used the mailbox type is fixated and neither
4893 the auto-detection (read on) nor the
4894 .Va newfolders
4895 mechanisms apply.
4896 \*(OPally URLs can also be used to access network resources, and it is
4897 possible to proxy all network traffic over a SOCKS5 server given via
4898 .Va socks-proxy .
4900 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
4901 .Dl \*(OU protocol://[user@]host[:port][/path]
4903 \*(OPally supported network protocols are
4904 .Ar pop3
4905 (POP3) and
4906 .Ar pop3s
4907 (POP3 with SSL/TLS encrypted transport),
4908 .Ar imap
4910 .Ar imaps .
4912 .Ar [/path]
4913 part is valid only for IMAP; there it defaults to
4914 .Ar INBOX .
4915 Network URLs require a special encoding as documented in the section
4916 .Sx "On URL syntax and credential lookup" .
4918 If the resulting file protocol (MBOX database)
4919 .Ar name
4920 is located on a local filesystem then the list of all registered
4921 .Ic filetype Ns
4922 s is traversed in order to see whether a transparent intermediate
4923 conversion step is necessary to handle the given mailbox, in which case
4924 \*(UA will use the found hook to load and save data into and from
4925 a temporary file, respectively.
4926 Changing hooks will not affect already opened mailboxes.
4927 For example, the following creates hooks for the
4928 .Xr gzip 1
4929 compression tool and a combined compressed and encrypted format:
4930 .Bd -literal -offset indent
4931 ? filetype \e
4932     gzip 'gzip -dc' 'gzip -c' \e
4933     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
4936 MBOX database files are generally locked during file operations in order
4937 to avoid inconsistencies due to concurrent modifications.
4938 \*(OPal Mailbox files which \*(UA treats as the system
4939 .Va inbox
4940 .Pf ( Ev MAIL ) ,
4942 .Mx -sx
4943 .Sx "primary system mailbox" Ns
4944 es in general will also be protected by so-called dotlock files, the
4945 traditional way of mail spool file locking: for any file
4946 .Ql a
4947 a lock file
4948 .Ql a.lock
4949 will be created for the duration of the synchronization \(em
4950 as necessary a privilege-separated dotlock child process will be used
4951 to accommodate for necessary privilege adjustments in order to create
4952 the dotlock file in the same directory
4953 and with the same user and group identities as the file of interest.
4955 \*(UA by default uses tolerant POSIX rules when reading MBOX database
4956 files, but it will detect invalid message boundaries in this mode and
4957 complain (even more with
4958 .Va debug )
4959 if any is seen: in this case
4960 .Va mbox-rfc4155
4961 can be used to create a valid MBOX database from the invalid input.
4963 If no protocol has been fixated, and
4964 .Ar name
4965 refers to a directory with the subdirectories
4966 .Ql tmp ,
4967 .Ql new
4969 .Ql cur ,
4970 then it is treated as a folder in
4971 .Dq Maildir
4972 format.
4973 The maildir format stores each message in its own file, and has been
4974 designed so that file locking is not necessary when reading or writing
4975 files.
4977 \*(ID If no protocol has been fixated and no existing file has
4978 been found, the variable
4979 .Va newfolders
4980 controls the format of mailboxes yet to be created.
4983 .It Ic filetype , unfiletype
4984 \*(NQ Define or list, and remove, respectively, file handler hooks,
4985 which provide (shell) commands that enable \*(UA to load and save MBOX
4986 files from and to files with the registered file extensions;
4987 it will use an intermediate temporary file to store the plain data.
4988 The latter command removes the hooks for all given extensions,
4989 .Ql *
4990 will remove all existing handlers.
4992 When used without arguments the former shows a list of all currently
4993 defined file hooks, with one argument the expansion of the given alias.
4994 Otherwise three arguments are expected, the first specifying the file
4995 extension for which the hook is meant, and the second and third defining
4996 the load- and save commands, respectively, to deal with the file type,
4997 both of which must read from standard input and write to standard
4998 output.
4999 Changing hooks will not affect already opened mailboxes (\*(ID except below).
5000 \*(ID For now too much work is done, and files are oftened read in twice
5001 where once would be sufficient: this can cause problems if a filetype is
5002 changed while such a file is opened; this was already so with the
5003 built-in support of .gz etc. in Heirloom, and will vanish in v15.
5004 \*(ID For now all handler strings are passed to the
5005 .Ev SHELL for evaluation purposes; in the future a
5006 .Ql \&!
5007 prefix to load and save commands may mean to bypass this shell instance:
5008 placing a leading space will avoid any possible misinterpretations.
5009 .Bd -literal -offset indent
5010 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
5011     gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
5012     zst 'zstd -dc' 'zstd -19 -zc' \e
5013     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5014 ? set record=+sent.zst.pgp
5018 .It Ic flag , unflag
5019 Take message lists and mark the messages as being flagged, or not being
5020 flagged, respectively, for urgent/special attention.
5021 See the section
5022 .Sx "Message states" .
5024 .It Ic folder
5025 (fold) The same as
5026 .Ic file .
5028 .It Ic folders
5029 With no arguments, list the names of the folders in the folder directory.
5030 With an existing folder as an argument,
5031 lists the names of folders below the named folder.
5033 .It Ic Followup
5034 (F) Similar to
5035 .Ic Respond ,
5036 but saves the message in a file named after the local part of the first
5037 recipient's address (instead of in
5038 .Va record Ns ).
5040 .It Ic followup
5041 (fo) Similar to
5042 .Ic respond ,
5043 but saves the message in a file named after the local part of the first
5044 recipient's address (instead of in
5045 .Va record Ns ).
5047 .It Ic followupall
5048 Similar to
5049 .Ic followup ,
5050 but responds to all recipients regardless of the
5051 .Va flipr
5052 variable.
5054 .It Ic followupsender
5055 Similar to
5056 .Ic Followup ,
5057 but responds to the sender only regardless of the
5058 .Va flipr
5059 variable.
5061 .It Ic Forward
5062 Similar to
5063 .Ic forward ,
5064 but saves the message in a file named after the local part of the
5065 recipient's address (instead of in
5066 .Va record Ns ).
5068 .It Ic forward
5069 Takes a message and the address of a recipient
5070 and forwards the message to him.
5071 The text of the original message is included in the new one,
5072 with the value of the
5073 .Va forward-inject-head
5074 variable preceding it.
5075 To filter the included header fields to the desired subset use the
5076 .Ql forward
5077 slot of the white- and blacklisting command
5078 .Ic headerpick .
5079 Only the first part of a multipart message is included unless
5080 .Va forward-as-attachment ,
5081 and recipient addresses will be stripped from comments, names etc.
5082 unless the internal variable
5083 .Va fullnames
5084 is set.
5086 This may generate the errors
5087 .Va ^ERR Ns -DESTADDRREQ
5088 if no receiver has been specified,
5089 .Va ^ERR Ns -PERM
5090 if some addressees where rejected by
5091 .Va expandaddr ,
5092 .Va ^ERR Ns -NODATA
5093 if no applicable messages have been given,
5094 .Va ^ERR Ns -NOTSUP
5095 if multiple messages have been specified,
5096 .Va ^ERR Ns -IO
5097 if an I/O error occurs,
5098 .Va ^ERR Ns -NOTSUP
5099 if a necessary character set conversion fails, and
5100 .Va ^ERR Ns -INVAL
5101 for other errors.
5103 .It Ic from
5104 (f) Takes a list of message specifications and displays a summary of
5105 their message headers, exactly as via
5106 .Ic headers .
5107 An alias of this command is
5108 .Ic search .
5109 Also see
5110 .Sx "Specifying messages" .
5111 .It Ic Fwd
5112 \*(OB Alias for
5113 .Ic Forward .
5114 .It Ic fwd
5115 \*(OB Alias for
5116 .Ic forward .
5117 .It Ic fwdignore
5118 \*(OB Superseded by the multiplexer
5119 .Ic headerpick .
5120 .It Ic fwdretain
5121 \*(OB Superseded by the multiplexer
5122 .Ic headerpick .
5123 .It Ic ghost , unghost
5124 \*(OB Replaced by
5125 .Ic commandalias ,
5126 .Ic uncommandalias .
5129 .It Ic headerpick , unheaderpick
5130 \*(NQ Multiplexer command to manage white- and blacklisting
5131 selections of header fields for a variety of applications.
5132 Without arguments the set of contexts that have settings is displayed.
5133 When given arguments, the first argument is the context to which the
5134 command applies, one of (case-insensitive)
5135 .Ql type
5136 for display purposes (via, e.g.,
5137 .Ic type ) ,
5138 .Ql save
5139 for selecting which headers shall be stored persistently when
5140 .Ic save ,
5141 .Ic copy ,
5142 .Ic move
5143 or even
5144 .Ic decrypt Ns
5145 ing messages (note that MIME related etc. header fields should not be
5146 ignored in order to not destroy usability of the message in this case),
5147 .Ql forward
5148 for stripping down messages when
5149 .Ic forward Ns
5150 ing message (has no effect if
5151 .Va forward-as-attachment
5152 is set), and
5153 .Ql top
5154 for defining user-defined set of fields for the command
5155 .Ic top .
5157 The current settings of the given context are displayed if it is the
5158 only argument.
5159 A second argument denotes the type of restriction that is to be chosen,
5160 it may be (a case-insensitive prefix of)
5161 .Ql retain
5163 .Ql ignore
5164 for white- and blacklisting purposes, respectively.
5165 Establishing a whitelist suppresses inspection of the corresponding
5166 blacklist.
5168 If no further argument is given the current settings of the given type
5169 will be displayed, otherwise the remaining arguments specify header
5170 fields, which \*(OPally may be given as regular expressions, to be added
5171 to the given type.
5172 The special wildcard field (asterisk,
5173 .Ql * )
5174 will establish a (fast) shorthand setting which covers all fields.
5176 The latter command always takes three or more arguments and can be used
5177 to remove selections, i.e., from the given context, the given type of
5178 list, all the given headers will be removed, the special argument
5179 .Ql *
5180 will remove all headers.
5182 .It Ic headers
5183 (h) Show the current group of headers, the size of which depends on
5184 the variable
5185 .Va screen ,
5186 and the style of which can be adjusted with the variable
5187 .Va headline .
5188 If a message-specification is given the group of headers containing the
5189 first message therein is shown and the message at the top of the screen
5190 becomes the new
5191 .Dq dot .
5193 .It Ic help
5194 (hel) A synonym for
5195 .Ic \&? .
5197 .It Ic history
5198 \*(OP Either
5199 .Ar show
5200 (this mode also supports a more
5201 .Va verbose
5202 output) or
5203 .Ar clear
5204 the list of history entries;
5205 a decimal
5206 .Ar NUMBER
5207 argument selects and evaluates the respective history entry,
5208 which will become the new history top; a negative number is used as an
5209 offset to the current command, e.g.,
5210 .Ql -1
5211 will select the last command, the history top.
5212 The default mode if no arguments are given is
5213 .Ar show .
5214 Please see
5215 .Sx "On terminal control and line editor"
5216 for more on this topic.
5218 .It Ic hold
5219 (ho, also
5220 .Ic preserve )
5221 Takes a message list and marks each message therein to be saved in the
5222 user's system
5223 .Va inbox
5224 instead of in the
5225 .Mx -sx
5226 .Sx "secondary mailbox"
5227 .Ev MBOX .
5228 Does not override the
5229 .Ic delete
5230 command.
5231 \*(UA deviates from the POSIX standard with this command, because a
5232 .Ic next
5233 command issued after
5234 .Ic hold
5235 will display the following message, not the current one.
5237 .It Ic if
5238 (i) Part of the nestable
5239 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
5240 conditional execution construct \(em if the given condition is true then
5241 the encapsulated block is executed.
5242 The POSIX standards supports the (case-insensitive) conditions
5243 .Ql r Ns
5244 eceive
5246 .Ql s Ns
5247 end, all remaining conditions are non-portable extensions.
5248 \*(ID These commands do not yet use
5249 .Sx "Shell-style argument quoting"
5250 and therefore do not know about input tokens, so that syntax
5251 elements have to be surrounded by whitespace; in v15 \*(UA will inspect
5252 all conditions bracket group wise and consider the tokens, representing
5253 values and operators, therein, which also means that variables will
5254 already have been expanded at that time (just like in the shell).
5255 .Bd -literal -offset indent
5256 if receive
5257   commands ...
5258 else
5259   commands ...
5260 endif
5263 The (case-insensitive) condition
5264 .Ql t Ns
5265 erminal will evaluate to true if the standard input is a terminal, i.e.,
5266 in interactive sessions.
5267 Another condition can be any boolean value (see the section
5268 .Sx "INTERNAL VARIABLES"
5269 for textual boolean representations) to mark an enwrapped block as
5270 .Dq never execute
5272 .Dq always execute .
5273 (It shall be remarked that a faulty condition skips all branches until
5274 .Ic endif . )
5276 (\*(ID In v15
5277 .Sx "Shell-style argument quoting"
5278 will be used, and this command will simply interpret expanded tokens.)
5279 It is possible to check
5280 .Sx "INTERNAL VARIABLES"
5281 as well as
5282 .Sx ENVIRONMENT
5283 variables for existence or compare their expansion against a user given
5284 value or another variable by using the
5285 .Ql $
5286 .Pf ( Dq variable next )
5287 conditional trigger character;
5288 a variable on the right hand side may be signalled using the same
5289 mechanism.
5290 Variable names may be enclosed in a pair of matching braces.
5291 When this mode has been triggered, several operators are available:
5293 Integer operators treat the arguments on the left and right hand side of
5294 the operator as integral numbers and compare them arithmetically.
5295 It is an error if any of the operands is not a valid integer, an empty
5296 argument (which implies it had been quoted) is treated as if it were 0.
5297 Available operators are
5298 .Ql -lt
5299 (less than),
5300 .Ql -le
5301 (less than or equal to),
5302 .Ql -eq
5303 (equal),
5304 .Ql -ne
5305 (not equal),
5306 .Ql -ge
5307 (greater than or equal to), and
5308 .Ql -gt
5309 (greater than).
5311 String data operators compare the left and right hand side according to
5312 their textual content.
5313 Unset variables are treated as the empty string.
5314 The behaviour of string operators can be adjusted by prefixing the
5315 operator with the modifier trigger commercial at
5316 .Ql @ ,
5317 followed by none to multiple modifiers: for now supported is
5318 .Ql i ,
5319 which turns the comparison into a case-insensitive one: this is
5320 implied if no modifier follows the trigger.
5322 Available string operators are
5323 .Ql <
5324 (less than),
5325 .Ql <=
5326 (less than or equal to),
5327 .Ql ==
5328 (equal),
5329 .Ql !=
5330 (not equal),
5331 .Ql >=
5332 (greater than or equal to),
5333 .Ql >
5334 (greater than),
5335 .Ql =%
5336 (is substring of) and
5337 .Ql !%
5338 (is not substring of).
5339 By default these operators work on bytes and (therefore) do not take
5340 into account character set specifics.
5341 If the case-insensitivity modifier has been used, case is ignored
5342 according to the rules of the US-ASCII encoding, i.e., bytes are
5343 still compared.
5345 When the \*(OPal regular expression support is available, the additional
5346 string operators
5347 .Ql =~
5349 .Ql !~
5350 can be used.
5351 They treat the right hand side as an extended regular expression that is
5352 matched according to the active locale (see
5353 .Sx "Character sets" ) ,
5354 i.e., character sets should be honoured correctly.
5356 Conditions can be joined via AND-OR lists (where the AND operator is
5357 .Ql &&
5358 and the OR operator is
5359 .Ql || ) ,
5360 which have equal precedence and will be evaluated with left
5361 associativity, thus using the same syntax that is known for the
5362 .Xr sh 1 .
5363 It is also possible to form groups of conditions and lists by enclosing
5364 them in pairs of brackets
5365 .Ql [\ \&.\&.\&.\ ] ,
5366 which may be interlocked within each other, and also be joined via
5367 AND-OR lists.
5369 The results of individual conditions and entire groups may be modified
5370 via unary operators: the unary operator
5371 .Ql \&!
5372 will reverse the result.
5373 .Bd -literal -offset indent
5374 # (This not in v15, there [ -n "$debug"]!)
5375 if $debug
5376   echo *debug* is set
5377 endif
5378 if [ "$ttycharset" == UTF-8 ] || [ "$ttycharset" @i== UTF8 ]
5379   echo *ttycharset* is UTF-8, the former case-sensitive!
5380 endif
5381 set t1=one t2=one
5382 if [ "${t1}" == "${t2}" ]
5383   echo These two variables are equal
5384 endif
5385 if [ "$features" =% +regex ] && [ "$TERM" @i=~ "^xterm\&.*" ]
5386   echo ..in an X terminal
5387 endif
5388 if [ [ true ] && [ [ "${debug}" != '' ] || \e
5389     [ "$verbose" != '' ] ] ]
5390   echo Noisy, noisy
5391 endif
5392 if true && [ "$debug" != '' ] || [ "${verbose}" != '' ]
5393   echo Left associativity, as is known from the shell
5394 endif
5397 .It Ic ignore
5398 (ig) Identical to
5399 .Ic discard .
5400 Superseded by the multiplexer
5401 .Ic headerpick .
5403 .It Ic list
5404 Shows the names of all available commands, alphabetically sorted.
5405 If given any non-whitespace argument the list will be shown in the order
5406 in which command prefixes are searched.
5407 \*(OP In conjunction with a set variable
5408 .Va verbose
5409 additional information will be provided for each command: the argument
5410 type will be indicated, the documentation string will be shown,
5411 and the set of command flags will show up:
5413 .Bl -tag -compact -width ".It Ql BaNg"
5414 .It Ql "vput modifier"
5415 command supports the command modifier
5416 .Cm vput .
5417 .It Ql "errno in *!*"
5418 the error number is tracked in
5419 .Va \&! .
5420 .It Ql "needs box"
5421 commands needs an active mailbox, a
5422 .Ic file .
5423 .It Ql "ok: batch or interactive"
5424 command may only be used in interactive or
5425 .Fl #
5426 batch mode.
5427 .It Ql "ok: send mode"
5428 command can be used in send mode.
5429 .It Ql "not ok: compose mode"
5430 command is not available when in compose mode.
5431 .It Ql "not ok: during startup"
5432 command cannot be used during program startup, e.g., while loading
5433 .Sx "Resource files" .
5434 .It Ql "ok: in subprocess"
5435 command is allowed to be used when running in a subprocess instance,
5436 e.g., from within a macro that is called via
5437 .Va on-compose-splice .
5440 .It Ic localopts
5441 This command can be used to localize changes to (linked)
5442 .Sx ENVIRONMENT
5443 as well as
5444 .Sx "INTERNAL VARIABLES" ,
5445 meaning that their state will be reverted to the former one once the
5446 .Dq covered scope
5447 is left.
5448 It can only be used inside of macro definition blocks introduced by
5449 .Ic account
5451 .Ic define .
5452 The covered scope of an
5453 .Ic account
5454 is left once a different account is activated, and some macros, notably
5455 .Va folder-hook Ns s ,
5456 use their own specific notion of covered scope, here it will be extended
5457 until the folder is left again.
5459 This setting stacks up: i.e., if
5460 .Ql macro1
5461 enables change localization and calls
5462 .Ql macro2 ,
5463 which explicitly resets localization, then any value changes within
5464 .Ql macro2
5465 will still be reverted when the scope of
5466 .Ql macro1
5467 is left.
5468 (Caveats: if in this example
5469 .Ql macro2
5470 changes to a different
5471 .Ic account
5472 which sets some variables that are already covered by localizations,
5473 their scope will be extended, and in fact leaving the
5474 .Ic account
5475 will (thus) restore settings in (likely) global scope which actually
5476 were defined in a local, macro private context!)
5478 This command takes one or two arguments, the optional first one
5479 specifies an attribute that may be one of
5480 .Cm scope ,
5481 which refers to the current scope and is thus the default,
5482 .Cm call ,
5483 which causes any macro that is being
5484 .Ic call Ns
5485 ed to be started with localization enabled by default, as well as
5486 .Cm call-fixate ,
5487 which (if enabled) disallows any called macro to turn off localization:
5488 like this it can be ensured that once the current scope regains control,
5489 any changes made in deeper levels have been reverted.
5490 The latter two are mutually exclusive.
5491 The (second) argument is interpreted as a boolean (string, see
5492 .Sx "INTERNAL VARIABLES" )
5493 and states whether the given attribute shall be turned on or off.
5494 .Bd -literal -offset indent
5495 define temporary_settings {
5496   set possibly_global_option1
5497   localopts on
5498   set local_option1
5499   set local_option2
5500   localopts scope off
5501   set possibly_global_option2
5505 .It Ic Lreply
5506 Reply to messages that come in via known
5507 .Pf ( Ic mlist )
5508 or subscribed
5509 .Pf ( Ic mlsubscribe )
5510 mailing lists, or pretend to do so (see
5511 .Sx "Mailing lists" ) :
5512 on top of the usual
5513 .Ic reply
5514 functionality this will actively resort and even remove message
5515 recipients in order to generate a message that is supposed to be sent to
5516 a mailing list.
5517 For example it will also implicitly generate a
5518 .Ql Mail-Followup-To:
5519 header if that seems useful, regardless of the setting of the variable
5520 .Va followup-to .
5521 For more documentation please refer to
5522 .Sx "On sending mail, and non-interactive mode" .
5524 This may generate the errors
5525 .Va ^ERR Ns -DESTADDRREQ
5526 if no receiver has been specified,
5527 .Va ^ERR Ns -PERM
5528 if some addressees where rejected by
5529 .Va expandaddr ,
5530 .Va ^ERR Ns -NODATA
5531 if no applicable messages have been given,
5532 .Va ^ERR Ns -IO
5533 if an I/O error occurs,
5534 .Va ^ERR Ns -NOTSUP
5535 if a necessary character set conversion fails, and
5536 .Va ^ERR Ns -INVAL
5537 for other errors.
5538 Any error stops processing of further messages.
5540 .It Ic Mail
5541 Similar to
5542 .Ic mail ,
5543 but saves the message in a file named after the local part of the first
5544 recipient's address (instead of in
5545 .Va record Ns ).
5547 .It Ic mail
5548 (m) Takes a (list of) recipient address(es) as (an) argument(s),
5549 or asks on standard input if none were given;
5550 then collects the remaining mail content and sends it out.
5551 For more documentation please refer to
5552 .Sx "On sending mail, and non-interactive mode" .
5554 This may generate the errors
5555 .Va ^ERR Ns -DESTADDRREQ
5556 if no receiver has been specified,
5557 .Va ^ERR Ns -PERM
5558 if some addressees where rejected by
5559 .Va expandaddr ,
5560 .Va ^ERR Ns -NODATA
5561 if no applicable messages have been given,
5562 .Va ^ERR Ns -NOTSUP
5563 if multiple messages have been specified,
5564 .Va ^ERR Ns -IO
5565 if an I/O error occurs,
5566 .Va ^ERR Ns -NOTSUP
5567 if a necessary character set conversion fails, and
5568 .Va ^ERR Ns -INVAL
5569 for other errors.
5571 .It Ic mbox
5572 (mb) The given message list is to be sent to the
5573 .Mx -sx
5574 .Sx "secondary mailbox"
5575 .Ev MBOX
5576 when \*(UA is quit; this is the default action unless the variable
5577 .Va hold
5578 is set.
5579 \*(ID This command can only be used in a
5580 .Mx -sx
5581 .Sx "primary system mailbox" .
5584 .It Ic mimetype , unmimetype
5585 Without arguments the content of the MIME type cache will displayed;
5586 a more verbose listing will be produced if either of
5587 .Va debug
5589 .Va verbose
5590 are set.
5591 When given arguments they will be joined, interpreted as shown in
5592 .Sx "The mime.types files"
5593 (also see
5594 .Sx "HTML mail and MIME attachments" ) ,
5595 and the resulting entry will be added (prepended) to the cache.
5596 In any event MIME type sources are loaded first as necessary \(en
5597 .Va mimetypes-load-control
5598 can be used to fine-tune which sources are actually loaded.
5600 The latter command deletes all specifications of the given MIME type, thus
5601 .Ql ? unmimetype text/plain
5602 will remove all registered specifications for the MIME type
5603 .Ql text/plain .
5604 The special name
5605 .Ql *
5606 will discard all existing MIME types, just as will
5607 .Ql reset ,
5608 but which also reenables cache initialization via
5609 .Va mimetypes-load-control .
5612 .It Ic mlist , unmlist
5613 The latter command removes all given mailing-lists, the special name
5614 .Ql *
5615 can be used to remove all registered lists.
5616 The former will list all currently defined mailing lists (and their
5617 attributes, if any) when used without arguments; a more verbose listing
5618 will be produced if either of
5619 .Va debug
5621 .Va verbose
5622 are set.
5623 Otherwise all given arguments will be added and henceforth be recognized
5624 as mailing lists.
5625 If the \*(OPal regular expression support is available then mailing
5626 lists may also be specified as (extended) regular expressions (see
5627 .Xr re_format 7
5628 for more on those).
5630 .It Ic mimeview
5631 \*(ID Only available in interactive mode, this command allows to display
5632 MIME parts which require external MIME handler programs to run which do
5633 not integrate in \*(UAs normal
5634 .Ic type
5635 output (see
5636 .Sx "HTML mail and MIME attachments" ) .
5637 (\*(ID No syntax to directly address parts, this restriction may vanish.)
5638 The user will be asked for each non-text part of the given message in
5639 turn whether the registered handler shall be used to display the part.
5642 .It Ic mlsubscribe , unmlsubscribe
5643 The latter command removes the subscription attribute from all given
5644 mailing-lists, the special name
5645 .Ql *
5646 can be used to do so for any registered list.
5647 The former will list all currently defined mailing lists which have
5648 a subscription attribute when used without arguments; a more verbose
5649 listing will be produced if either of
5650 .Va debug
5652 .Va verbose
5653 are set.
5654 Otherwise this attribute will be set for all given mailing lists,
5655 newly creating them as necessary (as via
5656 .Ic mlist ) .
5657 Also see
5658 .Va followup-to .
5660 .It Ic Move
5661 Similar to
5662 .Ic move ,
5663 but moves the messages to a file named after the local part of the
5664 sender address of the first message (instead of in
5665 .Va record Ns ).
5667 .It Ic move
5668 Acts like
5669 .Ic copy
5670 but marks the messages for deletion if they were transferred
5671 successfully.
5673 .It Ic More
5674 Like
5675 .Ic more ,
5676 but also displays header fields which would not pass the
5677 .Ic headerpick
5678 selection, and all MIME parts.
5679 Identical to
5680 .Ic Page .
5682 .It Ic more
5683 Invokes the
5684 .Ev PAGER
5685 on the given messages, even in non-interactive mode and as long as the
5686 standard output is a terminal.
5687 Identical to
5688 .Ic page .
5690 .It Ic netrc
5691 \*(OP When used without arguments or if
5692 .Ar show
5693 has been given the content of the
5694 .Pa .netrc
5695 cache is shown, loading it first as necessary.
5696 If the argument is
5697 .Ar load
5698 then the cache will only be initialized and
5699 .Ar clear
5700 will remove its contents.
5701 Note that \*(UA will try to load the file only once, use
5702 .Ql Ic \&\&netrc Ns \:\0\:clear
5703 to unlock further attempts.
5705 .Va netrc-lookup ,
5706 .Va netrc-pipe
5707 and the section
5708 .Sx "On URL syntax and credential lookup" ;
5709 the section
5710 .Sx "The .netrc file"
5711 documents the file format in detail.
5713 .It Ic newmail
5714 Checks for new mail in the current folder without committing any changes
5715 before.
5716 If new mail is present, a message is shown.
5717 If the
5718 .Va header
5719 variable is set,
5720 the headers of each new message are also shown.
5721 This command is not available for all mailbox types.
5723 .It Ic next
5724 (n) (like
5725 .Ql +
5727 .Dq ENTER )
5728 Goes to the next message in sequence and types it.
5729 With an argument list, types the next matching message.
5731 .It Ic New
5732 Same as
5733 .Ic Unread .
5735 .It Ic new
5736 Same as
5737 .Ic unread .
5739 .It Ic noop
5740 If the current folder is accessed via a network connection, a
5741 .Dq NOOP
5742 command is sent, otherwise no operation is performed.
5744 .It Ic Page
5745 Like
5746 .Ic page ,
5747 but also displays header fields which would not pass the
5748 .Ic headerpick
5749 selection, and all MIME parts.
5750 Identical to
5751 .Ic More .
5753 .It Ic page
5754 Invokes the
5755 .Ev PAGER
5756 on the given messages, even in non-interactive mode and as long as the
5757 standard output is a terminal.
5758 Identical to
5759 .Ic more .
5761 .It Ic Pipe
5762 Like
5763 .Ic pipe
5764 but also pipes header fields which would not pass the
5765 .Ic headerpick
5766 selection, and all parts of MIME
5767 .Ql multipart/alternative
5768 messages.
5770 .It Ic pipe
5771 (pi) Takes a message list and a shell command
5772 and pipes the messages through the command.
5773 Without an argument the current message is piped through the command
5774 given by the
5775 .Va cmd
5776 variable.
5777 If the
5778 .Va page
5779 variable is set,
5780 every message is followed by a formfeed character.
5782 .It Ic preserve
5783 (pre) A synonym for
5784 .Ic hold .
5786 .It Ic Print
5787 (P) Alias for
5788 .Ic Type .
5790 .It Ic print
5791 (p) Research
5793 equivalent of
5794 .Ic type .
5796 .It Ic quit
5797 (q) Terminates the session, saving all undeleted, unsaved messages in
5798 the current
5799 .Mx -sx
5800 .Sx "secondary mailbox"
5801 .Ev MBOX ,
5802 preserving all messages marked with
5803 .Ic hold
5805 .Ic preserve
5806 or never referenced in the system
5807 .Va inbox ,
5808 and removing all other messages from the
5809 .Mx -sx
5810 .Sx "primary system mailbox" .
5811 If new mail has arrived during the session,
5812 the message
5813 .Dq You have new mail
5814 will be shown.
5815 If given while editing a mailbox file with the command line option
5816 .Fl f ,
5817 then the edit file is rewritten.
5818 A return to the shell is effected,
5819 unless the rewrite of edit file fails,
5820 in which case the user can escape with the exit command.
5821 The optional status number argument will be passed through to
5822 .Xr exit 3 .
5823 \*(ID For now it can happen that the given status will be overwritten,
5824 later this will only occur if a later error needs to be reported onto an
5825 otherwise success indicating status.
5827 .It Ic read
5828 \*(NQ Read a line from standard input, or the channel set active via
5829 .Ic readctl ,
5830 and assign the data, which will be splitted as indicated by
5831 .Va ifs ,
5832 to the given variables.
5833 The variable names are checked by the same rules as documented for
5834 .Cm vput ,
5835 and the same error codes will be seen in
5836 .Va \&! ;
5837 the exit status
5838 .Va \&?
5839 indicates the number of bytes read, it will be
5840 .Ql -1
5841 with the error number
5842 .Va \&!
5843 set to
5844 .Va ^ERR Ns -BADF
5845 in case of I/O errors, or
5846 .Va ^ERR Ns -NONE
5847 upon End-Of-File.
5848 If there are more fields than variables, assigns successive fields to the
5849 last given variable.
5850 If there are less fields than variables, assigns the empty string to the
5851 remains.
5852 .Bd -literal -offset indent
5853 ? read a b c
5854    H  e  l  l  o
5855 ? echo "<$a> <$b> <$c>"
5856 <H> <e> <l  l  o>
5857 ? wysh set ifs=:; read a b c;unset ifs
5858 hey2.0,:"'you    ",:world!:mars.:
5859 ? echo $?/$^ERRNAME / <$a><$b><$c>
5860 0/NONE / <hey2.0,><"'you    ",><world!:mars.:><><>
5863 .It Ic readctl
5864 \*(NQ Manages input channels for
5865 .Ic read ,
5866 to be used to avoid complicated or impracticable code, like calling
5867 .Ic \&\&read
5868 from within a macro in non-interactive mode.
5869 Without arguments, or when the first argument is
5870 .Cm show ,
5871 a listing of all known channels is printed.
5872 Channels can otherwise be
5873 .Cm create Ns
5874 d, and existing channels can be
5875 .Cm set
5876 active and
5877 .Cm remove Ns
5878 d by giving the string used for creation.
5880 The channel name is expected to be a file descriptor number, or,
5881 if parsing the numeric fails, an input file name that undergoes
5882 .Sx "Filename transformations" .
5883 E.g. (this example requires a modern shell):
5884 .Bd -literal -offset indent
5885 $ LC_ALL=C printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
5886   LC_ALL=C \*(uA -R#
5887 hey, you
5888 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
5889   LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
5890 hey, you
5892 .It Ic redirect
5893 \*(OB Same as
5894 .Ic resend .
5895 .It Ic Redirect
5896 \*(OB Same as
5897 .Ic Resend .
5899 .It Ic remove
5900 Removes the named files or directories.
5901 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
5902 type specific removal will be performed, deleting the complete mailbox.
5903 The user is asked for confirmation in interactive mode.
5905 .It Ic rename
5906 Takes the name of an existing folder
5907 and the name for the new folder
5908 and renames the first to the second one.
5909 Both folders must be of the same type.
5911 .It Ic Reply
5912 (R) Replies to only the sender of each message of the given message
5913 list, by using the first message as the template to quote, for the
5914 .Ql Subject:
5915 etc.
5916 .Va flipr
5917 will exchange this command with
5918 .Ic reply .
5919 Unless the internal variable
5920 .Va fullnames
5921 is set the recipient address will be stripped from comments, names etc.
5922 .Ql Reply-To:
5923 headers will be inspected if
5924 .Va reply-to-honour
5925 is set.
5927 This may generate the errors
5928 .Va ^ERR Ns -DESTADDRREQ
5929 if no receiver has been specified,
5930 .Va ^ERR Ns -PERM
5931 if some addressees where rejected by
5932 .Va expandaddr ,
5933 .Va ^ERR Ns -NODATA
5934 if no applicable messages have been given,
5935 .Va ^ERR Ns -IO
5936 if an I/O error occurs,
5937 .Va ^ERR Ns -NOTSUP
5938 if a necessary character set conversion fails, and
5939 .Va ^ERR Ns -INVAL
5940 for other errors.
5942 .It Ic reply
5943 (r) Take a message and group-responds to it by addressing the sender
5944 and all recipients, subject to
5945 .Ic alternates
5946 processing.
5947 .Va followup-to ,
5948 .Va followup-to-honour ,
5949 .Va reply-to-honour
5950 as well as
5951 .Va recipients-in-cc
5952 influence response behaviour.
5953 Unless the internal variable
5954 .Va fullnames
5955 is set recipient addresses will be stripped from comments, names etc.
5957 .Va flipr
5958 is set the commands
5959 .Ic Reply
5961 .Ic reply
5962 are exchanged.
5963 The command
5964 .Ic Lreply
5965 offers special support for replying to mailing lists.
5966 For more documentation please refer to
5967 .Sx "On sending mail, and non-interactive mode" .
5969 This may generate the errors
5970 .Va ^ERR Ns -DESTADDRREQ
5971 if no receiver has been specified,
5972 .Va ^ERR Ns -PERM
5973 if some addressees where rejected by
5974 .Va expandaddr ,
5975 .Va ^ERR Ns -NODATA
5976 if no applicable messages have been given,
5977 .Va ^ERR Ns -IO
5978 if an I/O error occurs,
5979 .Va ^ERR Ns -NOTSUP
5980 if a necessary character set conversion fails, and
5981 .Va ^ERR Ns -INVAL
5982 for other errors.
5983 Any error stops processing of further messages.
5985 .It Ic replyall
5986 Similar to
5987 .Ic reply ,
5988 but initiates a group-reply regardless of the value of
5989 .Va flipr .
5991 .It Ic replysender
5992 Similar to
5993 .Ic Reply ,
5994 but responds to the sender only regardless of the value of
5995 .Va flipr .
5997 .It Ic Resend
5998 Like
5999 .Ic resend ,
6000 but does not add any header lines.
6001 This is not a way to hide the sender's identity,
6002 but useful for sending a message again to the same recipients.
6004 .It Ic resend
6005 Takes a list of messages and a user name
6006 and sends each message to the named user.
6007 .Ql Resent-From:
6008 and related header fields are prepended to the new copy of the message.
6009 Saving in
6010 .Va record
6011 is only performed if
6012 .Va record-resent
6013 is set.
6015 This may generate the errors
6016 .Va ^ERR Ns -DESTADDRREQ
6017 if no receiver has been specified,
6018 .Va ^ERR Ns -PERM
6019 if some addressees where rejected by
6020 .Va expandaddr ,
6021 .Va ^ERR Ns -NODATA
6022 if no applicable messages have been given,
6023 .Va ^ERR Ns -IO
6024 if an I/O error occurs,
6025 .Va ^ERR Ns -NOTSUP
6026 if a necessary character set conversion fails, and
6027 .Va ^ERR Ns -INVAL
6028 for other errors.
6029 Any error stops processing of further messages.
6031 .It Ic Respond
6032 Same as
6033 .Ic Reply .
6035 .It Ic respond
6036 Same as
6037 .Ic reply .
6039 .It Ic respondall
6040 Same as
6041 .Ic replyall .
6043 .It Ic respondsender
6044 Same as
6045 .Ic replysender .
6047 .It Ic retain
6048 (ret) Superseded by the multiplexer
6049 .Ic headerpick .
6051 .It Ic return
6052 Only available inside the scope of a
6053 .Ic define Ns
6054 d macro or an
6055 .Ic account ,
6056 this will stop evaluation of any further macro content, and return
6057 execution control to the caller.
6058 The two optional parameters must be specified as positive decimal
6059 numbers and default to the value 0:
6060 the first argument specifies the signed 32-bit return value (stored in
6061 .Va \&?
6062 \*(ID and later extended to signed 64-bit),
6063 the second the signed 32-bit error number (stored in
6064 .Va \&! ) .
6065 As documented for
6066 .Va \&?
6067 a non-0 exit status may cause the program to exit.
6069 .It Ic Save
6070 (S) Similar to
6071 .Ic save,
6072 but saves the messages in a file named after the local part of the
6073 sender of the first message instead of (in
6074 .Va record
6075 and) taking a filename argument; the variable
6076 .Va outfolder
6077 is inspected to decide on the actual storage location.
6079 .It Ic save
6080 (s) Takes a message list and a filename and appends each message in turn
6081 to the end of the file.
6082 If no filename is given, the
6083 .Mx -sx
6084 .Sx "secondary mailbox"
6085 .Ev MBOX
6086 is used.
6087 The filename in quotes, followed by the generated character count
6088 is echoed on the user's terminal.
6089 If editing a
6090 .Mx -sx
6091 .Sx "primary system mailbox"
6092 the messages are marked for deletion.
6093 .Sx "Filename transformations"
6094 will be applied.
6095 .It Ic savediscard
6096 \*(OB Superseded by the multiplexer
6097 .Ic headerpick .
6098 .It Ic saveignore
6099 \*(OB Superseded by the multiplexer
6100 .Ic headerpick .
6101 .It Ic saveretain
6102 \*(OB Superseded by the multiplexer
6103 .Ic headerpick .
6105 .It Ic search
6106 Takes a message specification (list) and displays a header summary of
6107 all matching messages, as via
6108 .Ic headers .
6109 This command is an alias of
6110 .Ic from .
6111 Also see
6112 .Sx "Specifying messages" .
6114 .It Ic seen
6115 Takes a message list and marks all messages as having been read.
6118 .It Ic set , unset
6119 (se, \*(NQ uns) The latter command will delete all given variables,
6120 the former, when used without arguments, will show all variables which
6121 are currently known to \*(UA.
6122 A more verbose listing will be produced if
6123 either of
6124 .Va debug
6126 .Va verbose
6127 are set.
6128 Remarks: the list mode will not automatically link-in known
6129 .Sx ENVIRONMENT
6130 variables, but only explicit addressing will, e.g., via
6131 .Ic varshow ,
6132 using a variable in an
6133 .Ic if
6134 condition or a string passed to
6135 .Ic echo ,
6136 explicit
6137 .Ic set Ns
6138 ting, as well as some program-internal use cases.
6140 Otherwise the given variables (and arguments) are set or adjusted.
6141 Arguments are of the form
6142 .Ql name=value
6143 (no space before or after
6144 .Ql = ) ,
6145 or plain
6146 .Ql name
6147 if there is no value, i.e., a boolean variable.
6148 \*(ID In conjunction with the
6149 .Cm wysh
6150 command prefix
6151 .Sx "Shell-style argument quoting"
6152 can be used to quote arguments as necessary.
6153 \*(ID Otherwise quotation marks may be placed around any part of the
6154 assignment statement to quote blanks or tabs.
6156 .Dl ? wysh set indentprefix=' -> '
6158 If an argument begins with
6159 .Ql no ,
6160 as in
6161 .Ql set nosave ,
6162 the effect is the same as invoking the
6163 .Ic unset
6164 command with the remaining part of the variable
6165 .Pf ( Ql unset save ) .
6168 .Ql name
6169 that is known to map to an environment variable will automatically cause
6170 updates in the program environment (unsetting a variable in the
6171 environment requires corresponding system support) \(em use the command
6172 .Ic environ
6173 for further environmental control.
6174 Also see
6175 .Ic varedit ,
6176 .Ic varshow
6177 and the sections
6178 .Sx "INTERNAL VARIABLES"
6180 .Sx ENVIRONMENT .
6182 .It Ic shcodec
6183 Apply shell quoting rules to the given raw-data arguments.
6184 Supports
6185 .Cm vput
6186 (see
6187 .Sx "Command modifiers" ) .
6188 The first argument specifies the operation:
6189 .Ar [+]e[ncode]
6191 .Ar d[ecode]
6192 cause shell quoting to be applied to the remains of the line, and
6193 expanded away thereof, respectively.
6194 If the former is prefixed with a plus-sign, the quoted result will not
6195 be roundtrip enabled, and thus can be decoded only in the very same
6196 environment that was used to perform the encode; also see
6197 .Cd mle-quote-rndtrip .
6198 If the coding operation fails the error number
6199 .Va \&!
6200 is set to
6201 .Va ^ERR Ns -CANCELED ,
6202 and the unmodified input is used as the result; the error number may
6203 change again due to output or result storage errors.
6205 .It Ic shell
6206 \*(NQ (sh) Invokes an interactive version of the shell,
6207 and returns its exit status.
6210 .It Ic shortcut , unshortcut
6211 Without arguments the list of all currently defined shortcuts is
6212 shown, with one argument the expansion of the given shortcut.
6213 Otherwise all given arguments are treated as pairs of shortcuts and
6214 their expansions, creating new or changing already existing shortcuts,
6215 as necessary.
6216 The latter command will remove all given shortcuts, the special name
6217 .Ql *
6218 will remove all registered shortcuts.
6220 .It Ic shift
6221 \*(NQ Shift the positional parameter stack (starting at
6222 .Va 1 )
6223 by the given number (which must be a positive decimal),
6224 or 1 if no argument has been given.
6225 It is an error if the value exceeds the number of positional parameters.
6226 If the given number is 0, no action is performed, successfully.
6227 The stack as such can be managed via
6228 .Ic vpospar .
6229 Note this command will fail in
6230 .Ic account
6231 and hook macros unless the positional parameter stack has been
6232 explicitly created in the current context via
6233 .Ic vpospar .
6235 .It Ic show
6236 Like
6237 .Ic type ,
6238 but performs neither MIME decoding nor decryption, so that the raw
6239 message text is shown.
6241 .It Ic size
6242 (si) Shows the size in characters of each message of the given
6243 message-list.
6245 .It Ic sleep
6246 \*(NQ Sleep for the specified number of seconds (and optionally
6247 milliseconds), by default interruptably.
6248 If a third argument is given the sleep will be uninterruptible,
6249 otherwise the error number
6250 .Va \&!
6251 will be set to
6252 .Va ^ERR Ns -INTR
6253 if the sleep has been interrupted.
6254 The command will fail and the error number will be
6255 .Va ^ERR Ns -OVERFLOW
6256 if the given duration(s) overflow the time datatype, and
6257 .Va ^ERR Ns -INVAL
6258 if the given durations are no valid integers.
6261 .It Ic sort , unsort
6262 The latter command disables sorted or threaded mode, returns to normal
6263 message order and, if the
6264 .Va header
6265 variable is set,
6266 displays a header summary.
6267 The former command shows the current sorting criterion when used without
6268 an argument, but creates a sorted representation of the current folder
6269 otherwise, and changes the
6270 .Ic next
6271 command and the addressing modes such that they refer to messages in
6272 the sorted order.
6273 Message numbers are the same as in regular mode.
6274 If the
6275 .Va header
6276 variable is set,
6277 a header summary in the new order is also displayed.
6278 Automatic folder sorting can be enabled by setting the
6279 .Va autosort
6280 variable, as in, e.g.,
6281 .Ql set autosort=thread .
6282 Possible sorting criterions are:
6284 .Bl -tag -compact -width "subject"
6285 .It Ar date
6286 Sort the messages by their
6287 .Ql Date:
6288 field, that is by the time they were sent.
6289 .It Ar from
6290 Sort messages by the value of their
6291 .Ql From:
6292 field, that is by the address of the sender.
6293 If the
6294 .Va showname
6295 variable is set, the sender's real name (if any) is used.
6296 .It Ar size
6297 Sort the messages by their size.
6298 .It spam
6299 \*(OP Sort the message by their spam score, as has been classified by
6300 .Ic spamrate .
6301 .It Ar status
6302 Sort the messages by their message status.
6303 .It Ar subject
6304 Sort the messages by their subject.
6305 .It Ar thread
6306 Create a threaded display.
6307 .It Ar to
6308 Sort messages by the value of their
6309 .Ql To:
6310 field, that is by the address of the recipient.
6311 If the
6312 .Va showname
6313 variable is set, the recipient's real name (if any) is used.
6316 .It Ic source
6317 \*(NQ (so) The source command reads commands from the given file.
6318 .Sx "Filename transformations"
6319 will be applied.
6320 If the given expanded argument ends with a vertical bar
6321 .Ql |
6322 then the argument will instead be interpreted as a shell command and
6323 \*(UA will read the output generated by it.
6324 Interpretation of commands read is stopped when an error is encountered.
6325 \*(ID Note that
6326 .Ic \&\&source
6327 cannot be used from within macros that execute as
6328 .Va folder-hook Ns s
6330 .Ic account Ns s ,
6331 i.e., it can only be called from macros that were
6332 .Ic call Ns ed .
6334 .It Ic source_if
6335 \*(NQ The difference to
6336 .Ic source
6337 (beside not supporting pipe syntax aka shell command input) is that
6338 this command will not generate an error nor warn if the given file
6339 argument cannot be opened successfully.
6341 .It Ic spamclear
6342 \*(OP Takes a list of messages and clears their
6343 .Ql is-spam
6344 flag.
6346 .It Ic spamforget
6347 \*(OP Takes a list of messages and causes the
6348 .Va spam-interface
6349 to forget it has ever used them to train its Bayesian filter.
6350 Unless otherwise noted the
6351 .Ql is-spam
6352 flag of the message is inspected to chose whether a message shall be
6353 forgotten to be
6354 .Dq ham
6356 .Dq spam .
6358 .It Ic spamham
6359 \*(OP Takes a list of messages and informs the Bayesian filter of the
6360 .Va spam-interface
6361 that they are
6362 .Dq ham .
6363 This also clears the
6364 .Ql is-spam
6365 flag of the messages in question.
6367 .It Ic spamrate
6368 \*(OP Takes a list of messages and rates them using the configured
6369 .Va spam-interface ,
6370 without modifying the messages, but setting their
6371 .Ql is-spam
6372 flag as appropriate; because the spam rating headers are lost the rate
6373 will be forgotten once the mailbox is left.
6374 Refer to the manual section
6375 .Sx "Handling spam"
6376 for the complete picture of spam handling in \*(UA.
6378 .It Ic spamset
6379 \*(OP Takes a list of messages and sets their
6380 .Ql is-spam
6381 flag.
6383 .It Ic spamspam
6384 \*(OP Takes a list of messages and informs the Bayesian filter of the
6385 .Va spam-interface
6386 that they are
6387 .Dq spam .
6388 This also sets the
6389 .Ql is-spam
6390 flag of the messages in question.
6391 .It Ic thread
6392 \*(OB The same as
6393 .Ql sort thread
6394 (consider using a
6395 .Ql commandalias
6396 as necessary).
6398 .It Ic Top
6399 Like
6400 .Ic top
6401 but always uses the
6402 .Ic headerpick
6403 .Ql type
6404 slot for white- and blacklisting header fields.
6406 .It Ic top
6407 (to) Takes a message list and types out the first
6408 .Va toplines
6409 lines of each message on the users' terminal.
6410 Unless a special selection has been established for the
6411 .Ql top
6412 slot of the
6413 .Ic headerpick
6414 command, the only header fields that are displayed are
6415 .Ql From: ,
6416 .Ql To: ,
6417 .Ql CC: ,
6419 .Ql Subject: .
6420 .Ic Top
6421 will always use the
6422 .Ql type
6423 .Ic headerpick
6424 selection instead.
6425 It is possible to apply compression to what is displayed by setting
6426 .Va topsqueeze .
6427 Messages are decrypted and converted to the terminal character set
6428 if necessary.
6430 .It Ic touch
6431 (tou) Takes a message list and marks the messages for saving in the
6432 .Mx -sx
6433 .Sx "secondary mailbox"
6434 .Ev MBOX .
6435 \*(UA deviates from the POSIX standard with this command,
6436 as a following
6437 .Ic next
6438 command will display the following message instead of the current one.
6440 .It Ic Type
6441 (T) Like
6442 .Ic type
6443 but also displays header fields which would not pass the
6444 .Ic headerpick
6445 selection, and all visualizable parts of MIME
6446 .Ql multipart/alternative
6447 messages.
6449 .It Ic type
6450 (t) Takes a message list and types out each message on the users terminal.
6451 The display of message headers is selectable via
6452 .Ic headerpick .
6453 For MIME multipart messages, all parts with a content type of
6454 .Ql text ,
6455 all parts which have a registered MIME type handler (see
6456 .Sx "HTML mail and MIME attachments" )
6457 which produces plain text output, and all
6458 .Ql message
6459 parts are shown, others are hidden except for their headers.
6460 Messages are decrypted and converted to the terminal character set
6461 if necessary.
6462 The command
6463 .Ic mimeview
6464 can be used to display parts which are not displayable as plain text.
6465 .It Ic unaccount
6467 .Ic account .
6468 .It Ic unalias
6469 (una) See
6470 .Ic alias .
6471 .It Ic unanswered
6473 .Ic answered .
6474 .It Ic unbind
6476 .Ic bind .
6477 .It Ic uncollapse
6479 .Ic collapse .
6480 .It Ic uncolour
6482 .Ic colour .
6483 .It Ic undefine
6485 .Ic define .
6486 .It Ic undelete
6488 .Ic delete .
6489 .It Ic undraft
6491 .Ic draft .
6492 .It Ic unflag
6494 .Ic flag .
6495 .It Ic unfwdignore
6496 \*(OB Superseded by the multiplexer
6497 .Ic headerpick .
6498 .It Ic unfwdretain
6499 \*(OB Superseded by the multiplexer
6500 .Ic headerpick .
6502 .It Ic unignore
6503 Superseded by the multiplexer
6504 .Ic headerpick .
6505 .It Ic unmimetype
6507 .Ic mimetype .
6508 .It Ic unmlist
6510 .Ic mlist .
6511 .It Ic unmlsubscribe
6513 .Ic mlsubscribe .
6515 .It Ic Unread
6516 Same as
6517 .Ic unread .
6519 .It Ic unread
6520 Takes a message list and marks each message as not having been read.
6522 .It Ic unretain
6523 Superseded by the multiplexer
6524 .Ic headerpick .
6525 .It Ic unsaveignore
6526 \*(OB Superseded by the multiplexer
6527 .Ic headerpick .
6528 .It Ic unsaveretain
6529 \*(OB Superseded by the multiplexer
6530 .Ic headerpick .
6531 .It Ic unset
6532 \*(NQ (uns) See
6533 .Ic set .
6534 .It Ic unshortcut
6536 .Ic shortcut .
6537 .It Ic unsort
6539 .Ic short .
6540 .It Ic unthread
6541 \*(OB
6542 Same as
6543 .Ic unsort .
6545 .It Ic urlcodec
6546 Perform URL percent codec operations on the raw-data argument, rather
6547 according to RFC 3986.
6548 Supports
6549 .Cm vput
6550 (see
6551 .Sx "Command modifiers" ) ,
6552 and manages the error number
6553 .Va \&! .
6554 This is a character set agnostic and thus locale dependent operation,
6555 and it may decode bytes which are invalid in the current
6556 .Va ttycharset .
6557 \*(ID This command does not know about URLs beside that.
6559 The first argument specifies the operation:
6560 .Ar e[ncode]
6562 .Ar d[ecode]
6563 perform plain URL percent en- and decoding, respectively.
6564 .Ar p[ath]enc[ode]
6566 .Ar p[ath]dec[ode]
6567 perform a slightly modified operation which should be better for
6568 pathnames: it does not allow a tilde
6569 .Ql ~ ,
6570 and will neither accept hyphen-minus
6571 .Ql -
6572 nor dot
6573 .Ql .
6574 as an initial character.
6575 The remains of the line form the URL data which is to be converted.
6576 If the coding operation fails the error number
6577 .Va \&!
6578 is set to
6579 .Va ^ERR Ns -CANCELED ,
6580 and the unmodified input is used as the result; the error number may
6581 change again due to output or result storage errors.
6583 .It Ic varedit
6584 \*(NQ Edit the values of or create the given variable(s) in the
6585 .Ev EDITOR .
6586 Boolean variables cannot be edited, and variables can also not be
6587 .Ic unset
6588 with this command.
6590 .It Ic varshow
6591 \*(NQ This command produces the same output as the listing mode of
6592 .Ic set ,
6593 including
6594 .Va verbose Ns
6595 ity adjustments, but only for the given variables.
6597 .It Ic verify
6598 \*(OP Takes a message list and verifies each message.
6599 If a message is not a S/MIME signed message,
6600 verification will fail for it.
6601 The verification process checks if the message was signed using a valid
6602 certificate,
6603 if the message sender's email address matches one of those contained
6604 within the certificate,
6605 and if the message content has been altered.
6607 .It Ic version
6608 Shows the
6609 .Va version
6611 .Va features
6612 of \*(UA.
6614 .It Ic vexpr
6615 \*(NQ Evaluate arguments according to a given operator.
6616 This is a multiplexer command which can be used to perform signed 64-bit
6617 numeric calculations as well as byte string and string operations.
6618 It uses polish notation, i.e., the operator is the first argument and
6619 defines the number and type, and the meaning of the remaining arguments.
6620 An empty argument is replaced with a 0 if a number is expected.
6621 Supports
6622 .Cm vput
6623 (see
6624 .Sx "Command modifiers" ) .
6626 The result that is shown in case of errors is always
6627 .Ql -1
6628 for usage errors and numeric operations, and the empty string for byte
6629 string and string operations;
6630 if the latter two fail to provide result data for
6631 .Dq soft
6632 errors, e.g., when a search operation failed, they also set the
6633 .Va \&!
6634 error number to
6635 .Va ^ERR Ns -NODATA .
6636 Except when otherwise noted numeric arguments are parsed as signed 64-bit
6637 numbers, and errors will be reported in the error number
6638 .Va \&!
6639 as the numeric error
6640 .Va ^ERR Ns -RANGE .
6642 Numeric operations work on one or two signed 64-bit integers.
6643 One integer is expected by assignment (equals sign
6644 .Ql = ) ,
6645 which does nothing but parsing the argument, thus detecting validity and
6646 possible overflow conditions, and unary not (tilde
6647 .Ql ~ ) ,
6648 which creates the bitwise complement.
6649 Two integers are used by addition (plus sign
6650 .Ql + ) ,
6651 subtraction (hyphen-minus
6652 .Ql - ) ,
6653 multiplication (asterisk
6654 .Ql * ) ,
6655 division (solidus
6656 .Ql / )
6657 and modulo (percent sign
6658 .Ql % ) ,
6659 as well as for the bitwise operators logical or (vertical bar
6660 .Ql | ,
6661 to be quoted) ,
6662 bitwise and (ampersand
6663 .Ql \&& ,
6664 to be quoted) ,
6665 bitwise xor (circumflex
6666 .Ql ^ ) ,
6667 the bitwise signed left- and right shifts
6668 .Pf ( Ql << ,
6669 .Ql >> ) ,
6670 as well as for the unsigned right shift
6671 .Ql >>> .
6673 All numeric operators can be suffixed with a commercial at
6674 .Ql @ ,
6675 e.g.,
6676 .Ql *@ :
6677 this will turn the operation into a saturated one, which means that
6678 overflow errors and division and modulo by zero are no longer reported
6679 via the exit status, but the result will linger at the minimum or
6680 maximum possible value, instead of overflowing (or trapping).
6681 This is true also for the argument parse step.
6682 For the bitwise shifts, the saturated maximum is 63.
6683 Any catched overflow will be reported via the error number
6684 .Va \&!
6686 .Va ^ERR Ns -OVERFLOW .
6688 Character set agnostic string functions have no notion of locale
6689 settings and character sets.
6690 There is
6691 .Ql file-expand ,
6692 which performs the usual
6693 .Sx "Filename transformations"
6694 on its argument, and
6695 .Ql random ,
6696 which generates a random string of the given length, or of
6697 .Dv \&\&PATH_MAX
6698 bytes (a constant from
6699 .Pa /usr/include )
6700 if the value 0 is given; the random string will be base64url encoded
6701 according to RFC 4648, and thus be usable as a (portable) filename.
6703 Byte string operations work on 8-bit bytes and have no notion of locale
6704 settings and character sets, effectively assuming ASCII data.
6705 Operations that take one argument are
6706 .Ql length ,
6707 which queries the length of the given argument, and
6708 .Ql hash ,
6709 which calculates the Chris Torek hash of the given argument.
6711 Byte string operations with two or more arguments are
6712 .Ql find ,
6713 which byte-searches in the first for the second argument, and shows the
6714 resulting 0-based offset shall it have been found,
6715 .Ql ifind ,
6716 which is identical to
6717 .Ql find ,
6718 but works case-insensitively according to the rules of the ASCII
6719 character set.
6720 .Ql substring
6721 will show a substring of its first argument:
6722 the second argument is the 0-based starting offset, the optional third
6723 argument can be used to specify the length of the desired substring,
6724 by default the entire string is used;
6725 this operation tries to work around faulty arguments (set
6726 .Va verbose
6727 for error logs), but reports them via the error number
6728 .Va \&!
6730 .Va ^ERR Ns -OVERFLOW .
6732 String operations work, sufficient support provided, according to the
6733 active user's locale encoding and character set (see
6734 .Sx "Character sets" ) .
6735 There is the one argument operation
6736 .Ql makeprint ,
6737 which (one-way) converts the argument to something safely printable on
6738 the terminal.
6740 \*(OP
6741 .Ql regex
6742 is a string operation that will try to match the first argument with the
6743 regular expression given as the second argument, as does
6744 .Ql iregex ,
6745 but which is case-insensitive.
6746 If the optional third argument has been given then instead of showing
6747 the match offset a replacement operation is performed:
6748 the third argument is treated as if specified via dollar-single-quote
6749 (see
6750 .Sx "Shell-style argument quoting" ) ,
6751 and any occurrence of a positional parameter, e.g.,
6752 .Va 1 ,
6753 is replaced by the corresponding match group of the regular expression.
6754 .Bd -literal -offset indent
6755 ? vexpr -@ +1 -9223372036854775808
6756 ? vput vexpr res ir bananarama (.*)NanA(.*) '\e${1}au\e$2'
6757 ? echo $0 $res
6760 .It Ic vpospar
6761 \*(NQ Manage the positional parameter stack (see
6762 .Va 1 , # , * , @
6763 as well as
6764 .Ic shift ) .
6765 If the first argument is
6766 .Ql clear ,
6767 then the positional parameter stack of the current context, or the
6768 global one, if there is none, is cleared.
6769 If it is
6770 .Ql set ,
6771 then the remaining arguments will be used to (re)create the stack,
6772 if the parameter stack size limit is excessed an
6773 .Va ^ERR Ns -OVERFLOW
6774 error will occur.
6776 If the first argument is
6777 .Ql quote ,
6778 a round-trip capable representation of the stack contents is created,
6779 with each quoted parameter separated from each other with the first
6780 character of
6781 .Va ifs ,
6782 and followed by the first character of
6783 .Va if-ws ,
6784 if that is not empty and not identical to the first.
6785 If that results in no separation at all a
6786 .Cm space
6787 character is used.
6788 This mode supports
6789 .Cm vput
6790 (see
6791 .Sx "Command modifiers" ) .
6792 I.e., the subcommands
6793 .Ql set
6795 .Ql quote
6796 can be used (in conjunction with
6797 .Ic eval )
6798 to (re)create an argument stack from and to a single variable losslessly.
6799 .Bd -literal -offset indent
6800 ? vpospar set hey, "'you    ", world!
6801 ? echo $#: <${1}><${2}><${3}>
6802 ? vput vpospar x quote
6803 ? vpospar clear
6804 ? echo $#: <${1}><${2}><${3}>
6805 ? eval vpospar set ${x}
6806 ? echo $#: <${1}><${2}><${3}>
6809 .It Ic visual
6810 (v) Takes a message list and invokes the display editor on each message.
6811 Modified contents are discarded unless the
6812 .Va writebackedited
6813 variable is set, and are not used unless the mailbox can be written to
6814 and the editor returns a successful exit status.
6816 .It Ic write
6817 (w) For conventional messages the body without all headers is written.
6818 The original message is never marked for deletion in the originating
6819 mail folder.
6820 The output is decrypted and converted to its native format as necessary.
6821 If the output file exists, the text is appended.
6822 If a message is in MIME multipart format its first part is written to
6823 the specified file as for conventional messages, handling of the remains
6824 depends on the execution mode.
6825 No special handling of compressed files is performed.
6827 In interactive mode the user is consecutively asked for the filenames of
6828 the processed parts.
6829 For convience saving of each part may be skipped by giving an empty
6830 value, the same result as writing it to
6831 .Pa /dev/null .
6832 Shell piping the part content by specifying a leading vertical bar
6833 .Ql |
6834 character for the filename is supported.
6835 Other user input undergoes the usual
6836 .Sx "Filename transformations" ,
6837 and contents of the destination file are overwritten if the file
6838 previously existed.
6840 \*(ID In non-interactive mode any part which does not specify a filename
6841 is ignored, and suspicious parts of filenames of the remaining parts are
6842 URL percent encoded (as via
6843 .Ic urlcodec )
6844 to prevent injection of malicious character sequences, resulting in
6845 a filename that will be written into the current directory.
6846 Existing files will not be overwritten, instead the part number or
6847 a dot are appended after a number sign
6848 .Ql #
6849 to the name until file creation succeeds (or fails due to other
6850 reasons).
6852 .It Ic xcall
6853 \*(NQ The sole difference to
6854 .Ic call
6855 is that the new macro is executed in place of the current one, which
6856 will not regain control: all resources of the current macro will be
6857 released first.
6858 This implies that any setting covered by
6859 .Ic localopts
6860 will be forgotten and covered variables will become cleaned up.
6861 If this command is not used from within a
6862 .Ic call Ns
6863 ed macro it will silently be (a more expensive variant of)
6864 .Ic call .
6866 .It Ic xit
6867 (x) A synonym for
6868 .Ic exit .
6870 .It Ic z
6871 \*(NQ \*(UA presents message headers in
6872 .Va screen Ns
6873 fuls as described under the
6874 .Ic headers
6875 command.
6876 Without arguments this command scrolls to the next window of messages,
6877 likewise if the argument is
6878 .Ql + .
6879 An argument of
6880 .Ql -
6881 scrolls to the last,
6882 .Ql ^
6883 scrolls to the first, and
6884 .Ql $
6885 to the last
6886 .Va \&\&screen
6887 of messages.
6888 A number argument prefixed by
6889 .Ql +
6891 .Ql \-
6892 indicates that the window is calculated in relation to the current
6893 position, and a number without a prefix specifies an absolute position.
6895 .It Ic Z
6896 \*(NQ Similar to
6897 .Ic z ,
6898 but scrolls to the next or previous window that contains at least one
6899 .Ql new
6901 .Ic flag Ns
6902 ged message.
6904 .Sh "COMMAND ESCAPES"
6905 Here is a summary of the command escapes available in compose mode,
6906 which are used to perform special functions when composing messages.
6907 Command escapes are only recognized at the beginning of lines, and
6908 consist of a trigger (escape) and a command character.
6909 The actual escape character can be set via the internal variable
6910 .Va escape ,
6911 it defaults to the tilde
6912 .Ql ~ .
6913 Otherwise ignored whitespace characters following the escape character
6914 will prevent a possible addition of the command line to the \*(OPal
6915 history.
6917 Unless otherwise noted all compose mode command escapes ensure proper
6918 updates of the variables which represent the error number
6919 .Va \&!
6920 and the exit status
6921 .Va \&? .
6922 If the variable
6923 .Va errexit
6924 is set they will, unless stated otherwise, error out message compose
6925 mode if an operation fails.
6926 It is however possible to place the character hyphen-minus
6927 .Ql -
6928 after (possible whitespace following) the escape character, which has an
6929 effect equivalent to the command modifier
6930 .Cm ignerr .
6931 If the \*(OPal key bindings are available it is possible to create
6932 .Ic bind Ns
6933 ings specifically for the compose mode.
6934 .Bl -tag -width ".It Ic BaNg"
6936 .It Ic ~~ Ar string
6937 Insert the string of text in the message prefaced by a single
6938 .Ql ~ .
6939 (If the escape character has been changed,
6940 that character must be doubled instead.)
6942 .It Ic ~! Ar command
6943 Execute the indicated shell
6944 .Ar command
6945 which follows, replacing unescaped exclamation marks with the previously
6946 executed command if the internal variable
6947 .Va bang
6948 is set, then return to the message.
6950 .It Ic ~.
6951 Same effect as typing the end-of-file character.
6953 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
6954 Execute the given \*(UA command.
6955 Not all commands, however, are allowed.
6957 .It Ic ~?
6958 Write a summary of command escapes.
6960 .It Ic ~< Ar filename
6961 Identical to
6962 .Ic ~r .
6964 .It Ic ~<! Ar command
6965 .Ar command
6966 is executed using the shell.
6967 Its standard output is inserted into the message.
6969 .It Ic ~@ Op Ar filename...
6970 Append or edit the list of attachments.
6971 Does not manage the error number
6972 .Va \&!
6973 and the exit status
6974 .Va \&? ,
6975 (please use
6976 .Ic ~^
6977 instead if this is a concern).
6978 A list of
6979 .Ar filename
6980 arguments is expected as shell tokens (see
6981 .Sx "Shell-style argument quoting" ;
6982 token-separating commas are ignored, too), to be
6983 interpreted as documented for the command line option
6984 .Fl a ,
6985 with the message number exception as below.
6987 Without
6988 .Ar filename
6989 arguments the attachment list is edited, entry by entry;
6990 if a filename is left empty, that attachment is deleted from the list;
6991 once the end of the list is reached either new attachments may be
6992 entered or the session can be quit by committing an empty
6993 .Dq new
6994 attachment.
6996 For all mode, if a given filename solely consists of the number sign
6997 .Ql #
6998 followed by a valid message number of the currently active mailbox, then
6999 the given message is attached as a
7000 .Ql message/rfc822
7001 MIME message part.
7002 As the shell comment character the number sign must be quoted.
7004 .It Ic ~A
7005 Inserts the string contained in the
7006 .Va Sign
7007 variable (same as
7008 .Ql Ic ~i Ns \0Sign ) .
7009 \*(OB The escape sequences tabulator
7010 .Ql \et
7011 and newline
7012 .Ql \en
7013 are understood (use the
7014 .Cm wysh
7015 prefix when
7016 .Ic set Ns
7017 ting the variable(s) instead).
7019 .It Ic ~a
7020 Inserts the string contained in the
7021 .Va sign
7022 variable (same as
7023 .Ql Ic ~i Ns \0sign ) .
7024 \*(OB The escape sequences tabulator
7025 .Ql \et
7026 and newline
7027 .Ql \en
7028 are understood (use the
7029 .Cm wysh
7030 prefix when
7031 .Ic set Ns
7032 ting the variable(s) instead).
7034 .It Ic ~b Ar name ...
7035 Add the given names to the list of blind carbon copy recipients.
7037 .It Ic ~c Ar name ...
7038 Add the given names to the list of carbon copy recipients.
7040 .It Ic ~d
7041 Read the file specified by the
7042 .Ev DEAD
7043 variable into the message.
7045 .It Ic ~e
7046 Invoke the text editor on the message collected so far.
7047 After the editing session is finished,
7048 the user may continue appending text to the message.
7050 .It Ic ~F Ar messages
7051 Read the named messages into the message being sent, including all
7052 message headers and MIME parts.
7053 If no messages are specified, read in the current message, the
7054 .Dq dot .
7056 .It Ic ~f Ar messages
7057 Read the named messages into the message being sent.
7058 If no messages are specified, read in the current message, the
7059 .Dq dot .
7060 Strips down the list of header fields according to the
7061 .Ql type
7062 white- and blacklist selection of
7063 .Ic headerpick .
7064 For MIME multipart messages,
7065 only the first displayable part is included.
7067 .It Ic ~H
7068 Edit the message header fields
7069 .Ql From: ,
7070 .Ql Reply-To:
7072 .Ql Sender:
7073 by typing each one in turn and allowing the user to edit the field.
7074 The default values for these fields originate from the
7075 .Va from , replyto
7077 .Va sender
7078 variables.
7080 .It Ic ~h
7081 Edit the message header fields
7082 .Ql To: ,
7083 .Ql Cc: ,
7084 .Ql Bcc:
7086 .Ql Subject:
7087 by typing each one in turn and allowing the user to edit the field.
7089 .It Ic ~I Ar variable
7090 Insert the value of the specified variable into the message.
7091 The message remains unaltered if the variable is unset or empty.
7092 \*(OB The escape sequences tabulator
7093 .Ql \et
7094 and newline
7095 .Ql \en
7096 are understood (use the
7097 .Cm wysh
7098 prefix when
7099 .Ic set Ns
7100 ting the variable(s) instead).
7102 .It Ic ~i Ar variable
7103 Identical to
7104 .Ic ~I ,
7105 but adds a newline character at the end of a successful insertion.
7107 .It Ic ~M Ar messages
7108 Read the named messages into the message being sent,
7109 indented by
7110 .Va indentprefix .
7111 If no messages are specified, read the current message, the
7112 .Dq dot .
7114 .It Ic ~m Ar messages
7115 Read the named messages into the message being sent,
7116 indented by
7117 .Va indentprefix .
7118 If no messages are specified, read the current message, the
7119 .Dq dot .
7120 Strips down the list of header fields according to the
7121 .Ql type
7122 white- and blacklist selection of
7123 .Ic headerpick .
7124 For MIME multipart messages,
7125 only the first displayable part is included.
7127 .It Ic ~p
7128 Display the message collected so far,
7129 prefaced by the message header fields
7130 and followed by the attachment list, if any.
7132 .It Ic ~q
7133 Abort the message being sent,
7134 copying it to the file specified by the
7135 .Ev DEAD
7136 variable if
7137 .Va save
7138 is set.
7140 .It Ic ~R Ar filename
7141 Identical to
7142 .Ic ~r ,
7143 but indent each line that has been read by
7144 .Va indentprefix .
7146 .It Ic ~r Ar filename Op Ar HERE-delimiter
7147 Read the named file, object to the usual
7148 .Sx "Filename transformations" ,
7149 into the message; if (the expanded)
7150 .Ar filename
7151 is the hyphen-minus
7152 .Ql -
7153 then standard input is used, e.g., for pasting purposes.
7154 Only in this latter mode
7155 .Ar HERE-delimiter
7156 may be given: if it is data will be read in until the given
7157 .Ar HERE-delimiter
7158 is seen on a line by itself, and encountering EOF is an error; the
7159 .Ar HERE-delimiter
7160 is a required argument in non-interactive mode; if it is single-quote
7161 quoted then the pasted content will not be expanded, \*(ID otherwise
7162 a future version of \*(UA may perform shell-style expansion on the content.
7164 .It Ic ~s Ar string
7165 Cause the named string to become the current subject field.
7166 Newline (NL) and carriage-return (CR) bytes are invalid and will be
7167 normalized to space (SP) characters.
7169 .It Ic ~t Ar name ...
7170 Add the given name(s) to the direct recipient list.
7172 .It Ic ~U Ar messages
7173 Read in the given / current message(s) excluding all headers, indented by
7174 .Va indentprefix .
7176 .It Ic ~u Ar messages
7177 Read in the given / current message(s), excluding all headers.
7179 .It Ic ~v
7180 Invoke an alternate editor (defined by the
7181 .Ev VISUAL
7182 environment variable) on the message collected so far.
7183 Usually, the alternate editor will be a screen editor.
7184 After the editor is quit,
7185 the user may resume appending text to the end of the message.
7187 .It Ic ~w Ar filename
7188 Write the message onto the named file, which is object to the usual
7189 .Sx "Filename transformations" .
7190 If the file exists,
7191 the message is appended to it.
7193 .It Ic ~x
7194 Same as
7195 .Ic ~q ,
7196 except that the message is not saved at all.
7198 .It Ic ~| Ar command
7199 Pipe the message through the specified filter command.
7200 If the command gives no output or terminates abnormally,
7201 retain the original text of the message.
7202 E.g., the command
7203 .Xr fmt 1
7204 is often used as a rejustifying filter.
7206 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
7207 Low-level command meant for scripted message access, i.e., for
7208 .Va on-compose-splice
7210 .Va on-compose-splice-shell .
7211 The used protocol is likely subject to changes, and therefore the
7212 mentioned hooks receive the used protocol version as an initial line.
7213 In general the first field of a response line represents a status code
7214 which specifies whether a command was successful or not, whether result
7215 data is to be expected, and if, the format of the result data.
7216 Does not manage the error number
7217 .Va \&!
7218 and the exit status
7219 .Va \&? ,
7220 because errors are reported via the protocol
7221 (hard errors like I/O failures cannot be handled).
7222 This command has read-only access to several virtual pseudo headers in
7223 the \*(UA private namespace, which may not exist (except for the first):
7225 .Bl -tag -compact -width ".It Va BaNg"
7226 .It Ql Mailx-Command:
7227 The name of the command that generates the message, one of
7228 .Ql forward ,
7229 .Ql Lreply ,
7230 .Ql mail ,
7231 .Ql Reply ,
7232 .Ql reply ,
7233 .Ql resend .
7234 .It Ql Mailx-Raw-To:
7235 .It Ql Mailx-Raw-Cc:
7236 .It Ql Mailx-Raw-Bcc:
7237 Represent the frozen initial state of these headers before any
7238 transformation (e.g.,
7239 .Ic alias ,
7240 .Ic alternates ,
7241 .Va recipients-in-cc
7242 etc.) took place.
7243 .It Ql Mailx-Orig-From:
7244 .It Ql Mailx-Orig-To:
7245 .It Ql Mailx-Orig-Cc:
7246 .It Ql Mailx-Orig-Bcc:
7247 The values of said headers of the original message which has been
7248 addressed by any of
7249 .Ic reply , forward , resend .
7252 The status codes are:
7254 .Bl -tag -compact -width ".It Ql 210"
7255 .It Ql 210
7256 Status ok; the remains of the line are the result.
7257 .It Ql 211
7258 Status ok; the rest of the line is optionally used for more status.
7259 What follows are lines of result addresses, terminated by an empty line.
7260 The address lines consist of two fields, the first of which is the
7261 plain address, e.g.,
7262 .Ql bob@exam.ple ,
7263 separated by a single ASCII SP space from the second which contains the
7264 unstripped address, even if that is identical to the first field, e.g.,
7265 .Ql (Lovely) Bob <bob@exam.ple> .
7266 All the input, including the empty line, must be consumed before further
7267 commands can be issued.
7268 .It Ql 212
7269 Status ok; the rest of the line is optionally used for more status.
7270 What follows are lines of furtherly unspecified string content,
7271 terminated by an empty line.
7272 All the input, including the empty line, must be consumed before further
7273 commands can be issued.
7274 .It Ql 500
7275 Syntax error; invalid command.
7276 .It Ql 501
7277 Syntax error in parameters or arguments.
7278 .It Ql 505
7279 Error: an argument fails verification.
7280 For example an invalid address has been specified, or an attempt was
7281 made to modify anything in \*(UA's own namespace.
7282 .It Ql 506
7283 Error: an otherwise valid argument is rendered invalid due to context.
7284 For example, a second address is added to a header which may consist of
7285 a single address only.
7288 If a command indicates failure then the message will have remained
7289 unmodified.
7290 Most commands can fail with
7291 .Ql 500
7292 if required arguments are missing (false command usage).
7293 The following (case-insensitive) commands are supported:
7294 .Bl -hang -width ".It Cm header"
7295 .It Cm header
7296 This command allows listing, inspection, and editing of message headers.
7297 Header name case is not normalized, and case-insensitive comparison
7298 should be used when matching names.
7299 The second argument specifies the subcommand to apply, one of:
7300 .Bl -hang -width ".It Cm remove"
7301 .It Cm list
7302 Without a third argument a list of all yet existing headers is given via
7303 .Ql 210 ;
7304 this command is the default command of
7305 .Cm header
7306 if no second argument has been given.
7307 A third argument restricts output to the given header only, which may
7308 fail with
7309 .Ql 501
7310 if no such field is defined.
7311 .It Cm show
7312 Shows the content of the header given as the third argument.
7313 Dependent on the header type this may respond with
7314 .Ql 211
7316 .Ql 212 ;
7317 any failure results in
7318 .Ql 501 .
7319 .It Cm remove
7320 This will remove all instances of the header given as the third
7321 argument, reporting
7322 .Ql 210
7323 upon success,
7324 .Ql 501
7325 if no such header can be found, and
7326 Ql 505
7327 on \*(UA namespace violations.
7328 .It Cm remove-at
7329 This will remove from the header given as the third argument the
7330 instance at the list position (counting from one!) given with the fourth
7331 argument, reporting
7332 .Ql 210
7333 upon success or
7334 .Ql 505
7335 if the list position argument is not a number or on \*(UA namespace
7336 violations, and
7337 .Ql 501
7338 if no such header instance exists.
7339 .It Cm insert
7340 Create a new or an additional instance of the header given in the third
7341 argument, with the header body content as given in the fourth argument
7342 (the remains of the line).
7343 It may return
7344 .Ql 501
7345 if the third argument specifies a free-form header field name that is
7346 invalid, or if body content extraction fails to succeed,
7347 .Ql 505
7348 if any extracted address does not pass syntax and/or security checks or
7349 on \*(UA namespace violations, and
7350 .Ql 506
7351 to indicate prevention of excessing a single-instance header \(em note that
7352 .Ql Subject:
7353 can be appended to (a space separator will be added automatically first).
7355 .Ql 210
7356 is returned upon success, followed by the name of the header and the list
7357 position of the newly inserted instance.
7358 The list position is always 1 for single-instance header fields.
7359 All free-form header fields are managed in a single list.
7361 .It Cm attachment
7362 This command allows listing, removal and addition of message attachments.
7363 The second argument specifies the subcommand to apply, one of:
7364 .Bl -hang -width ".It Cm remove"
7365 .It Cm list
7366 List all attachments via
7367 .Ql 212 ,
7368 or report
7369 .Ql 501
7370 if no attachments exist.
7371 This command is the default command of
7372 .Cm attachment
7373 if no second argument has been given.
7374 .It Cm remove
7375 This will remove the attachment given as the third argument, and report
7376 .Ql 210
7377 upon success or
7378 .Ql 501
7379 if no such attachment can be found.
7380 If there exists any path component in the given argument, then an exact
7381 match of the path which has been used to create the attachment is used
7382 directly, but if only the basename of that path matches then all
7383 attachments are traversed to find an exact match first, and the removal
7384 occurs afterwards; if multiple basenames match, a
7385 .Ql 506
7386 error occurs.
7387 Message attachments are treated as absolute pathnames.
7389 If no path component exists in the given argument, then all attachments
7390 will be searched for
7391 .Ql filename=
7392 parameter matches as well as for matches of the basename of the path
7393 which has been used when the attachment has been created; multiple
7394 matches result in a
7395 .Ql 506 .
7396 .It Cm remove-at
7397 This will interpret the third argument as a number and remove the
7398 attachment at that list position (counting from one!), reporting
7399 .Ql 210
7400 upon success or
7401 .Ql 505
7402 if the argument is not a number or
7403 .Ql 501
7404 if no such attachment exists.
7405 .It Cm insert
7406 Adds the attachment given as the third argument, specified exactly as
7407 documented for the command line option
7408 .Fl a ,
7409 and supporting the message number extension as documented for
7410 .Ic ~@ .
7411 This reports
7412 .Ql 210
7413 upon success, with the index of the new attachment following,
7414 .Ql 505
7415 if the given file cannot be opened,
7416 .Ql 506
7417 if an on-the-fly performed character set conversion fails, otherwise
7418 .Ql 501
7419 is reported; this is also reported if character set conversion is
7420 requested but not available.
7421 .It Cm attribute
7422 This uses the same search mechanism as described for
7423 .Cm remove
7424 and prints any known attributes of the first found attachment via
7425 .Ql 212
7426 upon success or
7427 .Ql 501
7428 if no such attachment can be found.
7429 The attributes are written as lines of keyword and value tuples, the
7430 keyword being separated from the rest of the line with an ASCII SP space
7431 character.
7432 .It Cm attribute-at
7433 This uses the same search mechanism as described for
7434 .Cm remove-at
7435 and is otherwise identical to
7436 .Cm attribute .
7437 .It Cm attribute-set
7438 This uses the same search mechanism as described for
7439 .Cm remove ,
7440 and will assign the attribute given as the fourth argument, which is
7441 expected to be a value tuple of keyword and other data, separated by
7442 a ASCII SP space or TAB tabulator character.
7443 If the value part is empty, then the given attribute is removed, or
7444 reset to a default value if existence of the attribute is crucial.
7446 It returns via
7447 .Ql 210
7448 upon success, with the index of the found attachment following,
7449 .Ql 505
7450 for message attachments or if the given keyword is invalid, and
7451 .Ql 501
7452 if no such attachment can be found.
7453 The following keywords may be used (case-insensitively):
7455 .Bl -hang -compact -width ".It Ql filename"
7456 .It Ql filename
7457 Sets the filename of the MIME part, i.e., the name that is used for
7458 display and when (suggesting a name for) saving (purposes).
7459 .It Ql content-description
7460 Associate some descriptive information to the attachment's content, used
7461 in favour of the plain filename by some MUAs.
7462 .It Ql content-id
7463 May be used for uniquely identifying MIME entities in several contexts;
7464 this expects a special reference address format as defined in RFC 2045
7465 and generates a
7466 .Ql 505
7467 upon address content verification failure.
7468 .It Ql content-type
7469 Defines the media type/subtype of the part, which is managed
7470 automatically, but can be overwritten.
7471 .It Ql content-disposition
7472 Automatically set to the string
7473 .Ql attachment .
7475 .It Cm attribute-set-at
7476 This uses the same search mechanism as described for
7477 .Cm remove-at
7478 and is otherwise identical to
7479 .Cm attribute-set .
7483 .Sh "INTERNAL VARIABLES"
7484 Internal \*(UA variables are controlled via the
7485 .Ic set
7487 .Ic unset
7488 commands; prefixing a variable name with the string
7489 .Ql no
7490 and calling
7491 .Ic set
7492 has the same effect as using
7493 .Ic unset :
7494 .Ql unset crt
7496 .Ql set nocrt
7497 do the same thing.
7498 Creation or editing of variables can be performed in the
7499 .Ev EDITOR
7500 with the command
7501 .Ic varedit .
7502 .Ic varshow
7503 will give more insight on the given variable(s), and
7504 .Ic set ,
7505 when called without arguments, will show a listing of all variables.
7506 Both commands support a more
7507 .Va verbose
7508 listing mode.
7509 Some well-known variables will also become inherited from the
7510 program
7511 .Sx ENVIRONMENT
7512 implicitly, others can be imported explicitly with the command
7513 .Ic environ
7514 and henceforth share said properties.
7516 Two different kinds of internal variables exist.
7517 There are boolean variables, which can only be in one of the two states
7518 .Dq set
7520 .Dq unset ,
7521 and value variables with a(n optional) string value.
7522 For the latter proper quoting is necessary upon assignment time, the
7523 introduction of the section
7524 .Sx COMMANDS
7525 documents the supported quoting rules.
7526 .Bd -literal -offset indent
7527 ? wysh set one=val\e 1 two="val 2" \e
7528     three='val "3"' four=$'val \e'4\e''; \e
7529     varshow one two three four; \e
7530     unset one two three four
7533 Dependent upon the actual option the string values will be interpreted
7534 as numbers, colour names, normal text etc., but there also exists
7535 a special kind of string value, the
7536 .Dq boolean string ,
7537 which must either be a decimal integer (in which case
7538 .Ql 0
7539 is false and
7540 .Ql 1
7541 and any other value is true) or any of the (case-insensitive) strings
7542 .Ql off ,
7543 .Ql no ,
7544 .Ql n
7546 .Ql false
7547 for a false boolean and
7548 .Ql on ,
7549 .Ql yes ,
7550 .Ql y
7552 .Ql true
7553 for a true boolean; a special kind of boolean string is the
7554 .Dq quadoption ,
7555 which is a boolean string that can optionally be prefixed with the
7556 (case-insensitive) term
7557 .Ql ask- ,
7558 as in
7559 .Ql ask-yes ,
7560 which causes prompting of the user in interactive mode, with the given
7561 boolean as the default value.
7562 .Ss "Initial settings"
7563 The standard POSIX 2008/Cor 2-2016 mandates the following initial
7564 variable settings:
7565 .Pf no Va allnet ,
7566 .Pf no Va append ,
7567 .Va asksub ,
7568 .Pf no Va askbcc ,
7569 .Pf no Va autoprint ,
7570 .Pf no Va bang ,
7571 .Pf no Va cmd ,
7572 .Pf no Va crt ,
7573 .Pf no Va debug ,
7574 .Pf no Va dot ,
7575 .Va escape
7576 set to
7577 .Ql ~ ,
7578 .Pf no Va flipr ,
7579 .Pf no Va folder ,
7580 .Va header ,
7581 .Pf no Va hold ,
7582 .Pf no Va ignore ,
7583 .Pf no Va ignoreeof ,
7584 .Pf no Va keep ,
7585 .Pf no Va keepsave ,
7586 .Pf no Va metoo ,
7587 .Pf no Va outfolder ,
7588 .Pf no Va page ,
7589 .Va prompt
7590 set to
7591 .Ql ?\0 ,
7592 .Pf no Va quiet ,
7593 .Pf no Va record ,
7594 .Va save ,
7595 .Pf no Va sendwait ,
7596 .Pf no Va showto ,
7597 .Pf no Va Sign ,
7598 .Pf no Va sign ,
7599 .Va toplines
7600 set to
7601 .Ql 5 .
7603 Notes: \*(UA does not support the
7604 .Pf no Va onehop
7605 variable \(en use command line options or
7606 .Va mta-arguments
7607 to pass options through to a
7608 .Va mta .
7609 And the default global
7610 .Pa \*(UR
7611 file, which is loaded unless the
7612 .Fl \&:
7613 (with according argument) or
7614 .Fl n
7615 command line options have been used, or the
7616 .Ev MAILX_NO_SYSTEM_RC
7617 environment variable is set (see
7618 .Sx "Resource files" )
7619 bends those initial settings a bit, e.g., it sets the variables
7620 .Va hold ,
7621 .Va keepsave
7623 .Va keep ,
7624 to name a few, establishes a default
7625 .Ic headerpick
7626 selection etc., and should thus be taken into account.
7627 .Ss "Variables"
7628 .Bl -tag -width ".It Va BaNg"
7630 .It Va \&?
7631 \*(RO The exit status of the last command, or the
7632 .Ic return
7633 value of the macro
7634 .Ic call Ns
7635 ed last.
7636 This status has a meaning in the state machine: in conjunction with
7637 .Va errexit
7638 any non-0 exit status will cause a program exit, and in
7639 .Ev POSIXLY_CORRECT
7640 mode any error while loading (any of the) resource files will have the
7641 same effect.
7642 .Cm ignerr ,
7643 one of the
7644 .Sx "Command modifiers" ,
7645 can be used to instruct the state machine to ignore errors.
7647 .It Va \&!
7648 \*(RO The current error number
7649 .Pf ( Xr errno 3 ) ,
7650 which is set after an error occurred; it is also available via
7651 .Va ^ERR ,
7652 and the error name and documentation string can be queried via
7653 .Va ^ERRNAME
7655 .Va ^ERRDOC .
7656 \*(ID This machinery is new and the error number is only really usable
7657 if a command explicitly states that it manages the variable
7658 .Va \&! ,
7659 for others errno will be used in case of errors, or
7660 .Va ^ERR Ns -INVAL
7661 if that is 0: it thus may or may not reflect the real error.
7662 The error number may be set with the command
7663 .Ic return .
7665 .It Va ^
7666 \*(RO This is a multiplexer variable which performs dynamic expansion of
7667 the requested state or condition, of which there are:
7669 .Bl -tag -compact -width ".It Va BaNg"
7673 .It Va ^ERR , ^ERRDOC , ^ERRNAME
7674 The number, documentation, and name of the current
7675 .Xr errno 3 ,
7676 respectively, which is usually set after an error occurred.
7677 \*(ID This machinery is new and is usually reliable only if a command
7678 explicitly states that it manages the variable
7679 .Va \&! ,
7680 which is effectively identical to
7681 .Va \&\&^ERR .
7682 Each of those variables can be suffixed with a hyphen minus followed by
7683 a name or number, in which case the expansion refers to the given error.
7684 Note this is a direct mapping of (a subset of) the system error values:
7685 .Bd -literal -offset indent
7686 define work {
7687   eval echo \e$1: \e$^ERR-$1: \e$^ERRNAME-$1: \e$^ERRDOC-$1
7688   vput vexpr i + "$1" 1
7689   if [ $i -lt 16 ]
7690     \excall work $i
7691   end
7693 call work 0
7697 .It Va *
7698 \*(RO Expands all positional parameters (see
7699 .Va 1 ) ,
7700 separated by a space character.
7701 \*(ID The special semantics of the equally named special parameter of the
7702 .Xr sh 1
7703 are not yet supported.
7705 .It Va @
7706 \*(RO Expands all positional parameters (see
7707 .Va 1 ) ,
7708 separated by a space character.
7709 If placed in double quotation marks, each positional parameter is
7710 properly quoted to expand to a single parameter again.
7712 .It Va #
7713 \*(RO Expands to the number of positional parameters, i.e., the size of
7714 the positional parameter stack in decimal.
7716 .It Va \&0
7717 \*(RO Inside the scope of a
7718 .Ic define Ns
7719 d and
7720 .Ic call Ns
7721 ed macro this expands to the name of the calling macro, or to the empty
7722 string if the macro is running from top-level.
7723 For the \*(OPal regular expression search and replace operator of
7724 .Ic vexpr
7725 this expands to the entire matching expression.
7726 It represents the program name in global context.
7728 .It Va 1
7729 \*(RO Access of the positional parameter stack.
7730 All further parameters can be accessed with this syntax, too, e.g.,
7731 .Ql 2 ,
7732 .Ql 3
7733 etc.; positional parameters can be shifted off the stack by calling
7734 .Ic shift .
7735 The parameter stack contains, e.g., the arguments of a
7736 .Ic call Ns
7738 .Ic define Ns
7739 d macro, the matching groups of the \*(OPal regular expression search
7740 and replace expression of
7741 .Ic vexpr ,
7742 and can be explicitly created or overwritten with the command
7743 .Ic vpospar .
7745 .It Va account
7746 \*(RO Is set to the active
7747 .Ic account .
7749 .It Va add-file-recipients
7750 \*(BO When file or pipe recipients have been specified,
7751 mention them in the corresponding address fields of the message instead
7752 of silently stripping them from their recipient list.
7753 By default such addressees are not mentioned.
7755 .It Va allnet
7756 \*(BO Causes only the local part to be evaluated
7757 when comparing addresses.
7759 .It Va append
7760 \*(BO Causes messages saved in the
7761 .Mx -sx
7762 .Sx "secondary mailbox"
7763 .Ev MBOX
7764 to be appended to the end rather than prepended.
7765 This should always be set.
7767 .It Va ask
7768 \*(BO Causes \*(UA to prompt for the subject of each message sent.
7769 If the user responds with simply a newline,
7770 no subject field will be sent.
7772 .It Va askatend
7773 \*(BO Causes the prompts for
7774 .Ql Cc:
7776 .Ql Bcc:
7777 lists to appear after the message has been edited.
7779 .It Va askattach
7780 \*(BO If set, \*(UA asks for files to attach at the end of each message,
7781 shall the list be found empty at that time.
7782 An empty line finalizes the list.
7784 .It Va askcc
7785 \*(BO Causes the user to be prompted for carbon copy recipients
7786 (at the end of each message if
7787 .Va askatend
7789 .Va bsdcompat
7790 are set) shall the list be found empty (at that time).
7791 An empty line finalizes the list.
7793 .It Va askbcc
7794 \*(BO Causes the user to be prompted for blind carbon copy
7795 recipients (at the end of each message if
7796 .Va askatend
7798 .Va bsdcompat
7799 are set) shall the list be found empty (at that time).
7800 An empty line finalizes the list.
7802 .It Va asksign
7803 \*(BO\*(OP Causes the user to be prompted if the message is to be
7804 signed at the end of each message.
7806 .Va smime-sign
7807 variable is ignored when this variable is set.
7809 .It Va asksub
7810 \*(BO Alternative name for
7811 .Va ask .
7813 .It Va attrlist
7814 A sequence of characters to display in the
7815 .Ql attribute
7816 column of the
7817 .Va headline
7818 as shown in the display of
7819 .Ic headers ;
7820 each for one type of messages (see
7821 .Sx "Message states" ) ,
7822 with the default being
7823 .Ql NUROSPMFAT+\-$~
7825 .Ql NU\ \ *HMFAT+\-$~
7826 if the
7827 .Va bsdflags
7828 variable is set, in the following order:
7830 .Bl -tag -compact -width ".It Ql _"
7831 .It Ql N
7832 new.
7833 .It Ql U
7834 unread but old.
7835 .It Ql R
7836 new but read.
7837 .It Ql O
7838 read and old.
7839 .It Ql S
7840 saved.
7841 .It Ql P
7842 preserved.
7843 .It Ql M
7844 mboxed.
7845 .It Ql F
7846 flagged.
7847 .It Ql A
7848 answered.
7849 .It Ql T
7850 draft.
7851 .It Ql +
7852 start of a collapsed thread.
7853 .It Ql -
7854 an uncollapsed thread (TODO ignored for now).
7855 .It Ql $
7856 classified as spam.
7857 .It Ql ~
7858 classified as possible spam.
7861 .It Va autobcc
7862 Specifies a list of recipients to which a blind carbon copy of each
7863 outgoing message will be sent automatically.
7865 .It Va autocc
7866 Specifies a list of recipients to which a carbon copy of each outgoing
7867 message will be sent automatically.
7869 .It Va autocollapse
7870 \*(BO Causes threads to be collapsed automatically when threaded mode
7871 is entered (see the
7872 .Ic collapse
7873 command).
7875 .It Va autoprint
7876 \*(BO Enable automatic
7877 .Ic type Ns
7878 ing of a(n existing)
7879 .Dq successive
7880 message after
7881 .Ic delete
7883 .Ic undelete
7884 commands, e.g., the message that becomes the new
7885 .Dq dot
7886 is shown automatically, as via
7887 .Ic dp
7889 .Ic dt .
7891 .It Va autosort
7892 Causes sorted mode (see the
7893 .Ic sort
7894 command) to be entered automatically with the value of this variable as
7895 sorting method when a folder is opened, e.g.,
7896 .Ql set autosort=thread .
7898 .It Va bang
7899 \*(BO Enables the substitution of all not (reverse-solidus) escaped
7900 exclamation mark
7901 .Ql \&!
7902 characters by the contents of the last executed command for the
7903 .Ic \&!
7904 shell escape command and
7905 .Ic ~! ,
7906 one of the compose mode
7907 .Sx "COMMAND ESCAPES" .
7908 If this variable is not set no reverse solidus stripping is performed.
7910 .It Va bind-timeout
7911 \*(OP Terminals generate multi-byte sequences for certain forms of
7912 input, for example for function and other special keys.
7913 Some terminals however do not write these multi-byte sequences as
7914 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
7915 This variable specifies the timeout in milliseconds that the MLE (see
7916 .Sx "On terminal control and line editor" )
7917 waits for more bytes to arrive unless it considers a sequence
7918 .Dq complete .
7919 The default is 200.
7921 .It Va bsdcompat
7922 \*(BO Sets some cosmetical features to traditional BSD style;
7923 has the same affect as setting
7924 .Va askatend
7925 and all other variables prefixed with
7926 .Ql bsd ;
7927 it also changes the behaviour of
7928 .Va emptystart
7929 (which does not exist in BSD).
7931 .It Va bsdflags
7932 \*(BO Changes the letters shown in the first column of a header
7933 summary to traditional BSD style.
7935 .It Va bsdheadline
7936 \*(BO Changes the display of columns in a header summary to traditional
7937 BSD style.
7939 .It Va bsdmsgs
7940 \*(BO Changes some informational messages to traditional BSD style.
7942 .It Va bsdorder
7943 \*(BO Causes the
7944 .Ql Subject:
7945 field to appear immediately after the
7946 .Ql To:
7947 field in message headers and with the
7948 .Ic ~h
7949 .Sx "COMMAND ESCAPES" .
7952 .It Va build-os , build-osenv
7953 \*(RO The operating system \*(UA has been build for, usually taken from
7954 .Xr uname 1
7956 .Ql uname -s
7958 .Ql uname -srm ,
7959 respectively, the former being lowercased.
7961 .It Va charset-7bit
7962 The value that should appear in the
7963 .Ql charset=
7964 parameter of
7965 .Ql Content-Type:
7966 MIME header fields when no character set conversion of the message data
7967 was performed.
7968 This defaults to US-ASCII, and the chosen character set should be
7969 US-ASCII compatible.
7971 .It Va charset-8bit
7972 \*(OP The default 8-bit character set that is used as an implicit last
7973 member of the variable
7974 .Va sendcharsets .
7975 This defaults to UTF-8 if character set conversion capabilities are
7976 available, and to ISO-8859-1 otherwise, in which case the only supported
7977 character set is
7978 .Va ttycharset
7979 and this variable is effectively ignored.
7980 Refer to the section
7981 .Sx "Character sets"
7982 for the complete picture of character set conversion in \*(UA.
7984 .It Va charset-unknown-8bit
7985 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
7986 .Dq upgrade
7987 the content of a mail message by using a character set with the name
7988 .Ql unknown-8bit .
7989 Because of the unclassified nature of this character set \*(UA will not
7990 be capable to convert this character set to any other character set.
7991 If this variable is set any message part which uses the character set
7992 .Ql unknown-8bit
7993 is assumed to really be in the character set given in the value,
7994 otherwise the (final) value of
7995 .Va charset-8bit
7996 is used for this purpose.
7998 This variable will also be taken into account if a MIME type (see
7999 .Sx "The mime.types files" )
8000 of a MIME message part that uses the
8001 .Ql binary
8002 character set is forcefully treated as text.
8004 .It Va cmd
8005 The default value for the
8006 .Ic pipe
8007 command.
8009 .It Va colour-disable
8010 \*(BO\*(OP Forcefully disable usage of colours.
8011 Also see the section
8012 .Sx "Coloured display" .
8014 .It Va colour-pager
8015 \*(BO\*(OP Whether colour shall be used for output that is paged through
8016 .Ev PAGER .
8017 Note that pagers may need special command line options, e.g.,
8018 .Xr less 1
8019 requires the option
8020 .Fl \&\&R
8022 .Xr lv 1
8023 the option
8024 .Fl \&\&c
8025 in order to support colours.
8026 Often doing manual adjustments is unnecessary since \*(UA may perform
8027 adjustments dependent on the value of the environment variable
8028 .Ev PAGER
8029 (see there for more).
8032 .It Va contact-mail , contact-web
8033 \*(RO Addresses for contact per email and web, respectively, e.g., for
8034 bug reports, suggestions, or help regarding \*(UA.
8035 The former can be used directly:
8036 .Ql ? eval mail $contact-mail .
8038 .It Va crt
8039 In a(n interactive) terminal session, then if this valued variable is
8040 set it will be used as a threshold to determine how many lines the given
8041 output has to span before it will be displayed via the configured
8042 .Ev PAGER ;
8043 Usage of the
8044 .Ev PAGER
8045 can be forced by setting this to the value
8046 .Ql 0 ,
8047 setting it without a value will deduce the current height of the
8048 terminal screen to compute the treshold (see
8049 .Ev LINES ,
8050 .Va screen
8052 .Xr stty 1 ) .
8053 \*(ID At the moment this uses the count of lines of the message in wire
8054 format, which, dependent on the
8055 .Va mime-encoding
8056 of the message, is unrelated to the number of display lines.
8057 (The software is old and historically the relation was a given thing.)
8059 .It Va customhdr
8060 Define a set of custom headers to be injected into newly composed or
8061 forwarded messages; it is also possible to create custom headers in
8062 compose mode with
8063 .Ic ~^ ,
8064 which can be automated by setting one of the hooks
8065 .Va on-compose-splice
8067 .Va on-compose-splice-shell .
8068 The value is interpreted as a comma-separated list of custom headers to
8069 be injected, to include commas in the header bodies escape them with
8070 reverse solidus.
8071 \*(ID Overwriting of automatically managed headers is neither supported
8072 nor prevented.
8074 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
8076 .It Va datefield
8077 Controls the appearance of the
8078 .Ql %d
8079 date and time format specification of the
8080 .Va headline
8081 variable, that is used, for example, when viewing the summary of
8082 .Ic headers .
8083 If unset, then the local receiving date is used and displayed
8084 unformatted, otherwise the message sending
8085 .Ql Date: .
8086 It is possible to assign a
8087 .Xr strftime 3
8088 format string and control formatting, but embedding newlines via the
8089 .Ql %n
8090 format is not supported, and will result in display errors.
8091 The default is
8092 .Ql %Y-%m-%d %H:%M ,
8093 and also see
8094 .Va datefield-markout-older .
8096 .It Va datefield-markout-older
8097 Only used in conjunction with
8098 .Va datefield .
8099 Can be used to create a visible distinction of messages dated more than
8100 a day in the future, or older than six months, a concept comparable to the
8101 .Fl \&\&l
8102 option of the POSIX utility
8103 .Xr ls 1 .
8104 If set to the empty string, then the plain month, day and year of the
8105 .Ql Date:
8106 will be displayed, but a
8107 .Xr strftime 3
8108 format string to control formatting can be assigned.
8109 The default is
8110 .Ql %Y-%m-%d .
8112 .It Va debug
8113 \*(BO Enables debug messages and obsoletion warnings, disables the
8114 actual delivery of messages and also implies
8115 .Pf no Va record
8116 as well as
8117 .Pf no Va save .
8119 .It Va disposition-notification-send
8120 \*(BO\*(OP Emit a
8121 .Ql Disposition-Notification-To:
8122 header (RFC 3798) with the message.
8123 This requires the
8124 .Va from
8125 variable to be set.
8127 .It Va dot
8128 \*(BO When dot is set, a period
8129 .Ql \&.
8130 on a line by itself during message input in (interactive or batch
8131 .Fl # )
8132 compose mode will be treated as end-of-message (in addition to the
8133 normal end-of-file condition).
8134 This behaviour is implied in
8135 .Va posix
8136 mode with a set
8137 .Va ignoreeof .
8139 .It Va dotlock-ignore-error
8140 \*(BO\*(OP Synchronization of mailboxes which \*(UA treats as
8141 .Mx -sx
8142 .Sx "primary system mailbox" Ns
8143 es (see, e.g., the notes on
8144 .Sx "Filename transformations" ,
8145 as well as the documentation of
8146 .Ic file )
8147 will be protected with so-called dotlock files\(emthe traditional mail
8148 spool file locking method\(emin addition to system file locking.
8149 Because \*(UA ships with a privilege-separated dotlock creation program
8150 that should always be able to create such a dotlock file there is no
8151 good reason to ignore dotlock file creation errors, and thus these are
8152 fatal unless this variable is set.
8154 .It Va editalong
8155 \*(BO If this variable is set then the editor is started automatically
8156 when a message is composed in interactive mode, as if the
8157 .Ic ~e
8158 .Sx "COMMAND ESCAPES"
8159 had been specified.
8161 .Va editheaders
8162 variable is implied for this automatically spawned editor session.
8164 .It Va editheaders
8165 \*(BO When a message is edited while being composed,
8166 its header is included in the editable text.
8168 .It Va emptystart
8169 \*(BO When entering interactive mode \*(UA normally writes
8170 .Dq \&No mail for user
8171 and exits immediately if a mailbox is empty or does not exist.
8172 If this variable is set \*(UA starts even with an empty or non-existent
8173 mailbox (the latter behaviour furtherly depends upon
8174 .Va bsdcompat ,
8175 though).
8177 .It Va errexit
8178 \*(BO Let each command with a non-0 exit status, including every
8179 .Ic call Ns
8180 ed macro which
8181 .Ic return Ns
8182 s a non-0 status, cause a program exit unless prefixed by
8183 .Cm ignerr
8184 (see
8185 .Sx "Command modifiers" ) .
8186 This also affects
8187 .Sx "COMMAND ESCAPES" ,
8188 but which use a different modifier for ignoring the error.
8189 Please refer to the variable
8190 .Va \&?
8191 for more on this topic.
8193 .It Va escape
8194 The first character of this value defines the escape character for
8195 .Sx "COMMAND ESCAPES"
8196 in compose mode.
8197 The default value is the character tilde
8198 .Ql ~ .
8199 If set to the empty string, command escapes are disabled.
8201 .It Va expandaddr
8202 If not set then file and command pipeline targets are not allowed,
8203 and any such address will be filtered out, giving a warning message.
8204 If set without a value then all possible recipient address
8205 specifications will be accepted \(en see the section
8206 .Sx "On sending mail, and non-interactive mode"
8207 for more on this.
8208 To accept them, but only in interactive mode, or when tilde commands
8209 were enabled explicitly by using one of the command line options
8210 .Fl ~
8212 .Fl # ,
8213 set this to the (case-insensitive) value
8214 .Ql restrict
8215 (it actually acts like
8216 .Ql restrict,-all,+name,+addr ,
8217 so that care for ordering issues must be taken) .
8219 In fact the value is interpreted as a comma-separated list of values.
8220 If it contains
8221 .Ql fail
8222 then the existence of disallowed specifications is treated as a hard
8223 send error instead of only filtering them out.
8224 The remaining values specify whether a specific type of recipient
8225 address specification is allowed (optionally indicated by a plus sign
8226 .Ql +
8227 prefix) or disallowed (prefixed with a hyphen-minus
8228 .Ql - ) .
8229 The value
8230 .Ql all
8231 addresses all possible address specifications,
8232 .Ql file
8233 file targets,
8234 .Ql pipe
8235 command pipeline targets,
8236 .Ql name
8237 plain user names and (MTA) aliases and
8238 .Ql addr
8239 network addresses.
8240 These kind of values are interpreted in the given order, so that
8241 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
8242 will cause hard errors for any non-network address recipient address
8243 unless \*(UA is in interactive mode or has been started with the
8244 .Fl ~
8246 .Fl #
8247 command line option; in the latter case(s) any address may be used, then.
8249 Historically invalid network addressees are silently stripped off.
8250 To change this so that any encountered invalid email address causes
8251 a hard error it must be ensured that
8252 .Ql failinvaddr
8253 is an entry in the above list.
8254 Setting this automatically enables network addressees
8255 (it actually acts like
8256 .Ql failinvaddr,+addr ,
8257 so that care for ordering issues must be taken) .
8259 .It Va expandargv
8260 Unless this variable is set additional
8261 .Va mta
8262 (Mail-Transfer-Agent)
8263 arguments from the command line, as can be given after a
8264 .Fl \&\&-
8265 separator, are ignored due to safety reasons.
8266 However, if set to the special (case-insensitive) value
8267 .Ql fail ,
8268 then the presence of additional MTA arguments is treated as a hard
8269 error that causes \*(UA to exit with failure status.
8270 A lesser strict variant is the otherwise identical
8271 .Ql restrict ,
8272 which does accept such arguments in interactive mode, or if tilde
8273 commands were enabled explicitly by using one of the command line options
8274 .Fl ~
8276 .Fl # .
8278 .It Va features
8279 \*(RO String giving a list of features \*(UA, preceded with a plus sign
8280 .Ql +
8281 if the feature is available, and a hyphen-minus
8282 .Ql -
8283 otherwise.
8284 The output of the command
8285 .Ic version
8286 will include this information in a more pleasant output.
8288 .It Va flipr
8289 \*(BO This setting reverses the meanings of a set of reply commands,
8290 turning the lowercase variants, which by default address all recipients
8291 included in the header of a message
8292 .Pf ( Ic reply , respond , followup )
8293 into the uppercase variants, which by default address the sender only
8294 .Pf ( Ic Reply , Respond , Followup )
8295 and vice versa.
8296 The commands
8297 .Ic replysender , respondsender , followupsender
8298 as well as
8299 .Ic replyall , respondall , followupall
8300 are not affected by the current setting of
8301 .Va flipr .
8303 .It Va folder
8304 The default path under which mailboxes are to be saved:
8305 filenames that begin with the plus sign
8306 .Ql +
8307 will have the plus sign replaced with the value of this variable if set,
8308 otherwise the plus sign will remain unchanged when doing
8309 .Sx "Filename transformations" ;
8310 also see
8311 .Ic file
8312 for more on this topic.
8313 The value supports a subset of transformations itself, and if the
8314 non-empty value does not start with a solidus
8315 .Ql / ,
8316 then the value of
8317 .Ev HOME
8318 will be prefixed automatically.
8319 Once the actual value is evaluated first, the internal variable
8320 .Va folder-resolved
8321 will be updated for caching purposes.
8323 .It Va folder-hook
8324 This variable can be set to the name of a
8325 .Ic define Ns d
8326 macro which will be called whenever a
8327 .Ic file
8328 is opened.
8329 The macro will also be invoked when new mail arrives,
8330 but message lists for commands executed from the macro
8331 only include newly arrived messages then.
8332 .Ic localopts
8333 are activated by default in a folder hook, causing the covered settings
8334 to be reverted once the folder is left again.
8336 .It Va folder-hook-FOLDER
8337 Overrides
8338 .Va folder-hook
8339 for a folder named
8340 .Ql FOLDER .
8341 Unlike other folder specifications, the fully expanded name of a folder,
8342 without metacharacters, is used to avoid ambiguities.
8343 However, if the mailbox resides under
8344 .Va folder
8345 then the usual
8346 .Ql +
8347 specification is tried in addition, e.g., if
8348 .Va \&\&folder
8350 .Dq mail
8351 (and thus relative to the user's home directory) then
8352 .Pa /home/usr1/mail/sent
8353 will be tried as
8354 .Ql folder-hook-/home/usr1/mail/sent
8355 first, but then followed by
8356 .Ql folder-hook-+sent .
8358 .It Va folder-resolved
8359 \*(RO Set to the fully resolved path of
8360 .Va folder
8361 once that evaluation has occurred; rather internal.
8363 .It Va followup-to
8364 \*(BO Controls whether a
8365 .Ql Mail-Followup-To:
8366 header is generated when sending messages to known mailing lists.
8367 Also see
8368 .Va followup-to-honour
8369 and the commands
8370 .Ic mlist , mlsubscribe , reply
8372 .Ic Lreply .
8374 .It Va followup-to-honour
8375 Controls whether a
8376 .Ql Mail-Followup-To:
8377 header is honoured when group-replying to a message via
8378 .Ic reply
8380 .Ic Lreply .
8381 This is a quadoption; if set without a value it defaults to
8382 .Dq yes .
8383 Also see
8384 .Va followup-to
8385 and the commands
8386 .Ic mlist
8388 .Ic mlsubscribe .
8390 .It Va forward-as-attachment
8391 \*(BO Original messages are normally sent as inline text with the
8392 .Ic forward
8393 command,
8394 and only the first part of a multipart message is included.
8395 With this setting enabled messages are sent as unmodified MIME
8396 .Ql message/rfc822
8397 attachments with all of their parts included.
8399 .It Va forward-inject-head
8400 The string to put before the text of a message with the
8401 .Ic forward
8402 command instead of the default
8403 .Dq -------- Original Message -------- .
8404 No heading is put if it is set to the empty string.
8405 This variable is ignored if the
8406 .Va forward-as-attachment
8407 variable is set.
8409 .It Va from
8410 The address (or a list of addresses) to put into the
8411 .Ql From:
8412 field of the message header, quoting RFC 5322:
8413 the author(s) of the message, that is, the mailbox(es) of the person(s)
8414 or system(s) responsible for the writing of the message.
8415 When
8416 .Ic reply Ns
8417 ing to messages these addresses are handled as if they were in the
8418 .Ic alternates
8419 list.
8421 If the machine's hostname is not valid at the Internet (for example at
8422 a dialup machine) then either this variable or
8423 .Va hostname
8424 (\*(IN and with a defined SMTP protocol in
8425 .Va mta
8426 .Va smtp-hostname
8427 adds even more fine-tuning capabilities),
8428 have to be set.
8430 .Va \&\&from
8431 contains more than one address,
8432 setting the
8433 .Va sender
8434 variable is required (according to the standard RFC 5322).
8436 If a file-based MTA is used, then
8437 .Va from
8438 (or, if that contains multiple addresses,
8439 .Va sender )
8440 can nonetheless be enforced to appear as the envelope sender address at
8441 the MTA protocol level (the RFC 5321 reverse-path), either by using the
8442 .Fl r
8443 command line option (with an empty argument; see there for the complete
8444 picture on this topic), or by setting the internal variable
8445 .Va r-option-implicit .
8447 .It Va fullnames
8448 \*(BO When replying to or forwarding a message \*(UA normally removes
8449 the comment and name parts of email addresses.
8450 If this variable is set such stripping is not performed,
8451 and comments, names etc. are retained.
8452 .It Va fwdheading
8453 \*(OB Predecessor of
8454 .Va forward-inject-head .
8456 .It Va header
8457 \*(BO Causes the header summary to be written at startup and after
8458 commands that affect the number of messages or the order of messages in
8459 the current
8460 .Ic folder .
8461 Unless in
8462 .Ev POSIXLY_CORRECT
8463 mode a header summary will also be displayed on folder changes.
8464 The command line option
8465 .Fl N
8466 can be used to set
8467 .Pf no Va header .
8469 .It Va headline
8470 A format string to use for the summary of
8471 .Ic headers ,
8472 similar to the ones used for
8473 .Xr printf 3
8474 formats.
8475 Format specifiers in the given string start with a percent sign
8476 .Ql %
8477 and may be followed by an optional decimal number indicating the field
8478 width \(em if that is negative, the field is to be left-aligned.
8479 Valid format specifiers are:
8481 .Bl -tag -compact -width ".It Ql _%%_"
8482 .It Ql %%
8483 A plain percent sign.
8484 .It Ql %>
8485 .Dq Dotmark :
8486 a space character but for the current message
8487 .Pf ( Dq dot ) ,
8488 for which it expands to
8489 .Ql > .
8490 .It Ql %<
8491 .Dq Dotmark :
8492 a space character but for the current message
8493 .Pf ( Dq dot ) ,
8494 for which it expands to
8495 .Ql < .
8496 .It Ql %$
8497 \*(OP The spam score of the message, as has been classified via the
8498 command
8499 .Ic spamrate .
8500 Shows only a replacement character if there is no spam support.
8501 .It Ql %a
8502 Message attribute character (status flag); the actual content can be
8503 adjusted by setting
8504 .Va attrlist .
8505 .It Ql %d
8506 The date found in the
8507 .Ql From:
8508 header of the message when
8509 .Va datefield
8510 is set (the default), otherwise the date when the message was received.
8511 Formatting can be controlled by assigning a
8512 .Xr strftime 3
8513 format string to
8514 .Va datefield .
8515 .It Ql %e
8516 The indenting level in threaded mode.
8517 .It Ql %f
8518 The address of the message sender.
8519 .It Ql %i
8520 The message thread tree structure.
8521 (Note that this format does not support a field width.)
8522 .It Ql %l
8523 The number of lines of the message, if available.
8524 .It Ql %m
8525 Message number.
8526 .It Ql %o
8527 The number of octets (bytes) in the message, if available.
8528 .It Ql %s
8529 Message subject (if any).
8530 .It Ql %S
8531 Message subject (if any) in double quotes.
8532 .It Ql \&%T
8533 Message recipient flags: is the addressee of the message a known or
8534 subscribed mailing list \(en see
8535 .Ic mlist
8537 .Ic mlsubscribe .
8538 .It Ql %t
8539 The position in threaded/sorted order.
8542 The default is
8543 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
8545 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
8547 .Va bsdcompat
8548 is set.
8549 Also see
8550 .Va attrlist
8552 .Va headline-bidi .
8554 .It Va headline-bidi
8555 Bidirectional text requires special treatment when displaying headers,
8556 because numbers (in dates or for file sizes etc.) will not affect the
8557 current text direction, in effect resulting in ugly line layouts when
8558 arabic or other right-to-left text is to be displayed.
8559 On the other hand only a minority of terminals is capable to correctly
8560 handle direction changes, so that user interaction is necessary for
8561 acceptable results.
8562 Note that extended host system support is required nonetheless, e.g.,
8563 detection of the terminal character set is one precondition;
8564 and this feature only works in an Unicode (i.e., UTF-8) locale.
8566 In general setting this variable will cause \*(UA to encapsulate text
8567 fields that may occur when displaying
8568 .Va headline
8569 (and some other fields, like dynamic expansions in
8570 .Va prompt )
8571 with special Unicode control sequences;
8572 it is possible to fine-tune the terminal support level by assigning
8573 a value:
8574 no value (or any value other than
8575 .Ql 1 ,
8576 .Ql 2
8578 .Ql 3 )
8579 will make \*(UA assume that the terminal is capable to properly deal
8580 with Unicode version 6.3, in which case text is embedded in a pair of
8581 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
8582 characters.
8583 In addition no space on the line is reserved for these characters.
8585 Weaker support is chosen by using the value
8586 .Ql 1
8587 (Unicode 6.3, but reserve the room of two spaces for writing the control
8588 sequences onto the line).
8589 The values
8590 .Ql 2
8592 .Ql 3
8593 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
8594 again reserves room for two spaces in addition.
8596 .It Va history-file
8597 \*(OP If a line editor is available then this can be set to
8598 name the (expandable) path of the location of a permanent history file.
8599 Also see
8600 .Va history-size .
8602 .It Va history-gabby
8603 \*(BO\*(OP Add more entries to the history as is normally done.
8605 .It Va history-gabby-persist
8606 \*(BO\*(OP \*(UA's own MLE will not save the additional
8607 .Va history-gabby
8608 entries in persistent storage unless this variable is set.
8609 On the other hand it will not loose the knowledge of whether
8610 a persistent entry was gabby or not.
8611 Also see
8612 .Va history-file .
8614 .It Va history-size
8615 \*(OP Setting this variable imposes a limit on the number of concurrent
8616 history entries.
8617 If set to the value 0 then no further history entries will be added, and
8618 loading and incorporation of the
8619 .Va history-file
8620 upon program startup can also be suppressed by doing this.
8621 Runtime changes will not be reflected, but will affect the number of
8622 entries saved to permanent storage.
8624 .It Va hold
8625 \*(BO This setting controls whether messages are held in the system
8626 .Va inbox ,
8627 and it is set by default.
8629 .It Va hostname
8630 Use this string as hostname when expanding local addresses instead of
8631 the value obtained from
8632 .Xr uname 3
8634 .Xr getaddrinfo 3 .
8635 It is used, e.g., in
8636 .Ql Message-ID:
8638 .Ql From:
8639 fields, as well as when generating
8640 .Ql Content-ID:
8641 MIME part related unique ID fields.
8642 Setting it to the empty string will cause the normal hostname to be
8643 used, but nonetheless enables creation of said ID fields.
8644 \*(IN in conjunction with the built-in SMTP
8645 .Va mta
8646 .Va smtp-hostname
8647 also influences the results:
8648 one should produce some test messages with the desired combination of
8649 .Va \&\&hostname ,
8650 and/or
8651 .Va from ,
8652 .Va sender
8653 etc. first.
8655 .It Va idna-disable
8656 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
8657 names according to the rules of IDNA (internationalized domain names
8658 for applications).
8659 Since the IDNA code assumes that domain names are specified with the
8660 .Va ttycharset
8661 character set, an UTF-8 locale charset is required to represent all
8662 possible international domain names (before conversion, that is).
8664 .It Va ifs
8665 The input field separator that is used (\*(ID by some functions) to
8666 determine where to split input data.
8668 .Bl -tag -compact -width ".It MMM"
8669 .It 1.
8670 Unsetting is treated as assigning the default value,
8671 .Ql \& \et\en .
8672 .It 2.
8673 If set to the empty value, no field splitting will be performed.
8674 .It 3.
8675 If set to a non-empty value, all whitespace characters are extracted
8676 and assigned to the variable
8677 .Va ifs-ws .
8680 .Bl -tag -compact -width ".It MMM"
8681 .It a.
8682 .Va \&\&ifs-ws
8683 will be ignored at the beginning and end of input.
8684 Diverging from POSIX shells default whitespace is removed in addition,
8685 which is owed to the entirely different line content extraction rules.
8686 .It b.
8687 Each occurrence of a character of
8688 .Va \&\&ifs
8689 will cause field-splitting, any adjacent
8690 .Va \&\&ifs-ws
8691 characters will be skipped.
8694 .It Va ifs-ws
8695 \*(RO Automatically deduced from the whitespace characters in
8696 .Va ifs .
8698 .It Va ignore
8699 \*(BO Ignore interrupt signals from the terminal while entering
8700 messages; instead echo them as
8701 .Ql @
8702 characters and discard the current line.
8704 .It Va ignoreeof
8705 \*(BO Ignore end-of-file conditions
8706 .Pf ( Ql control-D )
8707 in compose mode on message input and in interactive command input.
8708 If set an interactive command input session can only be left by
8709 explicitly using one of the commands
8710 .Ic exit
8712 .Ic quit ,
8713 and message input in compose mode can only be terminated by entering
8714 a period
8715 .Ql \&.
8716 on a line by itself or by using the
8717 .Ic ~.
8718 .Sx "COMMAND ESCAPES" ;
8719 Setting this implies the behaviour that
8720 .Va dot
8721 describes in
8722 .Va posix
8723 mode.
8725 .It Va inbox
8726 If this is set to a non-empty string it will specify the users
8727 .Mx -sx
8728 .Sx "primary system mailbox" ,
8729 overriding
8730 .Ev MAIL
8731 and the system-dependent default, and (thus) be used to replace
8732 .Ql %
8733 when doing
8734 .Sx "Filename transformations" ;
8735 also see
8736 .Ic file
8737 for more on this topic.
8738 The value supports a subset of transformations itself.
8740 .It Va indentprefix
8741 String used by the
8742 .Ic ~m , ~M
8744 .Ic ~R
8745 .Sx "COMMAND ESCAPES"
8746 and by the
8747 .Va quote
8748 option for indenting messages,
8749 in place of the normal tabulator character
8750 .Ql ^I ,
8751 which is the default.
8752 Be sure to quote the value if it contains spaces or tabs.
8754 .It Va keep
8755 \*(BO If set, an empty
8756 .Mx -sx
8757 .Sx "primary system mailbox"
8758 file is not removed.
8759 Note that, in conjunction with
8760 .Ev POSIXLY_CORRECT
8761 any empty file will be removed unless this variable is set.
8762 This may improve the interoperability with other mail user agents
8763 when using a common folder directory, and prevents malicious users
8764 from creating fake mailboxes in a world-writable spool directory.
8765 \*(ID Only local regular (MBOX) files are covered, Maildir or other
8766 mailbox types will never be removed, even if empty.
8768 .It Va keep-content-length
8769 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
8770 be told to keep the
8771 .Ql Content-Length:
8773 .Ql Lines:
8774 header fields that some MUAs generate by setting this variable.
8775 Since \*(UA does neither use nor update these non-standardized header
8776 fields (which in itself shows one of their conceptual problems),
8777 stripping them should increase interoperability in between MUAs that
8778 work with with same mailbox files.
8779 Note that, if this is not set but
8780 .Va writebackedited ,
8781 as below, is, a possibly performed automatic stripping of these header
8782 fields already marks the message as being modified.
8783 \*(ID At some future time \*(UA will be capable to rewrite and apply an
8784 .Va mime-encoding
8785 to modified messages, and then those fields will be stripped silently.
8787 .It Va keepsave
8788 \*(BO When a message is saved it is usually discarded from the
8789 originating folder when \*(UA is quit.
8790 This setting causes all saved message to be retained.
8792 .It Va line-editor-disable
8793 \*(BO Turn off any enhanced line editing capabilities (see
8794 .Sx "On terminal control and line editor"
8795 for more).
8797 .It Va line-editor-no-defaults
8798 \*(BO\*(OP Do not establish any default key binding.
8800 .It Va log-prefix
8801 Error log message prefix string
8802 .Pf ( Ql "\*(uA: " ) .
8804 .It Va mailbox-display
8805 \*(RO The name of the current mailbox
8806 .Pf ( Ic file ) ,
8807 possibly abbreviated for display purposes.
8809 .It Va mailbox-resolved
8810 \*(RO The fully resolved path of the current mailbox.
8812 .It Va mailx-extra-rc
8813 An additional startup file that is loaded as the last of the
8814 .Sx "Resource files" .
8815 Use this file for commands that are not understood by other POSIX
8816 .Xr mailx 1
8817 implementations, i.e., mostly anything which is not covered by
8818 .Sx "Initial settings" .
8820 .It Va markanswered
8821 \*(BO When a message is replied to and this variable is set,
8822 it is marked as having been
8823 .Ic answered .
8824 See the section
8825 .Sx "Message states" .
8827 .It Va mbox-rfc4155
8828 \*(BO When opening MBOX mailbox databases \*(UA by default uses tolerant
8829 POSIX rules for detecting message boundaries (so-called
8830 .Ql From_
8831 lines) due to compatibility reasons, instead of the stricter rules that
8832 have been standardized in RFC 4155.
8833 This behaviour can be switched to the stricter RFC 4155 rules by
8834 setting this variable.
8835 (This is never necessary for any message newly generated by \*(UA,
8836 it only applies to messages generated by buggy or malicious MUAs, or may
8837 occur in old MBOX databases: \*(UA itself will choose a proper
8838 .Va mime-encoding
8839 to avoid false interpretation of
8840 .Ql From_
8841 content lines in the MBOX database.)
8843 This may temporarily be handy when \*(UA complains about invalid
8844 .Ql From_
8845 lines when opening a MBOX: in this case setting this variable and
8846 re-opening the mailbox in question may correct the result.
8847 If so, copying the entire mailbox to some other file, as in
8848 .Ql copy * SOME-FILE ,
8849 will perform proper, all-compatible
8850 .Ql From_
8851 quoting for all detected messages, resulting in a valid MBOX mailbox.
8852 Finally the variable can be unset again:
8853 .Bd -literal -offset indent
8854 define mboxfix {
8855   localopts yes; wysh set mbox-rfc4155;\e
8856     wysh File "${1}"; eval copy * "${2}"
8858 call mboxfix /tmp/bad.mbox /tmp/good.mbox
8861 .It Va memdebug
8862 \*(BO Internal development variable.
8864 .It Va message-id-disable
8865 \*(BO By setting this variable the generation of
8866 .Ql Message-ID:
8867 can be completely suppressed, effectively leaving this task up to the
8868 .Va mta
8869 (Mail-Transfer-Agent) or the SMTP server.
8870 (According to RFC 5321 a SMTP server is not required to add this
8871 field by itself, so it should be ensured that it accepts messages without
8872 .Ql Message-ID . )
8873 This variable also affects automatic generation of
8874 .Va Content-ID:
8875 MIME header fields.
8877 .It Va message-inject-head
8878 A string to put at the beginning of each new message.
8879 The escape sequences tabulator
8880 .Ql \et
8881 and newline
8882 .Ql \en
8883 are understood.
8885 .It Va message-inject-tail
8886 A string to put at the end of each new message.
8887 The escape sequences tabulator
8888 .Ql \et
8889 and newline
8890 .Ql \en
8891 are understood.
8893 .It Va metoo
8894 \*(BO Usually, when an
8895 .Ic alias
8896 expansion contains the sender, the sender is removed from the expansion.
8897 Setting this option suppresses these removals.
8898 Note that a set
8899 .Va metoo
8900 also causes a
8901 .Ql -m
8902 option to be passed through to the
8903 .Va mta
8904 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
8905 this flag, no MTA is known which does not support it (for historical
8906 compatibility).
8908 .It Va mime-allow-text-controls
8909 \*(BO When sending messages, each part of the message is MIME-inspected
8910 in order to classify the
8911 .Ql Content-Type:
8913 .Ql Content-Transfer-Encoding:
8914 (see
8915 .Va mime-encoding )
8916 that is required to send this part over mail transport, i.e.,
8917 a computation rather similar to what the
8918 .Xr file 1
8919 command produces when used with the
8920 .Ql --mime
8921 option.
8923 This classification however treats text files which are encoded in
8924 UTF-16 (seen for HTML files) and similar character sets as binary
8925 octet-streams, forcefully changing any
8926 .Ql text/plain
8928 .Ql text/html
8929 specification to
8930 .Ql application/octet-stream :
8931 If that actually happens a yet unset charset MIME parameter is set to
8932 .Ql binary ,
8933 effectively making it impossible for the receiving MUA to automatically
8934 interpret the contents of the part.
8936 If this variable is set, and the data was unambiguously identified as
8937 text data at first glance (by a
8938 .Ql .txt
8940 .Ql .html
8941 file extension), then the original
8942 .Ql Content-Type:
8943 will not be overwritten.
8945 .It Va mime-alternative-favour-rich
8946 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
8947 HTML) will be preferred in favour of included plain text versions when
8948 displaying messages, provided that a handler exists which produces
8949 output that can be (re)integrated into \*(UA's normal visual display.
8950 (E.g., at the time of this writing some newsletters ship their full
8951 content only in the rich HTML part, whereas the plain text part only
8952 contains topic subjects.)
8954 .It Va mime-counter-evidence
8955 Normally the
8956 .Ql Content-Type:
8957 field is used to decide how to handle MIME parts.
8958 Some MUAs, however, do not use
8959 .Sx "The mime.types files"
8960 (also see
8961 .Sx "HTML mail and MIME attachments" )
8962 or a similar mechanism to correctly classify content, but specify an
8963 unspecific MIME type
8964 .Pf ( Ql application/octet-stream )
8965 even for plain text attachments.
8966 If this variable is set then \*(UA will try to re-classify such MIME
8967 message parts, if possible, for example via a possibly existing
8968 attachment filename.
8969 A non-empty value may also be given, in which case a number is expected,
8970 actually a carrier of bits.
8971 Creating the bit-carrying number is a simple addition:
8972 .Bd -literal -offset indent
8973 ? !echo Value should be set to $((2 + 4 + 8))
8974 Value should be set to 14
8977 .Bl -bullet -compact
8979 If bit two is set (2) then the detected
8980 .Ic mimetype
8981 will be carried along with the message and be used for deciding which
8982 MIME handler is to be used, for example;
8983 when displaying such a MIME part the part-info will indicate the
8984 overridden content-type by showing a plus sign
8985 .Ql + .
8987 If bit three is set (4) then the counter-evidence is always produced
8988 and a positive result will be used as the MIME type, even forcefully
8989 overriding the parts given MIME type.
8991 If bit four is set (8) then as a last resort the actual content of
8992 .Ql application/octet-stream
8993 parts will be inspected, so that data which looks like plain text can be
8994 treated as such.
8997 .It Va mime-encoding
8998 The MIME
8999 .Ql Content-Transfer-Encoding
9000 to use in outgoing text messages and message parts, where applicable.
9001 (7-bit clean text messages are sent as-is, without a transfer encoding.)
9002 Valid values are:
9004 .Bl -tag -compact -width ".It Ql _%%_"
9005 .It Ql 8bit
9006 .Pf (Or\0 Ql 8b . )
9007 8-bit transport effectively causes the raw data be passed through
9008 unchanged, but may cause problems when transferring mail messages over
9009 channels that are not ESMTP (RFC 1869) compliant.
9010 Also, several input data constructs are not allowed by the
9011 specifications and may cause a different transfer-encoding to be used.
9012 .It Ql quoted-printable
9013 .Pf (Or\0 Ql qp . )
9014 Quoted-printable encoding is 7-bit clean and has the property that ASCII
9015 characters are passed through unchanged, so that an english message can
9016 be read as-is; it is also acceptible for other single-byte locales that
9017 share many characters with ASCII, like, e.g., ISO-8859-1.
9018 The encoding will cause a large overhead for messages in other character
9019 sets: e.g., it will require up to twelve (12) bytes to encode a single
9020 UTF-8 character of four (4) bytes.
9021 .It Ql base64
9022 .Pf (Or\0 Ql b64 . )
9023 The default encoding, it is 7-bit clean and will always be used for
9024 binary data.
9025 This encoding has a constant input:output ratio of 3:4, regardless of
9026 the character set of the input data it will encode three bytes of input
9027 to four bytes of output.
9028 This transfer-encoding is not human readable without performing
9029 a decoding step.
9032 .It Va mimetypes-load-control
9033 Can be used to control which of
9034 .Sx "The mime.types files"
9035 are loaded: if the letter
9036 .Ql u
9037 is part of the option value, then the user's personal
9038 .Pa ~/.mime.types
9039 file will be loaded (if it exists); likewise the letter
9040 .Ql s
9041 controls loading of the system wide
9042 .Pa /etc/mime.types ;
9043 directives found in the user file take precedence, letter matching is
9044 case-insensitive.
9045 If this variable is not set \*(UA will try to load both files.
9046 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
9047 but they will be matched last (the order can be listed via
9048 .Ic mimetype ) .
9050 More sources can be specified by using a different syntax: if the
9051 value string contains an equals sign
9052 .Ql =
9053 then it is instead parsed as a comma-separated list of the described
9054 letters plus
9055 .Ql f=FILENAME
9056 pairs; the given filenames will be expanded and loaded, and their
9057 content may use the extended syntax that is described in the section
9058 .Sx "The mime.types files" .
9059 Directives found in such files always take precedence (are prepended to
9060 the MIME type cache).
9062 .It Va mta
9063 To choose an alternate Mail-Transfer-Agent, set this option to either
9064 the full pathname of an executable (optionally prefixed with a
9065 .Ql file://
9066 protocol indicator), or \*(OPally a SMTP protocol URL, e.g., \*(IN
9068 .Dl smtps?://[user[:password]@]server[:port]
9070 (\*(OU:
9071 .Ql [smtp://]server[:port] . )
9072 The default has been chosen at compile time.
9073 All supported data transfers are executed in child processes, which
9074 run asynchronously and without supervision unless either the
9075 .Va sendwait
9076 or the
9077 .Va verbose
9078 variable is set.
9079 If such a child receives a TERM signal, it will abort and
9080 .Va save
9081 the message to
9082 .Ev DEAD ,
9083 if so configured.
9085 For a file-based MTA it may be necessary to set
9086 .Va mta-argv0
9087 in in order to choose the right target of a modern
9088 .Xr mailwrapper 8
9089 environment.
9090 It will be passed command line arguments from several possible sources:
9091 from the variable
9092 .Va mta-arguments
9093 if set, from the command line if given and the variable
9094 .Va expandargv
9095 allows their use.
9096 Argument processing of the MTA will be terminated with a
9097 .Fl \&\&-
9098 separator.
9100 The otherwise occurring implicit usage of the following MTA command
9101 line arguments can be disabled by setting the boolean variable
9102 .Va mta-no-default-arguments
9103 (which will also disable passing
9104 .Fl \&\&-
9105 to the MTA):
9106 .Fl \&\&i
9107 (for not treating a line with only a dot
9108 .Ql \&.
9109 character as the end of input),
9110 .Fl \&\&m
9111 (shall the variable
9112 .Va metoo
9113 be set) and
9114 .Fl \&\&v
9115 (if the
9116 .Va verbose
9117 variable is set); in conjunction with the
9118 .Fl r
9119 command line option \*(UA will also (not) pass
9120 .Fl \&\&f
9121 as well as possibly
9122 .Fl \&\&F .
9124 \*(OPally \*(UA can send mail over SMTP network connections to a single
9125 defined SMTP smart host by specifying a SMTP URL as the value (see
9126 .Sx "On URL syntax and credential lookup" ) .
9127 Note that with some mail providers it may be necessary to set the
9128 .Va smtp-hostname
9129 variable in order to use a specific combination of
9130 .Va from ,
9131 .Va hostname
9133 .Va mta .
9134 \*(UA also supports forwarding of all network traffic over a specified
9135 .Va socks-proxy .
9136 The following SMTP variants may be used:
9137 .Bl -bullet
9139 The plain SMTP protocol (RFC 5321) that normally lives on the
9140 server port 25 and requires setting the
9141 .Va smtp-use-starttls
9142 variable to enter a SSL/TLS encrypted session state.
9143 Assign a value like \*(IN
9144 .Ql smtp://[user[:password]@]server[:port]
9145 (\*(OU
9146 .Ql smtp://server[:port] )
9147 to choose this protocol.
9149 The so-called SMTPS which is supposed to live on server port 465
9150 and is automatically SSL/TLS secured.
9151 Unfortunately it never became a standardized protocol and may thus not
9152 be supported by your hosts network service database
9153 \(en in fact the port number has already been reassigned to other
9154 protocols!
9156 SMTPS is nonetheless a commonly offered protocol and thus can be
9157 chosen by assigning a value like \*(IN
9158 .Ql smtps://[user[:password]@]server[:port]
9159 (\*(OU
9160 .Ql smtps://server[:port] ) ;
9161 due to the mentioned problems it is usually necessary to explicitly
9162 specify the port as
9163 .Ql :465 ,
9164 however.
9166 Finally there is the SUBMISSION protocol (RFC 6409), which usually
9167 lives on server port 587 and is practically identically to the SMTP
9168 protocol from \*(UA's point of view beside that; it requires setting the
9169 .Va smtp-use-starttls
9170 variable to enter a SSL/TLS secured session state.
9171 Assign a value like \*(IN
9172 .Ql submission://[user[:password]@]server[:port]
9173 (\*(OU
9174 .Ql submission://server[:port] ) .
9177 .It Va mta-arguments
9178 Arguments to pass through to a file-based
9179 .Va mta
9180 can be given via this variable, which is parsed according to
9181 .Sx "Shell-style argument quoting"
9182 into an array of arguments, and which will be joined onto MTA options
9183 from other sources, and then passed individually to the MTA:
9184 .Ql ? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
9186 .It Va mta-no-default-arguments
9187 \*(BO Unless this variable is set \*(UA will pass some well known
9188 standard command line options to a file-based
9189 .Va mta
9190 (Mail-Transfer-Agent), see there for more.
9192 .It Va mta-argv0
9193 Many systems use a so-called
9194 .Xr mailwrapper 8
9195 environment to ensure compatibility with
9196 .Xr sendmail 1 .
9197 This works by inspecting the name that was used to invoke the mail
9198 delivery system.
9199 If this variable is set then the mailwrapper (the program that is
9200 actually executed when calling the file-based
9201 .Va mta )
9202 will treat its contents as that name.
9203 .Mx Va netrc-lookup
9204 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
9205 \*(BO\*(IN\*(OP Used to control usage of the users
9206 .Pa .netrc
9207 file for lookup of account credentials, as documented in the section
9208 .Sx "On URL syntax and credential lookup"
9209 and for the command
9210 .Ic netrc ;
9211 the section
9212 .Sx "The .netrc file"
9213 documents the file format.
9214 Also see
9215 .Va netrc-pipe .
9217 .It Va netrc-pipe
9218 \*(IN\*(OP When
9219 .Pa .netrc
9220 is loaded (see
9221 .Ic netrc
9223 .Va netrc-lookup )
9224 then \*(UA will read the output of a shell pipe instead of the users
9225 .Pa .netrc
9226 file if this variable is set (to the desired shell command).
9227 This can be used to, e.g., store
9228 .Pa .netrc
9229 in encrypted form:
9230 .Ql ? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
9232 .It Va newfolders
9233 If this variable has the value
9234 .Ql maildir ,
9235 newly created local folders will be in Maildir instead of MBOX format.
9237 .It Va newmail
9238 Checks for new mail in the current folder each time the prompt is shown.
9239 A Maildir folder must be re-scanned to determine if new mail has arrived.
9240 If this variable is set to the special value
9241 .Ql nopoll
9242 then a Maildir folder will not be rescanned completely, but only
9243 timestamp changes are detected.
9245 .It Va outfolder
9246 \*(BO Causes the filename given in the
9247 .Va record
9248 variable
9249 and the sender-based filenames for the
9250 .Ic Copy
9252 .Ic Save
9253 commands to be interpreted relative to the directory given in the
9254 .Va folder
9255 variable rather than to the current directory,
9256 unless it is set to an absolute pathname.
9258 .It Va on-compose-cleanup
9259 Macro hook which will be called after the message has been sent (or not,
9260 in case of failures), as the very last step before unrolling compose mode
9261 .Ic localopts .
9262 This hook is run even in case of fatal errors, and it is advisable to
9263 perform only absolutely necessary actions, like cleaning up
9264 .Ic alternates ,
9265 for example.
9266 For compose mode hooks that may affect the message content please see
9267 .Va on-compose-enter , on-compose-leave , on-compose-splice .
9268 \*(ID This hook exists only because
9269 .Ic alias , alternates , commandalias , shortcut ,
9270 to name a few, are currently not covered by
9271 .Ic localopts
9272 or a similar mechanism: any changes applied in compose mode will
9273 continue to be in effect thereafter.
9276 .It Va on-compose-enter , on-compose-leave
9277 Macro hooks which will be called before compose mode is entered,
9278 and after composing has been finished (but before the
9279 .Va signature
9280 is injected, etc.), respectively.
9281 .Ic localopts
9282 are enabled for these hooks, causing any setting to be forgotten after
9283 the message has been sent;
9284 .Va on-compose-cleanup
9285 can be used to perform any other necessary cleanup.
9286 The following (read-only) variables will be set temporarily during
9287 execution of the macros to represent the according message headers, or
9288 the empty string for non-existent; they correspond to accoding virtual
9289 temporary message headers that can be accessed via
9290 .Ic ~^ ,
9291 one of the
9292 .Sx "COMMAND ESCAPES" :
9294 .Bl -tag -compact -width ".It Va mailx_subject"
9295 .It Va mailx-command
9296 The command that generates the message.
9297 .It Va mailx-subject
9298 The subject.
9299 .It Va mailx-from
9300 .Va from .
9301 .It Va mailx-sender
9302 .Va sender .
9303 .It Va mailx-to , mailx-cc , mailx-bcc
9304 The list of receiver addresses as a space-separated list.
9305 .It Va mailx-raw-to , mailx-raw-cc , mailx-raw-bcc
9306 The list of receiver addresses before any mangling (due to, e.g.,
9307 .Ic alternates ,
9308 .Ic alias
9309 .Va recipients-in-cc )
9310 as a space-separated list.
9311 .It Va mailx-orig-from
9312 When replying, forwarding or resending, this will be set to the
9313 .Ql From:
9314 of the given message.
9315 .It Va mailx-orig-to , mailx-orig-cc , mailx-orig-bcc
9316 When replying, forwarding or resending, this will be set to the
9317 receivers of the given message.
9321 .It Va on-compose-splice , on-compose-splice-shell
9322 These hooks run once the normal compose mode is finished, but before the
9323 .Va on-compose-leave
9324 macro hook is called, the
9325 .Va signature
9326 is injected etc.
9327 Both hooks will be executed in a subprocess, with their input and output
9328 connected to \*(UA such that they can act as if they would be an
9329 interactive user.
9330 The difference in between them is that the latter is a
9331 .Ev SHELL
9332 command, whereas the former is a normal \*(UA macro, but which is
9333 restricted to a small set of commands (the
9334 .Va verbose
9335 output of, e.g.,
9336 .Ic list
9337 will indicate said capability).
9338 .Ic localopts
9339 are enabled for these hooks (in the parent process), causing any setting
9340 to be forgotten after the message has been sent;
9341 .Va on-compose-cleanup
9342 can be used to perform other cleanup as necessary.
9344 During execution of these hooks \*(UA will temporarily forget whether it
9345 has been started in interactive mode, (a restricted set of)
9346 .Sx "COMMAND ESCAPES"
9347 will always be available, and for guaranteed reproducibilities sake
9348 .Va escape
9350 .Va ifs
9351 will be set to their defaults.
9352 The compose mode command
9353 .Ic ~^
9354 has been especially designed for scriptability (via these hooks).
9355 The first line the hook will read on its standard input is the protocol
9356 version of said command escape, currently
9357 .Dq 0 0 1 :
9358 backward incompatible protocol changes have to be expected.
9360 Care must be taken to avoid deadlocks and other false control flow:
9361 if both involved processes wait for more input to happen at the
9362 same time, or one does not expect more input but the other is stuck
9363 waiting for consumption of its output, etc.
9364 There is no automatic synchronization of the hook: it will not be
9365 stopped automatically just because it, e.g., emits
9366 .Ql ~x .
9367 The hooks will however receive a termination signal if the parent enters
9368 an error condition.
9369 \*(ID Protection against and interaction with signals is not yet given;
9370 it is likely that in the future these scripts will be placed in an
9371 isolated session, which is signalled in its entirety as necessary.
9372 .Bd -literal -offset indent
9373 wysh set on-compose-splice-shell=$'\e
9374   read version;\e
9375   printf "hello $version!  Headers: ";\e
9376   echo \e'~^header list\e';\e
9377   read status result;\e
9378   echo "status=$status result=$result";\e
9379   '
9381 set on-compose-splice=ocsm
9382 define ocsm {
9383   read ver
9384   echo Splice protocol version is $ver
9385   echo '~^h l'; read hl; vput vexpr es substring "${hl}" 0 1
9386   if [ "$es" != 2 ]
9387     echoerr 'Cannot read header list'; echo '~x'; xit
9388   endif
9389   if [ "$hl" @i!% ' cc' ]
9390     echo '~^h i cc Diet is your <mirr.or>'; read es;\e
9391       vput vexpr es substring "${es}" 0 1
9392     if [ "$es" != 2 ]
9393       echoerr 'Cannot insert Cc: header'; echo '~x'
9394     endif
9395   endif
9399 .It Va on-resend-cleanup
9400 \*(ID Identical to
9401 .Va on-compose-cleanup ,
9402 but is only triggered by
9403 .Ic resend .
9405 .It Va on-resend-enter
9406 \*(ID Identical to
9407 .Va on-compose-enter ,
9408 but is only triggered by
9409 .Ic resend .
9411 .It Va page
9412 \*(BO If set, each message feed through the command given for
9413 .Ic pipe
9414 is followed by a formfeed character
9415 .Ql \ef .
9416 .Mx Va password
9417 .It Va password-USER@HOST , password-HOST , password
9418 \*(IN Variable chain that sets a password, which is used in case none has
9419 been given in the protocol and account-specific URL;
9420 as a last resort \*(UA will ask for a password on the user's terminal if
9421 the authentication method requires a password.
9422 Specifying passwords in a startup file is generally a security risk;
9423 the file should be readable by the invoking user only.
9424 .It Va password-USER@HOST
9425 \*(OU (see the chain above for \*(IN)
9426 Set the password for
9427 .Ql USER
9428 when connecting to
9429 .Ql HOST .
9430 If no such variable is defined for a host,
9431 the user will be asked for a password on standard input.
9432 Specifying passwords in a startup file is generally a security risk;
9433 the file should be readable by the invoking user only.
9435 .It Va piperaw
9436 \*(BO Send messages to the
9437 .Ic pipe
9438 command without performing MIME and character set conversions.
9440 .It Va pipe-TYPE/SUBTYPE
9441 When a MIME message part of type
9442 .Ql TYPE/SUBTYPE
9443 (case-insensitive) is displayed or quoted,
9444 its text is filtered through the value of this variable interpreted as
9445 a shell command.
9446 Note that only parts which can be displayed inline as plain text (see
9447 .Cd copiousoutput )
9448 are displayed unless otherwise noted, other MIME parts will only be
9449 considered by and for the command
9450 .Ic mimeview .
9452 The special value commercial at
9453 .Ql @
9454 forces interpretation of the message part as plain text, e.g.,
9455 .Ql set pipe-application/xml=@
9456 will henceforth display XML
9457 .Dq as is .
9458 (The same could also be achieved by adding a MIME type marker with the
9459 .Ic mimetype
9460 command.
9461 And \*(OPally MIME type handlers may be defined via
9462 .Sx "The Mailcap files"
9463 \(em these directives,
9464 .Cd copiousoutput
9465 has already been used, should be referred to for further documentation.
9467 The commercial at
9468 .Ql @
9469 can in fact be used as a trigger character to adjust usage and behaviour
9470 of a following shell command specification more thoroughly by appending
9471 more special characters which refer to further mailcap directives, e.g.,
9472 the following hypothetical command specification could be used:
9473 .Bd -literal -offset indent
9474 ? set pipe-X/Y='@!++=@vim ${MAILX_FILENAME_TEMPORARY}'
9477 .Bl -tag -compact -width ".It Ql __"
9478 .It Ql *
9479 The command produces plain text to be integrated in \*(UAs output:
9480 .Cd copiousoutput .
9481 .It Ql #
9482 If set the handler will not be invoked when a message is to be quoted,
9483 but only when it will be displayed:
9484 .Cd x-mailx-noquote .
9485 .It Ql &
9486 Run the command asynchronously, i.e., without blocking \*(UA:
9487 .Cd x-mailx-async .
9488 .It Ql \&!
9489 The command must be run on an interactive terminal, \*(UA will
9490 temporarily release the terminal to it:
9491 .Cd needsterminal .
9492 .It Ql +
9493 Request creation of a zero-sized temporary file, the absolute pathname
9494 of which will be made accessible via the environment variable
9495 .Ev MAILX_FILENAME_TEMPORARY :
9496 .Cd x-mailx-tmpfile .
9497 If given twice then the file will be unlinked automatically by \*(UA
9498 when the command loop is entered again at latest:
9499 .Cd x-mailx-tmpfile-unlink .
9500 .It Ql =
9501 Normally the MIME part content is passed to the handler via standard
9502 input; if this flag is set then the data will instead be written into
9503 .Ev MAILX_FILENAME_TEMPORARY
9504 .Pf ( Cd x-mailx-tmpfile-fill ) ,
9505 the creation of which is implied; note however that in order to cause
9506 deletion of the temporary file you still have to use two plus signs
9507 .Ql ++
9508 explicitly!
9509 .It Ql @
9510 To avoid ambiguities with normal shell command content you can use
9511 another commercial at to forcefully terminate interpretation of
9512 remaining characters.
9513 (Any character not in this list will have the same effect.)
9516 Some information about the MIME part to be displayed is embedded into
9517 the environment of the shell command:
9519 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
9521 .It Ev MAILX_CONTENT
9522 The MIME content-type of the part, if known, the empty string otherwise.
9524 .It Ev MAILX_CONTENT_EVIDENCE
9526 .Va mime-counter-evidence
9527 includes the carry-around-bit (2), then this will be set to the detected
9528 MIME content-type; not only then identical to
9529 .Ev \&\&MAILX_CONTENT
9530 otherwise.
9532 .It Ev MAILX_FILENAME
9533 The filename, if any is set, the empty string otherwise.
9535 .It Ev MAILX_FILENAME_GENERATED
9536 A random string.
9538 .It Ev MAILX_FILENAME_TEMPORARY
9539 If temporary file creation has been requested through the command prefix
9540 this variable will be set and contain the absolute pathname of the
9541 temporary file.
9544 .It Va pipe-EXTENSION
9545 This is identical to
9546 .Va pipe-TYPE/SUBTYPE
9547 except that
9548 .Ql EXTENSION
9549 (normalized to lowercase using character mappings of the ASCII charset)
9550 names a file extension, e.g.,
9551 .Ql xhtml .
9552 Handlers registered using this method take precedence.
9553 .Mx Va pop3-auth
9554 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
9555 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
9556 The only possible value as of now is
9557 .Ql plain ,
9558 which is thus the default.
9560 .Mx Va pop3-bulk-load
9561 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
9562 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
9563 the messages, and only requests the message bodies on user request.
9564 For the POP3 protocol this means that the message headers will be
9565 downloaded twice.
9566 If this variable is set then \*(UA will download only complete messages
9567 from the given POP3 server(s) instead.
9568 .Mx Va pop3-keepalive
9569 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
9570 \*(OP POP3 servers close the connection after a period of inactivity;
9571 the standard requires this to be at least 10 minutes,
9572 but practical experience may vary.
9573 Setting this variable to a numeric value greater than
9574 .Ql 0
9575 causes a
9576 .Ql NOOP
9577 command to be sent each value seconds if no other operation is performed.
9578 .Mx Va pop3-no-apop
9579 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
9580 \*(BO\*(OP Unless this variable is set the
9581 .Ql APOP
9582 authentication method will be used when connecting to a POP3 server that
9583 advertises support.
9584 The advantage of
9585 .Ql APOP
9586 is that the password is not sent in clear text over the wire and that
9587 only a single packet is sent for the user/password tuple.
9588 Note that
9589 .Va pop3-no-apop-HOST
9590 requires \*(IN.
9591 .Mx Va pop3-use-starttls
9592 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
9593 \*(BO\*(OP Causes \*(UA to issue a
9594 .Ql STLS
9595 command to make an unencrypted POP3 session SSL/TLS encrypted.
9596 This functionality is not supported by all servers,
9597 and is not used if the session is already encrypted by the POP3S method.
9598 Note that
9599 .Va pop3-use-starttls-HOST
9600 requires \*(IN.
9602 .It Va posix
9603 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
9604 where that deviates from standardized behaviour.
9605 It will be set implicitly before the
9606 .Sx "Resource files"
9607 are loaded if the environment variable
9608 .Ev POSIXLY_CORRECT
9609 is set, and adjusting any of those two will be reflected by the other
9610 one implicitly.
9611 The following behaviour is covered and enforced by this mechanism:
9613 .Bl -bullet -compact
9615 In non-interactive mode, any error encountered while loading resource
9616 files during program startup will cause a program exit, whereas in
9617 interactive mode such errors will stop loading of the currently loaded
9618 (stack of) file(s, i.e., recursively).
9619 These exits can be circumvented on a per-command base by using
9620 .Cm ignerr ,
9621 one of the
9622 .Sx "Command modifiers" ,
9623 for each command which shall be allowed to fail.
9625 .Ic alternates
9626 will replace the list of alternate addresses instead of appending to it.
9628 Upon changing the active
9629 .Ic file
9630 no summary of
9631 .Ic headers
9632 will be displayed even if
9633 .Va header
9634 is set.
9636 Setting
9637 .Va ignoreeof
9638 implies the behaviour described by
9639 .Va dot .
9641 The variable
9642 .Va keep
9643 is extended to cover any empty mailbox, not only empty
9644 .Mx -sx
9645 .Sx "primary system mailbox" Ns
9646 es: they will be removed when they are left in empty state otherwise.
9649 .It Va print-alternatives
9650 \*(BO When a MIME message part of type
9651 .Ql multipart/alternative
9652 is displayed and it contains a subpart of type
9653 .Ql text/plain ,
9654 other parts are normally discarded.
9655 Setting this variable causes all subparts to be displayed,
9656 just as if the surrounding part was of type
9657 .Ql multipart/mixed .
9659 .It Va prompt
9660 The string used as a prompt in interactive mode.
9661 Whenever the variable is evaluated the value is expanded as via
9662 dollar-single-quote expansion (see
9663 .Sx "Shell-style argument quoting" ) .
9664 This (post-assignment, i.e., second) expansion can be used to embed
9665 status information, for example
9666 .Va \&? ,
9667 .Va \&! ,
9668 .Va account
9670 .Va mailbox-display .
9672 In order to embed characters which should not be counted when
9673 calculating the visual width of the resulting string, enclose the
9674 characters of interest in a pair of reverse solidus escaped brackets:
9675 .Ql \e[\eE[0m\e] ;
9676 a slot for coloured prompts is also available with the \*(OPal command
9677 .Ic colour .
9678 Prompting may be prevented by setting this to the null string
9679 (a.k.a.\|
9680 .Ql set noprompt ) .
9682 .It Va prompt2
9683 This string is used for secondary prompts, but is otherwise identical to
9684 .Va prompt .
9685 The default is
9686 .Ql ..\0 .
9688 .It Va quiet
9689 \*(BO Suppresses the printing of the version when first invoked.
9691 .It Va quote
9692 If set, \*(UA starts a replying message with the original message
9693 prefixed by the value of the variable
9694 .Va indentprefix .
9695 Normally, a heading consisting of
9696 .Dq Fromheaderfield wrote:
9697 is put before the quotation.
9698 If the string
9699 .Ql noheading
9700 is assigned to the
9701 .Va \&\&quote
9702 variable, this heading is omitted.
9703 If the string
9704 .Ql headers
9705 is assigned, only the headers selected by the
9706 .Ql type
9707 .Ic headerpick
9708 selection are put above the message body,
9709 thus
9710 .Va \&\&quote
9711 acts like an automatic
9712 .Pf ` Ic ~m Ns '
9713 .Sx "COMMAND ESCAPES"
9714 command, then.
9715 If the string
9716 .Ql allheaders
9717 is assigned, all headers are put above the message body and all MIME
9718 parts are included, making
9719 .Va \&\&quote
9720 act like an automatic
9721 .Pf ` Ic ~M Ns '
9722 command; also see
9723 .Va quote-as-attachment .
9725 .It Va quote-as-attachment
9726 \*(BO Add the original message in its entirety as a
9727 .Ql message/rfc822
9728 MIME attachment when replying to a message.
9729 Note this works regardless of the setting of
9730 .Va quote .
9732 .It Va quote-fold
9733 \*(OP Can be set in addition to
9734 .Va indentprefix .
9735 Setting this turns on a more fancy quotation algorithm in that leading
9736 quotation characters are compressed and overlong lines are folded.
9737 .Va \&\&quote-fold
9738 can be set to either one or two (space separated) numeric values,
9739 which are interpreted as the maximum (goal) and the minimum line length,
9740 respectively, in a spirit rather equal to the
9741 .Xr fmt 1
9742 program, but line-, not paragraph-based.
9743 If not set explicitly the minimum will reflect the goal algorithmically.
9744 The goal cannot be smaller than the length of
9745 .Va indentprefix
9746 plus some additional pad.
9747 Necessary adjustments take place silently.
9749 .It Va r-option-implicit
9750 \*(BO Setting this option evaluates the contents of
9751 .Va from
9752 (or, if that contains multiple addresses,
9753 .Va sender )
9754 and passes the results onto the used (file-based) MTA as described for the
9755 .Fl r
9756 option (empty argument case).
9758 .It Va recipients-in-cc
9759 \*(BO When doing a
9760 .Ic reply ,
9761 the original
9762 .Ql From:
9764 .Ql To:
9765 are by default merged into the new
9766 .Ql To: .
9767 If this variable is set, only the original
9768 .Ql From:
9769 ends in the new
9770 .Ql To: ,
9771 the rest is merged into
9772 .Ql Cc: .
9774 .It Va record
9775 Unless this variable is defined, no copies of outgoing mail will be saved.
9776 If defined it gives the pathname, subject to the usual
9777 .Sx "Filename transformations" ,
9778 of a folder where all new, replied-to or forwarded messages are saved:
9779 when saving to this folder fails the message is not sent, but instead
9780 .Va save Ns
9781 d to
9782 .Ev DEAD .
9783 The standard defines that relative (fully expanded) paths are to be
9784 interpreted relative to the current directory
9785 .Pf ( Ic cwd ) ,
9786 to force interpretation relative to
9787 .Va folder
9788 .Va outfolder
9789 needs to be set in addition.
9791 .It Va record-files
9792 \*(BO If this variable is set the meaning of
9793 .Va record
9794 will be extended to cover messages which target only file and pipe
9795 recipients (see
9796 .Va expandaddr ) .
9797 These address types will not appear in recipient lists unless
9798 .Va add-file-recipients
9799 is also set.
9801 .It Va record-resent
9802 \*(BO If this variable is set the meaning of
9803 .Va record
9804 will be extended to also cover the
9805 .Ic resend
9807 .Ic Resend
9808 commands.
9810 .It Va reply-in-same-charset
9811 \*(BO If this variable is set \*(UA first tries to use the same
9812 character set of the original message for replies.
9813 If this fails, the mechanism described in
9814 .Sx "Character sets"
9815 is evaluated as usual.
9817 .It Va reply-strings
9818 Can be set to a comma-separated list of (case-insensitive according to
9819 ASCII rules) strings which shall be recognized in addition to the
9820 built-in strings as
9821 .Ql Subject:
9822 reply message indicators \(en built-in are
9823 .Ql Re: ,
9824 which is mandated by RFC 5322, as well as the german
9825 .Ql Aw: ,
9826 .Ql Antw: ,
9827 and the
9828 .Ql Wg:
9829 which often has been seen in the wild;
9830 I.e., the separating colon has to be specified explicitly.
9832 .It Va replyto
9833 A list of addresses to put into the
9834 .Ql Reply-To:
9835 field of the message header.
9836 Members of this list are handled as if they were in the
9837 .Ic alternates
9838 list.
9840 .It Va reply-to-honour
9841 Controls whether a
9842 .Ql Reply-To:
9843 header is honoured when replying to a message via
9844 .Ic reply
9846 .Ic Lreply .
9847 This is a quadoption; if set without a value it defaults to
9848 .Dq yes .
9850 .It Va rfc822-body-from_
9851 \*(BO This variable can be used to force displaying a so-called
9852 .Ql From_
9853 line for messages that are embedded into an envelope mail via the
9854 .Ql message/rfc822
9855 MIME mechanism, for more visual convenience.
9857 .It Va save
9858 \*(BO Enable saving of (partial) messages in
9859 .Ev DEAD
9860 upon interrupt or delivery error.
9862 .It Va screen
9863 The number of lines that represents a
9864 .Dq screenful
9865 of lines, used in
9866 .Ic headers
9867 summary display,
9868 .Ic from
9869 .Ic search Ns
9870 ing, message
9871 .Ic top Ns
9872 line display and scrolling via
9873 .Ic z .
9874 If this variable is not set \*(UA falls back to a calculation based upon
9875 the detected terminal window size and the baud rate: the faster the
9876 terminal, the more will be shown.
9877 Overall screen dimensions and pager usage is influenced by the
9878 environment variables
9879 .Ev COLUMNS
9881 .Ev LINES
9882 and the variable
9883 .Va crt .
9885 .It Va searchheaders
9886 \*(BO Expand message-list specifiers in the form
9887 .Ql /x:y
9888 to all messages containing the substring
9889 .Dq y
9890 in the header field
9891 .Ql x .
9892 The string search is case insensitive.
9894 .It Va sendcharsets
9895 \*(OP A comma-separated list of character set names that can be used in
9896 outgoing internet mail.
9897 The value of the variable
9898 .Va charset-8bit
9899 is automatically appended to this list of character sets.
9900 If no character set conversion capabilities are compiled into \*(UA then
9901 the only supported charset is
9902 .Va ttycharset .
9903 Also see
9904 .Va sendcharsets-else-ttycharset
9905 and refer to the section
9906 .Sx "Character sets"
9907 for the complete picture of character set conversion in \*(UA.
9909 .It Va sendcharsets-else-ttycharset
9910 \*(BO\*(OP If this variable is set, but
9911 .Va sendcharsets
9912 is not, then \*(UA acts as if
9913 .Va sendcharsets
9914 had been set to the value of the variable
9915 .Va ttycharset .
9916 In effect this combination passes through the message data in the
9917 character set of the current locale encoding:
9918 therefore mail message text will be (assumed to be) in ISO-8859-1
9919 encoding when send from within a ISO-8859-1 locale, and in UTF-8
9920 encoding when send from within an UTF-8 locale.
9922 The 8-bit fallback
9923 .Va charset-8bit
9924 never comes into play as
9925 .Va ttycharset
9926 is implicitly assumed to be 8-bit and capable to represent all files the
9927 user may specify (as is the case when no character set conversion
9928 support is available in \*(UA and the only supported character set is
9929 .Va ttycharset :
9930 .Sx "Character sets" ) .
9931 This might be a problem for scripts which use the suggested
9932 .Ql LC_ALL=C
9933 setting, since in this case the character set is US-ASCII by definition,
9934 so that it is better to also override
9935 .Va ttycharset ,
9936 then.
9938 .It Va sender
9939 An address that is put into the
9940 .Ql Sender:
9941 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
9942 responsible for the actual transmission of the message.
9943 This field should normally not be used unless the
9944 .Va from
9945 field contains more than one address, on which case it is required.
9947 .Va \&\&sender
9948 address is handled as if it were in the
9949 .Ic alternates
9950 list; also see
9951 .Fl r ,
9952 .Va r-option-implicit .
9953 .It Va sendmail
9954 \*(OB Predecessor of
9955 .Va mta .
9956 .It Va sendmail-arguments
9957 \*(OB Predecessor of
9958 .Va mta-arguments .
9959 .It Va sendmail-no-default-arguments
9960 \*(OB\*(BO Predecessor of
9961 .Va mta-no-default-arguments .
9962 .It Va sendmail-progname
9963 \*(OB Predecessor of
9964 .Va mta-argv0 .
9966 .It Va sendwait
9967 \*(BO When sending a message wait until the
9968 .Va mta
9969 (including the built-in SMTP one) exits before accepting further commands.
9970 .Sy Only
9971 with this variable set errors reported by the MTA will be recognizable!
9972 If the MTA returns a non-zero exit status,
9973 the exit status of \*(UA will also be non-zero.
9975 .It Va showlast
9976 \*(BO This setting causes \*(UA to start at the last message
9977 instead of the first one when opening a mail folder.
9979 .It Va showname
9980 \*(BO Causes \*(UA to use the sender's real name instead of the plain
9981 address in the header field summary and in message specifications.
9983 .It Va showto
9984 \*(BO Causes the recipient of the message to be shown in the header
9985 summary if the message was sent by the user.
9987 .It Va Sign
9988 The string to expand
9989 .Ic ~A
9990 to (see
9991 .Sx "COMMAND ESCAPES" ) .
9993 .It Va sign
9994 The string to expand
9995 .Ic ~a
9996 to (see
9997 .Sx "COMMAND ESCAPES" ) .
9999 .It Va signature
10000 Must correspond to the name of a readable file if set.
10001 The file's content is then appended to each singlepart message
10002 and to the first part of each multipart message.
10003 Be warned that there is no possibility to edit the signature for an
10004 individual message.
10006 .It Va skipemptybody
10007 \*(BO If an outgoing message does not contain any text in its first or
10008 only message part, do not send it but discard it silently (see also the
10009 command line option
10010 .Fl E ) .
10013 .It Va smime-ca-dir , smime-ca-file
10014 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
10015 Enhanced Mail) format as a directory and a file, respectively, for the
10016 purpose of verification of S/MIME signed messages.
10017 It is possible to set both, the file will be loaded immediately, the
10018 directory will be searched whenever no match has yet been found.
10019 The set of CA certificates which are built into the SSL/TLS library can
10020 be explicitly turned off by setting
10021 .Va smime-ca-no-defaults ,
10022 and further fine-tuning is possible via
10023 .Va smime-ca-flags .
10025 .It Va smime-ca-flags
10026 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
10027 storage, and the certificate verification that is used.
10028 The actual values and their meanings are documented for
10029 .Va ssl-ca-flags .
10031 .It Va smime-ca-no-defaults
10032 \*(BO\*(OP Do not load the default CA locations that are built into the
10033 used to SSL/TLS library to verify S/MIME signed messages.
10034 .Mx Va smime-cipher
10035 .It Va smime-cipher-USER@HOST , smime-cipher
10036 \*(OP Specifies the cipher to use when generating S/MIME encrypted
10037 messages (for the specified account).
10038 RFC 5751 mandates a default of
10039 .Ql aes128
10040 (AES-128 CBC).
10041 Possible values are (case-insensitive and) in decreasing cipher strength:
10042 .Ql aes256
10043 (AES-256 CBC),
10044 .Ql aes192
10045 (AES-192 CBC),
10046 .Ql aes128
10047 (AES-128 CBC),
10048 .Ql des3
10049 (DES EDE3 CBC, 168 bits; default if
10050 .Ql aes128
10051 is not available) and
10052 .Ql des
10053 (DES CBC, 56 bits).
10055 The actually available cipher algorithms depend on the cryptographic
10056 library that \*(UA uses.
10057 \*(OP Support for more cipher algorithms may be available through
10058 dynamic loading via, e.g.,
10059 .Xr EVP_get_cipherbyname 3
10060 (OpenSSL) if \*(UA has been compiled to support this.
10062 .It Va smime-crl-dir
10063 \*(OP Specifies a directory that contains files with CRLs in PEM format
10064 to use when verifying S/MIME messages.
10066 .It Va smime-crl-file
10067 \*(OP Specifies a file that contains a CRL in PEM format to use when
10068 verifying S/MIME messages.
10070 .It Va smime-encrypt-USER@HOST
10071 \*(OP If this variable is set, messages send to the given receiver are
10072 encrypted before sending.
10073 The value of the variable must be set to the name of a file that
10074 contains a certificate in PEM format.
10076 If a message is sent to multiple recipients,
10077 each of them for whom a corresponding variable is set will receive an
10078 individually encrypted message;
10079 other recipients will continue to receive the message in plain text
10080 unless the
10081 .Va smime-force-encryption
10082 variable is set.
10083 It is recommended to sign encrypted messages, i.e., to also set the
10084 .Va smime-sign
10085 variable.
10087 .It Va smime-force-encryption
10088 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
10090 .It Va smime-sign
10091 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
10092 and include the user's certificate as a MIME attachment.
10093 Signing a message enables a recipient to verify that the sender used
10094 a valid certificate,
10095 that the email addresses in the certificate match those in the message
10096 header and that the message content has not been altered.
10097 It does not change the message text,
10098 and people will be able to read the message as usual.
10099 Also see
10100 .Va smime-sign-cert , smime-sign-include-certs
10102 .Va smime-sign-message-digest .
10103 .Mx Va smime-sign-cert
10104 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
10105 \*(OP Points to a file in PEM format.
10106 For the purpose of signing and decryption this file needs to contain the
10107 user's private key, followed by his certificate.
10109 For message signing
10110 .Ql USER@HOST
10111 is always derived from the value of
10112 .Va from
10113 (or, if that contains multiple addresses,
10114 .Va sender ) .
10115 For the purpose of encryption the recipient's public encryption key
10116 (certificate) is expected; the command
10117 .Ic certsave
10118 can be used to save certificates of signed messages (the section
10119 .Sx "Signed and encrypted messages with S/MIME"
10120 gives some details).
10121 This mode of operation is usually driven by the specialized form.
10123 When decrypting messages the account is derived from the recipient
10124 fields
10125 .Pf ( Ql To:
10127 .Ql Cc: )
10128 of the message, which are searched for addresses for which such
10129 a variable is set.
10130 \*(UA always uses the first address that matches,
10131 so if the same message is sent to more than one of the user's addresses
10132 using different encryption keys, decryption might fail.
10134 For signing and decryption purposes it is possible to use encrypted
10135 keys, and the pseudo-host(s)
10136 .Ql USER@HOST.smime-cert-key
10137 for the private key
10138 (and
10139 .Ql USER@HOST.smime-cert-cert
10140 for the certificate stored in the same file)
10141 will be used for performing any necessary password lookup,
10142 therefore the lookup can be automatized via the mechanisms described in
10143 .Sx "On URL syntax and credential lookup" .
10144 For example, the hypothetical address
10145 .Ql bob@exam.ple
10146 could be driven with a private key / certificate pair path defined in
10147 .Va \&\&smime-sign-cert-bob@exam.ple ,
10148 and needed passwords would then be looked up via the pseudo hosts
10149 .Ql bob@exam.ple.smime-cert-key
10150 (and
10151 .Ql bob@exam.ple.smime-cert-cert ) .
10152 To include intermediate certificates, use
10153 .Va smime-sign-include-certs .
10154 .Mx Va smime-sign-include-certs
10155 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
10156 \*(OP If used, this is supposed to a consist of a comma-separated list
10157 of files, each of which containing a single certificate in PEM format to
10158 be included in the S/MIME message in addition to the
10159 .Va smime-sign-cert
10160 certificate.
10161 This can be used to include intermediate certificates of the certificate
10162 authority, in order to allow the receiver's S/MIME implementation to
10163 perform a verification of the entire certificate chain, starting from
10164 a local root certificate, over the intermediate certificates, down to the
10165 .Va smime-sign-cert .
10166 Even though top level certificates may also be included in the chain,
10167 they won't be used for the verification on the receiver's side.
10169 For the purpose of the mechanisms involved here,
10170 .Ql USER@HOST
10171 refers to the content of the internal variable
10172 .Va from
10173 (or, if that contains multiple addresses,
10174 .Va sender ) .
10175 The pseudo-host
10176 .Ql USER@HOST.smime-include-certs
10177 will be used for performing password lookups for these certificates,
10178 shall they have been given one, therefore the lookup can be automatized
10179 via the mechanisms described in
10180 .Sx "On URL syntax and credential lookup" .
10181 .Mx Va smime-sign-message-digest
10182 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
10183 \*(OP Specifies the message digest to use when signing S/MIME messages.
10184 RFC 5751 mandates a default of
10185 .Ql sha1 .
10186 Possible values are (case-insensitive and) in decreasing cipher strength:
10187 .Ql sha512 ,
10188 .Ql sha384 ,
10189 .Ql sha256 ,
10190 .Ql sha224
10192 .Ql md5 .
10194 The actually available message digest algorithms depend on the
10195 cryptographic library that \*(UA uses.
10196 \*(OP Support for more message digest algorithms may be available
10197 through dynamic loading via, e.g.,
10198 .Xr EVP_get_digestbyname 3
10199 (OpenSSL) if \*(UA has been compiled to support this.
10200 Remember that for this
10201 .Ql USER@HOST
10202 refers to the variable
10203 .Va from
10204 (or, if that contains multiple addresses,
10205 .Va sender ) .
10206 .It Va smtp
10207 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
10208 .Va mta .
10209 \*(ID For compatibility reasons a set
10210 .Va smtp
10211 is used in preference of
10212 .Va mta .
10213 .Mx Va smtp-auth
10214 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
10215 \*(OP Variable chain that controls the SMTP
10216 .Va mta
10217 authentication method, possible values are
10218 .Ql none
10219 (\*(OU default),
10220 .Ql plain
10221 (\*(IN default),
10222 .Ql login
10223 as well as the \*(OPal methods
10224 .Ql cram-md5
10226 .Ql gssapi .
10228 .Ql none
10229 method does not need any user credentials,
10230 .Ql gssapi
10231 requires a user name and all other methods require a user name and
10232 a password.
10233 See \*(IN
10234 .Va mta ,
10235 .Va user
10237 .Va password
10238 (\*(OU
10239 .Va smtp-auth-password
10241 .Va smtp-auth-user ) .
10242 Note that
10243 .Va smtp-auth-HOST
10244 is \*(IN.
10245 \*(OU: Note for
10246 .Va smtp-auth-USER@HOST :
10247 may override dependent on sender address in the variable
10248 .Va from .
10249 .It Va smtp-auth-password
10250 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
10251 If the authentication method requires a password, but neither
10252 .Va smtp-auth-password
10253 nor a matching
10254 .Va smtp-auth-password-USER@HOST
10255 can be found,
10256 \*(UA will ask for a password on the user's terminal.
10257 .It Va smtp-auth-password-USER@HOST
10258 \*(OU Overrides
10259 .Va smtp-auth-password
10260 for specific values of sender addresses, dependent upon the variable
10261 .Va from .
10262 .It Va smtp-auth-user
10263 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
10264 If the authentication method requires a user name, but neither
10265 .Va smtp-auth-user
10266 nor a matching
10267 .Va smtp-auth-user-USER@HOST
10268 can be found,
10269 \*(UA will ask for a user name on the user's terminal.
10270 .It Va smtp-auth-user-USER@HOST
10271 \*(OU Overrides
10272 .Va smtp-auth-user
10273 for specific values of sender addresses, dependent upon the variable
10274 .Va from .
10276 .It Va smtp-hostname
10277 \*(OP\*(IN Normally \*(UA uses the variable
10278 .Va from
10279 to derive the necessary
10280 .Ql USER@HOST
10281 information in order to issue a
10282 .Ql MAIL FROM:<>
10283 SMTP
10284 .Va mta
10285 command.
10286 Setting
10287 .Va smtp-hostname
10288 can be used to use the
10289 .Ql USER
10290 from the SMTP account
10291 .Pf ( Va mta
10292 or the
10293 .Va user
10294 variable chain)
10295 and the
10296 .Ql HOST
10297 from the content of this variable (or, if that is the empty string,
10298 .Va hostname
10299 or the local hostname as a last resort).
10300 This often allows using an address that is itself valid but hosted by
10301 a provider other than which (in
10302 .Va from )
10303 is about to send the message.
10304 Setting this variable also influences generated
10305 .Ql Message-ID:
10307 .Ql Content-ID:
10308 header fields.
10309 .Mx Va smtp-use-starttls
10310 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
10311 \*(BO\*(OP Causes \*(UA to issue a
10312 .Ql STARTTLS
10313 command to make an SMTP
10314 .Va mta
10315 session SSL/TLS encrypted, i.e., to enable transport layer security.
10316 .Mx Va socks-proxy
10317 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
10318 \*(OP If this is set to the hostname (SOCKS URL) of a SOCKS5 server then
10319 \*(UA will proxy all of its network activities through it.
10320 This can be used to proxy SMTP, POP3 etc. network traffic through the
10321 Tor anonymizer, for example.
10322 The following would create a local SOCKS proxy on port 10000 that
10323 forwards to the machine
10324 .Ql HOST ,
10325 and from which the network traffic is actually instantiated:
10326 .Bd -literal -offset indent
10327 # Create local proxy server in terminal 1 forwarding to HOST
10328 $ ssh -D 10000 USER@HOST
10329 # Then, start a client that uses it in terminal 2
10330 $ \*(uA -Ssocks-proxy-USER@HOST=localhost:10000
10333 .It Va spam-interface
10334 \*(OP In order to use any of the spam-related commands (like, e.g.,
10335 .Ic spamrate )
10336 the desired spam interface must be defined by setting this variable.
10337 Please refer to the manual section
10338 .Sx "Handling spam"
10339 for the complete picture of spam handling in \*(UA.
10340 All or none of the following interfaces may be available:
10341 .Bl -tag -width ".It Ql _ilte_"
10342 .It Ql spamc
10343 Interaction with
10344 .Xr spamc 1
10345 from the
10346 .Xr spamassassin 1
10347 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
10348 suite.
10349 Different to the generic filter interface \*(UA will automatically add
10350 the correct arguments for a given command and has the necessary
10351 knowledge to parse the program's output.
10352 A default value for
10353 .Va spamc-command
10354 will have been compiled into the \*(UA binary if
10355 .Xr spamc 1
10356 has been found in
10357 .Ev PATH
10358 during compilation.
10359 Shall it be necessary to define a specific connection type (rather than
10360 using a configuration file for that), the variable
10361 .Va spamc-arguments
10362 can be used as in, e.g.,
10363 .Ql -d server.example.com -p 783 .
10364 It is also possible to specify a per-user configuration via
10365 .Va spamc-user .
10366 Note that this interface does not inspect the
10367 .Ql is-spam
10368 flag of a message for the command
10369 .Ic spamforget .
10370 .It Ql filter
10371 generic spam filter support via freely configurable hooks.
10372 This interface is meant for programs like
10373 .Xr bogofilter 1
10374 and requires according behaviour in respect to the hooks' exit
10375 status for at least the command
10376 .Ic spamrate
10377 .Pf ( Ql 0
10378 meaning a message is spam,
10379 .Ql 1
10380 for non-spam,
10381 .Ql 2
10382 for unsure and any other return value indicating a hard error);
10383 since the hooks can include shell code snippets diverting behaviour
10384 can be intercepted as necessary.
10385 The hooks are
10386 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
10387   spamfilter-rate
10389 .Va spamfilter-spam ;
10390 the manual section
10391 .Sx "Handling spam"
10392 contains examples for some programs.
10393 The process environment of the hooks will have the variable
10394 .Ev MAILX_FILENAME_GENERATED
10395 set.
10396 Note that spam score support for
10397 .Ic spamrate
10398 is not supported unless the \*(OPtional regular expression support is
10399 available and the
10400 .Va spamfilter-rate-scanscore
10401 variable is set.
10404 .It Va spam-maxsize
10405 \*(OP Messages that exceed this size will not be passed through to the
10406 configured
10407 .Va spam-interface .
10408 If unset or 0, the default of 420000 bytes is used.
10410 .It Va spamc-command
10411 \*(OP The path to the
10412 .Xr spamc 1
10413 program for the
10414 .Ql spamc
10415 .Va spam-interface .
10416 Note that the path is not expanded, but used
10417 .Dq as is .
10418 A fallback path will have been compiled into the \*(UA binary if the
10419 executable had been found during compilation.
10421 .It Va spamc-arguments
10422 \*(OP Even though \*(UA deals with most arguments for the
10423 .Ql spamc
10424 .Va spam-interface
10425 automatically, it may at least sometimes be desirable to specify
10426 connection-related ones via this variable, e.g.,
10427 .Ql -d server.example.com -p 783 .
10429 .It Va spamc-user
10430 \*(OP Specify a username for per-user configuration files for the
10431 .Ql spamc
10432 .Va spam-interface .
10433 If this is set to the empty string then \*(UA will use the name of the
10434 current
10435 .Va user .
10441 .It Va spamfilter-ham , spamfilter-noham , \
10442   spamfilter-nospam , spamfilter-rate , spamfilter-spam
10443 \*(OP Command and argument hooks for the
10444 .Ql filter
10445 .Va spam-interface .
10446 The manual section
10447 .Sx "Handling spam"
10448 contains examples for some programs.
10450 .It Va spamfilter-rate-scanscore
10451 \*(OP Because of the generic nature of the
10452 .Ql filter
10453 .Va spam-interface
10454 spam scores are not supported for it by default, but if the \*(OPnal
10455 regular expression support is available then setting this variable can
10456 be used to overcome this restriction.
10457 It is interpreted as follows: first a number (digits) is parsed that
10458 must be followed by a semicolon
10459 .Ql \&;
10460 and an extended regular expression.
10461 Then the latter is used to parse the first output line of the
10462 .Va spamfilter-rate
10463 hook, and, in case the evaluation is successful, the group that has been
10464 specified via the number is interpreted as a floating point scan score.
10467 .It Va ssl-ca-dir , ssl-ca-file
10468 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
10469 Enhanced Mail) format as a directory and a file, respectively, for the
10470 purpose of verification of SSL/TLS server certificates.
10471 It is possible to set both, the file will be loaded immediately, the
10472 directory will be searched whenever no match has yet been found.
10473 The set of CA certificates which are built into the SSL/TLS library can
10474 be explicitly turned off by setting
10475 .Va ssl-ca-no-defaults ,
10476 and further fine-tuning is possible via
10477 .Va ssl-ca-flags ;
10478 also see
10479 .Xr SSL_CTX_load_verify_locations 3
10480 for more information.
10481 \*(UA will try to use the TLS/SNI (ServerNameIndication) extension when
10482 establishing TLS connections to servers identified with hostnames.
10484 .It Va ssl-ca-flags
10485 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
10486 storage, and the certificate verification that is used (also see
10487 .Va ssl-verify ) .
10488 The value is expected to consist of a comma-separated list of
10489 configuration directives, with any intervening whitespace being ignored.
10490 The directives directly map to flags that can be passed to
10491 .Xr X509_STORE_set_flags 3 ,
10492 which are usually defined in a file
10493 .Pa openssl/x509_vfy.h ,
10494 and the availability of which depends on the used SSL/TLS library
10495 version: a directive without mapping is ignored (error log subject to
10496 .Va debug ) .
10497 Directives currently understood (case-insensitively) include:
10499 .Bl -tag -compact -width ".It Cd BaNg"
10500 .It Cd no-alt-chains
10501 If the initial chain is not trusted, do not attempt to build an
10502 alternative chain.
10503 Setting this flag will make OpenSSL certificate verification match that
10504 of older OpenSSL versions, before automatic building and checking of
10505 alternative chains has been implemented; also see
10506 .Cd trusted-first .
10507 .It Cd no-check-time
10508 Do not check certificate/CRL validity against current time.
10509 .It Cd partial-chain
10510 By default partial, incomplete chains which cannot be verified up to the
10511 chain top, a self-signed root certificate, will not verify.
10512 With this flag set, a chain succeeds to verify if at least one signing
10513 certificate of the chain is in any of the configured trusted stores of
10514 CA certificates.
10515 The OpenSSL manual page
10516 .Xr SSL_CTX_load_verify_locations 3
10517 gives some advise how to manage your own trusted store of CA certificates.
10518 .It Cd strict
10519 Disable workarounds for broken certificates.
10520 .It Cd trusted-first
10521 Try building a chain using issuers in the trusted store first to avoid
10522 problems with server-sent legacy intermediate certificates.
10523 Newer versions of OpenSSL support alternative chain checking and enable
10524 it by default, resulting in the same behaviour; also see
10525 .Cd no-alt-chains .
10528 .It Va ssl-ca-no-defaults
10529 \*(BO\*(OP Do not load the default CA locations that are built into the
10530 used to SSL/TLS library to verify SSL/TLS server certificates.
10531 .Mx Va ssl-cert
10532 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
10533 \*(OP Variable chain that sets the filename for a SSL/TLS client
10534 certificate required by some servers.
10535 This is a direct interface to the
10536 .Ql Certificate
10537 slot of the
10538 .Xr SSL_CONF_cmd 3
10539 function of the OpenSSL library, if available.
10540 .Mx Va ssl-cipher-list
10541 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
10542 \*(OP Specifies a list of ciphers for SSL/TLS connections.
10543 This is a direct interface to the
10544 .Ql CipherString
10545 slot of the
10546 .Xr SSL_CONF_cmd 3
10547 function of the OpenSSL library, if available; see
10548 .Xr ciphers 1
10550 .Xr SSL_CTX_set_cipher_list 3
10551 for more information.
10552 By default \*(UA does not set a list of ciphers, in effect using a
10553 .Va ssl-protocol
10554 specific cipher (protocol standards ship with a list of acceptable
10555 ciphers), possibly cramped to what the actually used SSL/TLS library
10556 supports \(en the manual section
10557 .Sx "An example configuration"
10558 also contains a SSL/TLS use case.
10560 .It Va ssl-config-file
10561 \*(OP If this variable is set \*(UA will call
10562 .Xr CONF_modules_load_file 3
10563 to allow OpenSSL to be configured according to the host system wide
10564 security settings.
10565 If a non-empty value is given then this will be used to specify the
10566 configuration file to be used instead of the global OpenSSL default;
10567 note that in this case it is an error if the file cannot be loaded.
10568 The application name will always be passed as
10569 .Dq \*(uA .
10570 .Mx Va ssl-curves
10571 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
10572 \*(OP Specifies a list of supported curves for SSL/TLS connections.
10573 This is a direct interface to the
10574 .Ql Curves
10575 slot of the
10576 .Xr SSL_CONF_cmd 3
10577 function of the OpenSSL library, if available; see
10578 .Xr SSL_CTX_set1_curves_list 3
10579 for more information.
10580 By default \*(UA does not set a list of curves.
10583 .It Va ssl-crl-dir , ssl-crl-file
10584 \*(OP Specify a directory / a file, respectively that contains a CRL in
10585 PEM format to use when verifying SSL/TLS server certificates.
10586 .Mx Va ssl-key
10587 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
10588 \*(OP Variable chain that sets the filename for the private key of
10589 a SSL/TLS client certificate.
10590 If unset, the name of the certificate file is used.
10591 The file is expected to be in PEM format.
10592 This is a direct interface to the
10593 .Ql PrivateKey
10594 slot of the
10595 .Xr SSL_CONF_cmd 3
10596 function of the OpenSSL library, if available.
10597 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
10598 \*(OB\*(OP Please use the newer and more flexible
10599 .Va ssl-protocol
10600 instead: if both values are set,
10601 .Va ssl-protocol
10602 will take precedence!
10603 Can be set to the following values, the actually used
10604 .Va ssl-protocol
10605 specification to which it is mapped is shown in parenthesis:
10606 .Ql tls1.2
10607 .Pf ( Ql -ALL, TLSv1.2 ) ,
10608 .Ql tls1.1
10609 .Pf ( Ql -ALL, TLSv1.1 ) ,
10610 .Ql tls1
10611 .Pf ( Ql -ALL, TLSv1 )
10613 .Ql ssl3
10614 .Pf ( Ql -ALL, SSLv3 ) ;
10615 the special value
10616 .Ql auto
10617 is mapped to
10618 .Ql ALL, -SSLv2
10619 and thus includes the SSLv3 protocol.
10620 Note that SSLv2 is no longer supported at all.
10621 .Mx Va ssl-protocol
10622 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
10623 \*(OP Specify the used SSL/TLS protocol.
10624 This is a direct interface to the
10625 .Ql Protocol
10626 slot of the
10627 .Xr SSL_CONF_cmd 3
10628 function of the OpenSSL library, if available;
10629 otherwise an \*(UA internal parser is used which understands the
10630 following subset of (case-insensitive) command strings:
10631 .Ql SSLv3 ,
10632 .Ql TLSv1 ,
10633 .Ql TLSv1.1
10635 .Ql TLSv1.2 ,
10636 as well as the special value
10637 .Ql ALL .
10638 Multiple specifications may be given via a comma-separated list which
10639 ignores any whitespace.
10640 An optional
10641 .Ql +
10642 plus sign prefix will enable a protocol, a
10643 .Ql -
10644 hyphen-minus prefix will disable it, so that
10645 .Ql -ALL, TLSv1.2
10646 will enable only the TLSv1.2 protocol.
10648 It depends upon the used TLS/SSL library which protocols are actually
10649 supported and which protocols are used if
10650 .Va ssl-protocol
10651 is not set, but note that SSLv2 is no longer supported at all and
10652 actively disabled.
10653 Especially for older protocols explicitly securing
10654 .Va ssl-cipher-list
10655 may be worthwile, see
10656 .Sx "An example configuration" .
10658 .It Va ssl-rand-egd
10659 \*(OP Gives the pathname to an entropy daemon socket, see
10660 .Xr RAND_egd 3 .
10661 Not all SSL/TLS libraries support this.
10663 .It Va ssl-rand-file
10664 \*(OP Gives the filename to a file with random entropy data, see
10665 .Xr RAND_load_file 3 .
10666 If this variable is not set, or set to the empty string, or if the
10667 .Sx "Filename transformations"
10668 fail, then
10669 .Xr RAND_file_name 3
10670 will be used to create the filename if, and only if,
10671 .Xr RAND_status 3
10672 documents that the SSL PRNG is not yet sufficiently seeded.
10673 If \*(UA successfully seeded the SSL PRNG then it will update the file
10674 .Pf ( Xr RAND_write_file 3 ) .
10675 This variable is only used if
10676 .Va ssl-rand-egd
10677 is not set (or not supported by the SSL/TLS library).
10678 .Mx Va ssl-verify
10679 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
10680 \*(OP Variable chain that sets the action to be performed if an error
10681 occurs during SSL/TLS server certificate validation against the
10682 specified or default trust stores
10683 .Va ssl-ca-dir ,
10684 .Va ssl-ca-file ,
10685 or the SSL/TLS library built-in defaults (unless usage disallowed via
10686 .Va ssl-ca-no-defaults ) ,
10687 and as fine-tuned via
10688 .Va ssl-ca-flags .
10689 Valid (case-insensitive) values are
10690 .Ql strict
10691 (fail and close connection immediately),
10692 .Ql ask
10693 (ask whether to continue on standard input),
10694 .Ql warn
10695 (show a warning and continue),
10696 .Ql ignore
10697 (do not perform validation).
10698 The default is
10699 .Ql ask .
10701 .It Va stealthmua
10702 If only set without an assigned value, then this setting inhibits the
10703 generation of the
10704 .Ql Message-ID: ,
10705 .Ql Content-ID:
10707 .Ql User-Agent:
10708 header fields that include obvious references to \*(UA.
10709 There are two pitfalls associated with this:
10710 First, the message id of outgoing messages is not known anymore.
10711 Second, an expert may still use the remaining information in the header
10712 to track down the originating mail user agent.
10713 If set to the value
10714 .Ql noagent ,
10715 then the mentioned
10716 .Ql Message-ID:
10718 .Ql Content-ID:
10719 suppression does not occur.
10721 .It Va termcap
10722 (\*(OP) This specifies a comma-separated list of
10723 .Lb libterminfo
10724 and/or
10725 .Lb libtermcap
10726 capabilities (see
10727 .Sx "On terminal control and line editor" ,
10728 escape commas with reverse solidus) to be used to overwrite or define
10729 entries.
10730 .Sy Note
10731 this variable will only be queried once at program startup and can
10732 thus only be specified in resource files or on the command line.
10734 String capabilities form
10735 .Ql cap=value
10736 pairs and are expected unless noted otherwise.
10737 Numerics have to be notated as
10738 .Ql cap#number
10739 where the number is expected in normal decimal notation.
10740 Finally, booleans do not have any value but indicate a true or false
10741 state simply by being defined or not; this indeed means that \*(UA
10742 does not support undefining an existing boolean.
10743 String capability values will undergo some expansions before use:
10744 for one notations like
10745 .Ql ^LETTER
10746 stand for
10747 .Ql control-LETTER ,
10748 and for clarification purposes
10749 .Ql \eE
10750 can be used to specify
10751 .Ql escape
10752 (the control notation
10753 .Ql ^[
10754 could lead to misreadings when a left bracket follows, which it does for
10755 the standard CSI sequence);
10756 finally three letter octal sequences, as in
10757 .Ql \e061 ,
10758 are supported.
10759 To specify that a terminal supports 256-colours, and to define sequences
10760 that home the cursor and produce an audible bell, one might write:
10761 .Bd -literal -offset indent
10762 ? set termcap='Co#256,home=\eE[H,bel=^G'
10765 The following terminal capabilities are or may be meaningful for the
10766 operation of the built-in line editor or \*(UA in general:
10768 .Bl -tag -compact -width ".It Cd yay"
10769 .It Cd colors Ns \0or Cd Co
10770 .Cd max_colors :
10771 numeric capability specifying the maximum number of colours.
10772 Note that \*(UA does not actually care about the terminal beside that,
10773 but always emits ANSI / ISO 6429 escape sequences.
10774 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
10775 .Cd exit_ca_mode
10777 .Cd enter_ca_mode ,
10778 respectively: exit and enter the alternative screen ca-mode,
10779 effectively turning \*(UA into a fullscreen application.
10780 This must be enabled explicitly by setting
10781 .Va termcap-ca-mode .
10782 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
10783 .Cd keypad_xmit
10785 .Cd keypad_local ,
10786 respectively: enable and disable the keypad.
10787 This is always enabled if available, because it seems even keyboards
10788 without keypads generate other key codes for, e.g., cursor keys in that
10789 case, and only if enabled we see the codes that we are interested in.
10790 .It Cd ed Ns \0or Cd cd
10791 .Cd clr_eos :
10792 clear the screen.
10793 .It Cd clear Ns \0or Cd cl
10794 .Cd clear_screen :
10795 clear the screen and home cursor.
10796 (Will be simulated via
10797 .Cd ho
10798 plus
10799 .Cd cd . )
10800 .It Cd home Ns \0or Cd ho
10801 .Cd cursor_home :
10802 home cursor.
10803 .It Cd el Ns \0or Cd ce
10804 .Cd clr_eol :
10805 clear to the end of line.
10806 (Will be simulated via
10807 .Cd ch
10808 plus repetitions of space characters.)
10809 .It Cd hpa Ns \0or Cd ch
10810 .Cd column_address :
10811 move the cursor (to the given column parameter) in the current row.
10812 (Will be simulated via
10813 .Cd cr
10814 plus
10815 .Cd nd . )
10816 .It Cd cr
10817 .Cd carriage_return :
10818 move to the first column in the current row.
10819 The default built-in fallback is
10820 .Ql \er .
10821 .It Cd cub1 Ns \0or Cd le
10822 .Cd cursor_left :
10823 move the cursor left one space (non-destructively).
10824 The default built-in fallback is
10825 .Ql \eb .
10826 .It Cd cuf1 Ns \0or Cd nd
10827 .Cd cursor_right :
10828 move the cursor right one space (non-destructively).
10829 The default built-in fallback is
10830 .Ql \eE[C ,
10831 which is used by most terminals.
10832 Less often occur
10833 .Ql \eEC
10835 .Ql \eEOC .
10838 Many more capabilities which describe key-sequences are documented for
10839 .Ic bind .
10841 .It Va termcap-ca-mode
10842 \*(OP Allow usage of the
10843 .Cd exit_ca_mode
10845 .Cd enter_ca_mode
10846 terminal capabilities, effectively turning \*(UA into a fullscreen
10847 application, as documented for
10848 .Va termcap .
10849 .Sy Note
10850 this variable will only be queried once at program startup and can
10851 thus only be specified in resource files or on the command line.
10853 .It Va termcap-disable
10854 \*(OP Disable any interaction with a terminal control library.
10855 If set only some generic fallback built-ins and possibly the content of
10856 .Va termcap
10857 describe the terminal to \*(UA.
10858 .Sy Note
10859 this variable will only be queried once at program startup and can
10860 thus only be specified in resource files or on the command line.
10862 .It Va toplines
10863 If defined, gives the number of lines of a message to be displayed
10864 with the command
10865 .Ic top ;
10866 if unset, the first five lines are printed, if set to 0 the variable
10867 .Va screen
10868 is inspected.
10869 If the value is negative then its absolute value will be used for
10870 unsigned right shifting (see
10871 .Ic vexpr )
10873 .Va screen
10874 height.
10876 .It Va topsqueeze
10877 \*(BO If set then the
10878 .Ic top
10879 command series will strip adjacent empty lines and quotations.
10881 .It Va ttycharset
10882 The character set of the terminal \*(UA operates on,
10883 and the one and only supported character set that \*(UA can use if no
10884 character set conversion capabilities have been compiled into it,
10885 in which case it defaults to ISO-8859-1 unless it can deduce a value
10886 from the locale specified in the
10887 .Ev LC_CTYPE
10888 environment variable (if supported, see there for more).
10889 It defaults to UTF-8 if conversion is available.
10890 Refer to the section
10891 .Sx "Character sets"
10892 for the complete picture about character sets.
10894 .It Va typescript-mode
10895 \*(BO A special multiplex variable that disables all variables and
10896 settings which result in behaviour that interferes with running \*(UA in
10897 .Xr script 1 ,
10898 e.g., it sets
10899 .Va colour-disable ,
10900 .Va line-editor-disable
10901 and (before startup completed only)
10902 .Va termcap-disable .
10903 Unsetting it does not restore the former state of the covered settings.
10905 .It Va umask
10906 For a safety-by-default policy \*(UA sets its process
10907 .Xr umask 2
10909 .Ql 0077 ,
10910 but this variable can be used to override that:
10911 set it to an empty value to do not change the (current) setting (on
10912 startup), otherwise the process file mode creation mask is updated to
10913 the new value.
10914 Child processes inherit the process file mode creation mask.
10915 .Mx Va user
10916 .It Va user-HOST , user
10917 \*(IN Variable chain that sets a global fallback user name, which is
10918 used in case none has been given in the protocol and account-specific
10919 URL.
10920 This variable defaults to the name of the user who runs \*(UA.
10922 .It Va v15-compat
10923 \*(BO Setting this enables upward compatibility with \*(UA
10924 version 15.0 in respect to which configuration options are available and
10925 how they are handled.
10926 This manual uses \*(IN and \*(OU to refer to the new and the old way of
10927 doing things, respectively.
10929 .It Va verbose
10930 \*(BO This setting, also controllable via the command line option
10931 .Fl v ,
10932 causes \*(UA to be more verbose, e.g., it will display obsoletion
10933 warnings and SSL/TLS certificate chains.
10934 Even though marked \*(BO this option may be set twice in order to
10935 increase the level of verbosity even more, in which case even details of
10936 the actual message delivery and protocol conversations are shown.
10937 A single
10938 .Pf no Va verbose
10939 is sufficient to disable verbosity as such.
10945 .It Va version , version-date , version-major , version-minor , version-update
10946 \*(RO \*(UA version information: the first variable contains a string
10947 containing the complete version identification, the latter three contain
10948 only digits: the major, minor and update version numbers.
10949 The date is in ISO 8601 notation.
10950 The output of the command
10951 .Ic version
10952 will include this information.
10954 .It Va writebackedited
10955 If this variable is set messages modified using the
10956 .Ic edit
10958 .Ic visual
10959 commands are written back to the current folder when it is quit;
10960 it is only honoured for writable folders in MBOX format, though.
10961 Note that the editor will be pointed to the raw message content in that
10962 case, i.e., neither MIME decoding nor decryption will have been
10963 performed, and proper RFC 4155
10964 .Ql From_
10965 quoting of newly added or edited content is also left as an excercise to
10966 the user.
10968 .Sh ENVIRONMENT
10969 The term
10970 .Dq environment variable
10971 should be considered an indication that these variables are either
10972 standardized as vivid parts of process environments, or that they are
10973 commonly found in there.
10974 The process environment is inherited from the
10975 .Xr sh 1
10976 once \*(UA is started, and unless otherwise explicitly noted handling of
10977 the following variables transparently integrates into that of the
10978 .Sx "INTERNAL VARIABLES"
10979 from \*(UA's point of view.
10980 This means that, e.g., they can be managed via
10981 .Ic set
10983 .Ic unset ,
10984 causing automatic program environment updates (to be inherited by
10985 newly created child processes).
10987 In order to transparently integrate other environment variables equally
10988 they need to be imported (linked) with the command
10989 .Ic environ .
10990 This command can also be used to set and unset non-integrated
10991 environment variables from scratch, sufficient system support provided.
10992 The following example, applicable to a POSIX shell, sets the
10993 .Ev COLUMNS
10994 environment variable for \*(UA only, and beforehand exports the
10995 .Ev EDITOR
10996 in order to affect any further processing in the running shell:
10997 .Bd -literal -offset indent
10998 $ EDITOR="vim -u ${HOME}/.vimrc"
10999 $ export EDITOR
11000 $ COLUMNS=80 \*(uA -R
11002 .Bl -tag -width ".It Ev BaNg"
11004 .It Ev COLUMNS
11005 The user's preferred width in column positions for the terminal screen
11006 or window.
11007 Queried and used once on program startup, actively managed for child
11008 processes and the MLE (see
11009 .Sx "On terminal control and line editor" )
11010 in interactive mode thereafter.
11011 Ignored in non-interactive mode, which always uses 80 columns, unless in
11012 .fl #
11013 batch mode.
11015 .It Ev DEAD
11016 The name of the (mailbox)
11017 .Ic file
11018 to use for saving aborted messages if
11019 .Va save
11020 is set; this defaults to
11021 .Pa dead.letter
11022 in the user's
11023 .Ev HOME
11024 directory.
11025 If the variable
11026 .Va debug
11027 is set no output will be generated, otherwise the contents of the file
11028 will be replaced.
11030 .It Ev EDITOR
11031 Pathname of the text editor to use in the
11032 .Ic edit
11033 command and
11034 .Ic ~e
11035 .Sx "COMMAND ESCAPES" .
11036 A default editor is used if this value is not defined.
11038 .It Ev HOME
11039 The user's home directory.
11040 This variable is only used when it resides in the process environment.
11041 The calling user's home directory will be used instead if this directory
11042 does not exist, is not accessible or cannot be read.
11043 (No test for being writable is performed to allow usage by
11044 non-privileged users within read-only jails, but dependent on the
11045 variable settings this directory is a default write target, e.g. for
11046 .Ev DEAD ,
11047 .Ev MBOX
11048 and more.)
11052 .It Ev LC_ALL , LC_CTYPE , LANG
11053 \*(OP The (names in lookup order of the)
11054 .Xr locale 7
11055 (and / or see
11056 .Xr setlocale 3 )
11057 which indicates the used
11058 .Sx "Character sets" .
11059 Runtime changes trigger automatic updates of the entire locale system,
11060 updating and overwriting also a
11061 .Va ttycharset
11062 set by the user.
11064 .It Ev LINES
11065 The user's preferred number of lines on a page or the vertical screen
11066 or window size in lines.
11067 Queried and used once on program startup, actively managed for child
11068 processes in interactive mode thereafter.
11069 Ignored in non-interactive mode, which always uses 24 lines, unless in
11070 .fl #
11071 batch mode.
11073 .It Ev LISTER
11074 Pathname of the directory lister to use in the
11075 .Ic folders
11076 command when operating on local mailboxes.
11077 Default is
11078 .Xr ls 1
11079 (path search through
11080 .Ev SHELL ) .
11082 .It Ev LOGNAME
11083 Upon startup \*(UA will actively ensure that this variable refers to the
11084 name of the user who runs \*(UA, in order to be able to pass a verified
11085 name to any newly created child process.
11087 .It Ev MAIL
11088 Is used as the users
11089 .Mx -sx
11090 .Sx "primary system mailbox"
11091 unless
11092 .Va inbox
11093 is set.
11094 This is assumed to be an absolute pathname.
11096 .It Ev MAILCAPS
11097 \*(OP Overrides the default path search for
11098 .Sx "The Mailcap files" ,
11099 which is defined in the standard RFC 1524 as
11100 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
11101 (\*(UA makes it a configuration option, however.)
11102 Note this is not a search path, but a path search.
11104 .It Ev MAILRC
11105 Is used as a startup file instead of
11106 .Pa \*(ur
11107 if set.
11108 When \*(UA scripts are invoked on behalf of other users,
11109 either this variable should be set to
11110 .Pa /dev/null
11111 or the
11112 .Fl \&:
11113 command line option should be used in order to avoid side-effects from
11114 reading their configuration files.
11115 This variable is only used when it resides in the process environment.
11117 .It Ev MAILX_NO_SYSTEM_RC
11118 If this variable is set then reading of
11119 .Pa \*(UR
11120 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
11121 had been started up with the option
11122 .Fl \&:
11123 (and according argument) or
11124 .Fl n .
11125 This variable is only used when it resides in the process environment.
11127 .It Ev MBOX
11128 The name of the users
11129 .Mx -sx
11130 .Sx "secondary mailbox"
11131 file.
11132 A logical subset of the special
11133 .Sx "Filename transformations"
11134 (also see
11135 .Ic file )
11136 are supported.
11137 The default is
11138 .Pa ~/mbox .
11139 Traditionally this MBOX is used as the file to save messages from the
11140 .Mx -sx
11141 .Sx "primary system mailbox"
11142 that have been read.
11143 Also see
11144 .Sx "Message states" .
11146 .It Ev NETRC
11147 \*(IN\*(OP This variable overrides the default location of the user's
11148 .Pa ~/.netrc
11149 file.
11151 .It Ev PAGER
11152 Pathname of the program to use for backing the command
11153 .Ic more ,
11154 and when the
11155 .Va crt
11156 variable enforces usage of a pager for output.
11157 The default paginator is
11158 .Xr more 1
11159 (path search through
11160 .Ev SHELL ) .
11162 \*(UA inspects the contents of this variable: if its contains the string
11163 .Dq less
11164 then a non-existing environment variable
11165 .Va LESS
11166 will be set to
11167 .Ql FRXi ,
11168 .Ql FRi
11170 .Ql Ri ,
11171 dependent on whether terminal control support is available and whether
11172 that supports full (alternative) screen mode or not (also see
11173 .Sx "On terminal control and line editor" ) .
11174 Likewise for
11175 .Dq lv
11176 .Va LV
11177 will optionally be set to
11178 .Dq -c .
11179 Alse see
11180 .Va colour-pager .
11182 .It Ev PATH
11183 A colon-separated list of directories that is searched by the shell when
11184 looking for commands, e.g.,
11185 .Ql /bin:/usr/bin:/usr/local/bin .
11187 .It Ev POSIXLY_CORRECT
11188 This variable is automatically looked for upon startup, see
11189 .Va posix
11190 for more.
11192 .It Ev SHELL
11193 The shell to use for the commands
11194 .Ic \&! ,
11195 .Ic shell ,
11197 .Ic ~!
11198 .Sx "COMMAND ESCAPES"
11199 and when starting subprocesses.
11200 A default shell is used if this environment variable is not defined.
11202 .It Ev SOURCE_DATE_EPOCH
11203 This specifies a time in seconds since the Unix epoch (1970-01-01) to be
11204 used in place of the current time.
11205 This variable is looked up upon program startup, and its existence will
11206 switch \*(UA to a completely reproducible mode which causes
11207 deterministic random numbers, a special fixed (non-existent?)
11208 .Ev LOGNAME
11209 and more to be used and set.
11210 It is to be used during development or by software packagers.
11211 \*(ID Currently an invalid setting is only ignored, rather than causing
11212 a program abortion.
11214 .Dl $ SOURCE_DATE_EPOCH=`date +%s` \*(uA
11216 .It Ev TERM
11217 \*(OP The terminal type for which output is to be prepared.
11218 For extended colour and font control please refer to
11219 .Sx "Coloured display" ,
11220 and for terminal management in general to
11221 .Sx "On terminal control and line editor" .
11223 .It Ev TMPDIR
11224 Used as directory for temporary files instead of
11225 .Pa /tmp ,
11226 if set, existent, accessible as well as read- and writable.
11227 This variable is only used when it resides in the process environment,
11228 but \*(UA will ensure at startup that this environment variable is
11229 updated to contain a usable temporary directory.
11231 .It Ev USER
11232 Identical to
11233 .Ev LOGNAME
11234 (see there), but this variable is not standardized, should therefore not
11235 be used, and is only corrected if already set.
11237 .It Ev VISUAL
11238 Pathname of the text editor to use in the
11239 .Ic visual
11240 command and
11241 .Ic ~v
11242 .Sx "COMMAND ESCAPES" .
11244 .Sh FILES
11245 .Bl -tag -width ".It Pa BaNg"
11246 .It Pa \*(ur
11247 File giving initial commands, one of the
11248 .Sx "Resource files" .
11249 .It Pa \*(UR
11250 System wide initialization file, one of the
11251 .Sx "Resource files" .
11253 .It Pa ~/.mailcap
11254 \*(OP Personal MIME type handler definition file, see
11255 .Sx "The Mailcap files" .
11256 This location is part of the RFC 1524 standard search path, which is
11257 a configuration option and can be overridden via
11258 .Ev MAILCAPS .
11260 .It Pa /etc/mailcap
11261 \*(OP System wide MIME type handler definition file, see
11262 .Sx "The Mailcap files" .
11263 This location is part of the RFC 1524 standard search path, which is
11264 a configuration option and can be overridden via
11266 .It Pa ~/mbox
11267 The default value for
11268 .Ev MBOX .
11269 The actually used path is a configuration option.
11271 .It Pa ~/.mime.types
11272 Personal MIME types, see
11273 .Sx "The mime.types files" .
11274 The actually used path is a configuration option.
11276 .It Pa /etc/mime.types
11277 System wide MIME types, see
11278 .Sx "The mime.types files" .
11279 The actually used path is a configuration option.
11281 .It Pa ~/.netrc
11282 \*(IN\*(OP The default location of the users
11283 .Pa .netrc
11284 file \(en the section
11285 .Sx "The .netrc file"
11286 documents the file format.
11287 The actually used path is a configuration option and can be overridden via
11288 .Ev NETRC .
11290 .It Pa /dev/null
11291 The data sink
11292 .Xr null 4 .
11293 The actually used path is a compile-time constant.
11295 .Ss "Resource files"
11296 Upon startup \*(UA reads in several resource files:
11297 .Bl -tag -width ".It Pa BaNg"
11299 .It Pa \*(UR
11300 System wide initialization file.
11301 Reading of this file can be suppressed, either by using the
11302 .Fl \&:
11303 (and according argument) or
11304 .Fl n
11305 command line options, or by setting the
11306 .Sx ENVIRONMENT
11307 variable
11308 .Ev MAILX_NO_SYSTEM_RC .
11310 .It Pa \*(ur
11311 File giving initial commands.
11312 A different file can be chosen by setting the
11313 .Sx ENVIRONMENT
11314 variable
11315 .Ev MAILRC .
11316 Reading of this file can be suppressed with the
11317 .Fl \&:
11318 command line option.
11319 .It Va mailx-extra-rc
11320 Defines a startup file to be read after all other resource files.
11321 It can be used to specify settings that are not understood by other
11322 .Xr mailx 1
11323 implementations, for example.
11324 This variable is only honoured when defined in a resource file, e.g.,
11325 it is one of the
11326 .Sx "INTERNAL VARIABLES" .
11329 The content of these files is interpreted as follows:
11331 .Bl -bullet -compact
11333 The whitespace characters space, tabulator and newline,
11334 as well as those defined by the variable
11335 .Va ifs ,
11336 are removed from the beginning and end of input lines.
11338 Empty lines are ignored.
11340 Any other line is interpreted as a command.
11341 It may be spread over multiple input lines if the newline character is
11342 .Dq escaped
11343 by placing a reverse solidus character
11344 .Ql \e
11345 as the last character of the line; whereas any leading whitespace of
11346 follow lines is ignored, trailing whitespace before a escaped newline
11347 remains in the input.
11349 If the line (content) starts with the number sign
11350 .Ql #
11351 then it is a comment-command and also ignored.
11352 (The comment-command is a real command, which does nothing, and
11353 therefore the usual follow lines mechanism applies!)
11356 Unless \*(UA is about to enter interactive mode syntax errors that occur
11357 while loading these files are treated as errors and cause program exit.
11358 More files with syntactically equal content can be
11359 .Ic source Ns ed .
11360 The following, saved in a file, would be an examplary content:
11361 .Bd -literal -offset indent
11362  # This line is a comment command.  And y\e
11363     es, it is really continued here.
11364 set debug \e
11365     verbose
11366     set editheaders
11368 .Ss "The mime.types files"
11369 As stated in
11370 .Sx "HTML mail and MIME attachments"
11371 \*(UA needs to learn about MIME (Multipurpose Internet Mail Extensions)
11372 media types in order to classify message and attachment content.
11373 One source for them are
11374 .Pa mime.types
11375 files, the loading of which can be controlled by setting the variable
11376 .Va mimetypes-load-control .
11377 Another is the command
11378 .Ic mimetype ,
11379 which also offers access to \*(UAs MIME type cache.
11380 .Pa mime.types
11381 files have the following syntax:
11382 .Bd -literal -offset indent
11383 type/subtype extension [extension ...]
11384 # E.g., text/html html htm
11387 where
11388 .Ql type/subtype
11389 define the MIME media type, as standardized in RFC 2046:
11390 .Ql type
11391 is used to declare the general type of data, while the
11392 .Ql subtype
11393 specifies a specific format for that type of data.
11394 One or multiple filename
11395 .Ql extension Ns
11396 s, separated by whitespace, can be bound to the media type format.
11397 Comments may be introduced anywhere on a line with a number sign
11398 .Ql # ,
11399 causing the remaining line to be discarded.
11400 \*(UA also supports an extended, non-portable syntax in especially
11401 crafted files, which can be loaded via the alternative value syntax of
11402 .Va mimetypes-load-control ,
11403 and prepends an optional
11404 .Ql type-marker :
11406 .Dl [type-marker ]type/subtype extension [extension ...]
11408 The following type markers are supported:
11410 .Bl -tag -compact -width ".It Ar _n_u"
11411 .It Ar @
11412 Treat message parts with this content as plain text.
11413 .It Ar @t
11414 The same as plain
11415 .Ar @ .
11416 .It Ar @h
11417 Treat message parts with this content as HTML tagsoup.
11418 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
11419 the content as plain text instead.
11420 .It Ar @H
11421 Likewise
11422 .Ar @h ,
11423 but instead of falling back to plain text require an explicit content
11424 handler to be defined.
11427 Further reading:
11428 for sending messages:
11429 .Ic mimetype ,
11430 .Va mime-allow-text-controls ,
11431 .Va mimetypes-load-control .
11432 For reading etc. messages:
11433 .Sx "HTML mail and MIME attachments" ,
11434 .Sx "The Mailcap files" ,
11435 .Ic mimetype ,
11436 .Va mime-counter-evidence ,
11437 .Va mimetypes-load-control ,
11438 .Va pipe-TYPE/SUBTYPE ,
11439 .Va pipe-EXTENSION .
11440 .Ss "The Mailcap files"
11441 .Sy This feature is not available in v14.9.0, sorry!
11442 RFC 1524 defines a
11443 .Dq User Agent Configuration Mechanism
11444 which \*(UA \*(OPally supports (see
11445 .Sx "HTML mail and MIME attachments" ) .
11446 It defines a file format to be used to inform mail user agent programs
11447 about the locally-installed facilities for handling various data
11448 formats, i.e., about commands and how they can be used to display, edit
11449 et cetera MIME part contents, as well as a default path search that
11450 includes multiple possible locations of
11451 .Dq mailcap
11452 files and the
11453 .Ev MAILCAPS
11454 environment variable that can be used to overwrite that (repeating here
11455 that it is not a search path, but instead a path search specification).
11456 Any existing files will be loaded in sequence, appending any content to
11457 the list of MIME type handler directives.
11459 .Dq Mailcap
11460 files consist of a set of newline separated entries.
11461 Comment lines start with a number sign
11462 .Ql #
11463 (in the first column!) and are ignored.
11464 Empty lines are also ignored.
11465 All other lines form individual entries that must adhere to the syntax
11466 described below.
11467 To extend a single entry (not comment) its line can be continued on
11468 follow lines if newline characters are
11469 .Dq escaped
11470 by preceding them with the reverse solidus character
11471 .Ql \e .
11472 The standard does not specify how leading whitespace of follow lines
11473 is to be treated, therefore \*(UA retains it.
11475 .Dq Mailcap
11476 entries consist of a number of semicolon
11477 .Ql \&;
11478 separated fields, and the reverse solidus
11479 .Ql \e
11480 character can be used to escape any following character including
11481 semicolon and itself.
11482 The first two fields are mandatory and must occur in the specified
11483 order, the remaining fields are optional and may appear in any order.
11484 Leading and trailing whitespace of content is ignored (removed).
11486 The first field defines the MIME
11487 .Ql TYPE/SUBTYPE
11488 the entry is about to handle (case-insensitively, and no reverse solidus
11489 escaping is possible in this field).
11490 If the subtype is specified as an asterisk
11491 .Ql *
11492 the entry is meant to match all subtypes of the named type, e.g.,
11493 .Ql audio/*
11494 would match any audio type.
11495 The second field defines the shell command which shall be used to
11496 .Dq display
11497 MIME parts of the given type; it is implicitly called the
11498 .Cd view
11499 command.
11501 For data
11502 .Dq consuming
11503 shell commands message (MIME part) data is passed via standard input
11504 unless the given shell command includes one or more instances of the
11505 (unquoted) string
11506 .Ql %s ,
11507 in which case these instances will be replaced with a temporary filename
11508 and the data will have been stored in the file that is being pointed to.
11509 Likewise, for data
11510 .Dq producing
11511 shell commands data is assumed to be generated on standard output unless
11512 the given command includes (one ore multiple)
11513 .Ql %s .
11514 In any case any given
11515 .Ql %s
11516 format is replaced with a(n already) properly quoted filename.
11517 Note that when a command makes use of a temporary file via
11518 .Ql %s
11519 then \*(UA will remove it again, as if the
11520 .Cd x-mailx-tmpfile ,
11521 .Cd x-mailx-tmpfile-fill
11523 .Cd x-mailx-tmpfile-unlink
11524 flags had been set; see below for more.
11526 The optional fields either define a shell command or an attribute (flag)
11527 value, the latter being a single word and the former being a keyword
11528 naming the field followed by an equals sign
11529 .Ql =
11530 succeeded by a shell command, and as usual for any
11531 .Dq Mailcap
11532 content any whitespace surrounding the equals sign will be removed, too.
11533 Optional fields include the following:
11534 .Bl -tag -width ".It Cd BaNg"
11535 .It Cd compose
11536 A program that can be used to compose a new body or body part in the
11537 given format.
11538 (Currently unused.)
11539 .It Cd composetyped
11540 Similar to the
11541 .Cd compose
11542 field, but is to be used when the composing program needs to specify the
11543 .Ql Content-type:
11544 header field to be applied to the composed data.
11545 (Currently unused.)
11546 .It Cd edit
11547 A program that can be used to edit a body or body part in the given
11548 format.
11549 (Currently unused.)
11550 .It Cd print
11551 A program that can be used to print a message or body part in the given
11552 format.
11553 (Currently unused.)
11554 .It Cd test
11555 Specifies a program to be run to test some condition, e.g., the machine
11556 architecture, or the window system in use, to determine whether or not
11557 this mailcap entry applies.
11558 If the test fails, a subsequent mailcap entry should be sought; also see
11559 .Cd x-mailx-test-once .
11561 .It Cd needsterminal
11562 This flag field indicates that the given shell command must be run on
11563 an interactive terminal.
11564 \*(UA will temporarily release the terminal to the given command in
11565 interactive mode, in non-interactive mode this entry will be entirely
11566 ignored; this flag implies
11567 .Cd x-mailx-noquote .
11569 .It Cd copiousoutput
11570 A flag field which indicates that the output of the
11571 .Cd view
11572 command will be an extended stream of textual output that can be
11573 (re)integrated into \*(UA's normal visual display.
11574 It is mutually exclusive with
11575 .Cd needsterminal .
11576 .It Cd textualnewlines
11577 A flag field which indicates that this type of data is line-oriented and
11578 that, if encoded in
11579 .Ql base64 ,
11580 all newlines should be converted to canonical form (CRLF) before
11581 encoding, and will be in that form after decoding.
11582 (Currently unused.)
11583 .It Cd nametemplate
11584 This field gives a filename format, in which
11585 .Ql %s
11586 will be replaced by a random string, the joined combination of which
11587 will be used as the filename denoted by
11588 .Ev MAILX_FILENAME_TEMPORARY .
11589 One could specify that a GIF file being passed to an image viewer should
11590 have a name ending in
11591 .Ql .gif
11592 by using
11593 .Ql nametemplate=%s.gif .
11594 Note that \*(UA ignores the name template unless that solely specifies
11595 a filename suffix that consists of (ASCII) alphabetic and numeric
11596 characters, the underscore and dot only.
11597 .It Cd x11-bitmap
11598 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
11599 icon to be used to visually denote the presence of this kind of data.
11600 This field is not used by \*(UA.
11601 .It Cd description
11602 A textual description that describes this type of data.
11604 .It Cd x-mailx-even-if-not-interactive
11605 An extension flag test field \(em by default handlers without
11606 .Cd copiousoutput
11607 are entirely ignored in non-interactive mode, but if this flag is set
11608 then their use will be considered.
11609 It is an error if this flag is set for commands that use the flag
11610 .Cd needsterminal .
11612 .It Cd x-mailx-noquote
11613 An extension flag field that indicates that even a
11614 .Cd copiousoutput
11615 .Cd view
11616 command shall not be used to generate message quotes
11617 (as it would be by default).
11619 .It Cd x-mailx-async
11620 Extension flag field that denotes that the given
11621 .Cd view
11622 command shall be executed asynchronously, without blocking \*(UA.
11623 Cannot be used in conjunction with
11624 .Cd needsterminal .
11626 .It Cd x-mailx-test-once
11627 Extension flag which denotes whether the given
11628 .Cd test
11629 command shall be evaluated once only and the (boolean) result be cached.
11630 This is handy if some global unchanging condition is to be queried, like
11631 .Dq running under the X Window System .
11633 .It Cd x-mailx-tmpfile
11634 Extension flag field that requests creation of a zero-sized temporary
11635 file, the name of which is to be placed in the environment variable
11636 .Ev MAILX_FILENAME_TEMPORARY .
11637 It is an error to use this flag with commands that include a
11638 .Ql %s
11639 format.
11641 .It Cd x-mailx-tmpfile-fill
11642 Normally the MIME part content is passed to the handler via standard
11643 input; if this flag is set then the data will instead be written into
11644 the implied
11645 .Cd x-mailx-tmpfile .
11646 In order to cause deletion of the temporary file you will have to set
11647 .Cd x-mailx-tmpfile-unlink
11648 explicitly!
11649 It is an error to use this flag with commands that include a
11650 .Ql %s
11651 format.
11653 .It Cd x-mailx-tmpfile-unlink
11654 Extension flag field that requests that the temporary file shall be
11655 deleted automatically when the command loop is entered again at latest.
11656 (Do not use this for asynchronous handlers.)
11657 It is an error to use this flag with commands that include a
11658 .Ql %s
11659 format, or in conjunction with
11660 .Cd x-mailx-async ,
11661 or without also setting
11662 .Cd x-mailx-tmpfile
11664 .Cd x-mailx-tmpfile-fill .
11666 .It Cd x-mailx-tmpfile-keep
11667 Using the string
11668 .Ql %s
11669 implies the three tmpfile related flags above, but if you want, e.g.,
11670 .Cd x-mailx-async
11671 and deal with the temporary file yourself, you can add in this flag to
11672 forcefully ignore
11673 .Cd x-mailx-tmpfile-unlink .
11676 The standard includes the possibility to define any number of additional
11677 entry fields, prefixed by
11678 .Ql x- .
11679 Flag fields apply to the entire
11680 .Dq Mailcap
11681 entry \(em in some unusual cases, this may not be desirable, but
11682 differentiation can be accomplished via separate entries, taking
11683 advantage of the fact that subsequent entries are searched if an earlier
11684 one does not provide enough information.
11685 E.g., if a
11686 .Cd view
11687 command needs to specify the
11688 .Cd needsterminal
11689 flag, but the
11690 .Cd compose
11691 command shall not, the following will help out the latter (with enabled
11692 .Va debug
11693 or an increased
11694 .Va verbose
11695 level \*(UA will show information about handler evaluation):
11696 .Bd -literal -offset indent
11697 application/postscript; ps-to-terminal %s; needsterminal
11698 application/postscript; ps-to-terminal %s; compose=idraw %s
11701 In fields any occurrence of the format string
11702 .Ql %t
11703 will be replaced by the
11704 .Ql TYPE/SUBTYPE
11705 specification.
11706 Named parameters from the
11707 .Ql Content-type:
11708 field may be placed in the command execution line using
11709 .Ql %{
11710 followed by the parameter name and a closing
11711 .Ql }
11712 character.
11713 The entire parameter should appear as a single command line argument,
11714 regardless of embedded spaces; thus:
11715 .Bd -literal -offset indent
11716 # Message
11717 Content-type:  multipart/mixed; boundary=42
11719 # Mailcap file
11720 multipart/*; /usr/local/bin/showmulti \e
11721   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
11723 # Executed shell command
11724 /usr/local/bin/showmulti multipart/mixed 42
11727 Note that \*(UA does not support handlers for multipart MIME parts as
11728 shown in this example (as of today).
11729 \*(UA does not support the additional formats
11730 .Ql %n
11732 .Ql %F .
11733 An example file, also showing how to properly deal with the expansion of
11734 .Ql %s ,
11735 which includes any quotes that are necessary to make it a valid shell
11736 argument by itself and thus will cause undesired behaviour when placed
11737 in additional user-provided quotes:
11738 .Bd -literal -offset indent
11739 # Comment line
11740 text/richtext; richtext %s; copiousoutput
11742 text/x-perl; perl -cWT %s
11744 application/pdf; \e
11745   infile=%s\e; \e
11746     trap "rm -f ${infile}" EXIT\e; \e
11747     trap "exit 75" INT QUIT TERM\e; \e
11748     mupdf %s; \e
11749   x-mailx-async; x-mailx-tmpfile-keep
11751 application/*; echo "This is \e"%t\e" but \e
11752     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vET; \e
11753   copiousoutput; x-mailx-noquote
11756 Further reading:
11757 .Sx "HTML mail and MIME attachments" ,
11758 .Sx "The mime.types files" ,
11759 .Ic mimetype ,
11760 .Ev MAILCAPS ,
11761 .Va mime-counter-evidence ,
11762 .Va pipe-TYPE/SUBTYPE ,
11763 .Va pipe-EXTENSION .
11764 .Ss "The .netrc file"
11766 .Pa .netrc
11767 file contains user credentials for machine accounts.
11768 The default location in the user's
11769 .Ev HOME
11770 directory may be overridden by the
11771 .Ev NETRC
11772 environment variable.
11773 The file consists of space, tabulator or newline separated tokens.
11774 \*(UA implements a parser that supports a superset of the original BSD
11775 syntax, but users should nonetheless be aware of portability glitches
11776 of that file format, shall their
11777 .Pa .netrc
11778 be usable across multiple programs and platforms:
11780 .Bl -bullet -compact
11782 BSD does not support single, but only double quotation marks, e.g.,
11783 .Ql password="pass with spaces" .
11785 BSD (only?) supports escaping of single characters via a reverse solidus
11786 (e.g., a space can be escaped via
11787 .Ql \e\0 ) ,
11788 in- as well as outside of a quoted string.
11790 BSD does not require a final quotation mark of the last user input token.
11792 The original BSD (Berknet) parser also supported a format which allowed
11793 tokens to be separated with commas \(en whereas at least Hewlett-Packard
11794 still seems to support this syntax, \*(UA does not!
11796 As a non-portable extension some widely-used programs support
11797 shell-style comments: if an input line starts, after any amount of
11798 whitespace, with a number sign
11799 .Ql # ,
11800 then the rest of the line is ignored.
11802 Whereas other programs may require that the
11803 .Pa .netrc
11804 file is accessible by only the user if it contains a
11805 .Cd password
11806 token for any other
11807 .Cd login
11808 than
11809 .Dq anonymous ,
11810 \*(UA will always require these strict permissions.
11813 Of the following list of supported tokens \*(UA only uses (and caches)
11814 .Cd machine ,
11815 .Cd login
11817 .Cd password .
11818 At runtime the command
11819 .Ic netrc
11820 can be used to control \*(UA's
11821 .Pa .netrc
11822 cache.
11823 .Bl -tag -width ".It Cd BaNg"
11824 .It Cd machine Ar name
11825 The hostname of the entries' machine, lowercase-normalized by \*(UA
11826 before use.
11827 Any further file content, until either end-of-file or the occurrence
11828 of another
11829 .Cd machine
11830 or a
11831 .Cd default
11832 first-class token is bound (only related) to the machine
11833 .Ar name .
11835 As an extension that should not be the cause of any worries
11836 \*(UA supports a single wildcard prefix for
11837 .Ar name :
11838 .Bd -literal -offset indent
11839 machine *.example.com login USER password PASS
11840 machine pop3.example.com login USER password PASS
11841 machine smtp.example.com login USER password PASS
11844 which would match
11845 .Ql xy.example.com
11846 as well as
11847 .Ql pop3.example.com ,
11848 but neither
11849 .Ql example.com
11851 .Ql local.smtp.example.com .
11852 Note that in the example neither
11853 .Ql pop3.example.com
11855 .Ql smtp.example.com
11856 will be matched by the wildcard, since the exact matches take
11857 precedence (it is however faster to specify it the other way around).
11858 .It Cd default
11859 This is the same as
11860 .Cd machine
11861 except that it is a fallback entry that is used shall none of the
11862 specified machines match; only one default token may be specified,
11863 and it must be the last first-class token.
11864 .It Cd login Ar name
11865 The user name on the remote machine.
11866 .It Cd password Ar string
11867 The user's password on the remote machine.
11868 .It Cd account Ar string
11869 Supply an additional account password.
11870 This is merely for FTP purposes.
11871 .It Cd macdef Ar name
11872 Define a macro.
11873 A macro is defined with the specified
11874 .Ar name ;
11875 it is formed from all lines beginning with the next line and continuing
11876 until a blank line is (consecutive newline characters are) encountered.
11877 (Note that
11878 .Cd macdef
11879 entries cannot be utilized by multiple machines, too, but must be
11880 defined following the
11881 .Ic machine
11882 they are intended to be used with.)
11883 If a macro named
11884 .Ar init
11885 exists, it is automatically run as the last step of the login process.
11886 This is merely for FTP purposes.
11888 .Sh EXAMPLES
11889 .Ss "An example configuration"
11890 .Bd -literal -offset indent
11891 # This example assumes v15.0 compatibility mode
11892 set v15-compat
11894 # Request strict transport security checks!
11895 set ssl-verify=strict
11897 # Where are the up-to-date SSL certificates?
11898 # (Since we manage up-to-date ones explicitly, do not use any,
11899 # possibly outdated, default certificates shipped with OpenSSL)
11900 #set ssl-ca-dir=/etc/ssl/certs
11901 set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
11902 set ssl-ca-no-defaults
11903 #set ssl-ca-flags=partial-chain
11904 wysh set smime-ca-file="${ssl-ca-file}" \e
11905   smime-ca-no-defaults #smime-ca-flags="${ssl-ca-flags}"
11907 # Do not use protocols older than TLS v1.2.
11908 # Change this only when the remote server does not support it:
11909 # maybe use ssl-protocol-HOST (or -USER@HOST) syntax to define
11910 # such explicit exceptions, then, e.g.
11911 #   set ssl-protocol-exam.ple='-ALL,+TLSv1.1'
11912 set ssl-protocol='-ALL,+TLSv1.2'
11914 # Explicitly define the list of ciphers, which may improve security,
11915 # especially with protocols older than TLS v1.2.  See ciphers(1).
11916 # Including "@STRENGTH" will sort the final list by algorithm strength.
11917 # In reality it is possibly best to only use ssl-cipher-list-HOST
11918 # (or -USER@HOST), as necessary, again..
11919 set ssl-cipher-list=TLSv1.2:!aNULL:!eNULL:@STRENGTH
11921 # - TLSv1.2:!aNULL:!eNULL:\e
11922 #     ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
11923 #     DHE-RSA-AES256-SHA:@STRENGTH
11924 # -ALL:!aNULL:!eNULL:!MEDIUM:!LOW:!MD5:!RC4:!EXPORT:@STRENGTH
11925 # Especially with TLSv1.3 curves selection may be desired:
11926 #set ssl-curves=P-521:P-384:P-256
11928 # Essential setting: select allowed character sets
11929 set sendcharsets=utf-8,iso-8859-1
11931 # A very kind option: when replying to a message, first try to
11932 # use the same encoding that the original poster used herself!
11933 set reply-in-same-charset
11935 # When replying, do not merge From: and To: of the original message
11936 # into To:.  Instead old From: -> new To:, old To: -> merge Cc:.
11937 set recipients-in-cc
11939 # When sending messages, wait until the Mail-Transfer-Agent finishs.
11940 # Only like this you will be able to see errors reported through the
11941 # exit status of the MTA (including the built-in SMTP one)!
11942 set sendwait
11944 # Only use built-in MIME types, no mime.types(5) files
11945 set mimetypes-load-control
11947 # Default directory where we act in (relative to $HOME)
11948 set folder=mail
11949 # A leading "+" (often) means: under *folder*
11950 # *record* is used to save copies of sent messages
11951 set MBOX=+mbox.mbox DEAD=+dead.txt \e
11952   record=+sent.mbox record-files record-resent
11954 # Make "file mymbox" and "file myrec" go to..
11955 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
11957 # Not really optional, e.g., for S/MIME
11958 set from='Your Name <address@exam.ple>'
11960 # It may be necessary to set hostname and/or smtp-hostname
11961 # if the "SERVER" of mta and "domain" of from do not match.
11962 # The `urlencode' command can be used to encode USER and PASS
11963 set mta=(smtps?|submission)://[USER[:PASS]@]SERVER[:PORT] \e
11964   smtp-auth=login/plain... \e
11965   smtp-use-starttls
11967 # Never refuse to start into interactive mode, and more
11968 set emptystart \e
11969   colour-pager crt= \e
11970   followup-to followup-to-honour=ask-yes \e
11971   history-file=+.\*(uAhist history-size=-1 history-gabby \e
11972   mime-counter-evidence=0xE \e
11973   prompt='?\e?!\e![\e${account}#\e${mailbox-display}]? ' \e
11974   reply-to-honour=ask-yes \e
11975   umask=
11977 # Only include the selected header fields when typing messages
11978 headerpick type retain from_ date from to cc subject \e
11979   message-id mail-followup-to reply-to
11980 # ...when forwarding messages
11981 headerpick forward retain subject date from to cc
11982 # ...when saving message, etc.
11983 #headerpick save ignore ^Original-.*$ ^X-.*$
11985 # Some mailing lists
11986 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
11987 mlsubscribe '^xfans@xfans\e.xyz$'
11989 # Handle a few file extensions (to store MBOX databases)
11990 filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
11991   gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
11992   zst 'zstd -dc' 'zstd -19 -zc' \e
11993   zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
11995 # A real life example of a very huge free mail provider
11996 # Instead of directly placing content inside `account',
11997 # we `define' a macro: like that we can switch "accounts"
11998 # from within *on-compose-splice*, for example!
11999 define XooglX {
12000   set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
12001   set from='Your Name <address@examp.ple>'
12002   set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
12004 account XooglX {
12005   \ecall XooglX
12008 # Here is a pretty large one which does not allow sending mails
12009 # if there is a domain name mismatch on the SMTP protocol level,
12010 # which would bite us if the value of from does not match, e.g.,
12011 # for people who have a sXXXXeforge project and want to speak
12012 # with the mailing list under their project account (in from),
12013 # still sending the message through their normal mail provider
12014 define XandeX {
12015   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
12016   set from='Your Name <address@exam.ple>'
12017   set mta=smtps://USER:PASS@smtp.yaXXex.ru:465 \e
12018     hostname=yaXXex.com smtp-hostname=
12020 account XandeX {
12021   \ecall Xandex
12024 # Create some new commands so that, e.g., `ls /tmp' will..
12025 commandalias lls '!ls ${LS_COLOR_FLAG} -aFlrS'
12026 commandalias llS '!ls ${LS_COLOR_FLAG} -aFlS'
12028 # We do not support gpg(1) directly yet.  But simple --clearsign'd
12029 # message parts can be dealt with as follows:
12030 define V {
12031   localopts yes
12032   wysh set pipe-text/plain=$'@*#++=@\e
12033     < "${MAILX_FILENAME_TEMPORARY}" awk \e
12034         -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
12035       BEGIN{done=0}\e
12036       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
12037         if(done++ != 0)\e
12038           next;\e
12039         print "--- GPG --verify ---";\e
12040         system("gpg --verify " TMPFILE " 2>&1");\e
12041         print "--- GPG --verify ---";\e
12042         print "";\e
12043         next;\e
12044       }\e
12045       /^-----BEGIN PGP SIGNATURE-----/,\e
12046           /^-----END PGP SIGNATURE-----/{\e
12047         next;\e
12048       }\e
12049       {print}\e
12050     \e''
12051     print
12053 commandalias V '\e'call V
12056 When storing passwords in
12057 .Pa \*(ur
12058 appropriate permissions should be set on this file with
12059 .Ql $ chmod 0600 \*(ur .
12060 If the \*(OPal
12061 .Va netrc-lookup
12062 is available user credentials can be stored in the central
12063 .Pa .netrc
12064 file instead; e.g., here is a different version of the example account
12065 that sets up SMTP and POP3:
12066 .Bd -literal -offset indent
12067 define XandeX {
12068   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
12069   set from='Your Name <address@exam.ple>'
12070   set netrc-lookup
12071   # Load an encrypted ~/.netrc by uncommenting the next line
12072   #set netrc-pipe='gpg -qd ~/.netrc.pgp'
12074   set mta=smtps://smtp.yXXXXx.ru:465 \e
12075       smtp-hostname= hostname=yXXXXx.com
12076   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
12077   commandalias xp fi pop3s://pop.yXXXXx.ru
12079 account XandeX {
12080   \ecall XandeX
12084 and, in the
12085 .Pa .netrc
12086 file:
12087 .Bd -literal -offset indent
12088 machine *.yXXXXx.ru login USER password PASS
12091 This configuration should now work just fine:
12093 .Dl $ echo text | \*(uA -dvv -AXandeX -s Subject user@exam.ple
12094 .Ss "S/MIME step by step"
12095 \*(OP The first thing you need for participating in S/MIME message
12096 exchange is your personal certificate, including a private key.
12097 The certificate contains public information, in particular your name and
12098 your email address(es), and the public key that is used by others to
12099 encrypt messages for you,
12100 and to verify signed messages they supposedly received from you.
12101 The certificate is included in each signed message you send.
12102 The private key must be kept secret.
12103 It is used to decrypt messages that were previously encrypted with your
12104 public key, and to sign messages.
12106 For personal use it is recommended that you get a S/MIME certificate
12107 from one of the major CAs on the Internet using your WWW browser.
12108 Many CAs offer such certificates for free.
12109 There is also
12110 .Lk https://www.CAcert.org
12111 which issues client and server certificates to members of their
12112 community for free; their root certificate
12113 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
12114 is often not in the default set of trusted CA root certificates, though,
12115 which means you will have to download their root certificate separately
12116 and ensure it is part of our S/MIME certificate validation chain by
12117 including it in
12118 .Va smime-ca-dir
12119 or as a vivid member of the
12120 .Va smime-ca-file .
12121 But let us take a step-by-step tour on how to setup S/MIME with
12122 a certificate from CAcert.org despite this situation!
12124 First of all you will have to become a member of the CAcert.org
12125 community, simply by registrating yourself via the web interface.
12126 Once you are, create and verify all email addresses you want to be able
12127 to create signed and encrypted messages for/with using the corresponding
12128 entries of the web interface.
12129 Now ready to create S/MIME certificates, so let us create a new
12130 .Dq client certificate ,
12131 ensure to include all email addresses that should be covered by the
12132 certificate in the following web form, and also to use your name as the
12133 .Dq common name .
12135 Create a private key and a certificate request on your local computer
12136 (please see the manual pages of the used commands for more in-depth
12137 knowledge on what the used arguments etc. do):
12139 .Dl $ openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
12141 Afterwards copy-and-paste the content of
12142 .Dq creq.pem
12143 into the certificate-request (CSR) field of the web form on the
12144 CAcert.org website (you may need to unfold some
12145 .Dq advanced options
12146 to see the corresponding text field).
12147 This last step will ensure that your private key (which never left your
12148 box) and the certificate belong together (through the public key that
12149 will find its way into the certificate via the certificate-request).
12150 You are now ready and can create your CAcert certified certificate.
12151 Download and store or copy-and-paste it as
12152 .Dq pub.crt .
12154 Yay.
12155 In order to use your new S/MIME setup a combined private key/public key
12156 (certificate) file has to be created:
12158 .Dl $ cat key.pem pub.crt > ME@HERE.com.paired
12160 This is the file \*(UA will work with.
12161 If you have created your private key with a passphrase then \*(UA will
12162 ask you for it whenever a message is signed or decrypted.
12163 Set the following variables to henceforth use S/MIME (setting
12164 .Va smime-ca-file
12165 is of interest for verification only):
12166 .Bd -literal -offset indent
12167 ? set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
12168     smime-sign-cert=ME@HERE.com.paired \e
12169     smime-sign-message-digest=SHA256 \e
12170     smime-sign
12172 .Ss "Using CRLs with S/MIME or SSL/TLS"
12173 \*(OP Certification authorities (CAs) issue certificate revocation
12174 lists (CRLs) on a regular basis.
12175 These lists contain the serial numbers of certificates that have been
12176 declared invalid after they have been issued.
12177 Such usually happens because the private key for the certificate has
12178 been compromised,
12179 because the owner of the certificate has left the organization that is
12180 mentioned in the certificate, etc.
12181 To seriously use S/MIME or SSL/TLS verification,
12182 an up-to-date CRL is required for each trusted CA.
12183 There is otherwise no method to distinguish between valid and
12184 invalidated certificates.
12185 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
12186 the Internet, so they have to be retrieved by some external mechanism.
12188 \*(UA accepts CRLs in PEM format only;
12189 CRLs in DER format must be converted, like, e.\|g.:
12191 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
12193 To tell \*(UA about the CRLs, a directory that contains all CRL files
12194 (and no other files) must be created.
12196 .Va smime-crl-dir
12198 .Va ssl-crl-dir
12199 variables, respectively, must then be set to point to that directory.
12200 After that, \*(UA requires a CRL to be present for each CA that is used
12201 to verify a certificate.
12202 .Sh "FAQ"
12203 In general it is a good idea to turn on
12204 .Va debug
12205 .Pf ( Fl d )
12206 and / or
12207 .Va verbose
12208 .Pf ( Fl v ,
12209 twice) if something does not work well.
12210 Very often a diagnostic message can be produced that leads to the
12211 problems' solution.
12212 .Ss "\*(UA shortly hangs on startup"
12213 This can have two reasons, one is the necessity to wait for a file lock
12214 and cannot be helped, the other being that \*(UA calls the function
12215 .Xr uname 2
12216 in order to query the nodename of the box (sometimes the real one is
12217 needed instead of the one represented by the internal variable
12218 .Va hostname ) .
12219 One may have varying success by ensuring that the real hostname and
12220 .Ql localhost
12221 have entries in
12222 .Pa /etc/hosts ,
12223 or, more generally, that the name service is properly setup \(en
12224 and does
12225 .Xr hostname 1
12226 return the expected value?
12227 Does this local hostname have a domain suffix?
12228 RFC 6762 standardized the link-local top-level domain
12229 .Ql .local ,
12230 try again after adding an (additional) entry with this extension.
12231 .Ss "I cannot login to Google mail aka GMail"
12232 Since 2014 some free service providers classify programs as
12233 .Dq less secure
12234 unless they use a special authentification method (OAuth 2.0) which
12235 was not standardized for non-HTTP protocol authentication token query
12236 until August 2015 (RFC 7628).
12238 Different to Kerberos / GSSAPI, which is developed since the mid of the
12239 1980s, where a user can easily create a local authentication ticket for
12240 her- and himself with the locally installed
12241 .Xr kinit 1
12242 program, that protocol has no such local part but instead requires
12243 a world-wide-web query to create or fetch a token; since there is no
12244 local cache this query would have to be performed whenever \*(UA is
12245 invoked (in interactive sessions situation may differ).
12247 \*(UA does not support OAuth.
12248 Because of this it is necessary to declare \*(UA a
12249 .Dq less secure app
12250 (on the providers account web page) in order to read and send mail.
12251 However, it also seems possible to take the following steps instead:
12253 .Bl -enum -compact
12255 give the provider the number of a mobile phone,
12257 enable
12258 .Dq 2-Step Verification ,
12260 create an application specific password (16 characters), and
12262 use that special password instead of the real Google account password in
12263 \*(UA (for more on that see the section
12264 .Sx "On URL syntax and credential lookup" ) .
12266 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
12267 It can happen that the terminal library (see
12268 .Sx "On terminal control and line editor",
12269 .Ic bind ,
12270 .Va termcap )
12271 reports different codes than the terminal really sends, in which case
12272 \*(UA will tell that a key binding is functional, but will not be able to
12273 recognize it because the received data does not match anything expected.
12274 Especially without the \*(OPal terminal capability library support one
12275 reason for this may be that the (possibly even non-existing) keypad
12276 is not turned on and the resulting layout reports the keypad control
12277 codes for the normal keyboard keys.
12279 .Va verbose
12280 listing of
12281 .Ic bind Ns
12282 ings will show the byte sequences that are expected.
12284 To overcome the situation, use, e.g., the program
12285 .Xr cat 1 ,
12286 in conjunction with the command line option
12287 .Fl \&\&v ,
12288 if available, to see the byte sequences which are actually produced
12289 by keypresses, and use the variable
12290 .Va termcap
12291 to make \*(UA aware of them.
12292 E.g., the terminal this is typed on produces some false sequences, here
12293 an example showing the shifted home key:
12294 .Bd -literal -offset indent
12295 ? set verbose
12296 ? bind*
12297 # 1B 5B=[ 31=1 3B=; 32=2 48=H
12298   bind base :kHOM z0
12299 ? x
12300 $ cat -v
12301 ^[[H
12302 ? \*(uA -v -Stermcap='kHOM=\eE[H'
12303 ? bind*
12304 # 1B 5B=[ 48=H
12305   bind base :kHOM z0
12307 .Sh "IMAP CLIENT"
12308 \*(OPally there is IMAP client support available.
12309 This part of the program is obsolete and will vanish in v15 with the
12310 large MIME and I/O layer rewrite, because it uses old-style blocking I/O
12311 and makes excessive use of signal based long code jumps.
12312 Support can hopefully be readded later based on a new-style I/O, with
12313 SysV signal handling.
12314 In fact the IMAP support had already been removed from the codebase, but
12315 was reinstantiated on user demand: in effect the IMAP code is at the
12316 level of \*(UA v14.8.16 (with
12317 .Ic imapcodec
12318 being the sole exception), and should be treated with some care.
12320 IMAP uses the
12321 .Ql imap://
12323 .Ql imaps://
12324 protocol prefixes, and an IMAP-based
12325 .Va folder
12326 may be used.
12327 IMAP URLs (paths) undergo inspections and possible transformations
12328 before use (and the command
12329 .Ic imapcodec
12330 can be used to manually apply them to any given argument).
12331 Hierarchy delimiters are normalized, a step which is configurable via the
12332 .Va imap-delim
12333 variable chain, but defaults to the first seen delimiter otherwise.
12334 \*(UA supports internationalised IMAP names, and en- and decodes the
12335 names from and to the
12336 .Va ttycharset
12337 as necessary and possible.
12338 If a mailbox name is expanded (see
12339 .Sx "Filename transformations" )
12340 to an IMAP mailbox, all names that begin with `+' then refer to IMAP
12341 mailboxes below the
12342 .Va folder
12343 target box, while folder names prefixed by `@' refer to folders below
12344 the hierarchy base.
12346 Note: some IMAP servers do not accept the creation of mailboxes in
12347 the hierarchy base, but require that they are created as subfolders of
12348 `INBOX' \(en with such servers a folder name of the form
12350 .Dl imaps://mylogin@imap.myisp.example/INBOX.
12352 should be used (the last character is the server's hierarchy
12353 delimiter).
12354 The following IMAP-specific commands exist:
12355 .Bl -tag -width ".It Ic BaNg"
12357 .It Ic cache
12358 Only applicable to cached IMAP mailboxes;
12359 takes a message list and reads the specified messages into the IMAP
12360 cache.
12362 .It Ic connect
12363 If operating in disconnected mode on an IMAP mailbox,
12364 switch to online mode and connect to the mail server while retaining
12365 the mailbox status.
12366 See the description of the
12367 .Va disconnected
12368 variable for more information.
12370 .It Ic disconnect
12371 If operating in online mode on an IMAP mailbox,
12372 switch to disconnected mode while retaining the mailbox status.
12373 See the description of the
12374 .Va disconnected
12375 variable for more.
12376 A list of messages may optionally be given as argument;
12377 the respective messages are then read into the cache before the
12378 connection is closed, thus
12379 .Ql disco *
12380 makes the entire mailbox available for disconnected use.
12382 .It Ic imap
12383 Sends command strings directly to the current IMAP server.
12384 \*(UA operates always in IMAP `selected state' on the current mailbox;
12385 commands that change this will produce undesirable results and should be
12386 avoided.
12387 Useful IMAP commands are:
12388 .Bl -tag -offset indent -width ".Ic getquotearoot"
12389 .It create
12390 Takes the name of an IMAP mailbox as an argument and creates it.
12391 .It getquotaroot
12392 (RFC 2087) Takes the name of an IMAP mailbox as an argument
12393 and prints the quotas that apply to the mailbox.
12394 Not all IMAP servers support this command.
12395 .It namespace
12396 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
12397 the Other User's Namespaces and the Shared Namespaces.
12398 Each namespace type is printed in parentheses;
12399 if there are multiple namespaces of the same type,
12400 inner parentheses separate them.
12401 For each namespace a prefix and a hierarchy separator is listed.
12402 Not all IMAP servers support this command.
12405 .It Ic imapcodec
12406 Perform IMAP path transformations.
12407 Supports
12408 .Cm vput
12409 (see
12410 .Sx "Command modifiers" ) ,
12411 and manages the error number
12412 .Va \&! .
12413 The first argument specifies the operation:
12414 .Ar e[ncode]
12415 normalizes hierarchy delimiters (see
12416 .Va imap-delim )
12417 and converts the strings from the locale
12418 .Va ttycharset
12419 to the internationalized variant used by IMAP,
12420 .Ar d[ecode]
12421 performs the reverse operation.
12424 The following IMAP-specific internal variables exist:
12425 .Bl -tag -width ".It Va BaNg"
12427 .It Va disconnected
12428 \*(BO When an IMAP mailbox is selected and this variable is set,
12429 no connection to the server is initiated.
12430 Instead, data is obtained from the local cache (see
12431 .Va imap-cache Ns
12433 Mailboxes that are not present in the cache
12434 and messages that have not yet entirely been fetched from the server
12435 are not available;
12436 to fetch all messages in a mailbox at once,
12437 the command
12438 .No ` Ns Li copy * /dev/null Ns '
12439 can be used while still in connected mode.
12440 Changes that are made to IMAP mailboxes in disconnected mode are queued
12441 and committed later when a connection to that server is made.
12442 This procedure is not completely reliable since it cannot be guaranteed
12443 that the IMAP unique identifiers (UIDs) on the server still match the
12444 ones in the cache at that time.
12445 Data is saved to
12446 .Ev DEAD
12447 when this problem occurs.
12448 .It Va disconnected-USER@HOST
12449 The specified account is handled as described for the
12450 .Va disconnected
12451 variable above,
12452 but other accounts are not affected.
12453 .Mx Va imap-auth
12454 .It Va imap-auth-USER@HOST , imap-auth
12455 Sets the IMAP authentication method.
12456 Valid values are `login' for the usual password-based authentication
12457 (the default),
12458 `cram-md5', which is a password-based authentication that does not send
12459 the password over the network in clear text,
12460 and `gssapi' for GSS-API based authentication.
12462 .It Va imap-cache
12463 Enables caching of IMAP mailboxes.
12464 The value of this variable must point to a directory that is either
12465 existent or can be created by \*(UA.
12466 All contents of the cache can be deleted by \*(UA at any time;
12467 it is not safe to make assumptions about them.
12468 .Mx Va imap-delim
12469 .It Va imap-delim-USER@HOST , imap-delim-HOST , imap-delim
12470 The hierarchy separator used by the IMAP server.
12471 Whenever an IMAP path is specified it will undergo normalization.
12472 One of the normalization steps is the squeezing and adjustment of
12473 hierarchy separators.
12474 If this variable is set, any occurrence of any character of the given
12475 value that exists in the path will be replaced by the first member of
12476 the value; an empty value will cause the default to be used, it is
12477 .Ql /. .
12478 If not set, we will reuse the first hierarchy separator character that
12479 is discovered in a user-given mailbox name.
12480 .Mx Va imap-keepalive
12481 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
12482 IMAP servers may close the connection after a period of
12483 inactivity; the standard requires this to be at least 30 minutes,
12484 but practical experience may vary.
12485 Setting this variable to a numeric `value' greater than 0 causes
12486 a `NOOP' command to be sent each `value' seconds if no other operation
12487 is performed.
12489 .It Va imap-list-depth
12490 When retrieving the list of folders on an IMAP server, the
12491 .Ic folders
12492 command stops after it has reached a certain depth to avoid possible
12493 infinite loops.
12494 The value of this variable sets the maximum depth allowed.
12495 The default is 2.
12496 If the folder separator on the current IMAP server is a slash `/',
12497 this variable has no effect and the
12498 .Ic folders
12499 command does not descend to subfolders.
12500 .Mx Va imap-use-starttls
12501 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
12502 Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
12503 IMAP session SSL/TLS encrypted.
12504 This functionality is not supported by all servers,
12505 and is not used if the session is already encrypted by the IMAPS method.
12507 .Sh "SEE ALSO"
12508 .Xr bogofilter 1 ,
12509 .Xr gpg 1 ,
12510 .Xr more 1 ,
12511 .Xr newaliases 1 ,
12512 .Xr openssl 1 ,
12513 .Xr sendmail 1 ,
12514 .Xr sh 1 ,
12515 .Xr spamassassin 1 ,
12516 .Xr iconv 3 ,
12517 .Xr setlocale 3 ,
12518 .Xr aliases 5 ,
12519 .Xr termcap 5 ,
12520 .Xr terminfo 5 ,
12521 .Xr locale 7 ,
12522 .Xr mailaddr 7 ,
12523 .Xr re_format 7 ,
12524 .Xr mailwrapper 8 ,
12525 .Xr sendmail 8
12526 .Sh HISTORY
12527 M. Douglas McIlroy writes in his article
12528 .Dq A Research UNIX Reader: Annotated Excerpts \
12529 from the Programmer's Manual, 1971-1986
12530 that a
12531 .Xr mail 1
12532 command already appeared in First Edition
12534 in 1971:
12535 .Bd -ragged -offset indent
12536 Electronic mail was there from the start.
12537 Never satisfied with its exact behavior, everybody touched it at one
12538 time or another: to assure the safety of simultaneous access, to improve
12539 privacy, to survive crashes, to exploit uucp, to screen out foreign
12540 freeloaders, or whatever.
12541 Not until v7 did the interface change (Thompson).
12542 Later, as mail became global in its reach, Dave Presotto took charge and
12543 brought order to communications with a grab-bag of external networks
12544 (v8).
12548 Mail was written in 1978 by Kurt Shoens and developed as part of the
12551 distribution until 1995.
12552 Mail has then seen further development in open source
12554 variants, noticeably by Christos Zoulas in
12555 .Pf Net Bx .
12556 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
12557 Ritter in the years 2000 until 2008.
12558 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
12559 This man page is derived from
12560 .Dq The Mail Reference Manual
12561 that was originally written by Kurt Shoens.
12562 .Sh AUTHORS
12563 .An "Kurt Shoens" ,
12564 .An "Edward Wang" ,
12565 .An "Keith Bostic" ,
12566 .An "Christos Zoulas" ,
12567 .An "Gunnar Ritter" ,
12568 .An "Steffen Nurpmeso" .
12570 The variables
12571 .Va contact-mail
12573 .Va contact-web
12574 provide contact addresses:
12576 .Dl ? echo $contact-web; eval mail $contact-mail
12577 .Sh CAVEATS
12578 \*(ID Interrupting an operation via
12579 .Dv \&\&SIGINT
12581 .Ql control-C
12582 from anywhere else but a command prompt is very problematic and likely
12583 to leave the program in an undefined state: many library functions
12584 cannot deal with the
12585 .Fn siglongjmp 3
12586 that this software (still) performs; even though efforts have been taken
12587 to address this, no sooner but in v15 it will have been worked out:
12588 interruptions have not been disabled in order to allow forceful breakage
12589 of hanging network connections, for example (all this is unrelated to
12590 .Va ignore ) .
12592 The SMTP and POP3 protocol support of \*(UA is very basic.
12593 Also, if it fails to contact its upstream SMTP server, it will not make
12594 further attempts to transfer the message at a later time (setting
12595 .Va save
12597 .Va sendwait
12598 may be useful).
12599 If this is a concern, it might be better to set up a local SMTP server
12600 that is capable of message queuing.
12601 .Sh BUGS
12602 After deleting some message of a POP3 mailbox the header summary falsely
12603 claims that there are no messages to display, one needs to perform
12604 a scroll or dot movement to restore proper state.
12605 In threaded display a power user may encounter crashes very
12606 occasionally (this is may and very).
12607 The file
12608 .Pa TODO
12609 in the source repository lists future directions.