Bump S-nail v14.9.24.ar ("Black ships ate the sky"), 2022-03-26
[s-mailx.git] / nail.1
blobb4056661d96a487d851da8fb79bf7e02dcf9ec32
1 .\"@ nail.1 - S-nail(1) reference manual.
2 .\"
3 .\" Copyright (c) 2012 - 2020 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
4 .\" SPDX-License-Identifier: ISC
5 .\"
6 .\" Permission to use, copy, modify, and/or distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
9 .\"
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .\"
18 .\"@ S-nail v14.9.24 / 2022-03-26
19 .Dd March 26, 2022
20 .ds VV \\%v14.9.24
21 .\"--MKMAN-START--
22 .ds UU \\%S-NAIL
23 .ds UA \\%S-nail
24 .ds uA \\%s-nail
25 .ds UR \\%s-nail.rc
26 .ds ur \\%~/.mailrc
27 .ds VD \\%~/dead.letter
28 .ds VM \\%~/mbox
29 .ds VN \\%~/.netrc
30 .ds VT \\%/tmp
31 .ds vS /etc/mime.types
32 .ds vU ~/.mime.types
33 .\"--MKMAN-END--
34 .ds BO (Boolean)
35 .ds CM (Compose mode)
36 .ds ID [v15 behaviour may differ]
37 .ds IN [v15-compat]
38 .ds NQ [Only new quoting rules]
39 .ds OB [Obsolete]
40 .ds OP [Option]
41 .ds OU [no v15-compat]
42 .ds RO (Read-only)
43 .ds SM (Send mode)
44 .if !d str-Lb-libterminfo \
45   .ds str-Lb-libterminfo Terminal Information Library (libterminfo, \-lterminfo)
46 .Dt "\*(UU" 1
47 .Os
48 .\" Uncomment for mandoc(1) compat.:
49 .\".ds mx-toc-name TABLE OF CONTENTS
50 .Mx -enable -preprocessed
51 .Mx -anchor-spass Sh "NAME" 1
52 .Mx -anchor-spass Sh "SYNOPSIS" 2
53 .Mx -anchor-spass Sh "\*[mx-toc-name]" 3
54 .Mx -anchor-spass Sh "DESCRIPTION" 4
55 .Mx -anchor-spass Ss "Options" 4
56 .Mx -anchor-spass Ss "A starter" 4
57 .Mx -anchor-spass Ss "On sending mail, and non-interactive mode" 4
58 .Mx -anchor-spass Ss "Compose mode" 4
59 .Mx -anchor-spass Ss "On reading mail, and more on interactive mode" 4
60 .Mx -anchor-spass Ss "HTML mail and MIME attachments" 4
61 .Mx -anchor-spass Ss "Mailing lists" 4
62 .Mx -anchor-spass Ss "Signed and encrypted messages with S/MIME" 4
63 .Mx -anchor-spass Ss "On URL syntax and credential lookup" 4
64 .Mx -anchor-spass Ss "Encrypted network communication" 4
65 .Mx -anchor-spass Ss "Character sets" 4
66 .Mx -anchor-spass Ss "Message states" 4
67 .Mx -anchor-spass Ss "Specifying messages" 4
68 .Mx -anchor-spass Ss "On terminal control and line editor" 4
69 .Mx -anchor-spass Ss "Coloured display" 4
70 .Mx -anchor-spass Ss "Handling spam" 4
71 .Mx -anchor-spass Sh "COMMANDS" 5
72 .Mx -anchor-spass Ss "Command modifiers" 5
73 .Mx -anchor-spass Ss "Old-style argument quoting" 5
74 .Mx -anchor-spass Ss "Shell-style argument quoting" 5
75 .Mx -anchor-spass Ss "Message list arguments" 5
76 .Mx -anchor-spass Ss "Raw data arguments for codec commands" 5
77 .Mx -anchor-spass Ss "Filename transformations" 5
78 .Mx -anchor-spass Ss "Commands" 5
79 .Mx -anchor-spass Sh "COMMAND ESCAPES" 6
80 .Mx -anchor-spass Sh "INTERNAL VARIABLES" 7
81 .Mx -anchor-spass Ss "Initial settings" 7
82 .Mx -anchor-spass Ss "Variables" 7
83 .Mx -anchor-spass Sh "ENVIRONMENT" 8
84 .Mx -anchor-spass Sh "FILES" 9
85 .Mx -anchor-spass Ss "Resource files" 9
86 .Mx -anchor-spass Ss "The mime.types files" 9
87 .Mx -anchor-spass Ss "The Mailcap files" 9
88 .Mx -anchor-spass Ss "The .netrc file" 9
89 .Mx -anchor-spass Sh "EXAMPLES" 10
90 .Mx -anchor-spass Ss "An example configuration" 10
91 .Mx -anchor-spass Ss "S/MIME step by step" 10
92 .Mx -anchor-spass Ss "Using CRLs with S/MIME or TLS" 10
93 .Mx -anchor-spass Sh "FAQ" 11
94 .Mx -anchor-spass Ss "\*(UA shortly hangs on startup" 11
95 .Mx -anchor-spass Ss "I cannot login to Google mail \&(via OAuth\&)" 11
96 .Mx -anchor-spass Ss "But, how about XOAUTH2 / OAUTHBEARER?" 11
97 .Mx -anchor-spass Ss "Not \(dqdefunctional\(dq, but the editor key does not work" 11
98 .Mx -anchor-spass Ss "Can \*(UA git-send-email?" 11
99 .Mx -anchor-spass Ss "Howto handle stale dotlock files" 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 "c"
113 .Mx -anchor-spass Fl "D"
114 .Mx -anchor-spass Fl "d"
115 .Mx -anchor-spass Fl "E"
116 .Mx -anchor-spass Fl "e"
117 .Mx -anchor-spass Fl "F"
118 .Mx -anchor-spass Fl "f"
119 .Mx -anchor-spass Fl "H"
120 .Mx -anchor-spass Fl "h"
121 .Mx -anchor-spass Fl "i"
122 .Mx -anchor-spass Fl "L"
123 .Mx -anchor-spass Fl "M"
124 .Mx -anchor-spass Fl "m"
125 .Mx -anchor-spass Fl "N"
126 .Mx -anchor-spass Fl "n"
127 .Mx -anchor-spass Fl "q"
128 .Mx -anchor-spass Fl "R"
129 .Mx -anchor-spass Fl "r"
130 .Mx -anchor-spass Fl "S"
131 .Mx -anchor-spass Fl "s"
132 .Mx -anchor-spass Fl "T"
133 .Mx -anchor-spass Fl "t"
134 .Mx -anchor-spass Fl "u"
135 .Mx -anchor-spass Fl "V"
136 .Mx -anchor-spass Fl "v"
137 .Mx -anchor-spass Fl "X"
138 .Mx -anchor-spass Fl "Y"
139 .Mx -anchor-spass Fl "~"
140 .Mx -anchor-spass Fl "#"
141 .Mx -anchor-spass Fl "."
142 .Mx -anchor-spass ixsx "magic regular expression characters"
143 .Mx -anchor-spass Cd "mle-go-home"
144 .Mx -anchor-spass Cd "mle-go-bwd"
145 .Mx -anchor-spass Cd "mle-raise-int"
146 .Mx -anchor-spass Cd "mle-del-fwd"
147 .Mx -anchor-spass Cd "mle-go-end"
148 .Mx -anchor-spass Cd "mle-go-fwd"
149 .Mx -anchor-spass Cd "mle-reset"
150 .Mx -anchor-spass Cd "mle-del-bwd"
151 .Mx -anchor-spass Cd "mle-complete"
152 .Mx -anchor-spass Cd "mle-commit"
153 .Mx -anchor-spass Cd "mle-snarf-end"
154 .Mx -anchor-spass Cd "mle-repaint"
155 .Mx -anchor-spass Cd "mle-hist-fwd"
156 .Mx -anchor-spass Cd "mle-hist-bwd"
157 .Mx -anchor-spass Cd "mle-quote-rndtrip"
158 .Mx -anchor-spass Cd "mle-hist-srch-bwd"
159 .Mx -anchor-spass Cd "mle-hist-srch-fwd"
160 .Mx -anchor-spass Cd "mle-paste"
161 .Mx -anchor-spass Cd "mle-snarf-line"
162 .Mx -anchor-spass Cd "mle-prompt-char"
163 .Mx -anchor-spass Cd "mle-snarf-word-bwd"
164 .Mx -anchor-spass Cd "mle-go-word-fwd"
165 .Mx -anchor-spass Cd "mle-go-word-bwd"
166 .Mx -anchor-spass Cd "mle-raise-tstp"
167 .Mx -anchor-spass Cd "mle-cancel"
168 .Mx -anchor-spass Cd "mle-snarf-word-fwd"
169 .Mx -anchor-spass Cd "mle-bell"
170 .Mx -anchor-spass Cd "mle-clear-screen"
171 .Mx -anchor-spass Cd "mle-fullreset"
172 .Mx -anchor-spass Cd "mle-go-screen-bwd"
173 .Mx -anchor-spass Cd "mle-go-screen-fwd"
174 .Mx -anchor-spass Cd "mle-raise-quit:"
175 .Mx -anchor-spass Cm "\e"
176 .Mx -anchor-spass Cm "ignerr"
177 .Mx -anchor-spass Cm "local"
178 .Mx -anchor-spass Cm "scope"
179 .Mx -anchor-spass Cm "u"
180 .Mx -anchor-spass Cm "vput"
181 .Mx -anchor-spass Cm "wysh"
182 .Mx -anchor-spass ixsx "primary system mailbox"
183 .Mx -anchor-spass ixsx "secondary mailbox"
184 .Mx -anchor-spass Ic "!"
185 .Mx -anchor-spass Ic "#"
186 .Mx -anchor-spass Ic "+"
187 .Mx -anchor-spass Ic "-"
188 .Mx -anchor-spass Ic "="
189 .Mx -anchor-spass Ic "?"
190 .Mx -anchor-spass Ic "|"
191 .Mx -anchor-spass Ic "account"
192 .Mx -anchor-spass Ic "unaccount"
193 .Mx -anchor-spass Ic "addrcodec"
194 .Mx -anchor-spass Ic "alias"
195 .Mx -anchor-spass Ic "unalias"
196 .Mx -anchor-spass Ic "alternates"
197 .Mx -anchor-spass Ic "unalternates"
198 .Mx -anchor-spass Ic "answered"
199 .Mx -anchor-spass Ic "unanswered"
200 .Mx -anchor-spass Ic "bind"
201 .Mx -anchor-spass Ic "unbind"
202 .Mx -anchor-spass Ic "call"
203 .Mx -anchor-spass Ic "call_if"
204 .Mx -anchor-spass Ic "cd"
205 .Mx -anchor-spass Ic "certsave"
206 .Mx -anchor-spass Ic "charsetalias"
207 .Mx -anchor-spass Ic "uncharsetalias"
208 .Mx -anchor-spass Ic "chdir"
209 .Mx -anchor-spass Ic "collapse"
210 .Mx -anchor-spass Ic "uncollapse"
211 .Mx -anchor-spass Ic "colour"
212 .Mx -anchor-spass Ic "uncolour"
213 .Mx -anchor-spass Ic "commandalias"
214 .Mx -anchor-spass Ic "uncommandalias"
215 .Mx -anchor-spass Ic "Copy"
216 .Mx -anchor-spass Ic "copy"
217 .Mx -anchor-spass Ic "csop"
218 .Mx -anchor-spass Ic "cwd"
219 .Mx -anchor-spass Ic "Decrypt"
220 .Mx -anchor-spass Ic "decrypt"
221 .Mx -anchor-spass Ic "define"
222 .Mx -anchor-spass Ic "undefine"
223 .Mx -anchor-spass Ic "delete"
224 .Mx -anchor-spass Ic "undelete"
225 .Mx -anchor-spass Ic "digmsg"
226 .Mx -anchor-spass Ic "discard"
227 .Mx -anchor-spass Ic "dp"
228 .Mx -anchor-spass Ic "dt"
229 .Mx -anchor-spass Ic "dotmove"
230 .Mx -anchor-spass Ic "draft"
231 .Mx -anchor-spass Ic "undraft"
232 .Mx -anchor-spass Ic "echo"
233 .Mx -anchor-spass Ic "echoerr"
234 .Mx -anchor-spass Ic "echon"
235 .Mx -anchor-spass Ic "echoerrn"
236 .Mx -anchor-spass Ic "edit"
237 .Mx -anchor-spass Ic "elif"
238 .Mx -anchor-spass Ic "else"
239 .Mx -anchor-spass Ic "endif"
240 .Mx -anchor-spass Ic "environ"
241 .Mx -anchor-spass Ic "errors"
242 .Mx -anchor-spass Ic "eval"
243 .Mx -anchor-spass Ic "exit"
244 .Mx -anchor-spass Ic "File"
245 .Mx -anchor-spass Ic "file"
246 .Mx -anchor-spass Ic "filetype"
247 .Mx -anchor-spass Ic "unfiletype"
248 .Mx -anchor-spass Ic "flag"
249 .Mx -anchor-spass Ic "unflag"
250 .Mx -anchor-spass Ic "Folder"
251 .Mx -anchor-spass Ic "folder"
252 .Mx -anchor-spass ixsx "dotlock files"
253 .Mx -anchor-spass Ic "folders"
254 .Mx -anchor-spass Ic "Followup"
255 .Mx -anchor-spass Ic "followup"
256 .Mx -anchor-spass Ic "Forward"
257 .Mx -anchor-spass Ic "forward"
258 .Mx -anchor-spass Ic "from"
259 .Mx -anchor-spass Ic "headerpick"
260 .Mx -anchor-spass Ic "unheaderpick"
261 .Mx -anchor-spass Ic "headers"
262 .Mx -anchor-spass Ic "help"
263 .Mx -anchor-spass Ic "history"
264 .Mx -anchor-spass Ic "hold"
265 .Mx -anchor-spass Ic "if"
266 .Mx -anchor-spass Ic "ignore"
267 .Mx -anchor-spass Ic "list"
268 .Mx -anchor-spass Ic "localopts"
269 .Mx -anchor-spass Ic "Lfollowup"
270 .Mx -anchor-spass Ic "Lreply"
271 .Mx -anchor-spass Ic "Mail"
272 .Mx -anchor-spass Ic "mail"
273 .Mx -anchor-spass Ic "mailcap"
274 .Mx -anchor-spass Ic "mbox"
275 .Mx -anchor-spass Ic "mimetype"
276 .Mx -anchor-spass Ic "unmimetype"
277 .Mx -anchor-spass Ic "mimeview"
278 .Mx -anchor-spass Ic "mlist"
279 .Mx -anchor-spass Ic "unmlist"
280 .Mx -anchor-spass Ic "mlsubscribe"
281 .Mx -anchor-spass Ic "unmlsubscribe"
282 .Mx -anchor-spass Ic "Move"
283 .Mx -anchor-spass Ic "move"
284 .Mx -anchor-spass Ic "More"
285 .Mx -anchor-spass Ic "more"
286 .Mx -anchor-spass Ic "mtaaliases"
287 .Mx -anchor-spass Ic "netrc"
288 .Mx -anchor-spass Ic "newmail"
289 .Mx -anchor-spass Ic "next"
290 .Mx -anchor-spass Ic "New"
291 .Mx -anchor-spass Ic "new"
292 .Mx -anchor-spass Ic "noop"
293 .Mx -anchor-spass Ic "Page"
294 .Mx -anchor-spass Ic "page"
295 .Mx -anchor-spass Ic "Pipe"
296 .Mx -anchor-spass Ic "pipe"
297 .Mx -anchor-spass Ic "preserve"
298 .Mx -anchor-spass Ic "Print"
299 .Mx -anchor-spass Ic "print"
300 .Mx -anchor-spass Ic "quit"
301 .Mx -anchor-spass Ic "read"
302 .Mx -anchor-spass Ic "readsh"
303 .Mx -anchor-spass Ic "readall"
304 .Mx -anchor-spass Ic "readctl"
305 .Mx -anchor-spass Ic "remove"
306 .Mx -anchor-spass Ic "rename"
307 .Mx -anchor-spass Ic "Reply"
308 .Mx -anchor-spass Ic "Respond"
309 .Mx -anchor-spass Ic "reply"
310 .Mx -anchor-spass Ic "respond"
311 .Mx -anchor-spass Ic "Resend"
312 .Mx -anchor-spass Ic "resend"
313 .Mx -anchor-spass Ic "retain"
314 .Mx -anchor-spass Ic "return"
315 .Mx -anchor-spass Ic "Save"
316 .Mx -anchor-spass Ic "save"
317 .Mx -anchor-spass Ic "search"
318 .Mx -anchor-spass Ic "seen"
319 .Mx -anchor-spass Ic "set"
320 .Mx -anchor-spass Ic "unset"
321 .Mx -anchor-spass Ic "shcodec"
322 .Mx -anchor-spass Ic "shell"
323 .Mx -anchor-spass Ic "shortcut"
324 .Mx -anchor-spass Ic "unshortcut"
325 .Mx -anchor-spass Ic "shift"
326 .Mx -anchor-spass Ic "show"
327 .Mx -anchor-spass Ic "size"
328 .Mx -anchor-spass Ic "sleep"
329 .Mx -anchor-spass Ic "sort"
330 .Mx -anchor-spass Ic "unsort"
331 .Mx -anchor-spass Ic "source"
332 .Mx -anchor-spass Ic "source_if"
333 .Mx -anchor-spass Ic "spamclear"
334 .Mx -anchor-spass Ic "spamforget"
335 .Mx -anchor-spass Ic "spamham"
336 .Mx -anchor-spass Ic "spamrate"
337 .Mx -anchor-spass Ic "spamset"
338 .Mx -anchor-spass Ic "spamspam"
339 .Mx -anchor-spass Ic "tls"
340 .Mx -anchor-spass Ic "Top"
341 .Mx -anchor-spass Ic "top"
342 .Mx -anchor-spass Ic "touch"
343 .Mx -anchor-spass Ic "Type"
344 .Mx -anchor-spass Ic "type"
345 .Mx -anchor-spass Ic "unignore"
346 .Mx -anchor-spass Ic "Unread"
347 .Mx -anchor-spass Ic "unread"
348 .Mx -anchor-spass Ic "unretain"
349 .Mx -anchor-spass Ic "urlcodec"
350 .Mx -anchor-spass Ic "varshow"
351 .Mx -anchor-spass Ic "verify"
352 .Mx -anchor-spass Ic "version"
353 .Mx -anchor-spass Ic "vexpr"
354 .Mx -anchor-spass Ic "vpospar"
355 .Mx -anchor-spass Ic "visual"
356 .Mx -anchor-spass Ic "write"
357 .Mx -anchor-spass Ic "xcall"
358 .Mx -anchor-spass Ic "xit"
359 .Mx -anchor-spass Ic "z"
360 .Mx -anchor-spass Ic "Z"
361 .Mx -anchor-spass Ic "~~"
362 .Mx -anchor-spass Ic "~!"
363 .Mx -anchor-spass Ic "~."
364 .Mx -anchor-spass Ic "~:"
365 .Mx -anchor-spass Ic "~<"
366 .Mx -anchor-spass Ic "~<!"
367 .Mx -anchor-spass Ic "~?"
368 .Mx -anchor-spass Ic "~@"
369 .Mx -anchor-spass Ic "~|"
370 .Mx -anchor-spass Ic "~^"
371 .Mx -anchor-spass Ic "~A"
372 .Mx -anchor-spass Ic "~a"
373 .Mx -anchor-spass Ic "~b"
374 .Mx -anchor-spass Ic "~c"
375 .Mx -anchor-spass Ic "~d"
376 .Mx -anchor-spass Ic "~e"
377 .Mx -anchor-spass Ic "~F"
378 .Mx -anchor-spass Ic "~f"
379 .Mx -anchor-spass Ic "~H"
380 .Mx -anchor-spass Ic "~h"
381 .Mx -anchor-spass Ic "~I"
382 .Mx -anchor-spass Ic "~i"
383 .Mx -anchor-spass Ic "~M"
384 .Mx -anchor-spass Ic "~m"
385 .Mx -anchor-spass Ic "~p"
386 .Mx -anchor-spass Ic "~Q"
387 .Mx -anchor-spass Ic "~q"
388 .Mx -anchor-spass Ic "~R"
389 .Mx -anchor-spass Ic "~r"
390 .Mx -anchor-spass Ic "~s"
391 .Mx -anchor-spass Ic "~t"
392 .Mx -anchor-spass Ic "~U"
393 .Mx -anchor-spass Ic "~u"
394 .Mx -anchor-spass Ic "~v"
395 .Mx -anchor-spass Ic "~w"
396 .Mx -anchor-spass Ic "~x"
397 .Mx -anchor-spass ixsx "quadoption"
398 .Mx -anchor-spass Va "?"
399 .Mx -anchor-spass Va "!"
400 .Mx -anchor-spass Va "^"
401 .Mx -anchor-spass Va "^ERR"
402 .Mx -anchor-spass Va "^ERRDOC"
403 .Mx -anchor-spass Va "^ERRNAME"
404 .Mx -anchor-spass Va "^ERRQUEUE-COUNT"
405 .Mx -anchor-spass Va "^ERRQUEUE-EXISTS"
406 .Mx -anchor-spass Va "*"
407 .Mx -anchor-spass Va "@"
408 .Mx -anchor-spass Va "#"
409 .Mx -anchor-spass Va "0"
410 .Mx -anchor-spass Va "1"
411 .Mx -anchor-spass Va "account"
412 .Mx -anchor-spass Va "add-file-recipients"
413 .Mx -anchor-spass Va "allnet"
414 .Mx -anchor-spass Va "append"
415 .Mx -anchor-spass Va "askatend"
416 .Mx -anchor-spass Va "askattach"
417 .Mx -anchor-spass Va "askcc"
418 .Mx -anchor-spass Va "askbcc"
419 .Mx -anchor-spass Va "asksend"
420 .Mx -anchor-spass Va "asksign"
421 .Mx -anchor-spass Va "asksub"
422 .Mx -anchor-spass Va "attrlist"
423 .Mx -anchor-spass Va "autobcc"
424 .Mx -anchor-spass Va "autocc"
425 .Mx -anchor-spass Va "autocollapse"
426 .Mx -anchor-spass Va "autoprint"
427 .Mx -anchor-spass Va "autosort"
428 .Mx -anchor-spass Va "bang"
429 .Mx -anchor-spass Va "bind-timeout"
430 .Mx -anchor-spass Va "bind-inter-byte-timeout"
431 .Mx -anchor-spass Va "bind-inter-key-timeout"
432 .Mx -anchor-spass Va "bsdcompat"
433 .Mx -anchor-spass Va "bsdflags"
434 .Mx -anchor-spass Va "bsdheadline"
435 .Mx -anchor-spass Va "bsdmsgs"
436 .Mx -anchor-spass Va "bsdorder"
437 .Mx -anchor-spass Va "build-cc"
438 .Mx -anchor-spass Va "build-ld"
439 .Mx -anchor-spass Va "build-os"
440 .Mx -anchor-spass Va "build-rest"
441 .Mx -anchor-spass Va "charset-7bit"
442 .Mx -anchor-spass Va "charset-8bit"
443 .Mx -anchor-spass Va "charset-unknown-8bit"
444 .Mx -anchor-spass Va "cmd"
445 .Mx -anchor-spass Va "colour-disable"
446 .Mx -anchor-spass Va "colour-pager"
447 .Mx -anchor-spass Va "contact-mail"
448 .Mx -anchor-spass Va "contact-web"
449 .Mx -anchor-spass Va "content-description-forwarded-message"
450 .Mx -anchor-spass Va "content-description-quote-attachment"
451 .Mx -anchor-spass Va "content-description-smime-message"
452 .Mx -anchor-spass Va "content-description-smime-signature"
453 .Mx -anchor-spass Va "crt"
454 .Mx -anchor-spass Va "customhdr"
455 .Mx -anchor-spass Va "datefield"
456 .Mx -anchor-spass Va "datefield-markout-older"
457 .Mx -anchor-spass Va "debug"
458 .Mx -anchor-spass Va "disposition-notification-send"
459 .Mx -anchor-spass Va "dot"
460 .Mx -anchor-spass Va "dotlock-disable"
461 .Mx -anchor-spass Va "editalong"
462 .Mx -anchor-spass Va "editheaders"
463 .Mx -anchor-spass Va "emptystart"
464 .Mx -anchor-spass Va "errexit"
465 .Mx -anchor-spass Va "errors-limit"
466 .Mx -anchor-spass Va "escape"
467 .Mx -anchor-spass Va "expandaddr"
468 .Mx -anchor-spass Va "expandaddr-domaincheck"
469 .Mx -anchor-spass Va "expandargv"
470 .Mx -anchor-spass Va "features"
471 .Mx -anchor-spass Va "flipr"
472 .Mx -anchor-spass Va "folder"
473 .Mx -anchor-spass Va "folder-hook"
474 .Mx -anchor-spass Va "folder-resolved"
475 .Mx -anchor-spass Va "followup-to"
476 .Mx -anchor-spass Va "followup-to-add-cc"
477 .Mx -anchor-spass Va "followup-to-honour"
478 .Mx -anchor-spass Va "forward-add-cc"
479 .Mx -anchor-spass Va "forward-as-attachment"
480 .Mx -anchor-spass Va "forward-inject-head"
481 .Mx -anchor-spass Va "forward-inject-tail"
482 .Mx -anchor-spass Va "from"
483 .Mx -anchor-spass Va "fullnames"
484 .Mx -anchor-spass Va "header"
485 .Mx -anchor-spass Va "headline"
486 .Mx -anchor-spass Va "headline-bidi"
487 .Mx -anchor-spass Va "headline-plain"
488 .Mx -anchor-spass Va "history-file"
489 .Mx -anchor-spass Va "history-gabby"
490 .Mx -anchor-spass Va "history-gabby-persist"
491 .Mx -anchor-spass Va "history-size"
492 .Mx -anchor-spass Va "hold"
493 .Mx -anchor-spass Va "hostname"
494 .Mx -anchor-spass Va "idna-disable"
495 .Mx -anchor-spass Va "ifs"
496 .Mx -anchor-spass Va "ifs-ws"
497 .Mx -anchor-spass Va "ignore"
498 .Mx -anchor-spass Va "ignoreeof"
499 .Mx -anchor-spass Va "inbox"
500 .Mx -anchor-spass Va "indentprefix"
501 .Mx -anchor-spass Va "keep"
502 .Mx -anchor-spass Va "keep-content-length"
503 .Mx -anchor-spass Va "keepsave"
504 .Mx -anchor-spass Va "line-editor-cpl-word-breaks"
505 .Mx -anchor-spass Va "line-editor-disable"
506 .Mx -anchor-spass Va "line-editor-no-defaults"
507 .Mx -anchor-spass Va "log-prefix"
508 .Mx -anchor-spass Va "mailbox-display"
509 .Mx -anchor-spass Va "mailbox-resolved"
510 .Mx -anchor-spass Va "mailcap-disable"
511 .Mx -anchor-spass Va "mailx-extra-rc"
512 .Mx -anchor-spass Va "markanswered"
513 .Mx -anchor-spass Va "mbox-fcc-and-pcc"
514 .Mx -anchor-spass Va "mbox-rfc4155"
515 .Mx -anchor-spass Va "memdebug"
516 .Mx -anchor-spass Va "message-id-disable"
517 .Mx -anchor-spass Va "message-inject-head"
518 .Mx -anchor-spass Va "message-inject-tail"
519 .Mx -anchor-spass Va "metoo"
520 .Mx -anchor-spass Va "mime-allow-text-controls"
521 .Mx -anchor-spass Va "mime-alternative-favour-rich"
522 .Mx -anchor-spass Va "mime-counter-evidence"
523 .Mx -anchor-spass Va "mime-encoding"
524 .Mx -anchor-spass Va "mime-force-sendout"
525 .Mx -anchor-spass Va "mimetypes-load-control"
526 .Mx -anchor-spass Va "mta"
527 .Mx -anchor-spass Va "mta-aliases"
528 .Mx -anchor-spass Va "mta-arguments"
529 .Mx -anchor-spass Va "mta-no-default-arguments"
530 .Mx -anchor-spass Va "mta-no-receiver-arguments"
531 .Mx -anchor-spass Va "mta-argv0"
532 .Mx -anchor-spass Va "mta-bcc-ok"
533 .Mx -anchor-spass Va "netrc-lookup"
534 .Mx -anchor-spass Va "netrc-pipe"
535 .Mx -anchor-spass Va "newfolders"
536 .Mx -anchor-spass Va "newmail"
537 .Mx -anchor-spass Va "outfolder"
538 .Mx -anchor-spass Va "on-account-cleanup"
539 .Mx -anchor-spass Va "on-compose-cleanup"
540 .Mx -anchor-spass Va "on-compose-enter"
541 .Mx -anchor-spass Va "on-compose-leave"
542 .Mx -anchor-spass Va "on-compose-splice"
543 .Mx -anchor-spass Va "on-compose-splice-shell"
544 .Mx -anchor-spass Va "on-history-addition"
545 .Mx -anchor-spass Va "on-main-loop-tick"
546 .Mx -anchor-spass Va "on-program-exit"
547 .Mx -anchor-spass Va "on-resend-cleanup"
548 .Mx -anchor-spass Va "on-resend-enter"
549 .Mx -anchor-spass Va "page"
550 .Mx -anchor-spass Va "password"
551 .Mx -anchor-spass Va "piperaw"
552 .Mx -anchor-spass Va "pipe-EXTENSION"
553 .Mx -anchor-spass Va "pipe-TYPE/SUBTYPE"
554 .Mx -anchor-spass Ev "MAILX_CONTENT"
555 .Mx -anchor-spass Ev "MAILX_CONTENT_EVIDENCE"
556 .Mx -anchor-spass Ev "MAILX_EXTERNAL_BODY_URL"
557 .Mx -anchor-spass Ev "MAILX_FILENAME"
558 .Mx -anchor-spass Ev "MAILX_FILENAME_GENERATED"
559 .Mx -anchor-spass Ev "MAILX_FILENAME_TEMPORARY"
560 .Mx -anchor-spass Va "pop3-auth"
561 .Mx -anchor-spass Va "pop3-bulk-load"
562 .Mx -anchor-spass Va "pop3-keepalive"
563 .Mx -anchor-spass Va "pop3-no-apop"
564 .Mx -anchor-spass Va "pop3-use-starttls"
565 .Mx -anchor-spass Va "posix"
566 .Mx -anchor-spass Va "print-alternatives"
567 .Mx -anchor-spass Va "prompt"
568 .Mx -anchor-spass Va "prompt2"
569 .Mx -anchor-spass Va "quiet"
570 .Mx -anchor-spass Va "quote"
571 .Mx -anchor-spass Va "quote-add-cc"
572 .Mx -anchor-spass Va "quote-as-attachment"
573 .Mx -anchor-spass Va "quote-chars"
574 .Mx -anchor-spass Va "quote-fold"
575 .Mx -anchor-spass Va "quote-inject-head"
576 .Mx -anchor-spass Va "quote-inject-tail"
577 .Mx -anchor-spass Va "r-option-implicit"
578 .Mx -anchor-spass Va "recipients-in-cc"
579 .Mx -anchor-spass Va "record"
580 .Mx -anchor-spass Va "record-files"
581 .Mx -anchor-spass Va "record-resent"
582 .Mx -anchor-spass Va "reply-in-same-charset"
583 .Mx -anchor-spass Va "reply-strings"
584 .Mx -anchor-spass Va "reply-to"
585 .Mx -anchor-spass Va "reply-to-honour"
586 .Mx -anchor-spass Va "reply-to-swap-in"
587 .Mx -anchor-spass Va "rfc822-body-from_"
588 .Mx -anchor-spass Va "save"
589 .Mx -anchor-spass Va "screen"
590 .Mx -anchor-spass Va "searchheaders"
591 .Mx -anchor-spass Va "sendcharsets"
592 .Mx -anchor-spass Va "sendcharsets-else-ttycharset"
593 .Mx -anchor-spass Va "sender"
594 .Mx -anchor-spass Va "sendwait"
595 .Mx -anchor-spass Va "showlast"
596 .Mx -anchor-spass Va "showname"
597 .Mx -anchor-spass Va "showto"
598 .Mx -anchor-spass Va "Sign"
599 .Mx -anchor-spass Va "sign"
600 .Mx -anchor-spass Va "signature"
601 .Mx -anchor-spass Va "skipemptybody"
602 .Mx -anchor-spass Va "smime-ca-dir"
603 .Mx -anchor-spass Va "smime-ca-file"
604 .Mx -anchor-spass Va "smime-ca-flags"
605 .Mx -anchor-spass Va "smime-ca-no-defaults"
606 .Mx -anchor-spass Va "smime-cipher"
607 .Mx -anchor-spass Va "smime-crl-dir"
608 .Mx -anchor-spass Va "smime-crl-file"
609 .Mx -anchor-spass Va "smime-encrypt-USER@HOST"
610 .Mx -anchor-spass Va "smime-force-encryption"
611 .Mx -anchor-spass Va "smime-sign"
612 .Mx -anchor-spass Va "smime-sign-cert"
613 .Mx -anchor-spass Va "smime-sign-digest"
614 .Mx -anchor-spass Va "smime-sign-include-certs"
615 .Mx -anchor-spass Va "smtp-auth"
616 .Mx -anchor-spass Va "smtp-hostname"
617 .Mx -anchor-spass Va "smtp-use-starttls"
618 .Mx -anchor-spass Va "socket-connect-timeout"
619 .Mx -anchor-spass Va "socks-proxy"
620 .Mx -anchor-spass Va "spam-interface"
621 .Mx -anchor-spass Va "spam-maxsize"
622 .Mx -anchor-spass Va "spamc-command"
623 .Mx -anchor-spass Va "spamc-arguments"
624 .Mx -anchor-spass Va "spamc-user"
625 .Mx -anchor-spass Va "spamfilter-ham"
626 .Mx -anchor-spass Va "spamfilter-noham"
627 .Mx -anchor-spass Va "spamfilter-nospam"
628 .Mx -anchor-spass Va "spamfilter-rate"
629 .Mx -anchor-spass Va "spamfilter-spam"
630 .Mx -anchor-spass Va "spamfilter-rate-scanscore"
631 .Mx -anchor-spass Va "stealthmua"
632 .Mx -anchor-spass Va "system-mailrc"
633 .Mx -anchor-spass Va "termcap"
634 .Mx -anchor-spass Va "termcap-ca-mode"
635 .Mx -anchor-spass Va "termcap-disable"
636 .Mx -anchor-spass Va "tls-ca-dir"
637 .Mx -anchor-spass Va "tls-ca-file"
638 .Mx -anchor-spass Va "tls-ca-flags"
639 .Mx -anchor-spass Va "tls-ca-no-defaults"
640 .Mx -anchor-spass Va "tls-config-file"
641 .Mx -anchor-spass Va "tls-config-module"
642 .Mx -anchor-spass Va "tls-config-pairs"
643 .Mx -anchor-spass Va "tls-crl-dir"
644 .Mx -anchor-spass Va "tls-crl-file"
645 .Mx -anchor-spass Va "tls-features"
646 .Mx -anchor-spass Va "tls-fingerprint"
647 .Mx -anchor-spass Va "tls-fingerprint-digest"
648 .Mx -anchor-spass Va "tls-rand-file"
649 .Mx -anchor-spass Va "tls-verify"
650 .Mx -anchor-spass Va "toplines"
651 .Mx -anchor-spass Va "topsqueeze"
652 .Mx -anchor-spass Va "ttycharset"
653 .Mx -anchor-spass Va "typescript-mode"
654 .Mx -anchor-spass Va "umask"
655 .Mx -anchor-spass Va "user"
656 .Mx -anchor-spass Va "v15-compat"
657 .Mx -anchor-spass Va "verbose"
658 .Mx -anchor-spass Va "version"
659 .Mx -anchor-spass Va "version-date"
660 .Mx -anchor-spass Va "version-hexnum"
661 .Mx -anchor-spass Va "version-major"
662 .Mx -anchor-spass Va "version-minor"
663 .Mx -anchor-spass Va "version-update"
664 .Mx -anchor-spass Va "writebackedited"
665 .Mx -anchor-spass Ev "COLUMNS"
666 .Mx -anchor-spass Ev "DEAD"
667 .Mx -anchor-spass Ev "EDITOR"
668 .Mx -anchor-spass Ev "HOME"
669 .Mx -anchor-spass Ev "LC_ALL"
670 .Mx -anchor-spass Ev "LC_CTYPE"
671 .Mx -anchor-spass Ev "LANG"
672 .Mx -anchor-spass Ev "LINES"
673 .Mx -anchor-spass Ev "LISTER"
674 .Mx -anchor-spass Ev "LOGNAME"
675 .Mx -anchor-spass Ev "MAIL"
676 .Mx -anchor-spass Ev "MAILCAPS"
677 .Mx -anchor-spass Ev "MAILRC"
678 .Mx -anchor-spass Ev "MAILX_NO_SYSTEM_RC"
679 .Mx -anchor-spass Ev "MBOX"
680 .Mx -anchor-spass Ev "NETRC"
681 .Mx -anchor-spass Ev "PAGER"
682 .Mx -anchor-spass Ev "PATH"
683 .Mx -anchor-spass Ev "POSIXLY_CORRECT"
684 .Mx -anchor-spass Ev "SHELL"
685 .Mx -anchor-spass Ev "SOCKS5_PROXY"
686 .Mx -anchor-spass Ev "SOURCE_DATE_EPOCH"
687 .Mx -anchor-spass Ev "TERM"
688 .Mx -anchor-spass Ev "TMPDIR"
689 .Mx -anchor-spass Ev "USER"
690 .Mx -anchor-spass Ev "VISUAL"
691 .Mx -anchor-spass Pa "~/.mailcap"
692 .Mx -anchor-spass Pa "/etc/mailcap"
693 .Mx -anchor-spass Pa "\*(VM"
694 .Mx -anchor-spass Pa "\*(vU"
695 .Mx -anchor-spass Pa "\*(vS"
696 .Mx -anchor-spass Pa "\*(VN"
697 .Mx -anchor-spass Pa "/dev/null"
698 .Mx -anchor-spass Pa "~/.rnd"
699 .Mx -anchor-spass Pa "\*(UR"
700 .Mx -anchor-spass Pa "\*(ur"
701 .Mx -anchor-spass Cd "copiousoutput"
702 .Mx -anchor-spass Cd "needsterminal"
703 .Mx -anchor-spass Cd "x-mailx-async"
704 .Mx -anchor-spass Cd "x-mailx-noquote"
705 .Mx -anchor-spass Cd "x-mailx-test-once"
706 .Mx -anchor-spass Cd "x-mailx-tmpfile"
707 .Mx -anchor-spass Cd "x-mailx-tmpfile-fill"
708 .Mx -anchor-spass Cd "x-mailx-tmpfile-unlink"
709 .Mx -anchor-spass Cd "x-mailx-last-resort"
710 .Mx -anchor-spass Cd "x-mailx-ignore"
711 .Mx -anchor-spass Ic "cache"
712 .Mx -anchor-spass Ic "connect"
713 .Mx -anchor-spass Ic "disconnect"
714 .Mx -anchor-spass Ic "imap"
715 .Mx -anchor-spass Ic "imapcodec"
716 .Mx -anchor-spass Va "disconnected"
717 .Mx -anchor-spass Va "imap-auth"
718 .Mx -anchor-spass Va "imap-cache"
719 .Mx -anchor-spass Va "imap-delim"
720 .Mx -anchor-spass Va "imap-keepalive"
721 .Mx -anchor-spass Va "imap-list-depth"
722 .Mx -anchor-spass Va "imap-use-starttls"
723 .Sh NAME
724 .Nm \*(UA \%[\*(VV]
725 .Nd send and receive Internet mail
726 .Sh SYNOPSIS
727 .Nm \*(uA
728 .Bk -words
729 .Op Fl DdEFinv~#
730 .Op Fl \&: Ar spec
731 .Op Fl A Ar account
732 .Op : Ns Fl a Ar attachment Ns \&:
733 .Op : Ns Fl b Ar bcc-addr Ns \&:
734 .Op : Ns Fl C Ar """field:\0body""" Ns \&:
735 .Op : Ns Fl c Ar cc-addr Ns \&:
736 .Op Fl M Ar type | Fl m Ar file | Fl q Ar file | Fl t
737 .Op Fl r Ar from-addr
738 .Oo : Ns Fl S\0 Ns Ar var Ns Oo Ns = Ns Ar value Ns Oc Ns : Ns Oc
739 .Op Fl s Ar subject
740 .Op : Ns Fl T Ar """field:\0addr""" Ns \&:
741 .Op : Ns Fl X Ar cmd Ns \&:
742 .Op : Ns Fl Y Ar cmd Ns \&:
743 .Op Fl \&.
744 .Pf : Ar to-addr Ns \&:
745 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
748 .Nm \*(uA
749 .Bk -words
750 .Op Fl DdEeHiNnRv~#
751 .Op Fl \&: Ar spec
752 .Op Fl A Ar account
753 .Op : Ns Fl C Ar """field:\0body""" Ns \&:
754 .Op Fl L Ar spec
755 .Op Fl r Ar from-addr
756 .Oo : Ns Fl S\0 Ns Ar var Ns Oo Ns = Ns Ar value Ns Oc Ns : Ns Oc
757 .Op Fl u Ar user
758 .Op : Ns Fl X Ar cmd Ns \&:
759 .Op : Ns Fl Y Ar cmd Ns \&:
760 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
762 .Nm \*(uA
763 .Bk -words
764 .Op Fl DdEeHiNnRv~#
765 .Op Fl \&: Ar spec
766 .Op Fl A Ar account
767 .Op : Ns Fl C Ar """field:\0body""" Ns \&:
768 .Fl f
769 .Op Fl L Ar spec
770 .Op Fl r Ar from-addr
771 .Oo : Ns Fl S\0 Ns Ar var Ns Oo Ns = Ns Ar value Ns Oc Ns : Ns Oc
772 .Op : Ns Fl X Ar cmd Ns \&:
773 .Op : Ns Fl Y Ar cmd Ns \&:
774 .Op Ar file
775 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
778 .Nm \*(uA
779 .Fl h | Fl Fl help
780 .Nm \*(uA
781 .Fl V | Fl Fl version
782 .Mx -toc -tree html pdf ps xhtml
783 .Sh DESCRIPTION
784 .Bd -filled -compact -offset indent
785 .Sy Note:
786 S-nail (\*(UA) will see major changes in v15.0 (circa 2022).
787 Some backward incompatibilities cannot be avoided.
788 .Sx COMMANDS
789 change to
790 .Sx "Shell-style argument quoting" ,
791 and shell metacharacters will become (more) meaningful.
792 Some commands accept new syntax today via
793 .Cm wysh
794 .Pf ( Sx "Command modifiers" ) .
795 Behaviour is flagged \*(IN and \*(OU,
796 .Ic set Ns
797 ting
798 .Va v15-compat
799 .Pf ( Sx "INTERNAL VARIABLES" )
800 will choose new behaviour when applicable;
801 giving it a value makes
802 .Cm wysh
803 an implied default.
804 \*(OB flags what will vanish.
806 .Sy Warning!
807 .Va v15-compat
808 (with value) will be a default in v14.10.0!
811 \*(UA provides a simple and friendly environment for sending and
812 receiving mail.
813 It is intended to provide the functionality of the POSIX
814 .Xr mailx 1
815 command, but is MIME capable and optionally offers extensions for
816 line editing, S/MIME, SMTP and POP3, among others.
817 \*(UA divides incoming mail into its constituent messages and allows
818 the user to deal with them in any order.
819 It offers many
820 .Sx COMMANDS
822 .Sx "INTERNAL VARIABLES"
823 for manipulating messages and sending mail.
824 It provides the user simple editing capabilities to ease the composition
825 of outgoing messages, and increasingly powerful and reliable
826 non-interactive scripting capabilities.
827 .Ss "Options"
828 .Bl -tag -width ".It Fl BaNg"
830 .It Fl \&: Ar spec , Fl Fl resource-files Ns =..
831 Controls loading of (as via
832 .Ic source )
833 .Sx "Resource files" :
834 .Ar spec
835 is parsed case-insensitively, the letter
836 .Ql s
837 corresponds to the system wide
838 .Pa \*(UR ,
839 .Ql u
840 the user's personal file
841 .Pa \*(ur .
842 The (original) system wide resource is also compiled-in, accessible via
843 .Ql x .
844 The letters
845 .Ql -
847 .Ql /
848 disable usage of resource files.
849 Order matters, default is
850 .Ql su .
851 This option overrides
852 .Fl n .
854 .It Fl A Ar name , Fl Fl account Ns =..
855 Activate user
856 .Ic account
857 .Ar name
858 after program startup is complete (resource files loaded, only
859 .Fl X
860 commands are to be executed), and switch to its
861 .Mx -sx
862 .Sx "primary system mailbox"
863 (most likely the
864 .Va inbox ) .
865 If activation fails the program
866 .Pf e Ic xit Ns
867 s if used non-interactively, or if any of
868 .Va errexit
870 .Va posix
871 are set.
873 .It Fl a Ar file Ns Oo Ar =input-charset Ns Oo Ar #output-charset Oc Oc , \
874   Fl Fl attach Ns =..
875 \*(SM Attach
876 .Ar file .
877 For \*(CM opportunities refer to
878 .Ic ~@
880 .Ic ~^ .
881 .Ar file
882 is subject to tilde expansion (see
883 .Sx "Filename transformations"
885 .Ic folder ) ;
886 if it is not accessible but contains a
887 .Ql =
888 character, anything before the last
889 .Ql =
890 will be used as the filename, anything thereafter as a character set
891 specification, as shown.
893 If only an input character set
894 .Mx -ix "character set specification"
895 is specified, the input side is fixed, and no character set conversion
896 will be applied; an empty or the special string hyphen-minus
897 .Ql -
898 is taken for
899 .Va ttycharset
900 (the default).
901 If an output character set has also been specified the desired
902 conversion is performed immediately, not considering file type and
903 content, except for an empty string or hyphen-minus
904 .Ql - ,
905 which select the default conversion algorithm (see
906 .Sx "Character sets" ) :
907 no immediate conversion is performed,
908 .Ar file
909 and its contents will be MIME-classified
910 .Pf ( Sx "HTML mail and MIME attachments" , "The mime.types files")
911 first \(em only the latter mode is available unless
912 .Va features
913 includes
914 .Ql ,+iconv, .
915 .It Fl B
916 (\*(OB: \*(UA will always use line-buffered output, to gain
917 line-buffered input even in batch mode enable batch mode via
918 .Fl # . )
920 .It Fl b Ar addr , Fl Fl bcc Ns =..
921 \*(SM Send a blind carbon copy to recipient
922 .Ar addr .
923 The option may be used multiple times.
924 Also see the section
925 .Sx "On sending mail, and non-interactive mode" .
927 .It Fl C Ar """field: body""" , Fl Fl custom-header Ns =..
928 Create a custom header which persists for an entire session.
929 A custom header consists of the field name followed by a colon
930 .Ql \&:
931 and the field content body, for example
932 .Ql -C """Blah: Neminem laede; imo omnes, quantum potes, juva""" .
933 Standard header field names cannot be overwritten by custom headers.
934 Runtime adjustable custom headers are available via the variable
935 .Va customhdr ,
936 and in \*(CM
937 .Ic ~^ ,
938 one of the
939 .Sx "COMMAND ESCAPES" ,
940 as well as
941 .Ic digmsg
942 are the most flexible and powerful options to manage message headers.
943 This option may be used multiple times.
945 .It Fl c Ar addr , Fl Fl cc Ns =..
946 \*(SM Just like
947 .Fl b ,
948 except it places the argument in the list of carbon copies.
950 .It Fl D , Fl Fl disconnected
951 \*(OP Startup with
952 .Va disconnected
953 .Ic set .
955 .It Fl d , Fl Fl debug
956 Enter a debug-only sandbox mode by setting the internal variable
957 .Va debug ;
958 the same can be achieved via
959 .Ql Fl S Va \&\&debug
961 .Ql Ic set Va \&\&debug .
962 Also see
963 .Fl v .
965 .It Fl E , Fl Fl discard-empty-messages
966 \*(SM
967 .Ic set
968 .Va skipemptybody
969 and thus discard messages with an empty message part body, successfully.
971 .It Fl e , Fl Fl check-and-exit
972 Just check if mail is present (in the system
973 .Va inbox
974 or the one specified via
975 .Fl f ) :
976 if yes, return an exit status of zero, a non-zero value otherwise.
977 To restrict the set of mails to consider in this evaluation a message
978 specification can be added with the option
979 .Fl L .
980 Quickrun: does not open an interactive session.
982 .It Fl F
983 \*(SM Save the message to send in a file named after the local part of
984 the first recipient's address (instead of in
985 .Va record Ns ).
987 .It Fl f , Fl Fl file
988 Read in the contents of the user's
989 .Mx -sx
990 .Sx "secondary mailbox"
991 .Ev MBOX
992 (or the specified file) for processing;
993 when \*(UA is quit, it writes undeleted messages back to this file
994 (but be aware of the
995 .Va hold
996 option).
997 The optional
998 .Ar file
999 argument will undergo some special
1000 .Sx "Filename transformations"
1001 (as via
1002 .Ic folder ) .
1003 Note that
1004 .Ar file
1005 is not an argument to the flag
1006 .Fl \&\&f ,
1007 but is instead taken from the command line after option processing has
1008 been completed.
1009 In order to use a
1010 .Ar file
1011 that starts with a hyphen-minus, prefix with a relative path, as in
1012 .Ql ./-hyphenbox.mbox .
1014 .It Fl H , Fl Fl header-summary
1015 Display a summary of
1016 .Ic headers
1017 for the given
1018 .Ic folder
1019 (depending on
1020 .Fl u ,
1021 .Va inbox
1023 .Ev MAIL ,
1024 or as specified via
1025 .Fl f ) ,
1026 then exit.
1027 A configurable summary view is available via the option
1028 .Fl L .
1029 This mode does not honour
1030 .Va showlast .
1031 Quickrun: does not open an interactive session.
1033 .It Fl h , Fl Fl help
1034 Show a brief usage summary; use
1035 .Fl Fl long-help
1036 for a list long options.
1038 .It Fl i
1039 .Ic set
1040 .Va ignore
1041 to ignore tty interrupt signals.
1043 .It Fl L Ar spec , Fl Fl search Ns =..
1044 Display a summary of
1045 .Ic headers
1046 of all messages that match the given
1047 .Ar spec
1048 in the
1049 .Ic folder
1050 found by the same algorithm used by
1051 .Fl H ,
1052 then exit.
1053 See the section
1054 .Sx "Specifying messages"
1055 for the format of
1056 .Ar spec .
1057 This mode does not honour
1058 .Va showlast .
1060 If the
1061 .Fl e
1062 option has been given in addition no header summary is produced,
1063 but \*(UA will instead indicate via its exit status whether
1064 .Ar spec
1065 matched any messages
1066 .Pf ( Ql 0 )
1067 or not
1068 .Pf ( Ql 1 ) ;
1069 note that any verbose output is suppressed in this mode and must instead
1070 be enabled explicitly (see
1071 .Fl v ) .
1072 Quickrun: does not open an interactive session.
1074 .It Fl M Ar type
1075 \*(SM Will flag standard input with the MIME
1076 .Ql Content-Type:
1077 set to the given known
1078 .Ar type
1079 .Pf ( Sx "HTML mail and MIME attachments" , "The mime.types files" )
1080 and use it as the main message body.
1081 \*(ID Using this option will bypass processing of
1082 .Va message-inject-head
1084 .Va message-inject-tail .
1085 Also see
1086 .Fl q , m , t .
1088 .It Fl m Ar file
1089 \*(SM MIME classify the specified
1090 .Ar file
1091 and use it as the main message body.
1092 \*(ID Using this option will bypass processing of
1093 .Va message-inject-head
1095 .Va message-inject-tail .
1096 Also see
1097 .Fl q , M , t .
1099 .It Fl N , Fl Fl no-header-summary
1100 inhibit the initial display of message headers when reading mail or
1101 editing a mailbox
1102 .Ic folder
1103 by calling
1104 .Ic unset
1105 for the internal variable
1106 .Va header .
1108 .It Fl n
1109 Standard flag that inhibits reading the system wide
1110 .Pa \*(UR
1111 upon startup.
1112 The option
1113 .Fl \&:
1114 allows more control over the startup sequence; also see
1115 .Sx "Resource files" .
1117 .It Fl q Ar file , Fl Fl quote-file Ns =..
1118 \*(SM Initialize the message body with the contents of
1119 .Ar file ,
1120 which may be standard input
1121 .Ql -
1122 only in non-interactive context.
1123 Also see
1124 .Fl M , m , t .
1126 .It Fl R , Fl Fl read-only
1127 Any mailbox
1128 .Ic folder
1129 aka\&
1130 .Ic folder
1131 opened will be in read-only mode.
1133 .It Fl r Ar from-addr , Fl Fl from-address Ns =..
1134 The RFC 5321 reverse-path used for relaying and delegating messages to
1135 its destination(s), for example to report delivery errors, is normally
1136 derived from the address which appears in the
1137 .Va from
1138 header (or, if that contains multiple addresses, in
1139 .Va sender ) .
1140 A file-based aka local executable
1141 .Va mta
1142 (Mail-Transfer-Agent), however, instead uses the local identity of the
1143 initiating user.
1145 When this command line option is used the given single addressee
1146 .Ar from-addr
1147 will be assigned to the internal variable
1148 .Va from ,
1149 but in addition the command line option
1150 .Fl \&\&f Ar from-addr
1151 will be passed to a file-based
1152 .Va mta
1153 whenever a message is sent.
1154 Shall
1155 .Ar from-addr
1156 include a user name the address components will be separated and
1157 the name part will be passed to a file-based
1158 .Va mta
1159 individually via
1160 .Fl \&\&F Ar name .
1161 Even though not a recipient the
1162 .Ql shquote
1163 .Va expandaddr
1164 flag is supported.
1166 If an empty string is passed as
1167 .Ar from-addr
1168 then the content of the variable
1169 .Va from
1170 (or, if that contains multiple addresses,
1171 .Va sender )
1172 will be evaluated and used for this purpose whenever the file-based
1173 .Va mta
1174 is contacted.
1175 By default, without
1176 .Fl \&\&r
1177 that is, neither
1178 .Fl \&\&f
1180 .Fl \&\&F
1181 command line options are used when contacting a file-based MTA, unless
1182 this automatic deduction is enforced by
1183 .Ic set Ns
1184 ting the internal variable
1185 .Va r-option-implicit .
1187 Remarks: many default installations and sites disallow overriding the
1188 local user identity like this unless either the MTA has been configured
1189 accordingly or the user is member of a group with special privileges.
1190 Passing an invalid address will cause an error.
1192 .It Fl S Ar var Ns Oo = Ns value Oc , Fl Fl set Ns =..
1193 .Ic set
1194 (or, with a prefix string
1195 .Ql no ,
1196 as documented in
1197 .Sx "INTERNAL VARIABLES" ,
1198 .Ic unset )
1199 .Ar var Ns
1200 iable and optionally assign
1201 .Ar value ,
1202 if supported; \*(ID the entire expression is evaluated as if specified
1203 within dollar-single-quotes (see
1204 .Sx "Shell-style argument quoting" )
1205 if the internal variable
1206 .Va v15-compat
1207 is set.
1208 If the operation fails the program will exit if any of
1209 .Va errexit
1211 .Va posix
1212 are set.
1213 Settings established via
1214 .Fl \&\&S
1215 cannot be changed from within
1216 .Sx "Resource files"
1217 or an account switch initiated by
1218 .Fl A .
1219 They will become mutable again before commands registered via
1220 .Fl X
1221 are executed.
1223 .It Fl s Ar subject , Fl Fl subject Ns =..
1224 \*(SM Specify the subject of the message to be sent.
1225 Newline (NL) and carriage-return (CR) bytes are invalid and will be
1226 normalized to space (SP) characters.
1228 .It Fl T Ar """field: addr""" , Fl Fl target Ns =..
1229 \*(SM Add
1230 .Ar addr
1231 to the list of receivers targeted by
1232 .Ar field ,
1233 for now supported are only
1234 .Ql bcc ,
1235 .Ql cc ,
1236 .Ql fcc ,
1238 .Ql to .
1239 Field and body (address) are separated by a colon
1240 .Ql \&:
1241 and optionally blank (space, tabulator) characters.
1243 .Ql shquote
1244 .Va expandaddr
1245 flag is supported.
1246 .Ar addr
1247 is parsed like a message header address line, as if it would be part of
1248 a template message fed in via
1249 .Fl t ,
1250 and the same modifier suffix is supported.
1251 This option may be used multiple times.
1253 .It Fl t , Fl Fl template
1254 \*(SM The text message given (on standard input) is expected to contain,
1255 separated from the message body by an empty line, one or multiple
1256 plain text message headers.
1257 \*(ID Readily prepared MIME mail messages cannot be passed.
1258 Headers can span multiple consecutive lines if follow lines start with
1259 any amount of whitespace.
1260 A line starting with the number sign
1261 .Ql #
1262 in the first column is ignored.
1263 Message recipients can be given via the message headers
1264 .Ql To: ,
1265 .Ql Cc: ,
1266 .Ql Bcc:
1267 (the
1268 .Ql ?single
1269 modifier enforces treatment as a single addressee, for example
1270 .Ql To?single: exa, <m@ple> )
1272 .Ql Fcc: ,
1273 they will be added to any recipients specified on the command line,
1274 and are likewise subject to
1275 .Va expandaddr
1276 validity checks.
1277 If a message subject is specified via
1278 .Ql Subject:
1279 then it will be used in favour of one given on the command line.
1281 More optional headers are
1282 .Ql Reply-To:
1283 (possibly overriding
1284 .Va reply-to ) ,
1285 .Ql Sender:
1286 .Pf ( Va sender ) ,
1287 .Ql From:
1288 .Pf ( Va from
1289 and / or option
1290 .Fl r ) .
1291 .Ql Message-ID: ,
1292 .Ql In-Reply-To: ,
1293 .Ql References:
1295 .Ql Mail-Followup-To: ,
1296 by default created automatically dependent on message context, will
1297 be used if specified (a special address massage will however still occur
1298 for the latter).
1299 Any other custom header field (also see
1300 .Fl C ,
1301 .Va customhdr
1303 .Ic ~^ )
1304 is passed through entirely
1305 unchanged, and in conjunction with the options
1306 .Fl ~
1308 .Fl #
1309 it is possible to embed
1310 .Sx "COMMAND ESCAPES" .
1311 Also see
1312 .Fl M , m , q .
1314 .It Fl u Ar user , Fl Fl inbox-of Ns =..
1315 Initially read the
1316 .Mx -sx
1317 .Sx "primary system mailbox"
1319 .Ar user ,
1320 appropriate privileges presumed; effectively identical to
1321 .Ql Fl \&\&f Ns \0%user .
1323 .It Fl V , Fl Fl version
1324 Show \*(UAs
1325 .Va version
1326 and exit.
1327 The command
1328 .Ic version
1329 will also show the list of
1330 .Va features :
1331 .Ql $ \*(uA -:/ -Xversion -Xx .
1333 .It Fl v , Fl Fl verbose
1334 .Ic set Ns
1335 s the internal variable
1336 .Va verbose
1337 to enable logging of informational context messages.
1338 (Increases level of verbosity when used multiple times.)
1339 Also see
1340 .Fl d .
1342 .It Fl X Ar cmd , Fl Fl startup-cmd Ns =..
1343 Add the given (or multiple for a multiline argument)
1344 .Ar cmd
1345 to a list of commands to be executed before normal operation starts.
1346 The commands will be evaluated as a unit, just as via
1347 .Ic source .
1348 Correlates with
1349 .Fl #
1351 .Va errexit .
1353 .It Fl Y Ar cmd , Fl Fl cmd Ns =..
1354 Add the given (or multiple for a multiline argument)
1355 .Ar cmd
1356 to a list of commands to be executed after normal operation has started.
1357 The commands will be evaluated successively in the given order, and as
1358 if given on the program's standard input \(em before interactive
1359 prompting begins in interactive mode, after standard input has been
1360 consumed otherwise.
1362 .It Fl ~ , Fl Fl enable-cmd-escapes
1363 Enable
1364 .Sx "COMMAND ESCAPES"
1365 in \*(CM even in non-interactive use cases.
1366 This can for example be used to automatically format the composed
1367 message text before sending the message:
1368 .Bd -literal -offset indent
1369 $ ( echo 'line    one. Word.     Word2.';\e
1370     echo '~| /usr/bin/fmt -tuw66' ) |\e
1371   LC_ALL=C \*(uA -d~:/ -Sttycharset=utf-8 bob@exam.ple
1374 .It Fl # , Fl Fl batch-mode
1375 Enables batch mode: standard input is made line buffered, the complete
1376 set of (interactive) commands is available, processing of
1377 .Sx "COMMAND ESCAPES"
1378 is enabled in
1379 .Sx "Compose mode" ,
1380 and diverse
1381 .Sx "INTERNAL VARIABLES"
1382 are adjusted for batch necessities, exactly as if done via
1383 .Fl S :
1384 .Va emptystart ,
1385 .Pf no Va errexit ,
1386 .Pf no Va header ,
1387 .Pf no Va posix ,
1388 .Va quiet ,
1389 .Va sendwait ,
1390 .Va typescript-mode
1391 as well as
1392 .Ev MAIL ,
1393 .Ev MBOX
1395 .Va inbox
1396 (the latter three to
1397 .Pa /dev/null ) .
1398 Also, the values of
1399 .Ev COLUMNS
1401 .Ev LINES
1402 are looked up, and acted upon.
1403 The following prepares an email message in a batched dry run:
1404 .Bd -literal -offset indent
1405 $ for name in bob alice@exam.ple lisa@exam.ple; do
1406     printf 'mail %s\en~s ubject\enText\en~.\en' "${name}"
1407   done |
1408   LC_ALL=C \*(uA -#:x -Smta=test \e
1409     -X'alias bob bob@exam.ple'
1412 .It Fl \&. , Fl Fl end-options
1413 This flag forces termination of option processing in order to prevent
1414 .Dq option injection
1415 (attacks).
1416 It also forcefully puts \*(UA into send mode, see
1417 .Sx "On sending mail, and non-interactive mode" .
1420 If the setting of
1421 .Va expandargv
1422 allows their recognition all
1423 .Ar mta-option
1424 arguments given at the end of the command line after a
1425 .Ql --
1426 separator will be passed through to a file-based
1427 .Va mta
1428 (Mail-Transfer-Agent) and persist for the entire session.
1429 .Va expandargv
1430 constraints do not apply to the content of
1431 .Va mta-arguments .
1432 Command line receiver address handling supports the
1433 .Ql shquote
1434 constraint of
1435 .Va expandaddr ,
1436 for more please see
1437 .Sx "On sending mail, and non-interactive mode" .
1438 .Bd -literal -offset indent
1439 $ \*(uA -#:/ -X 'addrcodec enc Hey, ho <silver@go>' -Xx
1441 .Ss "A starter"
1442 \*(UA is a direct descendant of
1444 Mail, itself a successor to the Research
1446 mail which
1447 .Dq was there from the start
1448 according to
1449 .Sx HISTORY .
1450 It thus represents the user side of the
1452 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
1453 traditionally taken by
1454 .Xr sendmail 8
1455 (and most MTAs provide a binary of this name for compatibility reasons).
1456 If the \*(OPal SMTP
1457 .Va mta
1458 is included in the
1459 .Va features
1460 of \*(UA then the system side is not a mandatory precondition for mail
1461 delivery.
1463 \*(UA strives for compliance with the POSIX
1464 .Xr mailx 1
1465 standard, but
1466 .Va posix ,
1467 one of the
1468 .Sx "INTERNAL VARIABLES" ,
1469 or its
1470 .Sx ENVIRONMENT Ns
1471 al equivalent
1472 .Ev POSIXLY_CORRECT ,
1473 needs to be set to adjust behaviour to be almost on par.
1474 Almost, because there is one important difference: POSIX
1475 .Sx "Shell-style argument quoting"
1476 is (\*(ID increasingly) used instead of the
1477 .Sx "Old-style argument quoting"
1478 that the standard documents, which is believed to be a feature.
1479 The builtin as well as the (default) global
1480 .Pa \*(UR
1481 .Sx "Resource files"
1482 already bend the standard imposed settings a bit.
1484 For example,
1485 .Va hold
1487 .Va keepsave
1489 .Ic set
1490 in order to suppress the automatic moving of messages to the
1491 .Mx -sx
1492 .Sx "secondary mailbox"
1493 .Ev MBOX
1494 that would otherwise occur (see
1495 .Sx "Message states" ) ,
1497 .Va keep
1498 to not remove empty system MBOX mailbox files (or all empty such files in
1499 .Va posix
1500 mode) to avoid mangling of file permissions when files eventually get
1501 recreated.
1503 To enter interactive mode even if the initial mailbox is empty
1504 .Va emptystart
1505 is set,
1506 .Va editheaders
1507 to allow editing of headers as well as
1508 .Va fullnames
1509 to not strip down addresses in
1510 .Sx "Compose mode" ,
1512 .Va quote
1513 to include the message that is being responded to when
1514 .Ic reply Ns
1515 ing, which is indented by an
1516 .Va indentprefix
1517 that also deviates from standard imposed settings.
1518 .Va mime-counter-evidence
1519 is fully enabled, too.
1520 It sets
1521 .Va followup-to-honour
1523 .Va reply-to-honour
1524 to comply with reply address desires.
1526 Credentials and other settings are easily addressable by grouping them via
1527 .Ic account .
1528 The file mode creation mask can be managed with
1529 .Va umask .
1530 Files and shell pipe output can be
1531 .Ic source Ns
1532 d for
1533 .Ic eval Ns
1534 uation, also during startup from within the
1535 .Sx "Resource files" .
1536 Informational context can be available by
1537 .Ic set Ns
1538 ting
1539 .Va verbose
1541 .Va debug
1542 (as via
1543 .Fl v , d ) .
1544 .Ss "On sending mail, and non-interactive mode"
1545 To send a message to one or more people, using a local or built-in
1546 .Va mta
1547 (Mail-Transfer-Agent) transport to actually deliver the generated mail
1548 message, \*(UA can be invoked with arguments which are the names of
1549 people to whom the mail will be sent, and the command line options
1550 .Fl b
1552 .Fl c
1553 can be used to add (blind) carbon copy receivers:
1554 .Bd -literal -offset indent
1555 # Via test MTA
1556 $ echo Hello, world | \*(uA -:/ -Smta=test -s test $LOGNAME
1558 # Via sendmail(1) MTA
1559 $ </dev/null \*(uA -:x -s test $LOGNAME
1561 # Debug dry-run mode:
1562 $ </dev/null LC_ALL=C \*(uA -d -:/ \e
1563    -Sttycharset=utf8 -Sfullnames \e
1564    -b bcc@exam.ple -c cc@exam.ple -. \e
1565    '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
1567 # With SMTP (no real sending due to -d debug dry-run)
1568 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Sttycharset=utf8 \e
1569     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
1570     -S from=scriptreply@exam.ple \e
1571     -a /etc/mail.rc --end-options \e
1572     eric@exam.ple < /tmp/letter.txt
1575 Email addresses and plain user names are subject to
1576 .Ic alternates
1577 filtering, names only are first expanded through
1578 .Ic alias
1580 .Va mta-aliases .
1581 An address in angle brackets consisting only of a valid local user
1582 .Ql <name>
1583 will be converted to a fully qualified address if either
1584 .Va hostname
1585 is not set, or set to a non-empty value; if set to the empty value the
1586 conversion is left up to the
1587 .Va mta .
1588 By setting
1589 .Va expandaddr
1590 fine-grained control of recipient address types other than user names
1591 and network addresses is possible.
1592 Recipients are classified as follows:
1593 any name that starts with a vertical bar
1594 .Ql |
1595 character specifies a command pipe \(en the command string following the
1596 .Ql |
1597 is executed and the message is sent to its standard input;
1598 likewise, any name that consists only of hyphen-minus
1599 .Ql -
1600 or starts with the character solidus
1601 .Ql /
1602 or the character sequence dot solidus
1603 .Ql ./
1604 is treated as a file, regardless of the remaining content.
1605 Any other name which contains a commercial at
1606 .Ql @
1607 character is a network address;
1608 Any other name which starts with a plus sign
1609 .Ql +
1610 character is a mailbox name;
1611 Any other name which contains a solidus
1612 .Ql /
1613 character but no exclamation mark
1614 .Ql \&!
1615 or percent sign
1616 .Ql %
1617 character before is also a mailbox name;
1618 What remains is treated as a network address.
1619 This classification can be avoided by using a
1620 .Ql Fcc:
1621 header, see
1622 .Sx "Compose mode" .
1623 .Bd -literal -offset indent
1624 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1625 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1626 $ echo safe | LC_ALL=C \e
1627     \*(uA -:/ -Smta=test -Sv15-compat -Sttycharset=utf8 \e
1628       --set mime-force-sendout --set fullnames \e
1629       -S expandaddr=fail,-all,+addr,failinvaddr -s test \e
1630       --end-options 'Imagine John <cold@turk.ey>'
1633 Before messages are sent they undergo editing in
1634 .Sx "Compose mode" .
1635 But many settings are static and can be set more generally.
1636 The envelope sender address for example is defined by
1637 .Va from ,
1638 explicitly defining an originating
1639 .Va hostname
1640 may be desirable, especially with the built-in SMTP Mail-Transfer-Agent
1641 .Va mta .
1642 .Sx "Character sets"
1643 for outgoing message and MIME part content are configurable via
1644 .Va sendcharsets ,
1645 whereas input data is assumed to be in
1646 .Va ttycharset .
1647 Message data will be passed over the wire in a
1648 .Va mime-encoding ,
1649 and MIME parts aka attachments need a
1650 .Ic mimetype ,
1651 usually taken out of
1652 .Sx "The mime.types files" .
1653 Saving copies of sent messages in a
1654 .Va record
1655 mailbox may be desirable \(en as for most mailbox
1656 .Ic folder
1657 targets
1658 .Sx "Filename transformations"
1659 will be performed.
1661 For the purpose of arranging a complete environment of settings that can
1662 be switched to with a single command or command line option there are
1663 .Ic account Ns s .
1664 Alternatively a flat configuration could be possible, making use
1665 of so-called variable chains which automatically pick
1666 .Ql USER@HOST
1668 .Ql HOST
1669 context-dependent variants some variables support: for example addressing
1670 .Ql Ic Folder Ns \& pop3://yaa@exam.ple
1671 would find
1672 .Va \&\&pop3-no-apop-yaa@exam.ple ,
1673 .Va \&\&pop3-no-apop-exam.ple
1675 .Va pop3-no-apop
1676 in order.
1677 For more please see
1678 .Sx "On URL syntax and credential lookup"
1680 .Sx "INTERNAL VARIABLES" .
1682 To avoid environmental noise scripts should create a script-local
1683 environment, ideally with the command line options
1684 .Fl \&:
1685 to disable configuration files in conjunction with repetitions of
1686 .Fl S
1687 to specify variables:
1688 .Bd -literal -offset indent
1689 $ env LC_ALL=C \*(uA -:/ \e
1690     -Sv15-compat \e
1691     -Sttycharset=utf-8 -Smime-force-sendout \e
1692     -Sexpandaddr=fail,-all,failinvaddr \e
1693     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1694     -S from=scriptreply@exam.ple \e
1695     -s 'Subject to go' -a attachment_file \e
1696     -Sfullnames -. \e
1697     'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1698     < content_file
1701 As shown, scripts producing messages can
1702 .Dq fake
1703 a locale environment, the above specifies the all-compatible 7-bit clean
1704 .Ev LC_ALL
1705 .Dq C ,
1706 but will nonetheless take and send UTF-8 in the message text by using
1707 .Va ttycharset .
1708 If character set conversion is compiled in
1709 .Pf ( Va features
1710 includes the term
1711 .Ql ,+iconv, )
1712 invalid (according to
1713 .Va ttycharset )
1714 character input data would normally cause errors; setting
1715 .Va mime-force-sendout
1716 will instead, as a last resort, classify the input as binary data, and
1717 therefore allow message creation to be successful.
1718 (Such content can then be inspected either by installing a
1719 .Va pipe-TYPE/SUBTYPE
1720 handler for
1721 .Ql application/octet-stream ,
1722 or possibly automatically through
1723 .Va mime-counter-evidence ) .
1725 In interactive mode, introduced soon, messages can be sent by calling the
1726 .Ic mail
1727 command with a list of recipient addresses:
1728 .Bd -literal -offset indent
1729 $ \*(uA -:/ -Squiet -Semptystart -Sfullnames -Smta=test
1730 "/var/spool/mail/user": 0 messages
1731 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1732 \&...
1733 ? # Will do the right thing (tm)
1734 ? m rec1@exam.ple rec2@exam.ple
1736 .Ss "Compose mode"
1737 If standard input is a terminal rather than the message to be sent,
1738 the user is expected to type in the message contents.
1739 In compose mode lines beginning with the character
1740 .Ql ~
1741 (in fact the value of
1742 .Va escape )
1743 are special \(en these are so-called
1744 .Sx "COMMAND ESCAPES"
1745 which can be used to read in files, process shell commands, add and edit
1746 attachments and more.
1747 For example
1748 .Ic ~v
1750 .Ic ~e
1751 will start the
1752 .Ev VISUAL
1753 text
1754 .Ev EDITOR ,
1755 respectively, to revise the message in its current state,
1756 .Ic ~h
1757 allows editing of the most important message headers, with the potent
1758 .Ic ~^
1759 custom headers can be created, for example (more specifically than with
1760 .Fl C
1762 .Va customhdr ) .
1763 \*(OPally
1764 .Ic ~?
1765 gives an overview of most other available command escapes.
1767 To create file-carbon-copies the special recipient header
1768 .Ql Fcc:
1769 may be used as often as desired, for example via
1770 .Ic ~^ .
1771 Its entire value (or body in standard terms) is interpreted as a
1772 .Ic folder
1773 target, after having been subject to
1774 .Sx "Filename transformations" :
1775 this is the only way to create a file-carbon-copy without introducing an
1776 ambiguity regarding the interpretation of the address, file names with
1777 leading vertical bars or commercial ats can be used.
1778 Like all other recipients
1779 .Ql Fcc:
1780 is subject to the checks of
1781 .Va expandaddr .
1782 Any local file and pipe command addressee honours the setting of
1783 .Va mbox-fcc-and-pcc .
1785 Once finished with editing the command escape
1786 .Ic ~.
1787 (see there) will call hooks, insert automatic injections and receivers,
1788 leave compose mode and send the message once it is completed.
1789 Aborting letter composition is possible with either of
1790 .Ic ~x
1792 .Ic ~q ,
1793 the latter of which will save the message in the file denoted by
1794 .Ev DEAD
1795 unless
1796 .Pf no Va save
1797 is set.
1798 And unless
1799 .Va ignoreeof
1800 is set the effect of
1801 .Ic ~.
1802 can also be achieved by typing end-of-transmission (EOT) via
1803 .Ql control-D
1804 .Pf ( Ql ^D )
1805 at the beginning of an empty line, and
1806 .Ic ~q
1807 is always reachable by typing end-of-text (ETX) twice via
1808 .Ql control-C
1809 .Pf ( Ql ^C ) .
1811 The compose mode hooks
1812 .Va on-compose-enter , on-compose-splice , on-compose-leave
1814 .Va on-compose-cleanup
1815 may be set to
1816 .Ic define Ns
1817 d macros and provide reliable and increasingly powerful mechanisms to
1818 perform automated message adjustments dependent on message context,
1819 for example addition of message signatures
1820 .Pf ( Va message-inject-head , message-inject-tail )
1821 or creation of additional receiver lists (also by setting
1822 .Va autocc , autobcc ) .
1823 To achieve that the command
1824 .Ic digmsg
1825 may be used in order to query and adjust status of message(s).
1826 The splice hook can also make use of
1827 .Sx "COMMAND ESCAPES" .
1828 (\*(ID The compose mode hooks work for
1829 .Ic forward , mail , reply
1830 and variants;
1831 .Ic resend
1833 .Ic Resend
1834 only provide the hooks
1835 .Va on-resend-enter
1837 .Va on-resend-cleanup ,
1838 which are pretty restricted due to the nature of the operation.)
1839 .Ss "On reading mail, and more on interactive mode"
1840 When invoked without addressees \*(UA enters interactive mode in which
1841 mails may be read.
1842 When used like that the user's system
1843 .Va inbox
1844 (for more on mailbox types please see the command
1845 .Ic folder )
1846 is read in and a one line header of each message therein is displayed if
1847 the variable
1848 .Va header
1849 is set.
1850 The visual style of this summary of
1851 .Ic headers
1852 can be adjusted through the variable
1853 .Va headline
1854 and the possible sorting criterion via
1855 .Va autosort .
1856 Scrolling through
1857 .Va screen Ns
1858 fuls of
1859 .Ic headers
1860 can be performed with the command
1861 .Ic z .
1862 If the initially opened mailbox is empty \*(UA will instead exit
1863 immediately (after displaying a message) unless the variable
1864 .Va emptystart
1865 is set.
1867 At the
1868 .Va prompt
1869 the command
1870 .Ic list
1871 will give a listing of all available commands and
1872 .Ic help
1873 will \*(OPally give a summary of some common ones.
1874 If the \*(OPal documentation strings are available (see
1875 .Va features )
1876 one can type
1877 .Ql help X
1878 .Pf "(or " Ql \&?X )
1879 and see the actual expansion of
1880 .Ql X
1881 and what its purpose is, i.e., commands can be abbreviated
1882 (note that POSIX defines some abbreviations, so that the alphabetical
1883 order of commands does not necessarily relate to the abbreviations; it is
1884 however possible to define overwrites with
1885 .Ic commandalias ) .
1886 These commands can also produce a more
1887 .Va verbose
1888 output.
1890 Messages are given numbers (starting at 1) which uniquely identify
1891 messages; the current message \(en the
1892 .Dq dot
1893 \(en will either be the first new message, or the first unread message,
1894 or the first message of the mailbox; the internal variable
1895 .Va showlast
1896 will instead cause usage of the last message for this purpose.
1897 The command
1898 .Ic headers
1899 will display a
1900 .Va screen Ns
1901 ful of header summaries containing the
1902 .Dq dot ,
1903 whereas
1904 .Ic from
1905 will display only the summaries of the given messages, defaulting to the
1906 .Dq dot .
1908 Message content can be displayed with the command
1909 .Ic type
1910 .Pf ( Ql t ,
1911 alias
1912 .Ic print ) .
1913 Here the variable
1914 .Va crt
1915 controls whether and when \*(UA will use the configured
1916 .Ev PAGER
1917 for display instead of directly writing to the user terminal
1918 .Va screen ,
1919 the sole difference to the command
1920 .Ic more ,
1921 which will always use the
1922 .Ev PAGER .
1923 The command
1924 .Ic top
1925 will instead only show the first
1926 .Va toplines
1927 of a message (maybe even compressed if
1928 .Va topsqueeze
1929 is set).
1930 Message display experience may improve by setting and adjusting
1931 .Va mime-counter-evidence ,
1932 and also see
1933 .Sx "HTML mail and MIME attachments" .
1935 By default the current message
1936 .Pf ( Dq dot )
1937 is displayed, but like with many other commands it is possible to give
1938 a fancy message specification (see
1939 .Sx "Specifying messages" ) ,
1940 for example
1941 .Ql t:u
1942 will display all unread messages,
1943 .Ql t.
1944 will display the
1945 .Dq dot ,
1946 .Ql t 1 5
1947 will type the messages 1 and 5,
1948 .Ql t 1-5
1949 will type the messages 1 through 5, and
1950 .Ql t-
1952 .Ql t+
1953 will display the previous and the next message, respectively.
1954 The command
1955 .Ic search
1956 (a more substantial alias for
1957 .Ic from )
1958 will display a header summary of the given message specification list
1959 instead of their content; the following will search for subjects:
1961 .Dl ? from "'@Some subject to search for'"
1963 In the default setup all header fields of a message will be
1964 .Ic type Ns
1965 d, but fields can be white- or blacklisted for a variety of
1966 applications by using the command
1967 .Ic headerpick ,
1968 e.g., to restrict their display to a very restricted set for
1969 .Ic type :
1970 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1971 In order to display all header fields of a message regardless of
1972 currently active ignore or retain lists, use the commands
1973 .Ic Type
1975 .Ic Top ;
1976 .Ic Show
1977 will show the raw message content.
1978 Note that historically the global
1979 .Pa \*(UR
1980 not only adjusts the list of displayed headers, but also sets
1981 .Va crt .
1982 (\*(ID A yet somewhat restricted) Reliable scriptable message
1983 inspection is available via
1984 .Ic digmsg .
1986 Dependent upon the configuration a line editor (see the section
1987 .Sx "On terminal control and line editor" )
1988 aims at making the user experience with the many
1989 .Sx COMMANDS
1990 a bit nicer.
1991 When reading the system
1992 .Va inbox ,
1993 or when
1994 .Fl f
1996 .Ic folder )
1997 specified a mailbox explicitly prefixed with the special
1998 .Ql %:
1999 modifier (to propagate it to a
2000 .Mx -sx
2001 .Sx "primary system mailbox" ) ,
2002 then messages which have been read
2003 .Pf (see\0 Sx "Message states" )
2004 will be automatically moved to a
2005 .Mx -sx
2006 .Sx "secondary mailbox" ,
2007 the user's
2008 .Ev MBOX
2009 file, when the mailbox is left, either by changing the active mailbox or
2010 by quitting \*(UA \(en this automatic moving from a system- or primary-
2011 to the secondary mailbox is not performed when the variable
2012 .Va hold
2013 is set.
2014 Messages can also be explicitly
2015 .Ic move Ns
2016 d to other mailboxes, whereas
2017 .Ic copy
2018 keeps the original message.
2019 .Ic write
2020 can be used to write out data content of specific parts of messages.
2022 After examining a message the user can
2023 .Ic reply Ql r
2024 to the sender and all recipients (which will also be placed in
2025 .Ql To:
2026 unless
2027 .Va recipients-in-cc
2028 is set), or
2029 .Ic Reply Ql R
2030 exclusively to the sender(s).
2031 To comply with with the receivers desired reply address the
2032 .Mx -sx
2033 .Sx quadoption Ns
2035 .Va followup-to-honour
2037 .Va reply-to-honour
2038 should usually be set.
2039 The commands
2040 .Ic Lreply
2042 .Ic Lfollowup
2043 know how to apply a special addressee massage, see
2044 .Sx "Mailing lists" .
2045 Dependent on the presence and value of
2046 .Va quote
2047 the message being replied to will be included in a quoted form.
2048 .Ic forward Ns
2049 ing a message will allow editing the new message: the original message
2050 will be contained in the message body, adjusted according to
2051 .Ic headerpick .
2052 It is possible to
2053 .Ic resend
2055 .Ic Resend
2056 messages: the former will add a series of
2057 .Ql Resent-
2058 headers, whereas the latter will not; different to newly created
2059 messages editing is not possible and no copy will be saved even with
2060 .Va record
2061 unless the additional variable
2062 .Va record-resent
2063 is set.
2064 When sending, replying or forwarding messages comments and full names
2065 will be stripped from recipient addresses unless the internal variable
2066 .Va fullnames
2067 is set.
2069 Of course messages can be
2070 .Ic delete Ql d ,
2071 and they can spring into existence again via
2072 .Ic undelete ,
2073 or when the \*(UA session is ended via the
2074 .Ic exit
2076 .Ic xit
2077 commands to perform a quick program termation.
2078 To end a mail processing session regularly and perform a full program
2079 exit one may issue the command
2080 .Ic quit .
2081 It will, among others, move read messages to the
2082 .Mx -sx
2083 .Sx "secondary mailbox"
2084 .Ev MBOX
2085 as necessary, discard deleted messages in the current mailbox,
2086 and update the \*(OPal (see
2087 .Va features )
2088 line editor
2089 .Va history-file .
2090 By the way, whenever the main event loop is about to look out for the
2091 next input line it will trigger the hook
2092 .Va on-main-loop-tick .
2093 .Ss "HTML mail and MIME attachments"
2094 HTML-only messages become more and more common, and many messages come
2095 bundled with a bouquet of MIME (Multipurpose Internet Mail Extensions)
2096 parts and attachments.
2097 To get a notion of MIME types there is a built-in default set,
2098 onto which the content of
2099 .Sx "The mime.types files"
2100 will be added (as configured and allowed by
2101 .Va mimetypes-load-control ) .
2102 Types can also become registered and listed with the command
2103 .Ic mimetype .
2104 To improve interaction with the faulty MIME part declarations of real life
2105 .Va mime-counter-evidence
2106 will allow verification of the given assertion, and the possible
2107 provision of an alternative, better MIME type.
2108 Note plain text parts will always be preferred in
2109 .Ql multipart/alternative
2110 MIME messages unless
2111 .Va mime-alternative-favour-rich
2112 is set.
2114 Whereas a simple HTML-to-text filter for displaying HTML messages is
2115 \*(OPally supported (indicated by
2116 .Ql ,+filter-html-tagsoup,
2118 .Va features ) ,
2119 MIME types other than plain text cannot be handled directly.
2120 To deal with specific non-text MIME types or file extensions programs
2121 need to be registered which either prepare (re-)integrable plain text
2122 versions of their input (a mode which is called
2123 .Cd copiousoutput ) ,
2124 or display the content externally, for example in a graphical window:
2125 the latter type is only considered by and for the command
2126 .Ic mimeview .
2128 To install a handler program for a MIME type an according
2129 .Va pipe-TYPE/SUBTYPE
2130 variable needs to be set; to define a handler for a file extension
2131 .Va pipe-EXTENSION
2132 can be used \(en these handlers take precedence.
2133 \*(OPally mail user agent configuration is supported (see
2134 .Sx "The Mailcap files" ) ,
2135 and will be queried for display or quote handlers after the former ones.
2136 Type-markers registered via
2137 .Ic mimetype
2138 are the last possible source for information how to handle a MIME type.
2140 For example, to display HTML messages integrated via the text browsers
2141 .Xr lynx 1
2143 .Xr elinks 1 ,
2144 register a MathML MIME type and enable its plain text display, and to
2145 open PDF attachments in an external PDF viewer, asynchronously and with
2146 some other magic attached:
2147 .Bd -literal -offset indent
2148 ? if "$features" !% ,+filter-html-tagsoup,
2149 ?   #set pipe-text/html='?* elinks -force-html -dump 1'
2150 ?   set pipe-text/html='?* lynx -stdin -dump -force_html'
2151 ?   # Display HTML as plain text instead
2152 ?   #set pipe-text/html=?t
2153 ? endif
2155 ? mimetype ?t application/mathml+xml mathml
2157 ? wysh set pipe-application/pdf='?&=? \e
2158     trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
2159     trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
2160     mupdf "${MAILX_FILENAME_TEMPORARY}"'
2162 ? define showhtml {
2163 ?   \elocalopts yes
2164 ?   \eset mime-alternative-favour-rich pipe-text/html=?h?
2165 ?   \etype "$@"
2166 ? }
2167 ? \ecommandalias html \e\ecall showhtml
2169 .Ss "Mailing lists"
2170 Known or subscribed-to mailing lists may be flagged in the summary of
2171 .Ic headers
2172 .Pf ( Va headline
2173 format character
2174 .Ql %L ) ,
2175 and will gain special treatment when sending mails: the variable
2176 .Va followup-to-honour
2177 will ensure that a
2178 .Ql Mail-\:Followup-\:To:
2179 header is honoured when a message is being replied to
2180 .Pf ( Ic reply ,
2181 .Ic followup ,
2182 .Ic Lreply ,
2183 .Ic Lfollowup ) ,
2185 .Va followup-to
2186 controls creation of this header when creating
2187 .Ic mail Ns
2188 s, if the necessary user setup
2189 .Pf ( from , sender ) ;
2190 is available; then, it may also be created automatically, for example
2191 when list-replying via
2192 .Ic Lreply
2194 .Ic Lfollowup ,
2195 when
2196 .Ic followup
2198 .Ic reply
2199 is used and the messages
2200 .Ql Mail-Followup-To:
2201 is honoured etc.
2203 The commands
2204 .Ic mlist
2206 .Ic mlsubscribe
2207 manage \*(UAs notion of which addresses are mailing lists.
2208 With the \*(OPal regular expression support any address
2209 .Mx -ix "magic regular expression characters"
2210 which contains any of the magic regular expression characters
2211 .Ql ( ^[*+?|$ ;
2213 .Xr re_format 7
2215 .Xr regex 7 ,
2216 dependent on the host system)
2217 will be compiled and used as one, possibly matching many addresses.
2218 It is not possible to escape the
2219 .Dq magic :
2220 in order to match special characters as-is, bracket expressions must be
2221 used, for example
2222 .Ql Ic search Li @subject@'[[]open bracket' .
2223 .Bd -literal -offset indent
2224 ? set followup-to followup-to-honour=ask-yes \e
2225     reply-to-honour=ask-yes
2226 ? mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
2227 ? mlsubscribe a4@b4.c4 exact@lists.c3
2230 Known and subscribed lists differ in that for the latter the
2231 .Va user Ns
2232 s address is not part of a generated
2233 .Ql Mail-Followup-To: .
2234 There are exceptions, for example if multiple lists are addressed and
2235 not all have the subscription attribute.
2236 When replying to a message its list address
2237 .Pf ( Ql List-Post:
2238 header) is automatically and temporarily treated like a known
2239 .Ic mlist ;
2240 dependent on the variable
2241 .Va reply-to-honour
2242 an existing
2243 .Ql Reply-To:
2244 is used instead (if it is a single address on the same domain as
2245 .Ql List-Post: )
2246 in order to accept a list administrator's wish that is supposed to have
2247 been manifested like that.
2249 For convenience and compatibility with mail programs that do not honour
2250 the non-standard M-F-T, an automatic user entry in the carbon-copy
2251 .Ql Cc:
2252 address list of generated message can be created by setting
2253 .Va followup-to-add-cc .
2254 This entry will be added whenever the user will be placed in the
2255 .Ql Mail-Followup-To:
2256 list, and is not a regular addressee already.
2257 .Va reply-to-swap-in
2258 tries to deal with the address rewriting that many mailing-lists nowadays
2259 perform to work around DKIM / DMARC etc. standard imposed problems.
2260 .Ss "Signed and encrypted messages with S/MIME"
2261 \*(OP S/MIME provides two central mechanisms:
2262 message signing and message encryption.
2263 A signed message contains some data in addition to the regular text.
2264 The data can be used to verify that the message has been sent using
2265 a valid certificate, that the sender address matches that in the
2266 certificate, and that the message text has not been altered.
2267 Signing a message does not change its regular text;
2268 it can be read regardless of whether the recipients software is able to
2269 handle S/MIME.
2270 It is thus usually possible to sign all outgoing messages if so desired.
2272 Encryption, in contrast, makes the message text invisible for all people
2273 except those who have access to the secret decryption key.
2274 To encrypt a message, the specific recipients public encryption key
2275 must be known.
2276 It is therefore not possible to send encrypted mail to people unless their
2277 key has been retrieved from either previous communication or public key
2278 directories.
2279 Because signing is performed with private keys, and encryption with
2280 public keys, messages should always be signed before being encrypted.
2282 A central concept to S/MIME is that of the certification authority (CA).
2283 A CA is a trusted institution that issues certificates.
2284 For each of these certificates it can be verified that it really
2285 originates from the CA, provided that the CA's own certificate is
2286 previously known.
2287 A set of CA certificates is usually delivered and installed together
2288 with the cryptographical library that is used on the local system.
2289 Therefore reasonable security for S/MIME on the Internet is provided if
2290 the source that provides that library installation is trusted.
2291 It is also possible to use a specific pool of trusted certificates.
2292 If this is desired,
2293 .Va smime-ca-no-defaults
2294 should be set to avoid using the default certificate pool, and
2295 .Va smime-ca-file
2296 and/or
2297 .Va smime-ca-dir
2298 should be pointed to a trusted pool of certificates.
2299 A certificate cannot be more secure than the method its CA certificate
2300 has been retrieved with.
2302 This trusted pool of certificates is used by the command
2303 .Ic verify
2304 to ensure that the given S/MIME messages can be trusted.
2305 If so, verified sender certificates that were embedded in signed
2306 messages can be saved locally with the command
2307 .Ic certsave ,
2308 and used by \*(UA to encrypt further communication with these senders:
2309 .Bd -literal -offset indent
2310 ? certsave FILENAME
2311 ? set smime-encrypt-USER@HOST=FILENAME \e
2312     smime-cipher-USER@HOST=AES256
2315 To sign outgoing messages, in order to allow receivers to verify the
2316 origin of these messages, a personal S/MIME certificate is required.
2317 \*(UA supports password-protected personal certificates (and keys), see
2318 .Va smime-sign-cert .
2319 The section
2320 .Sx "On URL syntax and credential lookup"
2321 gives an overview of the possible sources of user credentials, and
2322 .Sx "S/MIME step by step"
2323 shows examplarily how a private S/MIME certificate can be obtained.
2324 In general, if such a private key plus certificate
2325 .Dq pair
2326 is available, all that needs to be done is to set some variables:
2327 .Bd -literal -offset indent
2328 ? set smime-sign-cert=ME@exam.ple.paired \e
2329     smime-sign-digest=SHA512 \e
2330     smime-sign from=myname@my.host
2333 Variables of interest for S/MIME in general are
2334 .Va smime-ca-dir ,
2335 .Va smime-ca-file ,
2336 .Va smime-ca-flags ,
2337 .Va smime-ca-no-defaults ,
2338 .Va smime-crl-dir ,
2339 .Va smime-crl-file .
2340 For S/MIME signing of interest are
2341 .Va smime-sign ,
2342 .Va smime-sign-cert ,
2343 .Va smime-sign-include-certs
2345 .Va smime-sign-digest .
2346 Additional variables of interest for S/MIME en- and decryption:
2347 .Va smime-cipher
2349 .Va smime-encrypt-USER@HOST .
2350 Variables of secondary interest may be
2351 .Va content-description-smime-message
2353 .Va content-description-smime-signature .
2354 S/MIME is available if
2355 .Ql ,+smime,
2356 is included in
2357 .Va features .
2359 \*(ID Note that neither S/MIME signing nor encryption applies to
2360 message subjects or other header fields yet.
2361 Thus they may not contain sensitive information for encrypted messages,
2362 and cannot be trusted even if the message content has been verified.
2363 When sending signed messages,
2364 it is recommended to repeat any important header information in the
2365 message text.
2366 .Ss "On URL syntax and credential lookup"
2367 For accessing protocol-specific resources Uniform Resource Locators
2368 (URL, RFC 3986) have become omnipresent.
2369 Here they are expected in a
2370 .Dq normalized
2371 variant, not used in data exchange, but only meant as a compact,
2372 easy-to-use way of defining and representing information in a well-known
2373 notation; as such they do not conform to any real standard.
2374 Optional parts are placed in brackets
2375 .Ql [] ,
2376 optional either because there also exist other ways to define the
2377 information, or because the part is protocol specific.
2378 .Ql /path
2379 for example is used by the \*(OPal Maildir
2380 .Ic folder
2381 type and the IMAP protocol, but not by POP3.
2383 .Ql USER
2385 .Ql PASSWORD
2386 are included in an URL server specification, URL percent encoded
2387 (RFC 3986) forms are needed, generable with
2388 .Ic urlcodec .
2390 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
2392 Often
2393 .Sx "INTERNAL VARIABLES"
2394 exist in multiple versions, called
2395 .Dq variable chains
2396 in this document: the plain
2397 .Ql variable
2398 as well as
2399 .Ql variable-HOST
2401 .Ql variable-USER@HOST .
2402 If a port was specified
2403 .Ql HOST
2404 really means
2405 .Ql server:port ,
2407 .Ql server .
2408 And this
2409 .Ql USER
2410 is never in URL percent encoded form.
2411 For example, whether the hypothetical
2412 .Ql smtp://\:wings\:%3A\:of\:@a.dove
2413 including user and password was used, or whether it was
2414 .Ql smtp://a.dove
2415 and it came from a different source, to lookup the chain
2416 .Va tls-config-pairs
2417 first
2418 .Ql tls-\:config-\:pairs-\:wings:of@a.dove
2419 is looked up, then
2420 .Ql tls-\:config-pairs\-\:a.dove ,
2421 before finally looking up the plain variable.
2423 The logic to collect (an
2424 .Ic account Ns
2425 s) credential information is as follows:
2426 .Bl -bullet
2428 A user is always required.
2429 If no
2430 .Ql USER
2431 has been given in the URL the variables
2432 .Va user-HOST
2434 .Va user
2435 are looked up.
2436 Afterwards, when enforced by the \*(OPal variables
2437 .Va netrc-lookup-HOST
2439 .Va netrc-lookup ,
2440 .Sx "The .netrc file"
2441 of the user will be searched for a
2442 .Ql HOST
2443 specific entry which provides a
2444 .Ql login
2445 name: only unambiguous entries are used (one possible matching entry for
2446 .Ql HOST ) .
2448 If there is still no
2449 .Ql USER
2450 then the verified
2451 .Ev LOGNAME ,
2452 known to be a valid user on the current host, is used.
2454 Authentication: unless otherwise noted the chain
2455 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
2456 is checked, falling back to a protocol-specific default as necessary.
2458 If no
2459 .Ql PASSWORD
2460 has been given in the URL, then if the
2461 .Ql USER
2462 has been found through the \*(OPal
2463 .Va netrc-lookup ,
2464 that may have also provided the password.
2465 Otherwise the chain
2466 .Va password-USER@HOST , password-HOST , password
2467 is looked up.
2469 Thereafter the (now complete) \*(OPal chain
2470 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
2471 is checked, if set the
2472 .Ic netrc
2473 cache is searched for a password only (multiple user accounts for
2474 a single machine may exist as well as a fallback entry without user
2475 but with a password).
2477 If at that point there is still no password available, but the
2478 (protocols') chosen authentication type requires a password, then in
2479 interactive mode the user will be prompted on the terminal.
2482 .Sy Note:
2483 S/MIME verification works relative to the values found in the
2484 .Ql From:
2486 .Ql Sender: )
2487 header field(s), which means the values of
2488 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
2490 .Va smime-sign-digest
2491 will not be looked up using the
2492 .Ql USER
2494 .Ql HOST
2495 chains from above, but instead use the corresponding values from the
2496 message that is being worked on.
2497 If no address matches we assume and use the setting of
2498 .Va from .
2499 In unusual cases multiple and different
2500 .Ql USER
2502 .Ql HOST
2503 combinations may therefore be involved \(en on the other hand those
2504 unusual cases become possible.
2505 The usual case is as short as:
2506 .Bd -literal -offset indent
2507 set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
2508     smime-sign smime-sign-cert=+smime.pair \e
2509     from=myname@my.host
2512 The section
2513 .Sx EXAMPLES
2514 contains complete example configurations.
2515 .Ss "Encrypted network communication"
2516 \*(OP SSL (Secure Sockets Layer) aka its successor TLS (Transport Layer
2517 Security) are protocols which aid in securing communication by providing
2518 a safely initiated and encrypted network connection.
2519 A central concept of TLS are certificates: as part of each network
2520 connection setup a (set of) certificates will be exchanged through which
2521 the identity of the network peer can be cryptographically verified;
2522 if possible the TLS/SNI (ServerNameIndication) extension will be enabled
2523 to allow servers fine-grained control over the certificates being used.
2524 A locally installed pool of trusted certificates will then be inspected,
2525 and verification will succeed if it contains a(n in)direct signer of the
2526 presented certificate(s).
2528 The local pool of trusted so-called CA (Certification Authority)
2529 certificates is usually delivered with and used along the TLS library.
2530 A custom pool of trusted certificates can be selected by pointing
2531 .Va tls-ca-file
2532 and/or (with special preparation)
2533 .Va tls-ca-dir
2534 to the desired location; setting
2535 .Va tls-ca-no-defaults
2536 in addition will avoid additional inspection of the default pool.
2537 A certificate cannot be more secure than the method its CA certificate
2538 has been retrieved with.
2539 For inspection or other purposes, the certificate of a server (as seen
2540 when connecting to it) can be fetched with the command
2541 .Ic tls
2542 (port can usually be the protocol name, too, and
2543 .Va tls-verify
2544 is taken into account here):
2545 .Bd -literal -offset indent
2546 $ \*(uA -vX 'tls certchain SERVER-URL[:PORT]; x'
2549 A local pool of CA certificates is not strictly necessary, however,
2550 server certificates can also be verified via their fingerprint.
2551 For this a message digest will be calculated and compared against the
2552 variable chain
2553 .Va tls-fingerprint ,
2554 and verification will succeed if the fingerprint matches.
2555 The message digest (algorithm) can be configured via the variable chain
2556 .Va tls-fingerprint-digest ;
2557 .Ic tls
2558 can again be used:
2559 .Bd -literal -offset indent
2560 $ \*(uA -X 'wysh set verbose; tls fingerprint SERVER-URL[:PORT]; x'
2563 It depends on the used protocol whether encrypted communication is
2564 possible, and which configuration steps have to be taken to enable it.
2565 Some protocols, like POP3S, are implicitly encrypted, others, like
2566 POP3, can upgrade a plain text connection if so requested.
2567 For example, to use the
2568 .Ql STLS
2569 that POP3 offers (a member of) the variable (chain)
2570 .Va pop3-use-starttls
2571 needs to be set, with convenience via
2572 .Ic shortcut :
2573 .Bd -literal -offset indent
2574 shortcut encpop1 pop3s://pop1.exam.ple
2576 shortcut encpop2 pop3://pop2.exam.ple
2577 set pop3-use-starttls-pop2.exam.ple
2579 set mta=smtps://smtp.exam.ple:465
2580 set mta=smtp://smtp.exam.ple smtp-use-starttls
2583 Normally that is all there is to do, given that TLS libraries try to
2584 provide safe defaults, plenty of knobs however exist to adjust settings.
2585 For example certificate verification settings can be fine-tuned via
2586 .Va tls-ca-flags ,
2587 and the TLS configuration basics are accessible via
2588 .Va tls-config-pairs ,
2589 for example to control protocol versions or cipher lists.
2590 In the past hints on how to restrict the set of protocols to highly
2591 secure ones were indicated, but as of the time of this writing the list
2592 of protocols or ciphers may need to become relaxed in order to be able
2593 to connect to some servers; the following example allows connecting to a
2594 .Dq Lion
2595 that uses OpenSSL 0.9.8za from June 2014 (refer to
2596 .Sx "INTERNAL VARIABLES"
2597 for more on variable chains):
2598 .Bd -literal -offset indent
2599 wysh set tls-config-pairs-lion@exam.ple='MinProtocol=TLSv1.1,\e
2600     CipherString=TLSv1.2:!aNULL:!eNULL:\e
2601       ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
2602       DHE-RSA-AES256-SHA:@STRENGTH'
2605 The OpenSSL program
2606 .Xr ciphers 1
2607 should be referred to when creating a custom cipher list.
2608 Variables of interest for TLS in general are
2609 .Va tls-ca-dir ,
2610 .Va tls-ca-file ,
2611 .Va tls-ca-flags ,
2612 .Va tls-ca-no-defaults ,
2613 .Va tls-config-file ,
2614 .Va tls-config-module ,
2615 .Va tls-config-pairs ,
2616 .Va tls-crl-dir ,
2617 .Va tls-crl-file ,
2618 .Va tls-rand-file
2619 as well as
2620 .Va tls-verify .
2621 Also see
2622 .Va tls-features .
2623 TLS is available if
2624 .Ql +tls
2625 is included in
2626 .Va features .
2627 .Ss "Character sets"
2628 \*(OP The user's locale environment is detected by looking at the
2629 .Ev LC_ALL
2630 environment variable.
2631 The internal variable
2632 .Va ttycharset
2633 will be set to the detected terminal character set accordingly,
2634 and will thus show up in the output of commands like
2635 .Ic set
2637 .Ic varshow .
2638 This character set will be targeted when trying to display data,
2639 and user input data is expected to be in this character set, too.
2641 When creating messages their character input data is classified.
2642 7-bit clean text data and attachments will be classified as
2643 .Va charset-7bit .
2644 8-bit data will \*(OPally be converted into members of
2645 .Va sendcharsets
2646 until a character set conversion succeeds.
2647 .Va charset-8bit
2648 is the implied default last member of this list.
2649 If no 8-bit character set is capable to represent input data,
2650 no message will be sent, and its text will optionally be
2651 .Va save Ns d
2653 .Ev DEAD .
2654 If that is not acceptable, for example in script environments,
2655 .Va mime-force-sendout
2656 can be set to force sending of non-convertible data as
2657 .Ql application/octet-stream
2658 classified binary content instead: like this receivers still have the
2659 option to inspect message content (for example via
2660 .Va mime-counter-evidence ) .
2661 If the \*(OPal character set conversion is not available
2662 .Pf ( Va features
2663 misses
2664 .Ql ,+iconv, ) ,
2665 .Va ttycharset
2666 is the only supported character set for non 7-bit clean data, and
2667 it is simply assumed it can be used to exchange 8-bit messages.
2669 .Va ttycharset
2670 may also be given an explicit value to send mail in a completely
2671 .Dq faked
2672 locale environment, which can be used to generate and send for
2673 example 8-bit UTF-8 input data in a pure 7-bit US-ASCII
2674 .Ql LC_ALL=C
2675 environment (an example of this can be found in the section
2676 .Sx "On sending mail, and non-interactive mode" ) .
2677 Due to lack of programming interfaces reading mail will not really work
2678 as expected in a faked environment: whereas
2679 .Va ttycharset
2680 might be addressable, any output will be made safely printable, as via
2681 .Ic vexpr
2682 .Cm makeprint ,
2683 according to the actual locale environment, which is not affected by
2684 .Va ttycharset.
2686 Classifying 7-bit clean data as
2687 .Va charset-7bit
2688 is a problem if the input character set
2689 .Pf ( Va ttycharset )
2690 is a multibyte character set that is itself 7-bit clean.
2691 For example, the Japanese character set ISO-2022-JP is, but is capable
2692 to encode the rich set of Japanese Kanji, Hiragana and Katakana
2693 characters: in order to notify receivers of this character set the mail
2694 message must be MIME encoded so that the character set ISO-2022-JP can
2695 be advertised, otherwise an invalid email message would result!
2696 To achieve this, the variable
2697 .Va charset-7bit
2698 can be set to ISO-2022-JP.
2699 (Today a better approach regarding email is the usage of UTF-8, which
2700 uses 8-bit bytes for non-US-ASCII data.)
2702 When replying to a message and the variable
2703 .Va reply-in-same-charset
2704 is set, the character set of the message being replied to is tried first
2705 as a target character set (still being a subject of
2706 .Ic charsetalias
2707 filtering, however).
2708 Another opportunity is
2709 .Va sendcharsets-else-ttycharset
2710 to reflect the user's locale environment automatically, it will treat
2711 .Va ttycharset
2712 as an implied member of (an unset)
2713 .Va sendcharsets .
2715 \*(OP When reading messages, their text data is converted into
2716 .Va ttycharset
2717 as necessary in order to display them on the user's terminal.
2718 Unprintable characters and invalid byte sequences are detected
2719 and replaced by substitution characters.
2720 Character set mappings for source character sets can be established with
2721 .Ic charsetalias ,
2722 which may be handy to work around faulty or incomplete character set
2723 catalogues (one could for example add a missing LATIN1 to ISO-8859-1
2724 mapping), or to enforce treatment of one character set as another one
2725 .Pf ( Dq interpret LATIN1 as CP1252 ) .
2726 Also see
2727 .Va charset-unknown-8bit
2728 to deal with another hairy aspect of message interpretation.
2730 In general, if a message saying
2731 .Dq cannot convert from a to b
2732 appears, either some characters are not appropriate for the currently
2733 selected (terminal) character set,
2734 or the needed conversion is not supported by the system.
2735 In the first case, it is necessary to set an appropriate
2736 .Ev LC_CTYPE
2737 locale and/or the variable
2738 .Va ttycharset .
2739 The best results are usually achieved when running in a UTF-8
2740 locale on a UTF-8 capable terminal, in which case the full Unicode
2741 spectrum of characters is available.
2742 In this setup characters from various countries can be displayed,
2743 while it is still possible to use more simple character sets for sending
2744 to retain maximum compatibility with older mail clients.
2746 On the other hand the POSIX standard defines a locale-independent 7-bit
2747 .Dq portable character set
2748 that should be used when overall portability is an issue, the even more
2749 restricted subset named
2750 .Dq portable filename character set
2751 consists of A-Z, a-z, 0-9, period
2752 .Ql \&. ,
2753 underscore
2754 .Ql _
2755 and hyphen-minus
2756 .Ql - .
2757 .Ss "Message states"
2758 \*(UA differentiates in between several message states; the current
2759 state will be reflected in the summary of
2760 .Ic headers
2761 if the
2762 .Va attrlist
2763 of the configured
2764 .Va headline
2765 allows, and
2766 .Sx "Specifying messages"
2767 dependent on their state is possible.
2768 When operating on the system
2769 .Va inbox ,
2770 or in any other
2771 .Mx -sx
2772 .Sx "primary system mailbox" ,
2773 special actions, like the automatic moving of messages to the
2774 .Mx -sx
2775 .Sx "secondary mailbox"
2776 .Ev MBOX ,
2777 may be applied when the mailbox is left (also implicitly by program
2778 termination, unless the command
2779 .Ic exit
2780 was used) \(en however, because this may be irritating to users which
2781 are used to
2782 .Dq more modern
2783 mail-user-agents, the provided global
2784 .Pa \*(UR
2785 template sets the internal
2786 .Va hold
2788 .Va keepsave
2789 variables in order to suppress this behaviour.
2790 .Bl -hang -width ".It Ql new"
2791 .It Ql new
2792 Message has neither been viewed nor moved to any other state.
2793 Such messages are retained even in the
2794 .Mx -sx
2795 .Sx "primary system mailbox" .
2796 .It Ql unread
2797 Message has neither been viewed nor moved to any other state, but the
2798 message was present already when the mailbox has been opened last:
2799 Such messages are retained even in the
2800 .Mx -sx
2801 .Sx "primary system mailbox" .
2802 .It Ql read
2803 The message has been processed by one of the following commands:
2804 .Ic ~f ,
2805 .Ic ~m ,
2806 .Ic ~F ,
2807 .Ic ~M ,
2808 .Ic copy ,
2809 .Ic mbox ,
2810 .Ic next ,
2811 .Ic pipe  ,
2812 .Ic Print ,
2813 .Ic print ,
2814 .Ic top ,
2815 .Ic Type ,
2816 .Ic type ,
2817 .Ic undelete .
2818 The commands
2819 .Ic dp
2821 .Ic dt
2822 will always try to automatically
2823 .Dq step
2825 .Ic type
2827 .Dq next
2828 logical message, and may thus mark multiple messages as read, the
2829 .Ic delete
2830 command will do so if the internal variable
2831 .Va autoprint
2832 is set.
2834 Except when the
2835 .Ic exit
2836 command is used, messages that are in a
2837 .Mx -sx
2838 .Sx "primary system mailbox"
2839 and are in
2840 .Ql read
2841 state when the mailbox is left will be saved in the
2842 .Mx -sx
2843 .Sx "secondary mailbox"
2844 .Ev MBOX
2845 unless the internal variable
2846 .Va hold
2847 it set.
2848 .It Ql deleted
2849 The message has been processed by one of the following commands:
2850 .Ic delete ,
2851 .Ic dp ,
2852 .Ic dt .
2853 Only
2854 .Ic undelete
2855 can be used to access such messages.
2856 .It Ql preserved
2857 The message has been processed by a
2858 .Ic preserve
2859 command and it will be retained in its current location.
2860 .It Ql saved
2861 The message has been processed by one of the following commands:
2862 .Ic save
2864 .Ic write .
2865 Unless when the
2866 .Ic exit
2867 command is used, messages that are in a
2868 .Mx -sx
2869 .Sx "primary system mailbox"
2870 and are in
2871 .Ql saved
2872 state when the mailbox is left will be deleted; they will be saved in the
2873 .Mx -sx
2874 .Sx "secondary mailbox"
2875 .Ev MBOX
2876 when the internal variable
2877 .Va keepsave
2878 is set.
2881 In addition to these message states, flags which otherwise have no
2882 technical meaning in the mail system except allowing special ways of
2883 addressing them when
2884 .Sx "Specifying messages"
2885 can be set on messages.
2886 These flags are saved with messages and are thus persistent, and are
2887 portable between a set of widely used MUAs.
2888 .Bl -hang -width ".It Ic answered"
2889 .It Ic answered
2890 Mark messages as having been answered.
2891 .It Ic draft
2892 Mark messages as being a draft.
2893 .It Ic flag
2894 Mark messages which need special attention.
2896 .Ss "Specifying messages"
2897 \*(NQ
2898 .Ic COMMANDS
2899 which take
2900 .Sx "Message list arguments" ,
2901 such as
2902 .Ic search ,
2903 .Ic type ,
2904 .Ic copy ,
2906 .Ic delete ,
2907 can perform actions on a number of messages at once.
2908 Specifying invalid messages, or using illegal syntax, will cause errors
2909 to be reported through the
2910 .Sx "INTERNAL VARIABLES"
2911 .Va \&! ,
2912 .Va ^ERR
2913 and companions, as well as the command exit status
2914 .Va \&? .
2916 For example,
2917 .Ql delete 1 2
2918 deletes the messages 1 and 2,
2919 whereas
2920 .Ql delete 1-5
2921 will delete the messages 1 through 5.
2922 In sorted or threaded mode (see the
2923 .Ic sort
2924 command),
2925 .Ql delete 1-5
2926 will delete the messages that are located between (and including)
2927 messages 1 through 5 in the sorted/threaded order, as shown in the
2928 .Ic headers
2929 summary.
2931 Errors can for example be
2932 .Va ^ERR Ns -BADMSG
2933 when requesting an invalid message,
2934 .Va ^ERR Ns -NOMSG
2935 if no applicable message can be found,
2936 .Va ^ERR Ns -CANCELED
2937 for missing informational data (mostly thread-related).
2938 .Va ^ERR Ns -INVAL
2939 for invalid syntax as well as
2940 .Va ^ERR Ns -IO
2941 for input/output errors can happen.
2942 The following special message names exist:
2943 .Bl -tag -width ".It Ar BaNg"
2944 .It Ar \&.
2945 The current message, the so-called
2946 .Dq dot .
2947 .It Ar \&;
2948 The message that was previously the current message; needs to be quoted.
2949 .It Ar \&,
2950 The parent message of the current message,
2951 that is the message with the Message-ID given in the
2952 .Ql In-Reply-To:
2953 field or the last entry of the
2954 .Ql References:
2955 field of the current message.
2956 .It Ar -
2957 The previous undeleted message, or the previous deleted message for the
2958 .Ic undelete
2959 command; In
2960 .Ic sort Ns
2961 ed or
2962 .Ql thread Ns
2963 ed mode, the previous such message in the according order.
2964 .It Ar +
2965 The next undeleted message, or the next deleted message for the
2966 .Ic undelete
2967 command; In
2968 .Ic sort Ns
2969 ed or
2970 .Ql thread Ns
2971 ed mode, the next such message in the according order.
2972 .It Ar ^
2973 The first undeleted message,
2974 or the first deleted message for the
2975 .Ic undelete
2976 command; In
2977 .Ic sort Ns
2978 ed or
2979 .Ql thread Ns
2980 ed mode, the first such message in the according order.
2981 .It Ar $
2982 The last message; In
2983 .Ic sort Ns
2984 ed or
2985 .Ql thread Ns
2986 ed mode, the last such message in the according order.
2987 Needs to be quoted.
2988 .It Ar & Ns Ar x
2990 .Ql thread Ns
2992 .Ic sort
2993 mode, selects the message addressed with
2994 .Ar x ,
2995 where
2996 .Ar x
2997 is any other message specification,
2998 and all messages from the thread that begins at it.
2999 Otherwise it is identical to
3000 .Ar x .
3002 .Ar x
3003 is omitted,
3004 the thread beginning with the current message is selected.
3005 .It Ar *
3006 All messages.
3007 .It Ar `
3008 All messages that were included in the
3009 .Sx "Message list arguments"
3010 of the previous command; needs to be quoted.
3011 (A convenient way to read all new messages is to select them via
3012 .Ql from :n ,
3013 as below, and then to read them in order with the default command \(em
3014 .Ic next
3015 \(em simply by successively typing
3016 .Ql ` ;
3017 for this to work
3018 .Va showlast
3019 must be set.)
3020 .It Ar x-y
3021 An inclusive range of message numbers.
3022 Selectors that may also be used as endpoints include any of
3023 .Ar .;-+^$ .
3024 .It Ar address
3025 A case-insensitive
3026 .Dq any substring matches
3027 search against the
3028 .Ql From:
3029 header, which will match addresses (too) even if
3030 .Va showname
3031 is set (and POSIX says
3032 .Dq any address as shown in a header summary shall be matchable in this form ) ;
3033 However, if the
3034 .Va allnet
3035 variable is set, only the local part of the address is evaluated
3036 for the comparison, not ignoring case, and the setting of
3037 .Va showname
3038 is completely ignored.
3039 For finer control and match boundaries use the
3040 .Ql @
3041 search expression.
3042 .It Ar / Ns Ar string
3043 All messages that contain
3044 .Ar string
3045 in the subject field (case ignored according to locale).
3046 See also the
3047 .Va searchheaders
3048 variable.
3050 .Ar string
3051 is empty,
3052 the string from the previous specification of that type is used again.
3053 .It Xo Op Ar @ Ns Ar name-list Ns
3054 .Ar @ Ns Ar expr
3056 All messages that contain the given case-insensitive search
3057 .Ar expr Ns
3058 ession;  If the \*(OPal regular expression support is available
3059 .Ar expr
3060 will be interpreted as (an extended) one if any of the
3061 .Mx -sx
3062 .Sx "magic regular expression characters"
3063 is seen.
3064 If the optional
3065 .Ar @ Ns Ar name-list
3066 part is missing the search is restricted to the subject field body,
3067 but otherwise
3068 .Ar name-list
3069 specifies a comma-separated list of header fields to search, for example
3071 .Dl '@to,from,cc@Someone i ought to know'
3073 In order to search for a string that includes a
3074 .Ql @
3075 (commercial at) character the
3076 .Ar name-list
3077 is effectively non-optional, but may be given as the empty string.
3078 Also, specifying an empty search
3079 .Ar expr Ns
3080 ession will effectively test for existence of the given header fields.
3081 Some special header fields may be abbreviated:
3082 .Ql f ,
3083 .Ql t ,
3084 .Ql c ,
3085 .Ql b
3087 .Ql s
3088 will match
3089 .Ql From ,
3090 .Ql To ,
3091 .Ql Cc ,
3092 .Ql Bcc
3094 .Ql Subject ,
3095 respectively and case-insensitively.
3096 \*(OPally, and just like
3097 .Ar expr ,
3098 .Ar name-list
3099 will be interpreted as (an extended) regular expression if any of the
3100 .Mx -sx
3101 .Sx "magic regular expression characters"
3102 is seen.
3104 The special names
3105 .Ql header
3107 .Ql <
3108 can be used to search in (all of) the header(s) of the message, and the
3109 special names
3110 .Ql body
3112 .Ql >
3114 .Ql text
3116 .Ql =
3117 will perform full text searches \(en whereas the former searches only
3118 the body, the latter also searches the message header (\*(ID this mode
3119 yet brute force searches over the entire decoded content of messages,
3120 including administrativa strings).
3122 This specification performs full text comparison, but even with
3123 regular expression support it is almost impossible to write a search
3124 expression that safely matches only a specific address domain.
3125 To request that the body content of the header is treated as a list of
3126 addresses, and to strip those down to the plain email address which the
3127 search expression is to be matched against, prefix the effective
3128 .Ar name-list
3129 with a tilde
3130 .Ql ~ :
3132 .Dl '@~f,c@@a\e.safe\e.domain\e.match$'
3133 .It Ar :c
3134 All messages of state or with matching condition
3135 .Ql c ,
3136 where
3137 .Ql c
3138 is one or multiple of the following colon modifiers:
3140 .Bl -tag -compact -width ".It Ar :M"
3141 .It Ar a
3142 .Ic answered
3143 messages (cf. the variable
3144 .Va markanswered ) .
3145 .It Ar d
3146 .Ql deleted
3147 messages (for the
3148 .Ic undelete
3150 .Ic from
3151 commands only).
3152 .It Ar f
3153 .Ic flag Ns
3154 ged messages.
3155 .It Ar L
3156 Messages with receivers that match
3157 .Ic mlsubscribe Ns
3158 d addresses.
3159 .It Ar l
3160 Messages with receivers that match
3161 .Ic mlist Ns
3162 ed addresses.
3163 .It Ar n
3164 .Ql new
3165 messages.
3166 .It Ar o
3167 Old messages (any not in state
3168 .Ql read
3170 .Ql new ) .
3171 .It Ar r
3172 .Ql read
3173 messages.
3174 .It Ar S
3175 \*(OP Messages with unsure spam classification (see
3176 .Sx "Handling spam" ) .
3177 .It Ar s
3178 \*(OP Messages classified as spam.
3179 .It Ar t
3180 Messages marked as
3181 .Ic draft .
3182 .It Ar u
3183 .Ql unread
3184 messages.
3188 \*(OP IMAP-style SEARCH expressions may also be used.
3189 These consist of keywords and criterions, and because
3190 .Sx "Message list arguments"
3191 are split into tokens according to
3192 .Sx "Shell-style argument quoting"
3193 it is necessary to quote the entire IMAP search expression in order to
3194 ensure that it remains a single token.
3195 This addressing mode is available with all types of mailbox
3196 .Ic folder Ns
3197 s; \*(UA will perform the search locally as necessary.
3198 Strings must be enclosed by double quotation marks
3199 .Ql \&"
3200 in their entirety if they contain whitespace or parentheses;
3201 within the quotes, only reverse solidus
3202 .Ql \e
3203 is recognized as an escape character.
3204 All string searches are case-insensitive.
3205 When the description indicates that the
3206 .Dq envelope
3207 representation of an address field is used,
3208 this means that the search string is checked against both a list
3209 constructed as
3210 .Bd -literal -offset indent
3211 \&'(\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)'
3214 for each address,
3215 and the addresses without real names from the respective header field.
3216 These search expressions can be nested using parentheses, see below for
3217 examples.
3219 .Bl -tag -compact -width ".It Ar _n_u"
3220 .It Ar ( criterion )
3221 All messages that satisfy the given
3222 .Ar criterion .
3223 .It Ar ( criterion1 criterion2 ... criterionN )
3224 All messages that satisfy all of the given criteria.
3225 .It Ar ( or criterion1 criterion2 )
3226 All messages that satisfy either
3227 .Ar criterion1
3229 .Ar criterion2 ,
3230 or both.
3231 To connect more than two criteria using
3232 .Ql or
3233 specifications have to be nested using additional parentheses,
3234 as with
3235 .Ql (or a (or b c)) ,
3236 since
3237 .Ql (or a b c)
3238 really means
3239 .Ql ((a or b) and c) .
3240 For a simple
3241 .Ql or
3242 operation of independent criteria on the lowest nesting level,
3243 it is possible to achieve similar effects by using three separate
3244 criteria, as with
3245 .Ql (a) (b) (c) .
3246 .It Ar ( not criterion )
3247 All messages that do not satisfy
3248 .Ar criterion .
3249 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
3250 All messages that contain
3251 .Ar string
3252 in the envelope representation of the
3253 .Ql Bcc:
3254 field.
3255 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
3256 All messages that contain
3257 .Ar string
3258 in the envelope representation of the
3259 .Ql Cc:
3260 field.
3261 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
3262 All messages that contain
3263 .Ar string
3264 in the envelope representation of the
3265 .Ql From:
3266 field.
3267 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
3268 All messages that contain
3269 .Ar string
3270 in the
3271 .Ql Subject:
3272 field.
3273 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
3274 All messages that contain
3275 .Ar string
3276 in the envelope representation of the
3277 .Ql To:
3278 field.
3279 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
3280 All messages that contain
3281 .Ar string
3282 in the specified
3283 .Ql Name:
3284 field.
3285 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
3286 All messages that contain
3287 .Ar string
3288 in their body.
3289 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
3290 All messages that contain
3291 .Ar string
3292 in their header or body.
3293 .It Ar ( larger size )
3294 All messages that are larger than
3295 .Ar size
3296 (in bytes).
3297 .It Ar ( smaller size )
3298 All messages that are smaller than
3299 .Ar size
3300 (in bytes).
3301 .It Ar ( before date )
3302 All messages that were received before
3303 .Ar date ,
3304 which must be in the form
3305 .Ql d[d]-mon-yyyy ,
3306 where
3307 .Ql d
3308 denotes the day of the month as one or two digits,
3309 .Ql mon
3310 is the name of the month \(en one of
3311 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
3313 .Ql yyyy
3314 is the year as four digits, for example
3315 .Ql 28-Dec-2012 .
3316 .It Ar ( on date )
3317 All messages that were received on the specified date.
3318 .It Ar ( since date )
3319 All messages that were received since the specified date.
3320 .It Ar ( sentbefore date )
3321 All messages that were sent on the specified date.
3322 .It Ar ( senton date )
3323 All messages that were sent on the specified date.
3324 .It Ar ( sentsince date )
3325 All messages that were sent since the specified date.
3326 .It Ar ()
3327 The same criterion as for the previous search.
3328 This specification cannot be used as part of another criterion.
3329 If the previous command line contained more than one independent
3330 criterion then the last of those criteria is used.
3332 .Ss "On terminal control and line editor"
3333 \*(OP Terminal control through one of the standard
3335 libraries,
3336 .Lb libtermcap
3338 .Lb libterminfo ,
3339 may be available.
3340 For the
3341 .Ev TERM Ns
3342 inal defined in the environment interactive usage aspects, for example
3343 .Sx "Coloured display" ,
3344 and insight of cursor and function keys for the Mailx-Line-Editor
3345 (MLE), will be enhanced or enabled.
3346 Library interaction can be disabled on a per-invocation basis via
3347 .Va termcap-disable ,
3348 whereas the internal variable
3349 .Va termcap
3350 is always used as a preferred source of terminal capabilities.
3351 (For a usage example see the
3352 .Sx FAQ
3353 entry
3354 .Sx "Not \(dqdefunctional\(dq, but the editor key does not work" . )
3356 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
3357 environments which comply to the ISO C standard
3358 .St -isoC-amd1 ,
3359 and will support wide glyphs if possible (the necessary functionality
3360 had been removed from ISO C, but was included in
3361 .St -xpg4 ) .
3362 Usage of a line editor in interactive mode can be prevented by setting
3363 .Va line-editor-disable .
3364 Especially if the \*(OPal terminal control support is missing setting
3365 entries in
3366 .Va termcap
3367 will help shall the MLE misbehave, see there for more.
3368 The MLE can support a little bit of
3369 .Ic colour .
3371 \*(OP If the
3372 .Ic history
3373 feature is available then input from line editor prompts will be saved
3374 in a history list that can be searched in and be expanded from.
3375 Such saving can be prevented by prefixing input with any amount of
3376 whitespace.
3377 Aspects of history, like allowed content and maximum size, as well as
3378 whether history shall be saved persistently, can be configured with the
3379 internal variables
3380 .Va history-file ,
3381 .Va history-gabby ,
3382 .Va history-gabby-persist
3384 .Va history-size .
3385 There also exists the macro hook
3386 .Va on-history-addition
3387 which can be used to apply finer control on what enters history.
3389 The MLE supports a set of editing and control commands.
3390 By default (as) many (as possible) of these will be assigned to a set of
3391 single-letter control codes, which should work on any terminal (and can
3392 be generated by holding the
3393 .Dq control
3394 key while pressing the key of desire, for example
3395 .Ql control-D ) .
3396 If the \*(OPal
3397 .Ic bind
3398 command is available then the MLE commands can also be accessed freely
3399 by assigning the command name, which is shown in parenthesis in the list
3400 below, to any desired key-sequence, and the MLE will instead and also use
3401 .Ic bind
3402 to establish its built-in key bindings
3403 (more of them if the \*(OPal terminal control is available),
3404 an action which can then be suppressed completely by setting
3405 .Va line-editor-no-defaults .
3406 .Sx "Shell-style argument quoting"
3407 notation is used in the following:
3409 .Bl -tag -compact -width ".It Ql \eBa"
3410 .It Ql \ecA
3411 Go to the start of the line
3413 .Pf ( Cd mle-go-home ) .
3414 .It Ql \ecB
3415 Move the cursor backward one character
3417 .Pf ( Cd mle-go-bwd ) .
3418 .It Ql \ecC
3419 .Xr raise 3
3420 .Ql SIGINT
3422 .Pf ( Cd mle-raise-int ) .
3423 .It Ql \ecD
3424 Forward delete the character under the cursor;
3425 quits \*(UA if used on the empty line unless the internal variable
3426 .Va ignoreeof
3427 is set
3429 .Pf ( Cd mle-del-fwd ) .
3430 .It Ql \ecE
3431 Go to the end of the line
3433 .Pf ( Cd mle-go-end ) .
3434 .It Ql \ecF
3435 Move the cursor forward one character
3437 .Pf ( Cd mle-go-fwd ) .
3438 .It Ql \ecG
3439 Cancel current operation, full reset.
3440 If there is an active history search or tabulator expansion then this
3441 command will first reset that, reverting to the former line content;
3442 thus a second reset is needed for a full reset in this case
3444 .Pf ( Cd mle-reset ) .
3445 .It Ql \ecH
3446 Backspace: backward delete one character
3448 .Pf ( Cd mle-del-bwd ) .
3449 .It Ql \ecI
3450 \*(NQ
3451 Horizontal tabulator:
3452 try to expand the word before the cursor, supporting the usual
3453 .Sx "Filename transformations"
3455 .Pf ( Cd mle-complete ;
3456 this is affected by
3457 .Cd mle-quote-rndtrip
3459 .Va line-editor-cpl-word-breaks ) .
3460 .It Ql \ecJ
3461 Newline:
3462 commit the current line
3464 .Pf ( Cd mle-commit ) .
3465 .It Ql \ecK
3466 Cut all characters from the cursor to the end of the line
3468 .Pf ( Cd mle-snarf-end ) .
3469 .It Ql \ecL
3470 Repaint the line
3472 .Pf ( Cd mle-repaint ) .
3473 .It Ql \ecN
3474 \*(OP Go to the next history entry
3476 .Pf ( Cd mle-hist-fwd ) .
3477 .It Ql \ecO
3478 (\*(OPally context-dependent) Invokes the command
3479 .Ic dt .
3480 .It Ql \ecP
3481 \*(OP Go to the previous history entry
3483 .Pf ( Cd mle-hist-bwd ) .
3484 .It Ql \ecQ
3485 Toggle roundtrip mode shell quotes, where produced,
3486 on and off
3488 .Pf ( Cd mle-quote-rndtrip ) .
3489 This setting is temporary, and will be forgotten once the command line
3490 is committed; also see
3491 .Ic shcodec .
3492 .It Ql \ecR
3493 \*(OP Complete the current line from (the remaining) older history entries
3495 .Pf ( Cd mle-hist-srch-bwd ) .
3496 .It Ql \ecS
3497 \*(OP Complete the current line from (the remaining) newer history entries
3499 .Pf ( Cd mle-hist-srch-fwd ) .
3500 .It Ql \ecT
3501 Paste the snarf buffer
3503 .Pf ( Cd mle-paste ) .
3504 .It Ql \ecU
3505 The same as
3506 .Ql \ecA
3507 followed by
3508 .Ql \ecK
3510 .Pf ( Cd mle-snarf-line ) .
3511 .It Ql \ecV
3512 Prompts for a Unicode character (hexadecimal number without prefix, see
3513 .Ic vexpr )
3514 to be inserted
3516 .Pf ( Cd mle-prompt-char ) .
3517 Note this command needs to be assigned to a single-letter control code
3518 in order to become recognized and executed during input of
3519 a key-sequence (only three single-letter control codes can be used for
3520 that shortcut purpose); this control code is then special-treated and
3521 thus cannot be part of any other sequence (because it will trigger the
3522 .Cd \&\&mle-prompt-char
3523 function immediately).
3524 .It Ql \ecW
3525 Cut the characters from the one preceding the cursor to the preceding
3526 word boundary
3528 .Pf ( Cd mle-snarf-word-bwd ) .
3529 .It Ql \ecX
3530 Move the cursor forward one word boundary
3532 .Pf ( Cd mle-go-word-fwd ) .
3533 .It Ql \ecY
3534 Move the cursor backward one word boundary
3536 .Pf ( Cd mle-go-word-bwd ) .
3537 .It Ql \ecZ
3538 .Xr raise 3
3539 .Ql SIGTSTP
3541 .Pf ( Cd mle-raise-tstp ) .
3542 .It Ql \ec[
3543 Escape: reset a possibly used multibyte character input state machine
3544 and \*(OPally a lingering, incomplete key binding
3546 .Pf ( Cd mle-cancel ) .
3547 This command needs to be assigned to a single-letter control code in
3548 order to become recognized and executed during input of a key-sequence
3549 (only three single-letter control codes can be used for that shortcut
3550 purpose).
3551 This control code may also be part of a multi-byte sequence, but if
3552 a sequence is active and the very control code is currently also an
3553 expected input, then the active sequence takes precedence and will
3554 consume the control code.
3555 .It Ql \ec\e
3556 (\*(OPally context-dependent) Invokes the command
3557 .Ql Ic z Ns + .
3558 .It Ql \ec]
3559 (\*(OPally context-dependent) Invokes the command
3560 .Ql Ic z Ns $ .
3561 .It Ql \ec^
3562 (\*(OPally context-dependent) Invokes the command
3563 .Ql Ic z Ns 0 .
3564 .It Ql \ec_
3565 Cut the characters from the one after the cursor to the succeeding word
3566 boundary
3568 .Pf ( Cd mle-snarf-word-fwd ) .
3569 .It Ql \ec?
3570 Backspace:
3571 .Cd mle-del-bwd .
3572 .It \(en
3574 .Cd mle-bell :
3575 ring the audible bell.
3576 .It \(en
3577 \*(OP
3579 .Cd mle-clear-screen :
3580 move the cursor home and clear the screen.
3581 .It \(en
3583 .Cd mle-fullreset :
3584 different to
3585 .Cd mle-reset
3586 this will immediately reset a possibly active search etc.
3587 .It \(en
3589 .Cd mle-go-screen-bwd :
3590 move the cursor backward one screen width.
3591 .It \(en
3593 .Cd mle-go-screen-fwd :
3594 move the cursor forward one screen width.
3595 .It \(en
3597 .Cd mle-raise-quit:
3598 .Xr raise 3
3599 .Ql SIGQUIT .
3601 .Ss "Coloured display"
3602 \*(OP Colours and font attributes through ANSI a.k.a. ISO 6429 SGR
3603 (select graphic rendition) escape sequences are optionally supported.
3604 Usage of colours and font attributes solely depends upon the
3605 capability of the detected terminal type
3606 .Pf ( Ev TERM ) ,
3607 and as fine-tuned through
3608 .Va termcap .
3609 Colours and font attributes can be managed with the multiplexer command
3610 .Ic colour ,
3612 .Ic uncolour
3613 removes the given mappings.
3614 Setting
3615 .Va colour-disable
3616 suppresses usage of colour and font attribute sequences, while leaving
3617 established mappings unchanged.
3619 Whether actually applicable colour and font attribute sequences should
3620 also be generated when output is going to be paged through the external
3621 .Ev PAGER
3622 (also see
3623 .Va crt Ns
3624 ) depends upon the setting of
3625 .Va colour-pager ,
3626 because pagers usually need to be configured in order to support ISO
3627 escape sequences.
3628 Knowledge of some widely used pagers is however built-in, and in a clean
3629 environment it is often enough to simply set
3630 .Va colour-pager ;
3631 please refer to that variable for more on this topic.
3633 It might make sense to conditionalize colour setup on interactive mode via
3634 .Ic if
3635 .Pf ( Ql terminal
3636 indeed means
3637 .Dq interactive ) :
3638 .Bd -literal -offset indent
3639 if terminal && "$features" =% ,+colour,
3640   colour iso view-msginfo ft=bold,fg=green
3641   colour iso view-header ft=bold,fg=red (from|subject) # regex
3642   colour iso view-header fg=red
3644   uncolour iso view-header from,subject
3645   colour iso view-header ft=bold,fg=magenta,bg=cyan
3646   colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
3647   colour mono view-header ft=bold
3648   colour mono view-header ft=bold,ft=reverse subject,from
3649 endif
3651 .Ss "Handling spam"
3652 \*(OP \*(UA can make use of several spam interfaces for the purpose of
3653 identification of, and, in general, dealing with spam messages.
3654 A precondition of most commands in order to function is that the
3655 .Va spam-interface
3656 variable is set to one of the supported interfaces.
3657 .Sx "Specifying messages"
3658 that have been identified as spam is possible via their (volatile)
3659 .Ql is-spam
3660 state by using the
3661 .Ql Ar :s
3663 .Ql Ar :S
3664 specifications, and their
3665 .Va attrlist
3666 entries will be used when displaying the
3667 .Va headline
3668 in the summary of
3669 .Ic headers .
3670 .Bl -bullet
3672 .Ic spamrate
3673 rates the given messages and sets their
3674 .Ql is-spam
3675 flag accordingly.
3676 If the spam interface offers spam scores these can be shown in
3677 .Va headline
3678 by using the format
3679 .Ql %$ .
3681 .Ic spamham ,
3682 .Ic spamspam
3684 .Ic spamforget
3685 will interact with the Bayesian filter of the chosen interface and learn
3686 the given messages as
3687 .Dq ham
3689 .Dq spam ,
3690 respectively; the last command can be used to cause
3691 .Dq unlearning
3692 of messages; it adheres to their current
3693 .Ql is-spam
3694 state and thus reverts previous teachings.
3696 .Ic spamclear
3698 .Ic spamset
3699 will simply set and clear, respectively, the mentioned volatile
3700 .Ql is-spam
3701 message flag, without any interface interaction.
3705 .Xr spamassassin 1
3706 based
3707 .Va spam-interface
3708 .Ql spamc
3709 requires a running instance of the
3710 .Xr spamd 1
3711 server in order to function, started with the option
3712 .Fl -allow-tell
3713 shall Bayesian filter learning be possible.
3714 .Bd -literal -offset indent
3715 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
3716 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
3717     --daemonize [--local] [--allow-tell]
3720 Thereafter \*(UA can make use of these interfaces:
3721 .Bd -literal -offset indent
3722 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3723     -Sspamc-command=/usr/local/bin/spamc \e
3724     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
3726 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3727     -Sspamc-command=/usr/local/bin/spamc \e
3728     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
3731 Using the generic filter approach allows usage of programs like
3732 .Xr bogofilter 1 .
3733 Here is an example, requiring it to be accessible via
3734 .Ev PATH :
3735 .Bd -literal -offset indent
3736 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
3737     -Sspamfilter-ham="bogofilter -n" \e
3738     -Sspamfilter-noham="bogofilter -N" \e
3739     -Sspamfilter-nospam="bogofilter -S" \e
3740     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
3741     -Sspamfilter-spam="bogofilter -s" \e
3742     -Sspamfilter-rate-scanscore="1;^(.+)$"
3745 Because messages must exist on local storage in order to be scored (or
3746 used for Bayesian filter training), it is possibly a good idea to
3747 perform the local spam check last.
3748 Spam can be checked automatically when opening specific folders by
3749 setting a specialized form of the internal variable
3750 .Va folder-hook .
3751 .Bd -literal -offset indent
3752 define spamdelhook {
3753   # Server side DCC
3754   spamset (header x-dcc-brand-metrics "bulk")
3755   # Server-side spamassassin(1)
3756   spamset (header x-spam-flag "YES")
3757   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
3758   move :S +maybe-spam
3759   spamrate :u
3760   del :s
3761   move :S +maybe-spam
3763 set folder-hook-SOMEFOLDER=spamdelhook
3766 See also the documentation for the variables
3767 .Va spam-interface , spam-maxsize ,
3768 .Va spamc-command , spamc-arguments , spamc-user ,
3769 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
3770   spamfilter-rate
3772 .Va spamfilter-rate-scanscore .
3773 .Sh COMMANDS
3774 \*(UA reads input in lines.
3775 An unquoted reverse solidus
3776 .Ql \e
3777 at the end of a command line
3778 .Dq escapes
3779 the newline character: it is discarded and the next line of input is
3780 used as a follow-up line, with all leading whitespace removed;
3781 once an entire line is completed, the whitespace characters
3782 .Cm space , tabulator , newline
3783 as well as those defined by the variable
3784 .Va ifs
3785 are removed from the beginning and end.
3786 Placing any whitespace characters at the beginning of a line will
3787 prevent a possible addition of the command line to the \*(OPal
3788 .Ic history .
3790 The beginning of such input lines is then scanned for the name of
3791 a known command: command names may be abbreviated, in which case the
3792 first command that matches the given prefix will be used.
3793 .Sx "Command modifiers"
3794 may prefix a command in order to modify its behaviour.
3795 A name may also be a
3796 .Ic commandalias ,
3797 which will become expanded until no more expansion is possible.
3798 Once the command that shall be executed is known, the remains of the
3799 input line will be interpreted according to command-specific rules,
3800 documented in the following.
3802 This behaviour is different to the
3803 .Xr sh 1 Ns
3804 ell, which is a programming language with syntactic elements of clearly
3805 defined semantics, and therefore capable to sequentially expand and
3806 evaluate individual elements of a line.
3807 .Ql \&? set one=value two=$one
3808 for example will never possibly assign value to one, because the
3809 variable assignment is performed no sooner but by the command
3810 .Pf ( Ic set ) ,
3811 long after the expansion happened.
3813 A list of all commands in lookup order is dumped by the command
3814 .Ic list .
3815 \*(OPally the command
3816 .Ic help
3818 .Ic \&? ) ,
3819 when given an argument, will show a documentation string for the
3820 command matching the expanded argument, as in
3821 .Ql \&?t ,
3822 which should be a shorthand of
3823 .Ql \&?type ;
3824 with these documentation strings both commands support a more
3825 .Va verbose
3826 listing mode which includes the argument type of the command and other
3827 information which applies; a handy suggestion might thus be:
3828 .Bd -literal -offset indent
3829 ? define __xv {
3830   # Before v15: need to enable sh(1)ell-style on _entire_ line!
3831   localopts yes;wysh set verbose;ignerr eval "${@}";return ${?}
3833 ? commandalias xv '\ecall __xv'
3834 ? xv help set
3836 .Ss "Command modifiers"
3837 Commands may be prefixed by none to multiple command modifiers.
3838 Some command modifiers can be used with a restricted set of commands
3839 only, the
3840 .Va verbose
3841 version of
3842 .Ic list
3843 will (\*(OPally) show which modifiers apply.
3844 .Bl -bullet
3846 The modifier reverse solidus
3848 .Cm \e ,
3849 to be placed first, prevents
3850 .Ic commandalias
3851 expansions on the remains of the line, for example
3852 .Ql \eecho
3853 will always evaluate the command
3854 .Ic echo ,
3855 even if an (command)alias of the same name exists.
3856 .Ic commandalias
3857 content may itself contain further command modifiers, including
3858 an initial reverse solidus to prevent further expansions.
3860 The modifier
3862 .Cm ignerr
3863 indicates that any error generated by the following command should be
3864 ignored by the state machine and not cause a program exit with enabled
3865 .Va errexit
3866 or for the standardized exit cases in
3867 .Va posix
3868 mode.
3869 .Va \&? ,
3870 one of the
3871 .Sx "INTERNAL VARIABLES" ,
3872 will be set to the real exit status of the command regardless.
3875 .Cm local
3876 will alter the called command to apply changes only temporarily,
3877 local to block-scope, and can thus only be used inside of a
3878 .Ic define Ns
3879 d macro or an
3880 .Ic account
3881 definition.
3882 Specifying it implies the modifier
3883 .Cm wysh .
3884 Local variables will not be inherited by macros deeper in the
3885 .Ic call
3886 chain, and all local settings will be garbage collected once the local
3887 scope is left.
3888 To record and unroll changes in the global scope use the command
3889 .Ic localopts .
3892 .Cm scope
3893 does yet not implement any functionality.
3896 .Cm u
3897 does yet not implement any functionality.
3899 Some commands support the
3901 .Cm vput
3902 modifier: if used, they expect the name of a variable, which can itself
3903 be a variable, i.e., shell expansion is applied, as their first
3904 argument, and will place their computation result in it instead of the
3905 default location (it is usually written to standard output).
3907 The given name will be tested for being a valid
3908 .Xr sh 1
3909 variable name, and may therefore only consist of upper- and lowercase
3910 characters, digits, and the underscore; the hyphen-minus may be used as
3911 a non-portable extension; digits may not be used as first, hyphen-minus
3912 may not be used as last characters.
3913 In addition the name may either not be one of the known
3914 .Sx "INTERNAL VARIABLES" ,
3915 or must otherwise refer to a writable (non-boolean) value variable.
3916 The actual put operation may fail nonetheless, for example if the
3917 variable expects a number argument only a number will be accepted.
3918 Any error during these operations causes the command as such to fail,
3919 and the error number
3920 .Va \&!
3921 will be set to
3922 .Va ^ERR Ns -NOTSUP ,
3923 the exit status
3924 .Va \&?
3925 should be set to
3926 .Ql -1 ,
3927 but some commands deviate from the latter, which is documented.
3929 Last, but not least, the modifier
3931 .Cm wysh
3932 can be used for some old and established commands to choose the new
3933 .Sx "Shell-style argument quoting"
3934 rules over the traditional
3935 .Sx "Old-style argument quoting" .
3936 This modifier is implied if
3937 .Va v15-compat
3938 is set to a non-empty value.
3940 .Ss "Old-style argument quoting"
3941 \*(ID This section documents the traditional and POSIX standardized
3942 style of quoting non-message list arguments to commands which expect
3943 this type of arguments: whereas still used by the majority of such
3944 commands, the new
3945 .Sx "Shell-style argument quoting"
3946 may be available even for those via
3947 .Cm wysh ,
3948 one of the
3949 .Sx "Command modifiers" .
3950 Nonetheless care must be taken, because only new commands have been
3951 designed with all the capabilities of the new quoting rules in mind,
3952 which can, for example generate control characters.
3953 .Bl -bullet -offset indent
3955 An argument can be enclosed between paired double-quotes
3956 .Ql """argument"""
3958 single-quotes
3959 .Ql 'argument' ;
3960 any whitespace, shell word expansion, or reverse solidus characters
3961 (except as described next) within the quotes are treated literally as
3962 part of the argument.
3963 A double-quote will be treated literally within single-quotes and vice
3964 versa.
3965 Inside such a quoted string the actually used quote character can be
3966 used nonetheless by escaping it with a reverse solidus
3967 .Ql \e ,
3968 as in
3969 .Ql """y\e""ou""" .
3971 An argument that is not enclosed in quotes, as above, can usually still
3972 contain space characters if those spaces are reverse solidus escaped, as in
3973 .Ql you\e are .
3975 A reverse solidus outside of the enclosing quotes is discarded
3976 and the following character is treated literally as part of the argument.
3978 .Ss "Shell-style argument quoting"
3979 .Xr sh 1 Ns
3980 ell-style, and therefore POSIX standardized, argument parsing and
3981 quoting rules are used by most commands.
3982 \*(ID Most new commands only support these new rules and are flagged
3983 \*(NQ, some elder ones can use them with the command modifier
3984 .Cm wysh ;
3985 in the future only this type of argument quoting will remain.
3987 A command line is parsed from left to right and an input token is
3988 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3989 Metacharacters are vertical bar
3990 .Cm \&| ,
3991 ampersand
3992 .Cm & ,
3993 semicolon
3994 .Cm \&; ,
3995 as well as all characters from the variable
3996 .Va ifs ,
3997 and / or
3998 .Cm space , tabulator , newline .
3999 The additional metacharacters left and right parenthesis
4000 .Cm \&( , \&)
4001 and less-than and greater-than signs
4002 .Cm < , >
4003 that the
4004 .Xr sh 1
4005 supports are not used, and are treated as ordinary characters: for one
4006 these characters are a vivid part of email addresses, and it seems
4007 highly unlikely that their function will become meaningful to \*(UA.
4008 .Bd -filled -offset indent
4009 .Sy Compatibility note:
4010 \*(ID Please note that even many new-style commands do not yet honour
4011 .Va ifs
4012 to parse their arguments: whereas the
4013 .Xr sh 1 Ns
4014 ell is a language with syntactic elements of clearly defined semantics,
4015 \*(UA parses entire input lines and decides on a per-command base what
4016 to do with the rest of the line.
4017 This also means that whenever an unknown command is seen all that \*(UA
4018 can do is cancellation of the processing of the remains of the line.
4020 It also often depends on an actual subcommand of a multiplexer command
4021 how the rest of the line should be treated, and until v15 we are not
4022 capable to perform this deep inspection of arguments.
4023 Nonetheless, at least the following commands which work with positional
4024 parameters fully support
4025 .Va ifs
4026 for an almost shell-compatible field splitting:
4027 .Ic call , call_if , read , vpospar , xcall .
4030 Any unquoted number sign
4031 .Ql #
4032 at the beginning of a new token starts a comment that extends to the end
4033 of the line, and therefore ends argument processing.
4034 An unquoted dollar sign
4035 .Ql $
4036 will cause variable expansion of the given name, which must be a valid
4037 .Xr sh 1 Ns
4038 ell-style variable name (see
4039 .Cm vput ) :
4040 .Sx "INTERNAL VARIABLES"
4041 as well as
4042 .Sx ENVIRONMENT
4043 (shell) variables can be accessed through this mechanism, brace
4044 enclosing the name is supported (i.e., to subdivide a token).
4046 Whereas the metacharacters
4047 .Cm space , tabulator , newline
4048 only complete an input token, vertical bar
4049 .Cm \&| ,
4050 ampersand
4051 .Cm &
4052 and semicolon
4053 .Cm \&;
4054 also act as control operators and perform control functions.
4055 For now supported is semicolon
4056 .Cm \&; ,
4057 which terminates a single command, therefore sequencing the command line
4058 and making the remainder of the line a subject to reevaluation.
4059 With sequencing, multiple command argument types and quoting rules may
4060 therefore apply to a single line, which can become problematic before
4061 v15: e.g., the first of the following will cause surprising results.
4063 .Dl ? echo one; set verbose; echo verbose=$verbose.
4064 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
4066 Quoting is a mechanism that will remove the special meaning of
4067 metacharacters and reserved words, and will prevent expansion.
4068 There are four quoting mechanisms: the escape character, single-quotes,
4069 double-quotes and dollar-single-quotes:
4070 .Bl -bullet -offset indent
4072 The literal value of any character can be preserved by preceding it
4073 with the escape character reverse solidus
4074 .Ql \e .
4076 Arguments which are enclosed in
4077 .Ql 'single-\:quotes'
4078 retain their literal value.
4079 A single-quote cannot occur within single-quotes.
4081 The literal value of all characters enclosed in
4082 .Ql \(dqdouble-\:quotes\(dq
4083 is retained, with the exception of dollar sign
4084 .Ql $ ,
4085 which will cause variable expansion, as above, backquote (grave accent)
4086 .Ql ` ,
4087 (which not yet means anything special), reverse solidus
4088 .Ql \e ,
4089 which will escape any of the characters dollar sign
4090 .Ql $
4091 (to prevent variable expansion), backquote (grave accent)
4092 .Ql ` ,
4093 double-quote
4094 .Ql \(dq
4095 (to prevent ending the quote) and reverse solidus
4096 .Ql \e
4097 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
4098 but has no special meaning otherwise.
4100 Arguments enclosed in
4101 .Ql $'dollar-\:single-\:quotes'
4102 extend normal single quotes in that reverse solidus escape sequences are
4103 expanded as follows:
4105 .Bl -tag -compact -width ".Ql \eNNN"
4106 .It Ql \ea
4107 bell control character (ASCII and ISO-10646 BEL).
4108 .It Ql \eb
4109 backspace control character (ASCII and ISO-10646 BS).
4110 .It Ql \eE
4111 escape control character (ASCII and ISO-10646 ESC).
4112 .It Ql \ee
4113 the same.
4114 .It Ql \ef
4115 form feed control character (ASCII and ISO-10646 FF).
4116 .It Ql \en
4117 line feed control character (ASCII and ISO-10646 LF).
4118 .It Ql \er
4119 carriage return control character (ASCII and ISO-10646 CR).
4120 .It Ql \et
4121 horizontal tabulator control character (ASCII and ISO-10646 HT).
4122 .It Ql \ev
4123 vertical tabulator control character (ASCII and ISO-10646 VT).
4124 .It Ql \e\e
4125 emits a reverse solidus character.
4126 .It Ql \e'
4127 single quote.
4128 .It Ql \e"
4129 double quote (escaping is optional).
4130 .It Ql \eNNN
4131 eight-bit byte with the octal value
4132 .Ql NNN
4133 (one to three octal digits), optionally prefixed by an additional
4134 .Ql 0 .
4135 A 0 byte will suppress further output for the quoted argument.
4136 .It Ql \exHH
4137 eight-bit byte with the hexadecimal value
4138 .Ql HH
4139 (one or two hexadecimal characters, no prefix, see
4140 .Ic vexpr ) .
4141 A 0 byte will suppress further output for the quoted argument.
4142 .It Ql \eUHHHHHHHH
4143 the Unicode / ISO-10646 character with the hexadecimal codepoint value
4144 .Ql HHHHHHHH
4145 (one to eight hexadecimal characters) \(em note that Unicode defines the
4146 maximum codepoint ever to be supported as
4147 .Ql 0x10FFFF
4148 (in planes of
4149 .Ql 0xFFFF
4150 characters each).
4151 This escape is only supported in locales that support Unicode (see
4152 .Sx "Character sets" ) ,
4153 in other cases the sequence will remain unexpanded unless the given code
4154 point is ASCII compatible or (if the \*(OPal character set conversion is
4155 available) can be represented in the current locale.
4156 The character NUL will suppress further output for the quoted argument.
4157 .It Ql \euHHHH
4158 Identical to
4159 .Ql \eUHHHHHHHH
4160 except it takes only one to four hexadecimal characters.
4161 .It Ql \ecX
4162 Emits the non-printable (ASCII and compatible) C0 control codes
4163 0 (NUL) to 31 (US), and 127 (DEL).
4164 Printable representations of ASCII control codes can be created by
4165 mapping them to a different, visible part of the ASCII character set.
4166 Adding the number 64 achieves this for the codes 0 to 31, here 7 (BEL):
4167 .Ql 7 + 64 = 71 = G .
4168 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
4169 .Ic vexpr ) ,
4170 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
4171 .Ql \&?\0vexpr\0^\0127\064 .
4173 Whereas historically circumflex notation has often been used for
4174 visualization purposes of control codes, as in
4175 .Ql ^G ,
4176 the reverse solidus notation has been standardized:
4177 .Ql \ecG .
4178 Some control codes also have standardized (ISO-10646, ISO C) aliases,
4179 as shown above
4180 .Pf ( Ql \ea ,
4181 .Ql \en ,
4182 .Ql \et
4183 etc) :
4184 whenever such an alias exists it will be used for display purposes.
4185 The control code NUL
4186 .Pf ( Ql \ec@ ,
4187 a non-standard extension) will suppress further output for the remains
4188 of the token (which may extend beyond the current quote), or, depending
4189 on the context, the remains of all arguments for the current command.
4190 .It Ql \e$NAME
4191 Non-standard extension: expand the given variable name, as above.
4192 Brace enclosing the name is supported.
4193 .It Ql \e`{command}
4194 Not yet supported, just to raise awareness: Non-standard extension.
4198 Caveats:
4199 .Bd -literal -offset indent
4200 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
4201 ? echo Quotes ${HOME} and tokens differ! # comment
4202 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
4204 .Ss "Message list arguments"
4205 Many commands operate on message list specifications, as documented in
4206 .Sx "Specifying messages" .
4207 The argument input is first split into individual tokens via
4208 .Sx "Shell-style argument quoting" ,
4209 which are then interpreted as the mentioned specifications.
4210 If no explicit message list has been specified, many commands will
4211 search for and use the next message forward that satisfies the commands'
4212 requirements, and if there are no messages forward of the current
4213 message, the search proceeds backwards;
4214 if there are no good messages at all to be found, an error message is
4215 shown and the command is aborted.
4217 .Va verbose
4218 output of the command
4219 .Ic list
4220 will indicate whether a command searches for a default message, or not.
4221 .Ss "Raw data arguments for codec commands"
4222 A special set of commands, which all have the string
4223 .Dq codec
4224 in their name, like
4225 .Ic addrcodec ,
4226 .Ic shcodec ,
4227 .Ic urlcodec ,
4228 take raw string data as input, which means that the content of the
4229 command input line is passed completely unexpanded and otherwise
4230 unchanged: like this the effect of the actual codec is visible without
4231 any noise of possible shell quoting rules etc., i.e., the user can input
4232 one-to-one the desired or questionable data.
4233 To gain a level of expansion, the entire command line can be
4234 .Ic eval Ns
4235 uated first, for example
4236 .Bd -literal -offset indent
4237 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
4238 ? echo $res
4239 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
4240 ? shcodec d $res
4241 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
4242 ? eval shcodec d $res
4243 /usr/Sch\[:o]nes Wetter/heute.txt
4245 .Ss "Filename transformations"
4246 Filenames, where expected, and unless documented otherwise, are
4247 subsequently subject to the following filename transformations, in
4248 sequence:
4249 .Bl -bullet -offset indent
4251 If the given name is a registered
4252 .Ic shortcut ,
4253 it will be replaced with the expanded shortcut.
4254 This step is mostly taken for
4255 .Ic folder Ns
4256 s only.
4258 The filename is matched against the following patterns or strings.
4259 But for plus
4260 .Ar +file
4261 .Va folder
4262 expansion this step is mostly taken for
4263 .Ic folder Ns
4264 s only.
4266 .Bl -hang -compact -width ".Ar %user"
4267 .It Ar #
4268 (Number sign) is expanded to the previous file.
4269 .It Ar %
4270 (Percent sign) is replaced by the invoking
4271 .Mx -ix "primary system mailbox"
4272 user's primary system mailbox, which either is the (itself expandable)
4273 .Va inbox
4274 if that is set, the standardized absolute pathname indicated by
4275 .Ev MAIL
4276 if that is set, or a built-in compile-time default otherwise.
4277 When opening a
4278 .Ic folder
4279 the used name is actively checked for being a primary mailbox, first
4280 against
4281 .Va \&\&inbox ,
4282 then against
4283 .Ev MAIL .
4284 .It Ar %user
4285 Expands to the primary system mailbox of
4286 .Ar user
4287 (and never the value of
4288 .Va inbox ,
4289 regardless of its actual setting).
4290 .It Ar &
4291 (Ampersand) is replaced with the invoking user's
4292 .Mx -ix "secondary mailbox"
4293 secondary mailbox, the
4294 .Ev MBOX .
4295 .It Ar +file
4296 Refers to a
4297 .Ar file
4298 in the
4299 .Va folder
4300 directory (if that variable is set).
4301 .It Ar %:filespec
4302 Expands to the same value as
4303 .Ar filespec ,
4304 but has special meaning when used with, for example, the command
4305 .Ic folder :
4306 the file will be treated as a primary system mailbox by, among others, the
4307 .Ic mbox
4309 .Ic save
4310 commands, meaning that messages that have been read in the current
4311 session will be moved to the
4312 .Ev MBOX
4313 mailbox instead of simply being flagged as read.
4316 Meta expansions may be applied to the resulting filename, as allowed by
4317 the operation and applicable to the resulting access protocol (also see
4318 .Sx "On URL syntax and credential lookup" ) .
4319 For the file-protocol, a leading tilde
4320 .Ql ~
4321 character will be replaced by the expansion of
4322 .Ev HOME ,
4323 except when followed by a valid user name, in which case the home
4324 directory of the given user is used instead.
4326 A shell expansion as if specified in double-quotes (see
4327 .Sx "Shell-style argument quoting" )
4328 may be applied, so that any occurrence of
4329 .Ql $VARIABLE
4331 .Ql ${VARIABLE} )
4332 will be replaced by the expansion of the variable, if possible;
4333 .Sx "INTERNAL VARIABLES"
4334 as well as
4335 .Sx ENVIRONMENT
4336 (shell) variables can be accessed through this mechanism.
4338 Shell pathname wildcard pattern expansions
4339 .Pf ( Xr glob 7 )
4340 may be applied as documented.
4341 If the fully expanded filename results in multiple pathnames and the
4342 command is expecting only one file, an error results.
4344 In interactive context, in order to allow simple value acceptance (via
4345 .Dq ENTER ) ,
4346 arguments will usually be displayed in a properly quoted form, so a file
4347 .Ql diet\e is \ecurd.txt
4348 may be displayed as
4349 .Ql 'diet\e is \ecurd.txt' .
4351 .Ss "Commands"
4352 The following commands are available:
4353 .Bl -tag -width ".It Ic BaNg"
4355 .It Ic \&!
4356 Executes the
4357 .Ev SHELL
4358 command which follows, replacing unescaped exclamation marks with the
4359 previously executed command if the internal variable
4360 .Va bang
4361 is set.
4362 This command supports
4363 .Cm vput
4364 as documented in
4365 .Sx "Command modifiers" ,
4366 and manages the error number
4367 .Va \&! .
4368 A 0 or positive exit status
4369 .Va \&?
4370 reflects the exit status of the command, negative ones that
4371 an error happened before the command was executed, or that the program
4372 did not exit cleanly, but maybe due to a signal: the error number is
4373 .Va ^ERR Ns -CHILD ,
4374 then.
4376 In conjunction with the
4377 .Cm vput
4378 modifier the following special cases exist:
4379 a negative exit status occurs if the collected data could not be stored
4380 in the given variable, which is a
4381 .Va ^ERR Ns -NOTSUP
4382 error that should otherwise not occur.
4383 .Va ^ERR Ns -CANCELED
4384 indicates that no temporary file could be created to collect the command
4385 output at first glance.
4386 In case of catchable out-of-memory situations
4387 .Va ^ERR Ns -NOMEM
4388 will occur and \*(UA will try to store the empty string, just like with
4389 all other detected error conditions.
4391 .It Ic #
4392 The comment-command causes the entire line to be ignored.
4393 .Sy Note:
4394 this really is a normal command which' purpose is to discard its
4395 arguments, not a
4396 .Dq comment-start
4397 indicating special character, which means that for example trailing
4398 comments on a line are not possible (except for commands which use
4399 .Sx "Shell-style argument quoting" ) .
4401 .It Ic +
4402 Goes to the next message in sequence and types it
4403 (like
4404 .Dq ENTER ) .
4406 .It Ic -
4407 Display the preceding message, or the n'th previous message if given
4408 a numeric argument n.
4410 .It Ic =
4411 Shows the message number of the current message (the
4412 .Dq dot )
4413 when used without arguments, that of the given list otherwise.
4414 Output numbers will be separated from each other with the first
4415 character of
4416 .Va ifs ,
4417 and followed by the first character of
4418 .Va if-ws ,
4419 if that is not empty and not identical to the first.
4420 If that results in no separation at all a
4421 .Cm space
4422 character is used.
4423 This command supports
4424 .Cm vput
4425 (see
4426 .Sx "Command modifiers" ) ,
4427 and manages the error number
4428 .Va \&! .
4430 .It Ic \&?
4431 \*(OP Show a brief summary of commands.
4432 \*(OP Given an argument a synopsis for the command in question is
4433 shown instead; commands can be abbreviated in general and this command
4434 can be used to see the full expansion of an abbreviation including the
4435 synopsis, try, for example
4436 .Ql \&?h ,
4437 .Ql \&?hel
4439 .Ql \&?help
4440 and see how the output changes.
4441 To avoid that aliases are resolved the modifier
4442 .Cm \e
4443 can be prepended to the argument, but note it must be quoted.
4444 This mode also supports a more
4445 .Va verbose
4446 output, which will provide the information documented for
4447 .Ic list .
4449 .It Ic \&|
4450 A synonym for the
4451 .Ic pipe
4452 command.
4455 .It Ic account , unaccount
4456 (ac, una) Creates, selects or lists (an) account(s).
4457 Accounts are special incarnations of
4458 .Ic define Ns d
4459 macros and group commands and variable settings which together usually
4460 arrange the environment for the purpose of creating an email account.
4461 Different to normal macros settings which are covered by
4462 .Ic localopts
4463 \(en here by default enabled! \(en will not be reverted before the
4464 .Ic account
4465 is changed again.
4466 The special account
4467 .Ql null
4468 (case-insensitive) always exists, and all but it can be deleted by the
4469 latter command, and in one operation with the special name
4470 .Ql * .
4471 Also for all but it a possibly set
4472 .Va on-account-cleanup
4473 hook is called once they are left, also for program exit.
4475 Without arguments a listing of all defined accounts is shown.
4476 With one argument the given account is activated: the system
4477 .Va inbox
4478 of that account will be activated (as via
4479 .Ic folder ) ,
4480 a possibly installed
4481 .Va folder-hook
4482 will be run, and the internal variable
4483 .Va account
4484 will be updated.
4485 The two argument form behaves identical to defining a macro as via
4486 .Ic define .
4487 Important settings for accounts include
4488 .Va folder , from , hostname , inbox , mta , password
4490 .Va user
4491 .Pf ( Sx "On URL syntax and credential lookup" ) ,
4492 as well as things like
4493 .Va tls-config-pairs
4494 .Pf ( Sx "Encrypted network communication" ) ,
4495 and protocol specifics like
4496 .Va imap-auth , pop3-auth , smtp-auth .
4497 .Bd -literal -offset indent
4498 account myisp {
4499   set folder=~/mail inbox=+syste.mbox record=+sent.mbox
4500   set from='(My Name) myname@myisp.example'
4501   set mta=smtp://mylogin@smtp.myisp.example
4505 .It Ic addrcodec
4506 Perform email address codec transformations on raw-data argument, rather
4507 according to email standards (RFC 5322; \*(ID will furtherly improve).
4508 Supports
4509 .Cm vput
4510 (see
4511 .Sx "Command modifiers" ) ,
4512 and manages the error number
4513 .Va \&! .
4514 The first argument must be either
4515 .Ar [+[+[+]]]e[ncode] ,
4516 .Ar d[ecode] ,
4517 .Ar s[kin]
4519 .Ar skinl[ist]
4520 and specifies the operation to perform on the rest of the line.
4522 Decoding will show how a standard-compliant MUA will display the given
4523 argument, which should be an email address.
4524 Please be aware that most MUAs have difficulties with the address
4525 standards, and vary wildly when (comments) in parenthesis,
4526 .Dq double-quoted
4527 strings, or quoted-pairs, as below, become involved.
4528 \*(ID \*(UA currently does not perform decoding when displaying addresses.
4530 Skinning is identical to decoding but only outputs the plain address,
4531 without any string, comment etc. components.
4532 Another difference is that it may fail with the error number
4533 .Va \&!
4534 set to
4535 .Va ^ERR Ns -INVAL
4536 if decoding fails to find a(n) (valid) email address, in which case the
4537 unmodified input will be output again.
4539 .Ar skinlist
4540 first performs a skin operation, and thereafter checks a valid
4541 address for whether it is a registered mailing list (see
4542 .Ic mlist
4544 .Ic mlsubscribe ) ,
4545 eventually reporting that state in the error number
4546 .Va \&!
4548 .Va ^ERR Ns -EXIST .
4549 (This state could later become overwritten by an I/O error, though.)
4551 Encoding supports four different modes, lesser automated versions can be
4552 chosen by prefixing one, two or three plus signs: the standard imposes
4553 a special meaning on some characters, which thus have to be transformed
4554 to so-called quoted-pairs by pairing them with a reverse solidus
4555 .Ql \e
4556 in order to remove the special meaning; this might change interpretation
4557 of the entire argument from what has been desired, however!
4558 Specify one plus sign to remark that parenthesis shall be left alone,
4559 two for not turning double quotation marks into quoted-pairs, and three
4560 for also leaving any user-specified reverse solidus alone.
4561 The result will always be valid, if a successful exit status is reported
4562 (\*(ID the current parser fails this assertion for some constructs).
4563 \*(ID Addresses need to be specified in between angle brackets
4564 .Ql < ,
4565 .Ql >
4566 if the construct becomes more difficult, otherwise the current parser
4567 will fail; it is not smart enough to guess right.
4568 .Bd -literal -offset indent
4569 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
4570 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4571 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4572 "Hey, you", \e out\e there <diet@exam.ple>
4573 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4574 diet@exam.ple
4578 .It Ic alias , unalias
4579 \*(NQ(a, una) Define or list, and remove, respectively, address aliases,
4580 which are a method of creating personal distribution lists that map
4581 a single name to none to multiple receivers, to be expanded after
4582 .Sx "Compose mode"
4583 is left; the expansion correlates with
4584 .Va metoo .
4585 The latter command removes all given aliases, the special name asterisk
4586 .Ql *
4587 will remove all existing aliases.
4588 When used without arguments the former shows a list of all currently
4589 known aliases, with one argument only the target(s) of the given one.
4590 When given two arguments, hyphen-minus
4591 .Ql -
4592 being the first, the target(s) of the second is/are expanded recursively.
4594 In all other cases the given alias is newly defined, or will be appended
4595 to: arguments must either be themselves valid alias names, or any
4596 other address type (see
4597 .Sx "On sending mail, and non-interactive mode" ) .
4598 Recursive expansion of aliases can be prevented by prefixing the desired
4599 argument with the modifier reverse solidus
4600 .Cm \&\&\e .
4601 A valid alias name conforms to
4602 .Va mta-aliases
4603 syntax, but follow-up characters can also be the number sign
4604 .Ql # ,
4605 colon
4606 .Ql \&: ,
4607 commercial at
4608 .Ql @,
4609 exclamation mark
4610 .Ql \&! ,
4611 period
4612 .Ql \&.
4613 as well as
4614 .Dq any character that has the high bit set .
4615 The dollar sign
4616 .Ql $
4617 may be the last character.
4618 The number sign
4619 .Ql #
4620 may need
4621 .Sx "Shell-style argument quoting" .
4623 \*(ID Unfortunately the colon is currently not supported, as it
4624 interferes with normal address parsing rules.
4625 \*(ID Such high bit characters will likely cause warnings at the moment
4626 for the same reasons why colon is unsupported; also, in the future
4627 locale dependent character set validity checks will be performed.
4628 .Bd -literal -offset indent
4629 ? alias cohorts  bill jkf mark kridle@ucbcory ~/cohorts.mbox
4630 ? alias mark  mark@exam.ple
4631 ? set mta-aliases=/etc/aliases
4635 .It Ic alternates , unalternates
4636 \*(NQ (alt) Manage a list of alternate addresses or names of the active
4637 user, members of which will be removed from recipient lists (except one).
4638 There is a set of implicit alternates which is formed of the values of
4639 .Ev LOGNAME ,
4640 .Va from ,
4641 .Va sender
4643 .Va reply-to .
4644 .Va from
4645 will not be used if
4646 .Va sender
4647 is set.
4648 The latter command removes the given list of alternates, the special name
4649 .Ql *
4650 will discard all existing alternate names.
4652 The former command manages the error number
4653 .Va \&! .
4654 It shows the current set of alternates when used without arguments; in
4655 this mode only it also supports
4656 .Cm vput
4657 (see
4658 .Sx "Command modifiers" ) .
4659 Otherwise the given arguments (after being checked for validity) are
4660 appended to the list of alternate names; in
4661 .Va posix
4662 mode they replace that list instead.
4665 .It Ic answered , unanswered
4666 Take a message lists and mark each message as (not) having been answered.
4667 Messages will be marked answered when being
4668 .Ic reply Ns d
4669 to automatically if the
4670 .Va markanswered
4671 variable is set.
4672 See the section
4673 .Sx "Message states" .
4676 .It Ic bind , unbind
4677 \*(OP\*(NQ The bind command extends the MLE (see
4678 .Sx "On terminal control and line editor" )
4679 with freely configurable key bindings.
4680 The latter command removes from the given context the given key binding,
4681 both of which may be specified as a wildcard
4682 .Ql * ,
4683 so that
4684 .Ql unbind * *
4685 will remove all bindings of all contexts.
4686 Due to initialization order unbinding will not work for built-in key
4687 bindings upon program startup, however: please use
4688 .Va line-editor-no-defaults
4689 for this purpose instead.
4691 With zero arguments, or with a context name the former command shows
4692 all key bindings (of the given context; an asterisk
4693 .Ql *
4694 will iterate over all contexts); a more verbose listing will be
4695 produced if either of
4696 .Va debug
4698 .Va verbose
4699 are set.
4700 With two or more arguments a specific binding is shown, or
4701 (re)established: the first argument is the context to which the binding
4702 shall apply, the second argument is a comma-separated list of the
4703 .Dq keys
4704 which form the binding.
4705 Further arguments will be joined to form the expansion, and cause the
4706 binding to be created or updated.
4707 To indicate that a binding shall not be auto-committed, but that the
4708 expansion shall instead be furtherly editable by the user, a commercial at
4709 .Ql @
4710 (that will be removed) can be placed last in the expansion, from which
4711 leading and trailing whitespace will finally be removed.
4712 Reverse solidus cannot be used as the last character of expansion.
4713 An empty expansion will be rejected.
4715 Contexts define when a binding applies, i.e., a binding will not be seen
4716 unless the context for which it is defined for is currently active.
4717 This is not true for the shared binding
4718 .Ql base ,
4719 which is the foundation for all other bindings and as such always
4720 applies, its bindings, however, only apply secondarily.
4721 The available contexts are the shared
4722 .Ql base ,
4724 .Ql default
4725 context which is used in all not otherwise documented situations, and
4726 .Ql compose ,
4727 which applies only to
4728 .Sx "Compose mode" .
4730 Bindings are specified as a comma-separated list of byte-sequences,
4731 where each list entry corresponds to one
4732 .Dq key
4733 (press).
4734 Byte sequence boundaries will be forcefully terminated after
4735 .Va bind-inter-byte-timeout
4736 milliseconds, whereas key sequences can be timed out via
4737 .Va bind-inter-key-timeout .
4738 A list entry may, indicated by a leading colon character
4739 .Ql \&: ,
4740 also refer to the name of a terminal capability; several dozen names
4741 are compiled in and may be specified either by their
4742 .Xr terminfo 5 ,
4743 or, if existing, by their
4744 .Xr termcap 5
4745 name, regardless of the actually used \*(OPal terminal control library.
4746 But any capability may be used, as long as the name is resolvable by the
4747 \*(OPal control library, or was defined via the internal variable
4748 .Va termcap .
4749 Input sequences are not case-normalized, an exact match is required to
4750 update or remove a binding.
4751 It is advisable to use an initial escape or other control character (like
4752 .Ql \ecA )
4753 for user (as opposed to purely terminal capability based) bindings in
4754 order to avoid ambiguities; it also reduces search time.
4755 Examples:
4756 .Bd -literal -offset indent
4757 ? bind base a,b echo one
4758 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
4759 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc,Delete
4760 ? bind default $'\ecA',:khome,w 'echo Editable binding@'
4761 ? bind default a,b,c rm -irf / @  # Also editable
4762 ? bind default :kf1 File %
4763 ? bind compose :kf1 ~v
4766 Note that the entire comma-separated list is first parsed (over) as a
4767 shell-token with whitespace as the field separator, then parsed and
4768 expanded for real with comma as the field separator, therefore
4769 whitespace needs to be properly quoted, see
4770 .Sx "Shell-style argument quoting" .
4771 Using Unicode reverse solidus escape sequences renders a binding
4772 defunctional if the locale does not support Unicode (see
4773 .Sx "Character sets" ) ,
4774 and using terminal capabilities does so if no (corresponding) terminal
4775 control support is (currently) available.
4776 Adding, deleting or modifying a key binding invalidates the internal
4777 prebuilt lookup tree, it will be recreated as necessary: this process
4778 will be visualized in most
4779 .Va verbose
4780 as well as in
4781 .Va debug
4782 mode.
4784 The following terminal capability names are built-in and can be used in
4785 .Xr terminfo 5
4786 or (if available) the two-letter
4787 .Xr termcap 5
4788 notation.
4789 See the respective manual for a list of capabilities.
4790 The program
4791 .Xr infocmp 1
4792 can be used to show all the capabilities of
4793 .Ev TERM
4794 or the given terminal type;
4795 using the
4796 .Fl \&\&x
4797 flag will also show supported (non-standard) extensions.
4799 .Bl -tag -compact -width kcuuf_or_kcuuf
4800 .It Cd kbs Ns \0or Cd kb
4801 Backspace.
4802 .It Cd kdch1 Ns \0or Cd kD
4803 Delete character.
4804 .It Cd kDC Ns \0or Cd *4
4805 \(em shifted variant.
4806 .It Cd kel Ns \0or Cd kE
4807 Clear to end of line.
4808 .It Cd kext Ns \0or Cd @9
4809 Exit.
4810 .It Cd kich1 Ns \0or Cd kI
4811 Insert character.
4812 .It Cd kIC Ns \0or Cd #3
4813 \(em shifted variant.
4814 .It Cd khome Ns \0or Cd kh
4815 Home.
4816 .It Cd kHOM Ns \0or Cd #2
4817 \(em shifted variant.
4818 .It Cd kend Ns \0or Cd @7
4819 End.
4820 .It Cd knp Ns \0or Cd kN
4821 Next page.
4822 .It Cd kpp Ns \0or Cd kP
4823 Previous page.
4824 .It Cd kcub1 Ns \0or Cd kl
4825 Left cursor (with more modifiers: see below).
4826 .It Cd kLFT Ns \0or Cd #4
4827 \(em shifted variant.
4828 .It Cd kcuf1 Ns \0or Cd kr
4829 Right cursor (ditto).
4830 .It Cd kRIT Ns \0or Cd %i
4831 \(em shifted variant.
4832 .It Cd kcud1 Ns \0or Cd kd
4833 Down cursor (ditto).
4834 .It Cd kDN
4835 \(em shifted variant (only terminfo).
4836 .It Cd kcuu1 Ns \0or Cd ku
4837 Up cursor (ditto).
4838 .It Cd kUP
4839 \(em shifted variant (only terminfo).
4840 .It Cd kf0 Ns \0or Cd k0
4841 Function key 0.
4842 Add one for each function key up to
4843 .Cd kf9
4845 .Cd k9 ,
4846 respectively.
4847 .It Cd kf10 Ns \0or Cd k;
4848 Function key 10.
4849 .It Cd kf11 Ns \0or Cd F1
4850 Function key 11.
4851 Add one for each function key up to
4852 .Cd kf19
4854 .Cd F9 ,
4855 respectively.
4858 Some terminals support key-modifier combination extensions, e.g.,
4859 .Ql Alt+Shift+xy .
4860 For example, the delete key,
4861 .Cd kdch1 :
4862 in its shifted variant, the name is mutated to
4863 .Cd  kDC ,
4864 then a number is appended for the states
4865 .Ql Alt
4866 .Pf ( Cd kDC3 ) ,
4867 .Ql Shift+Alt
4868 .Pf ( Cd kDC4 ) ,
4869 .Ql Control
4870 .Pf ( Cd kDC5 ) ,
4871 .Ql Shift+Control
4872 .Pf ( Cd kDC6 ) ,
4873 .Ql Alt+Control
4874 .Pf ( Cd kDC7 ) ,
4875 finally
4876 .Ql Shift+Alt+Control
4877 .Pf ( Cd kDC8 ) .
4878 The same for the left cursor key,
4879 .Cd kcub1 :
4880 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
4882 .It Ic call
4883 \*(NQ Calls the given macro, which must have been created via
4884 .Ic define
4885 (see there for more), otherwise an
4886 .Va ^ERR Ns -NOENT
4887 error occurs.
4888 Calling macros recursively will at some time excess the stack size
4889 limit, causing a hard program abortion; if recursively calling a macro
4890 is the last command of the current macro, consider to use the command
4891 .Ic xcall ,
4892 which will first release all resources of the current macro before
4893 replacing the current macro with the called one.
4895 .It Ic call_if
4896 Identical to
4897 .Ic call
4898 if the given macro has been created via
4899 .Ic define ,
4900 but does not fail nor warn if the macro does not exist.
4902 .It Ic cd
4903 Synonym for
4904 .Ic chdir .
4906 .It Ic certsave
4907 \*(OP Only applicable to S/MIME signed messages.
4908 Takes an optional message list and a filename and saves the certificates
4909 contained within the message signatures to the named file in both
4910 human-readable and PEM format.
4911 The certificates can later be used to send encrypted messages to the
4912 respective message senders by setting
4913 .Va smime-encrypt-USER@HOST
4914 variables.
4917 .It Ic charsetalias , uncharsetalias
4918 \*(NQ Manage alias mappings for (conversion of)
4919 .Sx "Character sets" .
4920 Alias processing is not performed for
4921 .Sx "INTERNAL VARIABLES" ,
4922 for example
4923 .Va charset-8bit ,
4924 and mappings are ineffective if character set conversion is not available
4925 .Pf ( Va features
4926 does not announce
4927 .Ql ,+iconv, ) .
4928 Expansion happens recursively for cases where aliases point to other
4929 aliases (built-in loop limit: 8).
4931 The latter command deletes all aliases given as arguments,
4932 or all at once when given the asterisk
4933 .Ql * .
4934 The former shows the list of all currently defined aliases if used
4935 without arguments, or the target of the given single argument;
4936 when given two arguments, hyphen-minus
4937 .Ql -
4938 being the first, the second is instead expanded recursively.
4939 In all other cases the given arguments are treated as pairs of character
4940 sets and their desired target alias name, creating new or updating
4941 already existing aliases.
4943 .It Ic chdir
4944 \*(NQ(ch) Change the working directory to
4945 .Ev HOME
4946 or the given argument.
4947 Synonym for
4948 .Ic cd .
4951 .It Ic collapse , uncollapse
4952 Only applicable to
4953 .Ql thread Ns
4955 .Ic sort
4956 mode.
4957 Takes a message list and makes all replies to these messages invisible
4958 in header summaries, except for
4959 .Ql new
4960 messages and the
4961 .Dq dot .
4962 Also when a message with collapsed replies is displayed,
4963 all of these are automatically uncollapsed.
4964 The latter command undoes collapsing.
4967 .It Ic colour , uncolour
4968 \*(OP\*(NQ Manage colour mappings of and for a
4969 .Sx "Coloured display" .
4970 Without arguments the former shows all currently defined mappings.
4971 Otherwise a colour type is expected (case-insensitively),
4972 it must be one of
4973 .Ql 256
4974 for 256-colour terminals,
4975 .Ql 8 ,
4976 .Ql ansi
4978 .Ql iso
4979 for the standard 8-colour ANSI / ISO 6429 colour palette, and
4980 .Ql 1
4982 .Ql mono
4983 for monochrome terminals, which only support (some) font attributes.
4984 Without further arguments the list of all currently defined mappings
4985 of the given type is shown (here the special
4986 .Ql all
4988 .Ql *
4989 also show all currently defined mappings).
4991 Otherwise the second argument defines the mappable slot, the third
4992 argument a (comma-separated list of) colour and font attribute
4993 specification(s), and the optionally supported fourth argument can be
4994 used to specify a precondition: if conditioned mappings exist they are
4995 tested in (creation) order unless a (case-insensitive) match has been
4996 found, and the default mapping (if any has been established) will only
4997 be chosen as a last resort.
4998 The types of available preconditions depend on the mappable slot,
4999 the following of which exist:
5001 Mappings prefixed with
5002 .Ql mle-
5003 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
5004 .Sx "On terminal control and line editor" )
5005 and do not support preconditions.
5007 .Bl -tag -compact -width view-partinfo
5008 .It Ar mle-position
5009 This mapping is used for the position indicator that is visible when
5010 a line cannot be fully displayed on the screen.
5011 .It Ar mle-prompt
5012 Used for the
5013 .Va prompt .
5014 .It Ar mle-error
5015 Used for the occasionally appearing error indicator that is joined onto
5016 .Va prompt .
5017 \*(ID Also used for error messages written on standard error .
5020 Mappings prefixed with
5021 .Ql sum-
5022 are used in header summaries, and they all understand the preconditions
5023 .Ql dot
5024 (the current message) and
5025 .Ql older
5026 for elder messages (only honoured in conjunction with
5027 .Va datefield-markout-older ) .
5029 .Bl -tag -compact -width view-partinfo
5030 .It Ar sum-dotmark
5031 This mapping is used for the
5032 .Dq dotmark
5033 that can be created with the
5034 .Ql %>
5036 .Ql %<
5037 formats of the variable
5038 .Va headline .
5039 .It Ar sum-header
5040 For the complete header summary line except the
5041 .Dq dotmark
5042 and the thread structure.
5043 .It Ar sum-thread
5044 For the thread structure which can be created with the
5045 .Ql %i
5046 format of the variable
5047 .Va headline .
5050 Mappings prefixed with
5051 .Ql view-
5052 are used when displaying messages.
5054 .Bl -tag -compact -width view-partinfo
5055 .It Ar view-from_
5056 This mapping is used for so-called
5057 .Ql From_
5058 lines, which are MBOX file format specific header lines (also see
5059 .Va mbox-rfc4155 ) .
5060 .It Ar view-header
5061 For header lines.
5062 A comma-separated list of headers to which the mapping applies may be
5063 given as a precondition; if the \*(OPal regular expression support is
5064 available then if any of the
5065 .Mx -sx
5066 .Sx "magic regular expression characters"
5067 is seen the precondition will be evaluated as (an extended) one.
5068 .It Ar view-msginfo
5069 For the introductional message info line.
5070 .It Ar view-partinfo
5071 For MIME part info lines.
5074 The following (case-insensitive) colour definitions and font attributes
5075 are understood, multiple of which can be specified in a comma-separated
5076 list:
5077 .Bl -tag -width ft=
5078 .It Ar ft=
5079 a font attribute:
5080 .Ql bold ,
5081 .Ql reverse
5083 .Ql underline .
5084 It is possible (and often applicable) to specify multiple font
5085 attributes for a single mapping.
5086 .It Ar fg=
5087 foreground colour attribute, in order (numbers 0 - 7)
5088 .Ql black ,
5089 .Ql red ,
5090 .Ql green ,
5091 .Ql brown ,
5092 .Ql blue ,
5093 .Ql magenta ,
5094 .Ql cyan
5096 .Ql white .
5097 To specify a 256-colour mode a decimal number colour specification in
5098 the range 0 to 255, inclusive, is supported, and interpreted as follows:
5100 .Bl -tag -compact -width "999 - 999"
5101 .It 0 - 7
5102 the standard ISO 6429 colours, as above.
5103 .It 8 - 15
5104 high intensity variants of the standard colours.
5105 .It 16 - 231
5106 216 colours in tuples of 6.
5107 .It 232 - 255
5108 grayscale from black to white in 24 steps.
5110 .Bd -literal -offset indent
5111 #!/bin/sh -
5112 fg() { printf "\e033[38;5;${1}m($1)"; }
5113 bg() { printf "\e033[48;5;${1}m($1)"; }
5115 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
5116 printf "\e033[0m\en"
5118 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
5119 printf "\e033[0m\en"
5121 .It Ar bg=
5122 background colour attribute (see
5123 .Cd fg=
5124 for possible values).
5127 The command
5128 .Ic \&uncolour
5129 will remove for the given colour type (the special type
5130 .Ql *
5131 selects all) the given mapping; if the optional precondition argument is
5132 given only the exact tuple of mapping and precondition is removed.
5133 The special name
5134 .Ql *
5135 will remove all mappings (no precondition allowed), thus
5136 .Ql uncolour * *
5137 will remove all established mappings.
5140 .It Ic commandalias , uncommandalias
5141 \*(NQ Define or list, and remove, respectively, command aliases.
5142 An (command)alias can be used everywhere a normal command can be used,
5143 but always takes precedence: any arguments that are given to the command
5144 alias are joined onto the alias expansion, and the resulting string
5145 forms the command line that is, in effect, executed.
5146 The latter command removes all given aliases, the special name asterisk
5147 .Ql *
5148 will remove all existing aliases.
5149 When used without arguments the former shows a list of all currently
5150 known aliases, with one argument only the expansion of the given one.
5152 With two or more arguments a command alias is defined or updated: the
5153 first argument is the name under which the remaining command line should
5154 be accessible, the content of which can be just about anything.
5155 An alias may itself expand to another alias, but to avoid expansion loops
5156 further expansion will be prevented if an alias refers to itself or if
5157 an expansion depth limit is reached.
5158 Explicit expansion prevention is available via reverse solidus
5159 .Cm \e ,
5160 one of the
5161 .Sx "Command modifiers" .
5162 .Bd -literal -offset indent
5163 ? commandalias xx
5164 \*(uA: `commandalias': no such alias: xx
5165 ? commandalias xx echo hello,
5166 ? commandalias xx
5167 commandalias xx 'echo hello,'
5168 ? xx
5169 hello,
5170 ? xx world
5171 hello, world
5174 .It Ic Copy
5175 (C) Similar to
5176 .Ic copy ,
5177 but copy the messages to a file named after the local part of the
5178 sender of the first message instead of taking a filename argument;
5179 .Va outfolder
5180 is inspected to decide on the actual storage location.
5182 .It Ic copy
5183 (c) Copy messages to the named file and do not mark them as being saved;
5184 otherwise identical to
5185 .Ic save .
5187 .It Ic csop
5188 \*(NQ A multiplexer command which provides C-style string operations on
5189 8-bit bytes without a notion of locale settings and character sets,
5190 effectively assuming ASCII data.
5191 For numeric and other operations refer to
5192 .Ic vexpr .
5193 .Cm vput ,
5194 one of the
5195 .Sx "Command modifiers" ,
5196 is supported.
5197 The error result is
5198 .Ql -1
5199 for usage errors and numeric results, the empty string otherwise;
5200 missing data errors, as for unsuccessful searches, result in the
5201 .Va \&!
5202 error number being set to
5203 .Va ^ERR Ns -NODATA .
5204 Where the question mark
5205 .Ql \&?
5206 modifier suffix is supported, a case-insensitive (ASCII mapping)
5207 operation mode is supported; the keyword
5208 .Ql case
5209 is optional so that
5210 .Ql find?
5212 .Ql find?case
5213 are identical.
5214 .Bl -hang -width ".It Cm length"
5215 .It Cm length
5216 Queries the length of the given argument.
5217 .It Cm hash , Cm hash32
5218 Calculates a hash value of the given argument.
5219 The latter will return a 32-bit result regardless of host environment.
5220 .Ql \&?
5221 modifier suffix is supported.
5222 These use Chris Torek's hash algorithm, the resulting hash value is
5223 bit mixed as shown by Bret Mulvey.
5224 .It Cm find
5225 Search for the second in the first argument.
5226 Shows the resulting 0-based offset shall it have been found.
5227 .Ql \&?
5228 modifier suffix is supported.
5229 .It Cm substring
5230 Creates a substring of its first argument.
5231 The optional second argument is the 0-based starting offset,
5232 a negative one counts from the end;
5233 the optional third argument specifies the length of the desired result,
5234 a negative length leaves off the given number of bytes at the end of the
5235 original string; by default the entire string is used.
5236 This operation tries to work around faulty arguments (set
5237 .Va verbose
5238 for error logs), but reports them via the error number
5239 .Va \&!
5241 .Va ^ERR Ns -OVERFLOW .
5242 .It Cm trim
5243 Trim away whitespace characters from both ends of the argument.
5244 .It Cm trim-front
5245 Trim away whitespace characters from the begin of the argument.
5246 .It Cm trim-end
5247 Trim away whitespace characters from the end of the argument.
5250 .It Ic cwd
5251 Show the name of the current working directory, as reported by
5252 .Xr getcwd 3 .
5253 Supports
5254 .Cm vput
5255 (see
5256 .Sx "Command modifiers" ) .
5257 The return status is tracked via
5258 .Va \&? .
5260 .It Ic Decrypt
5261 \*(OP For unencrypted messages this command is identical to
5262 .Ic Copy ;
5263 Encrypted messages are first decrypted, if possible, and then copied.
5265 .It Ic decrypt
5266 \*(OP For unencrypted messages this command is identical to
5267 .Ic copy ;
5268 Encrypted messages are first decrypted, if possible, and then copied.
5271 .It Ic define , undefine
5272 The latter command deletes the given macro, the special name
5273 .Ql *
5274 will discard all existing macros.
5275 Deletion of (a) macro(s) can be performed from within running (a)
5276 macro(s), including self-deletion.
5277 Without arguments the former command prints the current list of macros,
5278 including their content, otherwise it defines a macro, replacing an
5279 existing one of the same name as applicable.
5281 A defined macro can be invoked explicitly by using the
5282 .Ic call ,
5283 .Ic call_if
5285 .Ic xcall
5286 commands, or implicitly if a macro hook is triggered, for example a
5287 .Va folder-hook .
5288 Execution of a macro body can be stopped from within by calling
5289 .Ic return .
5291 Temporary macro block-scope variables can be created or deleted with the
5292 .Cm local
5293 command modifier in conjunction with the commands
5294 .Ic set
5296 .Ic unset ,
5297 respectively.
5298 To enforce unrolling of changes made to (global)
5299 .Sx "INTERNAL VARIABLES"
5300 the command
5301 .Ic localopts
5302 can be used instead; its covered scope depends on how (i.e.,
5303 .Dq as what :
5304 normal macro, folder hook, hook,
5305 .Ic account
5306 switch) the macro is invoked.
5308 Inside a
5309 .Ic call Ns
5310 ed macro, the given positional parameters are implicitly local
5311 to the macro's scope, and may be accessed via the variables
5312 .Va * ,
5313 .Va @ ,
5314 .Va #
5316 .Va 1
5317 and any other positive unsigned decimal number less than or equal to
5318 .Va # .
5319 Positional parameters can be
5320 .Ic shift Ns
5321 ed, or become completely replaced, removed etc. via
5322 .Ic vpospar .
5323 A helpful command for numeric computation and string evaluations is
5324 .Ic vexpr ,
5325 .Ic csop
5326 offers C-style byte string operations.
5327 .Bd -literal -offset indent
5328 define name {
5329   command1
5330   command2
5331   ...
5332   commandN
5335 define exmac {
5336   echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
5337   return 1000 0
5339 call exmac Hello macro exmac!
5340 echo ${?}/${!}/${^ERRNAME}
5344 .It Ic delete , undelete
5345 (d, u) Marks the given message list as being or not being
5346 .Ql deleted ,
5347 respectively; if no argument has been specified then the usual search
5348 for a visible message is performed, as documented for
5349 .Sx "Message list arguments" ,
5350 showing only the next input prompt if the search fails.
5351 Deleted messages will neither be saved in the
5352 .Mx -sx
5353 .Sx "secondary mailbox"
5354 .Ev MBOX
5355 nor will they be available for most other commands.
5356 If the
5357 .Va autoprint
5358 variable is set, the new
5359 .Dq dot
5360 or the last message restored, respectively, is automatically
5361 .Ic type Ns
5362 d; also see
5363 .Ic dp ,
5364 .Ic dt .
5366 .It Ic digmsg
5367 \*(NQ Digging (information out of) messages is possible through
5368 .Ic \&\&digmsg
5369 objects, which can be
5370 .Cm create Ns
5371 d for the given message number; in
5372 .Sx "Compose mode"
5373 the hyphen-minus
5374 .Ql -
5375 will instead open the message that is being composed.
5376 If a hyphen-minus is given as the optional third argument then output
5377 will be generated on the standard output channel instead of being
5378 subject to consumption by the
5379 .Ic readall
5381 .Ic read
5383 .Ic readsh )
5384 command(s).
5385 Note: output must be consumed before normal processing can continue; for
5386 .Ic \&\&digmsg
5387 objects this means each command output has to be read until the end of
5388 file (EOF) state occurs.
5390 The objects may be
5391 .Cm remove Ns
5392 d again by giving the same identifier used for creation;
5393 this step could be omitted: objects will be automatically closed
5394 when the active
5395 .Ic folder
5396 (mailbox) or the compose mode is left, respectively.
5397 In all other use cases the second argument is an object identifier,
5398 and the third and all following arguments are interpreted as via
5399 .Ic ~^
5400 (see
5401 .Sx "COMMAND ESCAPES" ) :
5402 .Bd -literal -offset indent
5403 ? vput = msgno; digmsg create $msgno
5404 ? digmsg $msgno header list;   readall x;   echon $x
5405 210 Subject From To Message-ID References In-Reply-To
5406 ? digmsg $msgno header show Subject;readall x;echon $x
5407 212 Subject
5408 \(aqHello, world'
5410 ? digmsg remove $msgno
5413 .It Ic discard
5414 (di) Identical to
5415 .Ic ignore .
5416 Superseded by the multiplexer
5417 .Ic headerpick .
5420 .It Ic dp , dt
5421 Delete the given messages and automatically
5422 .Ic type
5423 the new
5424 .Dq dot
5425 if one exists, regardless of the setting of
5426 .Va autoprint .
5428 .It Ic dotmove
5429 Move the
5430 .Dq dot
5431 up or down by one message when given
5432 .Ql +
5434 .Ql -
5435 argument, respectively.
5438 .It Ic draft , undraft
5439 Take message lists and mark each given message as being draft, or not
5440 being draft, respectively, as documented in the section
5441 .Sx "Message states" .
5443 .It Ic echo
5444 \*(NQ(ec) Print the given strings, equivalent to the shell utility
5445 .Xr echo 1 ,
5446 that is,
5447 .Sx "Shell-style argument quoting"
5448 expansion is performed and, different to the otherwise identical
5449 .Ic echon ,
5450 a trailing newline is echoed.
5451 .Cm vput
5452 as documented in
5453 .Sx "Command modifiers"
5454 is supported, and the error number
5455 .Va \&!
5456 is managed: if data is stored in a variable then the return value
5457 reflects the length of the result string in case of success and is
5458 .Ql -1
5459 on error.
5461 .Sy Remarks:
5462 this command traditionally (in BSD Mail) also performed
5463 .Sx "Filename transformations" ,
5464 which is standard incompatible and hard to handle because quoting
5465 transformation patterns is not possible; the subcommand
5466 .Cm file-expand
5468 .Ic vexpr
5469 can be used to expand filenames.
5471 .It Ic echoerr
5472 \*(NQ Identical to
5473 .Ic echo ,
5474 but the message is written to standard error, and prefixed by
5475 .Va log-prefix .
5476 Also see
5477 .Ic echoerrn .
5478 In interactive sessions the \*(OPal message ring queue for
5479 .Ic errors
5480 will be used instead, if available and
5481 .Cm vput
5482 was not used.
5484 .It Ic echon
5485 \*(NQ Identical to
5486 .Ic echo ,
5487 but does not write or store a trailing newline.
5489 .It Ic echoerrn
5490 \*(NQ Identical to
5491 .Ic echoerr ,
5492 but does not write or store a trailing newline.
5494 .It Ic edit
5495 (e) Point the text
5496 .Ev EDITOR
5497 at each message from the given list in turn.
5498 Modified contents are discarded unless the
5499 .Va writebackedited
5500 variable is set, and are not used unless the mailbox can be written to
5501 and the editor returns a successful exit status.
5502 .Ic visual
5503 can be used instead for a more display oriented editor.
5505 .It Ic elif
5506 Part of the
5507 .Ic if
5508 (see there for more),
5509 .Ic elif , else , endif
5510 conditional \(em if the condition of a preceding
5511 .Ic if
5512 was false, check the following condition and execute the following block
5513 if it evaluates true.
5515 .It Ic else
5516 (el) Part of the
5517 .Ic if
5518 (see there for more),
5519 .Ic elif , else , endif
5520 conditional \(em if none of the conditions of the preceding
5521 .Ic if
5523 .Ic elif
5524 commands was true, the
5525 .Ic else
5526 block is executed.
5528 .It Ic endif
5529 (en) Marks the end of an
5530 .Ic if
5531 (see there for more),
5532 .Ic elif , else , endif
5533 conditional execution block.
5535 .It Ic environ
5536 \*(NQ There is a strict separation in between
5537 .Sx "INTERNAL VARIABLES"
5538 and the program
5539 .Sx ENVIRONMENT ,
5540 which is inherited by child processes.
5541 Some variables of the latter are however vivid for program operation,
5542 their purpose is known, therefore they have been integrated
5543 transparently into handling of the former, as accessible via
5544 .Ic set
5546 .Ic unset .
5547 To integrate any other environment variable, and/or to export internal
5548 variables into the process environment where they normally are not, a
5549 .Cm link
5550 needs to become established with this command, for example
5552 .Dl environ link PERL5LIB TZ
5554 Afterwards changing such variables with
5555 .Ic set
5556 will cause automatic updates of the environment, too.
5557 Sufficient system support provided (it was in BSD as early as 1987, and
5558 is standardized since Y2K) removing such variables with
5559 .Ic unset
5560 will remove them also from the environment, but in any way the knowledge
5561 they ever have been
5562 .Cm link Ns
5563 ed will be lost.
5564 This implies that
5565 .Ic localopts
5566 may cause loss of such links.
5568 The subcommand
5569 .Cm unlink
5570 removes an existing link without otherwise touching variables, the
5571 .Cm set
5573 .Cm unset
5574 subcommands are identical to
5575 .Ic set
5577 .Ic unset ,
5578 but additionally update the program environment accordingly; removing
5579 a variable breaks any freely established
5580 .Cm link .
5582 .It Ic errors
5583 \*(OP As console user interfaces at times scroll error messages by too
5584 fast and/or out of scope, data can additionally be sent to an error queue
5585 manageable by this command:
5586 .Ar show
5587 or no argument will display and clear the queue,
5588 .Ar clear
5589 will only clear it.
5590 As the queue becomes filled with
5591 .Va errors-limit
5592 entries the eldest entries are being dropped.
5593 There are also the variables
5594 .Va ^ERRQUEUE-COUNT
5596 .Va ^ERRQUEUE-EXISTS .
5598 .It Ic eval
5599 \*(NQ Construct a command by concatenating the arguments, separated with
5600 a single space character, and then evaluate the result.
5601 This command passes through the exit status
5602 .Va \&?
5603 and error number
5604 .Va \&!
5605 of the evaluated command; also see
5606 .Ic call .
5607 .Bd -literal -offset indent
5608 define xxx {
5609   echo "xxx arg <$1>"
5610   shift
5611   if $# -gt 0
5612     \excall xxx "$@"
5613   endif
5615 define yyy {
5616   eval "$@ ' ball"
5618 call yyy '\ecall xxx' "b\e$'\et'u ' "
5619 call xxx arg <b      u>
5620 call xxx arg <  >
5621 call xxx arg <ball>
5624 .It Ic exit
5625 (ex or x) Exit from \*(UA without changing the active mailbox and skip
5626 any saving of messages in the
5627 .Mx -sx
5628 .Sx "secondary mailbox"
5629 .Ev MBOX ,
5630 as well as a possibly tracked line editor
5631 .Va history-file .
5632 A possibly set
5633 .Va on-account-cleanup
5634 will be invoked, however.
5635 The optional status number argument will be passed through to
5636 .Xr exit 3 .
5637 \*(ID For now it can happen that the given status will be overwritten,
5638 later this will only occur if a later error needs to be reported onto an
5639 otherwise success indicating status.
5641 .It Ic File
5642 (Fi) Like
5643 .Ic folder ,
5644 but open the mailbox read-only.
5646 .It Ic file
5647 (fi) See
5648 .Ic folder .
5651 .It Ic filetype , unfiletype
5652 \*(NQ Define, list, and remove, respectively, file handler hooks,
5653 which provide (shell) commands that enable \*(UA to load and save MBOX
5654 files from and to files with the registered file extensions, as shown
5655 and described for
5656 .Ic folder .
5657 The extensions are used case-insensitively, yet the auto-completion
5658 feature of for example
5659 .Ic folder
5660 will only work case-sensitively.
5661 An intermediate temporary file will be used to store the expanded data.
5662 The latter command will remove hooks for all given extensions, asterisk
5663 .Ql *
5664 will remove all existing handlers.
5666 When used without arguments the former shows a list of all currently
5667 defined file hooks, with one argument the expansion of the given alias.
5668 Otherwise three arguments are expected, the first specifying the file
5669 extension for which the hook is meant, and the second and third defining
5670 the load- and save commands to deal with the file type, respectively,
5671 both of which must read from standard input and write to standard
5672 output.
5673 Changing hooks will not affect already opened mailboxes (\*(ID except below).
5674 \*(ID For now too much work is done, and files are oftened read in twice
5675 where once would be sufficient: this can cause problems if a filetype is
5676 changed while such a file is opened; this was already so with the
5677 built-in support of .gz etc. in Heirloom, and will vanish in v15.
5678 \*(ID For now all handler strings are passed to the
5679 .Ev SHELL for evaluation purposes; in the future a
5680 .Ql \&!
5681 prefix to load and save commands may mean to bypass this shell instance:
5682 placing a leading space will avoid any possible misinterpretations.
5683 .Bd -literal -offset indent
5684 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
5685     gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
5686     zst 'zstd -dc' 'zstd -19 -zc' \e
5687     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5688 ? set record=+sent.zst.pgp
5692 .It Ic flag , unflag
5693 Take message lists and mark the messages as being flagged, or not being
5694 flagged, respectively, for urgent/special attention.
5695 See the section
5696 .Sx "Message states" .
5698 .It Ic Folder
5699 (Fold) Like
5700 .Ic folder ,
5701 but open the mailbox read-only.
5703 .It Ic folder
5704 (fold) Open a new, or show status information of the current mailbox.
5705 If an argument is given, changes (such as deletions) will be written
5706 out, a new mailbox will be opened, the internal variables
5707 .Va mailbox-resolved
5709 .Va mailbox-display
5710 will be updated, a set according
5711 .Va folder-hook
5712 is executed, and optionally a summary of
5713 .Ic headers
5714 is displayed if the variable
5715 .Va header
5716 is set.
5718 .Sx "Filename transformations"
5719 will be applied to the
5720 .Ar name
5721 argument, and
5722 .Ql protocol://
5723 prefixes are, i.e., URL (see
5724 .Sx "On URL syntax and credential lookup" )
5725 syntax is understood, as in
5726 .Ql mbox:///tmp/somefolder .
5727 If a protocol prefix is used the mailbox type is fixated, otherwise
5728 opening none-existing
5729 .Ic folders
5730 uses the protocol defined in
5731 .Va newfolders .
5733 For the protocols
5734 .Ar mbox
5736 .Ar file
5737 (MBOX database), as well as
5738 .Ar eml
5739 (electronic mail message \*(ID read-only) the list of all registered
5740 .Ic filetype Ns
5741 s is traversed to check whether hooks shall be used to load (and save)
5742 data from (and to) the given
5743 .Ar name .
5744 Changing hooks will not affect already opened mailboxes.
5745 For example, the following creates hooks for the
5746 .Xr gzip 1
5747 compression tool and a combined compressed and encrypted format:
5748 .Bd -literal -offset indent
5749 ? filetype \e
5750     gzip 'gzip -dc' 'gzip -c' \e
5751     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5754 For historic reasons
5755 .Ic filetype Ns
5756 s provide limited (case-sensitive) auto-completion capabilities.
5757 For example
5758 .Ql mbox.gz
5759 will be found for
5760 .Ql \&? file mbox ,
5761 provided that corresponding handlers are installed.
5762 It will neither find
5763 .Ql mbox.GZ
5765 .Ql mbox.Gz
5766 however, but an explicit
5767 .Ql \&? file mbox.GZ
5768 will find and use the handler for
5769 .Ql gz .
5770 \*(ID The latter mode can only be used for MBOX files.
5772 EML files consist of only one mail message,
5773 \*(ID and can only be opened read-only.
5774 When reading MBOX files tolerant POSIX rules are used by default.
5775 Invalid message boundaries that can be found quite often in historic
5776 MBOX files will be complained about (even more with
5777 .Va debug ) :
5778 in this case the method described for
5779 .Va mbox-rfc4155
5780 can be used to create a valid MBOX database from the invalid input.
5782 MBOX databases and EML files will always be protected via file-region locks
5783 .Pf ( Xr fcntl 2 )
5784 during file operations to protect against concurrent modifications.
5785 .Mx -ix "dotlock files"
5786 \*(OP An MBOX
5787 .Va inbox
5788 .Pf ( Ev MAIL )
5790 .Mx -sx
5791 .Sx "primary system mailbox"
5792 will also be protected by so-called dotlock files,
5793 the traditional way of mail spool file locking: for any file
5794 .Ql x
5795 a lock file
5796 .Ql x.lock
5797 will be created during the synchronization, in the same directory and
5798 with the same user and group identities as the file of interest \(em
5799 as necessary created by an external privileged dotlock helper.
5800 .Va dotlock-disable
5801 disables dotlock files.
5802 Also see
5803 .Sx FAQ :
5804 .Sx "Howto handle stale dotlock files" .
5806 \*(OP If no protocol has been fixated, and
5807 .Ar name
5808 refers to a directory with the subdirectories
5809 .Ql tmp ,
5810 .Ql new
5812 .Ql cur ,
5813 then it is treated as a folder in
5814 .Dq Maildir
5815 format.
5816 The maildir format stores each message in its own file, and has been
5817 designed so that file locking is not necessary when reading or writing
5818 files.
5820 \*(OPally URLs can be used to access network resources, securely via
5821 .Sx "Encrypted network communication" ,
5822 if so supported.
5823 Network communication socket timeouts are configurable via
5824 .Va socket-connect-timeout .
5825 All network traffic may be proxied over a SOCKS server via
5826 .Va socks-proxy .
5828 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
5829 .Dl \*(OU protocol://[user@]host[:port][/path]
5831 \*(OPally supported network protocols are
5832 .Ar pop3
5833 (POP3) and
5834 .Ar pop3s
5835 (POP3 with TLS encrypted transport),
5836 .Ar imap
5838 .Ar imaps .
5840 .Ar [/path]
5841 part is valid only for IMAP; there it defaults to
5842 .Ar INBOX .
5843 Network URLs require a special encoding as documented in the section
5844 .Sx "On URL syntax and credential lookup" .
5846 .It Ic folders
5847 Lists the names of all folders below the given argument or
5848 .Va folder .
5849 For file-based protocols
5850 .Ev LISTER
5851 will be used for display purposes.
5854 .It Ic Followup , followup
5855 \*(CM(F,fo) Similar to
5856 .Ic Reply ,
5858 .Ic reply ,
5859 respectively, but save the message in a file named after the local part
5860 of the (first) recipient's address, possibly overwriting
5861 .Va record ,
5862 and honouring
5863 .Va outfolder .
5864 Also see
5865 .Ic Copy
5867 .Ic Save .
5869 .It Ic Forward
5870 \*(CM Similar to
5871 .Ic forward ,
5872 but saves the message in a file named after the local part of the
5873 recipient's address (instead of in
5874 .Va record Ns ).
5876 .It Ic forward
5877 \*(CM Take a message list and the address of a recipient, subject to
5878 .Va fullnames ,
5879 to whom the messages are sent.
5880 The text of the original message is included in the new one,
5881 enclosed by the values of
5882 .Va forward-inject-head
5884 .Va forward-inject-tail .
5885 .Va content-description-forwarded-message
5886 is inspected.
5887 The list of included headers can be filtered with the
5888 .Ql forward
5889 slot of the white- and blacklisting command
5890 .Ic headerpick .
5891 Only the first part of a multipart message is included but for
5892 .Va forward-as-attachment .
5894 This may generate the errors
5895 .Va ^ERR Ns -DESTADDRREQ
5896 if no receiver has been specified, or was rejected by
5897 .Va expandaddr
5898 policy,
5899 .Va ^ERR Ns -IO
5900 if an I/O error occurs,
5901 .Va ^ERR Ns -NOTSUP
5902 if a necessary character set conversion fails, and
5903 .Va ^ERR Ns -INVAL
5904 for other errors.
5905 It can also fail with errors of
5906 .Sx "Specifying messages" .
5907 Any error stops processing of further messages.
5909 .It Ic from
5910 (f) Takes a list of message specifications and displays a summary of
5911 their message headers, exactly as via
5912 .Ic headers ,
5913 making the first message of the result the new
5914 .Dq dot
5915 (the last message if
5916 .Va showlast
5917 is set).
5918 An alias of this command is
5919 .Ic search .
5920 Also see
5921 .Sx "Specifying messages" .
5922 .It Ic Fwd
5923 \*(OB Alias for
5924 .Ic Forward .
5925 .It Ic fwd
5926 \*(OB Alias for
5927 .Ic forward .
5928 .It Ic fwdignore
5929 \*(OB Superseded by the multiplexer
5930 .Ic headerpick .
5931 .It Ic fwdretain
5932 \*(OB Superseded by the multiplexer
5933 .Ic headerpick .
5934 .It Ic ghost , unghost
5935 \*(OB Replaced by
5936 .Ic commandalias ,
5937 .Ic uncommandalias .
5940 .It Ic headerpick , unheaderpick
5941 \*(NQ Multiplexer command to manage white- and blacklisting
5942 selections of header fields for a variety of applications.
5943 Without arguments the set of contexts that have settings is displayed.
5944 When given arguments, the first argument is the context to which the
5945 command applies, one of (case-insensitive)
5946 .Ql type
5947 for display purposes (for example
5948 .Ic type ) ,
5949 .Ql save
5950 for selecting which headers shall be stored persistently when
5951 .Ic save ,
5952 .Ic copy ,
5953 .Ic move
5954 or even
5955 .Ic decrypt Ns
5956 ing messages (note that MIME related etc. header fields should not be
5957 ignored in order to not destroy usability of the message in this case),
5958 .Ql forward
5959 for stripping down messages when
5960 .Ic forward Ns
5961 ing message (has no effect if
5962 .Va forward-as-attachment
5963 is set), and
5964 .Ql top
5965 for defining user-defined set of fields for the command
5966 .Ic top .
5968 The current settings of the given context are displayed if it is the
5969 only argument.
5970 A second argument denotes the type of restriction that is to be chosen,
5971 it may be (a case-insensitive prefix of)
5972 .Ql retain
5974 .Ql ignore
5975 for white- and blacklisting purposes, respectively.
5976 Establishing a whitelist suppresses inspection of the corresponding
5977 blacklist.
5979 If no further argument is given the current settings of the given type
5980 will be displayed, otherwise the remaining arguments specify header
5981 fields, which \*(OPally may be given as regular expressions, to be added
5982 to the given type.
5983 The special wildcard field (asterisk,
5984 .Ql * )
5985 will establish a (fast) shorthand setting which covers all fields.
5987 The latter command always takes three or more arguments and can be used
5988 to remove selections, i.e., from the given context, the given type of
5989 list, all the given headers will be removed, the special argument
5990 .Ql *
5991 will remove all headers.
5993 .It Ic headers
5994 (h) Show the current group of headers, the size of which depends on
5995 the variable
5996 .Va screen
5997 in interactive mode, and the format of which can be defined with
5998 .Va headline .
5999 If a message-specification is given the group of headers containing the
6000 first message therein is shown and the message at the top of the screen
6001 becomes the new
6002 .Dq dot ;
6003 the last message is targeted if
6004 .Va showlast
6005 is set.
6007 .It Ic help
6008 (hel) A synonym for
6009 .Ic \&? .
6011 .It Ic history
6012 \*(OP Without arguments or when given
6013 .Cm show
6014 all history entries are shown (this mode also supports a more
6015 .Va verbose
6016 output).
6017 .Cm load
6018 will replace the list of entries with the content of
6019 .Va history-file ,
6021 .Cm save
6022 will dump all entries to said file, replacing former content, and
6023 .Cm clear
6024 will delete all entries.
6025 The argument can also be a signed decimal
6026 .Ar NUMBER ,
6027 which will select and evaluate the respective history entry, and move it
6028 to the top of the history; a negative number is used as an offset to the
6029 current command so that
6030 .Ql -1
6031 will select the last command, the history top, whereas
6032 .Cm delete
6033 will delete all given entries
6034 .Pf ( Ar :NUMBER: ) .
6035 Also see
6036 .Sx "On terminal control and line editor" .
6038 .It Ic hold
6039 (ho, also
6040 .Ic preserve )
6041 Takes a message list and marks each message therein to be saved in the
6042 user's system
6043 .Va inbox
6044 instead of in the
6045 .Mx -sx
6046 .Sx "secondary mailbox"
6047 .Ev MBOX .
6048 Does not override the
6049 .Ic delete
6050 command.
6051 \*(UA deviates from the POSIX standard with this command, because a
6052 .Ic next
6053 command issued after
6054 .Ic hold
6055 will display the following message, not the current one.
6057 .It Ic if
6058 (i) Part of the
6059 .Ic \&\&if , Ic elif , else , endif
6060 conditional execution construct \(em if the given condition is true then
6061 the encapsulated block is executed.
6062 The POSIX standard only supports the (case-insensitive) conditions
6063 .Ql r Ns
6064 eceive
6066 .Ql s Ns
6067 end, the remaining are non-portable extensions.
6068 \*(ID In conjunction with the
6069 .Cm wysh
6070 command prefix(es)
6071 .Sx "Shell-style argument quoting"
6072 and more test operators are available.
6073 .Bd -literal -offset indent
6074 if receive
6075   commands ...
6076 else
6077   commands ...
6078 endif
6081 Further (case-insensitive) one-argument conditions are
6082 .Ql t Ns
6083 erminal which evaluates to true in interactive terminal sessions
6084 (running with standard input or standard output attached to a terminal,
6085 and none of the
6086 .Dq quickrun
6087 command line options
6088 .Fl e ,
6089 .Fl H
6091 .Fl L
6092 have been used), as well as any boolean value (see
6093 .Sx "INTERNAL VARIABLES"
6094 for textual boolean representations) to mark an enwrapped block as
6095 .Dq never execute
6097 .Dq always execute .
6098 (Remarks: condition syntax errors skip all branches until
6099 .Ic endif . )
6101 \*(OU and without
6102 .Cm wysh :
6103 It is possible to check
6104 .Sx "INTERNAL VARIABLES"
6105 as well as
6106 .Sx ENVIRONMENT
6107 variables for existence or compare their expansion against a user given
6108 value or another variable by using the
6109 .Ql $
6110 .Pf ( Dq variable next )
6111 conditional trigger character;
6112 a variable on the right hand side may be signalled using the same
6113 mechanism.
6114 Variable names may be enclosed in a pair of matching braces.
6115 When this mode has been triggered, several operators are available
6116 (\*(IN and
6117 .Cm wysh :
6118 they are always available, and there is no trigger: variables will have
6119 been expanded by the shell-compatible parser before the
6120 .Ic if
6121 etc. command sees them).
6123 \*(IN Two argument conditions.
6124 Variables can be tested for existence and expansion:
6125 .Ql -N
6126 will test whether the given variable exists, so that
6127 .Ql -N editalong
6128 will evaluate to true when
6129 .Va editalong
6130 is set, whereas
6131 .Ql -Z editalong
6132 will if it is not.
6133 .Ql -n """$editalong"""
6134 will be true if the variable is set and expands to a non-empty string,
6135 .Ql -z $'\e$editalong'
6136 only if the expansion is empty, whether the variable exists or not.
6137 The remaining conditions take three arguments.
6139 Integer operators treat the arguments on the left and right hand side of
6140 the operator as integral numbers and compare them arithmetically.
6141 It is an error if any of the operands is not a valid integer, an empty
6142 argument (which implies it had been quoted) is treated as if it were 0.
6143 Via the question mark
6144 .Ql \&?
6145 modifier suffix a saturated operation mode is available where numbers
6146 will linger at the minimum or maximum possible value, instead of
6147 overflowing (or trapping), the keyword
6148 .Ql saturated
6149 is optional,
6150 .Ql ==? ,
6151 .Ql ==?satu
6153 .Ql ==?saturated
6154 are therefore identical.
6155 Available operators are
6156 .Ql -lt
6157 (less than),
6158 .Ql -le
6159 (less than or equal to),
6160 .Ql -eq
6161 (equal),
6162 .Ql -ne
6163 (not equal),
6164 .Ql -ge
6165 (greater than or equal to), and
6166 .Ql -gt
6167 (greater than).
6169 String and regular expression data operators compare the left and right
6170 hand side according to their textual content.
6171 Unset variables are treated as the empty string.
6172 Via the question mark
6173 .Ql \&?
6174 modifier suffix a case-insensitive operation mode is available, the keyword
6175 .Ql case
6176 is optional,
6177 .Ql ==?
6179 .Ql ==?case
6180 are identical.
6182 Available string operators are
6183 .Ql <
6184 (less than),
6185 .Ql <=
6186 (less than or equal to),
6187 .Ql ==
6188 (equal),
6189 .Ql !=
6190 (not equal),
6191 .Ql >=
6192 (greater than or equal to),
6193 .Ql >
6194 (greater than),
6195 .Ql =%
6196 (is substring of) and
6197 .Ql !%
6198 (is not substring of).
6199 By default these operators work on bytes and (therefore) do not take
6200 into account character set specifics.
6201 If the case-insensitivity modifier has been used, case is ignored
6202 according to the rules of the US-ASCII encoding, i.e., bytes are
6203 still compared.
6205 When the \*(OPal regular expression support is available, the additional
6206 string operators
6207 .Ql =~
6209 .Ql !~
6210 can be used.
6211 They treat the right hand side as an extended regular expression that is
6212 matched according to the active locale (see
6213 .Sx "Character sets" ) ,
6214 i.e., character sets should be honoured correctly.
6216 Conditions can be joined via AND-OR lists (where the AND operator is
6217 .Ql &&
6218 and the OR operator is
6219 .Ql || ) ,
6220 which have equal precedence and will be evaluated with left
6221 associativity, thus using the same syntax that is known for the
6222 .Xr sh 1 .
6223 It is also possible to form groups of conditions and lists by enclosing
6224 them in pairs of brackets
6225 .Ql [\ \&.\&.\&.\ ] ,
6226 which may be interlocked within each other, and also be joined via
6227 AND-OR lists.
6229 The results of individual conditions and entire groups may be modified
6230 via unary operators: the unary operator
6231 .Ql \&!
6232 will reverse the result.
6233 .Bd -literal -offset indent
6234 wysh set v15-compat=yes # with value: automatic "wysh"!
6235 if -N debug;echo *debug* set;else;echo not;endif
6236 if "$ttycharset" == UTF-8 || "$ttycharset" ==?cas UTF8
6237   echo ttycharset is UTF-8, the former case-sensitive!
6238 endif
6239 set t1=one t2=one
6240 if [ "${t1}" == "${t2}" ]
6241   echo These two variables are equal
6242 endif
6243 if "$features" =% ,+regex, && "$TERM" =~?case ^xterm\&.*
6244   echo ..in an X terminal
6245 endif
6246 if [ [ true ] && [ [ "${debug}" != '' ] || \e
6247     [ "$verbose" != '' ] ] ]
6248   echo Noisy, noisy
6249 endif
6250 if true && [ -n "$debug" || -n "${verbose}" ]
6251   echo Left associativity, as is known from the shell
6252 endif
6255 .It Ic ignore
6256 (ig) Identical to
6257 .Ic discard .
6258 Superseded by the multiplexer
6259 .Ic headerpick .
6261 .It Ic list
6262 Shows the names of all available commands, in command lookup order.
6263 \*(OP In conjunction with a set variable
6264 .Va verbose
6265 additional information will be provided for each command: the argument
6266 type will be indicated, the documentation string will be shown,
6267 and the set of command flags will show up:
6269 .Bl -tag -compact -width ".It Ql NEEDS_BOX"
6270 .It Ql "`local'"
6271 command supports the command modifier
6272 .Cm local .
6273 .It Ql "`vput'"
6274 command supports the command modifier
6275 .Cm vput .
6276 .It Ql "*!*"
6277 the error number is tracked in
6278 .Va \&! .
6279 .It Ql needs-box
6280 whether the command needs an active mailbox, a
6281 .Ic folder .
6282 .It Ql ok:
6283 indicators whether command is \&.\h'.3m'.\h'.3m'.
6284 .Bl -tag -compact -width ".It Ql SUBPROCESS"
6285 .It Ql batch/interactive
6286 usable in interactive or batch mode
6287 .Pf ( Fl # ) .
6288 .It Ql send-mode
6289 usable in send mode.
6290 .It Ql subprocess
6291 allowed to be used when running in a subprocess instance,
6292 for example from within a macro that is called via
6293 .Va on-compose-splice .
6295 .It Ql not ok:
6296 indicators whether command is not \&.\h'.3m'.\h'.3m'.
6297 .Bl -tag -compact -width ".It Ql COMPOSE_MODE"
6298 .It Ql compose mode
6299 available in
6300 .Sx "Compose mode".
6301 .It Ql startup
6302 available during program startup, like in
6303 .Sx "Resource files" .
6305 .It Ql "gabby"
6306 The command produces
6307 .Va history-gabby
6308 .Ic history
6309 entries.
6312 .It Ic localopts
6313 Enforce change localization of
6314 .Ic environ
6315 (linked)
6316 .Sx ENVIRONMENT
6317 as well as (global)
6318 .Sx "INTERNAL VARIABLES" ,
6319 meaning that their state will be reverted to the former one once the
6320 .Dq covered scope
6321 is left.
6322 Just like the command modifier
6323 .Cm local ,
6324 which provides block-scope localization for some commands (instead),
6325 it can only be used inside of macro definition blocks introduced by
6326 .Ic account
6328 .Ic define .
6329 The covered scope of an
6330 .Ic account
6331 is left once a different account is activated, and some macros, notably
6332 .Va folder-hook Ns s ,
6333 use their own specific notion of covered scope, here it will be extended
6334 until the folder is left again.
6336 This setting stacks up: i.e., if
6337 .Ql macro1
6338 enables change localization and calls
6339 .Ql macro2 ,
6340 which explicitly resets localization, then any value changes within
6341 .Ql macro2
6342 will still be reverted when the scope of
6343 .Ql macro1
6344 is left.
6345 (Caveats: if in this example
6346 .Ql macro2
6347 changes to a different
6348 .Ic account
6349 which sets some variables that are already covered by localizations,
6350 their scope will be extended, and in fact leaving the
6351 .Ic account
6352 will (thus) restore settings in (likely) global scope which actually
6353 were defined in a local, macro private context!)
6355 This command takes one or two arguments, the optional first one
6356 specifies an attribute that may be one of
6357 .Cm \&\&scope ,
6358 which refers to the current scope and is thus the default,
6359 .Cm call ,
6360 which causes any macro that is being
6361 .Ic call Ns
6362 ed to be started with localization enabled by default, as well as
6363 .Cm call-fixate ,
6364 which (if enabled) disallows any called macro to turn off localization:
6365 like this it can be ensured that once the current scope regains control,
6366 any changes made in deeper levels have been reverted.
6367 The latter two are mutually exclusive, and neither affects
6368 .Ic xcall .
6369 The (second) argument is interpreted as a boolean (string, see
6370 .Sx "INTERNAL VARIABLES" )
6371 and states whether the given attribute shall be turned on or off.
6372 .Bd -literal -offset indent
6373 define temporary_settings {
6374   set possibly_global_option1
6375   localopts on
6376   set localized_option1
6377   set localized_option2
6378   localopts scope off
6379   set possibly_global_option2
6384 .It Ic Lfollowup , Lreply
6385 \*(CM Reply to messages that come in via known
6386 .Pf ( Ic mlist )
6387 or subscribed
6388 .Pf ( Ic mlsubscribe )
6389 mailing lists, or pretend to do so (see
6390 .Sx "Mailing lists" ) :
6391 on top of the usual
6392 .Ic followup
6394 .Ic reply ,
6395 respectively, functionality this will actively resort and even remove
6396 message recipients in order to generate a message that is supposed to be
6397 sent to a mailing list.
6398 For example it will also implicitly generate a
6399 .Ql Mail-Followup-To:
6400 header if that seems useful, regardless of the setting of the variable
6401 .Va followup-to .
6402 For more documentation please refer to
6403 .Sx "On sending mail, and non-interactive mode" .
6405 This may generate the errors
6406 .Va ^ERR Ns -DESTADDRREQ
6407 if no receiver has been specified,
6408 .Va ^ERR Ns -PERM
6409 if some addressees where rejected by
6410 .Va expandaddr ,
6411 .Va ^ERR Ns -IO
6412 if an I/O error occurs,
6413 .Va ^ERR Ns -NOTSUP
6414 if a necessary character set conversion fails, and
6415 .Va ^ERR Ns -INVAL
6416 for other errors.
6417 It can also fail with errors of
6418 .Sx "Specifying messages" .
6419 Occurrence of some of the errors depend on the value of
6420 .Va expandaddr .
6421 Any error stops processing of further messages.
6423 .It Ic Mail
6424 \*(CM Similar to
6425 .Ic mail ,
6426 but saves the message in a file named after the local part of the first
6427 recipient's address (instead of in
6428 .Va record Ns ).
6430 .It Ic mail
6431 \*(CM(m) Takes a (list of) recipient address(es) as (an) argument(s),
6432 or asks on standard input if none were given;
6433 then collects the remaining mail content and sends it out.
6434 Unless the internal variable
6435 .Va fullnames
6436 is set recipient addresses will be stripped from comments, names etc.
6437 For more documentation please refer to
6438 .Sx "On sending mail, and non-interactive mode" .
6440 This may generate the errors
6441 .Va ^ERR Ns -DESTADDRREQ
6442 if no receiver has been specified,
6443 .Va ^ERR Ns -PERM
6444 if some addressees where rejected by
6445 .Va expandaddr ,
6446 .Va ^ERR Ns -NOTSUP
6447 if multiple messages have been specified,
6448 .Va ^ERR Ns -IO
6449 if an I/O error occurs,
6450 .Va ^ERR Ns -NOTSUP
6451 if a necessary character set conversion fails, and
6452 .Va ^ERR Ns -INVAL
6453 for other errors.
6454 It can also fail with errors of
6455 .Sx "Specifying messages" .
6456 Occurrence of some of the errors depend on the value of
6457 .Va expandaddr .
6459 .It Ic mailcap
6460 \*(OP When used without arguments or if
6461 .Ar show
6462 has been given the content of
6463 .Sx "The Mailcap files"
6464 cache is shown, (re-)initializing it first (as necessary.
6465 If the argument is
6466 .Ar load
6467 then the cache will only be (re-)initialized, and
6468 .Ar clear
6469 will remove its contents.
6470 Note that \*(UA will try to load the files only once, use
6471 .Ql Ic \&\&mailcap Ns \:\0\:clear
6472 to unlock further attempts.
6473 Loading and parsing can be made more
6474 .Va verbose .
6476 .It Ic mbox
6477 (mb) The given message list is to be sent to the
6478 .Mx -sx
6479 .Sx "secondary mailbox"
6480 .Ev MBOX
6481 when \*(UA is quit; this is the default action unless the variable
6482 .Va hold
6483 is set.
6484 \*(ID This command can only be used in a
6485 .Mx -sx
6486 .Sx "primary system mailbox" .
6489 .It Ic mimetype , unmimetype
6490 \*(NQ Without arguments the content of the MIME type cache will displayed;
6491 a more verbose listing will be produced if either of
6492 .Va debug
6494 .Va verbose
6495 are set.
6496 When given arguments they will be joined, interpreted as shown in
6497 .Sx "The mime.types files"
6498 (also see
6499 .Sx "HTML mail and MIME attachments" ) ,
6500 and the resulting entry will be added (prepended) to the cache.
6501 In any event MIME type sources are loaded first as necessary \(en
6502 .Va mimetypes-load-control
6503 can be used to fine-tune which sources are actually loaded.
6505 The latter command deletes all specifications of the given MIME type, thus
6506 .Ql \&? unmimetype text/plain
6507 will remove all registered specifications for the MIME type
6508 .Ql text/plain .
6509 The special name
6510 .Ql *
6511 will discard all existing MIME types, just as will
6512 .Ql reset ,
6513 but which also reenables cache initialization via
6514 .Va mimetypes-load-control .
6516 .It Ic mimeview
6517 \*(ID Only available in interactive mode, this command allows execution
6518 of external MIME type handlers which do not integrate into the normal
6519 .Ic type
6520 output (see
6521 .Sx "HTML mail and MIME attachments" ) .
6522 (\*(ID No syntax to directly address parts, this restriction may vanish.)
6523 The user will be asked for each non-text part of the given message in
6524 turn whether the registered handler shall be used to display the part.
6527 .It Ic mlist , unmlist
6528 \*(NQ Manage the list of known
6529 .Sx "Mailing lists" ;
6530 subscriptions are controlled via
6531 .Ic mlsubscribe .
6532 The latter command deletes all given arguments,
6533 or all at once when given the asterisk
6534 .Ql * .
6535 The former shows the list of all currently known lists if used
6536 without arguments, otherwise the given arguments will become known.
6537 \*(OP In the latter case, arguments which contain any of the
6538 .Mx -sx
6539 .Sx "magic regular expression characters"
6540 will be interpreted as one, possibly matching many addresses;
6541 these will be sequentially matched via linked lists instead of being
6542 looked up in a dictionary.
6545 .It Ic mlsubscribe , unmlsubscribe
6546 Building upon the command pair
6547 .Ic mlist , unmlist ,
6548 but only managing the subscription attribute of mailing lists.
6549 (The former will also create not yet existing mailing lists.)
6551 .It Ic Move
6552 Similar to
6553 .Ic move ,
6554 but move the messages to a file named after the local part of the
6555 sender of the first message instead of taking a filename argument;
6556 .Va outfolder
6557 is inspected to decide on the actual storage location.
6559 .It Ic move
6560 Acts like
6561 .Ic copy
6562 but marks the messages for deletion if they were transferred
6563 successfully.
6565 .It Ic More
6566 Like
6567 .Ic more ,
6568 but also displays header fields which would not pass the
6569 .Ic headerpick
6570 selection, and all MIME parts.
6571 Identical to
6572 .Ic Page .
6574 .It Ic more
6575 Invokes the
6576 .Ev PAGER
6577 on the given messages, even in non-interactive mode and as long as the
6578 standard output is a terminal.
6579 Identical to
6580 .Ic page .
6582 .It Ic mtaaliases
6583 \*(OP When used without arguments or if
6584 .Ar show
6585 has been given the content of the
6586 .Va mta-aliases
6587 cache is shown, (re-)initializing it first (as necessary).
6588 If the argument is
6589 .Ar load
6590 then the cache will only be (re-)initialized, and
6591 .Ar clear
6592 will remove its contents.
6594 .It Ic netrc
6595 \*(OP When used without arguments, or when the argument was
6596 .Ar show
6597 the content of the
6598 .Pa \*(VN
6599 cache is shown, initializing it as necessary.
6600 If the argument is
6601 .Ar load
6602 then the cache will be (re)loaded, whereas
6603 .Ar clear
6604 removes it.
6605 Loading and parsing can be made more
6606 .Va verbose .
6607 .Ar lookup
6608 will query the cache for the URL given as the second argument
6609 .Pf ( Ql [USER@]HOST ) .
6611 .Va netrc-lookup ,
6612 .Va netrc-pipe
6613 and the section
6614 .Sx "On URL syntax and credential lookup" ;
6615 the section
6616 .Sx "The .netrc file"
6617 documents the file format in detail.
6619 .It Ic newmail
6620 Checks for new mail in the current folder without committing any changes
6621 before.
6622 If new mail is present, a message is shown.
6623 If the
6624 .Va header
6625 variable is set,
6626 the headers of each new message are also shown.
6627 This command is not available for all mailbox types.
6629 .It Ic next
6630 (n) (like
6631 .Ql +
6633 .Dq ENTER )
6634 Goes to the next message in sequence and types it.
6635 With an argument list, types the next matching message.
6637 .It Ic New
6638 Same as
6639 .Ic Unread .
6641 .It Ic new
6642 Same as
6643 .Ic unread .
6645 .It Ic noop
6646 If the current folder is accessed via a network connection, a
6647 .Dq NOOP
6648 command is sent, otherwise no operation is performed.
6650 .It Ic Page
6651 Like
6652 .Ic page ,
6653 but also displays header fields which would not pass the
6654 .Ic headerpick
6655 selection, and all MIME parts.
6656 Identical to
6657 .Ic More .
6659 .It Ic page
6660 Invokes the
6661 .Ev PAGER
6662 on the given messages, even in non-interactive mode and as long as the
6663 standard output is a terminal.
6664 Identical to
6665 .Ic more .
6667 .It Ic Pipe
6668 Like
6669 .Ic pipe
6670 but also pipes header fields which would not pass the
6671 .Ic headerpick
6672 selection, and all parts of MIME
6673 .Ql multipart/alternative
6674 messages.
6676 .It Ic pipe
6677 (pi) Takes an optional message list and shell command (that defaults to
6678 .Va cmd ) ,
6679 and pipes the messages through the command.
6680 If the
6681 .Va page
6682 variable is set,
6683 every message is followed by a formfeed character.
6685 .It Ic preserve
6686 (pre) A synonym for
6687 .Ic hold .
6689 .It Ic Print
6690 (P) Alias for
6691 .Ic Type .
6693 .It Ic print
6694 (p) Research
6696 equivalent of
6697 .Ic type .
6699 .It Ic quit
6700 (q) Terminates the session, saving all undeleted, unsaved messages in
6701 the current
6702 .Mx -sx
6703 .Sx "secondary mailbox"
6704 .Ev MBOX ,
6705 preserving all messages marked with
6706 .Ic hold
6708 .Ic preserve
6709 or never referenced in the system
6710 .Va inbox ,
6711 and removing all other messages from the
6712 .Mx -sx
6713 .Sx "primary system mailbox" .
6714 If new mail has arrived during the session,
6715 the message
6716 .Dq You have new mail
6717 will be shown.
6718 If given while editing a mailbox file with the command line option
6719 .Fl f ,
6720 then the edit file is rewritten.
6721 A return to the shell is effected,
6722 unless the rewrite of edit file fails,
6723 in which case the user can escape with the exit command.
6724 The optional status number argument will be passed through to
6725 .Xr exit 3 .
6726 \*(ID For now it can happen that the given status will be overwritten,
6727 later this will only occur if a later error needs to be reported onto an
6728 otherwise success indicating status.
6730 .It Ic read
6731 \*(NQ Read a line from standard input, or the channel set active via
6732 .Ic readctl ,
6733 and assign the data, which will be split as indicated by
6734 .Va ifs ,
6735 to the given variables.
6736 The variable names are checked by the same rules as documented for
6737 .Cm vput ,
6738 and the same error codes will be seen in
6739 .Va \&! ;
6740 the exit status
6741 .Va \&?
6742 indicates the number of bytes read, it will be
6743 .Ql -1
6744 with the error number
6745 .Va \&!
6746 set to
6747 .Va ^ERR Ns -BADF
6748 in case of I/O errors, or
6749 .Va ^ERR Ns -NONE
6750 upon End-Of-File.
6751 If there are more fields than variables, assigns successive fields to the
6752 last given variable.
6753 If there are less fields than variables, assigns the empty string to the
6754 remains.
6755 .Bd -literal -offset indent
6756 ? read a b c
6757    H  e  l  l  o
6758 ? echo "<$a> <$b> <$c>"
6759 <H> <e> <l  l  o>
6760 ? wysh set ifs=:; read a b c;unset ifs
6761 hey2.0,:"'you    ",:world!:mars.:
6762 ? echo $?/$^ERRNAME / <$a><$b><$c>
6763 0/NONE / <hey2.0,><"'you    ",><world!:mars.:><><>
6766 .It Ic readsh
6767 \*(NQ Like
6768 .Ic read ,
6769 but splits on shell token boundaries (see
6770 .Sx "Shell-style argument quoting" )
6771 rather than at
6772 .Va ifs .
6773 \*(ID Could become a
6774 .Ic commandalias ,
6775 maybe
6776 .Ql read --tokenize -- .
6778 .It Ic readall
6779 \*(NQ Read anything from standard input, or the channel set active via
6780 .Ic readctl ,
6781 and assign the data to the given variable.
6782 The variable name is checked by the same rules as documented for
6783 .Cm vput ,
6784 and the same error codes will be seen in
6785 .Va \&! ;
6786 the exit status
6787 .Va \&?
6788 indicates the number of bytes read, it will be
6789 .Ql -1
6790 with the error number
6791 .Va \&!
6792 set to
6793 .Va ^ERR Ns -BADF
6794 in case of I/O errors, or
6795 .Va ^ERR Ns -NONE
6796 upon End-Of-File.
6797 \*(ID The input data length is restricted to 31-bits.
6799 .It Ic readctl
6800 \*(NQ Manages input channels for
6801 .Ic read ,
6802 .Ic readsh
6804 .Ic readall ,
6805 to be used to avoid complicated or impracticable code, like calling
6806 .Ic \&\&read
6807 from within a macro in non-interactive mode.
6808 Without arguments, or when the first argument is
6809 .Cm show ,
6810 a listing of all known channels is printed.
6811 Channels can otherwise be
6812 .Cm create Ns
6813 d, and existing channels can be
6814 .Cm set
6815 active and
6816 .Cm remove Ns
6817 d by giving the string used for creation.
6819 The channel name is expected to be a file descriptor number, or,
6820 if parsing the numeric fails, an input file name that undergoes
6821 .Sx "Filename transformations" .
6822 For example (this example requires a modern shell):
6823 .Bd -literal -offset indent
6824 $ printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
6825   \*(uA -R#
6826 hey, you
6827 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
6828   LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
6829 hey, you
6832 .It Ic remove
6833 \*(NQ Removes the named files or directories.
6834 If a name refers to a mailbox, say a Maildir mailbox, then a mailbox
6835 type specific removal will be performed, deleting the complete mailbox.
6836 In interactive mode the user is asked for confirmation.
6838 .It Ic rename
6839 \*(NQ Takes the name of an existing folder
6840 and the name for the new folder
6841 and renames the first to the second one.
6842 .Sx "Filename transformations"
6843 including shell pathname wildcard pattern expansions
6844 .Pf ( Xr glob 7 )
6845 are performed on both arguments.
6846 Both folders must be of the same type.
6849 .It Ic Reply , Respond
6850 \*(CM(R) Identical to
6851 .Ic reply
6852 except that it replies to only the sender of each message of the given
6853 list, by using the first message as the template to quote, for the
6854 .Ql Subject:
6855 etc.; setting
6856 .Va flipr
6857 will exchange this command with
6858 .Ic reply .
6861 .It Ic reply , respond
6862 \*(CM(r) Take a message (list) and group-respond (to each in turn)
6863 by addressing the sender and all recipients, subject to
6864 .Va fullnames
6866 .Ic alternates
6867 processing.
6868 .Va followup-to ,
6869 .Va followup-to-honour ,
6870 .Va reply-to-honour
6871 as well as
6872 .Va recipients-in-cc
6873 influence response behaviour.
6874 .Va quote
6875 as well as
6876 .Va quote-as-attachment
6877 configure whether responded-to message shall be quoted etc.,
6878 .Va content-description-quote-attachment
6879 may be used.
6880 Setting
6881 .Va flipr
6882 will exchange this command with
6883 .Ic Reply .
6884 The command
6885 .Ic Lreply
6886 offers special support for replying to mailing lists.
6887 For more documentation please refer to
6888 .Sx "On sending mail, and non-interactive mode" .
6890 This may generate the errors
6891 .Va ^ERR Ns -DESTADDRREQ
6892 if no receiver has been specified, or was rejected by
6893 .Va expandaddr
6894 policy,
6895 .Va ^ERR Ns -IO
6896 if an I/O error occurs,
6897 .Va ^ERR Ns -NOTSUP
6898 if a necessary character set conversion fails, and
6899 .Va ^ERR Ns -INVAL
6900 for other errors.
6901 It can also fail with errors of
6902 .Sx "Specifying messages" .
6903 Any error stops processing of further messages.
6905 .It Ic Resend
6906 Like
6907 .Ic resend ,
6908 but does not add any header lines.
6909 This is not a way to hide the sender's identity,
6910 but useful for sending a message again to the same recipients.
6912 .It Ic resend
6913 Takes a list of messages and a name,
6914 and sends each message to the given addressee, which is subject to
6915 .Va fullnames .
6916 .Ql Resent-From:
6917 and related header fields are prepended to the new copy of the message.
6918 Saving in
6919 .Va record
6920 is only performed if
6921 .Va record-resent
6922 is set.
6923 \*(ID\*(CM is not entered, the only supported hooks are
6924 .Va on-resend-enter
6926 .Va on-resend-cleanup .
6928 This may generate the errors
6929 .Va ^ERR Ns -DESTADDRREQ
6930 if no receiver has been specified, or was rejected by
6931 .Va expandaddr
6932 policy,
6933 .Va ^ERR Ns -IO
6934 if an I/O error occurs,
6935 .Va ^ERR Ns -NOTSUP
6936 if a necessary character set conversion fails, and
6937 .Va ^ERR Ns -INVAL
6938 for other errors.
6939 It can also fail with errors of
6940 .Sx "Specifying messages" .
6941 Any error stops processing of further messages.
6943 .It Ic retain
6944 (ret) Superseded by the multiplexer
6945 .Ic headerpick .
6947 .It Ic return
6948 Only available inside of a
6949 .Ic define Ns
6950 d macro or an
6951 .Ic account ,
6952 this command returns control of execution to the outer scope.
6953 The two optional parameters are positive decimal numbers and default to 0:
6954 the first specifies the 32-bit return value (stored in
6955 .Va \&?
6956 \*(ID and later extended to 64-bit),
6957 the second the 32-bit error number (stored in
6958 .Va \&! ) .
6959 As documented for
6960 .Va \&?
6961 a non-0 exit status may cause the program to exit.
6963 .It Ic Save
6964 (S) Similar to
6965 .Ic save,
6966 but saves the messages in a file named after the local part of the
6967 sender of the first message instead of taking a filename argument;
6968 .Va outfolder
6969 is inspected to decide on the actual storage location.
6971 .It Ic save
6972 (s) Takes a message list and a filename and appends each message in turn
6973 to the end of the file.
6974 .Sx "Filename transformations"
6975 including shell pathname wildcard pattern expansions
6976 .Pf ( Xr glob 7 )
6977 is performed on the filename.
6978 If no filename is given, the
6979 .Mx -sx
6980 .Sx "secondary mailbox"
6981 .Ev MBOX
6982 is used.
6983 The filename in quotes, followed by the generated character count
6984 is echoed on the user's terminal.
6985 If editing a
6986 .Mx -sx
6987 .Sx "primary system mailbox"
6988 the messages are marked for deletion.
6989 To filter the saved header fields to the desired subset use the
6990 .Ql save
6991 slot of the white- and blacklisting command
6992 .Ic headerpick .
6993 Also see
6994 .Ic Copy .
6995 .It Ic savediscard
6996 \*(OB Superseded by the multiplexer
6997 .Ic headerpick .
6998 .It Ic saveignore
6999 \*(OB Superseded by the multiplexer
7000 .Ic headerpick .
7001 .It Ic saveretain
7002 \*(OB Superseded by the multiplexer
7003 .Ic headerpick .
7005 .It Ic search
7006 Takes a message specification (list) and displays a header summary of
7007 all matching messages, as via
7008 .Ic headers .
7009 This command is an alias of
7010 .Ic from .
7011 Also see
7012 .Sx "Specifying messages" .
7014 .It Ic seen
7015 Takes a message list and marks all messages as having been read.
7018 .It Ic set , unset
7019 (se, \*(NQ uns) The latter command will delete all given global
7020 variables, or only block-scope local ones if the
7021 .Cm local
7022 command modifier has been used.
7023 The former, when used without arguments, will show all
7024 currently known variables, being more verbose if either of
7025 .Va debug
7027 .Va verbose
7028 is set.
7029 Remarks: this list mode will not automatically link-in (known)
7030 .Sx ENVIRONMENT
7031 variables, this only happens for explicit addressing, examples are
7032 .Ic varshow ,
7033 using a variable in an
7034 .Ic if
7035 condition or a string passed to
7036 .Ic echo ,
7037 explicit
7038 .Ic \&\&set Ns
7039 ting, as well as some program-internal use cases (look-ups).
7041 Otherwise the given variables (and arguments) are set or adjusted.
7042 Arguments are of the form
7043 .Ql name=value
7044 (no space before or after
7045 .Ql = ) ,
7046 or plain
7047 .Ql name
7048 if there is no value, i.e., a boolean variable.
7049 If a name begins with
7050 .Ql no ,
7051 as in
7052 .Ql set nosave ,
7053 the effect is the same as invoking the
7054 .Ic \&\&unset
7055 command with the remaining part of the variable
7056 .Pf ( Ql unset save ) .
7057 \*(ID In conjunction with the
7058 .Cm wysh
7059 .Pf (or\0 Cm local )
7060 command prefix(es)
7061 .Sx "Shell-style argument quoting"
7062 can be used to quote arguments as necessary.
7063 \*(ID Otherwise quotation marks may be placed around any part of the
7064 assignment statement to quote blanks or tabs.
7066 When operating in global scope any
7067 .Ql name
7068 that is known to map to an environment variable will automatically cause
7069 updates in the program environment (unsetting a variable in the
7070 environment requires corresponding system support) \(em use the command
7071 .Ic environ
7072 for further environmental control.
7073 If the command modifier
7074 .Cm local
7075 has been used to enforce local scoping then the given user variables
7076 will be garbage collected when the local scope is left;
7078 .Sx "INTERNAL VARIABLES" ,
7079 however,
7080 .Cm local
7081 behaves the same as if
7082 .Ic localopts
7083 would have been set (temporarily), which means that changes are
7084 inherited by deeper scopes.
7085 Also see
7086 .Ic varshow
7087 and the sections
7088 .Sx "INTERNAL VARIABLES"
7090 .Sx ENVIRONMENT .
7091 .Bd -literal -offset indent
7092 ? wysh set indentprefix=' -> '
7093 ? wysh set atab=$'\t' aspace=' ' zero=0
7096 .It Ic shcodec
7097 Apply shell quoting rules to the given raw-data arguments.
7098 Supports
7099 .Cm vput
7100 (see
7101 .Sx "Command modifiers" ) .
7102 The first argument specifies the operation:
7103 .Ar [+]e[ncode]
7105 .Ar d[ecode]
7106 cause shell quoting to be applied to the remains of the line, and
7107 expanded away thereof, respectively.
7108 If the former is prefixed with a plus-sign, the quoted result will not
7109 be roundtrip enabled, and thus can be decoded only in the very same
7110 environment that was used to perform the encode; also see
7111 .Cd mle-quote-rndtrip .
7112 If the coding operation fails the error number
7113 .Va \&!
7114 is set to
7115 .Va ^ERR Ns -CANCELED ,
7116 and the unmodified input is used as the result; the error number may
7117 change again due to output or result storage errors.
7119 .It Ic shell
7120 \*(NQ (sh) Invokes an interactive version of the shell,
7121 and returns its exit status.
7124 .It Ic shortcut , unshortcut
7125 \*(NQ Manage the file- or pathname shortcuts as documented for
7126 .Ic folder .
7127 The latter command deletes all shortcuts given as arguments,
7128 or all at once when given the asterisk
7129 .Ql * .
7130 The former shows the list of all currently defined shortcuts if used
7131 without arguments, the target of the given with a single argument.
7132 Otherwise arguments are treated as pairs of shortcuts and their desired
7133 expansion, creating new or updating already existing ones.
7135 .It Ic shift
7136 \*(NQ Shift the positional parameter stack (starting at
7137 .Va 1 )
7138 by the given number (which must be a positive decimal),
7139 or 1 if no argument has been given.
7140 It is an error if the value exceeds the number of positional parameters.
7141 If the given number is 0, no action is performed, successfully.
7142 The stack as such can be managed via
7143 .Ic vpospar .
7144 Note this command will fail in
7145 .Ic account
7146 and hook macros unless the positional parameter stack has been
7147 explicitly created in the current context via
7148 .Ic vpospar .
7150 .It Ic show
7151 Like
7152 .Ic type ,
7153 but performs neither MIME decoding nor decryption, so that the raw
7154 message text is shown.
7156 .It Ic size
7157 (si) Shows the size in characters of each message of the given
7158 message list.
7160 .It Ic sleep
7161 \*(NQ Sleep for the specified number of seconds (and optionally
7162 milliseconds), by default interruptible.
7163 If a third argument is given the sleep will be uninterruptible,
7164 otherwise the error number
7165 .Va \&!
7166 will be set to
7167 .Va ^ERR Ns -INTR
7168 if the sleep has been interrupted.
7169 The command will fail and the error number will be
7170 .Va ^ERR Ns -OVERFLOW
7171 if the given duration(s) overflow the time datatype, and
7172 .Va ^ERR Ns -INVAL
7173 if the given durations are no valid integers.
7176 .It Ic sort , unsort
7177 The latter command disables sorted or threaded mode, returns to normal
7178 message order and, if the
7179 .Va header
7180 variable is set,
7181 displays a header summary.
7182 The former command shows the current sorting criterion when used without
7183 an argument, but creates a sorted representation of the current folder
7184 otherwise, and changes the
7185 .Ic next
7186 command and the addressing modes such that they refer to messages in
7187 the sorted order.
7188 Message numbers are the same as in regular mode.
7189 If the
7190 .Va header
7191 variable is set,
7192 a header summary in the new order is also displayed.
7193 Automatic folder sorting can be enabled by setting the
7194 .Va autosort
7195 variable, as in
7196 .Ql set autosort=thread .
7197 Possible sorting criterions are:
7199 .Bl -tag -compact -width "subject"
7200 .It Ar date
7201 Sort the messages by their
7202 .Ql Date:
7203 field, that is by the time they were sent.
7204 .It Ar from
7205 Sort messages by the value of their
7206 .Ql From:
7207 field, that is by the address of the sender.
7208 If the
7209 .Va showname
7210 variable is set, the sender's real name (if any) is used.
7211 .It Ar size
7212 Sort the messages by their size.
7213 .It spam
7214 \*(OP Sort the message by their spam score, as has been classified by
7215 .Ic spamrate .
7216 .It Ar status
7217 Sort the messages by their message status.
7218 .It Ar subject
7219 Sort the messages by their subject.
7220 .It Ar thread
7221 Create a threaded display.
7222 .It Ar to
7223 Sort messages by the value of their
7224 .Ql To:
7225 field, that is by the address of the recipient.
7226 If the
7227 .Va showname
7228 variable is set, the recipient's real name (if any) is used.
7231 .It Ic source
7232 \*(NQ (so) The source command reads commands from the given file.
7233 .Sx "Filename transformations"
7234 will be applied.
7235 If the given expanded argument ends with a vertical bar
7236 .Ql |
7237 then the argument will instead be interpreted as a shell command and
7238 \*(UA will read the output generated by it.
7239 Dependent on the settings of
7240 .Va posix
7242 .Va errexit ,
7243 and also dependent on whether the command modifier
7244 .Cm ignerr
7245 had been used, encountering errors will stop sourcing of the given input.
7246 \*(ID Note that
7247 .Ic \&\&source
7248 cannot be used from within macros that execute as
7249 .Va folder-hook Ns s
7251 .Ic account Ns s ,
7252 i.e., it can only be called from macros that were
7253 .Ic call Ns ed .
7255 .It Ic source_if
7256 \*(NQ The difference to
7257 .Ic source
7258 (beside not supporting pipe syntax aka shell command input) is that
7259 this command will not generate an error nor warn if the given file
7260 argument cannot be opened successfully.
7262 .It Ic spamclear
7263 \*(OP Takes a list of messages and clears their
7264 .Ql is-spam
7265 flag.
7267 .It Ic spamforget
7268 \*(OP Takes a list of messages and causes the
7269 .Va spam-interface
7270 to forget it has ever used them to train its Bayesian filter.
7271 Unless otherwise noted the
7272 .Ql is-spam
7273 flag of the message is inspected to chose whether a message shall be
7274 forgotten to be
7275 .Dq ham
7277 .Dq spam .
7279 .It Ic spamham
7280 \*(OP Takes a list of messages and informs the Bayesian filter of the
7281 .Va spam-interface
7282 that they are
7283 .Dq ham .
7284 This also clears the
7285 .Ql is-spam
7286 flag of the messages in question.
7288 .It Ic spamrate
7289 \*(OP Takes a list of messages and rates them using the configured
7290 .Va spam-interface ,
7291 without modifying the messages, but setting their
7292 .Ql is-spam
7293 flag as appropriate; because the spam rating headers are lost the rate
7294 will be forgotten once the mailbox is left.
7295 Refer to the manual section
7296 .Sx "Handling spam"
7297 for the complete picture of spam handling in \*(UA.
7299 .It Ic spamset
7300 \*(OP Takes a list of messages and sets their
7301 .Ql is-spam
7302 flag.
7304 .It Ic spamspam
7305 \*(OP Takes a list of messages and informs the Bayesian filter of the
7306 .Va spam-interface
7307 that they are
7308 .Dq spam .
7309 This also sets the
7310 .Ql is-spam
7311 flag of the messages in question.
7312 .It Ic thread
7313 \*(OB The same as
7314 .Ql sort thread
7315 (consider using a
7316 .Ql commandalias
7317 as necessary).
7319 .It Ic tls
7320 \*(NQ TLS information and management command multiplexer to aid in
7321 .Sx "Encrypted network communication" ,
7322 mostly available only if the term
7323 .Ql ,+sockets,
7324 is included in
7325 .Va features .
7326 Commands support
7327 .Cm vput
7328 if so documented (see
7329 .Sx "Command modifiers" ) .
7330 The result that is shown in case of errors is always the empty string,
7331 errors can be identified via the error number
7332 .Va \&! .
7333 For example, string length overflows are caught and set
7334 .Va \&!
7336 .Va ^ERR Ns -OVERFLOW .
7337 The TLS configuration is honoured, especially
7338 .Va tls-verify .
7339 .Bd -literal -offset indent
7340 ? vput tls result fingerprint pop3s://ex.am.ple
7341 ? echo $?/$!/$^ERRNAME: $result
7343 .Bl -hang -width ".It Cm random"
7344 .It Cm certchain
7345 Show the complete verified peer certificate chain.
7346 Includes informational fields in conjunction with
7347 .Va verbose .
7348 .It Cm certificate
7349 Show only the peer certificate, without any signers.
7350 Includes informational fields in conjunction with
7351 .Va verbose .
7352 .It Cm fingerprint
7353 Show the
7354 .Va tls-fingerprint-digest Ns
7355 ed fingerprint of the certificate of the given HOST
7356 .Pf ( Ql server:port ,
7357 where the port defaults to the HTTPS port, 443).
7358 .Va tls-fingerprint
7359 is actively ignored for the runtime of this command.
7362 .It Ic Top
7363 Like
7364 .Ic top
7365 but always uses the
7366 .Ic headerpick
7367 .Ql type
7368 slot for white- and blacklisting header fields.
7370 .It Ic top
7371 (to) Takes a message list and types out the first
7372 .Va toplines
7373 lines of each message on the user's terminal.
7374 Unless a special selection has been established for the
7375 .Ql top
7376 slot of the
7377 .Ic headerpick
7378 command, the only header fields that are displayed are
7379 .Ql From: ,
7380 .Ql To: ,
7381 .Ql Cc: ,
7383 .Ql Subject: .
7384 .Ic Top
7385 will always use the
7386 .Ql type
7387 .Ic headerpick
7388 selection instead.
7389 It is possible to apply compression to what is displayed by setting
7390 .Va topsqueeze .
7391 Messages are decrypted and converted to the terminal character set
7392 if necessary.
7394 .It Ic touch
7395 (tou) Takes a message list and marks the messages for saving in the
7396 .Mx -sx
7397 .Sx "secondary mailbox"
7398 .Ev MBOX .
7399 \*(UA deviates from the POSIX standard with this command,
7400 as a following
7401 .Ic next
7402 command will display the following message instead of the current one.
7404 .It Ic Type
7405 (T) Like
7406 .Ic type
7407 but also displays header fields which would not pass the
7408 .Ic headerpick
7409 selection, and all visualizable parts of MIME
7410 .Ql multipart/alternative
7411 messages.
7413 .It Ic type
7414 (t) Takes a message list and types out each message on the user's terminal.
7415 The display of message headers is selectable via
7416 .Ic headerpick .
7417 For MIME multipart messages, all parts with a content type of
7418 .Ql text ,
7419 all parts which have a registered MIME type handler (see
7420 .Sx "HTML mail and MIME attachments" )
7421 which produces plain text output, and all
7422 .Ql message
7423 parts are shown, others are hidden except for their headers.
7424 Messages are decrypted and converted to the terminal character set
7425 if necessary.
7426 The command
7427 .Ic mimeview
7428 can be used to display parts which are not displayable as plain text.
7429 .It Ic unaccount
7431 .Ic account .
7432 .It Ic unalias
7433 (una) See
7434 .Ic alias .
7435 .It Ic unanswered
7437 .Ic answered .
7438 .It Ic unbind
7440 .Ic bind .
7441 .It Ic uncollapse
7443 .Ic collapse .
7444 .It Ic uncolour
7446 .Ic colour .
7447 .It Ic undefine
7449 .Ic define .
7450 .It Ic undelete
7452 .Ic delete .
7453 .It Ic undraft
7455 .Ic draft .
7456 .It Ic unflag
7458 .Ic flag .
7459 .It Ic unfwdignore
7460 \*(OB Superseded by the multiplexer
7461 .Ic headerpick .
7462 .It Ic unfwdretain
7463 \*(OB Superseded by the multiplexer
7464 .Ic headerpick .
7466 .It Ic unignore
7467 Superseded by the multiplexer
7468 .Ic headerpick .
7469 .It Ic unmimetype
7471 .Ic mimetype .
7472 .It Ic unmlist
7474 .Ic mlist .
7475 .It Ic unmlsubscribe
7477 .Ic mlsubscribe .
7479 .It Ic Unread
7480 Same as
7481 .Ic unread .
7483 .It Ic unread
7484 Takes a message list and marks each message as not having been read.
7486 .It Ic unretain
7487 Superseded by the multiplexer
7488 .Ic headerpick .
7489 .It Ic unsaveignore
7490 \*(OB Superseded by the multiplexer
7491 .Ic headerpick .
7492 .It Ic unsaveretain
7493 \*(OB Superseded by the multiplexer
7494 .Ic headerpick .
7495 .It Ic unset
7496 \*(NQ (uns) See
7497 .Ic set .
7498 .It Ic unshortcut
7500 .Ic shortcut .
7501 .It Ic unsort
7503 .Ic short .
7504 .It Ic unthread
7505 \*(OB
7506 Same as
7507 .Ic unsort .
7509 .It Ic urlcodec
7510 Perform URL percent codec operations on the raw-data argument, rather
7511 according to RFC 3986.
7512 The first argument specifies the operation:
7513 .Ar e[ncode]
7515 .Ar d[ecode]
7516 perform plain URL percent en- and decoding, respectively.
7517 .Ar p[ath]enc[ode]
7519 .Ar p[ath]dec[ode]
7520 perform a slightly modified operation which should be better for
7521 pathnames: it does not allow a tilde
7522 .Ql ~ ,
7523 and will neither accept hyphen-minus
7524 .Ql -
7525 nor dot
7526 .Ql .
7527 as an initial character.
7528 The remains of the line form the URL data which is to be converted.
7529 This is a character set agnostic operation,
7530 and it may thus decode bytes which are invalid in the current
7531 .Va ttycharset .
7533 Supports
7534 .Cm vput
7535 (see
7536 .Sx "Command modifiers" ) ,
7537 and manages the error number
7538 .Va \&! .
7539 If the coding operation fails the error number
7540 .Va \&!
7541 is set to
7542 .Va ^ERR Ns -CANCELED ,
7543 and the unmodified input is used as the result; the error number may
7544 change again due to output or result storage errors.
7545 \*(ID This command does not know about URLs beside what is documented.
7546 .Pf ( Ic vexpr
7547 offers a
7548 .Cm makeprint
7549 subcommand, shall the URL be displayed.)
7551 .It Ic varshow
7552 \*(NQ This command produces the same output as the listing mode of
7553 .Ic set ,
7554 including
7555 .Va verbose Ns
7556 ity adjustments, but only for the given variables.
7558 .It Ic verify
7559 \*(OP Takes a message list and verifies each message.
7560 If a message is not a S/MIME signed message,
7561 verification will fail for it.
7562 The verification process checks if the message was signed using a valid
7563 certificate,
7564 if the message sender's email address matches one of those contained
7565 within the certificate,
7566 and if the message content has been altered.
7568 .It Ic version
7569 Shows the
7570 .Va version
7572 .Va features
7573 of \*(UA, optionally in a more
7574 .Va verbose
7575 form which also includes the build and running system environment.
7576 This command supports
7577 .Cm vput
7578 (see
7579 .Sx "Command modifiers" ) .
7581 .It Ic vexpr
7582 \*(NQ A multiplexer command which offers signed 64-bit numeric
7583 calculations, as well as other, mostly string-based operations.
7584 C-style byte string operations are available via
7585 .Ic csop .
7586 The first argument defines the number, type, and meaning of the
7587 remaining arguments.
7588 An empty number argument is treated as 0.
7589 Supports
7590 .Cm vput
7591 (see
7592 .Sx "Command modifiers" ) .
7593 The result shown in case of errors is
7594 .Ql -1
7595 for usage errors and numeric operations, the empty string otherwise;
7596 .Dq soft
7597 errors, like when a search operation failed, will also set the
7598 .Va \&!
7599 error number to
7600 .Va ^ERR Ns -NODATA .
7601 Except when otherwise noted numeric arguments are parsed as signed 64-bit
7602 numbers, and errors will be reported in the error number
7603 .Va \&!
7604 as the numeric error
7605 .Va ^ERR Ns -RANGE .
7607 Numeric operations work on one or two signed 64-bit integers.
7608 Numbers prefixed with
7609 .Ql 0x
7611 .Ql 0X
7612 are interpreted as hexadecimal (base 16) numbers, whereas
7613 .Ql 0
7614 indicates octal (base 8), and
7615 .Ql 0b
7616 as well as
7617 .Ql 0B
7618 denote binary (base 2) numbers.
7619 It is possible to use any base in between 2 and 36, inclusive, with the
7620 .Ql BASE#number
7621 notation, where the base is given as an unsigned decimal number, so
7622 .Ql 16#AFFE
7623 is a different way of specifying a hexadecimal number.
7624 Unsigned interpretation of a number can be enforced by prefixing an
7625 .Ql u
7626 (case-insensitively), as in
7627 .Ql u-110 ;
7628 this is not necessary for power-of-two bases (2, 4, 8, 16 and 32),
7629 which will be interpreted as unsigned by default, but it still makes
7630 a difference regarding overflow detection and overflow constant.
7631 It is possible to enforce signed interpretation by (instead) prefixing a
7632 .Ql s
7633 (case-insensitively).
7634 The number sign notation uses a permissive parse mode and as such
7635 supports complicated conditions out of the box:
7636 .Bd -literal -offset indent
7637 ? wysh set ifs=:;read i;unset ifs;echo $i;vexpr pb 2 10#$i
7638    -009
7639 <   -009>
7640 0b1001
7643 One integer is expected by assignment (equals sign
7644 .Ql = ) ,
7645 which does nothing but parsing the argument, thus detecting validity and
7646 possible overflow conditions, unary not (tilde
7647 .Ql ~ ) ,
7648 which creates the bitwise complement, and unary plus and minus.
7649 Two integers are used by addition (plus sign
7650 .Ql + ) ,
7651 subtraction (hyphen-minus
7652 .Ql - ) ,
7653 multiplication (asterisk
7654 .Ql * ) ,
7655 division (solidus
7656 .Ql / )
7657 and modulo (percent sign
7658 .Ql % ) ,
7659 as well as for the bitwise operators logical or (vertical bar
7660 .Ql | ,
7661 to be quoted) ,
7662 bitwise and (ampersand
7663 .Ql \&& ,
7664 to be quoted) ,
7665 bitwise xor (circumflex
7666 .Ql ^ ) ,
7667 the bitwise signed left- and right shifts
7668 .Pf ( Ql << ,
7669 .Ql >> ) ,
7670 as well as for the unsigned right shift
7671 .Ql >>> .
7673 Another numeric operation is
7674 .Cm pbase ,
7675 which takes a number base in between 2 and 36, inclusive, and will act
7676 on the second number given just the same as what equals sign
7677 .Ql =
7678 does, but the number result will be formatted in the base given, as
7679 a signed 64-bit number unless unsigned interpretation of the input
7680 number had been forced (with an u prefix).
7682 Numeric operations support a saturated mode via the question mark
7683 .Ql \&?
7684 modifier suffix; the keyword
7685 .Ql saturated
7686 is optional,
7687 .Ql +? ,
7688 .Ql +?satu ,
7690 .Ql +?saturated
7691 are therefore identical.
7692 In saturated mode overflow errors and division and modulo by zero are no
7693 longer reported via the exit status, but the result will linger at the
7694 minimum or maximum possible value, instead of overflowing (or trapping).
7695 This is true also for the argument parse step.
7696 For the bitwise shifts, the saturated maximum is 63.
7697 Any caught overflow will be reported via the error number
7698 .Va \&!
7700 .Va ^ERR Ns -OVERFLOW .
7701 .Bd -literal -offset indent
7702 ? vput vexpr res -? +1 -9223372036854775808
7703 ? echo $?/$!/$^ERRNAME:$res
7704 0/75/OVERFLOW:-9223372036854775808
7707 Character set agnostic string functions have no notion of locale
7708 settings and character sets.
7709 .Bl -hang -width ".It Cm random"
7710 .It Cm date-utc
7711 Outputs the current date and time in UTC (Coordinated Universal Time)
7712 with values named such that
7713 .Ql vput vexpr x date-utc; eval wysh set $x
7714 creates accessible variables.
7715 .It Cm date-stamp-utc
7716 Outputs a RFC 3339 internet date/time format of UTC.
7717 .It Cm epoch
7718 The seconds and nanoseconds since the Unix epoch (1970-01-01T00:00:00)
7719 named
7720 .Ql epoch_sec
7722 .Ql epoch_nsec
7723 such that
7724 .Ql vput vexpr x epoch; eval wysh set $x
7725 creates accessible variables.
7726 .It Cm file-expand
7727 Performs the usual
7728 .Sx "Filename transformations"
7729 on its argument.
7730 .It Cm file-stat , file-lstat
7731 Perform the usual
7732 .Sx "Filename transformations"
7733 on the argument, then call
7734 .Xr stat 2
7736 .Xr lstat 2 ,
7737 respectively, and output values such that
7738 .Ql vput vexpr x file-stat FILE; eval wysh set $x
7739 creates accessible variables.
7740 The variable
7741 .Ql st_type
7742 uses solidus
7743 .Ql /
7744 to denote directories, commercial at
7745 .Ql @
7746 for links, number sign
7747 .Ql #
7748 for block devices, percent sign
7749 .Ql %
7750 for for character devices, vertical bar
7751 .Ql |
7752 for FIFOs, equal sign
7753 .Ql =
7754 for sockets, and the period
7755 .Ql \&.
7756 for the rest.
7757 .It Cm random
7758 Generates a random string of the given length, or of
7759 .Dv \&\&PATH_MAX
7760 bytes (a constant from
7761 .Pa /usr/include )
7762 if the value 0 is given; the random string will be base64url encoded
7763 according to RFC 4648, and thus be usable as a (portable) filename.
7766 String operations work, sufficient support provided, according to the
7767 active user's locale encoding and character set (see
7768 .Sx "Character sets" ) .
7769 Where the question mark
7770 .Ql \&?
7771 modifier suffix is supported, a case-insensitive operation mode is
7772 available; the keyword
7773 .Ql case
7774 is optional,
7775 .Ql regex?
7777 .Ql regex?case
7778 are therefore identical.
7779 .Bl -hang -width ".It Cm regex"
7780 .It Cm makeprint
7781 (One-way) Converts the argument to something safely printable on the
7782 terminal.
7783 .It Cm regex
7784 \*(OP A string operation that will try to match the first argument with
7785 the regular expression given as the second argument.
7786 .Ql \&?
7787 modifier suffix is supported.
7788 If the optional third argument has been given then instead of showing
7789 the match offset a replacement operation is performed: the third
7790 argument is treated as if specified within dollar-single-quote (see
7791 .Sx "Shell-style argument quoting" ) ,
7792 and any occurrence of a positional parameter, for example
7793 .Va \&0 , 1
7794 etc. is replaced with the according match group of the regular expression:
7795 .Bd -literal -offset indent
7796 ? vput vexpr res regex bananarama \e
7797     (.*)NanA(.*) '\e${1}au\e$2'
7798 ? echo $?/$!/$^ERRNAME:$res:
7799 1/61/NODATA::
7800 ? vput vexpr res regex?case bananarama \e
7801     (.*)NanA(.*) '\e${1}uauf\e$2'
7802 ? echo $?/$!/$^ERRNAME:$res:
7803 0/0/NONE:bauauframa:
7807 .It Ic vpospar
7808 \*(NQ Manage the positional parameter stack (see
7809 .Va 1 , # , * , @
7810 as well as
7811 .Ic shift ) .
7812 If the first argument is
7813 .Ql clear ,
7814 then the positional parameter stack of the current context, or the
7815 global one, if there is none, is cleared.
7816 If it is
7817 .Ql set ,
7818 then the remaining arguments will be used to (re)create the stack,
7819 if the parameter stack size limit is excessed an
7820 .Va ^ERR Ns -OVERFLOW
7821 error will occur.
7823 If the first argument is
7824 .Ql quote ,
7825 a round-trip capable representation of the stack contents is created,
7826 with each quoted parameter separated from each other with the first
7827 character of
7828 .Va ifs ,
7829 and followed by the first character of
7830 .Va if-ws ,
7831 if that is not empty and not identical to the first.
7832 If that results in no separation at all a
7833 .Cm space
7834 character is used.
7835 This mode supports
7836 .Cm vput
7837 (see
7838 .Sx "Command modifiers" ) .
7839 I.e., the subcommands
7840 .Ql set
7842 .Ql quote
7843 can be used (in conjunction with
7844 .Ic eval )
7845 to (re)create an argument stack from and to a single variable losslessly.
7846 .Bd -literal -offset indent
7847 ? vpospar set hey, "'you    ", world!
7848 ? echo $#: <${1}><${2}><${3}>
7849 ? vput vpospar x quote
7850 ? vpospar clear
7851 ? echo $#: <${1}><${2}><${3}>
7852 ? eval vpospar set ${x}
7853 ? echo $#: <${1}><${2}><${3}>
7856 .It Ic visual
7857 (v) Takes a message list and invokes the
7858 .Ev VISUAL
7859 display editor on each message.
7860 Modified contents are discarded unless the
7861 .Va writebackedited
7862 variable is set, and are not used unless the mailbox can be written to
7863 and the editor returns a successful exit status.
7864 .Ic edit
7865 can be used instead for a less display oriented editor.
7867 .It Ic write
7868 (w) For conventional messages the body without all headers is written.
7869 The original message is never marked for deletion in the originating
7870 mail folder.
7871 The output is decrypted and converted to its native format as necessary.
7872 If the output file exists, the text is appended.
7873 If a message is in MIME multipart format its first part is written to
7874 the specified file as for conventional messages, handling of the remains
7875 depends on the execution mode.
7876 No special handling of compressed files is performed.
7878 In interactive mode the user is consecutively asked for the filenames of
7879 the processed parts.
7880 For convenience saving of each part may be skipped by giving an empty
7881 value, the same result as writing it to
7882 .Pa /dev/null .
7883 Shell piping the part content by specifying a leading vertical bar
7884 .Ql |
7885 character for the filename is supported.
7886 Other user input undergoes the usual
7887 .Sx "Filename transformations" ,
7888 including shell pathname wildcard pattern expansions
7889 .Pf ( Xr glob 7 )
7890 and shell variable expansion for the message as such, not the individual
7891 parts, and contents of the destination file are overwritten if the file
7892 previously existed.
7893 Character set conversion to
7894 .Va ttycharset
7895 is performed when saving text data.
7897 \*(ID In non-interactive mode any part which does not specify a filename
7898 is ignored, and suspicious parts of filenames of the remaining parts are
7899 URL percent encoded (as via
7900 .Ic urlcodec )
7901 to prevent injection of malicious character sequences, resulting in
7902 a filename that will be written into the current directory.
7903 Existing files will not be overwritten, instead the part number or
7904 a dot are appended after a number sign
7905 .Ql #
7906 to the name until file creation succeeds (or fails due to other
7907 reasons).
7909 .It Ic xcall
7910 \*(NQ The sole difference to
7911 .Ic call
7912 is that the new macro is executed in place of the current one, which
7913 will not regain control: all resources of the current macro will be
7914 released first.
7915 This implies that any setting covered by
7916 .Ic localopts
7917 will be forgotten and covered variables will become cleaned up.
7918 If this command is not used from within a
7919 .Ic call Ns
7920 ed macro it will silently be (a more expensive variant of)
7921 .Ic call .
7923 .It Ic xit
7924 (x) A synonym for
7925 .Ic exit .
7927 .It Ic z
7928 \*(NQ \*(UA presents message headers in
7929 .Va screen Ns
7930 fuls as described under the
7931 .Ic headers
7932 command.
7933 Without arguments this command scrolls to the next window of messages,
7934 likewise if the argument is
7935 .Ql + .
7936 An argument of
7937 .Ql -
7938 scrolls to the last,
7939 .Ql ^
7940 scrolls to the first, and
7941 .Ql $
7942 to the last
7943 .Va \&\&screen
7944 of messages.
7945 A number argument prefixed by
7946 .Ql +
7948 .Ql \-
7949 indicates that the window is calculated in relation to the current
7950 position, and a number without a prefix specifies an absolute position.
7952 .It Ic Z
7953 \*(NQ Similar to
7954 .Ic z ,
7955 but scrolls to the next or previous window that contains at least one
7956 .Ql new
7958 .Ic flag Ns
7959 ged message.
7961 .Sh "COMMAND ESCAPES"
7962 Command escapes are available in
7963 .Sx "Compose mode"
7964 during interactive usage, when explicitly requested via
7965 .Fl ~ ,
7966 and in batch mode
7967 .Pf ( Fl # ) .
7968 They perform special functions, like editing headers of the message
7969 being composed, calling normal
7970 .Sx COMMANDS ,
7971 yielding a shell, etc.
7972 Command escapes are only recognized at the beginning of lines, and
7973 consist of an escape followed by a command character.
7974 The default
7975 .Va escape
7976 character is the tilde
7977 .Ql ~ .
7979 Unless otherwise documented command escapes ensure proper updates of
7980 the error number
7981 .Va \&!
7982 and the exit status
7983 .Va \&? .
7984 The variable
7985 .Va errexit
7986 controls whether a failed operation errors out message compose mode and
7987 causes program exit.
7988 Escapes may be prefixed by none to multiple single character command
7989 modifiers, interspersed whitespace is ignored:
7990 .Bl -bullet
7992 An effect equivalent to the command modifier
7993 .Cm ignerr
7994 can be achieved with hyphen-minus
7995 .Ql - ,
7996 overriding
7997 .Va errexit .
7999 The modifier dollar
8000 .Ql $
8001 .Ic eval Ns
8002 uates the remains of the line; also see
8003 .Sx "Shell-style argument quoting" .
8004 \*(ID For now the entire input line is evaluated as a whole; to avoid
8005 that control operators like semicolon
8006 .Cm \&;
8007 are interpreted unintentionally, they must be quoted.
8010 Addition of the command line to the \*(OPal history can be prevented by
8011 placing whitespace directly after
8012 .Va escape .
8013 The \*(OPal key
8014 .Ic bind Ns
8015 ings support a compose mode specific context.
8016 The following command escapes are supported:
8017 .Bl -tag -width ".It Ic BaNg"
8019 .It Ic ~~ Ar string
8020 Insert the string of text in the message prefaced by a single
8021 .Ql ~ .
8022 (If the escape character has been changed,
8023 that character must be doubled instead.)
8025 .It Ic ~! Ar command
8026 Execute the indicated shell
8027 .Ar command
8028 which follows, replacing unescaped exclamation marks with the previously
8029 executed command if the internal variable
8030 .Va bang
8031 is set, then return to the message.
8033 .It Ic ~.
8034 End compose mode and send the message.
8035 The hooks
8036 .Va on-compose-splice-shell
8038 .Va on-compose-splice ,
8039 in order, will be called when set, after which, in interactive mode
8040 .Va askatend
8041 (leading to
8042 .Va askcc , askbcc )
8044 .Va askattach
8045 will be checked as well as
8046 .Va asksend ,
8047 after which a set
8048 .Va on-compose-leave
8049 hook will be called,
8050 .Va autocc
8052 .Va autobcc
8053 will be joined in if set,
8054 finally a given
8055 .Va message-inject-tail
8056 will be incorporated, after which the compose mode is left.
8058 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
8059 Can be used to execute
8060 .Sx COMMANDS
8061 (which are allowed in compose mode).
8063 .It Ic ~< Ar filename
8064 Identical to
8065 .Ic ~r .
8067 .It Ic ~<! Ar command
8068 .Ar command
8069 is executed using the shell.
8070 Its standard output is inserted into the message.
8072 .It Ic ~?
8073 \*(OP Write a summary of command escapes.
8075 .It Ic ~@ Op Ar filename...
8076 Append or edit the list of attachments.
8077 Does not manage the error number
8078 .Va \&!
8079 and the exit status
8080 .Va \&?
8081 (please use
8082 .Ic ~^
8083 if error handling is necessary).
8084 The append mode expects a list of
8085 .Ar filename
8086 arguments as shell tokens (see
8087 .Sx "Shell-style argument quoting" ;
8088 token-separating commas are ignored, too), to be
8089 interpreted as documented for the command line option
8090 .Fl a ,
8091 with the message number exception as below.
8093 Without
8094 .Ar filename
8095 arguments the attachment list is edited, entry by entry;
8096 if a filename is left empty, that attachment is deleted from the list;
8097 once the end of the list is reached either new attachments may be
8098 entered or the session can be quit by committing an empty
8099 .Dq new
8100 attachment.
8101 In non-interactive mode or in batch mode
8102 .Pf ( Fl # )
8103 the list of attachments is effectively not edited but instead recreated;
8104 again, an empty input ends list creation.
8106 For all modes, if a given filename solely consists of the number sign
8107 .Ql #
8108 followed by either a valid message number of the currently active
8109 mailbox, or by a period
8110 .Ql \&. ,
8111 referring to the current message of the active mailbox, the so-called
8112 .Dq dot ,
8113 then the given message is attached as a
8114 .Ql message/rfc822
8115 MIME message part.
8116 The number sign must be quoted to avoid misinterpretation as a shell
8117 comment character.
8119 .It Ic ~| Ar command
8120 Pipe the message text through the specified filter command.
8121 If the command gives no output or terminates abnormally,
8122 retain the original text of the message.
8123 The command
8124 .Xr fmt 1
8125 is often used as a rejustifying filter.
8127 If the first character of the command is a vertical bar, then the entire
8128 message including header fields is subject to the filter command, so
8129 .Ql ~|| echo Fcc: /tmp/test; cat
8130 will prepend a file-carbon-copy message header.
8131 Also see
8132 .Ic ~e , ~v .
8134 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
8135 Inspect and modify the message using the semantics of
8136 .Ic digmsg ,
8137 therefore arguments are evaluated according to
8138 .Sx "Shell-style argument quoting" .
8139 Error number
8140 .Va \&!
8141 and exit status
8142 .Va \&?
8143 are not managed: errors are handled via the protocol,
8144 and hard errors like I/O failures cannot be handled.
8146 The protocol consists of command lines followed by (a) response line(s).
8147 The first field of the response line represents a status code
8148 which specifies whether a command was successful or not, whether result
8149 data is to be expected, and if, the format of the result data.
8150 Response data will be shell quoted as necessary for consumption by
8151 .Ic readsh ,
8153 .Ic eval
8155 .Ic vpospar ,
8156 to name a few.
8157 Error status code lines may optionally contain additional context:
8159 .Bl -tag -compact -width ".It Ql 210"
8160 .It Ql 210
8161 Status ok; the remains of the line are the result.
8162 .It Ql 211
8163 Status ok; the rest of the line is optionally used for more status.
8164 What follows are lines of result addresses, terminated by an empty line.
8165 All the input, including the empty line, must be consumed before further
8166 commands can be issued.
8167 Address lines consist of two token, first the plain network address, e.g.,
8168 .Ql bob@exam.ple ,
8169 followed by the (quoted) full address as known:
8170 .Ql '(Lovely) Bob <bob@exam.ple>' .
8171 Non-network addresses use the first field to indicate the type (hyphen-minus
8172 .Ql -
8173 for files, vertical bar
8174 .Ql |
8175 for pipes, and number sign
8176 .Ql #
8177 for names which will undergo
8178 .Ic alias
8179 processing) instead, the actual value will be in the second field.
8180 .It Ql 212
8181 Status ok; the rest of the line is optionally used for more status.
8182 What follows are lines of furtherly unspecified (quoted) string content,
8183 terminated by an empty line.
8184 All the input, including the empty line, must be consumed before further
8185 commands can be issued.
8186 .It Ql 500
8187 Syntax error; invalid command.
8188 .It Ql 501
8189 Syntax error or otherwise invalid parameters or arguments.
8190 .It Ql 505
8191 Error: an argument fails verification.
8192 For example an invalid address has been specified (also see
8193 .Va expandaddr ) ,
8194 or an attempt was made to modify anything in \*(UA's own namespace,
8195 or a modifying subcommand has been used on a read-only message.
8196 .It Ql 506
8197 Error: an otherwise valid argument is rendered invalid due to context.
8198 For example, a second address is added to a header which may consist of
8199 a single address only.
8202 If a command indicates failure then the message will have remained
8203 unmodified.
8204 Most commands can fail with
8205 .Ql 500
8206 if required arguments are missing, or excessive arguments have been
8207 given (false command usage).
8208 (\*(ID The latter does not yet occur regularly, because as stated in
8209 .Sx "Shell-style argument quoting"
8210 our argument parser is not yet smart enough to work on subcommand base;
8211 for example one might get excess argument error for a three argument
8212 subcommand that receives four arguments, but not for a four argument
8213 subcommand which receives six arguments: here excess will be joined.)
8214 The following (case-insensitive) commands are supported:
8215 .Bl -hang -width ".It Cm version"
8216 .It Cm attachment
8217 This command allows listing, removal and addition of message attachments.
8218 The second argument specifies the subcommand to apply, one of:
8219 .Bl -hang -width ".It Cm remove"
8220 .It Cm attribute
8221 This uses the same search mechanism as described for
8222 .Cm remove
8223 and prints any known attributes of the first found attachment via
8224 .Ql 212
8225 upon success or
8226 .Ql 501
8227 if no such attachment can be found.
8228 The attributes are written as lines with a keyword and a value token.
8229 .It Cm attribute-at
8230 This uses the same search mechanism as described for
8231 .Cm remove-at
8232 and is otherwise identical to
8233 .Cm attribute .
8234 .It Cm attribute-set
8235 This uses the same search mechanism as described for
8236 .Cm remove ,
8237 and will set the attribute given as the fourth to the value given as
8238 the fifth token argument.
8239 If the value is an empty token, then the given attribute is removed,
8240 or reset to a default value if existence of the attribute is crucial.
8242 It returns via
8243 .Ql 210
8244 upon success, with the index of the found attachment following,
8245 .Ql 505
8246 for message attachments or if the given keyword is invalid, and
8247 .Ql 501
8248 if no such attachment can be found.
8249 The following keywords may be used (case-insensitively):
8251 .Bl -hang -compact -width ".It Ql filename"
8252 .It Ql filename
8253 Sets the filename of the MIME part, i.e., the name that is used for
8254 display and when (suggesting a name for) saving (purposes).
8255 .It Ql content-description
8256 Associate some descriptive information to the attachment's content, used
8257 in favour of the plain filename by some MUAs.
8258 .It Ql content-id
8259 May be used for uniquely identifying MIME entities in several contexts;
8260 this expects a special reference address format as defined in RFC 2045
8261 and generates a
8262 .Ql 505
8263 upon address content verification failure.
8264 .It Ql content-type
8265 Defines the media type/subtype of the part, which is managed
8266 automatically, but can be overwritten.
8267 .It Ql content-disposition
8268 Automatically set to the string
8269 .Ql attachment .
8271 .It Cm attribute-set-at
8272 This uses the same search mechanism as described for
8273 .Cm remove-at
8274 and is otherwise identical to
8275 .Cm attribute-set .
8276 .It Cm insert
8277 Adds the attachment given as the third argument, specified exactly as
8278 documented for the command line option
8279 .Fl a ,
8280 and supporting the message number extension as documented for
8281 .Ic ~@ .
8282 This reports
8283 .Ql 210
8284 upon success, with the index of the new attachment following,
8285 .Ql 505
8286 if the given file cannot be opened,
8287 .Ql 506
8288 if an on-the-fly performed character set conversion fails, otherwise
8289 .Ql 501
8290 is reported; this is also reported if character set conversion is
8291 requested but not available.
8292 .It Cm list
8293 List all attachments via
8294 .Ql 212 ,
8295 or report
8296 .Ql 501
8297 if no attachments exist.
8298 This command is the default command of
8299 .Cm attachment
8300 if no second argument has been given.
8301 .It Cm remove
8302 This will remove the attachment given as the third argument, and report
8303 .Ql 210
8304 upon success or
8305 .Ql 501
8306 if no such attachment can be found.
8307 If there exists any path component in the given argument, then an exact
8308 match of the path which has been used to create the attachment is used
8309 directly, but if only the basename of that path matches then all
8310 attachments are traversed to find an exact match first, and the removal
8311 occurs afterwards; if multiple basenames match, a
8312 .Ql 506
8313 error occurs.
8314 Message attachments are treated as absolute pathnames.
8316 If no path component exists in the given argument, then all attachments
8317 will be searched for
8318 .Ql filename=
8319 parameter matches as well as for matches of the basename of the path
8320 which has been used when the attachment has been created; multiple
8321 matches result in a
8322 .Ql 506 .
8323 .It Cm remove-at
8324 This will interpret the third argument as a number and remove the
8325 attachment at that list position (counting from one!), reporting
8326 .Ql 210
8327 upon success or
8328 .Ql 505
8329 if the argument is not a number or
8330 .Ql 501
8331 if no such attachment exists.
8333 .It Cm header
8334 This command allows listing, inspection, and editing of message headers.
8335 Header name case is not normalized, so that case-insensitive comparison
8336 should be used when matching names.
8337 The second argument specifies the subcommand to apply, one of:
8338 .Bl -hang -width ".It Cm remove"
8339 .It Cm insert
8340 Create a new or an additional instance of the header given in the third
8341 argument, with the header body content as given in the fourth token.
8342 It may return
8343 .Ql 501
8344 if the third argument specifies a free-form header field name that is
8345 invalid, or if body content extraction fails to succeed,
8346 .Ql 505
8347 if any extracted address does not pass syntax and/or security checks or
8348 on \*(UA namespace violations, and
8349 .Ql 506
8350 to indicate prevention of excessing a single-instance header \(em note that
8351 .Ql Subject:
8352 can be appended to (a space separator will be added automatically first).
8353 .Ql To: ,
8354 .Ql Cc:
8356 .Ql Bcc:
8357 support the
8358 .Ql ?single
8359 modifier to enforce treatment as a single addressee, for example
8360 .Ql header insert To?single: 'exa, <m@ple>' ;
8361 the word
8362 .Ql single
8363 is optional.
8365 .Ql 210
8366 is returned upon success, followed by the name of the header and the list
8367 position of the newly inserted instance.
8368 The list position is always 1 for single-instance header fields.
8369 All free-form header fields are managed in a single list; also see
8370 .Va customhdr .
8371 .It Cm list
8372 Without a third argument a list of all yet existing headers is given via
8373 .Ql 210 ;
8374 this command is the default command of
8375 .Cm header
8376 if no second argument has been given.
8377 A third argument restricts output to the given header only, which may
8378 fail with
8379 .Ql 501
8380 if no such field is defined.
8381 .It Cm remove
8382 This will remove all instances of the header given as the third
8383 argument, reporting
8384 .Ql 210
8385 upon success,
8386 .Ql 501
8387 if no such header can be found, and
8388 .Ql 505
8389 on \*(UA namespace violations.
8390 .It Cm remove-at
8391 This will remove from the header given as the third argument the
8392 instance at the list position (counting from one!) given with the fourth
8393 argument, reporting
8394 .Ql 210
8395 upon success or
8396 .Ql 505
8397 if the list position argument is not a number or on \*(UA namespace
8398 violations, and
8399 .Ql 501
8400 if no such header instance exists.
8401 .It Cm show
8402 Shows the content of the header given as the third argument.
8403 Dependent on the header type this may respond with
8404 .Ql 211
8406 .Ql 212 ;
8407 any failure results in
8408 .Ql 501 .
8411 In compose-mode read-only access to optional pseudo headers in the \*(UA
8412 private namespace is available:
8414 .Bl -tag -compact -width ".It Va BaNg"
8415 .It Ql Mailx-Command:
8416 The name of the command that generates the message, one of
8417 .Ql forward ,
8418 .Ql Lreply ,
8419 .Ql mail ,
8420 .Ql Reply ,
8421 .Ql reply ,
8422 .Ql resend .
8423 This pseudo header always exists (in compose-mode).
8424 .It Ql Mailx-Raw-To:
8425 .It Ql Mailx-Raw-Cc:
8426 .It Ql Mailx-Raw-Bcc:
8427 Represent the frozen initial state of these headers before any
8428 transformation
8429 .Pf ( Ic alias ,
8430 .Ic alternates ,
8431 .Va recipients-in-cc
8432 etc.) took place.
8433 .It Ql Mailx-Orig-Sender:
8434 .It Ql Mailx-Orig-From:
8435 .It Ql Mailx-Orig-To:
8436 .It Ql Mailx-Orig-Cc:
8437 .It Ql Mailx-Orig-Bcc:
8438 The values of said headers of the original message which has been
8439 addressed by any of
8440 .Ic reply , forward , resend .
8441 The sender field is special as it is filled in with the sole sender
8442 according to RFC 5322 rules, it may thus be equal to the from field.
8444 .It Cm help , \&?
8445 Show an abstract of the above commands via
8446 .Ql 211 .
8447 .It Cm version
8448 This command will print the protocol version via
8449 .Ql 210 .
8452 .It Ic ~A
8453 The same as
8454 .Ql Ic ~i Ns \| Va Sign .
8456 .It Ic ~a
8457 The same as
8458 .Ql Ic ~i Ns \| Va sign .
8460 .It Ic ~b Ar name ...
8461 Add the given names to the list of blind carbon copy recipients.
8463 .It Ic ~c Ar name ...
8464 Add the given names to the list of carbon copy recipients.
8466 .It Ic ~d
8467 Read the file specified by the
8468 .Ev DEAD
8469 variable into the message.
8471 .It Ic ~e
8472 Invoke the text
8473 .Ev EDITOR
8474 on the message collected so far, then return to compose mode.
8475 .Ic ~v
8476 can be used for a more display oriented editor, and
8477 .Ic ~| Ns |
8478 offers a pipe-based editing approach.
8480 .It Ic ~F Ar messages
8481 Read the named messages into the message being sent, including all
8482 message headers and MIME parts, and honouring
8483 .Va forward-add-cc
8484 as well as
8485 .Va forward-inject-head
8487 .Va forward-inject-tail .
8488 If no messages are specified, read in the current message, the
8489 .Dq dot .
8491 .It Ic ~f Ar messages
8492 Read the named messages into the message being sent.
8493 If no messages are specified, read in the current message, the
8494 .Dq dot .
8495 Strips down the list of header fields according to the
8496 .Ql forward
8497 (with
8498 .Va posix :
8499 .Ql type )
8500 white- and blacklist selection of
8501 .Ic headerpick ,
8502 and honours
8503 .Va forward-add-cc
8504 as well as
8505 .Va forward-inject-head
8507 .Va forward-inject-tail .
8508 For MIME multipart messages,
8509 only the first displayable part is included.
8511 .It Ic ~H
8512 In interactive mode, edit the message header fields
8513 .Ql From: ,
8514 .Ql Reply-To:
8516 .Ql Sender:
8517 by typing each one in turn and allowing the user to edit the field.
8518 The default values for these fields originate from the
8519 .Va from , reply-to
8521 .Va sender
8522 variables.
8523 In non-interactive mode this sets
8524 .Va ^ERR Ns -NOTTY .
8526 .It Ic ~h
8527 In interactive mode, edit the message header fields
8528 .Ql To: ,
8529 .Ql Cc: ,
8530 .Ql Bcc:
8532 .Ql Subject:
8533 by typing each one in turn and allowing the user to edit the field.
8534 In non-interactive mode this sets
8535 .Va ^ERR Ns -NOTTY .
8537 .It Ic ~I Ar variable
8538 Insert the value of the specified variable into the message.
8539 The message remains unaltered if the variable is unset or empty.
8540 Any embedded character sequences
8541 .Ql \et
8542 horizontal tabulator and
8543 .Ql \en
8544 line feed are expanded in
8545 .Va posix
8546 mode; otherwise the expansion should occur at
8547 .Ic set
8548 time (\*(ID by using the command modifier
8549 .Va wysh ) .
8551 .It Ic ~i Ar variable
8552 Like
8553 .Ic ~I ,
8554 but appends a newline character.
8556 .It Ic ~M Ar messages
8557 Read the named messages into the message being sent,
8558 indented by
8559 .Va indentprefix .
8560 If no messages are specified, read the current message, the
8561 .Dq dot .
8562 Honours
8563 .Va forward-add-cc
8564 as well as
8565 .Va forward-inject-head
8567 .Va forward-inject-tail .
8569 .It Ic ~m Ar messages
8570 Read the named messages into the message being sent,
8571 indented by
8572 .Va indentprefix .
8573 If no messages are specified, read the current message, the
8574 .Dq dot .
8575 Strips down the list of header fields according to the
8576 .Ql type
8577 white- and blacklist selection of
8578 .Ic headerpick .
8579 Honours
8580 .Va forward-add-cc
8581 as well as
8582 .Va forward-inject-head
8584 .Va forward-inject-tail .
8585 For MIME multipart messages,
8586 only the first displayable part is included.
8588 .It Ic ~p
8589 Display the message collected so far,
8590 prefaced by the message header fields
8591 and followed by the attachment list, if any.
8593 .It Ic ~Q
8594 Read in the given / current message(s) using the algorithm of
8595 .Va quote
8596 (except that is implicitly assumed, even if not set), honouring
8597 .Va quote-add-cc .
8599 .It Ic ~q
8600 Abort the message being sent,
8601 copying it to the file specified by the
8602 .Ev DEAD
8603 variable if
8604 .Va save
8605 is set.
8607 .It Ic ~R Ar filename
8608 Identical to
8609 .Ic ~r ,
8610 but indent each line that has been read by
8611 .Va indentprefix .
8613 .It Ic ~r Ar filename Op Ar HERE-delimiter
8614 Read the named file, object to
8615 .Sx "Filename transformations"
8616 excluding shell globs and variable expansions, into the message; if
8617 .Ar filename
8618 is the hyphen-minus
8619 .Ql -
8620 then standard input is used (for pasting, for example).
8621 Only in this latter mode
8622 .Ar HERE-delimiter
8623 may be given: if it is data will be read in until the given
8624 .Ar HERE-delimiter
8625 is seen on a line by itself, and encountering EOF is an error; the
8626 .Ar HERE-delimiter
8627 is a required argument in non-interactive mode; if it is single-quote
8628 quoted then the pasted content will not be expanded, \*(ID otherwise
8629 a future version of \*(UA may perform shell-style expansion on the content.
8631 .It Ic ~s Ar string
8632 Cause the named string to become the current subject field.
8633 Newline (NL) and carriage-return (CR) bytes are invalid and will be
8634 normalized to space (SP) characters.
8636 .It Ic ~t Ar name ...
8637 Add the given name(s) to the direct recipient list.
8639 .It Ic ~U Ar messages
8640 Read in the given / current message(s) excluding all headers, indented by
8641 .Va indentprefix .
8642 Honours
8643 .Va forward-add-cc
8644 as well as
8645 .Va forward-inject-head
8647 .Va forward-inject-tail .
8649 .It Ic ~u Ar messages
8650 Read in the given / current message(s), excluding all headers.
8651 Honours
8652 .Va forward-add-cc
8653 as well as
8654 .Va forward-inject-head
8656 .Va forward-inject-tail .
8658 .It Ic ~v
8659 Invoke the
8660 .Ev VISUAL
8661 editor on the message collected so far, then return to compose mode.
8662 .Ic ~e
8663 can be used for a less display oriented editor, and
8664 .Ic ~| Ns |
8665 offers a pipe-based editing approach.
8667 .It Ic ~w Ar filename
8668 Write the message onto the named file, which is object to the usual
8669 .Sx "Filename transformations" .
8670 If the file exists,
8671 the message is appended to it.
8673 .It Ic ~x
8674 Same as
8675 .Ic ~q ,
8676 except that the message is not saved at all.
8678 .Sh "INTERNAL VARIABLES"
8679 Internal \*(UA variables are controlled via the
8680 .Ic set
8682 .Ic unset
8683 commands; prefixing a variable name with the string
8684 .Ql no
8685 and calling
8686 .Ic set
8687 has the same effect as using
8688 .Ic unset :
8689 .Ql unset crt
8691 .Ql set nocrt
8692 do the same thing.
8693 .Ic varshow
8694 will give more insight on the given variable(s), and
8695 .Ic set ,
8696 when called without arguments, will show a listing of all variables.
8697 Both commands support a more
8698 .Va verbose
8699 listing mode.
8700 Some well-known variables will also become inherited from the
8701 program
8702 .Sx ENVIRONMENT
8703 implicitly, others can be imported explicitly with the command
8704 .Ic environ
8705 and henceforth share said properties.
8707 Two different kinds of internal variables exist, and both of which can
8708 also form chains.
8709 There are boolean variables, which can only be in one of the two states
8710 .Dq set
8712 .Dq unset ,
8713 and value variables with a(n optional) string value.
8714 For the latter proper quoting is necessary upon assignment time, the
8715 introduction of the section
8716 .Sx COMMANDS
8717 documents the supported quoting rules.
8718 .Bd -literal -offset indent
8719 ? wysh set one=val\e 1 two="val 2" \e
8720     three='val "3"' four=$'val \e'4\e''; \e
8721     varshow one two three four; \e
8722     unset one two three four
8725 Dependent upon the actual option string values may become interpreted as
8726 colour names, command specifications, normal text, etc.
8727 They may be treated as numbers, in which case decimal values are
8728 expected if so documented, but otherwise any numeric format and
8729 base that is valid and understood by the
8730 .Ic vexpr
8731 command may be used, too.
8733 There also exists a special kind of string value, the
8734 .Dq boolean string ,
8735 which must either be a decimal integer (in which case
8736 .Ql 0
8737 is false and
8738 .Ql 1
8739 and any other value is true) or any of the (case-insensitive) strings
8740 .Ql off ,
8741 .Ql no ,
8742 .Ql n
8744 .Ql false
8745 for a false boolean and
8746 .Ql on ,
8747 .Ql yes ,
8748 .Ql y
8750 .Ql true
8751 for a true boolean;
8752 .Mx -ix quadoption
8753 a special kind of boolean string is the
8754 .Dq quadoption :
8755 it can optionally be prefixed with the (case-insensitive) term
8756 .Ql ask- ,
8757 as in
8758 .Ql ask-yes ;
8759 in interactive mode the user will be prompted, otherwise the actual
8760 boolean is used.
8762 Variable chains extend a plain
8763 .Ql variable
8764 with
8765 .Ql variable-HOST
8767 .Ql variable-USER@HOST
8768 variants.
8769 Here
8770 .Ql HOST
8771 will be converted to all lowercase when looked up (but not when the
8772 variable is set or unset!), \*(OPally IDNA converted, and indeed means
8773 .Ql server:port
8774 if a
8775 .Ql port
8776 had been specified in the contextual Uniform Resource Locator URL, see
8777 .Sx "On URL syntax and credential lookup" .
8778 Even though this mechanism is based on URLs no URL percent encoding may
8779 be applied to neither of
8780 .Ql USER
8782 .Ql HOST ,
8783 variable chains need to be specified using raw data;
8784 the mentioned section contains examples.
8785 Variables which support chains are explicitly documented as such, and
8786 \*(UA treats the base name of any such variable special, meaning that
8787 users should not create custom names like
8788 .Ql variable-xyz
8789 in order to avoid false classifications and treatment of such variables.
8790 .Ss "Initial settings"
8791 The standard POSIX 2008/Cor 2-2016 mandates the following initial
8792 variable settings:
8793 .Pf no Va allnet ,
8794 .Pf no Va append ,
8795 .Va asksub ,
8796 .Pf no Va askbcc ,
8797 .Pf no Va autoprint ,
8798 .Pf no Va bang ,
8799 .Pf no Va cmd ,
8800 .Pf no Va crt ,
8801 .Pf no Va debug ,
8802 .Pf no Va dot ,
8803 .Va escape
8804 set to
8805 .Ql ~ ,
8806 .Pf no Va flipr ,
8807 .Pf no Va folder ,
8808 .Va header ,
8809 .Pf no Va hold ,
8810 .Pf no Va ignore ,
8811 .Pf no Va ignoreeof ,
8812 .Pf no Va keep ,
8813 .Pf no Va keepsave ,
8814 .Pf no Va metoo ,
8815 .Pf no Va outfolder ,
8816 .Pf no Va page ,
8817 .Va prompt
8818 set to
8819 .Ql \&?\0 ,
8820 .Pf no Va quiet ,
8821 .Pf no Va record ,
8822 .Va save ,
8823 .Pf no Va sendwait ,
8824 .Pf no Va showto ,
8825 .Pf no Va Sign ,
8826 .Pf no Va sign ,
8827 .Va toplines
8828 set to
8829 .Ql 5 .
8831 However, \*(UA has built-in some initial (and some default) settings
8832 which (may) diverge, others may become adjusted by one of the
8833 .Sx "Resource files" .
8834 Displaying the former is accomplished via
8835 .Ic set :
8836 .Ql $ \*(uA -:/ -v -Xset -Xx .
8837 In general this implementation sets (and has extended the meaning of)
8838 .Va sendwait ,
8839 and does not support the
8840 .Pf no Va onehop
8841 variable \(en use command line options or
8842 .Va mta-arguments
8843 to pass options through to a
8844 .Va mta .
8845 The default global resource file sets, among others, the variables
8846 .Va hold ,
8847 .Va keep
8849 .Va keepsave ,
8850 establishes a default
8851 .Ic headerpick
8852 selection etc., and should thus be taken into account.
8853 .Ss "Variables"
8854 .Bl -tag -width ".It Va BaNg"
8856 .It Va \&?
8857 \*(RO The exit status of the last command, or the
8858 .Ic return
8859 value of the macro
8860 .Ic call Ns
8861 ed last.
8862 This status has a meaning in the state machine: in conjunction with
8863 .Va errexit
8864 any non-0 exit status will cause a program exit, and in
8865 .Va posix
8866 mode any error while loading (any of the) resource files will have the
8867 same effect.
8868 .Cm ignerr ,
8869 one of the
8870 .Sx "Command modifiers" ,
8871 can be used to instruct the state machine to ignore errors.
8873 .It Va \&!
8874 \*(RO The current error number
8875 .Pf ( Xr errno 3 ) ,
8876 which is set after an error occurred; it is also available via
8877 .Va ^ERR ,
8878 and the error name and documentation string can be queried via
8879 .Va ^ERRNAME
8881 .Va ^ERRDOC .
8882 \*(ID This machinery is new and the error number is only really usable
8883 if a command explicitly states that it manages the variable
8884 .Va \&! ,
8885 for others errno will be used in case of errors, or
8886 .Va ^ERR Ns -INVAL
8887 if that is 0: it thus may or may not reflect the real error.
8888 The error number may be set with the command
8889 .Ic return .
8891 .It Va ^
8892 \*(RO This is a multiplexer variable which performs dynamic expansion of
8893 the requested state or condition, of which there are:
8894 .Bl -tag -width ".It Va BaNg"
8898 .It Va ^ERR , ^ERRDOC , ^ERRNAME
8899 The number, documentation, and name of the current
8900 .Xr errno 3 ,
8901 respectively, which is usually set after an error occurred.
8902 The documentation is an \*(OP, the name is used if not available.
8903 \*(ID This machinery is new and is usually reliable only if a command
8904 explicitly states that it manages the variable
8905 .Va \&! ,
8906 which is effectively identical to
8907 .Va \&\&^ERR .
8908 Each of those variables can be suffixed with a hyphen minus followed by
8909 a name or number, in which case the expansion refers to the given error.
8910 Note this is a direct mapping of (a subset of) the system error values:
8911 .Bd -literal -offset indent
8912 define work {
8913   eval echo \e$1: \e$^ERR-$1:\e
8914     \e$^ERRNAME-$1: \e$^ERRDOC-$1
8915   vput vexpr i + "$1" 1
8916   if [ $i -lt 16 ]
8917     \excall work $i
8918   end
8920 call work 0
8924 .It Va ^ERRQUEUE-COUNT , ^ERRQUEUE-EXISTS
8925 The number of messages in the \*(OPal queue of
8926 .Ic errors ,
8927 and a string indicating queue state: empty or (translated)
8928 .Dq ERROR .
8929 Always 0 and the empty string, respectively, unless
8930 .Va features
8931 includes
8932 .Ql ,+errors, .
8935 .It Va *
8936 \*(RO Expands all positional parameters (see
8937 .Va 1 ) ,
8938 separated by the first character of the value of
8939 .Va ifs .
8940 \*(ID The special semantics of the equally named special parameter of the
8941 .Xr sh 1
8942 are not yet supported.
8944 .It Va @
8945 \*(RO Expands all positional parameters (see
8946 .Va 1 ) ,
8947 separated by a space character.
8948 If placed in double quotation marks, each positional parameter is
8949 properly quoted to expand to a single parameter again.
8951 .It Va #
8952 \*(RO Expands to the number of positional parameters, i.e., the size of
8953 the positional parameter stack in decimal.
8955 .It Va \&0
8956 \*(RO Inside the scope of a
8957 .Ic define Ns
8958 d and
8959 .Ic call Ns
8960 ed macro this expands to the name of the calling macro, or to the empty
8961 string if the macro is running from top-level.
8962 For the \*(OPal regular expression search and replace operator of
8963 .Ic vexpr
8964 this expands to the entire matching expression.
8965 It represents the program name in global context.
8967 .It Va 1
8968 \*(RO Access of the positional parameter stack.
8969 All further parameters can be accessed with this syntax, too,
8970 .Ql 2 ,
8971 .Ql 3
8972 etc.; positional parameters can be shifted off the stack by calling
8973 .Ic shift .
8974 The parameter stack contains, for example, the arguments of a
8975 .Ic call Ns
8977 .Ic define Ns
8978 d macro, the matching groups of the \*(OPal regular expression search
8979 and replace expression of
8980 .Ic vexpr ,
8981 and can be explicitly created or overwritten with the command
8982 .Ic vpospar .
8984 .It Va account
8985 \*(RO Is set to the active
8986 .Ic account .
8988 .It Va add-file-recipients
8989 \*(BO When file or pipe recipients have been specified,
8990 mention them in the corresponding address fields of the message instead
8991 of silently stripping them from their recipient list.
8992 By default such addressees are not mentioned.
8994 .It Va allnet
8995 \*(BO Causes only the local part to be evaluated
8996 when comparing addresses.
8998 .It Va append
8999 \*(BO Causes messages saved in the
9000 .Mx -sx
9001 .Sx "secondary mailbox"
9002 .Ev MBOX
9003 to be appended to the end rather than prepended.
9004 This should always be set.
9006 .It Va askatend
9007 \*(BO Causes the prompts for
9008 .Ql Cc:
9010 .Ql Bcc:
9011 lists to appear after the message has been edited.
9013 .It Va askattach
9014 \*(BO If set, \*(UA asks an interactive user for files to attach at the
9015 end of each message; An empty line finalizes the list.
9017 .It Va askcc
9018 \*(BO Causes the interactive user to be prompted for carbon copy
9019 recipients (at the end of each message if
9020 .Va askatend
9022 .Va bsdcompat
9023 are set).
9025 .It Va askbcc
9026 \*(BO Causes the interactive user to be prompted for blind carbon copy
9027 recipients (at the end of each message if
9028 .Va askatend
9030 .Va bsdcompat
9031 are set).
9033 .It Va asksend
9034 \*(BO Causes the interactive user to be prompted for confirmation to
9035 send the message or reenter compose mode after having been shown
9036 a preliminary envelope summary.
9038 .It Va asksign
9039 \*(BO\*(OP Causes the interactive user to be prompted if the message is
9040 to be signed at the end of each message.
9042 .Va smime-sign
9043 variable is ignored when this variable is set.
9045 .It Va asksub
9046 \*(BO Causes \*(UA to prompt the interactive user for the subject upon
9047 entering compose mode unless a subject already exists.
9049 .It Va attrlist
9050 A sequence of characters to display in the
9051 .Ql attribute
9052 column of the
9053 .Va headline
9054 as shown in the display of
9055 .Ic headers ;
9056 each for one type of messages (see
9057 .Sx "Message states" ) ,
9058 with the default being
9059 .Ql NUROSPMFAT+\-$~
9061 .Ql NU\ \ *HMFAT+\-$~
9062 if the
9063 .Va bsdflags
9064 variable is set, in the following order:
9066 .Bl -tag -compact -width ".It Ql _"
9067 .It Ql N
9068 new.
9069 .It Ql U
9070 unread but old.
9071 .It Ql R
9072 new but read.
9073 .It Ql O
9074 read and old.
9075 .It Ql S
9076 saved.
9077 .It Ql P
9078 preserved.
9079 .It Ql M
9080 mboxed.
9081 .It Ql F
9082 flagged.
9083 .It Ql A
9084 answered.
9085 .It Ql T
9086 draft.
9087 .It Ql +
9088 \*(ID start of a (collapsed) thread in threaded mode (see
9089 .Va autosort ,
9090 .Ic thread ) ;
9091 .It Ql -
9092 \*(ID an uncollapsed thread in threaded mode; only used in conjunction with
9093 .Fl L .
9094 .It Ql $
9095 classified as spam.
9096 .It Ql ~
9097 classified as possible spam.
9100 .It Va autobcc
9101 Specifies a list of recipients to which a blind carbon copy of each
9102 outgoing message will be sent automatically.
9104 .It Va autocc
9105 Specifies a list of recipients to which a carbon copy of each outgoing
9106 message will be sent automatically.
9108 .It Va autocollapse
9109 \*(BO Causes threads to be collapsed automatically when .Ql thread Ns
9111 .Ic sort
9112 mode is entered (see the
9113 .Ic collapse
9114 command).
9116 .It Va autoprint
9117 \*(BO Enable automatic
9118 .Ic type Ns
9119 ing of a(n existing)
9120 .Dq successive
9121 message after
9122 .Ic delete
9124 .Ic undelete
9125 commands: the message that becomes the new
9126 .Dq dot
9127 is shown automatically, as via
9128 .Ic dp
9130 .Ic dt .
9132 .It Va autosort
9133 Causes sorted mode (see the
9134 .Ic sort
9135 command) to be entered automatically with the value of this variable as
9136 sorting method when a folder is opened, for example
9137 .Ql set autosort=thread .
9139 .It Va bang
9140 \*(BO Enables the substitution of all not (reverse-solidus) escaped
9141 exclamation mark
9142 .Ql \&!
9143 characters by the contents of the last executed command for the
9144 .Ic \&!
9145 shell escape command and
9146 .Ic ~! ,
9147 one of the compose mode
9148 .Sx "COMMAND ESCAPES" .
9149 If this variable is not set no reverse solidus stripping is performed.
9151 .It Va bind-timeout
9152 \*(OB Predecessor of
9153 .Va bind-inter-byte-timeout .
9154 \*(ID Setting this automatically sets the successor.
9156 .It Va bind-inter-byte-timeout
9157 \*(OP Terminals may generate multi-byte sequences for special function
9158 keys, for example, but these sequences may not become read as a unit.
9159 And multi-byte sequences can be defined freely via
9160 .Ic bind .
9161 This variable specifies the timeout in milliseconds that the MLE (see
9162 .Sx "On terminal control and line editor" )
9163 waits for more bytes to arrive unless it considers a sequence
9164 .Dq complete .
9165 The default is 200, the maximum is about 10 seconds.
9166 In the following example the comments state which sequences are
9167 affected by this timeout:
9168 .Bd -literal -offset indent
9169 ? bind base abc echo 0 # abc
9170 ? bind base ab,c echo 1 # ab
9171 ? bind base abc,d echo 2 # abc
9172 ? bind base ac,d echo 3 # ac
9173 ? bind base a,b,c echo 4
9174 ? bind base a,b,c,d echo 5
9175 ? bind base a,b,cc,dd echo 6 # cc and dd
9178 .It Va bind-inter-key-timeout
9179 \*(OP Multi-key
9180 .Ic bind
9181 sequences do not time out by default.
9182 If this variable is set, then the current key sequence is forcefully
9183 terminated once the timeout (in milliseconds) triggers.
9184 The value should be (maybe significantly) larger than
9185 .Va bind-inter-byte-timeout ,
9186 but may not excess the maximum, too.
9188 .It Va bsdcompat
9189 \*(BO Sets some cosmetical features to traditional BSD style;
9190 has the same affect as setting
9191 .Va askatend
9192 and all other variables prefixed with
9193 .Ql bsd ;
9194 it also changes the behaviour of
9195 .Va emptystart
9196 (which does not exist in BSD).
9198 .It Va bsdflags
9199 \*(BO Changes the letters shown in the first column of a header
9200 summary to traditional BSD style.
9202 .It Va bsdheadline
9203 \*(BO Changes the display of columns in a header summary to traditional
9204 BSD style.
9206 .It Va bsdmsgs
9207 \*(BO Changes some informational messages to traditional BSD style.
9209 .It Va bsdorder
9210 \*(BO Causes the
9211 .Ql Subject:
9212 field to appear immediately after the
9213 .Ql To:
9214 field in message headers and with the
9215 .Ic ~h
9216 .Sx "COMMAND ESCAPES" .
9221 .It Va build-cc , build-ld , build-os , build-rest
9222 \*(RO The build environment, including the compiler, the linker, the
9223 operating system \*(UA has been build for, usually taken from
9224 .Xr uname 1
9226 .Ql uname -s ,
9227 and then lowercased, as well as all the possibly interesting rest of the
9228 configuration and build environment.
9229 This information is also available in the
9230 .Va verbose
9231 output of the command
9232 .Ic version .
9234 .It Va charset-7bit
9235 The value that should appear in the
9236 .Ql charset=
9237 parameter of
9238 .Ql Content-Type:
9239 MIME header fields when no character set conversion of the message data
9240 was performed.
9241 This defaults to US-ASCII, and the chosen character set should be
9242 US-ASCII compatible.
9244 .It Va charset-8bit
9245 \*(OP The default 8-bit character set that is used as an implicit last
9246 member of the variable
9247 .Va sendcharsets .
9248 This defaults to UTF-8 if character set conversion capabilities are
9249 available, and to ISO-8859-1 otherwise (unless the operating system
9250 environment is known to always and exclusively support UTF-8 locales),
9251 in which case the only supported character set is
9252 .Va ttycharset
9253 and this variable is effectively ignored.
9255 .It Va charset-unknown-8bit
9256 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
9257 .Dq upgrade
9258 the content of a mail message by using a character set with the name
9259 .Ql unknown-8bit .
9260 Because of the unclassified nature of this character set \*(UA will not
9261 be capable to convert this character set to any other character set.
9262 If this variable is set any message part which uses the character set
9263 .Ql unknown-8bit
9264 is assumed to really be in the character set given in the value,
9265 otherwise the (final) value of
9266 .Va charset-8bit
9267 is used for this purpose.
9269 This variable will also be taken into account if a MIME type (see
9270 .Sx "The mime.types files" )
9271 of a MIME message part that uses the
9272 .Ql binary
9273 character set is forcefully treated as text.
9275 .It Va cmd
9276 The default value for the
9277 .Ic pipe
9278 command.
9280 .It Va colour-disable
9281 \*(BO\*(OP Forcefully disable usage of colours.
9282 Also see the section
9283 .Sx "Coloured display" .
9285 .It Va colour-pager
9286 \*(BO\*(OP Whether colour shall be used for output that is paged through
9287 .Ev PAGER .
9288 Note that pagers may need special command line options, for example
9289 .Xr less 1
9290 requires the option
9291 .Fl \&\&R
9293 .Xr lv 1
9294 the option
9295 .Fl \&\&c
9296 in order to support colours.
9297 Often doing manual adjustments is unnecessary since \*(UA may perform
9298 adjustments dependent on the value of the environment variable
9299 .Ev PAGER
9300 (see there for more).
9303 .It Va contact-mail , contact-web
9304 \*(RO Addresses for contact per email and web, respectively, for
9305 bug reports, suggestions, or anything else regarding \*(UA.
9306 The former can be used directly:
9307 .Ql \&? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
9312 .It Va content-description-forwarded-message , \
9313     content-description-quote-attachment , \
9314     content-description-smime-message , \
9315     content-description-smime-signature
9316 \*(OP(partially) Strings which will be placed in according
9317 .Ql Content-Description:
9318 headers if non-empty.
9319 They all have default values, for example
9320 .Ql Forwarded message .
9322 .It Va crt
9323 In a(n interactive) terminal session, then if this valued variable is
9324 set it will be used as a threshold to determine how many lines the given
9325 output has to span before it will be displayed via the configured
9326 .Ev PAGER ;
9327 Usage of the
9328 .Ev PAGER
9329 can be forced by setting this to the value
9330 .Ql 0 ,
9331 setting it without a value will deduce the current height of the
9332 terminal screen to compute the threshold (see
9333 .Ev LINES ,
9334 .Va screen
9336 .Xr stty 1 ) .
9337 \*(ID At the moment this uses the count of lines of the message in wire
9338 format, which, dependent on the
9339 .Va mime-encoding
9340 of the message, is unrelated to the number of display lines.
9341 (The software is old and historically the relation was a given thing.)
9343 .It Va customhdr
9344 Define a set of custom headers to be injected into newly composed or
9345 forwarded messages.
9346 A custom header consists of the field name followed by a colon
9347 .Ql \&:
9348 and the field content body.
9349 Standard header field names cannot be overwritten by a custom header,
9350 with the exception of
9351 .Ql Comments:
9353 .Ql Keywords: .
9354 Different to the command line option
9355 .Fl C
9356 the variable value is interpreted as a comma-separated list of custom
9357 headers: to include commas in header bodies they need to become escaped
9358 with reverse solidus
9359 .Ql \e .
9360 Headers can be managed more freely in
9361 .Sx "Compose mode"
9363 .Ic ~^ .
9365 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
9367 .It Va datefield
9368 Controls the appearance of the
9369 .Ql %d
9370 date and time format specification of the
9371 .Va headline
9372 variable, that is used, for example, when viewing the summary of
9373 .Ic headers .
9374 If unset, then the local receiving date is used and displayed
9375 unformatted, otherwise the message sending
9376 .Ql Date: .
9377 It is possible to assign a
9378 .Xr strftime 3
9379 format string and control formatting, but embedding newlines via the
9380 .Ql %n
9381 format is not supported, and will result in display errors.
9382 The default is
9383 .Ql %Y-%m-%d %H:%M ,
9384 and also see
9385 .Va datefield-markout-older .
9387 .It Va datefield-markout-older
9388 Only used in conjunction with
9389 .Va datefield .
9390 Can be used to create a visible distinction of messages dated more than
9391 a day in the future, or older than six months, a concept comparable to the
9392 .Fl \&\&l
9393 option of the POSIX utility
9394 .Xr ls 1 .
9395 If set to the empty string, then the plain month, day and year of the
9396 .Ql Date:
9397 will be displayed, but a
9398 .Xr strftime 3
9399 format string to control formatting can be assigned.
9400 The default is
9401 .Ql %Y-%m-%d .
9403 .It Va debug
9404 \*(BO (Almost) Enter a debug-only sandbox mode which generates many
9405 log messages, disables the actual delivery of messages, and also implies
9406 .Pf no Va record
9407 as well as
9408 .Pf no Va save .
9409 Also see
9410 .Va verbose .
9412 .It Va disposition-notification-send
9413 \*(BO\*(OP Emit a
9414 .Ql Disposition-Notification-To:
9415 header (RFC 3798) with the message.
9416 This requires the
9417 .Va from
9418 variable to be set.
9420 .It Va dot
9421 \*(BO When dot is set, a period
9422 .Ql \&.
9423 on a line by itself during message input in (interactive or batch
9424 .Fl # )
9425 .Sx "Compose mode"
9426 will be treated as end-of-message (in addition to the
9427 normal end-of-file condition).
9428 This behaviour is implied in
9429 .Va posix
9430 mode with a set
9431 .Va ignoreeof .
9433 .It Va dotlock-disable
9434 \*(BO\*(OP Disable creation of
9435 .Mx -sx
9436 .Sx "dotlock files"
9437 for MBOX databases.
9438 .It Va dotlock-ignore-error
9439 \*(OB\*(BO\*(OP Ignore failures when creating
9440 .Mx -sx
9441 .Sx "dotlock files" .
9442 Please use
9443 .Va dotlock-disable
9444 instead.
9446 .It Va editalong
9447 If this variable is set then the editor is started automatically when
9448 a message is composed in interactive mode.
9449 If the value starts with the letter
9450 .Ql v
9451 then this acts as if
9452 .Ic ~v ,
9453 otherwise as if
9454 .Ic ~e
9455 .Pf (see\0 Sx "COMMAND ESCAPES" )
9456 had been specified.
9458 .Va editheaders
9459 variable is implied for this automatically spawned editor session.
9461 .It Va editheaders
9462 \*(BO When a message is edited while being composed,
9463 its header is included in the editable text.
9465 .It Va emptystart
9466 \*(BO When entering interactive mode \*(UA normally writes
9467 .Dq \&No mail for user
9468 and exits immediately if a mailbox is empty or does not exist.
9469 If this variable is set \*(UA starts even with an empty or non-existent
9470 mailbox (the latter behaviour furtherly depends upon
9471 .Va bsdcompat ,
9472 though).
9474 .It Va errexit
9475 \*(BO Let each command with a non-0 exit status, including every
9476 .Ic call Ns
9477 ed macro which
9478 .Ic return Ns
9479 s a non-0 status, cause a program exit unless prefixed by
9480 .Cm ignerr
9481 (see
9482 .Sx "Command modifiers" ) .
9483 This also affects
9484 .Sx "COMMAND ESCAPES" ,
9485 but which use a different modifier for ignoring the error.
9486 Please refer to the variable
9487 .Va \&?
9488 for more on this topic.
9490 .It Va errors-limit
9491 \*(OP Maximum number of entries in the
9492 .Ic errors
9493 queue.
9495 .It Va escape
9496 The first character of this value defines the escape character for
9497 .Sx "COMMAND ESCAPES"
9499 .Sx "Compose mode" .
9500 The default value is the character tilde
9501 .Ql ~ .
9502 If set to the empty string, command escapes are disabled.
9504 .It Va expandaddr
9505 If unset only user name and email address recipients are allowed
9506 .Sx "On sending mail, and non-interactive mode" .
9507 If set without value all possible recipient types will be accepted.
9508 A value is parsed as a comma-separated list of case-insensitive strings,
9509 and if that contains
9510 .Ql restrict
9511 behaviour equals the former except when in interactive mode or if
9512 .Sx "COMMAND ESCAPES"
9513 were enabled via
9514 .Fl ~
9516 .Fl # ,
9517 in which case it equals the latter, allowing all address types.
9518 .Ql restrict
9519 really acts like
9520 .Ql restrict,\:-all,\:+name,\:+addr ,
9521 so care for ordering issues must be taken.
9523 Recipient types can be added and removed with a plus sign
9524 .Ql +
9525 or hyphen-minus
9526 .Ql -
9527 prefix, respectively.
9528 By default invalid or disallowed types are filtered out and
9529 cause a warning, hard send errors need to be enforced by including
9530 .Ql fail .
9531 The value
9532 .Ql all
9533 covers all types,
9534 .Ql fcc
9535 whitelists
9536 .Ql Fcc:
9537 header targets regardless of other settings,
9538 .Ql file
9539 file targets (it includes
9540 .Ql fcc ) ,
9541 .Ql pipe
9542 command pipeline targets,
9543 .Ql name
9544 user names still unexpanded after
9545 .Ic alias
9547 .Va mta-aliases
9548 processing and thus left for expansion by the
9549 .Va mta
9550 (invalid for the built-in SMTP one), and
9551 .Ql addr
9552 network addresses.
9553 Targets are interpreted in the given order, so that
9554 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
9555 will cause hard errors for any non-network address recipient address
9556 unless running interactively or having been started with the option
9557 .Fl ~
9559 .Fl # ;
9560 in the latter case(s) any type may be used.
9562 User name receivers addressing valid local users can be expanded to
9563 fully qualified network addresses (also see
9564 .Va hostname )
9565 by including
9566 .Ql nametoaddr
9567 in the list.
9568 Historically invalid recipients were stripped off without causing
9569 errors, this can be changed by making
9570 .Ql failinvaddr
9571 an entry of the list (it really acts like
9572 .Ql failinvaddr,\:+addr ) .
9573 Likewise,
9574 .Ql domaincheck
9575 .Pf (really\0\: Ql domaincheck,\:+addr )
9576 compares address domain names against a whitelist and strips off
9577 .Pf ( Ql fail
9578 for hard errors) addressees which fail this test; the domain name
9579 .Ql localhost
9580 and the non-empty value of
9581 .Va hostname
9582 (the real hostname otherwise) are always whitelisted,
9583 .Va expandaddr-domaincheck
9584 can be set to extend this list.
9585 Finally some address providers (for example
9586 .Fl b , c
9587 and all other command line recipients) will be evaluated as
9588 if specified within dollar-single-quotes (see
9589 .Sx "Shell-style argument quoting" )
9590 if the value list contains the string
9591 .Ql shquote .
9593 .It Va expandaddr-domaincheck
9594 Can be set to a comma-separated list of domain names which should be
9595 whitelisted for the evaluation of the
9596 .Ql domaincheck
9597 mode of
9598 .Va expandaddr .
9599 IDNA encoding is not automatically performed,
9600 .Ic addrcodec
9601 can be used to prepare the domain (of an address).
9603 .It Va expandargv
9604 Unless this variable is set additional
9605 .Va mta
9606 (Mail-Transfer-Agent)
9607 arguments from the command line, as can be given after a
9608 .Fl \&\&-
9609 separator, results in a program termination with failure status.
9610 The same can be accomplished by using the special (case-insensitive) value
9611 .Ql fail .
9612 A lesser strict variant is the otherwise identical
9613 .Ql restrict ,
9614 which does accept such arguments in interactive mode, or if tilde
9615 commands were enabled explicitly by using one of the command line options
9616 .Fl ~
9618 .Fl # .
9619 The empty value will allow unconditional usage.
9621 .It Va features
9622 \*(RO String giving a list of optional features.
9623 Features are preceded with a plus sign
9624 .Ql +
9625 if they are available, with a hyphen-minus
9626 .Ql -
9627 otherwise.
9628 To ease substring matching the string starts and ends with a comma.
9629 The output of the command
9630 .Ic version
9631 includes this information in a more pleasant output.
9633 .It Va flipr
9634 \*(BO This setting reverses the meanings of a set of reply commands,
9635 turning the lowercase variants, which by default address all recipients
9636 included in the header of a message
9637 .Pf ( Ic reply , respond , followup )
9638 into the uppercase variants, which by default address the sender only
9639 .Pf ( Ic Reply , Respond , Followup )
9640 and vice versa.
9642 .It Va folder
9643 The default path under which mailboxes are to be saved:
9644 filenames that begin with the plus sign
9645 .Ql +
9646 will have the plus sign replaced with the value of this variable if set,
9647 otherwise the plus sign will remain unchanged when doing
9648 .Sx "Filename transformations" ;
9649 also see
9650 .Ic folder
9651 for more on this topic, and know about standard imposed implications of
9652 .Va outfolder .
9653 The value supports a subset of transformations itself, and if the
9654 non-empty value does not start with a solidus
9655 .Ql / ,
9656 then the value of
9657 .Ev HOME
9658 will be prefixed automatically.
9659 Once the actual value is evaluated first, the internal variable
9660 .Va folder-resolved
9661 will be updated for caching purposes.
9662 .Mx Va folder-hook
9663 .It Va folder-hook-FOLDER , Va folder-hook
9664 Names a
9665 .Ic define Ns d
9666 macro which will be called whenever a
9667 .Ic folder
9668 is opened.
9669 The macro will also be invoked when new mail arrives,
9670 but message lists for commands executed from the macro
9671 only include newly arrived messages then.
9672 .Ic localopts
9673 are activated by default in a folder hook, causing the covered settings
9674 to be reverted once the folder is left again.
9676 The specialized form will override the generic one if
9677 .Ql FOLDER
9678 matches the file that is opened.
9679 Unlike other folder specifications, the fully expanded name of a folder,
9680 without metacharacters, is used to avoid ambiguities.
9681 However, if the mailbox resides under
9682 .Va folder
9683 then the usual
9684 .Ql +
9685 specification is tried in addition, so that if
9686 .Va \&\&folder
9688 .Dq mail
9689 (and thus relative to the user's home directory) then
9690 .Pa /home/usr1/mail/sent
9691 will be tried as
9692 .Ql folder-hook-/home/usr1/mail/sent
9693 first, but then followed by
9694 .Ql folder-hook-+sent .
9696 .It Va folder-resolved
9697 \*(RO Set to the fully resolved path of
9698 .Va folder
9699 once that evaluation has occurred; rather internal.
9701 .It Va followup-to
9702 \*(BO Controls whether a
9703 .Ql Mail-Followup-To:
9704 header is generated when sending messages to known mailing lists.
9705 The user as determined via
9706 .Va from
9707 (or, if that contains multiple addresses,
9708 .Va sender )
9709 will be placed in there if any list addressee is not a subscribed list.
9710 Also see
9711 .Va followup-to-honour
9712 and the commands
9713 .Ic mlist , mlsubscribe , reply
9715 .Ic Lreply .
9717 .It Va followup-to-add-cc
9718 \*(BO Controls whether the user will be added to the messages'
9719 .Ql Cc:
9720 list in addition to placing an entry in
9721 .Ql Mail-Followup-To:
9722 (see
9723 .Va followup-to ) .
9725 .It Va followup-to-honour
9726 Controls whether a
9727 .Ql Mail-Followup-To:
9728 header is honoured when group-replying to a message via
9729 .Ic reply
9731 .Ic Lreply .
9732 This is a
9733 .Mx -sx
9734 .Sx quadoption ;
9735 if set without a value it defaults to
9736 .Dq yes ,
9737 and see
9738 .Va followup-to .
9740 .It Va forward-add-cc
9741 \*(BO Whether senders of messages forwarded via
9742 .Ic ~F , ~f , ~m , ~U
9744 .Ic ~u
9745 shall be made members of the carbon copies
9746 .Ql Cc:
9747 list.
9749 .It Va forward-as-attachment
9750 \*(BO Original messages are normally sent as inline text with the
9751 .Ic forward
9752 command,
9753 and only the first part of a multipart message is included.
9754 With this setting enabled messages are sent as unmodified MIME
9755 .Ql message/rfc822
9756 attachments with all of their parts included.
9759 .It Va forward-inject-head , forward-inject-tail
9760 The strings to put before and after the text of a message with the
9761 .Ic forward
9762 command, respectively.
9763 The former defaults to
9764 .Ql -------- Original Message --------\en .
9765 Special format directives in these strings will be expanded if possible,
9766 and if so configured the output will be folded according to
9767 .Va quote-fold ;
9768 for more please refer to
9769 .Va quote-inject-head .
9770 Injections will not be performed by
9771 .Ic forward
9772 if the variable
9773 .Va forward-as-attachment
9774 is set \(em the
9775 .Sx "COMMAND ESCAPES"
9776 .Ic ~F , ~f , ~M , ~m , ~U , ~u
9777 always inject.
9779 .It Va from
9780 The address (or a list of addresses) to put into the
9781 .Ql From:
9782 field of the message header, quoting RFC 5322:
9783 the author(s) of the message, that is, the mailbox(es) of the person(s)
9784 or system(s) responsible for the writing of the message.
9785 According to that RFC setting the
9786 .Va sender
9787 variable is required if
9788 .Va \&\&from
9789 contains more than one address.
9790 \*(ID Please expect automatic management of the
9791 .Va from
9793 .Va sender
9794 relationship.
9795 Dependent on the context these addresses are handled as if they were in
9796 the list of
9797 .Ic alternates .
9799 If a file-based MTA is used, then
9800 .Va \&\&from
9801 (or, if that contains multiple addresses,
9802 .Va sender )
9803 can nonetheless be used as the envelope sender address at the MTA
9804 protocol level (the RFC 5321 reverse-path), either via the
9805 .Fl r
9806 command line option (without argument; see there for more), or by setting
9807 .Va r-option-implicit .
9809 If the machine's hostname is not valid at the Internet (for example at
9810 a dialup machine), then either this variable or
9811 .Va hostname
9812 (\*(IN a SMTP-based
9813 .Va mta
9814 adds even more fine-tuning capabilities with
9815 .Va smtp-hostname )
9816 have to be set: if so the message and MIME part related unique ID fields
9817 .Ql Message-ID:
9819 .Ql Content-ID:
9820 will be created (except when disallowed by
9821 .Va message-id-disable
9823 .Va stealthmua ) .
9825 .It Va fullnames
9826 \*(BO Due to historical reasons comments and name parts of email
9827 addresses are removed by default when sending mail, replying to or
9828 forwarding a message.
9829 If this variable is set such stripping is not performed.
9830 .It Va fwdheading
9831 \*(OB Predecessor of
9832 .Va forward-inject-head .
9834 .It Va header
9835 \*(BO Causes the header summary to be written at startup and after
9836 commands that affect the number of messages or the order of messages in
9837 the current
9838 .Ic folder .
9839 Unless in
9840 .Va posix
9841 mode a header summary will also be displayed on folder changes.
9842 The command line option
9843 .Fl N
9844 can be used to set
9845 .Pf no Va header .
9847 .It Va headline
9848 A format string to use for the summary of
9849 .Ic headers .
9850 Format specifiers in the given string start with a percent sign
9851 .Ql %
9852 and may be followed by an optional decimal number indicating the field
9853 width \(em if that is negative, the field is to be left-aligned.
9854 Names and addresses are subject to modifications according to
9855 .Va showname
9857 .Va showto .
9858 Valid format specifiers are:
9860 .Bl -tag -compact -width ".It Ql _%%_"
9861 .It Ql %%
9862 A plain percent sign.
9863 .It Ql %>
9864 .Dq Dotmark :
9865 a space character but for the current message
9866 .Pf ( Dq dot ) ,
9867 for which it expands to
9868 .Ql >
9869 (dependent on
9870 .Va headline-plain ) .
9871 .It Ql %<
9872 .Dq Dotmark :
9873 a space character but for the current message
9874 .Pf ( Dq dot ) ,
9875 for which it expands to
9876 .Ql <
9877 (dependent on
9878 .Va headline-plain ) .
9879 .It Ql %$
9880 \*(OP The spam score of the message, as has been classified via the
9881 command
9882 .Ic spamrate .
9883 Shows only a replacement character if there is no spam support.
9884 .It Ql %a
9885 Message attribute character (status flag); the actual content can be
9886 adjusted by setting
9887 .Va attrlist .
9888 .It Ql %d
9889 The date found in the
9890 .Ql Date:
9891 header of the message when
9892 .Va datefield
9893 is set (the default), otherwise the date when the message was received.
9894 Formatting can be controlled by assigning a
9895 .Xr strftime 3
9896 format string to
9897 .Va datefield
9898 (and
9899 .Va datefield-markout-older ) .
9900 .It Ql %e
9901 The indenting level in
9902 .Ql thread Ns
9904 .Ic sort
9905 mode.
9906 .It Ql %f
9907 The address of the message sender.
9908 .It Ql %i
9909 The message thread tree structure.
9910 (Note that this format does not support a field width, and honours
9911 .Va headline-plain . )
9912 .It Ql %L
9913 Mailing list status: is the addressee of the message a known
9914 .Ql l
9915 .Pf ( Ic mlist )
9917 .Ql L
9918 .Ic mlsubscribe Ns
9919 d mailing list?
9920 The letter
9921 .Ql P
9922 announces the presence of a RFC 2369
9923 .Ql List-Post:
9924 header, which makes a message a valuable target of
9925 .Ic Lreply .
9926 .It Ql %l
9927 The number of lines of the message, if available.
9928 .It Ql %m
9929 Message number.
9930 .It Ql %o
9931 The number of octets (bytes) in the message, if available.
9932 .It Ql %S
9933 Message subject (if any) in double quotes.
9934 .It Ql %s
9935 Message subject (if any).
9936 .It Ql %t
9937 The position in threaded/sorted order.
9938 .It Ql \&%U
9939 The value 0 except in an IMAP mailbox,
9940 where it expands to the UID of the message.
9943 The default is
9944 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
9946 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
9948 .Va bsdcompat
9949 is set.
9950 Also see
9951 .Va attrlist ,
9952 .Va headline-plain
9954 .Va headline-bidi .
9956 .It Va headline-bidi
9957 Bidirectional text requires special treatment when displaying headers,
9958 because numbers (in dates or for file sizes etc.) will not affect the
9959 current text direction, in effect resulting in ugly line layouts when
9960 arabic or other right-to-left text is to be displayed.
9961 On the other hand only a minority of terminals is capable to correctly
9962 handle direction changes, so that user interaction is necessary for
9963 acceptable results.
9964 Note that extended host system support is required nonetheless, e.g.,
9965 detection of the terminal character set is one precondition;
9966 and this feature only works in an Unicode (i.e., UTF-8) locale.
9968 In general setting this variable will cause \*(UA to encapsulate text
9969 fields that may occur when displaying
9970 .Va headline
9971 (and some other fields, like dynamic expansions in
9972 .Va prompt )
9973 with special Unicode control sequences;
9974 it is possible to fine-tune the terminal support level by assigning
9975 a value:
9976 no value (or any value other than
9977 .Ql 1 ,
9978 .Ql 2
9980 .Ql 3 )
9981 will make \*(UA assume that the terminal is capable to properly deal
9982 with Unicode version 6.3, in which case text is embedded in a pair of
9983 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
9984 characters.
9985 In addition no space on the line is reserved for these characters.
9987 Weaker support is chosen by using the value
9988 .Ql 1
9989 (Unicode 6.3, but reserve the room of two spaces for writing the control
9990 sequences onto the line).
9991 The values
9992 .Ql 2
9994 .Ql 3
9995 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
9996 again reserves room for two spaces in addition.
9998 .It Va headline-plain
9999 \*(BO On Unicode (UTF-8) aware terminals enhanced graphical symbols are
10000 used by default for certain entries of
10001 .Va headline .
10002 If this variable is set only basic US-ASCII symbols will be used.
10004 .It Va history-file
10005 \*(OP The (expandable) location of a permanent
10006 .Ic history
10007 file for the MLE line editor
10008 .Pf ( Sx "On terminal control and line editor" ) .
10009 Also see
10010 .Va history-size .
10012 .It Va history-gabby
10013 \*(OP Add more entries to the MLE
10014 .Ic history
10015 as is normally done.
10016 A comma-separated list of case-insensitive strings can be used to
10017 fine-tune which gabby entries shall be allowed.
10018 If it contains
10019 .Ql errors ,
10020 erroneous commands will also be added.
10021 .Ql all
10022 adds all optional entries, and is the fallback chattiness identifier of
10023 .Va on-history-addition .
10025 .It Va history-gabby-persist
10026 \*(BO\*(OP The
10027 .Va history-gabby
10028 entries will not be saved in persistent storage unless this variable is set.
10029 The knowledge of whether a persistent entry was gabby is not lost.
10030 Also see
10031 .Va history-file .
10033 .It Va history-size
10034 \*(OP Setting this variable imposes a limit on the number of concurrent
10035 .Ic history
10036 entries.
10037 If set to the value 0 then no further history entries will be added,
10038 and loading and incorporation of the
10039 .Va history-file
10040 upon program startup can also be suppressed by doing this.
10041 Runtime changes will not be reflected before the
10042 .Ic history
10043 is saved or loaded (again).
10045 .It Va hold
10046 \*(BO This setting controls whether messages are held in the system
10047 .Va inbox ,
10048 and it is set by default.
10050 .It Va hostname
10051 Used instead of the value obtained from
10052 .Xr uname 3
10054 .Xr getaddrinfo 3
10055 as the hostname when expanding local addresses, for example in
10056 .Ql From:
10057 (also see
10058 .Sx "On sending mail, and non-interactive mode" ,
10059 for expansion of addresses that have a valid user-, but no domain
10060 name in angle brackets).
10061 If either of
10062 .Va from
10063 or this variable is set the message and MIME part related unique ID fields
10064 .Ql Message-ID:
10066 .Ql Content-ID:
10067 will be created (except when disallowed by
10068 .Va message-id-disable
10070 .Va stealthmua ) .
10071 If the \*(OPal IDNA support is available (see
10072 .Va idna-disable )
10073 variable assignment is aborted when a necessary conversion fails.
10075 Setting it to the empty string will cause the normal hostname to be
10076 used, but nonetheless enables creation of said ID fields.
10077 \*(IN in conjunction with the built-in SMTP
10078 .Va mta
10079 .Va smtp-hostname
10080 also influences the results:
10081 one should produce some test messages with the desired combination of
10082 .Va \&\&hostname ,
10083 and/or
10084 .Va from ,
10085 .Va sender
10086 etc. first.
10088 .It Va idna-disable
10089 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
10090 names according to the rules of IDNA (internationalized domain names
10091 for applications).
10092 Since the IDNA code assumes that domain names are specified with the
10093 .Va ttycharset
10094 character set, an UTF-8 locale charset is required to represent all
10095 possible international domain names (before conversion, that is).
10097 .It Va ifs
10098 The input field separator that is used (\*(ID by some functions) to
10099 determine where to split input data.
10101 .Bl -tag -compact -width ".It MMM"
10102 .It 1.
10103 Unsetting is treated as assigning the default value,
10104 .Ql \& \et\en .
10105 .It 2.
10106 If set to the empty value, no field splitting will be performed.
10107 .It 3.
10108 If set to a non-empty value, all whitespace characters are extracted
10109 and assigned to the variable
10110 .Va ifs-ws .
10113 .Bl -tag -compact -width ".It MMM"
10114 .It a.
10115 .Va \&\&ifs-ws
10116 will be ignored at the beginning and end of input.
10117 Diverging from POSIX shells default whitespace is removed in addition,
10118 which is owed to the entirely different line content extraction rules.
10119 .It b.
10120 Each occurrence of a character of
10121 .Va \&\&ifs
10122 will cause field-splitting, any adjacent
10123 .Va \&\&ifs-ws
10124 characters will be skipped.
10127 .It Va ifs-ws
10128 \*(RO Automatically deduced from the whitespace characters in
10129 .Va ifs .
10131 .It Va ignore
10132 \*(BO Ignore interrupt signals from the terminal while entering
10133 messages; instead echo them as
10134 .Ql @
10135 characters and discard the current line.
10137 .It Va ignoreeof
10138 \*(BO Ignore end-of-file conditions
10139 .Pf ( Ql control-D )
10141 .Sx "Compose mode"
10142 on message input and in interactive command input.
10143 If set an interactive command input session can only be left by
10144 explicitly using one of the commands
10145 .Ic exit
10147 .Ic quit ,
10148 and message input in compose mode can only be terminated by entering
10149 a period
10150 .Ql \&.
10151 on a line by itself or by using the
10152 .Ic ~.
10153 .Sx "COMMAND ESCAPES" ;
10154 Setting this implies the behaviour that
10155 .Va dot
10156 describes in
10157 .Va posix
10158 mode.
10160 .It Va inbox
10161 If this is set to a non-empty string it will specify the user's
10162 .Mx -sx
10163 .Sx "primary system mailbox" ,
10164 overriding
10165 .Ev MAIL
10166 and the system-dependent default, and (thus) be used to replace
10167 .Ql %
10168 when doing
10169 .Sx "Filename transformations" ;
10170 also see
10171 .Ic folder
10172 for more on this topic.
10173 The value supports a subset of transformations itself.
10175 .It Va indentprefix
10176 String used by the
10177 .Ic ~m , ~M
10179 .Ic ~R
10180 .Sx "COMMAND ESCAPES"
10181 and by the
10182 .Va quote
10183 option for indenting messages,
10184 in place of the POSIX mandated default tabulator character
10185 .Ql \et .
10186 Also see
10187 .Va quote-chars .
10189 .It Va keep
10190 \*(BO If set, an empty
10191 .Mx -sx
10192 .Sx "primary system mailbox"
10193 file is not removed.
10194 Note that, in conjunction with
10195 .Va posix
10196 mode any empty file will be removed unless this variable is set.
10197 This may improve the interoperability with other mail user agents
10198 when using a common folder directory, and prevents malicious users
10199 from creating fake mailboxes in a world-writable spool directory.
10200 \*(ID Only local regular (MBOX) files are covered, Maildir and other
10201 mailbox types will never be removed, even if empty.
10203 .It Va keep-content-length
10204 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
10205 be told to keep the
10206 .Ql Content-Length:
10208 .Ql Lines:
10209 header fields that some MUAs generate by setting this variable.
10210 Since \*(UA does neither use nor update these non-standardized header
10211 fields (which in itself shows one of their conceptual problems),
10212 stripping them should increase interoperability in between MUAs that
10213 work with with same mailbox files.
10214 Note that, if this is not set but
10215 .Va writebackedited ,
10216 as below, is, a possibly performed automatic stripping of these header
10217 fields already marks the message as being modified.
10218 \*(ID At some future time \*(UA will be capable to rewrite and apply an
10219 .Va mime-encoding
10220 to modified messages, and then those fields will be stripped silently.
10222 .It Va keepsave
10223 \*(BO When a message is saved it is usually discarded from the
10224 originating folder when \*(UA is quit.
10225 This setting causes all saved message to be retained.
10227 .It Va line-editor-cpl-word-breaks
10228 \*(OP List of bytes which are used by the
10229 .Cd mle-complete
10230 tabulator completion to decide where word boundaries exist, by default
10231 .Ql """'@=;|:
10232 \*(ID This mechanism is yet restricted.
10234 .It Va line-editor-disable
10235 \*(BO Turn off any line editing capabilities (from \*(UAs POW, see
10236 .Sx "On terminal control and line editor"
10237 for more).
10239 .It Va line-editor-no-defaults
10240 \*(BO\*(OP Do not establish any default key binding.
10242 .It Va log-prefix
10243 Error log message prefix string
10244 .Pf ( Ql "\*(uA: " ) .
10246 .It Va mailbox-display
10247 \*(RO The name of the current mailbox
10248 .Pf ( Ic folder ) ,
10249 possibly abbreviated for display purposes.
10251 .It Va mailbox-resolved
10252 \*(RO The fully resolved path of the current mailbox.
10254 .It Va mailcap-disable
10255 \*(BO\*(OP Turn off consideration of MIME type handlers from,
10256 and implicit loading of
10257 .Sx "The Mailcap files" .
10259 .It Va mailx-extra-rc
10260 An additional startup file that is loaded as the last of the
10261 .Sx "Resource files" .
10262 Use this file for commands that are not understood by other POSIX
10263 .Xr mailx 1
10264 implementations, i.e., mostly anything which is not covered by
10265 .Sx "Initial settings" .
10267 .It Va markanswered
10268 \*(BO When a message is replied to and this variable is set,
10269 it is marked as having been
10270 .Ic answered .
10271 See the section
10272 .Sx "Message states" .
10274 .It Va mbox-fcc-and-pcc
10275 \*(BO By default all file and pipe message receivers (see
10276 .Va expandaddr )
10277 will be fed valid MBOX database entry message data (see
10278 .Ic folder ,
10279 .Va mbox-rfc4155 ) ,
10280 and existing file targets will become extended in compliance to RFC 4155.
10281 If this variable is unset then a plain standalone RFC 5322 message will
10282 be written, and existing file targets will be overwritten.
10284 .It Va mbox-rfc4155
10285 \*(BO When opening MBOX mailbox databases, and in order to achieve
10286 compatibility with old software, the very tolerant POSIX standard rules
10287 for detecting message boundaries (so-called
10288 .Ql From_
10289 lines) are used instead of the stricter rules from the standard RFC 4155.
10290 This behaviour can be switched by setting this variable.
10292 This may temporarily be handy when \*(UA complains about invalid
10293 .Ql From_
10294 lines when opening a MBOX: in this case setting this variable and
10295 re-opening the mailbox in question may correct the result.
10296 If so, copying the entire mailbox to some other file, as in
10297 .Ql copy * SOME-FILE ,
10298 will perform proper, all-compatible
10299 .Ql From_
10300 quoting for all detected messages, resulting in a valid MBOX mailbox.
10301 (\*(ID The better and non-destructive approach is to re-encode invalid
10302 messages, as if it would be created anew, instead of mangling the
10303 .Ql From_
10304 lines; this requires the structural code changes of the v15 rewrite.)
10305 Finally the variable can be unset again:
10306 .Bd -literal -offset indent
10307 define mboxfix {
10308   localopts yes; wysh set mbox-rfc4155;\e
10309     wysh File "${1}"; copy * "${2}"
10311 call mboxfix /tmp/bad.mbox /tmp/good.mbox
10314 .It Va memdebug
10315 \*(BO Internal development variable.
10316 (Keeps memory debug enabled even if
10317 .Va debug
10318 is not set.)
10320 .It Va message-id-disable
10321 \*(BO By setting this variable the generation of
10322 .Ql Message-ID:
10324 .Ql Content-ID:
10325 message and MIME part headers can be completely suppressed, effectively
10326 leaving this task up to the
10327 .Va mta
10328 (Mail-Transfer-Agent) or the SMTP server.
10329 Note that according to RFC 5321 a SMTP server is not required to add this
10330 field by itself, so it should be ensured that it accepts messages without
10331 .Ql Message-ID .
10333 .It Va message-inject-head
10334 A string to put at the beginning of each new message, followed by a newline.
10335 \*(OB The escape sequences tabulator
10336 .Ql \et
10337 and newline
10338 .Ql \en
10339 are understood (use the
10340 .Cm wysh
10341 prefix when
10342 .Ic set Ns
10343 ting the variable(s) instead).
10345 .It Va message-inject-tail
10346 A string to put at the end of each new message, followed by a newline.
10347 \*(OB The escape sequences tabulator
10348 .Ql \et
10349 and newline
10350 .Ql \en
10351 are understood (use the
10352 .Cm wysh
10353 prefix when
10354 .Ic set Ns
10355 ting the variable(s) instead).
10356 Also see
10357 .Va on-compose-leave .
10359 .It Va metoo
10360 \*(BO Usually, when an
10361 .Ic alias
10362 expansion contains the sender, the sender is removed from the expansion.
10363 Setting this option suppresses these removals.
10364 Note that a set
10365 .Va metoo
10366 also causes a
10367 .Ql -m
10368 option to be passed through to the
10369 .Va mta
10370 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
10371 this flag, no MTA is known which does not support it (for historical
10372 compatibility).
10374 .It Va mime-allow-text-controls
10375 \*(BO When sending messages, each part of the message is MIME-inspected
10376 in order to classify the
10377 .Ql Content-Type:
10379 .Ql Content-Transfer-Encoding:
10380 (see
10381 .Va mime-encoding )
10382 that is required to send this part over mail transport, i.e.,
10383 a computation rather similar to what the
10384 .Xr file 1
10385 command produces when used with the
10386 .Ql --mime
10387 option.
10389 This classification however treats text files which are encoded in
10390 UTF-16 (seen for HTML files) and similar character sets as binary
10391 octet-streams, forcefully changing any
10392 .Ql text/plain
10394 .Ql text/html
10395 specification to
10396 .Ql application/octet-stream :
10397 If that actually happens a yet unset charset MIME parameter is set to
10398 .Ql binary ,
10399 effectively making it impossible for the receiving MUA to automatically
10400 interpret the contents of the part.
10402 If this variable is set, and the data was unambiguously identified as
10403 text data at first glance (by a
10404 .Ql .txt
10406 .Ql .html
10407 file extension), then the original
10408 .Ql Content-Type:
10409 will not be overwritten.
10411 .It Va mime-alternative-favour-rich
10412 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
10413 HTML) will be preferred in favour of included plain text versions when
10414 displaying messages, provided that a handler exists which produces
10415 output that can be (re)integrated into \*(UA's normal visual display.
10417 .It Va mime-counter-evidence
10418 Normally the
10419 .Ql Content-Type:
10420 field is used to decide how to handle MIME parts.
10421 Some MUAs, however, do not use
10422 .Sx "The mime.types files"
10423 (also see
10424 .Sx "HTML mail and MIME attachments" )
10425 or a similar mechanism to correctly classify content, but specify an
10426 unspecific MIME type
10427 .Pf ( Ql application/octet-stream )
10428 even for plain text attachments.
10429 If this variable is set then \*(UA will try to re-classify such MIME
10430 message parts, if possible, for example via a possibly existing
10431 attachment filename.
10432 A non-empty value may also be given, in which case a number is expected,
10433 actually a carrier of bits, best specified as a binary value, like
10434 .Ql 0b1111 .
10436 .Bl -bullet -compact
10438 If bit two is set (counting from 1, decimal 2) then the detected
10439 .Ic mimetype
10440 will be carried along with the message and be used for deciding which
10441 MIME handler is to be used, for example;
10442 when displaying such a MIME part the part-info will indicate the
10443 overridden content-type by showing a plus sign
10444 .Ql + .
10446 If bit three is set (decimal 4) then the counter-evidence is always
10447 produced and a positive result will be used as the MIME type, even
10448 forcefully overriding the parts given MIME type.
10450 If bit four is set (decimal 8) as a last resort the actual content of
10451 .Ql application/octet-stream
10452 parts will be inspected, so that data which looks like plain text can be
10453 treated as such.
10454 This mode is even more relaxed when data is to be displayed to the user
10455 or used as a message quote (data consumers which mangle data for display
10456 purposes, which includes masking of control characters, for example).
10459 .It Va mime-encoding
10460 The MIME
10461 .Ql Content-Transfer-Encoding
10462 to use in outgoing text messages and message parts, where applicable
10463 (7-bit clean text messages are without an encoding if possible):
10465 .Bl -tag -compact -width ".It Ql _%%_"
10466 .It Ql 8bit
10467 .Pf (Or\0 Ql 8b . )
10468 8-bit transport effectively causes the raw data be passed through
10469 unchanged, but may cause problems when transferring mail messages over
10470 channels that are not ESMTP (RFC 1869) compliant.
10471 Also, several input data constructs are not allowed by the
10472 specifications and may cause a different transfer-encoding to be used.
10473 By established rules and popular demand occurrences of
10474 .Ql ^From_
10475 (see
10476 .Va mbox-rfc4155 )
10477 will be MBOXO quoted (prefixed with greater-than sign
10478 .Ql > )
10479 instead of causing a non-destructive encoding like
10480 .Ql quoted-printable
10481 to be chosen, unless context (like message signing) requires otherwise.
10482 .It Ql quoted-printable
10483 .Pf (Or\0 Ql qp . )
10484 Quoted-printable encoding is 7-bit clean and has the property that ASCII
10485 characters are passed through unchanged, so that an english message can
10486 be read as-is; it is also acceptable for other single-byte locales that
10487 share many characters with ASCII, for example ISO-8859-1.
10488 The encoding will cause a large overhead for messages in other character
10489 sets: for example it will require up to twelve (12) bytes to encode
10490 a single UTF-8 character of four (4) bytes.
10491 It is the default encoding.
10492 .It Ql base64
10493 .Pf (Or\0 Ql b64 . )
10494 This encoding is 7-bit clean and will always be used for binary data.
10495 This encoding has a constant input:output ratio of 3:4, regardless of
10496 the character set of the input data it will encode three bytes of input
10497 to four bytes of output.
10498 This transfer-encoding is not human readable without performing
10499 a decoding step.
10502 .It Va mime-force-sendout
10503 \*(BO\*(OP Whenever it is not acceptable to fail sending out messages
10504 because of non-convertible character content this variable may be set.
10505 It will, as a last resort, classify the part content as
10506 .Ql application/octet-stream .
10507 Please refer to the section
10508 .Sx "Character sets"
10509 for the complete picture of character set conversion, and
10510 .Sx "HTML mail and MIME attachments"
10511 for how to internally or externally handle part content.
10513 .It Va mimetypes-load-control
10514 Can be used to control which of
10515 .Sx "The mime.types files"
10516 are loaded: if the letter
10517 .Ql u
10518 is part of the option value, then the user's personal
10519 .Pa \*(vU
10520 file will be loaded (if it exists); likewise the letter
10521 .Ql s
10522 controls loading of the system wide
10523 .Pa \*(vS ;
10524 directives found in the user file take precedence, letter matching is
10525 case-insensitive.
10526 If this variable is not set \*(UA will try to load both files.
10527 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
10528 but they will be matched last (the order can be listed via
10529 .Ic mimetype ) .
10531 More sources can be specified by using a different syntax: if the
10532 value string contains an equals sign
10533 .Ql =
10534 then it is instead parsed as a comma-separated list of the described
10535 letters plus
10536 .Ql f=FILENAME
10537 pairs; the given filenames will be expanded and loaded, and their
10538 content may use the extended syntax that is described in the section
10539 .Sx "The mime.types files" .
10540 Directives found in such files always take precedence (are prepended to
10541 the MIME type cache).
10543 .It Va mta
10544 Select an alternate Mail-Transfer-Agent by either specifying the full
10545 pathname of an executable (a
10546 .Ql file://
10547 prefix may be given), or \*(OPally a SMTP aka SUBMISSION protocol URL \*(IN:
10549 .Dl submissions://[user[:password]@]server[:port]
10551 (\*(OU:
10552 .Ql [smtp://]server[:port] . )
10553 The default has been chosen at compile time.
10554 MTA data transfers are always performed in asynchronous child processes,
10555 and without supervision unless either the
10556 .Va sendwait
10557 or the
10558 .Va verbose
10559 variable is set.
10560 Also see
10561 .Va mta-bcc-ok .
10562 \*(OPally expansion of
10563 .Xr aliases 5
10564 can be performed by setting
10565 .Va mta-aliases .
10567 For testing purposes there is the
10568 .Ql test
10569 pseudo-MTA, which dumps to standard output or optionally to a file,
10570 and honours
10571 .Va mbox-fcc-and-pcc :
10572 .Bd -literal -offset indent
10573 $ echo text | \*(uA -:/ -Smta=test -s ubject ex@am.ple
10574 $ </dev/null \*(uA -:/ -Smta=test://./xy ex@am.ple
10577 For a file-based MTA it may be necessary to set
10578 .Va mta-argv0
10579 in in order to choose the right target of a modern
10580 .Xr mailwrapper 8
10581 environment.
10582 It will be passed command line arguments from several possible sources:
10583 from the variable
10584 .Va mta-arguments
10585 if set, from the command line if given and the variable
10586 .Va expandargv
10587 allows their use.
10588 Argument processing of the MTA will be terminated with a
10589 .Fl \&\&-
10590 separator.
10592 The otherwise occurring implicit usage of the following MTA command
10593 line arguments can be disabled by setting the boolean variable
10594 .Va mta-no-default-arguments
10595 (which will also disable passing
10596 .Fl \&\&-
10597 to the MTA):
10598 .Fl \&\&i
10599 (for not treating a line with only a dot
10600 .Ql \&.
10601 character as the end of input),
10602 .Fl \&\&m
10603 (shall the variable
10604 .Va metoo
10605 be set) and
10606 .Fl \&\&v
10607 (if the
10608 .Va verbose
10609 variable is set); in conjunction with the
10610 .Fl r
10611 command line option or
10612 .Va r-option-implicit
10613 .Fl \&\&f
10614 as well as possibly
10615 .Fl \&\&F
10616 will (not) be passed.
10618 \*(OPally \*(UA can send mail over SMTP aka SUBMISSION network
10619 connections to a single defined smart host by setting this variable to
10620 a SMTP or SUBMISSION URL (see
10621 .Sx "On URL syntax and credential lookup" ) .
10622 An authentication scheme can be specified via the variable chain
10623 .Va smtp-auth .
10624 Encrypted network connections are \*(OPally available, the section
10625 .Sx "Encrypted network communication"
10626 should give an overview and provide links to more information on this.
10627 Note that with some mail providers it may be necessary to set the
10628 .Va smtp-hostname
10629 variable in order to use a specific combination of
10630 .Va from ,
10631 .Va hostname
10633 .Va mta .
10634 Network communication socket timeouts are configurable via
10635 .Va socket-connect-timeout .
10636 All generated network traffic may be proxied over a SOCKS
10637 .Va socks-proxy ,
10638 it can be logged by setting
10639 .Va verbose
10640 twice.
10641 The following SMTP variants may be used:
10642 .Bl -bullet
10644 The plain SMTP protocol (RFC 5321) that normally lives on the
10645 server port 25 and requires setting the
10646 .Va smtp-use-starttls
10647 variable to enter a TLS encrypted session state.
10648 Assign a value like \*(IN
10649 .Ql smtp://[user[:password]@]server[:port]
10650 (\*(OU
10651 .Ql smtp://server[:port] )
10652 to choose this protocol.
10654 The so-called SMTPS which is supposed to live on server port 465
10655 and is automatically TLS secured.
10656 Unfortunately it never became a standardized protocol and may thus not
10657 be supported by your hosts network service database
10658 \(en in fact the port number has already been reassigned to other
10659 protocols!
10661 SMTPS is nonetheless a commonly offered protocol and thus can be
10662 chosen by assigning a value like \*(IN
10663 .Ql smtps://[user[:password]@]server[:port]
10664 (\*(OU
10665 .Ql smtps://server[:port] ) ;
10666 due to the mentioned problems it is usually necessary to explicitly
10667 specify the port as
10668 .Ql :465 ,
10669 however.
10671 The SUBMISSION protocol (RFC 6409) lives on server port 587 and
10672 is identically to the SMTP protocol from \*(UA's point of view;
10673 it requires setting
10674 .Va smtp-use-starttls
10675 to enter a TLS secured session state; e.g., \*(IN
10676 .Ql submission://[user[:password]@]server[:port] .
10678 The SUBMISSIONS protocol (RFC 8314) that lives on server port 465 and is
10679 TLS secured by default.
10680 It can be chosen by assigning a value like \*(IN
10681 .Ql submissions://[user[:password]@]server[:port] .
10682 Due to the problems mentioned for SMTPS above and the fact that
10683 SUBMISSIONS is new and a successor that lives on the same port as the
10684 historical engineering mismanagement named SMTPS, it is usually
10685 necessary to explicitly specify the port as
10686 .Ql :465 .
10689 .It Va mta-aliases
10690 \*(OP If set to a path pointing to a text file in valid MTA (Postfix)
10691 .Xr aliases 5
10692 format, the file is loaded and cached (manageable with
10693 .Ic mtaaliases ) ,
10694 and henceforth plain
10695 .Ql name
10696 (see
10697 .Va expandaddr )
10698 message receiver names are recursively expanded as a last expansion
10699 step, after the distribution lists which can be created with
10700 .Ic alias .
10701 Constraints on
10702 .Xr \&\&aliases 5
10703 content support: only local addresses (names) which are valid usernames
10704 .Pf ( Ql [a-z_][a-z0-9_-]*[$]? )
10705 are treated as expandable aliases, and \*(ID
10706 .Ql :include:/file/name
10707 directives are not supported.
10708 By including
10709 .Ql -name
10711 .Va expandaddr
10712 it can be asserted that only expanded names (mail addresses) are passed
10713 through to the MTA.
10715 .It Va mta-arguments
10716 Arguments to pass through to a file-based
10717 .Va mta
10718 (Mail-Transfer-Agent), parsed according to
10719 .Sx "Shell-style argument quoting"
10720 into an array of arguments which will be joined onto MTA options
10721 from other sources, for example
10722 .Ql \&? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
10724 .It Va mta-no-default-arguments
10725 \*(BO Avoids passing standard command line options to a file-based
10726 .Va mta
10727 (please see there).
10729 .It Va mta-no-receiver-arguments
10730 \*(BO By default all receiver addresses will be passed as command line
10731 options to a file-based
10732 .Va mta .
10733 Setting this variable disables this behaviour to aid those MTAs which
10734 employ special treatment of such arguments.
10735 Doing so can make it necessary to pass a
10736 .Fl \&\&t
10738 .Va mta-arguments ,
10739 to testify the MTA that it should use the passed message as a template.
10741 .It Va mta-argv0
10742 Many systems use a so-called
10743 .Xr mailwrapper 8
10744 environment to ensure compatibility with
10745 .Xr sendmail 1 .
10746 This works by inspecting the name that was used to invoke the mail
10747 delivery system.
10748 If this variable is set then the mailwrapper (the program that is
10749 actually executed when calling the file-based
10750 .Va mta )
10751 will treat its contents as that name.
10753 .It Va mta-bcc-ok
10754 \*(BO In violation of RFC 5322 some MTAs do not remove
10755 .Ql Bcc:
10756 header lines from transported messages after having noted the respective
10757 receivers for addressing purposes.
10758 (The MTAs Exim and Courier for example require the command line option
10759 .Fl \&\&t
10760 to enforce removal.)
10761 Unless this is set corresponding receivers are addressed by
10762 protocol-specific means or MTA command line options only, the header
10763 itself is stripped before being sent over the wire.
10764 .Mx Va netrc-lookup
10765 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
10766 \*(BO\*(IN\*(OP Used to control usage of the user's
10767 .Pa \*(VN
10768 file for lookup of account credentials, as documented in the section
10769 .Sx "On URL syntax and credential lookup"
10770 and for the command
10771 .Ic netrc ;
10772 the section
10773 .Sx "The .netrc file"
10774 documents the file format.
10775 Also see
10776 .Va netrc-pipe .
10778 .It Va netrc-pipe
10779 \*(IN\*(OP When
10780 .Pa \*(VN
10781 is loaded (see
10782 .Ic netrc
10784 .Va netrc-lookup )
10785 then \*(UA will read the output of a shell pipe instead of the user's
10786 .Pa \*(VN
10787 file if this variable is set (to the desired shell command).
10788 This can be used to, for example, store
10789 .Pa \*(VN
10790 in encrypted form:
10791 .Ql \&? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
10793 .It Va newfolders
10794 \*(OP If this variable has the value
10795 .Ql maildir ,
10796 newly created local folders will be in Maildir instead of MBOX format.
10798 .It Va newmail
10799 Checks for new mail in the current folder each time the prompt is shown.
10800 A Maildir folder must be re-scanned to determine if new mail has arrived.
10801 If this variable is set to the special value
10802 .Ql nopoll
10803 then a Maildir folder will not be rescanned completely, but only
10804 timestamp changes are detected.
10805 Maildir folders are \*(OPal.
10807 .It Va outfolder
10808 \*(BO Causes a non-absolute filename specified in
10809 .Va record ,
10810 as well as the sender-based filenames of the
10811 .Ic Copy ,
10812 .Ic Save ,
10813 .Ic Followup
10815 .Ic followup
10816 commands to be interpreted relative to the
10817 .Va folder
10818 directory rather than relative to the current directory.
10819 .Mx Va on-account-cleanup
10820 .It Va on-account-cleanup-ACCOUNT , Va on-account-cleanup
10821 Macro hook which will be called once an
10822 .Ic account
10823 is left, as the very last step before unrolling per-account
10824 .Ic localopts .
10825 This hook is run even in case of fatal errors, including those generated
10826 by switching to the account as such, and it is advisable to perform only
10827 absolutely necessary actions, like cleaning up
10828 .Ic alternates ,
10829 for example.
10830 The specialized form is used in favour of the generic one if found.
10832 .It Va on-compose-cleanup
10833 Macro hook which will be called after the message has been sent (or not,
10834 in case of failures), as the very last step before unrolling compose mode
10835 .Ic localopts .
10836 This hook is run even in case of fatal errors, and it is advisable to
10837 perform only absolutely necessary actions, like cleaning up
10838 .Ic alternates ,
10839 for example.
10841 For compose mode hooks that may affect the message content please see
10842 .Va on-compose-enter , on-compose-leave , on-compose-splice .
10843 \*(ID This hook exists because
10844 .Ic alias , alternates , commandalias , shortcut ,
10845 to name a few, are neither covered by
10846 .Ic localopts
10847 nor by
10848 .Cm local :
10849 changes applied in compose mode will continue to be in effect thereafter.
10852 .It Va on-compose-enter , on-compose-leave
10853 Macro hooks which will be called once compose mode is entered,
10854 and after composing has been finished, respectively;
10855 the exact order of the steps taken is documented for
10856 .Ic ~. ,
10857 one of the
10858 .Sx "COMMAND ESCAPES" .
10859 Context about the message being worked on can be queried via
10860 .Ic digmsg .
10861 .Ic localopts
10862 are enabled for these hooks, and changes on variables will be forgotten
10863 after the message has been sent.
10864 .Va on-compose-cleanup
10865 can be used to perform other necessary cleanup steps.
10867 Here is an example that injects a signature via
10868 .Va message-inject-tail ;
10869 instead using
10870 .Va on-compose-splice
10871 to simply inject the file of desire via
10872 .Ic ~<
10874 .Ic ~<!
10875 may be a better approach.
10876 .Bd -literal -offset indent
10877 define t_ocl {
10878   vput ! i cat ~/.mysig
10879   if $? -eq 0
10880      vput csop message-inject-tail trim-end $i
10881   end
10883   # Alternatively
10884   readctl create ~/.mysig
10885   if $? -eq 0
10886     readall i
10887     if $? -eq 0
10888       vput csop message-inject-tail trim-end $i
10889     end
10890     readctl remove ~/.mysig
10891   end
10893 set on-compose-leave=t_ocl
10897 .It Va on-compose-splice , on-compose-splice-shell
10898 These hooks run once the normal compose mode is finished, but before the
10899 .Va on-compose-leave
10900 macro hook is called etc.
10901 Both hooks will be executed in a subprocess, with their input and output
10902 connected to \*(UA such that they can act as if they would be an
10903 interactive user.
10904 The difference in between them is that the latter is a
10905 .Ev SHELL
10906 command, whereas the former is a normal
10907 .Ic define Ns
10908 d macro, but which is restricted to a small set of commands (the
10909 .Va verbose
10910 output of for example
10911 .Ic list
10912 will indicate said capability).
10913 .Ic localopts
10914 are enabled for these hooks (in the parent process), causing any setting
10915 to be forgotten after the message has been sent;
10916 .Va on-compose-cleanup
10917 can be used to perform other cleanup as necessary.
10919 During execution of these hooks \*(UA will temporarily forget whether it
10920 has been started in interactive mode, (a restricted set of)
10921 .Sx "COMMAND ESCAPES"
10922 will always be available, and for guaranteed reproducibilities sake
10923 .Va escape
10925 .Va ifs
10926 will be set to their defaults.
10927 The compose mode command
10928 .Ic ~^
10929 has been especially designed for scriptability (via these hooks).
10930 The first line the hook will read on its standard input is the protocol
10931 version of said command escape, currently
10932 .Dq 0 0 2 :
10933 backward incompatible protocol changes have to be expected.
10935 Care must be taken to avoid deadlocks and other false control flow:
10936 if both involved processes wait for more input to happen at the
10937 same time, or one does not expect more input but the other is stuck
10938 waiting for consumption of its output, etc.
10939 There is no automatic synchronization of the hook: it will not be
10940 stopped automatically just because it, e.g., emits
10941 .Ql ~x .
10942 The hooks will however receive a termination signal if the parent enters
10943 an error condition.
10944 \*(ID Protection against and interaction with signals is not yet given;
10945 it is likely that in the future these scripts will be placed in an
10946 isolated session, which is signalled in its entirety as necessary.
10947 .Bd -literal -offset indent
10948 define ocs_signature {
10949   read version
10950   echo '~< ~/.mysig' # '~<! fortune pathtofortunefile'
10952 set on-compose-splice=ocs_signature
10954 wysh set on-compose-splice-shell=$'\e
10955   read version;\e
10956   printf "hello $version!  Headers: ";\e
10957   echo \e'~^header list\e';\e
10958   read status result;\e
10959   echo "status=$status result=$result";\e
10960   '
10962 define ocsm {
10963   read version
10964   echo Splice protocol version is $version
10965   echo '~^h l'; read hl; vput csop es subs "${hl}" 0 1
10966   if "$es" != 2
10967     echoerr 'Cannot read header list'; echo '~x'; xit
10968   endif
10969   if "$hl" !%?case ' cc'
10970     echo '~^h i cc "Diet is your <mirr.or>"'; read es;\e
10971       vput csop es substring "${es}" 0 1
10972     if "$es" != 2
10973       echoerr 'Cannot insert Cc: header'; echo '~x'
10974       # (no xit, macro finishes anyway)
10975     endif
10976   endif
10978 set on-compose-splice=ocsm
10981 .It Va on-history-addition
10982 This hook will be called if an entry is about to be added to the
10983 .Ic history
10984 of the MLE, as documented in
10985 .Sx "On terminal control and line editor" .
10986 It will be called with three arguments: the first is the name of the
10987 input context (see
10988 .Ic bind ) ,
10989 the second is either an empty string or the matching
10990 .Va history-gabby
10991 type, and the third being the complete command line to be added.
10992 The entry will not be added to history if the hook uses a non-0
10993 .Ic return .
10994 \*(ID A future version will give the expanded command name as the third
10995 argument, followed by the tokenized command line as parsed in the
10996 remaining arguments, the first of which is the original unexpanded
10997 command name; i.e., one may do
10998 .Ql Ic shift Ns \| 4
10999 and will then be able to access the positional parameters as usual via
11000 .Va * , # , 1
11001 etc.
11003 .It Va on-main-loop-tick
11004 This hook will be called whenever the program's main event loop is
11005 about to read the next input line.
11006 Note variable and other changes it performs are not scoped as via
11007 .Ic localopts !
11009 .It Va on-program-exit
11010 This hook will be called when the program exits, whether via
11011 .Ic exit
11013 .Ic quit ,
11014 or because the send mode is done.
11015 .Sy Note:
11016 this runs late and so terminal settings etc. are already teared down.
11018 .It Va on-resend-cleanup
11019 \*(ID Identical to
11020 .Va on-compose-cleanup ,
11021 but is only triggered by
11022 .Ic resend .
11024 .It Va on-resend-enter
11025 \*(ID Identical to
11026 .Va on-compose-enter ,
11027 but is only triggered by
11028 .Ic resend ;
11029 currently there is no
11030 .Ic digmsg
11031 support, for example.
11033 .It Va page
11034 \*(BO If set, each message feed through the command given for
11035 .Ic pipe
11036 is followed by a formfeed character
11037 .Ql \ef .
11038 .Mx Va password
11039 .It Va password-USER@HOST , password-HOST , password
11040 \*(IN Variable chain that sets a password, which is used in case none has
11041 been given in the protocol and account-specific URL;
11042 as a last resort \*(UA will ask for a password on the user's terminal if
11043 the authentication method requires a password.
11044 Specifying passwords in a startup file is generally a security risk;
11045 the file should be readable by the invoking user only.
11046 .It Va password-USER@HOST
11047 \*(OU (see the chain above for \*(IN)
11048 Set the password for
11049 .Ql USER
11050 when connecting to
11051 .Ql HOST .
11052 If no such variable is defined for a host,
11053 the user will be asked for a password on standard input.
11054 Specifying passwords in a startup file is generally a security risk;
11055 the file should be readable by the invoking user only.
11057 .It Va piperaw
11058 \*(BO Send messages to the
11059 .Ic pipe
11060 command without performing MIME and character set conversions.
11062 .It Va pipe-EXTENSION
11063 Identical to
11064 .Va pipe-TYPE/SUBTYPE
11065 except that
11066 .Ql EXTENSION
11067 (normalized to lowercase using character mappings of the ASCII charset)
11068 denotes a file extension, for example
11069 .Ql xhtml .
11070 Handlers registered using this method take precedence.
11072 .It Va pipe-TYPE/SUBTYPE
11073 A MIME message part identified as
11074 .Ql TYPE/SUBTYPE
11075 (case-insensitive, normalized to lowercase using character mappings of
11076 the ASCII charset) is displayed or quoted,
11077 its text is filtered through the value of this variable interpreted as
11078 a shell command.
11079 Unless noted only parts displayable as inline plain text (see
11080 .Cd copiousoutput )
11081 are covered, other MIME parts will only be considered by and for
11082 .Ic mimeview .
11084 The special value question mark
11085 .Ql \&?
11086 forces interpretation of the message part as plain text, for example
11087 .Ql set pipe-application/xml=? .
11088 (This can also be achieved by adding a MIME type-marker via
11089 .Ic mimetype . )
11090 \*(OPally MIME type handlers may be defined via
11091 .Sx "The Mailcap files"
11092 to which should be referred to for documentation of flags like
11093 .Cd copiousoutput .
11094 Question mark is indeed a trigger character to indicate flags that
11095 adjust behaviour and usage of the rest of the value, the shell command,
11096 for example:
11097 .Bd -literal -offset indent
11098 ? set pipe-X/Y='?!++=? vim ${MAILX_FILENAME_TEMPORARY}'
11101 .Bl -tag -compact -width ".It Ql __"
11102 .It Ql *
11103 The command output can be reintegrated into this MUA's normal processing:
11104 .Cd copiousoutput .
11105 Implied when using a plain
11106 .Ql \& .
11107 .It Ql #
11108 Only use this handler for display, not for quoting a message:
11109 .Cd x-mailx-noquote .
11110 .It Ql &
11111 Run the command asynchronously, do not wait for the handler to exit:
11112 .Cd x-mailx-async .
11113 The standard output of the command will go to
11114 .Pa /dev/null .
11115 .It Ql \&!
11116 The command must be run on an interactive terminal, the terminal will
11117 temporarily be released for it to run:
11118 .Cd needsterminal .
11119 .It Ql +
11120 Request creation of a zero-sized temporary file, the absolute pathname
11121 of which will be made accessible via the environment variable
11122 .Ev MAILX_FILENAME_TEMPORARY :
11123 .Cd x-mailx-tmpfile .
11124 If given twice then the file will be unlinked automatically by \*(UA
11125 when the command loop is entered again at latest:
11126 .Cd x-mailx-tmpfile-unlink ;
11127 it is an error to use automatic deletion in conjunction with
11128 .Cd x-mailx-async .
11129 .It Ql =
11130 Normally the MIME part content is passed to the handler via standard
11131 input; with this the data will instead be written into
11132 .Ev MAILX_FILENAME_TEMPORARY
11133 .Pf ( Cd x-mailx-tmpfile-fill ) ,
11134 the creation of which is implied; in order to cause automatic deletion
11135 of the temporary file two plus signs
11136 .Ql ++
11137 still have to be used.
11138 .It Ql t
11139 Text type-marker: display this as normal plain text (for type-markers:
11140 .Sx "The mime.types files" ) .
11141 Identical to only giving plain
11142 .Ql \&? ,
11143 implies
11144 .Cd copiousoutput .
11145 .It Ql h
11146 \*(OP HTML type-marker: display via built-in HTML-to-text filter.
11147 Implies
11148 .Cd copiousoutput .
11149 .It Ql \&?
11150 To avoid ambiguities with normal shell command content another
11151 question mark can be used to forcefully terminate interpretation of
11152 remaining characters.
11153 (Any character not in this list will have the same effect.)
11156 Some information about the MIME part to be displayed is embedded into
11157 the environment of the shell command:
11159 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
11161 .It Ev MAILX_CONTENT
11162 The MIME content-type of the part, if known, the empty string otherwise.
11164 .It Ev MAILX_CONTENT_EVIDENCE
11166 .Va mime-counter-evidence
11167 includes the carry-around-bit (2), then this will be set to the detected
11168 MIME content-type; not only then identical to
11169 .Ev \&\&MAILX_CONTENT
11170 otherwise.
11172 .It Ev MAILX_EXTERNAL_BODY_URL
11173 MIME parts of type
11174 .Ql message/external-body access-type=url
11175 will store the access URL in this variable, it is empty otherwise.
11176 URL targets should not be activated automatically, without supervision.
11178 .It Ev MAILX_FILENAME
11179 The filename, if any is set, the empty string otherwise.
11181 .It Ev MAILX_FILENAME_GENERATED
11182 A random string.
11184 .It Ev MAILX_FILENAME_TEMPORARY
11185 If temporary file creation has been requested through the command prefix
11186 this variable will be set and contain the absolute pathname of the
11187 temporary file.
11189 .Mx Va pop3-auth
11190 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
11191 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
11192 Supported are the default
11193 .Ql plain ,
11194 \*(IN
11195 .Ql oauthbearer
11196 (see
11197 .Sx FAQ
11198 entry
11199 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" ) ,
11200 as well as \*(IN
11201 .Ql external
11203 .Ql externanon
11204 for TLS secured connections which pass a client certificate via
11205 .Va tls-config-pairs .
11206 There may be the \*(OPal method \*(IN
11207 .Ql gssapi .
11208 .Ql externanon
11209 does not need any user credentials,
11210 .Ql external
11212 .Ql gssapi
11213 need a
11214 .Va user ,
11215 the remains also require a
11216 .Va password .
11217 .Ql externanon
11218 solely builds upon the credentials passed via a client certificate,
11219 and is usually the way to go since tested servers do not actually follow
11220 RFC 4422, and fail if additional credentials are actually passed.
11221 Unless
11222 .Va pop3-no-apop
11223 is set the
11224 .Ql plain
11225 method will \*(OPally be replaced with APOP if possible (see there).
11226 .Mx Va pop3-bulk-load
11227 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
11228 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
11229 the messages, and only requests the message bodies on user request.
11230 For the POP3 protocol this means that the message headers will be
11231 downloaded twice.
11232 If this variable is set then \*(UA will download only complete messages
11233 from the given POP3 server(s) instead.
11234 .Mx Va pop3-keepalive
11235 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
11236 \*(OP POP3 servers close the connection after a period of inactivity;
11237 the standard requires this to be at least 10 minutes,
11238 but practical experience may vary.
11239 Setting this variable to a numeric value greater than
11240 .Ql 0
11241 causes a
11242 .Ql NOOP
11243 command to be sent each value seconds if no other operation is performed.
11244 .Mx Va pop3-no-apop
11245 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
11246 \*(BO\*(OP Unless this variable is set the MD5 based
11247 .Ql APOP
11248 authentication method will be used instead of a chosen
11249 .Ql plain
11250 .Va pop3-auth
11251 when connecting to a POP3 server that advertises support.
11252 The advantage of
11253 .Ql APOP
11254 is that only a single packet is sent for the user/password tuple.
11255 (Originally also that the password is not sent in clear text over the
11256 wire, but for one MD5 does not any longer offer sufficient security,
11257 and then today transport is almost ever TLS secured.)
11258 Note that
11259 .Va pop3-no-apop-HOST
11260 requires \*(IN.
11261 .Mx Va pop3-use-starttls
11262 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
11263 \*(BO\*(OP Causes \*(UA to issue a
11264 .Ql STLS
11265 command to make an unencrypted POP3 session TLS encrypted.
11266 This functionality is not supported by all servers,
11267 and is not used if the session is already encrypted by the POP3S method.
11268 Note that
11269 .Va pop3-use-starttls-HOST
11270 requires \*(IN.
11272 .It Va posix
11273 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
11274 where that deviates from standardized behaviour.
11275 It is automatically squared with the environment variable
11276 .Ev POSIXLY_CORRECT ,
11277 changing the one will adjust the other.
11278 The following behaviour is covered and enforced by this mechanism:
11280 .Bl -bullet -compact
11282 In non-interactive mode, any error encountered while loading resource
11283 files during program startup will cause a program exit, whereas in
11284 interactive mode such errors will stop loading of the currently loaded
11285 (stack of) file(s, i.e., recursively).
11286 These exits can be circumvented on a per-command base by using
11287 .Cm ignerr ,
11288 one of the
11289 .Sx "Command modifiers" ,
11290 for each command which shall be allowed to fail.
11292 .Ic alternates
11293 will replace the list of alternate addresses instead of appending to it.
11294 In addition alternates will only be honoured for any sort of message
11295 .Ic reply ,
11296 and for aliases.
11298 The variable inserting
11299 .Sx "COMMAND ESCAPES"
11300 .Ic ~A ,
11301 .Ic ~a ,
11302 .Ic ~I
11304 .Ic ~i
11305 will expand embedded character sequences
11306 .Ql \et
11307 horizontal tabulator and
11308 .Ql \en
11309 line feed.
11310 \*(ID For compatibility reasons this step will always be performed.
11312 Reading in messages via
11313 .Ic ~f
11314 .Pf ( Sx "COMMAND ESCAPES" )
11315 will use the
11316 .Ql type
11317 not the
11318 .Ql forward
11319 .Ic headerpick
11320 selection.
11322 Upon changing the active
11323 .Ic folder
11324 no summary of
11325 .Ic headers
11326 will be displayed even if
11327 .Va header
11328 is set.
11330 Setting
11331 .Va ignoreeof
11332 implies the behaviour described by
11333 .Va dot .
11335 The variable
11336 .Va keep
11337 is extended to cover any empty mailbox, not only empty
11338 .Mx -sx
11339 .Sx "primary system mailbox" Ns
11340 es: they will be removed when they are left in empty state otherwise.
11342 Each command has an exit
11343 .Va \&?
11344 and error
11345 .Va \&!
11346 status that overwrites that of the last command.
11347 In POSIX mode the program exit status will signal failure regardless
11348 unless all messages were successfully sent out to the
11349 .Va mta ;
11350 also see
11351 .Va sendwait .
11354 .It Va print-alternatives
11355 \*(BO When a MIME message part of type
11356 .Ql multipart/alternative
11357 is displayed and it contains a subpart of type
11358 .Ql text/plain ,
11359 other parts are normally discarded.
11360 Setting this variable causes all subparts to be displayed,
11361 just as if the surrounding part was of type
11362 .Ql multipart/mixed .
11364 .It Va prompt
11365 The string used as a prompt in interactive mode.
11366 Whenever the variable is evaluated the value is treated as if specified
11367 within dollar-single-quotes (see
11368 .Sx "Shell-style argument quoting" ) .
11369 This (post-assignment, i.e., second) expansion can be used to embed
11370 status information, for example
11371 .Va \&? ,
11372 .Va \&! ,
11373 .Va account
11375 .Va mailbox-display .
11377 In order to embed characters which should not be counted when
11378 calculating the visual width of the resulting string, enclose the
11379 characters of interest in a pair of reverse solidus escaped brackets:
11380 .Ql \e[\eE[0m\e] ;
11381 a slot for coloured prompts is also available with the \*(OPal command
11382 .Ic colour .
11383 Prompting may be prevented by setting this to the null string
11384 (aka\|
11385 .Ql set noprompt ) .
11387 .It Va prompt2
11388 This string is used for secondary prompts, but is otherwise identical to
11389 .Va prompt .
11390 The default is
11391 .Ql ..\0 .
11393 .It Va quiet
11394 \*(BO Suppresses the printing of the version when first invoked.
11396 .It Va quote
11397 If set messages processed by variants of
11398 .Ic followup
11400 .Ic reply
11401 will start with the original message, lines of which prefixed by
11402 .Va indentprefix ,
11403 taking into account
11404 .Va quote-chars
11406 .Va quote-fold .
11407 No headers will be quoted when set without value or for
11408 .Ql noheading ,
11410 .Ql headers
11412 .Ql type
11413 .Ic headerpick
11414 selection will be included in the quote,
11415 .Ql allbodies
11416 embeds the (body) contents of all MIME parts, and
11417 .Ql allheaders
11418 also includes all headers.
11419 The quoted message will be enclosed by the expansions of
11420 .Va quote-inject-head
11422 .Va quote-inject-tail .
11423 Also see
11424 .Va quote-add-cc ,
11425 .Va quote-as-attachment
11427 .Ic ~Q ,
11428 one of the
11429 .Sx "COMMAND ESCAPES" .
11431 .It Va quote-add-cc
11432 \*(BO Whether senders of messages quoted via
11433 .Ic ~Q
11434 shall be made members of the carbon copies
11435 .Ql Cc:
11436 list.
11438 .It Va quote-as-attachment
11439 \*(BO Add the original message in its entirety as a
11440 .Ql message/rfc822
11441 MIME attachment when replying to a message.
11442 Note this works regardless of the setting of
11443 .Va quote .
11445 .It Va quote-chars
11446 Can be set to a string consisting of non-whitespace ASCII characters
11447 which shall be treated as quotation leaders, the default being
11448 .Ql >|}: .
11450 .It Va quote-fold
11451 \*(OP Can be set in addition to
11452 .Va indentprefix ,
11453 and creates a more fancy quotation in that leading quotation characters
11454 .Pf ( Va quote-chars )
11455 are compressed and overlong lines are folded.
11456 .Va \&\&quote-fold
11457 can be set to either one, two or three (space separated) numeric values,
11458 which are interpreted as the maximum (goal) and the minimum line length,
11459 respectively, in a spirit rather equal to the
11460 .Xr fmt 1
11461 program, but line- instead of paragraph-based.
11462 The third value is used as the maximum line length instead of the first
11463 if no better break point can be found; it is ignored unless it is larger
11464 than the minimum and smaller than the maximum.
11465 If not set explicitly the minimum will reflect the goal algorithmically.
11466 The goal cannot be smaller than the length of
11467 .Va indentprefix
11468 plus some additional pad; necessary adjustments take place silently.
11471 .It Va quote-inject-head , quote-inject-tail
11472 The strings to put before and after the text of a
11473 .Va quote Ns
11474 d message, if non-empty, and respectively.
11475 The former defaults to
11476 .Ql %f wrote:\en\en .
11477 Special format directives will be expanded if possible, and if so
11478 configured the output will be folded according to
11479 .Va quote-fold .
11480 Format specifiers in the given strings start with a percent sign
11481 .Ql %
11482 and expand values of the original message, unless noted otherwise.
11483 Note that names and addresses are not subject to the setting of
11484 .Va showto .
11485 Valid format specifiers are:
11487 .Bl -tag -compact -width ".It Ql _%%_"
11488 .It Ql %%
11489 A plain percent sign.
11490 .It Ql %a
11491 The address(es) of the sender(s).
11492 .It Ql %d
11493 The date found in the
11494 .Ql Date:
11495 header of the message when
11496 .Va datefield
11497 is set (the default), otherwise the date when the message was received.
11498 Formatting can be controlled by assigning a
11499 .Xr strftime 3
11500 format string to
11501 .Va datefield
11502 (and
11503 .Va datefield-markout-older ) .
11504 .It Ql %f
11505 The full name(s) (name and address, as given) of the sender(s).
11506 .It Ql %i
11508 .Ql Message-ID: .
11509 .It Ql %n
11510 The real name(s) of the sender(s) if there is one and
11511 .Va showname
11512 allows usage, the address(es) otherwise.
11513 .It Ql %r
11514 The senders real name(s) if there is one, the address(es) otherwise.
11517 .It Va r-option-implicit
11518 \*(BO Setting this option evaluates the contents of
11519 .Va from
11520 (or, if that contains multiple addresses,
11521 .Va sender )
11522 and passes the results onto the used (file-based) MTA as described for the
11523 .Fl r
11524 option (empty argument case).
11526 .It Va recipients-in-cc
11527 \*(BO When doing a
11528 .Ic reply ,
11529 the original
11530 .Ql From:
11532 .Ql To:
11533 as well as addressees which possibly came in via
11534 .Ql Reply-To:
11536 .Ql Mail-Followup-To:
11537 are by default merged into the new
11538 .Ql To: .
11539 If this variable is set a sensitive algorithm tries to place in
11540 .Ql To:
11541 only the sender of the message being replied to, others are placed in
11542 .Ql Cc: .
11544 .It Va record
11545 Unless this variable is defined, no copies of outgoing mail will be saved.
11546 If defined it gives the pathname, subject to the usual
11547 .Sx "Filename transformations" ,
11548 of a folder where all new, replied-to or forwarded messages are saved:
11549 when saving to this folder fails the message is not sent, but instead
11550 .Va save Ns
11551 d to
11552 .Ev DEAD .
11553 The standard defines that relative (fully expanded) paths are to be
11554 interpreted relative to the current directory
11555 .Pf ( Ic cwd ) ,
11556 to force interpretation relative to
11557 .Va folder
11558 .Va outfolder
11559 needs to be set in addition.
11561 .It Va record-files
11562 \*(BO If this variable is set the meaning of
11563 .Va record
11564 will be extended to cover messages which target only file and pipe
11565 recipients (see
11566 .Va expandaddr ) .
11567 These address types will not appear in recipient lists unless
11568 .Va add-file-recipients
11569 is also set.
11571 .It Va record-resent
11572 \*(BO If this variable is set the meaning of
11573 .Va record
11574 will be extended to also cover the
11575 .Ic resend
11577 .Ic Resend
11578 commands.
11580 .It Va reply-in-same-charset
11581 \*(BO If this variable is set \*(UA first tries to use the same
11582 character set of the original message for replies.
11583 If this fails, the mechanism described in
11584 .Sx "Character sets"
11585 is evaluated as usual.
11587 .It Va reply-strings
11588 Can be set to a comma-separated list of (case-insensitive according to
11589 ASCII rules) strings which shall be recognized in addition to the
11590 built-in strings as
11591 .Ql Subject:
11592 reply message indicators \(en built-in are
11593 .Ql Re: ,
11594 which is mandated by RFC 5322, as well as the german
11595 .Ql Aw: ,
11596 .Ql Antw: ,
11597 and the
11598 .Ql Wg:
11599 which often has been seen in the wild;
11600 I.e., the separating colon has to be specified explicitly.
11602 .It Va reply-to
11603 A list of addresses to put into the
11604 .Ql Reply-To:
11605 field of the message header.
11606 Members of this list are handled as if they were in the
11607 .Ic alternates
11608 list.
11609 .It Va replyto
11610 \*(OB Variant of
11611 .Va reply-to .
11613 .It Va reply-to-honour
11614 Controls whether a
11615 .Ql Reply-To:
11616 header is honoured when replying to a message via
11617 .Ic reply
11619 .Ic Lreply .
11620 This is a
11621 .Mx -sx
11622 .Sx quadoption ;
11623 if set without a value it defaults to
11624 .Dq yes .
11626 .It Va reply-to-swap-in
11627 Standards like DKIM and (in conjunction with) DMARC caused many
11628 .Sx "Mailing lists"
11629 to use sender address rewriting in the style of
11630 .Ql Name via List <list@address> ,
11631 where the original sender address often being placed in
11632 .Ql Reply-To: .
11633 If this is set and a
11634 .Ql Reply-To:
11635 exists, and consists of only one addressee (!), then that is used in
11636 place of the pretended sender.
11637 This works independently from
11638 .Va reply-to-honour .
11639 The optional value, a comma-separated list of strings, offers more
11640 fine-grained control on when swapping shall be used; for now supported is
11641 .Va mlist ,
11642 here swapping occurs if the sender is a mailing-list as defined by
11643 .Ic mlist .
11645 .It Va rfc822-body-from_
11646 \*(BO This variable can be used to force displaying a so-called
11647 .Ql From_
11648 line for messages that are embedded into an envelope mail via the
11649 .Ql message/rfc822
11650 MIME mechanism, for more visual convenience, also see
11651 .Va mbox-rfc4155 .
11653 .It Va save
11654 \*(BO Enable saving of (partial) messages in
11655 .Ev DEAD
11656 upon interrupt or delivery error.
11658 .It Va screen
11659 The number of lines that represents a
11660 .Dq screenful
11661 of lines, used in
11662 .Ic headers
11663 summary display,
11664 .Ic from
11665 .Ic search Ns
11666 ing, message
11667 .Ic top Ns
11668 line display and scrolling via
11669 .Ic z .
11670 If this variable is not set \*(UA falls back to a calculation based upon
11671 the detected terminal window size and the baud rate: the faster the
11672 terminal, the more will be shown.
11673 Overall screen dimensions and pager usage is influenced by the
11674 environment variables
11675 .Ev COLUMNS
11677 .Ev LINES
11678 and the variable
11679 .Va crt .
11681 .It Va searchheaders
11682 \*(BO Expand message list specifiers in the form
11683 .Ql /x:y
11684 to all messages containing the substring
11685 .Dq y
11686 in the header field
11687 .Ql x .
11688 The string search is case insensitive.
11690 .It Va sendcharsets
11691 \*(OP A comma-separated list of character set names that can be used in
11692 outgoing internet mail.
11693 The value of the variable
11694 .Va charset-8bit
11695 is automatically appended to this list of character sets.
11696 If no character set conversion capabilities are compiled into \*(UA then
11697 the only supported charset is
11698 .Va ttycharset .
11699 Also see
11700 .Va sendcharsets-else-ttycharset
11701 and refer to the section
11702 .Sx "Character sets"
11703 for the complete picture of character set conversion in \*(UA.
11705 .It Va sendcharsets-else-ttycharset
11706 \*(BO\*(OP If this variable is set, but
11707 .Va sendcharsets
11708 is not, then \*(UA acts as if
11709 .Va sendcharsets
11710 had been set to the value of the variable
11711 .Va ttycharset .
11712 In effect this combination passes through the message data in the
11713 character set of the current locale encoding:
11714 therefore mail message text will be (assumed to be) in ISO-8859-1
11715 encoding when send from within a ISO-8859-1 locale, and in UTF-8
11716 encoding when send from within an UTF-8 locale.
11718 The 8-bit fallback
11719 .Va charset-8bit
11720 never comes into play as
11721 .Va ttycharset
11722 is implicitly assumed to be 8-bit and capable to represent all files the
11723 user may specify (as is the case when no character set conversion
11724 support is available in \*(UA and the only supported character set is
11725 .Va ttycharset ,
11727 .Sx "Character sets" ) .
11728 This might be a problem for scripts which use the suggested
11729 .Ql LC_ALL=C
11730 setting, since in this case the character set is US-ASCII by definition,
11731 so that it is better to also override
11732 .Va ttycharset ,
11733 then; and/or do something like the following in the resource file:
11734 .Bd -literal -offset indent
11735 # Avoid ASCII "propagates to 8-bit" when scripting
11736 \eif ! t && "$LC_ALL" != C && "$LC_CTYPE" != C
11737   \eset sendcharsets-else-ttycharset
11738 \eend
11741 .It Va sender
11742 An address that is put into the
11743 .Ql Sender:
11744 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
11745 responsible for the actual transmission of the message.
11746 This field should normally not be used unless the
11747 .Va from
11748 field contains more than one address, on which case it is required.
11749 \*(ID Please expect automatic management of the
11750 .Va from
11752 .Va sender
11753 relationship.
11754 Dependent on the context this address is handled as if it were in
11755 the list of
11756 .Ic alternates .
11757 Also see
11758 .Fl r ,
11759 .Va r-option-implicit .
11760 .It Va sendmail
11761 \*(OB Predecessor of
11762 .Va mta .
11763 .It Va sendmail-arguments
11764 \*(OB Predecessor of
11765 .Va mta-arguments .
11766 .It Va sendmail-no-default-arguments
11767 \*(OB\*(BO Predecessor of
11768 .Va mta-no-default-arguments .
11769 .It Va sendmail-progname
11770 \*(OB Predecessor of
11771 .Va mta-argv0 .
11773 .It Va sendwait
11774 Sending messages to the chosen
11775 .Va mta
11776 or to command-pipe receivers (see
11777 .Sx "On sending mail, and non-interactive mode" )
11778 will be performed asynchronously.
11779 This means that only startup errors of the respective program will be
11780 recognizable, but no delivery errors.
11781 Also, no guarantees can be made as to when the respective program will
11782 actually run, as well as to when they will have produced output.
11784 If this variable is set then child program exit is waited for, and its
11785 exit status code is used to decide about success.
11786 Remarks: in conflict with the POSIX standard this variable is built-in
11787 to be initially set.
11788 Another difference is that it can have a value, which is interpreted as
11789 a comma-separated list of case-insensitive strings naming specific
11790 subsystems for which synchronousness shall be ensured (only).
11791 Possible values are
11792 .Ql mta
11794 .Va mta
11795 delivery, and
11796 .Ql pcc
11797 for command-pipe receivers.
11799 .It Va showlast
11800 \*(BO This setting causes \*(UA to start at the last message
11801 instead of the first one when opening a mail folder, as well as with
11802 .Ic from
11804 .Ic headers .
11806 .It Va showname
11807 \*(BO Causes \*(UA to use the sender's real name instead of the plain
11808 address in the header field summary and in message specifications.
11810 .It Va showto
11811 \*(BO Causes the recipient of the message to be shown in the header
11812 summary if the message was sent by the user.
11814 .It Va Sign
11815 The value backing
11816 .Ic ~A ,
11817 one of the
11818 .Sx "COMMAND ESCAPES" .
11819 Also see
11820 .Va message-inject-tail ,
11821 .Va on-compose-leave
11823 .Va on-compose-splice .
11825 .It Va sign
11826 The value backing
11827 .Ic ~a ,
11828 one of the
11829 .Sx "COMMAND ESCAPES" .
11830 Also see
11831 .Va message-inject-tail ,
11832 .Va on-compose-leave
11834 .Va on-compose-splice .
11836 .It Va signature
11837 \*(OB Please use
11838 .Va on-compose-splice
11840 .Va on-compose-splice-shell
11842 .Va on-compose-leave
11843 and (if necessary)
11844 .Va message-inject-tail
11845 instead!
11847 .It Va skipemptybody
11848 \*(BO If an outgoing message has an empty first or only message part, do
11849 not send, but discard it, successfully (also see the command line option
11850 .Fl E ) .
11853 .It Va smime-ca-dir , smime-ca-file
11854 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
11855 Enhanced Mail) for the purpose of verification of S/MIME signed messages.
11856 .Va tls-ca-dir
11857 documents the necessary preparation steps to use the former.
11858 The set of CA certificates which are built into the TLS library can
11859 be explicitly turned off by setting
11860 .Va smime-ca-no-defaults ,
11861 and further fine-tuning is possible via
11862 .Va smime-ca-flags .
11864 .It Va smime-ca-flags
11865 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
11866 storage, and the certificate verification that is used.
11867 The actual values and their meanings are documented for
11868 .Va tls-ca-flags .
11870 .It Va smime-ca-no-defaults
11871 \*(BO\*(OP Do not load the default CA locations that are built into the
11872 used to TLS library to verify S/MIME signed messages.
11873 .Mx Va smime-cipher
11874 .It Va smime-cipher-USER@HOST , smime-cipher
11875 \*(OP Specifies the cipher to use when generating S/MIME encrypted
11876 messages (for the specified account).
11877 RFC 5751 mandates a default of
11878 .Ql aes128
11879 (AES-128 CBC).
11880 Possible values are (case-insensitive and) in decreasing cipher strength:
11881 .Ql aes256
11882 (AES-256 CBC),
11883 .Ql aes192
11884 (AES-192 CBC),
11885 .Ql aes128
11886 (AES-128 CBC),
11887 .Ql des3
11888 (DES EDE3 CBC, 168 bits; default if
11889 .Ql aes128
11890 is not available) and
11891 .Ql des
11892 (DES CBC, 56 bits).
11894 The actually available cipher algorithms depend on the cryptographic
11895 library that \*(UA uses.
11896 \*(OP Support for more cipher algorithms may be available through
11897 dynamic loading via
11898 .Xr EVP_get_cipherbyname 3
11899 (OpenSSL) if \*(UA has been compiled to support this.
11901 .It Va smime-crl-dir
11902 \*(OP Specifies a directory that contains files with CRLs in PEM format
11903 to use when verifying S/MIME messages.
11905 .It Va smime-crl-file
11906 \*(OP Specifies a file that contains a CRL in PEM format to use when
11907 verifying S/MIME messages.
11909 .It Va smime-encrypt-USER@HOST
11910 \*(OP If this variable is set, messages send to the given receiver are
11911 encrypted before sending.
11912 The value of the variable must be set to the name of a file that
11913 contains a certificate in PEM format.
11915 If a message is sent to multiple recipients,
11916 each of them for whom a corresponding variable is set will receive an
11917 individually encrypted message;
11918 other recipients will continue to receive the message in plain text
11919 unless the
11920 .Va smime-force-encryption
11921 variable is set.
11922 It is recommended to sign encrypted messages, i.e., to also set the
11923 .Va smime-sign
11924 variable.
11925 .Va content-description-smime-message
11926 will be inspected for messages which become encrypted.
11928 .It Va smime-force-encryption
11929 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
11931 .It Va smime-sign
11932 \*(BO\*(OP S/MIME sign outgoing messages with the user's
11933 .Pf ( Va from )
11934 private key and include the users certificate as a MIME attachment.
11935 Signing a message enables a recipient to verify that the sender used
11936 a valid certificate,
11937 that the email addresses in the certificate match those in the message
11938 header and that the message content has not been altered.
11939 It does not change the message text,
11940 and people will be able to read the message as usual.
11941 .Va content-description-smime-signature
11942 will be inspected.
11943 Also see
11944 .Va smime-sign-cert , smime-sign-include-certs
11946 .Va smime-sign-digest .
11947 .Mx Va smime-sign-cert
11948 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
11949 \*(OP Points to a file in PEM format.
11950 For the purpose of signing and decryption this file needs to contain the
11951 user's private key, followed by his certificate.
11953 For message signing
11954 .Ql USER@HOST
11955 is always derived from the value of
11956 .Va from
11957 (or, if that contains multiple addresses,
11958 .Va sender ) .
11959 For the purpose of encryption the recipients public encryption key
11960 (certificate) is expected; the command
11961 .Ic certsave
11962 can be used to save certificates of signed messages (the section
11963 .Sx "Signed and encrypted messages with S/MIME"
11964 gives some details).
11965 This mode of operation is usually driven by the specialized form.
11967 When decrypting messages the account is derived from the recipient
11968 fields
11969 .Pf ( Ql To:
11971 .Ql Cc: )
11972 of the message, which are searched for addresses for which such
11973 a variable is set.
11974 \*(UA always uses the first address that matches,
11975 so if the same message is sent to more than one of the user addresses
11976 using different encryption keys, decryption might fail.
11978 Password-encrypted keys may be used for signing and decryption.
11979 Automated password lookup is possible via the
11980 .Dq pseudo-hosts
11981 .Ql USER@HOST.smime-cert-key
11982 for the private key, and
11983 .Ql USER@HOST.smime-cert-cert
11984 for the certificate stored in the same file.
11985 For example, the hypothetical address
11986 .Ql bob@exam.ple
11987 could be driven with a private key / certificate pair path defined in
11988 .Va \&\&smime-sign-cert-bob@exam.ple ,
11989 and the needed passwords would then be looked up as
11990 .Ql bob@exam.ple.smime-cert-key
11992 .Ql bob@exam.ple.smime-cert-cert .
11993 When decrypting the value of
11994 .Va from
11995 will be tried as a fallback to provide the necessary
11996 .Ql USER@HOST .
11997 To include intermediate certificates, use
11998 .Va smime-sign-include-certs .
11999 The possible password sources are documented in
12000 .Sx "On URL syntax and credential lookup" .
12001 .Mx Va smime-sign-digest
12002 .It Va smime-sign-digest-USER@HOST , smime-sign-digest
12003 \*(OP Specifies the message digest to use when signing S/MIME messages.
12004 Please remember that for this use case
12005 .Ql USER@HOST
12006 refers to the variable
12007 .Va from
12008 (or, if that contains multiple addresses,
12009 .Va sender ) .
12010 The available algorithms depend on the used cryptographic library, but
12011 at least one usable built-in algorithm is ensured as a default.
12012 If possible the standard RFC 5751 will be violated by using
12013 .Ql SHA512
12014 instead of the mandated
12015 .Ql SHA1
12016 due to security concerns.
12017 This variable is ignored for very old (released before 2010)
12018 cryptographic libraries which do not offer the necessary interface:
12019 it will be logged if that happened.
12021 \*(UA will try to add built-in support for the following message
12022 digests, names are case-insensitive:
12023 .Ql BLAKE2b512 ,
12024 .Ql BLAKE2s256 ,
12025 .Ql SHA3-512 ,
12026 .Ql SHA3-384 ,
12027 .Ql SHA3-256 ,
12028 .Ql SHA3-224 ,
12029 as well as the widely available
12030 .Ql SHA512 ,
12031 .Ql SHA384 ,
12032 .Ql SHA256 ,
12033 .Ql SHA224 ,
12034 and the proposed insecure
12035 .Ql SHA1 ,
12036 finally
12037 .Ql MD5 .
12038 More digests may \*(OPally be available through dynamic loading via the
12039 OpenSSL function
12040 .Xr EVP_get_digestbyname 3 .
12041 .Mx Va smime-sign-include-certs
12042 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
12043 \*(OP If used, this is supposed to a consist of a comma-separated list
12044 of files, each of which containing a single certificate in PEM format to
12045 be included in the S/MIME message in addition to the
12046 .Va smime-sign-cert
12047 certificate.
12048 This can be used to include intermediate certificates of the certificate
12049 authority, in order to allow the receiver's S/MIME implementation to
12050 perform a verification of the entire certificate chain, starting from
12051 a local root certificate, over the intermediate certificates, down to the
12052 .Va smime-sign-cert .
12053 Even though top level certificates may also be included in the chain,
12054 they will not be used for the verification on the receiver's side.
12056 For the purpose of the mechanisms involved here,
12057 .Ql USER@HOST
12058 refers to the content of the internal variable
12059 .Va from
12060 (or, if that contains multiple addresses,
12061 .Va sender ) .
12062 The pseudo-host
12063 .Ql USER@HOST.smime-include-certs
12064 will be used for performing password lookups for these certificates,
12065 shall they have been given one, therefore the lookup can be automated
12066 via the mechanisms described in
12067 .Sx "On URL syntax and credential lookup" .
12068 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
12069 \*(OB\*(OP Predecessor(s) of
12070 .Va smime-sign-digest .
12071 .It Va smtp
12072 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
12073 .Va mta .
12074 \*(ID For compatibility reasons a set
12075 .Va smtp
12076 is used in preference of
12077 .Va mta .
12078 .Mx Va smtp-auth
12079 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
12080 \*(OP Variable chain that controls the SMTP
12081 .Va mta
12082 authentication method, possible values are
12083 .Ql none
12084 (\*(OU default),
12085 .Ql plain
12086 (\*(IN default),
12087 .Ql login ,
12088 \*(IN
12089 .Ql oauthbearer
12090 (see
12091 .Sx FAQ
12092 entry
12093 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" )
12094 as well as \*(IN
12095 .Ql external
12097 .Ql externanon
12098 for TLS secured connections which pass a client certificate via
12099 .Va tls-config-pairs .
12100 There may be the \*(OPal methods
12101 .Ql cram-md5
12103 .Ql gssapi .
12104 .Ql none
12106 .Ql externanon
12107 do not need any user credentials,
12108 .Ql external
12110 .Ql gssapi
12111 require a user name, and all other methods require a
12112 .Va user
12113 name and a
12114 .Va password .
12115 .Ql externanon
12116 solely builds upon the credentials passed via a client certificate,
12117 and is usually the way to go since tested servers do not actually follow
12118 RFC 4422 aka RFC 4954, and fail if additional credentials are passed.
12119 Also see
12120 .Va mta .
12121 Note that
12122 .Va smtp-auth-HOST
12123 is \*(IN.
12124 (\*(OU Requires
12125 .Va smtp-auth-password
12127 .Va smtp-auth-user .
12128 Note for
12129 .Va smtp-auth-USER@HOST :
12130 may override dependent on sender address in the variable
12131 .Va from . )
12132 .It Va smtp-auth-password
12133 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
12134 If the authentication method requires a password, but neither
12135 .Va smtp-auth-password
12136 nor a matching
12137 .Va smtp-auth-password-USER@HOST
12138 can be found,
12139 \*(UA will ask for a password on the user's terminal.
12140 .It Va smtp-auth-password-USER@HOST
12141 \*(OU Overrides
12142 .Va smtp-auth-password
12143 for specific values of sender addresses, dependent upon the variable
12144 .Va from .
12145 .It Va smtp-auth-user
12146 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
12147 If the authentication method requires a user name, but neither
12148 .Va smtp-auth-user
12149 nor a matching
12150 .Va smtp-auth-user-USER@HOST
12151 can be found,
12152 \*(UA will ask for a user name on the user's terminal.
12153 .It Va smtp-auth-user-USER@HOST
12154 \*(OU Overrides
12155 .Va smtp-auth-user
12156 for specific values of sender addresses, dependent upon the variable
12157 .Va from .
12159 .It Va smtp-hostname
12160 \*(OP\*(IN Normally \*(UA uses the variable
12161 .Va from
12162 to derive the necessary
12163 .Ql USER@HOST
12164 information in order to issue a
12165 .Ql MAIL FROM:<>
12166 SMTP
12167 .Va mta
12168 command.
12169 Setting
12170 .Va smtp-hostname
12171 can be used to use the
12172 .Ql USER
12173 from the SMTP account
12174 .Pf ( Va mta
12175 or the
12176 .Va user
12177 variable chain)
12178 and the given
12179 .Ql HOST
12180 .Pf ( Va hostname
12181 if the empty string is given, or the local hostname as a last resort).
12182 This often allows using an address that is itself valid but hosted by
12183 a provider other than from which (in
12184 .Va from )
12185 the message is sent.
12186 Setting this variable also influences generated
12187 .Ql Message-ID:
12189 .Ql Content-ID:
12190 header fields.
12191 If the \*(OPal IDNA support is available (see
12192 .Va idna-disable )
12193 variable assignment is aborted when a necessary conversion fails.
12194 .Mx Va smtp-use-starttls
12195 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
12196 \*(BO\*(OP Causes \*(UA to issue a
12197 .Ql STARTTLS
12198 command to make an SMTP
12199 .Va mta
12200 session TLS encrypted, i.e., to enable transport layer security.
12202 .It Va socket-connect-timeout
12203 \*(OP A positive number that defines the timeout to wait for
12204 establishing a socket connection before forcing
12205 .Va ^ERR Ns -TIMEDOUT .
12206 .Mx Va socks-proxy
12207 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
12208 \*(OP If set to the URL of a SOCKS5 server then all network activities
12209 are proxied through it, except for the single DNS name lookup necessary
12210 to resolve the proxy URL (unnecessary when given an already resolved IP
12211 address).
12212 It is automatically squared with the environment variable
12213 .Ev SOCKS5_PROXY ,
12214 changing the one will adjust the other.
12215 This example creates a local SOCKS5 proxy on port 10000 that forwards to
12216 the machine
12217 .Ql HOST
12218 (with identity
12219 .Ql USER ) ,
12220 and from which actual network traffic happens:
12221 .Bd -literal -offset indent
12222 $ ssh -D 10000 USER@HOST
12223 $ \*(uA -Ssocks-proxy=[socks5://]localhost:10000
12224 # or =localhost:10000; no local DNS: =127.0.0.1:10000
12227 .It Va spam-interface
12228 \*(OP In order to use any of the spam-related commands (like
12229 .Ic spamrate )
12230 the desired spam interface must be defined by setting this variable.
12231 Please refer to the manual section
12232 .Sx "Handling spam"
12233 for the complete picture of spam handling in \*(UA.
12234 All or none of the following interfaces may be available:
12235 .Bl -tag -width ".It Ql _ilte_"
12236 .It Ql spamc
12237 Interaction with
12238 .Xr spamc 1
12239 from the
12240 .Xr spamassassin 1
12241 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
12242 suite.
12243 Different to the generic filter interface \*(UA will automatically add
12244 the correct arguments for a given command and has the necessary
12245 knowledge to parse the program's output.
12246 A default value for
12247 .Va spamc-command
12248 will have been compiled into the \*(UA binary if
12249 .Xr spamc 1
12250 has been found in
12251 .Ev PATH
12252 during compilation.
12253 Shall it be necessary to define a specific connection type (rather than
12254 using a configuration file for that), the variable
12255 .Va spamc-arguments
12256 can be used as in for example
12257 .Ql -d server.example.com -p 783 .
12258 It is also possible to specify a per-user configuration via
12259 .Va spamc-user .
12260 Note that this interface does not inspect the
12261 .Ql is-spam
12262 flag of a message for the command
12263 .Ic spamforget .
12264 .It Ql filter
12265 generic spam filter support via freely configurable hooks.
12266 This interface is meant for programs like
12267 .Xr bogofilter 1
12268 and requires according behaviour in respect to the hooks' exit
12269 status for at least the command
12270 .Ic spamrate
12271 .Pf ( Ql 0
12272 meaning a message is spam,
12273 .Ql 1
12274 for non-spam,
12275 .Ql 2
12276 for unsure and any other return value indicating a hard error);
12277 since the hooks can include shell code snippets diverting behaviour
12278 can be intercepted as necessary.
12279 The hooks are
12280 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
12281   spamfilter-rate
12283 .Va spamfilter-spam ;
12284 the manual section
12285 .Sx "Handling spam"
12286 contains examples for some programs.
12287 The process environment of the hooks will have the variable
12288 .Ev MAILX_FILENAME_GENERATED
12289 set.
12290 Note that spam score support for
12291 .Ic spamrate
12292 is not supported unless the \*(OPtional regular expression support is
12293 available and the
12294 .Va spamfilter-rate-scanscore
12295 variable is set.
12298 .It Va spam-maxsize
12299 \*(OP Messages that exceed this size will not be passed through to the
12300 configured
12301 .Va spam-interface .
12302 If unset or 0, the default of 420000 bytes is used.
12304 .It Va spamc-command
12305 \*(OP The path to the
12306 .Xr spamc 1
12307 program for the
12308 .Ql spamc
12309 .Va spam-interface .
12310 Note that the path is not expanded, but used
12311 .Dq as is .
12312 A fallback path will have been compiled into the \*(UA binary if the
12313 executable had been found during compilation.
12315 .It Va spamc-arguments
12316 \*(OP Even though \*(UA deals with most arguments for the
12317 .Ql spamc
12318 .Va spam-interface
12319 automatically, it may at least sometimes be desirable to specify
12320 connection-related ones via this variable, for example
12321 .Ql -d server.example.com -p 783 .
12323 .It Va spamc-user
12324 \*(OP Specify a username for per-user configuration files for the
12325 .Ql spamc
12326 .Va spam-interface .
12327 If this is set to the empty string then \*(UA will use the name of the
12328 current
12329 .Va user .
12335 .It Va spamfilter-ham , spamfilter-noham , \
12336   spamfilter-nospam , spamfilter-rate , spamfilter-spam
12337 \*(OP Command and argument hooks for the
12338 .Ql filter
12339 .Va spam-interface .
12340 The manual section
12341 .Sx "Handling spam"
12342 contains examples for some programs.
12344 .It Va spamfilter-rate-scanscore
12345 \*(OP Because of the generic nature of the
12346 .Ql filter
12347 .Va spam-interface
12348 spam scores are not supported for it by default, but if the \*(OPnal
12349 regular expression support is available then setting this variable can
12350 be used to overcome this restriction.
12351 It is interpreted as follows: first a number (digits) is parsed that
12352 must be followed by a semicolon
12353 .Ql \&;
12354 and an extended regular expression.
12355 Then the latter is used to parse the first output line of the
12356 .Va spamfilter-rate
12357 hook, and, in case the evaluation is successful, the group that has been
12358 specified via the number is interpreted as a floating point scan score.
12359 .It Va ssl-ca-dir-USER@HOST , ssl-ca-dir-HOST , ssl-ca-dir ,\
12360   ssl-ca-file-USER@HOST , ssl-ca-file-HOST , ssl-ca-file
12361 \*(OB\*(OP Predecessors of
12362 .Va tls-ca-file ,
12363 .Va tls-ca-dir .
12364 .It Va ssl-ca-flags-USER@HOST , ssl-ca-flags-HOST , ssl-ca-flags
12365 \*(OB\*(OP Predecessor of
12366 .Va tls-ca-flags .
12367 .It Va ssl-ca-no-defaults-USER@HOST , ssl-ca-no-defaults-HOST ,\
12368   ssl-ca-no-defaults
12369 \*(OB\*(BO\*(OP Predecessor of
12370 .Va tls-ca-no-defaults .
12371 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
12372 \*(OB\*(OP Please use the
12373 .Cd Certificate
12374 slot of
12375 .Va tls-config-pairs .
12376 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
12377 \*(OB\*(OP Please use the
12378 .Cd CipherString
12379 slot of
12380 .Va tls-config-pairs .
12381 .It Va ssl-config-file
12382 \*(OB\*(OP Predecessor of
12383 .Va tls-config-file .
12384 .It Va ssl-config-module-USER@HOST , ssl-config-module-HOST ,\
12385   ssl-config-module
12386 \*(OB\*(OP Predecessor of
12387 .Va tls-config-module .
12388 .It Va ssl-config-pairs-USER@HOST , ssl-config-pairs-HOST , ssl-config-pairs
12389 \*(OB\*(OP Predecessor of
12390 .Va tls-config-pairs .
12391 .It Va ssl-crl-dir , ssl-crl-file
12392 \*(OB\*(OP Predecessors of
12393 .Va tls-crl-dir ,
12394 .Va tls-crl-file .
12395 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
12396 \*(OB\*(OP Please use the
12397 .Cd Curves
12398 slot of
12399 .Va tls-config-pairs .
12400 .It Va ssl-features
12401 \*(OB\*(OP\*(RO Predecessor of
12402 .Va tls-features .
12403 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
12404 \*(OB\*(OP Please use the
12405 .Cd PrivateKey
12406 slot of
12407 .Va tls-config-pairs .
12408 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
12409 \*(OB\*(OP Please use the
12410 .Cd Protocol
12411 slot of
12412 .Va tls-config-pairs .
12413 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
12414 \*(OB\*(OP Please use the
12415 .Cd Protocol
12416 slot of
12417 .Va tls-config-pairs .
12418 .It Va ssl-rand-file
12419 \*(OB\*(OP Predecessor of
12420 .Va tls-rand-file .
12421 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
12422 \*(OB\*(OP Predecessor of
12423 .Va tls-verify .
12425 .It Va stealthmua
12426 If only set without an assigned value, then this setting inhibits the
12427 generation of the
12428 .Ql Message-ID: ,
12429 .Ql Content-ID:
12431 .Ql User-Agent:
12432 header fields that include obvious references to \*(UA.
12433 There are two pitfalls associated with this:
12434 First, the message id of outgoing messages is not known anymore.
12435 Second, an expert may still use the remaining information in the header
12436 to track down the originating mail user agent.
12437 If set to the value
12438 .Ql noagent ,
12439 then the mentioned
12440 .Ql Message-ID:
12442 .Ql Content-ID:
12443 suppression does not occur.
12445 .It Va system-mailrc
12446 \*(RO The compiled in path of the system wide initialization file
12447 one of the
12448 .Sx "Resource files" :
12449 .Pa \*(UR .
12451 .It Va termcap
12452 (\*(OP) This specifies a comma-separated list of
12453 .Lb libterminfo
12454 and/or
12455 .Lb libtermcap
12456 capabilities (see
12457 .Sx "On terminal control and line editor" ,
12458 escape commas with reverse solidus
12459 .Ql \e )
12460 to be used to overwrite or define entries.
12461 .Sy Note
12462 this variable will only be queried once at program startup and can
12463 thus only be specified in resource files or on the command line.
12464 It will always be inspected, regardless of whether
12465 .Va features
12466 denotes termcap/terminfo library support via
12467 .Ql ,+termcap, .
12469 String capabilities form
12470 .Ql cap=value
12471 pairs and are expected unless noted otherwise.
12472 Numerics have to be notated as
12473 .Ql cap#number
12474 where the number is expected in normal decimal notation.
12475 Finally, booleans do not have any value but indicate a true or false
12476 state simply by being defined or not; this indeed means that \*(UA
12477 does not support undefining an existing boolean.
12478 String capability values will undergo some expansions before use:
12479 for one notations like
12480 .Ql ^LETTER
12481 stand for
12482 .Ql control-LETTER ,
12483 and for clarification purposes
12484 .Ql \eE
12485 can be used to specify
12486 .Ql escape
12487 (the control notation
12488 .Ql ^[
12489 could lead to misreadings when a left bracket follows, which it does for
12490 the standard CSI sequence);
12491 finally three letter octal sequences, as in
12492 .Ql \e061 ,
12493 are supported.
12494 To specify that a terminal supports 256-colours, and to define sequences
12495 that home the cursor and produce an audible bell, one might write:
12496 .Bd -literal -offset indent
12497 ? set termcap='Co#256,home=\eE[H,bel=^G'
12500 The following terminal capabilities are or may be meaningful for the
12501 operation of the built-in line editor or \*(UA in general:
12503 .Bl -tag -compact -width ".It Cd yay"
12504 .It Cd am
12505 .Cd auto_right_margin :
12506 boolean which indicates if the right margin needs special treatment; the
12507 .Cd xenl
12508 capability is related, for more see
12509 .Ev COLUMNS .
12510 This capability is only used when backed by library support.
12511 .It Cd clear Ns \0or Cd cl
12512 .Cd clear_screen :
12513 clear the screen and home cursor.
12514 (Will be simulated via
12515 .Cd ho
12516 plus
12517 .Cd cd . )
12518 .It Cd colors Ns \0or Cd Co
12519 .Cd max_colors :
12520 numeric capability specifying the maximum number of colours.
12521 Note that \*(UA does not actually care about the terminal beside that,
12522 but always emits ANSI / ISO 6429 escape sequences; also see
12523 .Ic colour .
12524 .It Cd cr
12525 .Cd carriage_return :
12526 move to the first column in the current row.
12527 The default built-in fallback is
12528 .Ql \er .
12529 .It Cd cub1 Ns \0or Cd le
12530 .Cd cursor_left :
12531 move the cursor left one space (non-destructively).
12532 The default built-in fallback is
12533 .Ql \eb .
12534 .It Cd cuf1 Ns \0or Cd nd
12535 .Cd cursor_right :
12536 move the cursor right one space (non-destructively).
12537 The default built-in fallback is
12538 .Ql \eE[C ,
12539 which is used by most terminals.
12540 Less often occur
12541 .Ql \eEC
12543 .Ql \eEOC .
12544 .It Cd ed Ns \0or Cd cd
12545 .Cd clr_eos :
12546 clear the screen.
12547 .It Cd el Ns \0or Cd ce
12548 .Cd clr_eol :
12549 clear to the end of line.
12550 (Will be simulated via
12551 .Cd ch
12552 plus repetitions of space characters.)
12553 .It Cd home Ns \0or Cd ho
12554 .Cd cursor_home :
12555 home cursor.
12556 .It Cd hpa Ns \0or Cd ch
12557 .Cd column_address :
12558 move the cursor (to the given column parameter) in the current row.
12559 (Will be simulated via
12560 .Cd cr
12561 plus
12562 .Cd nd . )
12563 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
12564 .Cd exit_ca_mode
12566 .Cd enter_ca_mode ,
12567 respectively: exit and enter the alternative screen ca-mode,
12568 effectively turning \*(UA into a fullscreen application.
12569 This must be enabled explicitly by setting
12570 .Va termcap-ca-mode .
12571 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
12572 .Cd keypad_xmit
12574 .Cd keypad_local ,
12575 respectively: enable and disable the keypad.
12576 This is always enabled if available, because it seems even keyboards
12577 without keypads generate other key codes for, e.g., cursor keys in that
12578 case, and only if enabled we see the codes that we are interested in.
12579 .It Cd xenl Ns \0or Cd xn
12580 .Cd eat_newline_glitch :
12581 boolean which indicates whether a newline written in the last column of an
12582 .Cd auto_right_margin
12583 indicating terminal is ignored.
12584 With it the full terminal width is available even on autowrap terminals.
12585 This will be inspected even without
12586 .Ql ,+termcap,
12587 .Va features .
12590 Many more capabilities which describe key-sequences are documented for
12591 .Ic bind .
12593 .It Va termcap-ca-mode
12594 \*(OP Allow usage of the
12595 .Cd exit_ca_mode
12597 .Cd enter_ca_mode
12598 .Va termcap Ns
12599 abilities in order to enter an alternative exclusive screen, the
12600 so-called ca-mode; this usually requires special configuration of the
12601 .Ev PAGER ,
12602 also dependent on the value of
12603 .Va crt .
12604 .Sy Note
12605 this variable will only be queried once at program startup and can
12606 thus only be specified in resource files or on the command line.
12608 .It Va termcap-disable
12609 \*(OP Disable any interaction with a terminal control library.
12610 If set only some generic fallback built-ins and possibly the content of
12611 .Va termcap
12612 describe the terminal to \*(UA.
12613 .Sy Note
12614 this variable will only be queried once at program startup and can
12615 thus only be specified in resource files or on the command line.
12616 .Mx Va tls-ca-file
12617 .Mx Va tls-ca-dir
12618 .It Va tls-ca-dir-USER@HOST , tls-ca-dir-HOST , tls-ca-dir ,\
12619   tls-ca-file-USER@HOST , tls-ca-file-HOST , tls-ca-file
12620 \*(OP Directory and file, respectively, for pools of trusted CA
12621 certificates in PEM (Privacy Enhanced Mail) format, for the purpose of
12622 verification of TLS server certificates.
12623 Concurrent use is possible, the file is loaded once needed first, the
12624 directory lookup is performed anew as a last resort whenever necessary.
12625 The CA certificate pool built into the TLS library can be disabled via
12626 .Va tls-ca-no-defaults ,
12627 further fine-tuning is possible via
12628 .Va tls-ca-flags .
12629 The directory search requires special filename conventions, please see
12630 .Xr SSL_CTX_load_verify_locations 3
12632 .Xr verify 1
12634 .Xr c_rehash 1 ) .
12635 .Mx Va tls-ca-flags
12636 .It Va tls-ca-flags-USER@HOST , tls-ca-flags-HOST , tls-ca-flags
12637 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
12638 storage, and the certificate verification that is used (also see
12639 .Va tls-verify ) .
12640 The value is expected to consist of a comma-separated list of
12641 configuration directives, with any intervening whitespace being ignored.
12642 The directives directly map to flags that can be passed to
12643 .Xr X509_STORE_set_flags 3 ,
12644 which are usually defined in a file
12645 .Pa openssl/x509_vfy.h ,
12646 and the availability of which depends on the used TLS library
12647 version: a directive without mapping is ignored (error log subject to
12648 .Va debug ) .
12649 Directives currently understood (case-insensitively) include:
12651 .Bl -tag -compact -width ".It Cd BaNg"
12652 .It Cd no-alt-chains
12653 If the initial chain is not trusted, do not attempt to build an
12654 alternative chain.
12655 Setting this flag will make OpenSSL certificate verification match that
12656 of older OpenSSL versions, before automatic building and checking of
12657 alternative chains has been implemented; also see
12658 .Cd trusted-first .
12659 .It Cd no-check-time
12660 Do not check certificate/CRL validity against current time.
12661 .It Cd partial-chain
12662 By default partial, incomplete chains which cannot be verified up to the
12663 chain top, a self-signed root certificate, will not verify.
12664 With this flag set, a chain succeeds to verify if at least one signing
12665 certificate of the chain is in any of the configured trusted stores of
12666 CA certificates.
12667 The OpenSSL manual page
12668 .Xr SSL_CTX_load_verify_locations 3
12669 gives some advise how to manage your own trusted store of CA certificates.
12670 .It Cd strict
12671 Disable workarounds for broken certificates.
12672 .It Cd trusted-first
12673 Try building a chain using issuers in the trusted store first to avoid
12674 problems with server-sent legacy intermediate certificates.
12675 Newer versions of OpenSSL support alternative chain checking and enable
12676 it by default, resulting in the same behaviour; also see
12677 .Cd no-alt-chains .
12679 .Mx Va tls-ca-no-defaults
12680 .It Va tls-ca-no-defaults-USER@HOST , tls-ca-no-defaults-HOST ,\
12681   tls-ca-no-defaults
12682 \*(BO\*(OP Do not load the default CA locations that are built into the
12683 used to TLS library to verify TLS server certificates.
12685 .It Va tls-config-file
12686 \*(OP If this variable is set
12687 .Xr CONF_modules_load_file 3
12688 (if announced via
12689 .Ql ,+modules-load-file,
12691 .Va tls-features )
12692 is used to allow resource file based configuration of the TLS library.
12693 This happens once the library is used first, which may also be early
12694 during startup (logged with
12695 .Va verbose ) !
12696 If a non-empty value is given then the given file, after performing
12697 .Sx "Filename transformations" ,
12698 will be used instead of the TLS libraries global default, and it is an
12699 error if the file cannot be loaded.
12700 The application name will always be passed as
12701 .Ql \*(uA .
12702 Some TLS libraries support application-specific configuration via
12703 resource files loaded like this, please see
12704 .Va tls-config-module .
12705 .Mx Va tls-config-module
12706 .It Va tls-config-module-USER@HOST , tls-config-module-HOST ,\
12707   tls-config-module
12708 \*(OP If file based application-specific configuration via
12709 .Va tls-config-file
12710 is available, announced as
12711 .Ql ,+ctx-config,
12713 .Va tls-features ,
12714 indicating availability of
12715 .Xr SSL_CTX_config 3 ,
12716 then, it becomes possible to use a central TLS configuration file
12717 for all programs, including \*(uA, for example
12718 .Bd -literal -offset indent
12719 # Register a configuration section for \*(uA
12720 \*(uA = mailx_master
12721 # The top configuration section creates a relation
12722 # in between dynamic SSL configuration and an actual
12723 # program specific configuration section
12724 [mailx_master]
12725 ssl_conf = mailx_tls_config
12726 # And that program specific configuration section now
12727 # can map diverse tls-config-module names to sections,
12728 # as in: tls-config-module=account_xy
12729 [mailx_tls_config]
12730 account_xy = mailx_account_xy
12731 account_yz = mailx_account_yz
12732 [mailx_account_xy]
12733 MinProtocol = TLSv1.2
12734 Curves=P-521
12735 [mailx_account_yz]
12736 CipherString = TLSv1.2:!aNULL:!eNULL:
12737 MinProtocol = TLSv1.1
12738 Options = Bugs
12740 .Mx Va tls-config-pairs
12741 .It Va tls-config-pairs-USER@HOST , tls-config-pairs-HOST , tls-config-pairs
12742 \*(OP The value of this variable chain will be interpreted as
12743 a comma-separated list of directive/value pairs.
12744 Directives and values need to be separated by equals signs
12745 .Ql = ,
12746 any whitespace surrounding pair members is removed.
12747 Keys are (usually) case-insensitive.
12748 Different to when placing these pairs in a
12749 .Va tls-config-module
12750 section of a
12751 .Va tls-config-file ,
12752 commas
12753 .Ql \&,
12754 need to be escaped with a reverse solidus
12755 .Ql \e
12756 when included in pairs; also different: if the equals sign
12757 .Ql =
12758 is preceded with an asterisk
12759 .Ql *
12760 .Sx "Filename transformations"
12761 will be performed on the value; it is an error if these fail.
12762 Unless proper support is announced by
12763 .Va tls-features
12764 .Pf ( Ql ,+conf-ctx, )
12765 only the keys below are supported, otherwise the pairs will be used
12766 directly as arguments to the function
12767 .Xr SSL_CONF_cmd 3 .
12769 .Bl -tag -compact -width ".It Cd C_rtificate_"
12770 .It Cd Certificate
12771 Filename of a TLS client certificate (chain) required by some servers.
12772 Fallback support via
12773 .Xr SSL_CTX_use_certificate_chain_file 3 .
12774 .Sx "Filename transformations"
12775 are performed.
12776 .Cd PrivateKey
12777 will be set to the same value if not initialized explicitly.
12778 Some services support so-called
12779 .Ql external
12780 authentication if a TLS client certificate was successfully presented
12781 during connection establishment
12782 .Pf ( Dq connecting is authenticating ) .
12783 .It Cd CipherString
12784 A list of ciphers for TLS connections, see
12785 .Xr ciphers 1 .
12786 By default no list of ciphers is set, resulting in a
12787 .Cd Protocol Ns - Ns
12788 specific list of ciphers (the protocol standards define lists of
12789 acceptable ciphers; possibly cramped by the used TLS library).
12790 Fallback support via
12791 .Xr SSL_CTX_set_cipher_list 3 .
12792 .It Cd Ciphersuites
12793 A list of ciphers used for TLSv1.3 connections, see
12794 .Xr ciphers 1 .
12795 These will be joined onto the list of ciphers from
12796 .Cd CipherString .
12797 Available if
12798 .Va tls-features
12799 announces
12800 .Ql ,+ctx-set-ciphersuites, ,
12801 as necessary via
12802 .Xr SSL_CTX_set_ciphersuites 3 .
12803 .It Cd Curves
12804 A list of supported elliptic curves, if applicable.
12805 By default no curves are set.
12806 Fallback support via
12807 .Xr SSL_CTX_set1_curves_list 3 ,
12808 if available.
12809 .It Cd MaxProtocol , MinProtocol
12810 The maximum and minimum supported TLS versions, respectively.
12811 Available if
12812 .Va tls-features
12813 announces
12814 .Ql ,+ctx-set-maxmin-proto, ,
12815 as necessary via
12816 .Xr SSL_CTX_set_max_proto_version 3
12818 .Xr SSL_CTX_set_min_proto_version 3 ;
12819 these fallbacks use an internal parser which understands the strings
12820 .Ql SSLv3 ,
12821 .Ql TLSv1 ,
12822 .Ql TLSv1.1 ,
12823 .Ql TLSv1.2 ,
12824 .Ql TLSv1.3 ,
12825 and the special value
12826 .Ql None ,
12827 which disables the given limit.
12828 .It Cd Options
12829 Various flags to set.
12830 Fallback via
12831 .Xr SSL_CTX_set_options 3 ,
12832 in which case any other value but (exactly)
12833 .Ql Bugs
12834 results in an error.
12835 .It Cd PrivateKey
12836 Filename of the private key in PEM format of a TLS client certificate.
12837 If unset, the value of
12838 .Cd Certificate
12839 is used.
12840 .Sx "Filename transformations"
12841 are performed.
12842 Fallback via
12843 .Xr SSL_CTX_use_PrivateKey_file 3 .
12844 .It Cd Protocol
12845 The used TLS protocol.
12847 .Va tls-features
12848 announces
12849 .Ql ,+conf-ctx,
12851 .Ql ctx-set-maxmin-proto
12852 then using
12853 .Cd MaxProtocol
12855 .Cd MinProtocol
12856 is preferable.
12857 Fallback is
12858 .Xr SSL_CTX_set_options 3 ,
12859 driven via an internal parser which understands the strings
12860 .Ql SSLv3 ,
12861 .Ql TLSv1 ,
12862 .Ql TLSv1.1 ,
12863 .Ql TLSv1.2 ,
12864 .Ql TLSv1.3 ,
12865 and the special value
12866 .Ql ALL .
12867 Multiple protocols may be given as a comma-separated list, any
12868 whitespace is ignored, an optional plus sign
12869 .Ql +
12870 prefix enables, a hyphen-minus
12871 .Ql -
12872 prefix disables a protocol, so that
12873 .Ql -ALL, TLSv1.2
12874 enables only the TLSv1.2 protocol.
12878 .It Va tls-crl-dir , tls-crl-file
12879 \*(OP Specify a directory / a file, respectively, that contains a CRL in
12880 PEM format to use when verifying TLS server certificates.
12882 .It Va tls-features
12883 \*(OP\*(RO This expands to a comma-separated list of the TLS library
12884 identity and optional features.
12885 To ease substring matching the string starts and ends with a comma.
12886 Currently supported identities are
12887 .Ql libressl
12888 (LibreSSL) ,
12889 .Ql libssl-0x30000
12890 (OpenSSL v3.0.0 series),
12891 .Ql libssl-0x10100
12892 (OpenSSL v1.1.x series)
12894 .Ql libssl-0x10000
12895 (elder OpenSSL series, other clones).
12896 Optional features are preceded with a plus sign
12897 .Ql +
12898 when available, and with a hyphen-minus
12899 .Ql -
12900 otherwise.
12902 Currently known features are
12903 .Ql conf-ctx
12904 .Pf ( Va tls-config-pairs ) ,
12905 .Ql ctx-config
12906 .Pf ( Va tls-config-module ) ,
12907 .Ql ctx-set-ciphersuites
12908 .Pf ( Cd Ciphersuites
12909 slot of
12910 .Va tls-config-pairs ) ,
12911 .Ql ctx-set-maxmin-proto
12912 .Pf ( Va tls-config-pairs ) ,
12913 .Ql modules-load-file
12914 .Pf ( Va tls-config-file ) ,
12916 .Ql tls-rand-file
12917 .Pf ( Va tls-rand-file ) .
12918 .Mx Va tls-fingerprint
12919 .It Va tls-fingerprint-USER@HOST , tls-fingerprint-HOST , tls-fingerprint
12920 \*(OP It is possible to replace the verification of the connection
12921 peer certificate against the entire local pool of CAs (for more see
12922 .Sx "Encrypted network communication" )
12923 with the comparison against a precalculated certificate message digest,
12924 the so-called fingerprint, to be specified as the used
12925 .Va tls-fingerprint-digest .
12926 This fingerprint can for example be calculated with
12927 .Ql Ic tls Ns \:\0\:fingerprint HOST .
12928 .Mx Va tls-fingerprint-digest
12929 .It Va tls-fingerprint-digest-USER@HOST , tls-fingerprint-digest-HOST , \
12930   tls-fingerprint-digest
12931 \*(OP The message digest to be used when creating TLS certificate
12932 fingerprints, the defaults, if available, in test order, being
12933 .Ql BLAKE2s256 ,
12934 .Ql SHA256 .
12935 For the complete list of digest algorithms refer to
12936 .Va smime-sign-digest .
12938 .It Va tls-rand-file
12939 \*(OP If
12940 .Va tls-features
12941 announces
12942 .Ql ,+tls-rand-file,
12943 then this will be queried to find a file with random entropy data which
12944 can be used to seed the P(seudo)R(andom)N(umber)G(enerator), see
12945 .Xr RAND_load_file 3 .
12946 The default filename
12947 .Pf ( Xr RAND_file_name 3 ,
12948 normally
12949 .Pa ~/.rnd )
12950 will be used if this variable is not set or empty, or if the
12951 .Sx "Filename transformations"
12952 fail.
12953 Shall seeding the PRNG have been successful,
12954 .Xr RAND_write_file 3
12955 will be called to update the entropy.
12956 Remarks: libraries which do not announce this feature seed the PRNG by
12957 other means.
12958 .Mx Va tls-verify
12959 .It Va tls-verify-USER@HOST , tls-verify-HOST , tls-verify
12960 \*(OP Variable chain that sets the action to be performed if an error
12961 occurs during TLS server certificate validation against the
12962 specified or default trust stores
12963 .Va tls-ca-dir ,
12964 .Va tls-ca-file ,
12965 or the TLS library built-in defaults (unless usage disallowed via
12966 .Va tls-ca-no-defaults ) ,
12967 and as fine-tuned via
12968 .Va tls-ca-flags .
12969 Valid (case-insensitive) values are
12970 .Ql strict
12971 (fail and close connection immediately),
12972 .Ql ask
12973 (ask whether to continue on standard input),
12974 .Ql warn
12975 (show a warning and continue),
12976 .Ql ignore
12977 (do not perform validation).
12978 The default is
12979 .Ql ask .
12981 .It Va toplines
12982 If defined, gives the number of lines of a message to be displayed
12983 with the command
12984 .Ic top ;
12985 if unset, the first five lines are printed, if set to 0 the variable
12986 .Va screen
12987 is inspected.
12988 If the value is negative then its absolute value will be used for
12989 unsigned right shifting (see
12990 .Ic vexpr )
12992 .Va screen
12993 height.
12995 .It Va topsqueeze
12996 \*(BO If set then the
12997 .Ic top
12998 command series will strip adjacent empty lines and quotations.
13000 .It Va ttycharset
13001 The character set of the terminal \*(UA operates on,
13002 and the one and only supported character set that \*(UA can use if no
13003 character set conversion capabilities have been compiled into it,
13004 in which case it defaults to ISO-8859-1.
13005 Otherwise it defaults to UTF-8.
13006 Sufficient locale support provided the default will be preferably
13007 deduced from the locale environment if that is set (for example
13008 .Ev LC_CTYPE ,
13009 see there for more); runtime locale changes will be reflected by
13010 .Va \&\&ttycharset
13011 except during the program startup phase and if
13012 .Fl S
13013 had been used to freeze the given value.
13014 Refer to the section
13015 .Sx "Character sets"
13016 for the complete picture about character sets.
13018 .It Va typescript-mode
13019 \*(BO A special multiplex variable that disables all variables and
13020 settings which result in behaviour that interferes with running \*(UA in
13021 .Xr script 1 ;
13022 it sets
13023 .Va colour-disable ,
13024 .Va line-editor-disable
13025 and (before startup completed only)
13026 .Va termcap-disable .
13027 Unsetting it does not restore the former state of the covered settings.
13029 .It Va umask
13030 For a safe-by-default policy the process file mode creation mask
13031 .Xr umask 2
13032 will be set to
13033 .Ql 0077
13034 on program startup after the resource files have been loaded,
13035 and unless this variable is set.
13036 By assigning this an empty value the active setting will not be changed,
13037 otherwise the given value will be made the new file mode creation mask.
13038 Child processes inherit the file mode creation mask of their parent.
13039 .Mx Va user
13040 .It Va user-HOST , user
13041 \*(IN Variable chain that sets a global fallback user name, used in case
13042 none has been given in the protocol and account-specific URL.
13043 This variable defaults to the name of the user who runs \*(UA.
13045 .It Va v15-compat
13046 Enable upward compatibility with \*(UA version 15.0 in respect to which
13047 configuration options are available and how they are handled.
13048 If set to a non-empty value the command modifier
13049 .Cm wysh
13050 is implied and thus enforces
13051 .Sx "Shell-style argument quoting"
13052 over
13053 .Sx "Old-style argument quoting"
13054 for all commands which support both.
13055 This manual uses \*(IN and \*(OU to refer to the new and the old way of
13056 doing things, respectively.
13058 .It Va verbose
13059 Verbose mode enables logging of informational context messages.
13060 Historically a \*(BO variable, this can either be set multiple times
13061 (what the command line option
13062 .Fl v
13063 uses), or be assigned a numeric value in order to increase verbosity.
13064 Assigning the value 0 disables verbosity and thus (almost) equals
13065 .Ic unset .
13066 The maximum number is 3.
13067 Also see
13068 .Va debug .
13075 .It Va version , version-date , \
13076   version-hexnum , version-major , version-minor , version-update
13077 \*(RO \*(UA version information: the first variable is a string with
13078 the complete version identification, the second the release date in ISO
13079 8601 notation without time.
13080 The third is a 32-bit hexadecimal number with the upper 8 bits storing
13081 the major, followed by the minor and update version numbers which occupy
13082 12 bits each.
13083 The latter three variables contain only decimal digits: the major, minor
13084 and update version numbers.
13085 The output of the command
13086 .Ic version
13087 will include this information.
13089 .It Va writebackedited
13090 If this variable is set messages modified using the
13091 .Ic edit
13093 .Ic visual
13094 commands are written back to the current folder when it is quit;
13095 it is only honoured for writable folders in MBOX format, though.
13096 Note that the editor will be pointed to the raw message content in that
13097 case, i.e., neither MIME decoding nor decryption will have been
13098 performed, and proper
13099 .Va mbox-rfc4155
13100 .Ql From_
13101 quoting of newly added or edited content is also left as an exercise
13102 to the user.
13104 .Sh ENVIRONMENT
13105 The term
13106 .Dq environment variable
13107 should be considered an indication that these variables are either
13108 standardized as vivid parts of process environments, or that they are
13109 commonly found in there.
13110 The process environment is inherited from the
13111 .Xr sh 1
13112 once \*(UA is started, and unless otherwise explicitly noted handling of
13113 the following variables transparently integrates into that of the
13114 .Sx "INTERNAL VARIABLES"
13115 from \*(UA's point of view.
13116 This means they can be managed via
13117 .Ic set
13119 .Ic unset ,
13120 causing automatic program environment updates (to be inherited by
13121 newly created child processes).
13123 In order to integrate other environment variables equally they need to
13124 be imported (linked) with the command
13125 .Ic environ .
13126 This command can also be used to set and unset non-integrated
13127 environment variables from scratch, sufficient system support provided.
13128 The following example, applicable to a POSIX shell, sets the
13129 .Ev COLUMNS
13130 environment variable for \*(UA only, and beforehand exports the
13131 .Ev EDITOR
13132 in order to affect any further processing in the running shell:
13133 .Bd -literal -offset indent
13134 $ EDITOR="vim -u ${HOME}/.vimrc"
13135 $ export EDITOR
13136 $ COLUMNS=80 \*(uA -R
13138 .Bl -tag -width ".It Ev BaNg"
13140 .It Ev COLUMNS
13141 The user's preferred width in column positions for the terminal screen.
13142 Queried and used once on program startup in interactive or batch
13143 .Pf ( Fl \&# )
13144 mode, actively managed for child processes and the MLE (see
13145 .Sx "On terminal control and line editor" )
13146 in interactive mode thereafter.
13147 Non-interactive mode always uses, and the fallback default is
13148 a compile-time constant, by default 80 columns.
13149 If in batch mode
13150 .Ev \&\&COLUMNS
13152 .Ev LINES
13153 are both set but not both are usable (empty, not a number, or 0) at
13154 program startup, then the real terminal screen size will be (tried to
13155 be) determined once.
13156 (Normally the
13157 .Xr sh 1
13158 manages these variables, and unsets them for pipe specifications etc.)
13160 .It Ev DEAD
13161 The name of the (mailbox)
13162 .Ic folder
13163 to use for saving aborted messages if
13164 .Va save
13165 is set; this defaults to
13166 .Pa \*(VD .
13167 If the variable
13168 .Va debug
13169 is set no output will be generated, otherwise the contents of the file
13170 will be replaced.
13171 Except shell globs
13172 .Sx "Filename transformations"
13173 (also see
13174 .Ic folder )
13175 will be performed.
13177 .It Ev EDITOR
13178 Pathname of the text editor to use for the
13179 .Ic edit
13180 command and
13181 .Ic ~e
13182 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
13183 .Ev VISUAL
13184 is used for a more display oriented editor.
13186 .It Ev HOME
13187 The user's home directory.
13188 This variable is only used when it resides in the process environment.
13189 The calling user's home directory will be used instead if this directory
13190 does not exist, is not accessible or cannot be read;
13191 it will always be used for the root user.
13192 (No test for being writable is performed to allow usage by
13193 non-privileged users within read-only jails, but dependent on settings
13194 this directory is a default write target for, for example,
13195 .Ev DEAD ,
13196 .Ev MBOX
13197 and more.)
13201 .It Ev LC_ALL , LC_CTYPE , LANG
13202 \*(OP The (names in lookup order of the)
13203 .Xr locale 7
13204 (and / or see
13205 .Xr setlocale 3 )
13206 which indicates the used
13207 .Sx "Character sets" .
13208 Runtime changes trigger automatic updates of the entire locale system,
13209 which includes updating
13210 .Va ttycharset
13211 (except during startup if the variable has been frozen via
13212 .Fl S ) .
13214 .It Ev LINES
13215 The user's preferred number of lines for the terminal screen.
13216 The behaviour is as described for
13217 .Ev COLUMNS ,
13218 yet the compile-time constant used in non-interactive mode and as
13219 a fallback defaults to 24 (lines).
13221 .It Ev LISTER
13222 Pathname of the directory lister to use in the
13223 .Ic folders
13224 command when operating on local mailboxes.
13225 Default is
13226 .Xr ls 1
13227 (path search through
13228 .Ev SHELL ) .
13230 .It Ev LOGNAME
13231 Upon startup \*(UA will actively ensure that this variable refers to the
13232 name of the user who runs \*(UA, in order to be able to pass a verified
13233 name to any newly created child process.
13235 .It Ev MAIL
13236 Is used as the user's
13237 .Mx -sx
13238 .Sx "primary system mailbox"
13239 unless
13240 .Va inbox
13241 is set.
13242 If the environmental fallback is also not set, a built-in compile-time
13243 default is used.
13244 This is assumed to be an absolute pathname.
13246 .It Ev MAILCAPS
13247 \*(OP Override the default path search of
13248 .Sx "The Mailcap files" :
13249 any existing file therein will be loaded in sequence, appending any
13250 content to the list of MIME type handler directives.
13251 The RFC 1524 standard imposed default value is assigned otherwise:
13252 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
13253 (The default value is a compile-time \*(OP.)
13255 .It Ev MAILRC
13256 Is used as a startup file instead of
13257 .Pa \*(ur
13258 if set.
13259 In order to avoid side-effects from configuration files scripts should
13260 either set this variable to
13261 .Pa /dev/null
13262 or the
13263 .Fl \&:
13264 command line option should be used.
13266 .It Ev MAILX_NO_SYSTEM_RC
13267 If this variable is set then reading of
13268 .Pa \*(UR
13269 (aka\&
13270 .Va system-mailrc )
13271 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
13272 had been started up with the option
13273 .Fl \&:
13274 (and according argument) or
13275 .Fl n .
13276 This variable is only used when it resides in the process environment.
13278 .It Ev MBOX
13279 The name of the user's
13280 .Mx -sx
13281 .Sx "secondary mailbox"
13282 file.
13283 A logical subset of the special
13284 .Sx "Filename transformations"
13285 (also see
13286 .Ic folder )
13287 are supported.
13288 The default is
13289 .Pa \*(VM .
13290 Traditionally this MBOX is used as the file to save messages from the
13291 .Mx -sx
13292 .Sx "primary system mailbox"
13293 that have been read.
13294 Also see
13295 .Sx "Message states" .
13297 .It Ev NETRC
13298 \*(IN\*(OP This variable overrides the default location of the user's
13299 .Pa \*(VN
13300 file.
13302 .It Ev PAGER
13303 Pathname of the program to use for backing the command
13304 .Ic more ,
13305 and when the
13306 .Va crt
13307 variable enforces usage of a pager for output.
13308 The default paginator is
13309 .Xr more 1
13310 (path search through
13311 .Ev SHELL ) .
13313 \*(UA inspects the contents of this variable: if its contains the string
13314 .Dq less
13315 then a non-existing environment variable
13316 .Ev LESS
13317 will be set to (the portable)
13318 .Ql RI ,
13319 likewise for
13320 .Dq lv
13321 .Ev LV
13322 will optionally be set to
13323 .Ql -c .
13324 Also see
13325 .Va colour-pager .
13327 .It Ev PATH
13328 A colon-separated list of directories that is searched by the shell when
13329 looking for commands, for example
13330 .Ql /bin:/usr/bin:/usr/local/bin .
13332 .It Ev POSIXLY_CORRECT
13333 This environment entry is automatically squared with
13334 .Va posix .
13336 .It Ev SHELL
13337 The shell to use for the commands
13338 .Ic \&! ,
13339 .Ic shell ,
13341 .Ic ~!
13342 .Sx "COMMAND ESCAPES"
13343 and when starting subprocesses.
13344 A default shell is used if this environment variable is not defined.
13346 .It Ev SOCKS5_PROXY
13347 This environment entry is automatically squared with
13348 .Va socks-proxy .
13350 .It Ev SOURCE_DATE_EPOCH
13351 Specifies a time in seconds since the Unix epoch (1970-01-01) to be
13352 used in place of the current time.
13353 This variable is looked up upon program startup, and its existence will
13354 switch \*(UA to a reproducible mode
13355 .Pf ( Lk https://reproducible-builds.org )
13356 which uses deterministic random numbers, a special fixated pseudo
13357 .Ev LOGNAME
13358 and more.
13359 This operation mode is used for development and by software packagers.
13360 \*(ID Currently an invalid setting is only ignored, rather than causing
13361 a program abortion.
13363 .Dl $ SOURCE_DATE_EPOCH=`date +%s` \*(uA
13365 .It Ev TERM
13366 \*(OP The terminal type for which output is to be prepared.
13367 For extended colour and font control please refer to
13368 .Sx "Coloured display" ,
13369 and for terminal management in general to
13370 .Sx "On terminal control and line editor" .
13372 .It Ev TMPDIR
13373 Except for the root user this variable defines the directory for
13374 temporary files to be used instead of
13375 .Pa \*(VT
13376 (or the given compile-time constant) if set, existent, accessible as
13377 well as read- and writable.
13378 This variable is only used when it resides in the process environment,
13379 but \*(UA will ensure at startup that this environment variable is
13380 updated to contain a usable temporary directory.
13382 .It Ev USER
13383 Identical to
13384 .Ev LOGNAME
13385 (see there), but this variable is not standardized, should therefore not
13386 be used, and is only corrected if already set.
13388 .It Ev VISUAL
13389 Pathname of the text editor to use for the
13390 .Ic visual
13391 command and
13392 .Ic ~v
13393 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
13394 .Ev EDITOR
13395 is used for a less display oriented editor.
13397 .Sh FILES
13398 .Bl -tag -width ".It Pa BaNg"
13401 .It Pa ~/.mailcap , /etc/mailcap
13402 \*(OP Personal and system-wide MIME type handler definition files, see
13403 .Sx "The Mailcap files" .
13404 (The shown names are part of the RFC 1524 standard search path
13405 .Ev MAILCAPS . )
13406 .It Pa \*(ur , \*(UR
13407 User-specific and system-wide files giving initial commands, the
13408 .Sx "Resource files" .
13409 (The used filenames come from
13410 .Va MAILRC
13412 .Va system-mailrc ,
13413 respectively.)
13415 .It Pa \*(VM
13416 The default value for
13417 .Ev MBOX .
13420 .It Pa \*(vU , \*(vS
13421 Personal and system-wide MIME types, see
13422 .Sx "The mime.types files" .
13424 .It Pa \*(VN
13425 \*(IN\*(OP The default location of the user's
13426 .Pa .netrc
13427 file \(en the section
13428 .Sx "The .netrc file"
13429 documents the file format.
13430 The used path can be set via
13431 .Ev NETRC .
13433 .It Pa /dev/null
13434 The data sink
13435 .Xr null 4 .
13437 .It Pa ~/.rnd
13438 \*(OP Possible location for persistent random entropy seed storage, see
13439 .Va tls-rand-file .
13441 .Ss "Resource files"
13442 Upon startup \*(UA reads in several resource files, in order:
13443 .Bl -tag -width ".It Pa BaNg"
13445 .It Pa \*(UR
13446 System wide initialization file
13447 .Pf ( Va system-mailrc ) .
13448 Reading of this file can be suppressed, either by using the
13449 .Fl \&:
13450 (and according argument) or
13451 .Fl n
13452 command line options, or by setting the
13453 .Sx ENVIRONMENT
13454 variable
13455 .Ev MAILX_NO_SYSTEM_RC .
13457 .It Pa \*(ur
13458 File giving initial commands.
13459 A different file can be chosen by setting the
13460 .Sx ENVIRONMENT
13461 variable
13462 .Ev MAILRC .
13463 Reading of this file can be suppressed with the
13464 .Fl \&:
13465 command line option.
13466 .It Va mailx-extra-rc
13467 Defines a startup file to be read after all other resource files.
13468 It can be used to specify settings that are not understood by other
13469 .Xr mailx 1
13470 implementations, for example.
13473 The content of these files is interpreted as follows:
13475 .Bl -bullet -compact
13477 The whitespace characters space, tabulator and newline,
13478 as well as those defined by the variable
13479 .Va ifs ,
13480 are removed from the beginning and end of input lines.
13482 Empty lines are ignored.
13484 Any other line is interpreted as a command.
13485 It may be spread over multiple input lines if the newline character is
13486 .Dq escaped
13487 by placing a reverse solidus character
13488 .Ql \e
13489 as the last character of the line; whereas any leading whitespace of
13490 follow lines is ignored, trailing whitespace before a escaped newline
13491 remains in the input.
13493 If the line (content) starts with the number sign
13494 .Ql #
13495 then it is a comment-command and also ignored.
13496 (The comment-command is a real command, which does nothing, and
13497 therefore the usual follow lines mechanism applies!)
13500 Errors while loading these files are subject to the settings of
13501 .Va errexit
13503 .Va posix .
13504 More files with syntactically equal content can be
13505 .Ic source Ns ed .
13506 The following, saved in a file, would be an examplary content:
13507 .Bd -literal -offset indent
13508  # This line is a comment command.  And y\e
13509     es, it is really continued here.
13510 set debug \e
13511     verbose
13512     set editheaders
13514 .Ss "The mime.types files"
13515 As stated in
13516 .Sx "HTML mail and MIME attachments"
13517 \*(UA needs to learn about MIME (Multipurpose Internet Mail Extensions)
13518 media types in order to classify message and attachment content.
13519 One source for them are
13520 .Pa mime.types
13521 files, the loading of which can be controlled by setting the variable
13522 .Va mimetypes-load-control .
13523 Another is the command
13524 .Ic mimetype ,
13525 which also offers access to \*(UAs MIME type cache.
13526 .Pa mime.types
13527 files have the following syntax:
13528 .Bd -literal -offset indent
13529 type/subtype extension [extension ...]
13530 # For example text/html html htm
13533 where
13534 .Ql type/subtype
13535 define the MIME media type, as standardized in RFC 2046:
13536 .Ql type
13537 is used to declare the general type of data, while the
13538 .Ql subtype
13539 specifies a specific format for that type of data.
13540 One or multiple filename
13541 .Ql extension Ns
13542 s, separated by whitespace, can be bound to the media type format.
13543 Comments may be introduced anywhere on a line with a number sign
13544 .Ql # ,
13545 causing the remaining line to be discarded.
13546 \*(UA also supports an extended, non-portable syntax in especially
13547 crafted files, which can be loaded via the alternative value syntax of
13548 .Va mimetypes-load-control ,
13549 and prepends an optional
13550 .Ql type-marker :
13552 .Dl [type-marker ]type/subtype extension [extension ...]
13554 The following type markers are supported:
13556 .Bl -tag -compact -width ".It Ar _n_u"
13557 .It Ar \&?
13558 Treat message parts with this content as plain text.
13559 .It Ar ?t
13560 The same as plain
13561 .Ar \&? .
13562 .It Ar ?h
13563 Treat message parts with this content as HTML tagsoup.
13564 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
13565 the content as plain text instead.
13566 .It Ar ?H
13567 Likewise
13568 .Ar ?h ,
13569 but instead of falling back to plain text require an explicit content
13570 handler to be defined.
13571 .It Ar ?q
13572 If no handler can be found a text message is displayed which says so.
13573 This can be annoying, for example signatures serve a contextual purpose,
13574 their content is of no use by itself.
13575 This marker will avoid displaying the text message.
13578 Further reading:
13579 for sending messages:
13580 .Ic mimetype ,
13581 .Va mime-allow-text-controls ,
13582 .Va mimetypes-load-control .
13583 For reading etc. messages:
13584 .Sx "HTML mail and MIME attachments" ,
13585 .Sx "The Mailcap files" ,
13586 .Ic mimetype ,
13587 .Va mime-counter-evidence ,
13588 .Va mimetypes-load-control ,
13589 .Va pipe-TYPE/SUBTYPE ,
13590 .Va pipe-EXTENSION .
13591 .Ss "The Mailcap files"
13592 \*(OP RFC 1524 defines a
13593 .Dq User Agent Configuration Mechanism
13594 to be used to inform mail user agent programs about the locally
13595 installed facilities for handling various data formats, i.e., about
13596 commands and how they can be used to display, edit et cetera MIME part
13597 contents, as well as a default path search that includes multiple
13598 possible locations of resource files, and the
13599 .Ev MAILCAPS
13600 environment variable to overwrite that.
13601 Handlers found from doing the path search will be cached, the command
13602 .Ic mailcap
13603 operates on that cache, and the variable
13604 .Va mailcap-disable
13605 will suppress automatic loading, and usage of any mailcap handlers.
13606 .Sx "HTML mail and MIME attachments"
13607 gives a general overview of how MIME types are handled.
13609 .Dq Mailcap
13610 files consist of a set of newline separated entries.
13611 Comment lines start with a number sign
13612 .Ql #
13613 (in the first column!) and are ignored.
13614 Empty lines are ignored.
13615 All other lines are interpreted as mailcap entries.
13616 An entry definition may be split over multiple lines by placing the
13617 reverse solidus character
13618 .Ql \e
13619 last in all but the final line.
13620 The standard does not specify how leading whitespace of successive lines
13621 is to be treated, therefore they are retained.
13623 .Dq Mailcap
13624 entries consist of a number of semicolon
13625 .Ql \&;
13626 separated fields.
13627 The first two fields are mandatory and must occur in the specified
13628 order, the remaining fields are optional and may appear in any order.
13629 Leading and trailing whitespace of field content is ignored (removed).
13630 The reverse solidus
13631 .Ql \e
13632 character can be used to escape any following character including
13633 semicolon and itself in the content of the second field, and in value
13634 parts of any optional key/value field.
13636 The first field defines the MIME
13637 .Ql TYPE/SUBTYPE
13638 the entry is about to handle (case-insensitively).
13639 If the subtype is specified as an asterisk
13640 .Ql *
13641 the entry is meant to match all subtypes of the named type, e.g.,
13642 .Ql audio/*
13643 would match any audio type.
13644 The second field is the
13645 .Cd view
13646 shell command used to display MIME parts of the given type.
13648 Data consuming shell commands will be fed message (MIME part) data on
13649 standard input unless one or more instances of the (unquoted) string
13650 .Ql %s
13651 are used: these formats will be replaced with a temporary file(name)
13652 that has been prefilled with the parts data.
13653 Data producing shell commands are expected to generata data on their
13654 standard output unless that format is used.
13655 In all cases any given
13656 .Ql %s
13657 format is replaced with a properly shell quoted filename.
13658 When a command requests a temporary file via
13659 .Ql %s
13660 then that will be removed again, as if the
13661 .Cd x-mailx-tmpfile
13663 .Cd x-mailx-tmpfile-fill
13664 flags had been set; unless the command requests
13665 .Cd x-mailx-async
13667 .Cd x-mailx-tmpfile-unlink
13668 flag is also implied; see below for more.
13670 Optional fields define single-word flags (case-insensitive), or key
13671 / value pairs consisting of a case-insensitive keyword, an equals sign
13672 .Ql = ,
13673 and a shell command; whitespace surrounding the equals sign is removed.
13674 Optional fields include the following:
13675 .Bl -tag -width ".It Cd BaNg"
13676 .It Cd compose
13677 A program that can be used to compose a new body or body part in the
13678 given format.
13679 (Currently unused.)
13680 .It Cd composetyped
13681 Similar to the
13682 .Cd compose
13683 field, but is to be used when the composing program needs to specify the
13684 .Ql Content-type:
13685 header field to be applied to the composed data.
13686 (Currently unused.)
13688 .It Cd copiousoutput
13689 A flag field which indicates that the output of the
13690 .Cd view
13691 command is integrable into \*(UAs normal visual display.
13692 It is mutually exclusive with
13693 .Cd needsterminal .
13694 .It Cd description
13695 A textual description that describes this type of data.
13696 The text may optionally be enclosed within double quotation marks
13697 .Ql \&" .
13698 .It Cd edit
13699 A program that can be used to edit a body or body part in the given
13700 format.
13701 (Currently unused.)
13702 .It Cd nametemplate
13703 This field specifies a filename format for the
13704 .Ql %s
13705 format used in the shell command fields, in which
13706 .Ql %s
13707 will be replaced by a random string.
13708 (The filename is also stored in and passed to subprocesses via
13709 .Ev MAILX_FILENAME_TEMPORARY . )
13710 The standard says this is
13711 .Dq only expected to be relevant in environments \
13712   where filename extensions are meaningful ,
13713 and so this field is ignored unless the
13714 .Ql %s
13715 is a prefix, optionally followed by (ASCII) alphabetic and numeric
13716 characters, the underscore and the period.
13717 For example, to specify that a JPG file is to be passed to an image
13718 viewer with a name ending in
13719 .Ql .jpg ,
13720 .Ql nametemplate=%s.jpg
13721 can be used.
13723 .It Cd needsterminal
13724 This flag field indicates that the given shell command must be run on
13725 an interactive terminal.
13726 \*(UA will temporarily release the terminal to the given command in
13727 interactive mode, in non-interactive mode this entry will be entirely
13728 ignored; this flag implies
13729 .Cd x-mailx-noquote .
13730 .It Cd print
13731 A program that can be used to print a message or body part in the given
13732 format.
13733 (Currently unused.)
13734 .It Cd test
13735 Specifies a program to be run to test some condition, for example, the
13736 machine architecture, or the window system in use, to determine whether
13737 or not this mailcap entry applies.
13738 If the test fails, a subsequent mailcap entry should be sought; also see
13739 .Cd x-mailx-test-once .
13740 Standard I/O of the test program is redirected from and to
13741 .Pa /dev/null ,
13742 and the format
13743 .Ql %s
13744 is not supported (the data does not yet exist).
13745 .It Cd textualnewlines
13746 A flag field which indicates that this type of data is line-oriented and
13747 that, if encoded in
13748 .Ql base64 ,
13749 all newlines should be converted to canonical form (CRLF) before
13750 encoding, and will be in that form after decoding.
13751 (Currently unused.)
13752 .It Cd x11-bitmap
13753 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
13754 icon to be used to visually denote the presence of this kind of data.
13755 This field is not used by \*(UA.
13757 .It Cd x-mailx-async
13758 Extension flag field that denotes that the given
13759 .Cd view
13760 command shall be executed asynchronously, without blocking \*(UA.
13761 Cannot be used in conjunction with
13762 .Cd needsterminal ;
13763 the standard output of the command will go to
13764 .Pa /dev/null .
13766 .It Cd x-mailx-noquote
13767 An extension flag field that indicates that even a
13768 .Cd copiousoutput
13769 .Cd view
13770 command shall not be used when
13771 .Va quote Ns
13772 ing messages, as it would by default.
13774 .It Cd x-mailx-test-once
13775 Extension flag which denotes whether the given
13776 .Cd test
13777 command shall be evaluated once only with its exit status being cached.
13778 This is handy if some global unchanging condition is to be queried, like
13779 .Dq running under the X Window System .
13781 .It Cd x-mailx-tmpfile
13782 Extension flag field that requests creation of a zero-sized temporary
13783 file, the name of which is to be placed in the environment variable
13784 .Ev MAILX_FILENAME_TEMPORARY .
13785 It is an error to use this flag with commands that include a
13786 .Ql %s
13787 format (because that is implemented by means of this temporary file).
13789 .It Cd x-mailx-tmpfile-fill
13790 Normally the MIME part content is passed to the handler via standard
13791 input; if this flag is set then the data will instead be written into
13792 the implied
13793 .Cd x-mailx-tmpfile .
13794 In order to cause deletion of the temporary file you will have to set
13795 .Cd x-mailx-tmpfile-unlink
13796 explicitly!
13797 It is an error to use this flag with commands that include a
13798 .Ql %s
13799 format.
13801 .It Cd x-mailx-tmpfile-unlink
13802 Extension flag field that requests that the temporary file shall be
13803 deleted automatically when the command loop is entered again at latest.
13804 It is an error to use this flag with commands that include a
13805 .Ql %s
13806 format, or in conjunction with
13807 .Cd x-mailx-async .
13808 .Cd x-mailx-tmpfile
13809 is implied.
13811 .It Cd x-mailx-last-resort
13812 An extension flag that indicates that this handler shall only be used
13813 as a last resort, when no other source (see
13814 .Sx "HTML mail and MIME attachments" )
13815 provides a MIME handler.
13817 .It Cd x-mailx-ignore
13818 An extension that enforces that this handler is not used at all.
13821 The standard includes the possibility to define any number of additional
13822 fields, prefixed by
13823 .Ql x- .
13824 Flag fields apply to the entire
13825 .Dq Mailcap
13826 entry \(em in some unusual cases, this may not be desirable, but
13827 differentiation can be accomplished via separate entries, taking
13828 advantage of the fact that subsequent entries are searched if an earlier
13829 one does not provide enough information.
13830 For example, if a
13831 .Cd view
13832 command needs to specify the
13833 .Cd needsterminal
13834 flag, but the
13835 .Cd compose
13836 command shall not, the following will help out the latter:
13837 .Bd -literal -offset indent
13838 application/postscript; ps-to-terminal %s; needsterminal
13839 application/postscript; ps-to-terminal %s; compose=idraw %s
13842 In value parts of command fields any occurrence of the format string
13843 .Ql %t
13844 will be replaced by the
13845 .Ql TYPE/SUBTYPE
13846 specification.
13847 Any named parameter from a messages'
13848 .Ql Content-type:
13849 field may be embedded into the command line using the format
13850 .Ql %{
13851 followed by the parameter name and a closing brace
13852 .Ql }
13853 character.
13854 The entire parameter should appear as a single command line argument,
13855 regardless of embedded spaces, shell quoting will be performed by the
13856 RFC 1524 processor, thus:
13857 .Bd -literal -offset indent
13858 # Message
13859 Content-type:  multipart/mixed; boundary=42
13861 # Mailcap file
13862 multipart/*; /usr/local/bin/showmulti \e
13863   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
13865 # Executed shell command
13866 /usr/local/bin/showmulti multipart/mixed 42
13869 Note that \*(UA does not support handlers for multipart MIME parts as
13870 shown in this example (as of today).
13871 It does not support the additional formats
13872 .Ql %n
13874 .Ql %F .
13875 An example file, also showing how to properly deal with the expansion of
13876 .Ql %s ,
13877 which includes any quotes that are necessary to make it a valid shell
13878 argument by itself and thus will cause undesired behaviour when placed
13879 in additional user-provided quotes:
13880 .Bd -literal -offset indent
13881 # Comment line
13882 text/richtext; richtext %s; copiousoutput
13884 text/x-perl; perl -cWT %s; nametemplate = %s.pl
13886 # Exit EX_TEMPFAIL=75 on signal
13887 application/pdf; \e
13888   infile=%s\e; \e
13889     trap "rm -f ${infile}" EXIT\e; \e
13890     trap "exit 75" INT QUIT TERM\e; \e
13891     mupdf "${infile}"; \e
13892   test = [ -n "${DISPLAY}" ]; \e
13893   nametemplate = %s.pdf; x-mailx-async
13894 application/pdf; pdftotext -layout - -; copiousoutput
13896 application/*; echo "This is \e\e"%t\e\e" but \e
13897     is 50 \e% Greek to me" \e; < %s head -c 512 | cat -vet; \e
13898   copiousoutput; x-mailx-noquote; x-mailx-last-resort
13901 Further reading:
13902 .Sx "HTML mail and MIME attachments" ,
13903 .Sx "The mime.types files" ,
13904 .Ic mimetype ,
13905 .Ev MAILCAPS ,
13906 .Va mime-counter-evidence ,
13907 .Va pipe-TYPE/SUBTYPE ,
13908 .Va pipe-EXTENSION .
13909 .Ss "The .netrc file"
13910 User credentials for machine accounts (see
13911 .Sx "On URL syntax and credential lookup" )
13912 can be placed in the
13913 .Pa .netrc
13914 file, which will be loaded and cached when requested by
13915 .Va netrc-lookup .
13916 The default location
13917 .Pa \*(VN
13918 may be overridden by the
13919 .Ev NETRC
13920 environment variable.
13921 As long as syntax constraints are honoured the file source may be
13922 replaced with the output of the shell command set in
13923 .Va netrc-pipe ,
13924 to load an encrypted file, for example.
13925 The cache can be managed with the command
13926 .Ic netrc .
13928 The file consists of space, tabulator or newline separated tokens.
13929 This parser implements a superset of the original BSD syntax, but users
13930 should nonetheless be aware of portability glitches, shall their
13931 .Pa .netrc
13932 be usable across multiple programs and platforms:
13934 .Bl -bullet -compact
13936 BSD only supports double quotation marks, for example
13937 .Ql password """pass with spaces""" .
13939 BSD (only?) supports escaping of single characters via a reverse solidus
13940 (a space could be escaped via
13941 .Ql \e\0 ) ,
13942 in- as well as outside of a quoted string.
13943 This method is assumed to be present, and will actively be used to quote
13944 double quotation marks
13945 .Ql \&"
13946 and reverse solidus
13947 .Ql \e
13948 characters inside the
13949 .Cd login
13951 .Cd password
13952 tokens, for example for display purposes.
13954 BSD does not require a final quotation mark of the last user input token.
13956 The original BSD (Berknet) parser also supported a format which allowed
13957 tokens to be separated with commas \(en whereas at least Hewlett-Packard
13958 still seems to support this syntax, this parser does not!
13960 As a non-portable extension some widely-used programs support
13961 shell-style comments: if an input line starts, after any amount of
13962 whitespace, with a number sign
13963 .Ql # ,
13964 then the rest of the line is ignored.
13966 Whereas other programs may require that the
13967 .Pa .netrc
13968 file is accessible by only the user if it contains a
13969 .Cd password
13970 token for any other
13971 .Cd login
13972 than
13973 .Dq anonymous ,
13974 this parser will always require these strict permissions.
13977 Of the following list of supported tokens this parser uses (and caches)
13978 .Cd machine ,
13979 .Cd login
13981 .Cd password .
13982 An existing
13983 .Cd default
13984 entry will not be used.
13985 .Bl -tag -width ".It Cd BaNg"
13986 .It Cd machine Ar name
13987 The hostname of the entries' machine, lowercase-normalized before use.
13988 Any further file content, until either end-of-file or the occurrence
13989 of another
13990 .Cd machine
13991 or a
13992 .Cd default
13993 first-class token is bound (only related) to the machine
13994 .Ar name .
13996 As an extension that should not be the cause of any worries this parser
13997 supports a single wildcard prefix for
13998 .Ar name :
13999 .Bd -literal -offset indent
14000 machine *.example.com login USER password PASS
14001 machine pop3.example.com login USER password PASS
14002 machine smtp.example.com login USER password PASS
14005 which would match
14006 .Ql xy.example.com
14007 as well as
14008 .Ql pop3.example.com ,
14009 but neither
14010 .Ql example.com
14012 .Ql local.smtp.example.com .
14013 In the example neither
14014 .Ql pop3.example.com
14016 .Ql smtp.example.com
14017 will be matched by the wildcard, since the exact matches take
14018 precedence (it is however faster to specify it the other way around).
14019 .It Cd default
14020 This is the same as
14021 .Cd machine
14022 except that it is a fallback entry that is used shall none of the
14023 specified machines match; only one default token may be specified,
14024 and it must be the last first-class token.
14025 .It Cd login Ar name
14026 The user name on the remote machine.
14027 .It Cd password Ar string
14028 The user's password on the remote machine.
14029 .It Cd account Ar string
14030 Supply an additional account password.
14031 This is merely for FTP purposes.
14032 .It Cd macdef Ar name
14033 Define a macro.
14034 A macro is defined with the specified
14035 .Ar name ;
14036 it is formed from all lines beginning with the next line and continuing
14037 until a blank line is (consecutive newline characters are) encountered.
14038 (Note that
14039 .Cd macdef
14040 entries cannot be utilized by multiple machines, too, but must be
14041 defined following the
14042 .Ic machine
14043 they are intended to be used with.)
14044 If a macro named
14045 .Ar init
14046 exists, it is automatically run as the last step of the login process.
14047 This is merely for FTP purposes.
14049 .Sh EXAMPLES
14050 .Ss "An example configuration"
14051 .Bd -literal -offset indent
14052 # This example assumes v15.0 compatibility mode
14053 set v15-compat
14055 # Request strict TLL transport layer security checks
14056 set tls-verify=strict
14058 # Where are the up-to-date TLS certificates?
14059 # (Since we manage up-to-date ones explicitly, do not use any,
14060 # possibly outdated, default certificates shipped with OpenSSL)
14061 #set tls-ca-dir=/etc/ssl/certs
14062 set tls-ca-file=/etc/ssl/certs/ca-certificates.crt
14063 set tls-ca-no-defaults
14064 #set tls-ca-flags=partial-chain
14065 wysh set smime-ca-file="${tls-ca-file}" \e
14066   smime-ca-no-defaults #smime-ca-flags="${tls-ca-flags}"
14068 # This could be outsourced to a central configuration file via
14069 # tls-config-file plus tls-config-module if the used library allows.
14070 # CipherString: explicitly define the list of ciphers, which may
14071 #   improve security, especially with protocols older than TLS v1.2.
14072 #   See ciphers(1).  Possibly best to only use tls-config-pairs-HOST
14073 #   (or -USER@HOST), as necessary, again..
14074 #   Note that TLSv1.3 uses Ciphersuites= instead, which will join
14075 #   with CipherString (if protocols older than v1.3 are allowed)
14076 # Curves: especially with TLSv1.3 curves selection may be desired.
14077 # MinProtocol,MaxProtocol: do not use protocols older than TLS v1.2.
14078 #   Change this only when the remote server does not support it:
14079 #   maybe use chain support via tls-config-pairs-HOST / -USER@HOST
14080 #   to define such explicit exceptions, then, e.g.,
14081 #     MinProtocol=TLSv1.1
14082 if "$tls-features" =% ,+ctx-set-maxmin-proto,
14083   wysh set tls-config-pairs='\e
14084       CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
14085       Curves=P-521:P-384:P-256,\e
14086       MinProtocol=TLSv1.1'
14087 else
14088   wysh set tls-config-pairs='\e
14089       CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
14090       Curves=P-521:P-384:P-256,\e
14091       Protocol=-ALL\e,+TLSv1.1 \e, +TLSv1.2\e, +TLSv1.3'
14092 endif
14094 # Essential setting: select allowed character sets
14095 set sendcharsets=utf-8,iso-8859-1
14097 # A very kind option: when replying to a message, first try to
14098 # use the same encoding that the original poster used herself!
14099 set reply-in-same-charset
14101 # When replying, do not merge From: and To: of the original message
14102 # into To:.  Instead old From: -> new To:, old To: -> merge Cc:.
14103 set recipients-in-cc
14105 # When sending messages, wait until the Mail-Transfer-Agent finishs.
14106 # Only like this you will be able to see errors reported through the
14107 # exit status of the MTA (including the built-in SMTP one)!
14108 set sendwait
14110 # Only use built-in MIME types, no mime.types(5) files
14111 set mimetypes-load-control
14113 # Default directory where we act in (relative to $HOME)
14114 set folder=mail
14115 # A leading "+" (often) means: under *folder*
14116 # *record* is used to save copies of sent messages
14117 set MBOX=+mbox.mbox DEAD=+dead.txt \e
14118   record=+sent.mbox record-files record-resent
14120 # Make "file mymbox" and "file myrec" go to..
14121 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
14123 # Not really optional, e.g., for S/MIME
14124 set from='Your Name <address@exam.ple>'
14126 # It may be necessary to set hostname and/or smtp-hostname
14127 # if the "SERVER" of mta and "domain" of from do not match.
14128 # The `urlencode' command can be used to encode USER and PASS
14129 set mta=(smtps?|submissions?)://[USER[:PASS]@]SERVER[:PORT] \e
14130   smtp-auth=login/plain... \e
14131   smtp-use-starttls
14133 # Never refuse to start into interactive mode, and more
14134 set emptystart \e
14135   colour-pager crt= \e
14136   followup-to followup-to-honour=ask-yes fullnames \e
14137   history-file=+.\*(uAhist history-size=-1 history-gabby \e
14138   mime-counter-evidence=0b1111 \e
14139   prompt='?\e$?!\e$!/\e$^ERRNAME[\e$account#\e$mailbox-display]? ' \e
14140   reply-to-honour=ask-yes \e
14141   umask=
14143 # Only include the selected header fields when typing messages
14144 headerpick type retain from_ date from to cc subject \e
14145   message-id mail-followup-to reply-to
14146 # ...when forwarding messages
14147 headerpick forward retain subject date from to cc
14148 # ...when saving message, etc.
14149 #headerpick save ignore ^Original-.*$ ^X-.*$
14151 # Some mailing lists
14152 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
14153 mlsubscribe '^xfans@xfans\e.xyz$'
14155 # Handle a few file extensions (to store MBOX databases)
14156 filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
14157   gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
14158   zst 'zstd -dc' 'zstd -19 -zc' \e
14159   zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
14161 # A real life example of a very huge free mail provider
14162 # Instead of directly placing content inside `account',
14163 # we `define' a macro: like that we can switch "accounts"
14164 # from within *on-compose-splice*, for example!
14165 define XooglX {
14166   set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
14167   set from='Your Name <address@examp.ple>'
14169   set pop3-no-apop-pop.gmXil.com
14170   shortcut pop %:pop3s://pop.gmXil.com
14171   shortcut imap %:imaps://imap.gmXil.com
14172   # Or, entirely IMAP based setup
14173   #set folder=imaps://imap.gmail.com record="+[Gmail]/Sent Mail" \e
14174   #   imap-cache=~/spool/cache
14176   set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
14177   # Alternatively:
14178   set mta=smtps://USER:PASS@smtp.gmail.com:465
14180 account XooglX {
14181   \ecall XooglX
14184 # Here is a pretty large one which does not allow sending mails
14185 # if there is a domain name mismatch on the SMTP protocol level,
14186 # which would bite us if the value of from does not match, e.g.,
14187 # for people who have a sXXXXeforge project and want to speak
14188 # with the mailing list under their project account (in from),
14189 # still sending the message through their normal mail provider
14190 define XandeX {
14191   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
14192   set from='Your Name <address@exam.ple>'
14194   shortcut pop %:pop3s://pop.yaXXex.com
14195   shortcut imap %:imaps://imap.yaXXex.com
14197   set mta=smtps://USER:PASS@smtp.yaXXex.com:465 \e
14198     hostname=yaXXex.com smtp-hostname=
14200 account XandeX {
14201   \ecall Xandex
14204 # Create some new commands so that, e.g., `ls /tmp' will..
14205 commandalias lls '!ls ${LS_COLOUR_FLAG} -aFlrS'
14206 commandalias llS '!ls ${LS_COLOUR_FLAG} -aFlS'
14208 set pipe-message/external-body='?* echo $MAILX_EXTERNAL_BODY_URL'
14210 # We do not support gpg(1) directly yet.  But simple --clearsign'd
14211 # message parts can be dealt with as follows:
14212 define V {
14213   localopts yes
14214   wysh set pipe-text/plain=$'?*#++=?\e
14215     < "${MAILX_FILENAME_TEMPORARY}" awk \e
14216         -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
14217       BEGIN{done=0}\e
14218       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
14219         if(done++ != 0)\e
14220           next;\e
14221         print "--- GPG --verify ---";\e
14222         system("gpg --verify " TMPFILE " 2>&1");\e
14223         print "--- GPG --verify ---";\e
14224         print "";\e
14225         next;\e
14226       }\e
14227       /^-----BEGIN PGP SIGNATURE-----/,\e
14228           /^-----END PGP SIGNATURE-----/{\e
14229         next;\e
14230       }\e
14231       {print}\e
14232     \e''
14233     print
14235 commandalias V '\e'call V
14238 When storing passwords in
14239 .Pa \*(ur
14240 appropriate permissions should be set on this file with
14241 .Ql $ chmod 0600 \*(ur .
14242 If the \*(OPal
14243 .Va netrc-lookup
14244 is available user credentials can be stored in the central
14245 .Pa \*(VN
14246 file instead; e.g., here is a different version of the example account
14247 that sets up SMTP and POP3:
14248 .Bd -literal -offset indent
14249 define XandeX {
14250   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
14251   set from='Your Name <address@exam.ple>'
14252   set netrc-lookup
14253   # Load an encrypted ~/.netrc by uncommenting the next line
14254   #set netrc-pipe='gpg -qd ~/.netrc.pgp'
14256   set mta=smtps://smtp.yXXXXx.ru:465 \e
14257       smtp-hostname= hostname=yXXXXx.com
14258   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
14259   commandalias xp fi pop3s://pop.yXXXXx.ru
14261 account XandeX {
14262   \ecall XandeX
14266 and, in the
14267 .Pa \*(VN
14268 file:
14269 .Bd -literal -offset indent
14270 machine *.yXXXXx.ru login USER password PASS
14273 This configuration should now work just fine:
14275 .Dl $ echo text | \*(uA -dvv -AXandeX -s Subject user@exam.ple
14276 .Ss "S/MIME step by step"
14277 \*(OP The first thing that is needed for
14278 .Sx "Signed and encrypted messages with S/MIME"
14279 is a personal certificate, and a private key.
14280 The certificate contains public information, in particular a name and
14281 email address(es), and the public key that can be used by others to
14282 encrypt messages for the certificate holder (the owner of the private
14283 key), and to
14284 .Ic verify
14285 signed messages generated with that certificate('s private key).
14286 Whereas the certificate is included in each signed message, the private
14287 key must be kept secret.
14288 It is used to decrypt messages that were previously encrypted with the
14289 public key, and to sign messages.
14291 For personal use it is recommended to get a S/MIME certificate from
14292 one of the major CAs on the Internet.
14293 Many CAs offer such certificates for free.
14294 Usually offered is a combined certificate and private key in PKCS#12
14295 format which \*(UA does not accept directly.
14296 To convert it to PEM format, the following shell command can be used;
14297 please read on for how to use these PEM files.
14298 .Bd -literal -offset indent
14299 $ openssl pkcs12 -in cert.p12 -out certpem.pem -clcerts -nodes
14300 $ # Alternatively
14301 $ openssl pkcs12 -in cert.p12 -out cert.pem -clcerts -nokeys
14302 $ openssl pkcs12 -in cert.p12 -out key.pem -nocerts -nodes
14305 There is also
14306 .Lk https://www.CAcert.org
14307 which issues client and server certificates to members of their
14308 community for free; their root certificate
14309 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
14310 is often not in the default set of trusted CA root certificates, though,
14311 which means their root certificate has to be downloaded separately,
14312 and needs to be part of the S/MIME certificate validation chain by
14313 including it in
14314 .Va smime-ca-dir
14315 or as a vivid member of the
14316 .Va smime-ca-file .
14317 But let us take a step-by-step tour on how to setup S/MIME with
14318 a certificate from CAcert.org despite this situation!
14320 First of all you will have to become a member of the CAcert.org
14321 community, simply by registrating yourself via the web interface.
14322 Once you are, create and verify all email addresses you want to be able
14323 to create signed and encrypted messages for/with using the corresponding
14324 entries of the web interface.
14325 Now ready to create S/MIME certificates, so let us create a new
14326 .Dq client certificate ,
14327 ensure to include all email addresses that should be covered by the
14328 certificate in the following web form, and also to use your name as the
14329 .Dq common name .
14331 Create a private key and a certificate request on your local computer
14332 (please see the manual pages of the used commands for more in-depth
14333 knowledge on what the used arguments etc. do):
14335 .Dl $ openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
14337 Afterwards copy-and-paste the content of
14338 .Dq creq.pem
14339 into the certificate-request (CSR) field of the web form on the
14340 CAcert.org website (you may need to unfold some
14341 .Dq advanced options
14342 to see the corresponding text field).
14343 This last step will ensure that your private key (which never left your
14344 box) and the certificate belong together (through the public key that
14345 will find its way into the certificate via the certificate-request).
14346 You are now ready and can create your CAcert certified certificate.
14347 Download and store or copy-and-paste it as
14348 .Dq pub.crt .
14350 Yay.
14351 In order to use your new S/MIME setup a combined private key/public key
14352 (certificate) file has to be created:
14354 .Dl $ cat key.pem pub.crt > ME@HERE.com.paired
14356 This is the file \*(UA will work with.
14357 If you have created your private key with a passphrase then \*(UA will
14358 ask you for it whenever a message is signed or decrypted, unless this
14359 operation has been automated as described in
14360 .Sx "Signed and encrypted messages with S/MIME" .
14361 Set the following variables to henceforth use S/MIME (setting
14362 .Va smime-ca-file
14363 is of interest for verification only):
14364 .Bd -literal -offset indent
14365 ? set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
14366     smime-sign-cert=ME@HERE.com.paired \e
14367     smime-sign-digest=SHA512 \e
14368     smime-sign from=myname@my.host
14370 .Ss "Using CRLs with S/MIME or TLS"
14371 \*(OP Certification authorities (CAs) issue certificate revocation
14372 lists (CRLs) on a regular basis.
14373 These lists contain the serial numbers of certificates that have been
14374 declared invalid after they have been issued.
14375 Such usually happens because the private key for the certificate has
14376 been compromised,
14377 because the owner of the certificate has left the organization that is
14378 mentioned in the certificate, etc.
14379 To seriously use S/MIME or TLS verification,
14380 an up-to-date CRL is required for each trusted CA.
14381 There is otherwise no method to distinguish between valid and
14382 invalidated certificates.
14383 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
14384 the Internet, so they have to be retrieved by some external mechanism.
14386 \*(UA accepts CRLs in PEM format only;
14387 CRLs in DER format must be converted, like, e.\|g.:
14389 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
14391 To tell \*(UA about the CRLs, a directory that contains all CRL files
14392 (and no other files) must be created.
14394 .Va smime-crl-dir
14396 .Va tls-crl-dir
14397 variables, respectively, must then be set to point to that directory.
14398 After that, \*(UA requires a CRL to be present for each CA that is used
14399 to verify a certificate.
14400 .Sh "FAQ"
14401 In general it is a good idea to turn on
14402 .Va debug
14403 .Pf ( Fl d )
14404 and / or
14405 .Va verbose
14406 .Pf ( Fl v ,
14407 twice) if something does not work well.
14408 Very often a diagnostic message can be produced that leads to the
14409 problems' solution.
14410 .Ss "\*(UA shortly hangs on startup"
14411 This can have two reasons, one is the necessity to wait for a file lock
14412 and cannot be helped, the other being that \*(UA calls the function
14413 .Xr uname 2
14414 in order to query the nodename of the box (sometimes the real one is
14415 needed instead of the one represented by the internal variable
14416 .Va hostname ) .
14417 One may have varying success by ensuring that the real hostname and
14418 .Ql localhost
14419 have entries in
14420 .Pa /etc/hosts ,
14421 or, more generally, that the name service is properly setup \(en
14422 and does
14423 .Xr hostname 1
14424 return the expected value?
14425 Does this local hostname have a domain suffix?
14426 RFC 6762 standardized the link-local top-level domain
14427 .Ql .local ,
14428 try again after adding an (additional) entry with this extension.
14429 .Ss "I cannot login to Google mail \&(via OAuth\&)"
14430 Since 2014 some free service providers classify programs as
14431 .Dq less secure
14432 unless they use a special authentication method (OAuth 2.0) which
14433 was not standardized for non-HTTP protocol authentication token query
14434 until August 2015 (RFC 7628).
14436 Different to Kerberos / GSSAPI, which is developed since the mid of the
14437 1980s, where a user can easily create a local authentication ticket for
14438 her- and himself with the locally installed
14439 .Xr kinit 1
14440 program, that protocol has no such local part but instead requires
14441 a world-wide-web query to create or fetch a token; since there is no
14442 local cache this query would have to be performed whenever \*(UA is
14443 invoked (in interactive sessions situation may differ).
14445 \*(UA does not directly support OAuth.
14446 It, however, supports XOAUTH2 / OAUTHBEARER, see
14447 .Sx "But, how about XOAUTH2 / OAUTHBEARER?"
14448 If that is not used it is necessary to declare \*(UA a
14449 .Dq less secure app
14450 (on the providers account web page) in order to read and send mail.
14451 However, it also seems possible to take the following steps instead:
14453 .Bl -enum -compact
14455 give the provider the number of a mobile phone,
14457 enable
14458 .Dq 2-Step Verification ,
14460 create an application specific password (16 characters), and
14462 use that special password instead of the real Google account password in
14463 \*(UA (for more on that see the section
14464 .Sx "On URL syntax and credential lookup" ) .
14466 .Ss "But, how about XOAUTH2 / OAUTHBEARER?"
14467 Following up
14468 .Sx "I cannot login to Google mail \&(via OAuth\&)"
14469 one OAuth-based authentication method is available:
14470 the OAuth 2.0 bearer token usage as standardized in RFC 6750 (according
14471 SASL mechanism in RFC 7628), also known as XOAUTH2 and OAUTHBEARER,
14472 allows fetching a temporary access token via the web that can locally be
14473 used as a
14474 .Va password .
14475 The protocol is simple and extendable, token updates or even password
14476 changes via a simple TLS secured server login would be possible in
14477 theory, but today a web browser and an external support tool are
14478 prerequisites for using this authentication method.
14479 The token times out and must be periodically refreshed via the web.
14481 Some hurdles must be taken before being able to use this method.
14482 Using GMail as an example, an application (that is a name) must be
14483 registered, for which credentials, a
14484 .Dq client ID
14485 and a
14486 .Dq client secret ,
14487 need to be created and saved locally (in a secure way).
14488 These initial configuration steps can be performed at
14489 .Lk https://console.developers.google.com/apis/credentials .
14490 Thereafter a refresh token can be requested;
14491 a python program to do this for GMail accounts is
14492 .Lk https://github.com/google/\:gmail-oauth2-tools/\:raw/\:\
14493 master/\:python/\:oauth2.py :
14494 .Bd -literal -offset indent
14495 $ python oauth2.py --user=EMAIL \e
14496   --client-id=THE-ID --client-secret=THE-SECRET \e
14497   --generate_oauth2_token
14498 To authorize token, visit this url and follow the directions:
14499   https://accounts.google.com/o/oauth2/auth?client_id=...
14500   Enter verification code: ...
14501   Refresh Token: ...
14502   Access Token: ...
14503   Access Token Expiration Seconds: 3600
14504 $ # Of which the last three are actual token responses.
14505 $ # Thereafter access tokens can regularly be refreshed
14506 $ # via the created refresh token (read on)
14509 The generated refresh token must also be saved locally (securely).
14510 The procedure as a whole can be read at
14511 .Lk https://github.com/google/\:gmail-oauth2-tools/\:wiki/\:\
14512 OAuth2DotPyRunThrough .
14513 Since periodic timers are not yet supported, keeping an access token
14514 up-to-date (from within \*(UA) can only be performed via the hook
14515 .Va on-main-loop-tick ,
14516 or (for sending only)
14517 .Va on-compose-enter
14518 (for more on authentication please see the section
14519 .Sx "On URL syntax and credential lookup" ) :
14520 .Bd -literal -offset indent
14521 set on-main-loop-tick=o-m-l-t on-compose-enter=o-c-e
14522 define o-m-l-t {
14523   xcall update_access_token
14525 define o-c-e {
14526   xcall update_access_token
14529 set access_token_=0
14530 define update_access_token {
14531   local set i epoch_sec epoch_nsec
14532   vput vexpr i epoch
14533   eval set $i # set epoch_sec/_nsec of vexpr epoch
14534   vput vexpr i + $access_token_ 2100
14535   if $epoch_sec -ge $i
14536     vput ! password python oauth2.py --user=EMAIL \e
14537         --client-id=THE-ID --client-secret=THE-SECRET \e
14538         --refresh-token=THE-REFRESH-TOKEN |\e
14539       sed '1b PASS;d; :PASS s/^.\e{1,\e}:\e(.\e{1,\e}\e)$/\e1/'
14540     vput csop password trim "$password"
14541     if -n "$verbose"
14542       echo password is <$password>
14543     endif
14544     set access_token_=$epoch_sec
14545   endif
14548 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
14549 Two thinkable situations: the first is a shadowed sequence; setting
14550 .Va debug ,
14551 or the most possible
14552 .Va verbose
14553 mode, causes a printout of the
14554 .Ic bind
14555 tree after that is built; being a cache, this happens only upon startup
14556 or after modifying bindings.
14558 Or second, terminal libraries (see
14559 .Sx "On terminal control and line editor",
14560 .Ic bind ,
14561 .Va termcap )
14562 may report different codes than the terminal really sends, rendering
14563 bindings dysfunctional because expected and received data do not match; the
14564 .Va verbose
14565 listing of
14566 .Ic bind Ns
14567 ings will show the byte sequences that are expected.
14568 (One common source of problems is that the \(em possibly even
14569 non-existing \(em keypad is not turned on, and the resulting layout
14570 reports the keypad control codes for the normal keyboard keys.)
14572 To overcome the situation use for example the program
14573 .Xr cat 1
14574 with its option
14575 .Fl \&\&v ,
14576 if available, to see the byte sequences which are actually produced
14577 by keypresses, and use the variable
14578 .Va termcap
14579 to make \*(UA aware of them.
14580 The terminal this is typed on produces some unexpected sequences,
14581 here for an example the shifted home key:
14582 .Bd -literal -offset indent
14583 ? set verbose
14584 ? bind*
14585 # 1B 5B=[ 31=1 3B=; 32=2 48=H
14586   bind base :kHOM z0
14587 ? x
14588 $ cat -v
14589 ^[[H
14590 $ \*(uA -v -Stermcap='kHOM=\eE[H'
14591 ? bind*
14592 # 1B 5B=[ 48=H
14593   bind base :kHOM z0
14595 .Ss "Can \*(UA git-send-email?"
14596 Yes.
14597 Put (at least parts of) the following in your
14598 .Pa ~/.gitconfig :
14599 .Bd -literal -offset indent
14600 [sendemail]
14601 smtpserver = /usr/bin/\*(uA
14602 smtpserveroption = -t
14603 #smtpserveroption = -Sexpandaddr
14604 smtpserveroption = -Athe-account-you-need
14606 suppresscc = all
14607 suppressfrom = false
14608 assume8bitEncoding = UTF-8
14609 #to = /tmp/OUT
14610 confirm = always
14611 chainreplyto = true
14612 multiedit = false
14613 thread = true
14614 quiet = true
14615 annotate = true
14618 Newer
14619 .Xr git 1
14620 versions (v2.33.0) added the option
14621 .Cm sendmailCmd .
14622 Patches can also be send directly, for example:
14623 .Bd -literal -offset indent
14624 $ git format-patch -M --stdout HEAD^ |
14625   \*(uA -A the-account-you-need -t RECEIVER
14627 .Ss "Howto handle stale dotlock files"
14628 .Ic folder
14629 sometimes fails to open MBOX mail databases because creation of
14630 .Mx -sx
14631 .Sx "dotlock files"
14632 is impossible due to existing but unowned lock files.
14633 \*(UA does not offer an option to deal with those files, because it is
14634 considered a site policy what counts as unowned, and what not.
14635 The site policy is usually defined by administrator(s), and expressed in
14636 the configuration of a locally installed MTA (for example Postfix
14637 .Ql stale_lock_time=500s ) .
14638 Therefore the suggestion:
14639 .Bd -literal -offset indent
14640 $ </dev/null \*(uA -s 'MTA: be no frog, handle lock' $LOGNAME
14643 By sending a mail to yourself the local MTA can use its normal queue
14644 mechanism to try the delivery multiple times, finally decide a lock file
14645 has become stale, and remove it.
14646 .Sh "IMAP CLIENT"
14647 \*(OPally there is IMAP client support available.
14648 This part of the program is obsolete and will vanish in v15 with the
14649 large MIME and I/O layer rewrite, because it uses old-style blocking I/O
14650 and makes excessive use of signal based long code jumps.
14651 Support can hopefully be readded later based on a new-style I/O, with
14652 SysV signal handling.
14653 In fact the IMAP support had already been removed from the codebase, but
14654 was reinstantiated on user demand: in effect the IMAP code is at the
14655 level of \*(UA v14.8.16 (with
14656 .Ic imapcodec
14657 being the sole exception), and should be treated with some care.
14659 IMAP uses the
14660 .Ql imap://
14662 .Ql imaps://
14663 protocol prefixes, and an IMAP-based
14664 .Va folder
14665 may be used.
14666 IMAP URLs (paths) undergo inspections and possible transformations
14667 before use (and the command
14668 .Ic imapcodec
14669 can be used to manually apply them to any given argument).
14670 Hierarchy delimiters are normalized, a step which is configurable via the
14671 .Va imap-delim
14672 variable chain, but defaults to the first seen delimiter otherwise.
14673 \*(UA supports internationalised IMAP names, and en- and decodes the
14674 names from and to the
14675 .Va ttycharset
14676 as necessary and possible.
14677 If a mailbox name is expanded (see
14678 .Sx "Filename transformations" )
14679 to an IMAP mailbox, all names that begin with `+' then refer to IMAP
14680 mailboxes below the
14681 .Va folder
14682 target box, while folder names prefixed by `@' refer to folders below
14683 the hierarchy base, so the following will list all folders below the
14684 current one when in an IMAP mailbox:
14685 .Ql folders @ .
14687 Note: some IMAP servers do not accept the creation of mailboxes in
14688 the hierarchy base, but require that they are created as subfolders of
14689 `INBOX' \(en with such servers a folder name of the form
14691 .Dl imaps://mylogin@imap.myisp.example/INBOX.
14693 should be used (the last character is the server's hierarchy
14694 delimiter).
14695 The following IMAP-specific commands exist:
14696 .Bl -tag -width ".It Ic BaNg"
14698 .It Ic cache
14699 Only applicable to cached IMAP mailboxes;
14700 takes a message list and reads the specified messages into the IMAP
14701 cache.
14703 .It Ic connect
14704 If operating in disconnected mode on an IMAP mailbox,
14705 switch to online mode and connect to the mail server while retaining
14706 the mailbox status.
14707 See the description of the
14708 .Va disconnected
14709 variable for more information.
14711 .It Ic disconnect
14712 If operating in online mode on an IMAP mailbox,
14713 switch to disconnected mode while retaining the mailbox status.
14714 See the description of the
14715 .Va disconnected
14716 variable for more.
14717 A list of messages may optionally be given as argument;
14718 the respective messages are then read into the cache before the
14719 connection is closed, thus
14720 .Ql disco *
14721 makes the entire mailbox available for disconnected use.
14723 .It Ic imap
14724 Sends command strings directly to the current IMAP server.
14725 \*(UA operates always in IMAP `selected state' on the current mailbox;
14726 commands that change this will produce undesirable results and should be
14727 avoided.
14728 Useful IMAP commands are:
14729 .Bl -tag -offset indent -width ".Ic getquotearoot"
14730 .It create
14731 Takes the name of an IMAP mailbox as an argument and creates it.
14732 .It getquotaroot
14733 (RFC 2087) Takes the name of an IMAP mailbox as an argument
14734 and prints the quotas that apply to the mailbox.
14735 Not all IMAP servers support this command.
14736 .It namespace
14737 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
14738 the Other User's Namespaces and the Shared Namespaces.
14739 Each namespace type is printed in parentheses;
14740 if there are multiple namespaces of the same type,
14741 inner parentheses separate them.
14742 For each namespace a prefix and a hierarchy separator is listed.
14743 Not all IMAP servers support this command.
14746 .It Ic imapcodec
14747 Perform IMAP path transformations.
14748 Supports
14749 .Cm vput
14750 (see
14751 .Sx "Command modifiers" ) ,
14752 and manages the error number
14753 .Va \&! .
14754 The first argument specifies the operation:
14755 .Ar e[ncode]
14756 normalizes hierarchy delimiters (see
14757 .Va imap-delim )
14758 and converts the strings from the locale
14759 .Va ttycharset
14760 to the internationalized variant used by IMAP,
14761 .Ar d[ecode]
14762 performs the reverse operation.
14763 Encoding will honour the (global) value of
14764 .Va imap-delim .
14767 The following IMAP-specific internal variables exist:
14768 .Bl -tag -width ".It Va BaNg"
14770 .It Va disconnected
14771 \*(BO When an IMAP mailbox is selected and this variable is set,
14772 no connection to the server is initiated.
14773 Instead, data is obtained from the local cache (see
14774 .Va imap-cache Ns
14776 Mailboxes that are not present in the cache
14777 and messages that have not yet entirely been fetched from the server
14778 are not available;
14779 to fetch all messages in a mailbox at once,
14780 the command
14781 .No ` Ns Li copy * /dev/null Ns '
14782 can be used while still in connected mode.
14783 Changes that are made to IMAP mailboxes in disconnected mode are queued
14784 and committed later when a connection to that server is made.
14785 This procedure is not completely reliable since it cannot be guaranteed
14786 that the IMAP unique identifiers (UIDs) on the server still match the
14787 ones in the cache at that time.
14788 Data is saved to
14789 .Ev DEAD
14790 when this problem occurs.
14791 .It Va disconnected-USER@HOST
14792 The specified account is handled as described for the
14793 .Va disconnected
14794 variable above,
14795 but other accounts are not affected.
14796 .Mx Va imap-auth
14797 .It Va imap-auth-USER@HOST , imap-auth
14798 Sets the IMAP authentication method.
14799 Supported are the default
14800 .Ql login
14801 (called
14802 .Ql plain
14803 by some servers),
14804 \*(IN
14805 .Ql oauthbearer
14806 (see
14807 .Sx FAQ
14808 entry
14809 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" ) ,
14810 \*(IN
14811 .Ql external
14813 .Ql externanon
14814 (for TLS secured connections which pass a client certificate via
14815 .Va tls-config-pairs ) ,
14816 as well as the \*(OPal
14817 .Ql cram-md5
14819 .Ql gssapi .
14820 All methods need a
14821 .Va user
14822 and a
14823 .Va password
14824 except
14825 .Ql gssapi
14827 .Ql external ,
14828 which only need the former.
14829 .Ql externanon
14830 solely builds upon the credentials passed via a client certificate,
14831 and is usually the way to go since tested servers do not actually follow
14832 RFC 4422, and fail if additional credentials are actually passed.
14834 .It Va imap-cache
14835 Enables caching of IMAP mailboxes.
14836 The value of this variable must point to a directory that is either
14837 existent or can be created by \*(UA.
14838 All contents of the cache can be deleted by \*(UA at any time;
14839 it is not safe to make assumptions about them.
14840 .Mx Va imap-delim
14841 .It Va imap-delim-USER@HOST , imap-delim-HOST , imap-delim
14842 The hierarchy separator used by the IMAP server.
14843 Whenever an IMAP path is specified it will undergo normalization.
14844 One of the normalization steps is the squeezing and adjustment of
14845 hierarchy separators.
14846 If this variable is set, any occurrence of any character of the given
14847 value that exists in the path will be replaced by the first member of
14848 the value; an empty value will cause the default to be used, it is
14849 .Ql /. .
14850 If not set, we will reuse the first hierarchy separator character that
14851 is discovered in a user-given mailbox name.
14852 .Mx Va imap-keepalive
14853 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
14854 IMAP servers may close the connection after a period of
14855 inactivity; the standard requires this to be at least 30 minutes,
14856 but practical experience may vary.
14857 Setting this variable to a numeric `value' greater than 0 causes
14858 a `NOOP' command to be sent each `value' seconds if no other operation
14859 is performed.
14861 .It Va imap-list-depth
14862 When retrieving the list of folders on an IMAP server, the
14863 .Ic folders
14864 command stops after it has reached a certain depth to avoid possible
14865 infinite loops.
14866 The value of this variable sets the maximum depth allowed.
14867 The default is 2.
14868 If the folder separator on the current IMAP server is a slash `/',
14869 this variable has no effect and the
14870 .Ic folders
14871 command does not descend to subfolders.
14872 .Mx Va imap-use-starttls
14873 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
14874 Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
14875 IMAP session TLS encrypted.
14876 This functionality is not supported by all servers,
14877 and is not used if the session is already encrypted by the IMAPS method.
14879 .Sh "SEE ALSO"
14880 .Xr bogofilter 1 ,
14881 .Xr gpg 1 ,
14882 .Xr more 1 ,
14883 .Xr newaliases 1 ,
14884 .Xr openssl 1 ,
14885 .Xr sendmail 1 ,
14886 .Xr sh 1 ,
14887 .Xr spamassassin 1 ,
14888 .Xr iconv 3 ,
14889 .Xr setlocale 3 ,
14890 .Xr aliases 5 ,
14891 .Xr termcap 5 ,
14892 .Xr terminfo 5 ,
14893 .Xr locale 7 ,
14894 .Xr mailaddr 7 ,
14895 .Xr re_format 7
14896 .Pf (or\0 Xr regex 7 ) ,
14897 .Xr mailwrapper 8 ,
14898 .Xr sendmail 8
14899 .Sh HISTORY
14900 M. Douglas McIlroy writes in his article
14901 .Dq A Research UNIX Reader: Annotated Excerpts \
14902 from the Programmer's Manual, 1971-1986
14903 that a
14904 .Xr mail 1
14905 command already appeared in First Edition
14907 in 1971:
14908 .Bd -ragged -offset indent
14909 Electronic mail was there from the start.
14910 Never satisfied with its exact behavior, everybody touched it at one
14911 time or another: to assure the safety of simultaneous access, to improve
14912 privacy, to survive crashes, to exploit uucp, to screen out foreign
14913 freeloaders, or whatever.
14914 Not until v7 did the interface change (Thompson).
14915 Later, as mail became global in its reach, Dave Presotto took charge and
14916 brought order to communications with a grab-bag of external networks
14917 (v8).
14921 Mail, in large parts compatible with
14923 mail, was written in 1978 by Kurt Shoens and developed as part of the
14926 distribution until 1995.
14927 This manual page is derived from
14928 .Dq The Mail Reference Manual
14929 that Kurt Shoens wrote for Mail 1.3, included in 3BSD in 1980.
14930 The common
14934 denominator became standardized as
14935 .Xr mailx 1
14936 in the X/Open Portability Guide Issue 2 (January 1987).
14937 After the rise of Open Source
14939 variants
14940 Mail saw continuous development in the individual code forks,
14941 noticeably by Christos Zoulas in
14942 .Pf Net Bx .
14943 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
14944 Ritter in the years 2000 until 2008.
14945 Since 2012 S-nail is maintained by Steffen Nurpmeso.
14947 Electronic mail exchange in general is a concept even older.
14948 The earliest well documented electronic mail system was part of the
14949 Compatible Time Sharing System (CTSS) at MIT, its MAIL command had been
14950 proposed in a staff planning memo at the end of 1964 and was implemented
14951 in mid-1965 when Tom Van Vleck and Noel Morris wrote the necessary code.
14952 Similar communication programs were built for other timesharing systems.
14953 One of the most ambitious and influential was Murray Turoff's EMISARI.
14954 Created in 1971 for the United States Office of Emergency Preparedness,
14955 EMISARI combined private electronic messages with a chat system, public
14956 postings, voting, and a user directory.
14958 During the 1960s it was common to connect a large number of terminals to
14959 a single, central computer.
14960 Connecting two computers together was relatively unusual.
14961 This began to change with the development of the ARPANET, the ancestor
14962 of today's Internet.
14963 In 1971 Ray Tomlinson adapted the SNDMSG program, originally developed
14964 for the University of California at Berkeley timesharing system, to give
14965 it the ability to transmit a message across the network into the mailbox
14966 of a user on a different computer.
14967 For the first time it was necessary to specify the recipient's computer
14968 as well as an account name.
14969 Tomlinson decided that the underused commercial at
14970 .Ql @
14971 would work to separate the two.
14973 Sending a message across the network was originally treated as a special
14974 instance of transmitting a file, and so a MAIL command was included in
14975 RFC 385 on file transfer in 1972.
14976 Because it was not always clear when or where a message had come from,
14977 RFC 561 in 1973 aimed to formalize electronic mail headers, including
14978 .Dq from ,
14979 .Dq date ,
14981 .Dq subject .
14982 In 1975 RFC 680 described fields to help with the transmission of
14983 messages to multiple users, including
14984 .Dq to ,
14985 .Dq cc ,
14987 .Dq bcc .
14988 In 1977 these features and others went from best practices to a binding
14989 standard in RFC 733.
14990 Queen Elizabeth II of England became the first head of state to send
14991 electronic mail on March 26 1976 while ceremonially opening a building
14992 in the British Royal Signals and Radar Establishment (RSRE) in Malvern.
14993 .Sh AUTHORS
14994 .An -nosplit
14995 .An "Kurt Shoens" ,
14996 .An "Edward Wang" ,
14997 .An "Keith Bostic" ,
14998 .An "Christos Zoulas" ,
14999 .An "Gunnar Ritter" .
15000 \*(UA is developed by
15001 .An "Steffen Nurpmeso" Aq s-mailx@lists.sdaoden.eu .
15002 .Sh CAVEATS
15003 \*(ID Interrupting an operation via
15004 .Dv \&\&SIGINT
15006 .Ql control-C
15007 from anywhere else but a command prompt is very problematic and likely
15008 to leave the program in an undefined state: many library functions
15009 cannot deal with the
15010 .Fn siglongjmp 3
15011 that this software (still) performs; even though efforts have been taken
15012 to address this, no sooner but in v15 it will have been worked out:
15013 interruptions have not been disabled in order to allow forceful breakage
15014 of hanging network connections, for example (all this is unrelated to
15015 .Va ignore ) .
15017 The SMTP and POP3 protocol support of \*(UA is very basic.
15018 Also, if it fails to contact its upstream SMTP server, it will not make
15019 further attempts to transfer the message at a later time (setting
15020 .Va save
15022 .Va sendwait
15023 may be useful).
15024 If this is a concern, it might be better to set up a local SMTP server
15025 that is capable of message queuing.
15026 .Sh BUGS
15027 When a network-based mailbox is open, directly changing to another
15028 network-based mailbox of a different protocol (i.e., from POP3 to IMAP
15029 or vice versa) will cause a
15030 .Dq deadlock .
15032 After deleting some message of a POP3 mailbox the header summary falsely
15033 claims that there are no messages to display, one needs to perform
15034 a scroll or dot movement to restore proper state.
15037 .Ql thread Ns
15039 .Ic sort
15040 mode a power user may encounter crashes very occasionally (this is may
15041 and very).
15043 Please report bugs to the
15044 .Va contact-mail
15045 address, for example from within \*(uA:
15046 .Ql \&? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
15047 Including the
15048 .Va verbose
15049 output of the command
15050 .Ic version
15051 may be helpful:
15052 .Bd -literal -offset indent
15053 ? wysh set escape=! verbose; vput version xy; unset verbose;\e
15054   eval mail $contact-mail
15055 Bug subject
15056 !I xy
15060 Information on the web at
15061 .Ql $ \*(uA -X 'echo Ns \| $ Ns Va contact-web Ns ; x' .