Bump S-nail v14.9.9.ar ("Marsh tit savours first spring sun, II"), 2018-03-06
[s-mailx.git] / nail.1
blob3e4e2b0b7a3306dab980445e776421b296f0376f
1 .\"@ nail.1 - S-nail(1) reference manual.
2 .\"
3 .\" Copyright (c) 2000-2008 Gunnar Ritter, Freiburg i. Br., Germany.
4 .\" Copyright (c) 2012 - 2018 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
5 .\"
6 .\" Copyright (c) 1980, 1990, 1993
7 .\"      The Regents of the University of California.  All rights reserved.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\" 3. Neither the name of the University nor the names of its contributors
18 .\"    may be used to endorse or promote products derived from this software
19 .\"    without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .\"@ S-nail v14.9.9 / 2018-03-06
34 .Dd March 06, 2018
35 .ds VV \\%v14.9.9
36 .\"--MKMAN-START--
37 .ds UU \\%S-NAIL
38 .ds UA \\%S-nail
39 .ds uA \\%s-nail
40 .ds UR \\%s-nail.rc
41 .\"--MKMAN-END--
42 .ds ur \\%~/.mailrc
43 .ds OB [Obsolete]
44 .ds OP [Option]
45 .ds IN [v15-compat]
46 .ds OU [no v15-compat]
47 .ds ID [v15 behaviour may differ]
48 .ds NQ [Only new quoting rules]
49 .ds BO (Boolean)
50 .ds RO (Read-only)
51 .Dt "\*(UU" 1
52 .Os
53 .\" Uncomment for mandoc(1) compat.:
54 .\".ds mx-toc-name TABLE OF CONTENTS
55 .Mx -enable -preprocessed
56 .Mx -anchor-spass Sh "NAME" 1
57 .Mx -anchor-spass Sh "SYNOPSIS" 2
58 .Mx -anchor-spass Sh "\*[mx-toc-name]" 3
59 .Mx -anchor-spass Sh "DESCRIPTION" 4
60 .Mx -anchor-spass Ss "Options" 4
61 .Mx -anchor-spass Ss "A starter" 4
62 .Mx -anchor-spass Ss "On sending mail, and non-interactive mode" 4
63 .Mx -anchor-spass Ss "On reading mail, and interactive mode" 4
64 .Mx -anchor-spass Ss "HTML mail and MIME attachments" 4
65 .Mx -anchor-spass Ss "Mailing lists" 4
66 .Mx -anchor-spass Ss "Signed and encrypted messages with S/MIME" 4
67 .Mx -anchor-spass Ss "On URL syntax and credential lookup" 4
68 .Mx -anchor-spass Ss "Encrypted network communication" 4
69 .Mx -anchor-spass Ss "Character sets" 4
70 .Mx -anchor-spass Ss "Message states" 4
71 .Mx -anchor-spass Ss "Specifying messages" 4
72 .Mx -anchor-spass Ss "On terminal control and line editor" 4
73 .Mx -anchor-spass Ss "Coloured display" 4
74 .Mx -anchor-spass Ss "Handling spam" 4
75 .Mx -anchor-spass Sh "COMMANDS" 5
76 .Mx -anchor-spass Ss "Command modifiers" 5
77 .Mx -anchor-spass Ss "Message list arguments" 5
78 .Mx -anchor-spass Ss "Old-style argument quoting" 5
79 .Mx -anchor-spass Ss "Shell-style argument quoting" 5
80 .Mx -anchor-spass Ss "Raw data arguments for codec commands" 5
81 .Mx -anchor-spass Ss "Filename transformations" 5
82 .Mx -anchor-spass Ss "Commands" 5
83 .Mx -anchor-spass Sh "COMMAND ESCAPES" 6
84 .Mx -anchor-spass Sh "INTERNAL VARIABLES" 7
85 .Mx -anchor-spass Ss "Initial settings" 7
86 .Mx -anchor-spass Ss "Variables" 7
87 .Mx -anchor-spass Sh "ENVIRONMENT" 8
88 .Mx -anchor-spass Sh "FILES" 9
89 .Mx -anchor-spass Ss "Resource files" 9
90 .Mx -anchor-spass Ss "The mime.types files" 9
91 .Mx -anchor-spass Ss "The Mailcap files" 9
92 .Mx -anchor-spass Ss "The .netrc file" 9
93 .Mx -anchor-spass Sh "EXAMPLES" 10
94 .Mx -anchor-spass Ss "An example configuration" 10
95 .Mx -anchor-spass Ss "S/MIME step by step" 10
96 .Mx -anchor-spass Ss "Using CRLs with S/MIME or SSL/TLS" 10
97 .Mx -anchor-spass Sh "FAQ" 11
98 .Mx -anchor-spass Ss "\*(UA shortly hangs on startup" 11
99 .Mx -anchor-spass Ss "I cannot login to Google mail aka GMail" 11
100 .Mx -anchor-spass Ss "Not \(dqdefunctional\(dq, but the editor key does not work" 11
101 .Mx -anchor-spass Ss "Can \*(UA git-send-email?" 11
102 .Mx -anchor-spass Sh "IMAP CLIENT" 12
103 .Mx -anchor-spass Sh "SEE ALSO" 13
104 .Mx -anchor-spass Sh "HISTORY" 14
105 .Mx -anchor-spass Sh "AUTHORS" 15
106 .Mx -anchor-spass Sh "CAVEATS" 16
107 .Mx -anchor-spass Sh "BUGS" 17
108 .Mx -anchor-spass Fl ":"
109 .Mx -anchor-spass Fl "A"
110 .Mx -anchor-spass Fl "a"
111 .Mx -anchor-spass ixsx "character set specification"
112 .Mx -anchor-spass Fl "b"
113 .Mx -anchor-spass Fl "C"
114 .Mx -anchor-spass Fl "c"
115 .Mx -anchor-spass Fl "d"
116 .Mx -anchor-spass Fl "E"
117 .Mx -anchor-spass Fl "e"
118 .Mx -anchor-spass Fl "F"
119 .Mx -anchor-spass Fl "f"
120 .Mx -anchor-spass Fl "H"
121 .Mx -anchor-spass Fl "h"
122 .Mx -anchor-spass Fl "i"
123 .Mx -anchor-spass Fl "L"
124 .Mx -anchor-spass Fl "M"
125 .Mx -anchor-spass Fl "m"
126 .Mx -anchor-spass Fl "N"
127 .Mx -anchor-spass Fl "n"
128 .Mx -anchor-spass Fl "q"
129 .Mx -anchor-spass Fl "R"
130 .Mx -anchor-spass Fl "r"
131 .Mx -anchor-spass Fl "S"
132 .Mx -anchor-spass Fl "s"
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 "~"
139 .Mx -anchor-spass Fl "#"
140 .Mx -anchor-spass Fl "."
141 .Mx -anchor-spass Cd "mle-go-home"
142 .Mx -anchor-spass Cd "mle-go-bwd"
143 .Mx -anchor-spass Cd "mle-del-fwd"
144 .Mx -anchor-spass Cd "mle-go-end"
145 .Mx -anchor-spass Cd "mle-go-fwd"
146 .Mx -anchor-spass Cd "mle-reset"
147 .Mx -anchor-spass Cd "mle-del-bwd"
148 .Mx -anchor-spass Cd "mle-complete"
149 .Mx -anchor-spass Cd "mle-commit"
150 .Mx -anchor-spass Cd "mle-snarf-end"
151 .Mx -anchor-spass Cd "mle-repaint"
152 .Mx -anchor-spass Cd "mle-hist-fwd"
153 .Mx -anchor-spass Cd "mle-hist-bwd"
154 .Mx -anchor-spass Cd "mle-quote-rndtrip"
155 .Mx -anchor-spass Cd "mle-hist-srch-bwd"
156 .Mx -anchor-spass Cd "mle-hist-srch-fwd"
157 .Mx -anchor-spass Cd "mle-paste"
158 .Mx -anchor-spass Cd "mle-snarf-line"
159 .Mx -anchor-spass Cd "mle-prompt-char"
160 .Mx -anchor-spass Cd "mle-snarf-word-bwd"
161 .Mx -anchor-spass Cd "mle-go-word-fwd"
162 .Mx -anchor-spass Cd "mle-go-word-bwd"
163 .Mx -anchor-spass Cd "mle-cancel"
164 .Mx -anchor-spass Cd "mle-snarf-word-fwd"
165 .Mx -anchor-spass Cd "mle-fullreset"
166 .Mx -anchor-spass Cd "mle-bell"
167 .Mx -anchor-spass Cm "\e"
168 .Mx -anchor-spass Cm "ignerr"
169 .Mx -anchor-spass Cm "local"
170 .Mx -anchor-spass Cm "scope"
171 .Mx -anchor-spass Cm "u"
172 .Mx -anchor-spass Cm "vput"
173 .Mx -anchor-spass Cm "wysh"
174 .Mx -anchor-spass ixsx "primary system mailbox"
175 .Mx -anchor-spass ixsx "secondary mailbox"
176 .Mx -anchor-spass Ic "!"
177 .Mx -anchor-spass Ic "#"
178 .Mx -anchor-spass Ic "+"
179 .Mx -anchor-spass Ic "-"
180 .Mx -anchor-spass Ic "="
181 .Mx -anchor-spass Ic "?"
182 .Mx -anchor-spass Ic "|"
183 .Mx -anchor-spass Ic "account"
184 .Mx -anchor-spass Ic "unaccount"
185 .Mx -anchor-spass Ic "addrcodec"
186 .Mx -anchor-spass Ic "alias"
187 .Mx -anchor-spass Ic "unalias"
188 .Mx -anchor-spass Ic "alternates"
189 .Mx -anchor-spass Ic "unalternates"
190 .Mx -anchor-spass Ic "answered"
191 .Mx -anchor-spass Ic "unanswered"
192 .Mx -anchor-spass Ic "bind"
193 .Mx -anchor-spass Ic "unbind"
194 .Mx -anchor-spass Ic "call"
195 .Mx -anchor-spass Ic "call_if"
196 .Mx -anchor-spass Ic "cd"
197 .Mx -anchor-spass Ic "certsave"
198 .Mx -anchor-spass Ic "charsetalias"
199 .Mx -anchor-spass Ic "uncharsetalias"
200 .Mx -anchor-spass Ic "chdir"
201 .Mx -anchor-spass Ic "collapse"
202 .Mx -anchor-spass Ic "uncollapse"
203 .Mx -anchor-spass Ic "colour"
204 .Mx -anchor-spass Ic "uncolour"
205 .Mx -anchor-spass Ic "commandalias"
206 .Mx -anchor-spass Ic "uncommandalias"
207 .Mx -anchor-spass Ic "Copy"
208 .Mx -anchor-spass Ic "copy"
209 .Mx -anchor-spass Ic "cwd"
210 .Mx -anchor-spass Ic "Decrypt"
211 .Mx -anchor-spass Ic "decrypt"
212 .Mx -anchor-spass Ic "define"
213 .Mx -anchor-spass Ic "undefine"
214 .Mx -anchor-spass Ic "delete"
215 .Mx -anchor-spass Ic "undelete"
216 .Mx -anchor-spass Ic "discard"
217 .Mx -anchor-spass Ic "dp"
218 .Mx -anchor-spass Ic "dt"
219 .Mx -anchor-spass Ic "dotmove"
220 .Mx -anchor-spass Ic "draft"
221 .Mx -anchor-spass Ic "undraft"
222 .Mx -anchor-spass Ic "echo"
223 .Mx -anchor-spass Ic "echoerr"
224 .Mx -anchor-spass Ic "echon"
225 .Mx -anchor-spass Ic "echoerrn"
226 .Mx -anchor-spass Ic "edit"
227 .Mx -anchor-spass Ic "elif"
228 .Mx -anchor-spass Ic "else"
229 .Mx -anchor-spass Ic "endif"
230 .Mx -anchor-spass Ic "environ"
231 .Mx -anchor-spass Ic "errors"
232 .Mx -anchor-spass Ic "eval"
233 .Mx -anchor-spass Ic "exit"
234 .Mx -anchor-spass Ic "File"
235 .Mx -anchor-spass Ic "file"
236 .Mx -anchor-spass Ic "filetype"
237 .Mx -anchor-spass Ic "unfiletype"
238 .Mx -anchor-spass Ic "flag"
239 .Mx -anchor-spass Ic "unflag"
240 .Mx -anchor-spass Ic "folder"
241 .Mx -anchor-spass Ic "folders"
242 .Mx -anchor-spass Ic "Followup"
243 .Mx -anchor-spass Ic "followup"
244 .Mx -anchor-spass Ic "followupall"
245 .Mx -anchor-spass Ic "followupsender"
246 .Mx -anchor-spass Ic "Forward"
247 .Mx -anchor-spass Ic "forward"
248 .Mx -anchor-spass Ic "from"
249 .Mx -anchor-spass Ic "headerpick"
250 .Mx -anchor-spass Ic "unheaderpick"
251 .Mx -anchor-spass Ic "headers"
252 .Mx -anchor-spass Ic "help"
253 .Mx -anchor-spass Ic "history"
254 .Mx -anchor-spass Ic "hold"
255 .Mx -anchor-spass Ic "if"
256 .Mx -anchor-spass Ic "ignore"
257 .Mx -anchor-spass Ic "list"
258 .Mx -anchor-spass Ic "localopts"
259 .Mx -anchor-spass Ic "Lreply"
260 .Mx -anchor-spass Ic "Mail"
261 .Mx -anchor-spass Ic "mail"
262 .Mx -anchor-spass Ic "mbox"
263 .Mx -anchor-spass Ic "mimetype"
264 .Mx -anchor-spass Ic "unmimetype"
265 .Mx -anchor-spass Ic "mlist"
266 .Mx -anchor-spass Ic "unmlist"
267 .Mx -anchor-spass Ic "mimeview"
268 .Mx -anchor-spass Ic "mlsubscribe"
269 .Mx -anchor-spass Ic "unmlsubscribe"
270 .Mx -anchor-spass Ic "Move"
271 .Mx -anchor-spass Ic "move"
272 .Mx -anchor-spass Ic "More"
273 .Mx -anchor-spass Ic "more"
274 .Mx -anchor-spass Ic "netrc"
275 .Mx -anchor-spass Ic "newmail"
276 .Mx -anchor-spass Ic "next"
277 .Mx -anchor-spass Ic "New"
278 .Mx -anchor-spass Ic "new"
279 .Mx -anchor-spass Ic "noop"
280 .Mx -anchor-spass Ic "Page"
281 .Mx -anchor-spass Ic "page"
282 .Mx -anchor-spass Ic "Pipe"
283 .Mx -anchor-spass Ic "pipe"
284 .Mx -anchor-spass Ic "preserve"
285 .Mx -anchor-spass Ic "Print"
286 .Mx -anchor-spass Ic "print"
287 .Mx -anchor-spass Ic "quit"
288 .Mx -anchor-spass Ic "read"
289 .Mx -anchor-spass Ic "readall"
290 .Mx -anchor-spass Ic "readctl"
291 .Mx -anchor-spass Ic "remove"
292 .Mx -anchor-spass Ic "rename"
293 .Mx -anchor-spass Ic "Reply"
294 .Mx -anchor-spass Ic "reply"
295 .Mx -anchor-spass Ic "replyall"
296 .Mx -anchor-spass Ic "replysender"
297 .Mx -anchor-spass Ic "Resend"
298 .Mx -anchor-spass Ic "resend"
299 .Mx -anchor-spass Ic "Respond"
300 .Mx -anchor-spass Ic "respond"
301 .Mx -anchor-spass Ic "respondall"
302 .Mx -anchor-spass Ic "respondsender"
303 .Mx -anchor-spass Ic "retain"
304 .Mx -anchor-spass Ic "return"
305 .Mx -anchor-spass Ic "Save"
306 .Mx -anchor-spass Ic "save"
307 .Mx -anchor-spass Ic "search"
308 .Mx -anchor-spass Ic "seen"
309 .Mx -anchor-spass Ic "set"
310 .Mx -anchor-spass Ic "unset"
311 .Mx -anchor-spass Ic "shcodec"
312 .Mx -anchor-spass Ic "shell"
313 .Mx -anchor-spass Ic "shortcut"
314 .Mx -anchor-spass Ic "unshortcut"
315 .Mx -anchor-spass Ic "shift"
316 .Mx -anchor-spass Ic "show"
317 .Mx -anchor-spass Ic "size"
318 .Mx -anchor-spass Ic "sleep"
319 .Mx -anchor-spass Ic "sort"
320 .Mx -anchor-spass Ic "unsort"
321 .Mx -anchor-spass Ic "source"
322 .Mx -anchor-spass Ic "source_if"
323 .Mx -anchor-spass Ic "spamclear"
324 .Mx -anchor-spass Ic "spamforget"
325 .Mx -anchor-spass Ic "spamham"
326 .Mx -anchor-spass Ic "spamrate"
327 .Mx -anchor-spass Ic "spamset"
328 .Mx -anchor-spass Ic "spamspam"
329 .Mx -anchor-spass Ic "Top"
330 .Mx -anchor-spass Ic "top"
331 .Mx -anchor-spass Ic "touch"
332 .Mx -anchor-spass Ic "Type"
333 .Mx -anchor-spass Ic "type"
334 .Mx -anchor-spass Ic "unignore"
335 .Mx -anchor-spass Ic "Unread"
336 .Mx -anchor-spass Ic "unread"
337 .Mx -anchor-spass Ic "unretain"
338 .Mx -anchor-spass Ic "urlcodec"
339 .Mx -anchor-spass Ic "varedit"
340 .Mx -anchor-spass Ic "varshow"
341 .Mx -anchor-spass Ic "verify"
342 .Mx -anchor-spass Ic "version"
343 .Mx -anchor-spass Ic "vexpr"
344 .Mx -anchor-spass Ic "vpospar"
345 .Mx -anchor-spass Ic "visual"
346 .Mx -anchor-spass Ic "write"
347 .Mx -anchor-spass Ic "xcall"
348 .Mx -anchor-spass Ic "xit"
349 .Mx -anchor-spass Ic "z"
350 .Mx -anchor-spass Ic "Z"
351 .Mx -anchor-spass Ic "~~"
352 .Mx -anchor-spass Ic "~!"
353 .Mx -anchor-spass Ic "~."
354 .Mx -anchor-spass Ic "~:"
355 .Mx -anchor-spass Ic "~<"
356 .Mx -anchor-spass Ic "~<!"
357 .Mx -anchor-spass Ic "~?"
358 .Mx -anchor-spass Ic "~@"
359 .Mx -anchor-spass Ic "~|"
360 .Mx -anchor-spass Ic "~^"
361 .Mx -anchor-spass Ic "~A"
362 .Mx -anchor-spass Ic "~a"
363 .Mx -anchor-spass Ic "~b"
364 .Mx -anchor-spass Ic "~c"
365 .Mx -anchor-spass Ic "~d"
366 .Mx -anchor-spass Ic "~e"
367 .Mx -anchor-spass Ic "~F"
368 .Mx -anchor-spass Ic "~f"
369 .Mx -anchor-spass Ic "~H"
370 .Mx -anchor-spass Ic "~h"
371 .Mx -anchor-spass Ic "~I"
372 .Mx -anchor-spass Ic "~i"
373 .Mx -anchor-spass Ic "~M"
374 .Mx -anchor-spass Ic "~m"
375 .Mx -anchor-spass Ic "~p"
376 .Mx -anchor-spass Ic "~q"
377 .Mx -anchor-spass Ic "~R"
378 .Mx -anchor-spass Ic "~r"
379 .Mx -anchor-spass Ic "~s"
380 .Mx -anchor-spass Ic "~t"
381 .Mx -anchor-spass Ic "~U"
382 .Mx -anchor-spass Ic "~u"
383 .Mx -anchor-spass Ic "~v"
384 .Mx -anchor-spass Ic "~w"
385 .Mx -anchor-spass Ic "~x"
386 .Mx -anchor-spass Va "?"
387 .Mx -anchor-spass Va "!"
388 .Mx -anchor-spass Va "^"
389 .Mx -anchor-spass Va "^ERR"
390 .Mx -anchor-spass Va "^ERRDOC"
391 .Mx -anchor-spass Va "^ERRNAME"
392 .Mx -anchor-spass Va "*"
393 .Mx -anchor-spass Va "@"
394 .Mx -anchor-spass Va "#"
395 .Mx -anchor-spass Va "0"
396 .Mx -anchor-spass Va "1"
397 .Mx -anchor-spass Va "account"
398 .Mx -anchor-spass Va "add-file-recipients"
399 .Mx -anchor-spass Va "allnet"
400 .Mx -anchor-spass Va "append"
401 .Mx -anchor-spass Va "askatend"
402 .Mx -anchor-spass Va "askattach"
403 .Mx -anchor-spass Va "askcc"
404 .Mx -anchor-spass Va "askbcc"
405 .Mx -anchor-spass Va "asksend"
406 .Mx -anchor-spass Va "asksign"
407 .Mx -anchor-spass Va "asksub"
408 .Mx -anchor-spass Va "attrlist"
409 .Mx -anchor-spass Va "autobcc"
410 .Mx -anchor-spass Va "autocc"
411 .Mx -anchor-spass Va "autocollapse"
412 .Mx -anchor-spass Va "autoprint"
413 .Mx -anchor-spass Va "autosort"
414 .Mx -anchor-spass Va "bang"
415 .Mx -anchor-spass Va "bind-timeout"
416 .Mx -anchor-spass Va "bsdcompat"
417 .Mx -anchor-spass Va "bsdflags"
418 .Mx -anchor-spass Va "bsdheadline"
419 .Mx -anchor-spass Va "bsdmsgs"
420 .Mx -anchor-spass Va "bsdorder"
421 .Mx -anchor-spass Va "build-os"
422 .Mx -anchor-spass Va "build-osenv"
423 .Mx -anchor-spass Va "charset-7bit"
424 .Mx -anchor-spass Va "charset-8bit"
425 .Mx -anchor-spass Va "charset-unknown-8bit"
426 .Mx -anchor-spass Va "cmd"
427 .Mx -anchor-spass Va "colour-disable"
428 .Mx -anchor-spass Va "colour-pager"
429 .Mx -anchor-spass Va "contact-mail"
430 .Mx -anchor-spass Va "contact-web"
431 .Mx -anchor-spass Va "crt"
432 .Mx -anchor-spass Va "customhdr"
433 .Mx -anchor-spass Va "datefield"
434 .Mx -anchor-spass Va "datefield-markout-older"
435 .Mx -anchor-spass Va "debug"
436 .Mx -anchor-spass Va "disposition-notification-send"
437 .Mx -anchor-spass Va "dot"
438 .Mx -anchor-spass Va "dotlock-ignore-error"
439 .Mx -anchor-spass Va "editalong"
440 .Mx -anchor-spass Va "editheaders"
441 .Mx -anchor-spass Va "emptystart"
442 .Mx -anchor-spass Va "errexit"
443 .Mx -anchor-spass Va "escape"
444 .Mx -anchor-spass Va "expandaddr"
445 .Mx -anchor-spass Va "expandargv"
446 .Mx -anchor-spass Va "features"
447 .Mx -anchor-spass Va "flipr"
448 .Mx -anchor-spass Va "folder"
449 .Mx -anchor-spass Va "folder-hook"
450 .Mx -anchor-spass Va "folder-resolved"
451 .Mx -anchor-spass Va "followup-to"
452 .Mx -anchor-spass Va "followup-to-honour"
453 .Mx -anchor-spass Va "forward-as-attachment"
454 .Mx -anchor-spass Va "forward-inject-head"
455 .Mx -anchor-spass Va "from"
456 .Mx -anchor-spass Va "fullnames"
457 .Mx -anchor-spass Va "header"
458 .Mx -anchor-spass Va "headline"
459 .Mx -anchor-spass Va "headline-bidi"
460 .Mx -anchor-spass Va "headline-plain"
461 .Mx -anchor-spass Va "history-file"
462 .Mx -anchor-spass Va "history-gabby"
463 .Mx -anchor-spass Va "history-gabby-persist"
464 .Mx -anchor-spass Va "history-size"
465 .Mx -anchor-spass Va "hold"
466 .Mx -anchor-spass Va "hostname"
467 .Mx -anchor-spass Va "idna-disable"
468 .Mx -anchor-spass Va "ifs"
469 .Mx -anchor-spass Va "ifs-ws"
470 .Mx -anchor-spass Va "ignore"
471 .Mx -anchor-spass Va "ignoreeof"
472 .Mx -anchor-spass Va "inbox"
473 .Mx -anchor-spass Va "indentprefix"
474 .Mx -anchor-spass Va "keep"
475 .Mx -anchor-spass Va "keep-content-length"
476 .Mx -anchor-spass Va "keepsave"
477 .Mx -anchor-spass Va "line-editor-disable"
478 .Mx -anchor-spass Va "line-editor-no-defaults"
479 .Mx -anchor-spass Va "log-prefix"
480 .Mx -anchor-spass Va "mailbox-display"
481 .Mx -anchor-spass Va "mailbox-resolved"
482 .Mx -anchor-spass Va "mailx-extra-rc"
483 .Mx -anchor-spass Va "markanswered"
484 .Mx -anchor-spass Va "mbox-rfc4155"
485 .Mx -anchor-spass Va "memdebug"
486 .Mx -anchor-spass Va "message-id-disable"
487 .Mx -anchor-spass Va "message-inject-head"
488 .Mx -anchor-spass Va "message-inject-tail"
489 .Mx -anchor-spass Va "metoo"
490 .Mx -anchor-spass Va "mime-allow-text-controls"
491 .Mx -anchor-spass Va "mime-alternative-favour-rich"
492 .Mx -anchor-spass Va "mime-counter-evidence"
493 .Mx -anchor-spass Va "mime-encoding"
494 .Mx -anchor-spass Va "mimetypes-load-control"
495 .Mx -anchor-spass Va "mta"
496 .Mx -anchor-spass Va "mta-arguments"
497 .Mx -anchor-spass Va "mta-no-default-arguments"
498 .Mx -anchor-spass Va "mta-no-receiver-arguments"
499 .Mx -anchor-spass Va "mta-argv0"
500 .Mx -anchor-spass Va "netrc-lookup"
501 .Mx -anchor-spass Va "netrc-pipe"
502 .Mx -anchor-spass Va "newfolders"
503 .Mx -anchor-spass Va "newmail"
504 .Mx -anchor-spass Va "outfolder"
505 .Mx -anchor-spass Va "on-account-cleanup"
506 .Mx -anchor-spass Va "on-compose-cleanup"
507 .Mx -anchor-spass Va "on-compose-enter"
508 .Mx -anchor-spass Va "on-compose-leave"
509 .Mx -anchor-spass Va "on-compose-splice"
510 .Mx -anchor-spass Va "on-compose-splice-shell"
511 .Mx -anchor-spass Va "on-resend-cleanup"
512 .Mx -anchor-spass Va "on-resend-enter"
513 .Mx -anchor-spass Va "page"
514 .Mx -anchor-spass Va "password"
515 .Mx -anchor-spass Va "piperaw"
516 .Mx -anchor-spass Va "pipe-TYPE/SUBTYPE"
517 .Mx -anchor-spass Ev "MAILX_CONTENT"
518 .Mx -anchor-spass Ev "MAILX_CONTENT_EVIDENCE"
519 .Mx -anchor-spass Ev "MAILX_EXTERNAL_BODY_URL"
520 .Mx -anchor-spass Ev "MAILX_FILENAME"
521 .Mx -anchor-spass Ev "MAILX_FILENAME_GENERATED"
522 .Mx -anchor-spass Ev "MAILX_FILENAME_TEMPORARY"
523 .Mx -anchor-spass Va "pipe-EXTENSION"
524 .Mx -anchor-spass Va "pop3-auth"
525 .Mx -anchor-spass Va "pop3-bulk-load"
526 .Mx -anchor-spass Va "pop3-keepalive"
527 .Mx -anchor-spass Va "pop3-no-apop"
528 .Mx -anchor-spass Va "pop3-use-starttls"
529 .Mx -anchor-spass Va "posix"
530 .Mx -anchor-spass Va "print-alternatives"
531 .Mx -anchor-spass Va "prompt"
532 .Mx -anchor-spass Va "prompt2"
533 .Mx -anchor-spass Va "quiet"
534 .Mx -anchor-spass Va "quote"
535 .Mx -anchor-spass Va "quote-as-attachment"
536 .Mx -anchor-spass Va "quote-chars"
537 .Mx -anchor-spass Va "quote-fold"
538 .Mx -anchor-spass Va "r-option-implicit"
539 .Mx -anchor-spass Va "recipients-in-cc"
540 .Mx -anchor-spass Va "record"
541 .Mx -anchor-spass Va "record-files"
542 .Mx -anchor-spass Va "record-resent"
543 .Mx -anchor-spass Va "reply-in-same-charset"
544 .Mx -anchor-spass Va "reply-strings"
545 .Mx -anchor-spass Va "reply-to"
546 .Mx -anchor-spass Va "reply-to-honour"
547 .Mx -anchor-spass Va "rfc822-body-from_"
548 .Mx -anchor-spass Va "save"
549 .Mx -anchor-spass Va "screen"
550 .Mx -anchor-spass Va "searchheaders"
551 .Mx -anchor-spass Va "sendcharsets"
552 .Mx -anchor-spass Va "sendcharsets-else-ttycharset"
553 .Mx -anchor-spass Va "sender"
554 .Mx -anchor-spass Va "sendwait"
555 .Mx -anchor-spass Va "showlast"
556 .Mx -anchor-spass Va "showname"
557 .Mx -anchor-spass Va "showto"
558 .Mx -anchor-spass Va "Sign"
559 .Mx -anchor-spass Va "sign"
560 .Mx -anchor-spass Va "signature"
561 .Mx -anchor-spass Va "skipemptybody"
562 .Mx -anchor-spass Va "smime-ca-dir"
563 .Mx -anchor-spass Va "smime-ca-file"
564 .Mx -anchor-spass Va "smime-ca-flags"
565 .Mx -anchor-spass Va "smime-ca-no-defaults"
566 .Mx -anchor-spass Va "smime-cipher"
567 .Mx -anchor-spass Va "smime-crl-dir"
568 .Mx -anchor-spass Va "smime-crl-file"
569 .Mx -anchor-spass Va "smime-encrypt-USER@HOST"
570 .Mx -anchor-spass Va "smime-force-encryption"
571 .Mx -anchor-spass Va "smime-sign"
572 .Mx -anchor-spass Va "smime-sign-cert"
573 .Mx -anchor-spass Va "smime-sign-include-certs"
574 .Mx -anchor-spass Va "smime-sign-message-digest"
575 .Mx -anchor-spass Va "smtp-auth"
576 .Mx -anchor-spass Va "smtp-hostname"
577 .Mx -anchor-spass Va "smtp-use-starttls"
578 .Mx -anchor-spass Va "socks-proxy"
579 .Mx -anchor-spass Va "spam-interface"
580 .Mx -anchor-spass Va "spam-maxsize"
581 .Mx -anchor-spass Va "spamc-command"
582 .Mx -anchor-spass Va "spamc-arguments"
583 .Mx -anchor-spass Va "spamc-user"
584 .Mx -anchor-spass Va "spamfilter-ham"
585 .Mx -anchor-spass Va "spamfilter-noham"
586 .Mx -anchor-spass Va "spamfilter-nospam"
587 .Mx -anchor-spass Va "spamfilter-rate"
588 .Mx -anchor-spass Va "spamfilter-spam"
589 .Mx -anchor-spass Va "spamfilter-rate-scanscore"
590 .Mx -anchor-spass Va "ssl-ca-file"
591 .Mx -anchor-spass Va "ssl-ca-flags"
592 .Mx -anchor-spass Va "ssl-ca-no-defaults"
593 .Mx -anchor-spass Va "ssl-cert"
594 .Mx -anchor-spass Va "ssl-cipher-list"
595 .Mx -anchor-spass Va "ssl-config-file"
596 .Mx -anchor-spass Va "ssl-config-module"
597 .Mx -anchor-spass Va "ssl-config-pairs"
598 .Mx -anchor-spass Va "ssl-crl-dir"
599 .Mx -anchor-spass Va "ssl-crl-file"
600 .Mx -anchor-spass Va "ssl-curves"
601 .Mx -anchor-spass Va "ssl-features"
602 .Mx -anchor-spass Va "ssl-key"
603 .Mx -anchor-spass Va "ssl-protocol"
604 .Mx -anchor-spass Va "ssl-rand-egd"
605 .Mx -anchor-spass Va "ssl-rand-file"
606 .Mx -anchor-spass Va "ssl-verify"
607 .Mx -anchor-spass Va "ssl-ca-dir"
608 .Mx -anchor-spass Va "stealthmua"
609 .Mx -anchor-spass Va "termcap"
610 .Mx -anchor-spass Va "termcap-ca-mode"
611 .Mx -anchor-spass Va "termcap-disable"
612 .Mx -anchor-spass Va "toplines"
613 .Mx -anchor-spass Va "topsqueeze"
614 .Mx -anchor-spass Va "ttycharset"
615 .Mx -anchor-spass Va "typescript-mode"
616 .Mx -anchor-spass Va "umask"
617 .Mx -anchor-spass Va "user"
618 .Mx -anchor-spass Va "v15-compat"
619 .Mx -anchor-spass Va "verbose"
620 .Mx -anchor-spass Va "version"
621 .Mx -anchor-spass Va "version-date"
622 .Mx -anchor-spass Va "version-hexnum"
623 .Mx -anchor-spass Va "version-major"
624 .Mx -anchor-spass Va "version-minor"
625 .Mx -anchor-spass Va "writebackedited"
626 .Mx -anchor-spass Ev "COLUMNS"
627 .Mx -anchor-spass Ev "DEAD"
628 .Mx -anchor-spass Ev "EDITOR"
629 .Mx -anchor-spass Ev "HOME"
630 .Mx -anchor-spass Ev "LC_ALL"
631 .Mx -anchor-spass Ev "LC_CTYPE"
632 .Mx -anchor-spass Ev "LANG"
633 .Mx -anchor-spass Ev "LINES"
634 .Mx -anchor-spass Ev "LISTER"
635 .Mx -anchor-spass Ev "LOGNAME"
636 .Mx -anchor-spass Ev "MAIL"
637 .Mx -anchor-spass Ev "MAILCAPS"
638 .Mx -anchor-spass Ev "MAILRC"
639 .Mx -anchor-spass Ev "MAILX_NO_SYSTEM_RC"
640 .Mx -anchor-spass Ev "MBOX"
641 .Mx -anchor-spass Ev "NETRC"
642 .Mx -anchor-spass Ev "PAGER"
643 .Mx -anchor-spass Ev "PATH"
644 .Mx -anchor-spass Ev "POSIXLY_CORRECT"
645 .Mx -anchor-spass Ev "SHELL"
646 .Mx -anchor-spass Ev "SOURCE_DATE_EPOCH"
647 .Mx -anchor-spass Ev "TERM"
648 .Mx -anchor-spass Ev "TMPDIR"
649 .Mx -anchor-spass Ev "USER"
650 .Mx -anchor-spass Ev "VISUAL"
651 .Mx -anchor-spass Pa "~/.mailcap"
652 .Mx -anchor-spass Pa "/etc/mailcap"
653 .Mx -anchor-spass Pa "~/mbox"
654 .Mx -anchor-spass Pa "~/.mime.types"
655 .Mx -anchor-spass Pa "/etc/mime.types"
656 .Mx -anchor-spass Pa "~/.netrc"
657 .Mx -anchor-spass Pa "/dev/null"
658 .Mx -anchor-spass Pa "\*(UR"
659 .Mx -anchor-spass Pa "\*(ur"
660 .Mx -anchor-spass Cd "needsterminal"
661 .Mx -anchor-spass Cd "copiousoutput"
662 .Mx -anchor-spass Cd "x-mailx-even-if-not-interactive"
663 .Mx -anchor-spass Cd "x-mailx-noquote"
664 .Mx -anchor-spass Cd "x-mailx-async"
665 .Mx -anchor-spass Cd "x-mailx-test-once"
666 .Mx -anchor-spass Cd "x-mailx-tmpfile"
667 .Mx -anchor-spass Cd "x-mailx-tmpfile-fill"
668 .Mx -anchor-spass Cd "x-mailx-tmpfile-unlink"
669 .Mx -anchor-spass Cd "x-mailx-tmpfile-keep"
670 .Mx -anchor-spass Ic "cache"
671 .Mx -anchor-spass Ic "connect"
672 .Mx -anchor-spass Ic "disconnect"
673 .Mx -anchor-spass Ic "imap"
674 .Mx -anchor-spass Ic "imapcodec"
675 .Mx -anchor-spass Va "disconnected"
676 .Mx -anchor-spass Va "imap-auth"
677 .Mx -anchor-spass Va "imap-cache"
678 .Mx -anchor-spass Va "imap-delim"
679 .Mx -anchor-spass Va "imap-keepalive"
680 .Mx -anchor-spass Va "imap-list-depth"
681 .Mx -anchor-spass Va "imap-use-starttls"
682 .Sh NAME
683 .Nm \*(UA \%[\*(VV]
684 .Nd send and receive Internet mail
685 .Sh SYNOPSIS
686 .Nm \*(uA
687 .Fl h | Fl Fl help
689 .Nm \*(uA
690 .Bk -words
691 .Op Fl BdEFinv~#
692 .Op Fl \&: Ar spec
693 .Op Fl A Ar account
694 .Op : Ns Fl a Ar attachment Ns \&:
695 .Op : Ns Fl b Ar bcc-addr Ns \&:
696 .Op : Ns Fl C Ar """custom:\0header""" Ns \&:
697 .Op : Ns Fl c Ar cc-addr Ns \&:
698 .Op Fl M Ar type | Fl m Ar file | Fl q Ar file | Fl t
699 .Op Fl r Ar from-addr
700 .Oo : Ns
701 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
702 .Pf \&: Oc
703 .Op Fl s Ar subject
704 .Op : Ns Fl X Ar cmd Ns \&:
705 .Op Fl \&.
706 .Pf : Ar to-addr Ns \&:
707 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
710 .Nm \*(uA
711 .Bk -words
712 .Op Fl BdEeHiNnRv~#
713 .Op Fl \&: Ar spec
714 .Op Fl A Ar account
715 .Op : Ns Fl C Ar """custom:\0header""" Ns \&:
716 .Op Fl L Ar spec
717 .Op Fl r Ar from-addr
718 .Oo : Ns
719 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
720 .Pf \&: Oc
721 .Op Fl u Ar user
722 .Op : Ns Fl X Ar cmd Ns \&:
723 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
725 .Nm \*(uA
726 .Bk -words
727 .Op Fl BdEeHiNnRv~#
728 .Op Fl \&: Ar spec
729 .Op Fl A Ar account
730 .Op : Ns Fl C Ar """custom:\0header""" Ns \&:
731 .Fl f
732 .Op Fl L Ar spec
733 .Op Fl r Ar from-addr
734 .Oo : Ns
735 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
736 .Pf \&: Oc
737 .Op : Ns Fl X Ar cmd Ns \&:
738 .Op Ar file
739 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
741 .Mx -toc -tree html pdf ps xhtml
742 .Sh DESCRIPTION
743 .Bd -filled -compact -offset indent
744 .Sy Compatibility note:
745 S-nail (\*(UA) will wrap up into \%S-mailx in v15.0 (circa 2020).
746 Backward incompatibility has to be expected \(en
747 .Sx COMMANDS
748 will use
749 .Sx "Shell-style argument quoting"
750 rules, for example, and shell metacharacters will become meaningful.
751 New and old behaviour is flagged \*(IN and \*(OU, and setting
752 .Va v15-compat ,
753 one of the many
754 .Sx "INTERNAL VARIABLES" ,
755 will choose new behaviour when applicable.
756 \*(OB flags what will vanish, and enabling
757 .Fl d
759 .Fl v
760 enables obsoletion warnings.
763 \*(UA provides a simple and friendly environment for sending and
764 receiving mail.
765 It is intended to provide the functionality of the POSIX
766 .Xr mailx 1
767 command, but is MIME capable and optionally offers extensions for
768 line editing, S/MIME, SMTP and POP3, among others.
769 \*(UA divides incoming mail into its constituent messages and allows
770 the user to deal with them in any order.
771 It offers many
772 .Sx COMMANDS
774 .Sx "INTERNAL VARIABLES"
775 for manipulating messages and sending mail.
776 It provides the user simple editing capabilities to ease the composition
777 of outgoing messages, and increasingly powerful and reliable
778 non-interactive scripting capabilities.
779 .Ss "Options"
780 .Bl -tag -width ".It Fl BaNg"
782 .It Fl \&: Ar spec
783 Explicitly control which of the
784 .Sx "Resource files"
785 shall be
786 .Ic source Ns
787 d (loaded): if the letter
788 .Ql s
789 is (case-insensitively) part of the
790 .Ar spec
791 then the system wide
792 .Pa \*(UR
793 is sourced, likewise the letter
794 .Ql u
795 controls sourcing of the user's personal
796 .Pa \*(ur
797 file, whereas the letters
798 .Ql -
800 .Ql /
801 explicitly forbid sourcing of any resource files.
802 Scripts should use this option: to avoid environmental noise they should
803 .Dq detach
804 from any configuration and create a script-specific environment, setting
805 any of the desired
806 .Sx "INTERNAL VARIABLES"
808 .Fl S
809 and running configurating commands via
810 .Fl X .
811 This option overrides
812 .Fl n .
814 .It Fl A Ar account
815 Executes an
816 .Ic account
817 command for the given user email
818 .Ar account
819 after program startup is complete (all resource files are loaded, any
820 .Fl S
821 setting is being established; only
822 .Fl X
823 commands have not been evaluated yet).
824 Being a special incarnation of
825 .Ic define Ns d
826 macros for the purpose of bundling longer-lived
827 .Ic set Ns
828 tings, activating such an email account also switches to the accounts
829 .Mx -sx
830 .Sx "primary system mailbox"
831 (most likely the
832 .Va inbox ) .
834 .It Fl a Ar file Ns Op Ar =input-charset Ns Op Ar #output-charset
835 Attach
836 .Ar file
837 to the message (for compose mode opportunities refer to
838 .Ic ~@
840 .Ic ~^ ) .
841 .Sx "Filename transformations"
842 (also see
843 .Ic file )
844 will be performed, except that shell variables are not expanded.
845 Shall
846 .Ar file
847 not be accessible but contain a
848 .Ql =
849 character, then anything before the
850 .Ql =
851 will be used as the filename, anything thereafter as a character set
852 specification.
854 If an input character set is specified,
855 .Mx -ix "character set specification"
856 but no output character set, then the given input character set is fixed
857 as-is, and no conversion will be applied;
858 giving the empty string or the special string hyphen-minus
859 .Ql -
860 will be treated as if
861 .Va ttycharset
862 has been specified (the default).
864 If an output character set has also been given then the conversion will
865 be performed exactly as specified and on-the-fly, not considering the
866 file's type and content.
867 As an exception, if the output character set is specified as the empty
868 string or hyphen-minus
869 .Ql - ,
870 then the default conversion algorithm (see
871 .Sx "Character sets" )
872 is applied (therefore no conversion is performed on-the-fly,
873 .Ar file
874 will be MIME-classified and its contents will be inspected first) \(em
875 without support for character set conversions
876 .Pf ( Va features
877 does not include the term
878 .Ql +iconv )
879 only this argument is supported.
880 .It Fl B
881 (\*(OB: \*(UA will always use line-buffered output, to gain
882 line-buffered input even in batch mode enable batch mode via
883 .Fl # . )
885 .It Fl b Ar addr
886 Send a blind carbon copy to
887 .Ar addr Ns
888 ess, if the
889 .Ic set Ns
890 ting of
891 .Va expandaddr ,
892 one of the
893 .Sx "INTERNAL VARIABLES" ,
894 allows.
895 The option may be used multiple times.
896 Also see the section
897 .Sx "On sending mail, and non-interactive mode" .
899 .It Fl C Ar """field: body"""
900 Create a custom header which persists for an entire session.
901 A custom header consists of the field name followed by a colon
902 .Ql \&:
903 and the field content body, e.g.,
904 .Ql -C """Blah: Neminem laede; imo omnes, quantum potes, juva""" Ns .
905 Standard header field names cannot be overwritten by a custom header.
906 A changeable way to create custom headers is available via the variable
907 .Va customhdr ,
908 and in compose mode
909 .Ic ~^ ,
910 one of the
911 .Sx "COMMAND ESCAPES" ,
912 offers the most flexible and powerful possibility of managing headers.
913 This option may be used multiple times.
915 .It Fl c Ar addr
916 Send carbon copies to the given receiver, if so allowed by
917 .Va expandaddr .
918 May be used multiple times.
920 .It Fl d
921 .Ic set
922 the internal variable
923 .Va debug
924 which enables debug messages and disables message delivery,
925 among others; effectively turns almost any operation into a dry-run.
927 .It Fl E
928 .Ic set
929 .Va skipemptybody
930 and thus discard messages with an empty message part body.
931 This command line option is \*(OB.
933 .It Fl e
934 Just check if mail is present (in the system
935 .Va inbox
936 or the one specified via
937 .Fl f ) :
938 if yes, return an exit status of zero, a non-zero value otherwise.
939 To restrict the set of mails to consider in this evaluation a message
940 specification can be added with the option
941 .Fl L .
943 .It Fl F
944 Save the message to send in a file named after the local part of the
945 first recipient's address (instead of in
946 .Va record Ns ).
948 .It Fl f
949 Read in the contents of the user's
950 .Mx -sx
951 .Sx "secondary mailbox"
952 .Ev MBOX
953 (or the specified file) for processing;
954 when \*(UA is quit, it writes undeleted messages back to this file
955 (but be aware of the
956 .Va hold
957 option).
958 The optional
959 .Ar file
960 argument will undergo some special
961 .Sx "Filename transformations"
962 (also see
963 .Ic file ) .
964 Note that
965 .Ar file
966 is not an argument to the flag
967 .Fl \&\&f ,
968 but is instead taken from the command line after option processing has
969 been completed.
970 In order to use a
971 .Ar file
972 that starts with a hyphen-minus, prefix with a relative path, as in
973 .Ql ./-hyphenbox.mbox .
975 .It Fl H
976 Display a summary of
977 .Ic headers
978 and exit; a configurable summary view is available via the
979 .Fl L
980 option.
982 .It Fl h
983 Show a short usage summary.
985 .It Fl i
986 .Ic set
987 .Va ignore
988 to ignore tty interrupt signals.
990 .It Fl L Ar spec
991 Display a summary of
992 .Ic headers
993 of all messages that match the given
994 .Ar spec ,
995 then exit.
996 See the section
997 .Sx "Specifying messages"
998 for the format of
999 .Ar spec .
1000 If the
1001 .Fl e
1002 option has been given in addition no header summary is produced,
1003 but \*(UA will instead indicate via its exit status whether
1004 .Ar spec
1005 matched any messages
1006 .Pf ( Ql 0 )
1007 or not
1008 .Pf ( Ql 1 ) ;
1009 note that any verbose output is suppressed in this mode and must instead
1010 be enabled explicitly (e.g., by using the option
1011 .Fl v ) .
1013 .It Fl M Ar type
1014 Special send mode that will flag standard input with the MIME
1015 .Ql Content-Type:
1016 set to the given
1017 .Ar type
1018 and use it as the main message body.
1019 \*(ID Using this option will bypass processing of
1020 .Va message-inject-head
1022 .Va message-inject-tail .
1023 Also see
1024 .Fl q , m , t .
1026 .It Fl m Ar file
1027 Special send mode that will MIME classify the specified
1028 .Ar file
1029 and use it as the main message body.
1030 \*(ID Using this option will bypass processing of
1031 .Va message-inject-head
1033 .Va message-inject-tail .
1034 Also see
1035 .Fl q , M , t .
1037 .It Fl N
1038 inhibit the initial display of message headers when reading mail or
1039 editing a mailbox
1040 .Ic folder
1041 by calling
1042 .Ic unset
1043 for the internal variable
1044 .Va header .
1046 .It Fl n
1047 Standard flag that inhibits reading the system wide
1048 .Pa \*(UR
1049 upon startup.
1050 The option
1051 .Fl \&:
1052 allows more control over the startup sequence; also see
1053 .Sx "Resource files" .
1055 .It Fl q Ar file
1056 Special send mode that will initialize the message body with the
1057 contents of the specified
1058 .Ar file ,
1059 which may be standard input
1060 .Ql -
1061 only in non-interactive context.
1062 Also see
1063 .Fl M , m , t .
1065 .It Fl R
1066 Any mailbox
1067 .Ic folder
1068 opened will be in read-only mode.
1070 .It Fl r Ar from-addr
1071 Whereas the source address that appears in the
1072 .Va from
1073 header of a message (or in the
1074 .Va sender
1075 header if the former contains multiple addresses) is honoured by the
1076 builtin SMTP transport, it is not used by a file-based
1077 .Va mta
1078 (Mail-Transfer-Agent) for the RFC 5321 reverse-path used for relaying
1079 and delegating a message to its destination(s), for delivery errors
1080 etc., but it instead uses the local identity of the initiating user.
1082 When this command line option is used the given
1083 .Ar from-addr
1084 will be assigned to the internal variable
1085 .Va from ,
1086 but in addition the command line option
1087 .Fl \&\&f Ar from-addr
1088 will be passed to a file-based
1089 .Va mta
1090 whenever a message is sent.
1091 Shall
1092 .Ar from-addr
1093 include a user name the address components will be separated and
1094 the name part will be passed to a file-based
1095 .Va mta
1096 individually via
1097 .Fl \&\&F Ar name .
1099 If an empty string is passed as
1100 .Ar from-addr
1101 then the content of the variable
1102 .Va from
1103 (or, if that contains multiple addresses,
1104 .Va sender )
1105 will be evaluated and used for this purpose whenever the file-based
1106 .Va mta
1107 is contacted.
1108 By default, without
1109 .Fl \&\&r
1110 that is, neither
1111 .Fl \&\&f
1113 .Fl \&\&F
1114 command line options are used when contacting a file-based MTA, unless
1115 this automatic deduction is enforced by
1116 .Ic set Ns
1117 ing the internal variable
1118 .Va r-option-implicit .
1120 Remarks: many default installations and sites disallow overriding the
1121 local user identity like this unless either the MTA has been configured
1122 accordingly or the user is member of a group with special privileges.
1123 Passing an invalid address will cause an error.
1125 .It Fl S Ar var Ns Op = Ns value
1126 .Ic set
1127 (or, with a prefix string
1128 .Ql no ,
1129 as documented in
1130 .Sx "INTERNAL VARIABLES" ,
1131 .Ic unset )
1132 .Ar var Ns
1133 iable and optionally assign
1134 .Ar value ,
1135 if supported; \*(ID the entire expression is evaluated as if specified
1136 within dollar-single-quotes (see
1137 .Sx "Shell-style argument quoting" )
1138 if the internal variable
1139 .Va v15-compat
1140 is set.
1141 If the operation fails the program will exit if any of
1142 .Va errexit
1144 .Va posix
1145 are set.
1146 Settings established via
1147 .Fl \&\&S
1148 cannot be changed from within
1149 .Sx "Resource files"
1150 or an account switch initiated by
1151 .Fl A .
1152 They will become mutable again before commands registered via
1153 .Fl X
1154 are executed.
1156 .It Fl s Ar subject
1157 Specify the subject of the message to be sent.
1158 Newline (NL) and carriage-return (CR) bytes are invalid and will be
1159 normalized to space (SP) characters.
1161 .It Fl t
1162 The message given (on standard input) is expected to contain, separated
1163 from the message body by an empty line, a message header with
1164 .Ql To: ,
1165 .Ql Cc: ,
1167 .Ql Bcc:
1168 fields giving its recipients, which will be added to any recipients
1169 specified on the command line.
1170 If a message subject is specified via
1171 .Ql Subject:
1172 then it will be used in favour of one given on the command line.
1174 Also understood are
1175 .Ql Reply-To:
1176 (possibly overriding
1177 .Va reply-to ) ,
1178 .Ql Sender:
1179 .Pf ( Va sender ) ,
1180 .Ql From:
1181 .Pf ( Va from
1182 and / or option
1183 .Fl r ) .
1184 .Ql Message-ID: ,
1185 .Ql In-Reply-To: ,
1186 .Ql References:
1188 .Ql Mail-Followup-To: ,
1189 by default created automatically dependent on message context, will
1190 be used if specified (a special address massage will however still occur
1191 for the latter).
1192 Any other custom header field (also see
1193 .Fl C ,
1194 .Va customhdr
1196 .Ic ~^ )
1197 is passed through entirely
1198 unchanged, and in conjunction with the options
1199 .Fl ~
1201 .Fl #
1202 it is possible to embed
1203 .Sx "COMMAND ESCAPES" .
1204 Also see
1205 .Fl M , m , q .
1207 .It Fl u Ar user
1208 Initially read the
1209 .Mx -sx
1210 .Sx "primary system mailbox"
1212 .Ar user ,
1213 appropriate privileges presumed; effectively identical to
1214 .Ql Fl \&\&f Ns \0%user .
1216 .It Fl V
1217 Show \*(UA's
1218 .Va version
1219 and exit.
1220 The command
1221 .Ic version
1222 will also show the list of
1223 .Va features :
1224 .Ql $ \*(uA -Xversion -Xx .
1226 .It Fl v
1227 .Ic set Ns
1228 ting the internal variable
1229 .Va verbose
1230 enables display of some informational context messages.
1231 Using it twice increases the level of verbosity.
1233 .It Fl X Ar cmd
1234 Add the given (or multiple for a multiline argument)
1235 .Ar cmd
1236 to the list of commands to be executed,
1237 as a last step of program startup, before normal operation starts.
1238 This is the only possibility to execute commands in non-interactive mode
1239 when reading startup files is actively prohibited.
1240 The commands will be evaluated as a unit, just as via
1241 .Ic source .
1242 Correlates with
1243 .Fl #
1245 .Va errexit .
1247 .It Fl ~
1248 Enable
1249 .Sx "COMMAND ESCAPES"
1250 in compose mode even in non-interactive use cases.
1251 This can be used to, e.g., automatically format the composed message
1252 text before sending the message:
1253 .Bd -literal -offset indent
1254 $ ( echo 'line    one. Word.     Word2.';\e
1255     echo '~| /usr/bin/fmt -tuw66' ) |\e
1256   LC_ALL=C \*(uA -d~:/ -Sttycharset=utf-8 bob@exam.ple
1259 .It Fl #
1260 Enables batch mode: standard input is made line buffered, the complete
1261 set of (interactive) commands is available, processing of
1262 .Sx "COMMAND ESCAPES"
1263 is enabled in compose mode, and diverse
1264 .Sx "INTERNAL VARIABLES"
1265 are adjusted for batch necessities, exactly as if done via
1266 .Ic set :
1267 .Va emptystart ,
1268 .Pf no Va errexit ,
1269 .Pf no Va header ,
1270 .Pf no Va posix ,
1271 .Va quiet ,
1272 .Va sendwait ,
1273 .Va typescript-mode
1274 as well as
1275 .Ev MAIL ,
1276 .Ev MBOX
1278 .Va inbox
1279 (the latter three to
1280 .Pa /dev/null ) .
1281 The following prepares an email message in a batched dry run:
1282 .Bd -literal -offset indent
1283 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' |\e
1284   LC_ALL=C \*(uA -d#:/ -X'alias bob bob@exam.ple'
1287 .It Fl \&.
1288 This flag forces termination of option processing in order to prevent
1289 .Dq option injection
1290 (attacks).
1291 It also forcefully puts \*(UA into send mode, see
1292 .Sx "On sending mail, and non-interactive mode" .
1295 All given
1296 .Ar to-addr
1297 arguments and all receivers established via
1298 .Fl b
1300 .Fl c
1301 are subject to the checks established by
1302 .Va expandaddr ,
1303 one of the
1304 .Sx "INTERNAL VARIABLES" .
1305 If the setting of
1306 .Va expandargv
1307 allows their recognition all
1308 .Ar mta-option
1309 arguments given at the end of the command line after a
1310 .Ql --
1311 separator will be passed through to a file-based
1312 .Va mta
1313 (Mail-Transfer-Agent) and persist for the entire session.
1314 .Va expandargv
1315 constraints do not apply to the content of
1316 .Va mta-arguments .
1317 .Ss "A starter"
1318 \*(UA is a direct descendant of
1320 Mail, itself a successor of the Research
1322 mail which
1323 .Dq was there from the start
1324 according to
1325 .Sx HISTORY .
1326 It thus represents the user side of the
1328 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
1329 traditionally taken by
1330 .Xr sendmail 8 ,
1331 and most MTAs provide a binary of this name for compatibility purposes.
1332 If the \*(OPal SMTP
1333 .Va mta
1334 is included in the
1335 .Va features
1336 of \*(UA then the system side is not a mandatory precondition for mail
1337 delivery.
1339 Because \*(UA strives for compliance with POSIX
1340 .Xr mailx 1
1341 it is likely that some configuration settings have to be adjusted before
1342 using it is a smooth experience.
1343 (Rather complete configuration examples can be found in the section
1344 .Sx EXAMPLES . )
1345 The default global
1346 .Pa \*(UR ,
1347 one of the
1348 .Sx "Resource files" ,
1349 bends those standard imposed settings of the
1350 .Sx "INTERNAL VARIABLES"
1351 a bit towards more user friendliness and safety already.
1353 For example, it
1354 .Ic set Ns s
1355 .Va hold
1357 .Va keepsave
1358 in order to suppress the automatic moving of messages to the
1359 .Mx -sx
1360 .Sx "secondary mailbox"
1361 .Ev MBOX
1362 that would otherwise occur (see
1363 .Sx "Message states" ) ,
1365 .Va keep
1366 to not remove empty system MBOX mailbox files in order not to mangle
1367 file permissions when files eventually get recreated (all empty (MBOX)
1368 mailbox files will be removed unless this variable is set whenever
1369 .Va posix
1370 .Pf a.k.a.\0 Ev POSIXLY_CORRECT
1371 mode has been enabled).
1373 It also enables
1374 .Va sendwait
1375 in order to synchronize \*(UA with the exit status report of the used
1376 .Va mta
1377 when sending mails.
1379 .Ic set Ns
1381 .Va emptystart
1382 to enter interactive startup even if the initial mailbox is empty,
1383 .Va editheaders
1384 to allow editing of headers as well as
1385 .Va fullnames
1386 to not strip down addresses in compose mode, and
1387 .Va quote
1388 to include the message that is being responded to when
1389 .Ic reply Ns
1390 ing, which is indented by an
1391 .Va indentprefix
1392 that also deviates from standard imposed settings.
1393 .Va mime-counter-evidence
1394 is fully enabled, too.
1396 Some random remarks.
1397 The file mode creation mask can be managed explicitly via the variable
1398 .Va umask .
1399 Sufficient system support provided symbolic links will not be followed
1400 when files are opened for writing.
1401 Files and shell pipe output can be
1402 .Ic source Ns
1403 d for evaluation, also during startup from within the
1404 .Sx "Resource files" .
1405 .Ss "On sending mail, and non-interactive mode"
1406 To send a message to one or more people, using a local or built-in
1407 .Va mta
1408 (Mail-Transfer-Agent) transport to actually deliver the generated mail
1409 message, \*(UA can be invoked with arguments which are the names of
1410 people to whom the mail will be sent, and the command line options
1411 .Fl b
1413 .Fl c
1414 can be used to add (blind) carbon copy receivers:
1415 .Bd -literal -offset indent
1416 # Via sendmail(1)
1417 $ \*(uA -s ubject -a ttach.txt bill@exam.ple
1419 # But... try it in an isolated dry-run mode (-d) first
1420 $ LC_ALL=C \*(uA -d -:/ -Ssendwait -Sttycharset=utf8 \e
1421    -b bcc@exam.ple -c cc@exam.ple \e
1422    -Sfullnames -. \e
1423    '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
1425 # With SMTP
1426 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
1427     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
1428     -S from=scriptreply@exam.ple \e
1429     -a /etc/mail.rc \e
1430     -. eric@exam.ple
1433 If standard input is a terminal rather than the message to be sent,
1434 the user is expected to type in the message contents.
1435 In this compose mode \*(UA treats lines beginning with the character
1436 .Ql ~
1437 special \(en these are so-called
1438 .Sx "COMMAND ESCAPES" ,
1439 which can be used to read in files, process shell commands, add and edit
1440 attachments and more; e.g., the command escape
1441 .Ic ~e
1442 will start the text editor to revise the message in its current state,
1443 .Ic ~h
1444 allows editing of the most important message headers, with
1445 .Ic ~^
1446 custom headers can be created (more specifically than with
1447 .Fl C
1449 .Va customhdr ) .
1450 .Ic ~?
1451 gives an overview of most other available command escapes.
1452 The command escape
1453 .Ic ~.
1454 will leave compose mode and send the message once it is completed.
1455 Alternatively typing
1456 .Ql control-D
1457 .Pf ( Ql ^D )
1458 at the beginning of an empty line has the same effect, whereas typing
1459 .Ql control-C
1460 .Pf ( Ql ^C )
1461 twice will abort the current letter (saving its contents in the file
1462 denoted by
1463 .Ev DEAD
1464 unless
1465 .Pf no Va save
1466 is set).
1468 A number of
1469 .Sx ENVIRONMENT
1471 .Sx "INTERNAL VARIABLES"
1472 can be used to alter default behavior.
1473 E.g., messages are sent asynchronously, without supervision, unless the
1474 internal variable
1475 .Va sendwait
1476 is set, therefore send errors will not be recognizable until then.
1477 .Ic set Ns
1478 ting (also via
1479 .Fl S )
1480 .Va editalong
1481 will automatically startup a text editor when compose mode is entered,
1482 .Va editheaders
1483 allows editing of headers additionally to plain body content,
1484 .Va askcc
1486 .Va askbcc
1487 will cause the user to be prompted actively for (blind) carbon-copy
1488 recipients, respectively, and (the default)
1489 .Va asksend
1490 will request confirmation whether the message shall be sent.
1492 The envelope sender address is defined by
1493 .Va from ,
1494 explicitly defining an originating
1495 .Va hostname
1496 may be desirable, especially with the builtin SMTP Mail-Transfer-Agent
1497 .Va mta .
1498 .Sx "Character sets"
1499 for outgoing message and MIME part content are configurable via
1500 .Va sendcharsets ,
1501 whereas input data is assumed to be in
1502 .Va ttycharset .
1503 Message data will be passed over the wire in a
1504 .Va mime-encoding .
1505 MIME parts a.k.a. attachments need to be assigned a
1506 .Ic mimetype ,
1507 usually taken out of
1508 .Sx "The mime.types files" .
1509 Saving a copy of sent messages in a
1510 .Va record
1511 mailbox may be desirable \(en as for most mailbox
1512 .Ic file
1513 targets the value will undergo
1514 .Sx "Filename transformations" .
1515 Some introductional
1516 .Fl d
1518 .Va debug
1519 sandbox dry-run tests will prove correctness.
1521 Message recipients (as specified on the command line or defined in
1522 .Ql To: ,
1523 .Ql Cc:
1525 .Ql Bcc: )
1526 may not only be email addressees but can also be names of mailboxes and
1527 even complete shell command pipe specifications.
1528 If the variable
1529 .Va expandaddr
1530 is not set then only network addresses (see
1531 .Xr mailaddr 7
1532 for a description of mail addresses) and plain user names (including MTA
1533 aliases) may be used, other types will be filtered out, giving a warning
1534 message.
1535 A network address that contains no domain-, but only a valid local user
1536 .Ql <name>
1537 in angle brackets will be automatically expanded to a valid address when
1538 .Va hostname
1539 is set to a non-empty value; setting it to the empty value instructs
1540 \*(UA that the used
1541 .Va mta
1542 will perform the necessary expansion.
1543 The command
1544 .Ic addrcodec
1545 can be used to generate standard compliant network addresses.
1547 If the variable
1548 .Va expandaddr
1549 is set then extended recipient addresses will optionally be accepted:
1550 Any name which starts with a vertical bar
1551 .Ql |
1552 character specifies a command pipe \(en the command string following the
1553 .Ql |
1554 is executed and the message is sent to its standard input;
1555 Likewise, any name that starts with the character solidus
1556 .Ql /
1557 or the character sequence dot solidus
1558 .Ql ./
1559 is treated as a file, regardless of the remaining content;
1560 likewise a name that solely consists of a hyphen-minus
1561 .Ql - .
1562 Any other name which contains a commercial at
1563 .Ql @
1564 character is treated as a network address;
1565 Any other name which starts with a plus sign
1566 .Ql +
1567 character specifies a mailbox name;
1568 Any other name which contains a solidus
1569 .Ql /
1570 character but no exclamation mark
1571 .Ql \&!
1572 or percent sign
1573 .Ql %
1574 character before also specifies a mailbox name;
1575 What remains is treated as a network address.
1576 .Bd -literal -offset indent
1577 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1578 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1579 $ echo safe | LC_ALL=C \e
1580     \*(uA -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
1581       -Sexpandaddr=fail,-all,+addr,failinvaddr -s test \e
1582       -. bob@exam.ple
1585 It is possible to create personal distribution lists via the
1586 .Ic alias
1587 command, so that, for instance, the user can send mail to
1588 .Ql cohorts
1589 and have it go to a group of people.
1590 These aliases have nothing in common with the system wide aliases that
1591 may be used by the MTA, which are subject to the
1592 .Ql name
1593 constraint of
1594 .Va expandaddr
1595 and are often tracked in a file
1596 .Pa /etc/aliases
1597 (and documented in
1598 .Xr aliases 5
1600 .Xr sendmail 1 ) .
1601 Personal aliases will be expanded by \*(UA before the message is sent,
1602 and are thus a convenient alternative to specifying each addressee by
1603 itself; they correlate with the active set of
1604 .Ic alternates
1605 and are subject to
1606 .Va metoo
1607 filtering.
1609 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
1611 .Va on-compose-enter , on-compose-leave
1613 .Va on-compose-cleanup
1614 hook variables may be set to
1615 .Ic define Ns
1616 d macros to automatically adjust some settings dependent
1617 on receiver, sender or subject contexts, and via the
1618 .Va on-compose-splice
1619 as well as
1620 .Va on-compose-splice-shell
1621 variables, the former also to be set to a
1622 .Ic define Ns
1623 d macro, increasingly powerful mechanisms to perform automated message
1624 adjustments, including signature creation, are available.
1625 (\*(ID These hooks work for commands which newly create messages, namely
1626 .Ic forward , mail , reply
1627 and variants;
1628 .Ic resend
1630 .Ic Resend
1631 for now provide only the hooks
1632 .Va on-resend-enter
1634 .Va on-resend-cleanup . )
1636 For the purpose of arranging a complete environment of settings that can
1637 be switched to with a single command or command line option there are
1638 .Ic account Ns s .
1639 Alternatively it is also possible to use a flat configuration, making use
1640 of so-called variable chains which automatically pick
1641 .Ql USER@HOST
1643 .Ql HOST
1644 context-dependent variable variants: for example addressing
1645 .Ql Ic File Ns \& pop3://yaa@exam.ple
1646 would find
1647 .Va \&\&pop3-no-apop-yaa@exam.ple ,
1648 .Va \&\&pop3-no-apop-exam.ple
1650 .Va pop3-no-apop
1651 in order.
1653 .Sx "On URL syntax and credential lookup"
1655 .Sx "INTERNAL VARIABLES" .
1657 To avoid environmental noise scripts should
1658 .Dq detach
1659 \*(UA from any configuration files and create a script-local
1660 environment, ideally with the command line options
1661 .Fl \&:
1662 to disable any configuration file in conjunction with repetitions of
1663 .Fl S
1664 to specify variables:
1665 .Bd -literal -offset indent
1666 $ env LC_ALL=C \*(uA -:/ \e
1667     -Sv15-compat -Ssendwait -Sttycharset=utf-8 \e
1668     -Sexpandaddr=fail,-all,failinvaddr \e
1669     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1670     -S from=scriptreply@exam.ple \e
1671     -s 'Subject to go' -a attachment_file \e
1672     -Sfullnames -. \e
1673     'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1674     < content_file
1677 As shown, scripts can
1678 .Dq fake
1679 a locale environment, the above specifies the all-compatible 7-bit clean
1680 .Ev LC_ALL
1681 .Dq C ,
1682 but will nonetheless take and send UTF-8 in the message text by using
1683 .Va ttycharset .
1684 In interactive mode, which is introduced in the next section, messages
1685 can be sent by calling the
1686 .Ic mail
1687 command with a list of recipient addresses:
1688 .Bd -literal -offset indent
1689 $ \*(uA -d -Squiet -Semptystart
1690 "/var/spool/mail/user": 0 messages
1691 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1692 \&...
1693 ? # Will do the right thing (tm)
1694 ? m rec1@exam.ple rec2@exam.ple
1696 .Ss "On reading mail, and interactive mode"
1697 When invoked without addressees \*(UA enters interactive mode in which
1698 mails may be read.
1699 When used like that the user's system
1700 .Va inbox
1701 (for more on mailbox types please see the command
1702 .Ic file )
1703 is read in and a one line header of each message therein is displayed if
1704 the variable
1705 .Va header
1706 is set.
1707 The visual style of this summary of
1708 .Ic headers
1709 can be adjusted through the variable
1710 .Va headline
1711 and the possible sorting criterion via
1712 .Va autosort .
1713 Scrolling through
1714 .Va screen Ns
1715 fuls of
1716 .Ic headers
1717 can be performed with the command
1718 .Ic z .
1719 If the initially opened mailbox is empty \*(UA will instead exit
1720 immediately (after displaying a message) unless the variable
1721 .Va emptystart
1722 is set.
1724 At the
1725 .Va prompt
1726 the command
1727 .Ic list
1728 will give a listing of all available commands and
1729 .Ic help
1730 will give a summary of some common ones.
1731 If the \*(OPal documentation strings are available (see
1732 .Va features )
1733 one can type
1734 .Ql help X
1735 .Pf "(or " Ql ?X )
1736 and see the actual expansion of
1737 .Ql X
1738 and what its purpose is, i.e., commands can be abbreviated
1739 (note that POSIX defines some abbreviations, so that the alphabetical
1740 order of commands does not necessarily relate to the abbreviations; it is
1741 however possible to define overwrites with
1742 .Ic commandalias ) .
1743 These commands can also produce a more
1744 .Va verbose
1745 output.
1747 Messages are given numbers (starting at 1) which uniquely identify
1748 messages; the current message \(en the
1749 .Dq dot
1750 \(en will either be the first new message, or the first unread message,
1751 or the first message of the mailbox; the internal variable
1752 .Va showlast
1753 will instead cause usage of the last message for this purpose.
1754 The command
1755 .Ic headers
1756 will display a
1757 .Va screen Ns
1758 ful of header summaries containing the
1759 .Dq dot ,
1760 whereas
1761 .Ic from
1762 will display only the summaries of the given messages, defaulting to the
1763 .Dq dot .
1765 Message content can be displayed with the command
1766 .Ic type
1767 .Pf ( Ql t ,
1768 alias
1769 .Ic print ) .
1770 Here the variable
1771 .Va crt
1772 controls whether and when \*(UA will use the configured
1773 .Ev PAGER
1774 for display instead of directly writing to the user terminal
1775 .Va screen ,
1776 the sole difference to the command
1777 .Ic more ,
1778 which will always use the
1779 .Ev PAGER .
1780 The command
1781 .Ic top
1782 will instead only show the first
1783 .Va toplines
1784 of a message (maybe even compressed if
1785 .Va topsqueeze
1786 is set).
1787 Message display experience may improve by setting and adjusting
1788 .Va mime-counter-evidence ,
1789 and also see
1790 .Sx "HTML mail and MIME attachments" .
1792 By default the current message
1793 .Pf ( Dq dot )
1794 is displayed, but like with many other commands it is possible to give
1795 a fancy message specification (see
1796 .Sx "Specifying messages" ) ,
1797 e.g.,
1798 .Ql t:u
1799 will display all unread messages,
1800 .Ql t.
1801 will display the
1802 .Dq dot ,
1803 .Ql t 1 5
1804 will type the messages 1 and 5,
1805 .Ql t 1-5
1806 will type the messages 1 through 5, and
1807 .Ql t-
1809 .Ql t+
1810 will display the last and the next message, respectively.
1811 The command
1812 .Ic search
1813 (a more substantial alias for
1814 .Ic from )
1815 will display a header summary of the given message specification list
1816 instead of their content, e.g., the following will search for subjects:
1818 .Dl ? from "'@Some subject to search for'"
1820 In the default setup all header fields of a message will be
1821 .Ic type Ns
1822 d, but fields can be white- or blacklisted for a variety of
1823 applications by using the command
1824 .Ic headerpick ,
1825 e.g., to restrict their display to a very restricted set for
1826 .Ic type :
1827 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1828 In order to display all header fields of a message regardless of
1829 currently active ignore or retain lists, use the commands
1830 .Ic Type
1832 .Ic Top ;
1833 .Ic Show
1834 will show the raw message content.
1835 Note that historically the global
1836 .Pa \*(UR
1837 not only adjusts the list of displayed headers, but also sets
1838 .Va crt .
1840 Dependent upon the configuration a line editor (see the section
1841 .Sx "On terminal control and line editor" )
1842 aims at making the user experience with the many
1843 .Sx COMMANDS
1844 a bit nicer.
1845 When reading the system
1846 .Va inbox
1847 or when
1848 .Fl f
1850 .Ic file )
1851 specified a mailbox explicitly prefixed with the special
1852 .Ql %:
1853 modifier (propagating the mailbox to a
1854 .Mx -sx
1855 .Sx "primary system mailbox" ) ,
1856 then messages which have been read will be automatically moved to a
1857 .Mx -sx
1858 .Sx "secondary mailbox" ,
1859 the users
1860 .Ev MBOX
1861 file, when the mailbox is left, either by changing the
1862 active mailbox or by quitting \*(UA (also see
1863 .Sx "Message states" )
1864 \(en this automatic moving from a system or primary to the secondary
1865 mailbox is not performed when the variable
1866 .Va hold
1867 is set.
1868 Messages can also be explicitly
1869 .Ic move Ns
1870 d to other mailboxes, whereas
1871 .Ic copy
1872 keeps the original message.
1873 .Ic write
1874 can be used to write out data content of specific parts of messages.
1876 After examining a message the user can
1877 .Ic reply Ql r
1878 to the sender and all recipients (which will also be placed in
1879 .Ql To:
1880 unless
1881 .Va recipients-in-cc
1882 is set) or
1883 .Ic Reply Ql R
1884 exclusively to the sender(s).
1885 .Ic forward Ns
1886 ing a message will allow editing the new message: the original message
1887 will be contained in the message body, adjusted according to
1888 .Ic headerpick .
1889 It is possible to
1890 .Ic resend
1892 .Ic Resend
1893 messages: the former will add a series of
1894 .Ql Resent-
1895 headers, whereas the latter will not; different to newly created
1896 messages editing is not possible and no copy will be saved even with
1897 .Va record
1898 unless the additional variable
1899 .Va record-resent
1900 is set.
1901 When sending, replying or forwarding messages comments and full names
1902 will be stripped from recipient addresses unless the internal variable
1903 .Va fullnames
1904 is set.
1905 Of course messages can be
1906 .Ic delete Ql d ,
1907 and they can spring into existence again via
1908 .Ic undelete
1909 or when the \*(UA session is ended via the
1910 .Ic exit Ql x
1911 command.
1913 To end a mail processing session one may either issue
1914 .Ic quit Ql q
1915 to cause a full program exit, which possibly includes
1916 automatic moving of read messages to the
1917 .Mx -sx
1918 .Sx "secondary mailbox"
1919 .Ev MBOX
1920 as well as updating the \*(OPal (see
1921 .Va features )
1922 line editor
1923 .Va history-file ,
1924 or use the command
1925 .Ic exit Ql x
1926 instead in order to prevent any of these actions.
1927 .Ss "HTML mail and MIME attachments"
1928 Messages which are HTML-only become more and more common and of course
1929 many messages come bundled with a bouquet of MIME (Multipurpose Internet
1930 Mail Extensions) parts for, e.g., attachments.
1931 To get a notion of MIME types, \*(UA will first read
1932 .Sx "The mime.types files"
1933 (as configured and allowed by
1934 .Va mimetypes-load-control ) ,
1935 and then add onto that types registered directly with
1936 .Ic mimetype .
1937 It (normally) has a default set of types built-in, too.
1938 To improve interaction with faulty MIME part declarations which are
1939 often seen in real-life messages, setting
1940 .Va mime-counter-evidence
1941 will allow \*(UA to verify the given assertion and possibly provide
1942 an alternative MIME type.
1944 Whereas \*(UA \*(OPally supports a simple HTML-to-text converter for
1945 HTML messages, it cannot handle MIME types other than plain text itself.
1946 Instead programs need to become registered to deal with specific MIME
1947 types or file extensions.
1948 These programs may either prepare plain text versions of their input in
1949 order to enable \*(UA to integrate their output neatlessly in its own
1950 message visualization (a mode which is called
1951 .Cd copiousoutput ) ,
1952 or display the content themselves, for example in an external graphical
1953 window: such handlers will only be considered by and for the command
1954 .Ic mimeview .
1956 To install a handler program for a specific MIME type an according
1957 .Va pipe-TYPE/SUBTYPE
1958 variable needs to be set; to instead define a handler for a specific
1959 file extension the respective
1960 .Va pipe-EXTENSION
1961 variable can be used \(en these handlers take precedence.
1962 \*(OPally \*(UA supports mail user agent configuration as defined in
1963 RFC 1524; this mechanism (see
1964 .Sx "The Mailcap files" )
1965 will be queried for display or quote handlers if none of the former two
1966 did; it will be the sole source for handlers of other purpose.
1967 A last source for handlers is the MIME type definition itself, when
1968 a (\*(UA specific) type-marker was registered with the command
1969 .Ic mimetype
1970 (which many built-in MIME types do).
1972 E.g., to display a HTML message inline (that is, converted to a more
1973 fancy plain text representation than the built-in converter is capable to
1974 produce) with either of the text-mode browsers
1975 .Xr lynx 1
1977 .Xr elinks 1 ,
1978 teach \*(UA about MathML documents and make it display them as plain
1979 text, and to open PDF attachments in an external PDF viewer,
1980 asynchronously and with some other magic attached:
1981 .Bd -literal -offset indent
1982 ? if [ "$features" !% +filter-html-tagsoup ]
1983 ?  #set pipe-text/html='@* elinks -force-html -dump 1'
1984 ?  set pipe-text/html='@* lynx -stdin -dump -force_html'
1985 ?  # Display HTML as plain text instead
1986 ?  #set pipe-text/html=@
1987 ? endif
1988 ? mimetype @ application/mathml+xml mathml
1989 ? wysh set pipe-application/pdf='@&=@ \e
1990     trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1991     trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1992     mupdf "${MAILX_FILENAME_TEMPORARY}"'
1994 .Ss "Mailing lists"
1995 \*(UA offers some support to ease handling of mailing lists.
1996 The command
1997 .Ic mlist
1998 promotes all given arguments to known mailing lists, and
1999 .Ic mlsubscribe
2000 sets their subscription attribute, creating them first as necessary.
2001 (On the other hand
2002 .Ic unmlsubscribe
2003 does not
2004 .Ic unmlist
2005 automatically, but only resets the subscription attribute.)
2006 Using the commands without arguments will show (a subset of) all
2007 currently defined mailing lists.
2009 .Va headline
2010 format
2011 .Ql \&%T
2012 can be used to mark out messages with configured list addresses
2013 in the header display.
2015 If the \*(OPal regular expression support is available a mailing list
2016 specification that contains any of the
2017 .Dq magical
2018 regular expression characters
2019 .Ql ^[]*+?|$
2020 (see
2021 .Xr re_format 7 )
2022 will be interpreted as one, which allows matching of many addresses with
2023 a single expression.
2024 However, all fully qualified list addresses are matched via a fast
2025 dictionary, whereas expressions are placed in (a) list(s) which is
2026 (are) matched sequentially.
2027 .Bd -literal -offset indent
2028 ? set followup-to followup-to-honour=ask-yes \e
2029     reply-to-honour=ask-yes
2030 ? wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
2031 ? mlsubscribe a4@b4.c4 exact@lists.c3
2034 The variable
2035 .Va followup-to-honour
2036 will ensure that a
2037 .Ql Mail-\:Followup-\:To:
2038 header is honoured when the message is being replied to (via
2039 .Ic reply
2041 .Ic Lreply )
2043 .Va followup-to
2044 controls whether this header is created when sending mails; it will be
2045 created automatically for a couple of reasons, too, like when the
2046 special
2047 .Dq mailing list specific
2048 respond command
2049 .Ic Lreply
2050 is used, when
2051 .Ic reply
2052 is used to respond to a message with its
2053 .Ql Mail-Followup-To:
2054 being honoured etc.
2056 A difference in between the handling of known and subscribed lists is
2057 that the address of the sender is usually not part of a generated
2058 .Ql Mail-Followup-To:
2059 when addressing the latter, whereas it is for the former kind of lists.
2060 Usually because there are exceptions: say, if multiple lists are
2061 addressed and not all of them are subscribed lists.
2063 For convenience \*(UA will, temporarily, automatically add a list
2064 address that is presented in the
2065 .Ql List-Post:
2066 header of a message that is being responded to to the list of known
2067 mailing lists.
2068 Shall that header have existed \*(UA will instead, dependent on the
2069 variable
2070 .Va reply-to-honour ,
2071 use an also set
2072 .Ql Reply-To:
2073 for this purpose in order to accept a list administrators' wish that
2074 is supposed to have been manifested like that (but only if it provides
2075 a single address which resides on the same domain as what is stated in
2076 .Ql List-Post: ) .
2077 .Ss "Signed and encrypted messages with S/MIME"
2078 \*(OP S/MIME provides two central mechanisms:
2079 message signing and message encryption.
2080 A signed message contains some data in addition to the regular text.
2081 The data can be used to verify that the message was sent using a valid
2082 certificate, that the sender's address in the message header matches
2083 that in the certificate, and that the message text has not been altered.
2084 Signing a message does not change its regular text;
2085 it can be read regardless of whether the recipient's software is able to
2086 handle S/MIME.
2087 It is thus usually possible to sign all outgoing messages if so desired.
2089 Encryption, in contrast, makes the message text invisible for all people
2090 except those who have access to the secret decryption key.
2091 To encrypt a message, the specific recipient's public encryption key
2092 must be known.
2093 It is therefore not possible to send encrypted mail to people unless their
2094 key has been retrieved from either previous communication or public key
2095 directories.
2096 A message should always be signed before it is encrypted.
2097 Otherwise, it is still possible that the encrypted message text is
2098 altered.
2100 A central concept to S/MIME is that of the certification authority (CA).
2101 A CA is a trusted institution that issues certificates.
2102 For each of these certificates it can be verified that it really
2103 originates from the CA, provided that the CA's own certificate is
2104 previously known.
2105 A set of CA certificates is usually delivered with OpenSSL and installed
2106 on your system.
2107 If you trust the source of your OpenSSL software installation,
2108 this offers reasonable security for S/MIME on the Internet.
2109 Otherwise set
2110 .Va smime-ca-no-defaults
2111 to avoid using the default certificates and point
2112 .Va smime-ca-file
2113 and/or
2114 .Va smime-ca-dir
2115 to a trusted pool of certificates.
2116 In general, a certificate cannot be more secure than the method its CA
2117 certificate has been retrieved with.
2119 This trusted pool of certificates is used by the command
2120 .Ic verify
2121 to ensure that the given S/MIME messages can be trusted.
2122 If so, verified sender certificates that were embedded in signed
2123 messages can be saved locally with the command
2124 .Ic certsave ,
2125 and used by \*(UA to encrypt further communication with these senders:
2126 .Bd -literal -offset indent
2127 ? certsave FILENAME
2128 ? set smime-encrypt-USER@HOST=FILENAME \e
2129     smime-cipher-USER@HOST=AES256
2132 To sign outgoing messages in order to allow receivers to verify the
2133 origin of these messages a personal S/MIME certificate is required.
2134 \*(UA supports password-protected personal certificates (and keys),
2135 for more on this, and its automatization, please see the section
2136 .Sx "On URL syntax and credential lookup" .
2137 The section
2138 .Sx "S/MIME step by step"
2139 shows examplarily how such a private certificate can be obtained.
2140 In general, if such a private key plus certificate
2141 .Dq pair
2142 is available, all that needs to be done is to set some variables:
2143 .Bd -literal -offset indent
2144 ? set smime-sign-cert=ME@HERE.com.paired \e
2145     smime-sign-message-digest=SHA256 \e
2146     smime-sign
2149 Variables of interest for S/MIME in general are
2150 .Va smime-ca-dir ,
2151 .Va smime-ca-file ,
2152 .Va smime-ca-flags ,
2153 .Va smime-ca-no-defaults ,
2154 .Va smime-crl-dir ,
2155 .Va smime-crl-file .
2156 For S/MIME signing of interest are
2157 .Va smime-sign ,
2158 .Va smime-sign-cert ,
2159 .Va smime-sign-include-certs
2161 .Va smime-sign-message-digest .
2162 Additional variables of interest for S/MIME en- and decryption:
2163 .Va smime-cipher
2165 .Va smime-encrypt-USER@HOST .
2167 \*(ID Note that neither S/MIME signing nor encryption applies to
2168 message subjects or other header fields yet.
2169 Thus they may not contain sensitive information for encrypted messages,
2170 and cannot be trusted even if the message content has been verified.
2171 When sending signed messages,
2172 it is recommended to repeat any important header information in the
2173 message text.
2174 .Ss "On URL syntax and credential lookup"
2175 \*(IN For accessing protocol-specific resources usage of Uniform
2176 Resource Locators (URL, RFC 1738) has become omnipresent.
2177 \*(UA expects and understands URLs in the following form;
2178 parts in brackets
2179 .Ql []
2180 denote optional parts, optional either because there also exist other
2181 ways to define the information in question or because support of the
2182 part is protocol-specific (e.g.,
2183 .Ql /path
2184 is used by the local maildir and the IMAP protocol, but not by POP3);
2185 If any of
2186 .Ql USER
2188 .Ql PASSWORD
2189 are specified they must be given in URL percent encoded form (RFC 3986;
2190 the command
2191 .Ic urlcodec
2192 may be helpful):
2194 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
2196 Note that these \*(UA URLs most often do not conform to any real
2197 standard, but instead represent a normalized variant of RFC 1738 \(en
2198 they are not used in data exchange but only meant as a compact,
2199 easy-to-use way of defining and representing information in
2200 a well-known notation.
2202 Many internal variables of \*(UA exist in multiple versions, called
2203 variable chains for the rest of this document: the plain
2204 .Ql variable
2205 as well as
2206 .Ql variable-HOST
2208 .Ql variable-USER@HOST .
2209 Here
2210 .Ql HOST
2211 indeed means
2212 .Ql server:port
2213 if a
2214 .Ql port
2215 had been specified in the respective URL, otherwise it refers to the plain
2216 .Ql server .
2217 Also,
2218 .Ql USER
2219 is not truly the
2220 .Ql USER
2221 that had been found when doing the user chain lookup as is described
2222 below, i.e., this
2223 .Ql USER
2224 will never be in URL percent encoded form, whether it came from an URL
2225 or not; i.e., variable chain name extensions of
2226 .Sx "INTERNAL VARIABLES"
2227 must not be URL percent encoded.
2229 For example, whether an hypothetical URL
2230 .Ql smtp://hey%3Ayou@our.house
2231 had been given that includes a user, or whether the URL was
2232 .Ql smtp://our.house
2233 and the user had been found differently, to lookup the variable chain
2234 .Va smtp-use-starttls
2235 \*(UA first looks for whether
2236 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
2237 is defined, then whether
2238 .Ql smtp-\:use-\:starttls-\:our.house
2239 exists before finally ending up looking at the plain variable itself.
2241 \*(UA obeys the following logic scheme when dealing with the
2242 necessary credential information of an account:
2243 .Bl -bullet
2245 If no
2246 .Ql USER
2247 has been given in the URL the variables
2248 .Va user-HOST
2250 .Va user
2251 are looked up; if no such variable(s) can be found then \*(UA will,
2252 when enforced by the \*(OPal variables
2253 .Va netrc-lookup-HOST
2255 .Va netrc-lookup ,
2256 search the users
2257 .Pa .netrc
2258 file for a
2259 .Ql HOST
2260 specific entry which provides a
2261 .Ql login
2262 name: this lookup will only succeed if unambiguous (one possible matching
2263 entry for
2264 .Ql HOST ) .
2265 It is possible to load encrypted
2266 .Pa .netrc
2267 files via
2268 .Va netrc-pipe .
2270 If there is still no
2271 .Ql USER
2272 then \*(UA will fall back to the user who is supposed to run \*(UA,
2273 the identity of which has been fixated during \*(UA startup and is
2274 known to be a valid user on the current host.
2276 Authentication: unless otherwise noted this will lookup the
2277 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
2278 variable chain, falling back to a protocol-specific default should this
2279 have no success.
2281 If no
2282 .Ql PASSWORD
2283 has been given in the URL, then if the
2284 .Ql USER
2285 has been found through the \*(OPal
2286 .Va netrc-lookup
2287 that may have already provided the password, too.
2288 Otherwise the variable chain
2289 .Va password-USER@HOST , password-HOST , password
2290 is looked up and used if existent.
2292 Afterwards the complete \*(OPal variable chain
2293 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
2294 is looked up.
2295 If set, the
2296 .Ic netrc
2297 cache is searched for a password only (multiple user accounts for
2298 a single machine may exist as well as a fallback entry without user
2299 but with a password).
2301 If at that point there is still no password available, but the
2302 (protocols') chosen authentication type requires a password, then in
2303 interactive mode the user will be prompted on the terminal.
2306 .Sy Note:
2307 S/MIME verification works relative to the values found in the
2308 .Ql From:
2310 .Ql Sender: )
2311 header field(s), which means that the values of
2312 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
2314 .Va smime-sign-message-digest
2315 will not be looked up using the
2316 .Ql USER
2318 .Ql HOST
2319 chains from above but instead use the corresponding values from the
2320 message that is being worked on.
2321 In unusual cases multiple and different
2322 .Ql USER
2324 .Ql HOST
2325 combinations may therefore be involved \(en on the other hand those
2326 unusual cases become possible.
2327 The usual case is as short as:
2328 .Bd -literal -offset indent
2329 set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
2330     smime-sign smime-sign-cert=+smime.pair
2333 The section
2334 .Sx EXAMPLES
2335 contains complete example configurations.
2336 .Ss "Encrypted network communication"
2337 SSL (Secure Sockets Layer) a.k.a. its successor TLS (Transport Layer
2338 Security) are protocols which aid in securing communication by providing
2339 a safely initiated and encrypted network connection.
2340 A central concept of SSL/TLS is that of certificates: as part of each
2341 network connection setup a (set of) certificates will be exchanged, and
2342 by using those the identity of the network peer can be cryptographically
2343 verified.
2344 SSL/TLS works by using a locally installed pool of trusted certificates,
2345 and verifying the connection peer succeeds if that provides
2346 a certificate which has been issued or is trusted by any certificate in
2347 the trusted local pool.
2349 The local pool of trusted so-called CA (Certification Authority)
2350 certificates is usually delivered with the used SSL/TLS library, and
2351 will be selected automatically, but it is also possible to create and
2352 use an own pool of trusted certificates.
2353 If this is desired, set
2354 .Va ssl-ca-no-defaults
2355 to avoid using the default certificate pool, and point
2356 .Va ssl-ca-file
2357 and/or
2358 .Va ssl-ca-dir
2359 to a trusted pool of certificates.
2360 A certificate cannot be more secure than the method its CA certificate
2361 has been retrieved with.
2363 It depends on the used protocol whether encrypted communication is
2364 possible, and which configuration steps have to be taken to enable it.
2365 Some protocols, e.g., POP3S, are implicitly encrypted, others, like
2366 POP3, can upgrade a plain text connection if so requested: POP3 offers
2367 .Ql STLS ,
2368 which will be used if the variable (chain)
2369 .Va pop3-use-starttls
2370 is set:
2371 .Bd -literal -offset indent
2372 shortcut encpop1 pop3s://pop1.exam.ple
2374 shortcut encpop2 pop3://pop2.exam.ple
2375 set pop3-use-starttls-pop2.exam.ple
2377 set mta=smtps://smtp.exam.ple:465
2378 set mta=smtp://smtp.exam.ple smtp-use-starttls
2381 Normally that is all there is to do, given that SSL/TLS libraries try to
2382 provide safe defaults, plenty of knobs however exist to adjust settings.
2383 For example certificate verification settings can be fine-tuned via
2384 .Va ssl-ca-flags ,
2385 and the SSL/TLS configuration basics are accessible via
2386 .Va ssl-config-pairs ,
2387 e.g., to specify the allowed protocols or cipher lists that
2388 a communication channel may use.
2389 In the past hints of how to restrict the set of protocols to highly
2390 secure ones were indicated, as of the time of this writing the allowed
2391 protocols or cipher list may need to become relaxed in order to be able
2392 to connect to some servers; the following example allows connecting to a
2393 .Dq Lion
2394 that uses OpenSSL 0.9.8za from June 2014 (refer to
2395 .Sx "INTERNAL VARIABLES"
2396 for more on variable chains):
2397 .Bd -literal -offset indent
2398 wysh set ssl-config-pairs-lion@exam.ple='MinProtocol=TLSv1.1,\e
2399     CipherList=TLSv1.2:!aNULL:!eNULL:\e
2400       ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
2401       DHE-RSA-AES256-SHA:@STRENGTH'
2404 The OpenSSL program
2405 .Xr ciphers 1
2406 can be used and should be referred to when creating a custom cipher list.
2407 Variables of interest for SSL/TLS in general are
2408 .Va ssl-ca-dir ,
2409 .Va ssl-ca-file ,
2410 .Va ssl-ca-flags ,
2411 .Va ssl-ca-no-defaults ,
2412 .Va ssl-config-file ,
2413 .Va ssl-config-module ,
2414 .Va ssl-config-pairs ,
2415 .Va ssl-crl-dir ,
2416 .Va ssl-crl-file ,
2417 .Va ssl-rand-file
2418 as well as
2419 .Va ssl-verify .
2420 .Ss "Character sets"
2421 \*(OP \*(UA detects the character set of the terminal by using
2422 mechanisms that are controlled by the
2423 .Ev LC_CTYPE
2424 environment variable
2425 (in fact
2426 .Ev LC_ALL ,
2427 .Ev \&\&LC_CTYPE ,
2428 .Ev LANG ,
2429 in that order, see there).
2430 The internal variable
2431 .Va ttycharset
2432 will be set to the detected terminal character set accordingly,
2433 and will thus show up in the output of commands like, e.g.,
2434 .Ic set
2436 .Ic varshow .
2438 However, the user may give a value for
2439 .Va ttycharset
2440 during startup, so that it is possible to send mail in a completely
2441 .Dq faked
2442 locale environment, an option which can be used to generate and send,
2443 e.g., 8-bit UTF-8 input data in a pure 7-bit US-ASCII
2444 .Ql LC_ALL=C
2445 environment (an example of this can be found in the section
2446 .Sx "On sending mail, and non-interactive mode" ) .
2447 Changing the value does not mean much beside that, because several
2448 aspects of the real character set are implied by the locale environment
2449 of the system, which stays unaffected by
2450 .Va ttycharset .
2452 Messages and attachments which consist of 7-bit clean data will be
2453 classified as consisting of
2454 .Va charset-7bit
2455 character data.
2456 This is a problem if the
2457 .Va ttycharset
2458 character set is a multibyte character set that is also 7-bit clean.
2459 For example, the Japanese character set ISO-2022-JP is 7-bit clean but
2460 capable to encode the rich set of Japanese Kanji, Hiragana and Katakana
2461 characters: in order to notify receivers of this character set the mail
2462 message must be MIME encoded so that the character set ISO-2022-JP can
2463 be advertised!
2464 To achieve this, the variable
2465 .Va charset-7bit
2466 must be set to ISO-2022-JP.
2467 (Today a better approach regarding email is the usage of UTF-8, which
2468 uses 8-bit bytes for non-US-ASCII data.)
2470 If the \*(OPal character set conversion capabilities are not available
2471 .Pf ( Va features
2472 does not include the term
2473 .Ql +iconv ) ,
2474 then
2475 .Va ttycharset
2476 will be the only supported character set,
2477 it is simply assumed that it can be used to exchange 8-bit messages
2478 (over the wire an intermediate, configurable
2479 .Va mime-encoding
2480 may be applied),
2481 and the rest of this section does not apply;
2482 it may however still be necessary to explicitly set it if automatic
2483 detection fails, since in that case it defaults to
2484 LATIN1 a.k.a. ISO-8859-1.
2486 \*(OP When reading messages, their text is converted into
2487 .Va ttycharset
2488 as necessary in order to display them on the users terminal.
2489 Unprintable characters and invalid byte sequences are detected
2490 and replaced by proper substitution characters.
2491 Character set mappings for source character sets can be established with
2492 the command
2493 .Ic charsetalias ,
2494 which may be handy to work around faulty character set catalogues (e.g.,
2495 to add a missing LATIN1 to ISO-8859-1 mapping), or to enforce treatment
2496 of one character set as another one (e.g., to interpret LATIN1 as CP1252).
2497 Also see
2498 .Va charset-unknown-8bit
2499 to deal with another hairy aspect of message interpretation.
2501 When sending messages all their parts and attachments are classified.
2502 Whereas no character set conversion is performed on those parts which
2503 appear to be binary data,
2504 the character set being used must be declared within the MIME header of
2505 an outgoing text part if it contains characters that do not conform to
2506 the set of characters that are allowed by the email standards.
2507 Permissible values for character sets used in outgoing messages can be
2508 declared using the
2509 .Va sendcharsets
2510 variable, and
2511 .Va charset-8bit ,
2512 which defines a catch-all last-resort fallback character set that is
2513 implicitly appended to the list of character sets in
2514 .Va sendcharsets .
2516 When replying to a message and the variable
2517 .Va reply-in-same-charset
2518 is set, then the character set of the message being replied to
2519 is tried first (still being a subject of
2520 .Ic charsetalias ) .
2521 And it is also possible to make \*(UA work even more closely related to
2522 the current locale setting automatically by using the variable
2523 .Va sendcharsets-else-ttycharset ,
2524 please see there for more information.
2526 All the specified character sets are tried in order unless the
2527 conversion of the part or attachment succeeds.
2528 If none of the tried (8-bit) character sets is capable to represent the
2529 content of the part or attachment,
2530 then the message will not be sent and its text will optionally be
2531 .Va save Ns d
2533 .Ev DEAD .
2534 In general, if a message saying
2535 .Dq cannot convert from a to b
2536 appears, either some characters are not appropriate for the currently
2537 selected (terminal) character set,
2538 or the needed conversion is not supported by the system.
2539 In the first case, it is necessary to set an appropriate
2540 .Ev LC_CTYPE
2541 locale and/or the variable
2542 .Va ttycharset .
2544 The best results are usually achieved when \*(UA is run in a UTF-8
2545 locale on an UTF-8 capable terminal, in which case the full Unicode
2546 spectrum of characters is available.
2547 In this setup characters from various countries can be displayed,
2548 while it is still possible to use more simple character sets for sending
2549 to retain maximum compatibility with older mail clients.
2551 On the other hand the POSIX standard defines a locale-independent 7-bit
2552 .Dq portable character set
2553 that should be used when overall portability is an issue, the even more
2554 restricted subset named
2555 .Dq portable filename character set
2556 consists of A-Z, a-z, 0-9, period
2557 .Ql \&. ,
2558 underscore
2559 .Ql _
2560 and hyphen-minus
2561 .Ql - .
2562 .Ss "Message states"
2563 \*(UA differentiates in between several different message states;
2564 the current state will be reflected in header summary displays if
2565 .Va headline
2566 is configured to do so (via the internal variable
2567 .Va attrlist ) ,
2568 and messages can also be selected and be acted upon depending on their
2569 state (see
2570 .Sx "Specifying messages" ) .
2571 When operating on the system
2572 .Va inbox ,
2573 or in any other
2574 .Mx -sx
2575 .Sx "primary system mailbox" ,
2576 special actions, like the automatic moving of messages to the
2577 .Mx -sx
2578 .Sx "secondary mailbox"
2579 .Ev MBOX ,
2580 may be applied when the mailbox is left (also implicitly via
2581 a successful exit of \*(UA, but not if the special command
2582 .Ic exit
2583 is used) \(en however, because this may be irritating to users which
2584 are used to
2585 .Dq more modern
2586 mail-user-agents, the default global
2587 .Pa \*(UR
2588 sets the internal
2589 .Va hold
2591 .Va keepsave
2592 variables in order to suppress this behaviour.
2593 .Bl -hang -width ".It Ql new"
2594 .It Ql new
2595 Message has neither been viewed nor moved to any other state.
2596 Such messages are retained even in the
2597 .Mx -sx
2598 .Sx "primary system mailbox" .
2599 .It Ql unread
2600 Message has neither been viewed nor moved to any other state, but the
2601 message was present already when the mailbox has been opened last:
2602 Such messages are retained even in the
2603 .Mx -sx
2604 .Sx "primary system mailbox" .
2605 .It Ql read
2606 The message has been processed by one of the following commands:
2607 .Ic ~f ,
2608 .Ic ~m ,
2609 .Ic ~F ,
2610 .Ic ~M ,
2611 .Ic copy ,
2612 .Ic mbox ,
2613 .Ic next ,
2614 .Ic pipe  ,
2615 .Ic Print ,
2616 .Ic print ,
2617 .Ic top ,
2618 .Ic Type ,
2619 .Ic type ,
2620 .Ic undelete .
2621 The commands
2622 .Ic dp
2624 .Ic dt
2625 will always try to automatically
2626 .Dq step
2628 .Ic type
2630 .Dq next
2631 logical message, and may thus mark multiple messages as read, the
2632 .Ic delete
2633 command will do so if  the internal variable
2634 .Va autoprint
2635 is set.
2636 Except when the
2637 .Ic exit
2638 command is used, messages that are in a
2639 .Mx -sx
2640 .Sx "primary system mailbox"
2641 and are in
2642 .Ql read
2643 state when the mailbox is left will be saved in the
2644 .Mx -sx
2645 .Sx "secondary mailbox"
2646 .Ev MBOX
2647 unless the internal variable
2648 .Va hold
2649 it set.
2650 .It Ql deleted
2651 The message has been processed by one of the following commands:
2652 .Ic delete ,
2653 .Ic dp ,
2654 .Ic dt .
2655 Only
2656 .Ic undelete
2657 can be used to access such messages.
2658 .It Ql preserved
2659 The message has been processed by a
2660 .Ic preserve
2661 command and it will be retained in its current location.
2662 .It Ql saved
2663 The message has been processed by one of the following commands:
2664 .Ic save
2666 .Ic write .
2667 Unless when the
2668 .Ic exit
2669 command is used, messages that are in a
2670 .Mx -sx
2671 .Sx "primary system mailbox"
2672 and are in
2673 .Ql saved
2674 state when the mailbox is left will be deleted; they will be saved in the
2675 .Mx -sx
2676 .Sx "secondary mailbox"
2677 .Ev MBOX
2678 when the internal variable
2679 .Va keepsave
2680 is set.
2683 In addition to these message states, flags which otherwise have no
2684 technical meaning in the mail system except allowing special ways of
2685 addressing them when
2686 .Sx "Specifying messages"
2687 can be set on messages.
2688 These flags are saved with messages and are thus persistent, and are
2689 portable between a set of widely used MUAs.
2690 .Bl -hang -width ".It Ic answered"
2691 .It Ic answered
2692 Mark messages as having been answered.
2693 .It Ic draft
2694 Mark messages as being a draft.
2695 .It Ic flag
2696 Mark messages which need special attention.
2698 .Ss "Specifying messages"
2699 Commands which take
2700 .Sx "Message list arguments" ,
2701 such as
2702 .Ic from
2703 a.k.a.\&
2704 .Ic search ,
2705 .Ic type
2707 .Ic delete ,
2708 can be given a list of message numbers as arguments to apply to a number
2709 of messages at once.
2710 Thus
2711 .Ql delete 1 2
2712 deletes messages 1 and 2,
2713 whereas
2714 .Ql delete 1-5
2715 will delete the messages 1 through 5.
2716 In sorted or threaded mode (see the
2717 .Ic sort
2718 command),
2719 .Ql delete 1-5
2720 will delete the messages that are located between (and including)
2721 messages 1 through 5 in the sorted/threaded order, as shown in the
2722 .Ic headers
2723 summary.
2724 The following special message names exist:
2725 .Bl -tag -width ".It Ar BaNg"
2726 .It Ar \&.
2727 The current message, the so-called
2728 .Dq dot .
2729 .It Ar \&;
2730 The message that was previously the current message.
2731 .It Ar \&,
2732 The parent message of the current message,
2733 that is the message with the Message-ID given in the
2734 .Ql In-Reply-To:
2735 field or the last entry of the
2736 .Ql References:
2737 field of the current message.
2738 .It Ar -
2739 The next previous undeleted message,
2740 or the next previous deleted message for the
2741 .Ic undelete
2742 command.
2743 In sorted/threaded mode,
2744 the next previous such message in the sorted/threaded order.
2745 .It Ar +
2746 The next undeleted message,
2747 or the next deleted message for the
2748 .Ic undelete
2749 command.
2750 In sorted/threaded mode,
2751 the next such message in the sorted/threaded order.
2752 .It Ar ^
2753 The first undeleted message,
2754 or the first deleted message for the
2755 .Ic undelete
2756 command.
2757 In sorted/threaded mode,
2758 the first such message in the sorted/threaded order.
2759 .It Ar $
2760 The last message.
2761 In sorted/threaded mode,
2762 the last message in the sorted/threaded order.
2763 .It Ar & Ns Ar x
2764 In threaded mode,
2765 selects the message addressed with
2766 .Ar x ,
2767 where
2768 .Ar x
2769 is any other message specification,
2770 and all messages from the thread that begins at it.
2771 Otherwise it is identical to
2772 .Ar x .
2774 .Ar x
2775 is omitted,
2776 the thread beginning with the current message is selected.
2777 .It Ar *
2778 All messages.
2779 .It Ar `
2780 All messages that were included in the
2781 .Sx "Message list arguments"
2782 of the previous command.
2783 .It Ar x-y
2784 An inclusive range of message numbers.
2785 Selectors that may also be used as endpoints include any of
2786 .Ar .;-+^$ .
2787 .It Ar address
2788 A case-insensitive
2789 .Dq any substring matches
2790 search against the
2791 .Ql From:
2792 header, which will match addresses (too) even if
2793 .Va showname
2794 is set (and POSIX says
2795 .Dq any address as shown in a header summary shall be matchable in this form ) ;
2796 However, if the
2797 .Va allnet
2798 variable is set, only the local part of the address is evaluated
2799 for the comparison, not ignoring case, and the setting of
2800 .Va showname
2801 is completely ignored.
2802 For finer control and match boundaries use the
2803 .Ql @
2804 search expression.
2805 .It Ar / Ns Ar string
2806 All messages that contain
2807 .Ar string
2808 in the subject field (case ignored according to locale).
2809 See also the
2810 .Va searchheaders
2811 variable.
2813 .Ar string
2814 is empty,
2815 the string from the previous specification of that type is used again.
2816 .It Xo Op Ar @ Ns Ar name-list Ns
2817 .Ar @ Ns Ar expr
2819 All messages that contain the given case-insensitive search
2820 .Ar expr Ns
2821 ession;  If the \*(OPal regular expression support is available
2822 .Ar expr
2823 will be interpreted as (an extended) one if any of the
2824 .Dq magical
2825 regular expression characters
2826 .Ql ^[]*+?|$
2827 is seen (see
2828 .Xr re_format 7 ) .
2829 If the optional
2830 .Ar @ Ns Ar name-list
2831 part is missing the search is restricted to the subject field body,
2832 but otherwise
2833 .Ar name-list
2834 specifies a comma-separated list of header fields to search, e.g.,
2836 .Dl '@to,from,cc@Someone i ought to know'
2838 In order to search for a string that includes a
2839 .Ql @
2840 (commercial at) character the
2841 .Ar name-list
2842 is effectively non-optional, but may be given as the empty string.
2843 Also, specifying an empty search
2844 .Ar expr Ns
2845 ession will effectively test for existence of the given header fields.
2846 Some special header fields may be abbreviated:
2847 .Ql f ,
2848 .Ql t ,
2849 .Ql c ,
2850 .Ql b
2852 .Ql s
2853 will match
2854 .Ql From ,
2855 .Ql To ,
2856 .Ql Cc ,
2857 .Ql Bcc
2859 .Ql Subject ,
2860 respectively and case-insensitively.
2861 \*(OPally, and just like
2862 .Ar expr ,
2863 .Ar name-list
2864 will be interpreted as (an extended) regular expression if any of the
2865 .Dq magical
2866 regular expression characters is seen.
2868 The special names
2869 .Ql header
2871 .Ql <
2872 can be used to search in (all of) the header(s) of the message, and the
2873 special names
2874 .Ql body
2876 .Ql >
2878 .Ql text
2880 .Ql =
2881 will perform full text searches \(en whereas the former searches only
2882 the body, the latter also searches the message header (\*(ID this mode
2883 yet brute force searches over the entire decoded content of messages,
2884 including administrativa strings).
2886 This specification performs full text comparison, but even with
2887 regular expression support it is almost impossible to write a search
2888 expression that safely matches only a specific address domain.
2889 To request that the body content of the header is treated as a list of
2890 addresses, and to strip those down to the plain email address which the
2891 search expression is to be matched against, prefix the effective
2892 .Ar name-list
2893 with a tilde
2894 .Ql ~ :
2896 .Dl @~f@@a\e.safe\e.domain\e.match$
2897 .It Ar :c
2898 All messages of state or with matching condition
2899 .Ql c ,
2900 where
2901 .Ql c
2902 is one or multiple of the following colon modifiers:
2904 .Bl -tag -compact -width ".It Ar :M"
2905 .It Ar a
2906 .Ic answered
2907 messages (cf. the variable
2908 .Va markanswered ) .
2909 .It Ar d
2910 .Ql deleted
2911 messages (for the
2912 .Ic undelete
2914 .Ic from
2915 commands only).
2916 .It Ar f
2917 .Ic flag Ns
2918 ged messages.
2919 .It Ar L
2920 Messages with receivers that match
2921 .Ic mlsubscribe Ns
2922 d addresses.
2923 .It Ar l
2924 Messages with receivers that match
2925 .Ic mlist Ns
2926 ed addresses.
2927 .It Ar n
2928 .Ql new
2929 messages.
2930 .It Ar o
2931 Old messages (any not in state
2932 .Ql read
2934 .Ql new ) .
2935 .It Ar r
2936 .Ql read
2937 messages.
2938 .It Ar S
2939 \*(OP Messages with unsure spam classification (see
2940 .Sx "Handling spam" ) .
2941 .It Ar s
2942 \*(OP Messages classified as spam.
2943 .It Ar t
2944 Messages marked as
2945 .Ic draft .
2946 .It Ar u
2947 .Ql unread
2948 messages.
2952 \*(OP IMAP-style SEARCH expressions may also be used.
2953 This addressing mode is available with all types of mailbox
2954 .Ic folder Ns
2955 s; \*(UA will perform the search locally as necessary.
2956 Strings must be enclosed by double quotes
2957 .Ql \&"
2958 in their entirety if they contain whitespace or parentheses;
2959 within the quotes, only reverse solidus
2960 .Ql \e
2961 is recognized as an escape character.
2962 All string searches are case-insensitive.
2963 When the description indicates that the
2964 .Dq envelope
2965 representation of an address field is used,
2966 this means that the search string is checked against both a list
2967 constructed as
2968 .Bd -literal -offset indent
2969 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
2972 for each address,
2973 and the addresses without real names from the respective header field.
2974 These search expressions can be nested using parentheses, see below for
2975 examples.
2977 .Bl -tag -compact -width ".It Ar _n_u"
2978 .It Ar ( criterion )
2979 All messages that satisfy the given
2980 .Ar criterion .
2981 .It Ar ( criterion1 criterion2 ... criterionN )
2982 All messages that satisfy all of the given criteria.
2983 .It Ar ( or criterion1 criterion2 )
2984 All messages that satisfy either
2985 .Ar criterion1
2987 .Ar criterion2 ,
2988 or both.
2989 To connect more than two criteria using
2990 .Ql or
2991 specifications have to be nested using additional parentheses,
2992 as with
2993 .Ql (or a (or b c)) ,
2994 since
2995 .Ql (or a b c)
2996 really means
2997 .Ql ((a or b) and c) .
2998 For a simple
2999 .Ql or
3000 operation of independent criteria on the lowest nesting level,
3001 it is possible to achieve similar effects by using three separate
3002 criteria, as with
3003 .Ql (a) (b) (c) .
3004 .It Ar ( not criterion )
3005 All messages that do not satisfy
3006 .Ar criterion .
3007 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
3008 All messages that contain
3009 .Ar string
3010 in the envelope representation of the
3011 .Ql Bcc:
3012 field.
3013 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
3014 All messages that contain
3015 .Ar string
3016 in the envelope representation of the
3017 .Ql Cc:
3018 field.
3019 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
3020 All messages that contain
3021 .Ar string
3022 in the envelope representation of the
3023 .Ql From:
3024 field.
3025 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
3026 All messages that contain
3027 .Ar string
3028 in the
3029 .Ql Subject:
3030 field.
3031 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
3032 All messages that contain
3033 .Ar string
3034 in the envelope representation of the
3035 .Ql To:
3036 field.
3037 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
3038 All messages that contain
3039 .Ar string
3040 in the specified
3041 .Ql Name:
3042 field.
3043 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
3044 All messages that contain
3045 .Ar string
3046 in their body.
3047 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
3048 All messages that contain
3049 .Ar string
3050 in their header or body.
3051 .It Ar ( larger size )
3052 All messages that are larger than
3053 .Ar size
3054 (in bytes).
3055 .It Ar ( smaller size )
3056 All messages that are smaller than
3057 .Ar size
3058 (in bytes).
3059 .It Ar ( before date )
3060 All messages that were received before
3061 .Ar date ,
3062 which must be in the form
3063 .Ql d[d]-mon-yyyy ,
3064 where
3065 .Ql d
3066 denotes the day of the month as one or two digits,
3067 .Ql mon
3068 is the name of the month \(en one of
3069 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
3071 .Ql yyyy
3072 is the year as four digits, e.g.,
3073 .Ql 28-Dec-2012 .
3074 .It Ar ( on date )
3075 All messages that were received on the specified date.
3076 .It Ar ( since date )
3077 All messages that were received since the specified date.
3078 .It Ar ( sentbefore date )
3079 All messages that were sent on the specified date.
3080 .It Ar ( senton date )
3081 All messages that were sent on the specified date.
3082 .It Ar ( sentsince date )
3083 All messages that were sent since the specified date.
3084 .It Ar ()
3085 The same criterion as for the previous search.
3086 This specification cannot be used as part of another criterion.
3087 If the previous command line contained more than one independent
3088 criterion then the last of those criteria is used.
3090 .Ss "On terminal control and line editor"
3091 \*(OP Terminal control will be realized through one of the standard
3093 libraries, either the
3094 .Lb libtermcap ,
3095 or, alternatively, the
3096 .Lb libterminfo ,
3097 both of which will be initialized to work with the environment variable
3098 .Ev TERM .
3099 Terminal control will enhance or enable interactive usage aspects, e.g.,
3100 .Sx "Coloured display" ,
3101 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
3102 byte-sequences of keys like the cursor and function keys.
3104 The internal variable
3105 .Va termcap
3106 can be used to overwrite settings or to learn (correct(ed)) keycodes.
3107 \*(UA may also become a fullscreen application by entering the
3108 so-called ca-mode and switching to an alternative exclusive screen
3109 (content) shall the terminal support it and the internal variable
3110 .Va termcap-ca-mode
3111 has been set explicitly.
3112 Actual interaction with the chosen library can be disabled completely by
3113 setting the internal variable
3114 .Va termcap-disable ;
3115 .Va termcap
3116 will be queried regardless, which is true even if the \*(OPal library
3117 support has not been enabled at configuration time as long as some other
3118 \*(OP which (may) query terminal control sequences has been enabled.
3120 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
3121 environments which comply to the ISO C standard
3122 .St -isoC-amd1 ,
3123 and will support wide glyphs if possible (the necessary functionality
3124 had been removed from ISO C, but was included in
3125 .St -xpg4 ) .
3126 Prevent usage of a line editor in interactive mode by setting the
3127 internal variable
3128 .Va line-editor-disable .
3129 Especially if the \*(OPal terminal control support is missing setting
3130 entries in the internal variable
3131 .Va termcap
3132 will help shall the MLE misbehave, see there for more.
3133 The MLE can support a little bit of
3134 .Ic colour .
3136 \*(OP If the
3137 .Ic history
3138 feature is available then input from line editor prompts will be saved
3139 in a history list that can be searched in and be expanded from.
3140 Such saving can be prevented by prefixing input with any amount of
3141 whitespace.
3142 Aspects of history, like allowed content and maximum size, as well as
3143 whether history shall be saved persistently, can be configured with the
3144 internal variables
3145 .Va history-file ,
3146 .Va history-gabby ,
3147 .Va history-gabby-persist
3149 .Va history-size .
3151 The MLE supports a set of editing and control commands.
3152 By default (as) many (as possible) of these will be assigned to a set of
3153 single-letter control codes, which should work on any terminal (and can
3154 be generated by holding the
3155 .Dq control
3156 key while pressing the key of desire, e.g.,
3157 .Ql control-D ) .
3158 If the \*(OPal
3159 .Ic bind
3160 command is available then the MLE commands can also be accessed freely
3161 by assigning the command name, which is shown in parenthesis in the list
3162 below, to any desired key-sequence, and the MLE will instead and also use
3163 .Ic bind
3164 to establish its built-in key bindings
3165 (more of them if the \*(OPal terminal control is available),
3166 an action which can then be suppressed completely by setting
3167 .Va line-editor-no-defaults .
3168 .Sx "Shell-style argument quoting"
3169 notation is used in the following;
3170 combinations not mentioned either cause job control signals or do not
3171 generate a (unique) keycode:
3173 .Bl -tag -compact -width ".It Ql \eBa"
3174 .It Ql \ecA
3175 Go to the start of the line
3177 .Pf ( Cd mle-go-home ) .
3178 .It Ql \ecB
3179 Move the cursor backward one character
3181 .Pf ( Cd mle-go-bwd ) .
3182 .It Ql \ecD
3183 Forward delete the character under the cursor;
3184 quits \*(UA if used on the empty line unless the internal variable
3185 .Va ignoreeof
3186 is set
3188 .Pf ( Cd mle-del-fwd ) .
3189 .It Ql \ecE
3190 Go to the end of the line
3192 .Pf ( Cd mle-go-end ) .
3193 .It Ql \ecF
3194 Move the cursor forward one character
3196 .Pf ( Cd mle-go-fwd ) .
3197 .It Ql \ecG
3198 Cancel current operation, full reset.
3199 If there is an active history search or tabulator expansion then this
3200 command will first reset that, reverting to the former line content;
3201 thus a second reset is needed for a full reset in this case
3203 .Pf ( Cd mle-reset ) .
3204 .It Ql \ecH
3205 Backspace: backward delete one character
3207 .Pf ( Cd mle-del-bwd ) .
3208 .It Ql \ecI
3209 \*(NQ
3210 Horizontal tabulator:
3211 try to expand the word before the cursor, supporting the usual
3212 .Sx "Filename transformations"
3214 .Pf ( Cd mle-complete ;
3215 this is affected by
3216 .Cd mle-quote-rndtrip ) .
3217 .It Ql \ecJ
3218 Newline:
3219 commit the current line
3221 .Pf ( Cd mle-commit ) .
3222 .It Ql \ecK
3223 Cut all characters from the cursor to the end of the line
3225 .Pf ( Cd mle-snarf-end ) .
3226 .It Ql \ecL
3227 Repaint the line
3229 .Pf ( Cd mle-repaint ) .
3230 .It Ql \ecN
3231 \*(OP Go to the next history entry
3233 .Pf ( Cd mle-hist-fwd ) .
3234 .It Ql \ecO
3235 (\*(OPally context-dependent) Invokes the command
3236 .Ic dt .
3237 .It Ql \ecP
3238 \*(OP Go to the previous history entry
3240 .Pf ( Cd mle-hist-bwd ) .
3241 .It Ql \ecQ
3242 Toggle roundtrip mode shell quotes, where produced,
3243 on and off
3245 .Pf ( Cd mle-quote-rndtrip ) .
3246 This setting is temporary, and will be forgotten once the command line
3247 is committed; also see
3248 .Ic shcodec .
3249 .It Ql \ecR
3250 \*(OP Complete the current line from (the remaining) older history entries
3252 .Pf ( Cd mle-hist-srch-bwd ) .
3253 .It Ql \ecS
3254 \*(OP Complete the current line from (the remaining) newer history entries
3256 .Pf ( Cd mle-hist-srch-fwd ) .
3257 .It Ql \ecT
3258 Paste the snarf buffer
3260 .Pf ( Cd mle-paste ) .
3261 .It Ql \ecU
3262 The same as
3263 .Ql \ecA
3264 followed by
3265 .Ql \ecK
3267 .Pf ( Cd mle-snarf-line ) .
3268 .It Ql \ecV
3269 Prompts for a Unicode character (hexadecimal number without prefix, see
3270 .Ic vexpr )
3271 to be inserted
3273 .Pf ( Cd mle-prompt-char ) .
3274 Note this command needs to be assigned to a single-letter control code
3275 in order to become recognized and executed during input of
3276 a key-sequence (only three single-letter control codes can be used for
3277 that shortcut purpose); this control code is special-treated and cannot
3278 be part of any other sequence, because any occurrence will perform the
3279 .Cd mle-prompt-char
3280 function immediately.
3281 .It Ql \ecW
3282 Cut the characters from the one preceding the cursor to the preceding
3283 word boundary
3285 .Pf ( Cd mle-snarf-word-bwd ) .
3286 .It Ql \ecX
3287 Move the cursor forward one word boundary
3289 .Pf ( Cd mle-go-word-fwd ) .
3290 .It Ql \ecY
3291 Move the cursor backward one word boundary
3293 .Pf ( Cd mle-go-word-bwd ) .
3294 .It Ql \ec[
3295 Escape: reset a possibly used multibyte character input state machine
3296 and \*(OPally a lingering, incomplete key binding
3298 .Pf ( Cd mle-cancel ) .
3299 This command needs to be assigned to a single-letter control code in
3300 order to become recognized and executed during input of a key-sequence
3301 (only three single-letter control codes can be used for that shortcut
3302 purpose).
3303 This control code may also be part of a multi-byte sequence, but if
3304 a sequence is active and the very control code is currently also an
3305 expected input, then it will first be consumed by the active sequence.
3306 .It Ql \ec\e
3307 (\*(OPally context-dependent) Invokes the command
3308 .Ql Ic z Ns + .
3309 .It Ql \ec]
3310 (\*(OPally context-dependent) Invokes the command
3311 .Ql Ic z Ns $ .
3312 .It Ql \ec^
3313 (\*(OPally context-dependent) Invokes the command
3314 .Ql Ic z Ns 0 .
3315 .It Ql \ec_
3316 Cut the characters from the one after the cursor to the succeeding word
3317 boundary
3319 .Pf ( Cd mle-snarf-word-fwd ) .
3320 .It Ql \ec?
3321 Backspace:
3322 .Cd mle-del-bwd .
3323 .It \(en
3325 .Cd mle-fullreset :
3326 different to
3327 .Cd mle-reset
3328 this will immediately reset a possibly active search etc.
3329 .It \(en
3331 .Cd mle-bell :
3332 ring the audible bell.
3334 .Ss "Coloured display"
3335 \*(OP \*(UA can be configured to support a coloured display and font
3336 attributes by emitting ANSI a.k.a. ISO 6429 SGR (select graphic
3337 rendition) escape sequences.
3338 Usage of colours and font attributes solely depends upon the
3339 capability of the detected terminal type that is defined by the
3340 environment variable
3341 .Ev TERM
3342 and which can be fine-tuned by the user via the internal variable
3343 .Va termcap .
3345 On top of what \*(UA knows about the terminal the boolean variable
3346 .Va colour-pager
3347 defines whether the actually applicable colour and font attribute
3348 sequences should also be generated when output is going to be paged
3349 through the external program defined by the environment variable
3350 .Ev PAGER
3351 (also see
3352 .Va crt Ns
3354 This is not enabled by default because different pager programs need
3355 different command line switches or other configuration in order to
3356 support those sequences.
3357 \*(UA however knows about some widely used pagers and in a clean
3358 environment it is often enough to simply set
3359 .Va colour-pager ;
3360 please refer to that variable for more on this topic.
3362 If the variable
3363 .Va colour-disable
3364 is set then any active usage of colour and font attribute sequences
3365 is suppressed, but without affecting possibly established
3366 .Ic colour
3367 mappings.
3369 To define and control colours and font attributes a single multiplexer
3370 command family exists:
3371 .Ic colour
3372 shows or defines colour mappings for the given colour type (e.g.,
3373 monochrome) and
3374 .Ic uncolour
3375 can be used to remove mappings of a given colour type.
3376 Since colours are only available in interactive mode, it may make
3377 sense to conditionalize the colour setup by encapsulating it with
3378 .Ic if :
3379 .Bd -literal -offset indent
3380 if terminal && [ "$features" =% +colour ]
3381   colour iso view-msginfo ft=bold,fg=green
3382   colour iso view-header ft=bold,fg=red from,subject
3383   colour iso view-header fg=red
3385   uncolour iso view-header from,subject
3386   colour iso view-header ft=bold,fg=magenta,bg=cyan
3387   colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
3388   colour mono view-header ft=bold
3389   colour mono view-header ft=bold,ft=reverse subject,from
3390 endif
3392 .Ss "Handling spam"
3393 \*(OP \*(UA can make use of several spam interfaces for the purpose of
3394 identification of, and, in general, dealing with spam messages.
3395 A precondition of most commands in order to function is that the
3396 .Va spam-interface
3397 variable is set to one of the supported interfaces.
3398 Once messages have been identified as spam their (volatile)
3399 .Ql is-spam
3400 state can be prompted: the
3401 .Ql Ar :s
3403 .Ql Ar :S
3404 message specifications will address respective messages and their
3405 .Va attrlist
3406 entries will be used when displaying the
3407 .Va headline
3408 in the header display.
3409 .Bl -bullet
3411 .Ic spamrate
3412 rates the given messages and sets their
3413 .Ql is-spam
3414 flag accordingly.
3415 If the spam interface offers spam scores those can also be displayed in
3416 the header display by including the
3417 .Ql %$
3418 format in the
3419 .Va headline
3420 variable.
3422 .Ic spamham ,
3423 .Ic spamspam
3425 .Ic spamforget
3426 will interact with the Bayesian filter of the chosen interface and learn
3427 the given messages as
3428 .Dq ham
3430 .Dq spam ,
3431 respectively; the last command can be used to cause
3432 .Dq unlearning
3433 of messages; it adheres to their current
3434 .Ql is-spam
3435 state and thus reverts previous teachings.
3437 .Ic spamclear
3439 .Ic spamset
3440 will simply set and clear, respectively, the mentioned volatile
3441 .Ql is-spam
3442 message flag, without any interface interaction.
3446 .Xr spamassassin 1
3447 based
3448 .Va spam-interface
3449 .Ql spamc
3450 requires a running instance of the
3451 .Xr spamd 1
3452 server in order to function, started with the option
3453 .Fl -allow-tell
3454 shall Bayesian filter learning be possible.
3455 .Bd -literal -offset indent
3456 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
3457 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
3458     --daemonize [--local] [--allow-tell]
3461 Thereafter \*(UA can make use of these interfaces:
3462 .Bd -literal -offset indent
3463 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3464     -Sspamc-command=/usr/local/bin/spamc \e
3465     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
3467 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3468     -Sspamc-command=/usr/local/bin/spamc \e
3469     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
3472 Using the generic filter approach allows usage of programs like
3473 .Xr bogofilter 1 .
3474 Here is an example, requiring it to be accessible via
3475 .Ev PATH :
3476 .Bd -literal -offset indent
3477 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
3478     -Sspamfilter-ham="bogofilter -n" \e
3479     -Sspamfilter-noham="bogofilter -N" \e
3480     -Sspamfilter-nospam="bogofilter -S" \e
3481     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
3482     -Sspamfilter-spam="bogofilter -s" \e
3483     -Sspamfilter-rate-scanscore="1;^(.+)$"
3486 Because messages must exist on local storage in order to be scored (or
3487 used for Bayesian filter training), it is possibly a good idea to
3488 perform the local spam check last.
3489 Spam can be checked automatically when opening specific folders by
3490 setting a specialized form of the internal variable
3491 .Va folder-hook .
3492 .Bd -literal -offset indent
3493 define spamdelhook {
3494   # Server side DCC
3495   spamset (header x-dcc-brand-metrics "bulk")
3496   # Server-side spamassassin(1)
3497   spamset (header x-spam-flag "YES")
3498   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
3499   move :S +maybe-spam
3500   spamrate :u
3501   del :s
3502   move :S +maybe-spam
3504 set folder-hook-SOMEFOLDER=spamdelhook
3507 See also the documentation for the variables
3508 .Va spam-interface , spam-maxsize ,
3509 .Va spamc-command , spamc-arguments , spamc-user ,
3510 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
3511   spamfilter-rate
3513 .Va spamfilter-rate-scanscore .
3514 .Sh COMMANDS
3515 \*(UA reads input in lines.
3516 An unquoted reverse solidus
3517 .Ql \e
3518 at the end of a command line
3519 .Dq escapes
3520 the newline character: it is discarded and the next line of input is
3521 used as a follow-up line, with all leading whitespace removed;
3522 once an entire line is completed, the whitespace characters
3523 .Cm space , tabulator , newline
3524 as well as those defined by the variable
3525 .Va ifs
3526 are removed from the beginning and end.
3527 Placing any whitespace characters at the beginning of a line will
3528 prevent a possible addition of the command line to the \*(OPal
3529 .Ic history .
3531 The beginning of such input lines is then scanned for the name of
3532 a known command: command names may be abbreviated, in which case the
3533 first command that matches the given prefix will be used.
3534 .Sx "Command modifiers"
3535 may prefix a command in order to modify its behaviour.
3536 A name may also be a
3537 .Ic commandalias ,
3538 which will become expanded until no more expansion is possible.
3539 Once the command that shall be executed is known, the remains of the
3540 input line will be interpreted according to command-specific rules,
3541 documented in the following.
3543 This behaviour is different to the
3544 .Xr sh 1 Ns
3545 ell, which is a programming language with syntactic elements of clearly
3546 defined semantics, and therefore capable to sequentially expand and
3547 evaluate individual elements of a line.
3548 \*(UA will never be able to handle
3549 .Ql ? set one=value two=$one
3550 in a single statement, because the variable assignment is performed by
3551 the command
3552 .Pf ( Ic set ) ,
3553 not the language.
3555 The command
3556 .Ic list
3557 can be used to show the list of all commands, either alphabetically
3558 sorted or in prefix search order (these do not match, also because the
3559 POSIX standard prescribes a set of abbreviations).
3560 \*(OPally the command
3561 .Ic help
3563 .Ic \&? ) ,
3564 when given an argument, will show a documentation string for the
3565 command matching the expanded argument, as in
3566 .Ql ?t ,
3567 which should be a shorthand of
3568 .Ql ?type ;
3569 with these documentation strings both commands support a more
3570 .Va verbose
3571 listing mode which includes the argument type of the command and other
3572 information which applies; a handy suggestion might thus be:
3573 .Bd -literal -offset indent
3574 ? define __xv {
3575   # Before v15: need to enable sh(1)ell-style on _entire_ line!
3576   localopts 1;wysh set verbose;ignerr eval "${@}";return ${?}
3578 ? commandalias xv '\ecall __xv'
3579 ? xv help set
3581 .Ss "Command modifiers"
3582 Commands may be prefixed by one or multiple command modifiers.
3583 Some command modifiers can be used with a restricted set of commands
3584 only, the
3585 .Va verbose
3586 version of
3587 .Ic list
3588 will (\*(OPally) show which modifiers apply.
3589 .Bl -bullet
3591 The modifier reverse solidus
3593 .Cm \e ,
3594 to be placed first, prevents
3595 .Ic commandalias
3596 expansions on the remains of the line, e.g.,
3597 .Ql \eecho
3598 will always evaluate the command
3599 .Ic echo ,
3600 even if an (command)alias of the same name exists.
3601 .Ic commandalias
3602 content may itself contain further command modifiers, including
3603 an initial reverse solidus to prevent further expansions.
3605 The modifier
3607 .Cm ignerr
3608 indicates that any error generated by the following command should be
3609 ignored by the state machine and not cause a program exit with enabled
3610 .Va errexit
3611 or for the standardized exit cases in
3612 .Va posix
3613 mode.
3614 .Va \&? ,
3615 one of the
3616 .Sx "INTERNAL VARIABLES" ,
3617 will be set to the real exit status of the command regardless.
3620 .Cm local
3621 will alter the called command to apply changes only temporarily,
3622 local to block-scope, and can thus only be used inside of a
3623 .Ic define Ns
3624 d macro or an
3625 .Ic account
3626 definition.
3627 Specifying it implies the modifier
3628 .Cm wysh .
3629 Block-scope settings will not be inherited by macros deeper in the
3630 .Ic call
3631 chain, and will be garbage collected once the current block is left.
3632 To record and unroll changes in the global scope use the command
3633 .Ic localopts .
3636 .Cm scope
3637 does yet not implement any functionality.
3640 .Cm u
3641 does yet not implement any functionality.
3643 Some commands support the
3645 .Cm vput
3646 modifier: if used, they expect the name of a variable, which can itself
3647 be a variable, i.e., shell expansion is applied, as their first
3648 argument, and will place their computation result in it instead of the
3649 default location (it is usually written to standard output).
3651 The given name will be tested for being a valid
3652 .Xr sh 1
3653 variable name, and may therefore only consist of upper- and lowercase
3654 characters, digits, and the underscore; the hyphen-minus may be used as
3655 a non-portable extension; digits may not be used as first, hyphen-minus
3656 may not be used as last characters.
3657 In addition the name may either not be one of the known
3658 .Sx "INTERNAL VARIABLES" ,
3659 or must otherwise refer to a writable (non-boolean) value variable.
3660 The actual put operation may fail nonetheless, e.g., if the variable
3661 expects a number argument only a number will be accepted.
3662 Any error during these operations causes the command as such to fail,
3663 and the error number
3664 .Va \&!
3665 will be set to
3666 .Va ^ERR Ns -NOTSUP ,
3667 the exit status
3668 .Va \&?
3669 should be set to
3670 .Ql -1 ,
3671 but some commands deviate from the latter, which is documented.
3673 Last, but not least, the modifier
3675 .Cm wysh
3676 can be used for some old and established commands to choose the new
3677 .Sx "Shell-style argument quoting"
3678 rules over the traditional
3679 .Sx "Old-style argument quoting" .
3681 .Ss "Message list arguments"
3682 Some commands expect arguments that represent messages (actually
3683 their symbolic message numbers), as has been documented above under
3684 .Sx "Specifying messages"
3685 already.
3686 If no explicit message list has been specified, the next message
3687 forward that satisfies the command's requirements will be used,
3688 and if there are no messages forward of the current message,
3689 the search proceeds backwards;
3690 if there are no good messages at all to be found, an error message is
3691 shown and the command is aborted.
3692 .Ss "Old-style argument quoting"
3693 \*(ID This section documents the old, traditional style of quoting
3694 non-message-list arguments to commands which expect this type of
3695 arguments: whereas still used by the majority of such commands, the new
3696 .Sx "Shell-style argument quoting"
3697 may be available even for those via
3698 .Cm wysh ,
3699 one of the
3700 .Sx "Command modifiers" .
3701 Nonetheless care must be taken, because only new commands have been
3702 designed with all the capabilities of the new quoting rules in mind,
3703 which can, e.g., generate control characters.
3704 .Bl -bullet -offset indent
3706 An argument can be enclosed between paired double-quotes
3707 .Ql """argument"""
3709 single-quotes
3710 .Ql 'argument' ;
3711 any whitespace, shell word expansion, or reverse solidus characters
3712 (except as described next) within the quotes are treated literally as
3713 part of the argument.
3714 A double-quote will be treated literally within single-quotes and vice
3715 versa.
3716 Inside such a quoted string the actually used quote character can be
3717 used nonetheless by escaping it with a reverse solidus
3718 .Ql \e ,
3719 as in
3720 .Ql """y\e""ou""" .
3722 An argument that is not enclosed in quotes, as above, can usually still
3723 contain space characters if those spaces are reverse solidus escaped, as in
3724 .Ql you\e are .
3726 A reverse solidus outside of the enclosing quotes is discarded
3727 and the following character is treated literally as part of the argument.
3729 .Ss "Shell-style argument quoting"
3730 Commands which don't expect message-list arguments use
3731 .Xr sh 1 Ns
3732 ell-style, and therefore POSIX standardized, argument parsing and
3733 quoting rules.
3734 \*(ID Most new commands only support these new rules and are flagged
3735 \*(NQ, some elder ones can use them with the command modifier
3736 .Cm wysh ;
3737 in the future only this type of argument quoting will remain.
3739 A command line is parsed from left to right and an input token is
3740 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3741 Metacharacters are vertical bar
3742 .Cm \&| ,
3743 ampersand
3744 .Cm & ,
3745 semicolon
3746 .Cm \&; ,
3747 as well as all characters from the variable
3748 .Va ifs ,
3749 and / or
3750 .Cm space , tabulator , newline .
3751 The additional metacharacters left and right parenthesis
3752 .Cm \&( , \&)
3753 and less-than and greater-than signs
3754 .Cm < , >
3755 that the
3756 .Xr sh 1
3757 supports are not used, and are treated as ordinary characters: for one
3758 these characters are a vivid part of email addresses, and it seems
3759 highly unlikely that their function will become meaningful to \*(UA.
3760 .Bd -filled -offset indent
3761 .Sy Compatibility note:
3762 \*(ID Please note that even many new-style commands do not yet honour
3763 .Va ifs
3764 to parse their arguments: whereas the
3765 .Xr sh 1 Ns
3766 ell is a language with syntactic elements of clearly defined semantics,
3767 \*(UA parses entire input lines and decides on a per-command base what
3768 to do with the rest of the line.
3769 This also means that whenever an unknown command is seen all that \*(UA
3770 can do is cancellation of the processing of the remains of the line.
3772 It also often depends on an actual subcommand of a multiplexer command
3773 how the rest of the line should be treated, and until v15 we are not
3774 capable to perform this deep inspection of arguments.
3775 Nonetheless, at least the following commands which work with positional
3776 parameters fully support
3777 .Va ifs
3778 for an almost shell-compatible field splitting:
3779 .Ic call , call_if , read , vpospar , xcall .
3782 Any unquoted number sign
3783 .Ql #
3784 at the beginning of a new token starts a comment that extends to the end
3785 of the line, and therefore ends argument processing.
3786 An unquoted dollar sign
3787 .Ql $
3788 will cause variable expansion of the given name, which must be a valid
3789 .Xr sh 1 Ns
3790 ell-style variable name (see
3791 .Cm vput ) :
3792 .Sx "INTERNAL VARIABLES"
3793 as well as
3794 .Sx ENVIRONMENT
3795 (shell) variables can be accessed through this mechanism, brace
3796 enclosing the name is supported (i.e., to subdivide a token).
3798 Whereas the metacharacters
3799 .Cm space , tabulator , newline
3800 only complete an input token, vertical bar
3801 .Cm \&| ,
3802 ampersand
3803 .Cm &
3804 and semicolon
3805 .Cm \&;
3806 also act as control operators and perform control functions.
3807 For now supported is semicolon
3808 .Cm \&; ,
3809 which terminates a single command, therefore sequencing the command line
3810 and making the remainder of the line a subject to reevaluation.
3811 With sequencing, multiple command argument types and quoting rules may
3812 therefore apply to a single line, which can become problematic before
3813 v15: e.g., the first of the following will cause surprising results.
3815 .Dl ? echo one; set verbose; echo verbose=$verbose.
3816 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
3818 Quoting is a mechanism that will remove the special meaning of
3819 metacharacters and reserved words, and will prevent expansion.
3820 There are four quoting mechanisms: the escape character, single-quotes,
3821 double-quotes and dollar-single-quotes:
3822 .Bl -bullet -offset indent
3824 The literal value of any character can be preserved by preceding it
3825 with the escape character reverse solidus
3826 .Ql \e .
3828 Arguments which are enclosed in
3829 .Ql 'single-\:quotes'
3830 retain their literal value.
3831 A single-quote cannot occur within single-quotes.
3833 The literal value of all characters enclosed in
3834 .Ql \(dqdouble-\:quotes\(dq
3835 is retained, with the exception of dollar sign
3836 .Ql $ ,
3837 which will cause variable expansion, as above, backquote (grave accent)
3838 .Ql ` ,
3839 (which not yet means anything special), reverse solidus
3840 .Ql \e ,
3841 which will escape any of the characters dollar sign
3842 .Ql $
3843 (to prevent variable expansion), backquote (grave accent)
3844 .Ql ` ,
3845 double-quote
3846 .Ql \(dq
3847 (to prevent ending the quote) and reverse solidus
3848 .Ql \e
3849 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3850 but has no special meaning otherwise.
3852 Arguments enclosed in
3853 .Ql $'dollar-\:single-\:quotes'
3854 extend normal single quotes in that reverse solidus escape sequences are
3855 expanded as follows:
3857 .Bl -tag -compact -width ".Ql \eNNN"
3858 .It Ql \ea
3859 bell control character (ASCII and ISO-10646 BEL).
3860 .It Ql \eb
3861 backspace control character (ASCII and ISO-10646 BS).
3862 .It Ql \eE
3863 escape control character (ASCII and ISO-10646 ESC).
3864 .It Ql \ee
3865 the same.
3866 .It Ql \ef
3867 form feed control character (ASCII and ISO-10646 FF).
3868 .It Ql \en
3869 line feed control character (ASCII and ISO-10646 LF).
3870 .It Ql \er
3871 carriage return control character (ASCII and ISO-10646 CR).
3872 .It Ql \et
3873 horizontal tabulator control character (ASCII and ISO-10646 HT).
3874 .It Ql \ev
3875 vertical tabulator control character (ASCII and ISO-10646 VT).
3876 .It Ql \e\e
3877 emits a reverse solidus character.
3878 .It Ql \e'
3879 single quote.
3880 .It Ql \e"
3881 double quote (escaping is optional).
3882 .It Ql \eNNN
3883 eight-bit byte with the octal value
3884 .Ql NNN
3885 (one to three octal digits), optionally prefixed by an additional
3886 .Ql 0 .
3887 A 0 byte will suppress further output for the quoted argument.
3888 .It Ql \exHH
3889 eight-bit byte with the hexadecimal value
3890 .Ql HH
3891 (one or two hexadecimal characters, no prefix, see
3892 .Ic vexpr ) .
3893 A 0 byte will suppress further output for the quoted argument.
3894 .It Ql \eUHHHHHHHH
3895 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3896 .Ql HHHHHHHH
3897 (one to eight hexadecimal characters) \(em note that Unicode defines the
3898 maximum codepoint ever to be supported as
3899 .Ql 0x10FFFF
3900 (in planes of
3901 .Ql 0xFFFF
3902 characters each).
3903 This escape is only supported in locales that support Unicode (see
3904 .Sx "Character sets" ) ,
3905 in other cases the sequence will remain unexpanded unless the given code
3906 point is ASCII compatible or (if the \*(OPal character set conversion is
3907 available) can be represented in the current locale.
3908 The character NUL will suppress further output for the quoted argument.
3909 .It Ql \euHHHH
3910 Identical to
3911 .Ql \eUHHHHHHHH
3912 except it takes only one to four hexadecimal characters.
3913 .It Ql \ecX
3914 Emits the non-printable (ASCII and compatible) C0 control codes
3915 0 (NUL) to 31 (US), and 127 (DEL).
3916 Printable representations of ASCII control codes can be created by
3917 mapping them to a different part of the ASCII character set, which is
3918 possible by adding the number 64 for the codes 0 to 31, e.g., 7 (BEL) is
3919 .Ql 7 + 64 = 71 = G .
3920 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3921 .Ic vexpr ) ,
3922 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3923 .Ql ? vexpr ^ 127 64 .
3925 Whereas historically circumflex notation has often been used for
3926 visualization purposes of control codes, e.g.,
3927 .Ql ^G ,
3928 the reverse solidus notation has been standardized:
3929 .Ql \ecG .
3930 Some control codes also have standardized (ISO-10646, ISO C) aliases,
3931 as shown above (e.g.,
3932 .Ql \ea ,
3933 .Ql \en ,
3934 .Ql \et ) :
3935 whenever such an alias exists it will be used for display purposes.
3936 The control code NUL
3937 .Pf ( Ql \ec@ ,
3938 a non-standard extension) will suppress further output for the remains
3939 of the token (which may extend beyond the current quote), or, depending
3940 on the context, the remains of all arguments for the current command.
3941 .It Ql \e$NAME
3942 Non-standard extension: expand the given variable name, as above.
3943 Brace enclosing the name is supported.
3944 .It Ql \e`{command}
3945 Not yet supported, just to raise awareness: Non-standard extension.
3949 Caveats:
3950 .Bd -literal -offset indent
3951 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3952 ? echo Quotes ${HOME} and tokens differ! # comment
3953 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3955 .Ss "Raw data arguments for codec commands"
3956 A special set of commands, which all have the string
3957 .Dq codec
3958 in their name, e.g.,
3959 .Ic addrcodec ,
3960 .Ic shcodec ,
3961 .Ic urlcodec ,
3962 take raw string data as input, which means that the content of the
3963 command input line is passed completely unexpanded and otherwise
3964 unchanged: like this the effect of the actual codec is visible without
3965 any noise of possible shell quoting rules etc., i.e., the user can input
3966 one-to-one the desired or questionable data.
3967 To gain a level of expansion, the entire command line can be
3968 .Ic eval Ns
3969 uated first, e.g.,
3970 .Bd -literal -offset indent
3971 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
3972 ? echo $res
3973 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3974 ? shcodec d $res
3975 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3976 ? eval shcodec d $res
3977 /usr/Sch\[:o]nes Wetter/heute.txt
3979 .Ss "Filename transformations"
3980 Filenames, where expected, and unless documented otherwise, are
3981 subsequently subject to the following filename transformations, in
3982 sequence:
3983 .Bl -bullet -offset indent
3985 If the given name is a registered
3986 .Ic shortcut ,
3987 it will be replaced with the expanded shortcut.
3989 The filename is matched against the following patterns or strings:
3991 .Bl -hang -compact -width ".Ar %user"
3992 .It Ar #
3993 (Number sign) is expanded to the previous file.
3994 .It Ar %
3995 (Percent sign) is replaced by the invoking
3996 .Mx -ix "primary system mailbox"
3997 user's primary system mailbox, which either is the (itself expandable)
3998 .Va inbox
3999 if that is set, the standardized absolute pathname indicated by
4000 .Ev MAIL
4001 if that is set, or a built-in compile-time default otherwise.
4002 .It Ar %user
4003 Expands to the primary system mailbox of
4004 .Ar user
4005 (and never the value of
4006 .Va inbox ,
4007 regardless of its actual setting).
4008 .It Ar &
4009 (Ampersand) is replaced with the invoking users
4010 .Mx -ix "secondary mailbox"
4011 secondary mailbox, the
4012 .Ev MBOX .
4013 .It Ar +file
4014 Refers to a
4015 .Ar file
4016 in the
4017 .Va folder
4018 directory (if that variable is set).
4019 .It Ar %:filespec
4020 Expands to the same value as
4021 .Ar filespec ,
4022 but has special meaning when used with, e.g., the command
4023 .Ic file :
4024 the file will be treated as a primary system mailbox by, e.g., the
4025 .Ic mbox
4027 .Ic save
4028 commands, meaning that messages that have been read in the current
4029 session will be moved to the
4030 .Ev MBOX
4031 mailbox instead of simply being flagged as read.
4034 Meta expansions may be applied to the resulting filename, as allowed by
4035 the operation and applicable to the resulting access protocol (also see
4036 .Sx "On URL syntax and credential lookup" ) .
4037 For the file-protocol, a leading tilde
4038 .Ql ~
4039 character will be replaced by the expansion of
4040 .Ev HOME ,
4041 except when followed by a valid user name, in which case the home
4042 directory of the given user is used instead.
4044 A shell expansion as if specified in double-quotes (see
4045 .Sx "Shell-style argument quoting" )
4046 may be applied, so that any occurrence of
4047 .Ql $VARIABLE
4049 .Ql ${VARIABLE} )
4050 will be replaced by the expansion of the variable, if possible;
4051 .Sx "INTERNAL VARIABLES"
4052 as well as
4053 .Sx ENVIRONMENT
4054 (shell) variables can be accessed through this mechanism.
4056 Shell pathname wildcard pattern expansions
4057 .Pf ( Xr glob 7 )
4058 may be applied as documented.
4059 If the fully expanded filename results in multiple pathnames and the
4060 command is expecting only one file, an error results.
4062 In interactive context, in order to allow simple value acceptance (via
4063 .Dq ENTER ) ,
4064 arguments will usually be displayed in a properly quoted form, e.g., a file
4065 .Ql diet\e is \ecurd.txt
4066 may be displayed as
4067 .Ql 'diet\e is \ecurd.txt' .
4069 .Ss "Commands"
4070 The following commands are available:
4071 .Bl -tag -width ".It Ic BaNg"
4073 .It Ic \&!
4074 Executes the
4075 .Ev SHELL
4076 command which follows, replacing unescaped exclamation marks with the
4077 previously executed command if the internal variable
4078 .Va bang
4079 is set.
4080 This command supports
4081 .Cm vput
4082 as documented in
4083 .Sx "Command modifiers" ,
4084 and manages the error number
4085 .Va \&! .
4086 A 0 or positive exit status
4087 .Va \&?
4088 reflects the exit status of the command, negative ones that
4089 an error happened before the command was executed, or that the program
4090 did not exit cleanly, but, e.g., due to a signal: the error number is
4091 .Va ^ERR Ns -CHILD ,
4092 then.
4094 In conjunction with the
4095 .Cm vput
4096 modifier the following special cases exist:
4097 a negative exit status occurs if the collected data could not be stored
4098 in the given variable, which is a
4099 .Va ^ERR Ns -NOTSUP
4100 error that should otherwise not occur.
4101 .Va ^ERR Ns -CANCELED
4102 indicates that no temporary file could be created to collect the command
4103 output at first glance.
4104 In case of catchable out-of-memory situations
4105 .Va ^ERR Ns -NOMEM
4106 will occur and \*(UA will try to store the empty string, just like with
4107 all other detected error conditions.
4109 .It Ic #
4110 The comment-command causes the entire line to be ignored.
4111 .Sy Note:
4112 this really is a normal command which' purpose is to discard its
4113 arguments, not a
4114 .Dq comment-start
4115 indicating special character, which means that, e.g., trailing comments
4116 on a line are not possible.
4118 .It Ic +
4119 Goes to the next message in sequence and types it
4120 (like
4121 .Dq ENTER ) .
4123 .It Ic -
4124 Display the preceding message, or the n'th previous message if given
4125 a numeric argument n.
4127 .It Ic =
4128 Show the current message number (the
4129 .Dq dot ) .
4131 .It Ic \&?
4132 Show a brief summary of commands.
4133 \*(OP Given an argument a synopsis for the command in question is
4134 shown instead; commands can be abbreviated in general and this command
4135 can be used to see the full expansion of an abbreviation including the
4136 synopsis, try, e.g.,
4137 .Ql ?h ,
4138 .Ql ?hel
4140 .Ql ?help
4141 and see how the output changes.
4142 This mode also supports a more
4143 .Va verbose
4144 output, which will provide the information documented for
4145 .Ic list .
4147 .It Ic \&|
4148 A synonym for the
4149 .Ic pipe
4150 command.
4153 .It Ic account , unaccount
4154 (ac, una) Creates, selects or lists (an) account(s).
4155 Accounts are special incarnations of
4156 .Ic define Ns d
4157 macros and group commands and variable settings which together usually
4158 arrange the environment for the purpose of creating an email account.
4159 Different to normal macros settings which are covered by
4160 .Ic localopts
4161 \(en here by default enabled! \(en will not be reverted before the
4162 .Ic account
4163 is changed again.
4164 The special account
4165 .Ql null
4166 (case-insensitive) always exists, and all but it can be deleted by the
4167 latter command, and in one operation with the special name
4168 .Ql * .
4169 Also for all but it a possibly set
4170 .Va on-account-cleanup
4171 hook is called once they are left.
4173 Without arguments a listing of all defined accounts is shown.
4174 With one argument the given account is activated: the system
4175 .Va inbox
4176 of that account will be activated (as via
4177 .Ic file ) ,
4178 a possibly installed
4179 .Va folder-hook
4180 will be run, and the internal variable
4181 .Va account
4182 will be updated.
4183 The two argument form is identical to defining a macro as via
4184 .Ic define :
4185 .Bd -literal -offset indent
4186 account myisp {
4187   set folder=~/mail inbox=+syste.mbox record=+sent.mbox
4188   set from='(My Name) myname@myisp.example'
4189   set mta=smtp://mylogin@smtp.myisp.example
4193 .It Ic addrcodec
4194 Perform email address codec transformations on raw-data argument, rather
4195 according to email standards (RFC 5322; \*(ID will furtherly improve).
4196 Supports
4197 .Cm vput
4198 (see
4199 .Sx "Command modifiers" ) ,
4200 and manages the error number
4201 .Va \&! .
4202 The first argument must be either
4203 .Ar [+[+[+]]]e[ncode] ,
4204 .Ar d[ecode] ,
4205 .Ar s[kin]
4207 .Ar skinl[ist]
4208 and specifies the operation to perform on the rest of the line.
4210 Decoding will show how a standard-compliant MUA will display the given
4211 argument, which should be an email address.
4212 Please be aware that most MUAs have difficulties with the address
4213 standards, and vary wildly when (comments) in parenthesis,
4214 .Dq double-quoted
4215 strings, or quoted-pairs, as below, become involved.
4216 \*(ID \*(UA currently does not perform decoding when displaying addresses.
4218 Skinning is identical to decoding but only outputs the plain address,
4219 without any string, comment etc. components.
4220 Another difference is that it may fail with the error number
4221 .Va \&!
4222 set to
4223 .Va ^ERR Ns -INVAL
4224 if decoding fails to find a(n) (valid) email address, in which case the
4225 unmodified input will be output again.
4227 .Ar skinlist
4228 first performs a skin operation, and thereafter checks a valid
4229 address for whether it is a registered mailing-list (see
4230 .Ic mlist
4232 .Ic mlsubscribe ) ,
4233 eventually reporting that state in the error number
4234 .Va \&!
4236 .Va ^ERR Ns -EXIST .
4237 (This state could later become overwritten by an I/O error, though.)
4239 Encoding supports four different modes, lesser automated versions can be
4240 chosen by prefixing one, two or three plus signs: the standard imposes
4241 a special meaning on some characters, which thus have to be transformed
4242 to so-called quoted-pairs by pairing them with a reverse solidus
4243 .Ql \e
4244 in order to remove the special meaning; this might change interpretation
4245 of the entire argument from what has been desired, however!
4246 Specify one plus sign to remark that parenthesis shall be left alone,
4247 two for not turning double quotation marks into quoted-pairs, and three
4248 for also leaving any user-specified reverse solidus alone.
4249 The result will always be valid, if a successful exit status is reported
4250 (\*(ID the current parser fails this assertion for some constructs).
4251 \*(ID Addresses need to be specified in between angle brackets
4252 .Ql < ,
4253 .Ql >
4254 if the construct becomes more difficult, otherwise the current parser
4255 will fail; it is not smart enough to guess right.
4256 .Bd -literal -offset indent
4257 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
4258 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4259 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4260 "Hey, you", \e out\e there <diet@exam.ple>
4261 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4262 diet@exam.ple
4266 .It Ic alias , unalias
4267 (a, una) Aliases are a method of creating personal distribution lists
4268 that map a single alias name to none to multiple real receivers;
4269 these aliases become expanded after message composing is completed.
4270 The latter command removes the given list of aliases, the special name
4271 .Ql *
4272 will discard all existing aliases.
4274 The former command shows all currently defined aliases when used without
4275 arguments, and with one argument the expansion of the given alias.
4276 With more than one argument, creates or appends to the alias name given
4277 as the first argument the remaining arguments.
4278 Alias names adhere to the Postfix MTA
4279 .Xr aliases 5
4280 rules and are thus restricted to alphabetic characters, digits, the
4281 underscore, hyphen-minus, the number sign, colon and commercial at,
4282 the last character can also be the dollar sign; the regular expression:
4283 .Ql [[:alnum:]_#:@-]+$? .
4284 \*(ID Unfortunately the colon is currently not supported, as it
4285 interferes with normal address parsing rules.
4286 As extensions the exclamation mark
4287 .Ql \&! ,
4288 period
4289 .Ql \&.
4290 as well as
4291 .Dq any character that has the high bit set
4292 may be used.
4293 \*(ID Such high bit characters will likely cause warnings at the moment
4294 for the same reasons why colon is unsupported.
4297 .It Ic alternates , unalternates
4298 \*(NQ (alt) Manage a list of alternate addresses or names of the active user,
4299 members of which will be removed from recipient lists.
4300 The latter command removes the given list of alternates, the special name
4301 .Ql *
4302 will discard all existing aliases.
4303 The former command manages the error number
4304 .Va \&!
4305 and shows the current set of alternates when used without arguments; in
4306 this mode it supports
4307 .Cm vput
4308 (see
4309 .Sx "Command modifiers" ) .
4310 Otherwise the given arguments (after being checked for validity) are
4311 appended to the list of alternate names; in
4312 .Va posix
4313 mode they replace that list instead.
4314 There is a set of implicit alternates which is formed of the values of
4315 .Ev LOGNAME ,
4316 .Va from ,
4317 .Va sender
4319 .Va reply-to .
4322 .It Ic answered , unanswered
4323 Take a message lists and mark each message as having been answered,
4324 having not been answered, respectively.
4325 Messages will be marked answered when being
4326 .Ic reply Ns d
4327 to automatically if the
4328 .Va markanswered
4329 variable is set.
4330 See the section
4331 .Sx "Message states" .
4334 .It Ic bind , unbind
4335 \*(OP\*(NQ The bind command extends the MLE (see
4336 .Sx "On terminal control and line editor" )
4337 with freely configurable key bindings.
4338 The latter command removes from the given context the given key binding,
4339 both of which may be specified as a wildcard
4340 .Ql * ,
4341 so that, e.g.,
4342 .Ql unbind * *
4343 will remove all bindings of all contexts.
4344 Due to initialization order unbinding will not work for built-in key
4345 bindings upon program startup, however: please use
4346 .Va line-editor-no-defaults
4347 for this purpose instead.
4349 With one argument the former command shows all key bindings for the
4350 given context, specifying an asterisk
4351 .Ql *
4352 will show the bindings of all contexts; a more verbose listing will be
4353 produced if either of
4354 .Va debug
4356 .Va verbose
4357 are set.
4358 With two or more arguments a binding is (re)established:
4359 the first argument is the context to which the binding shall apply,
4360 the second argument is a comma-separated list of the
4361 .Dq keys
4362 which form the binding, and any remaining arguments form the expansion.
4363 To indicate that a binding shall not be auto-committed, but that the
4364 expansion shall instead be furtherly editable by the user, a commercial at
4365 .Ql @
4366 (that will be removed) can be placed last in the expansion, from which
4367 leading and trailing whitespace will finally be removed.
4368 Reverse solidus cannot be used as the last character of expansion.
4370 Contexts define when a binding applies, i.e., a binding will not be seen
4371 unless the context for which it is defined for is currently active.
4372 This is not true for the shared binding
4373 .Ql base ,
4374 which is the foundation for all other bindings and as such always
4375 applies, its bindings, however, only apply secondarily.
4376 The available contexts are the shared
4377 .Ql base ,
4379 .Ql default
4380 context which is used in all not otherwise documented situations, and
4381 .Ql compose ,
4382 which applies to compose mode only.
4384 .Dq Keys
4385 which form the binding are specified as a comma-separated list of
4386 byte-sequences, where each list entry corresponds to one key(press).
4387 A list entry may, indicated by a leading colon character
4388 .Ql \&: ,
4389 also refer to the name of a terminal capability; several dozen names
4390 will be compiled in and may be specified either by their
4391 .Xr terminfo 5 ,
4392 or, if existing, by their
4393 .Xr termcap 5
4394 name, regardless of the actually used \*(OPal terminal control library.
4395 It is possible to use any capability, as long as the name is resolvable
4396 by the \*(OPal control library or was defined via the internal variable
4397 .Va termcap .
4398 Input sequences are not case-normalized, so that an exact match is
4399 required to update or remove a binding.
4400 Examples:
4401 .Bd -literal -offset indent
4402 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
4403 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc, Delete
4404 ? bind default $'\ecA',:khome,w 'echo An editable binding@'
4405 ? bind default a,b,c rm -irf / @  # Another editable binding
4406 ? bind default :kf1 File %
4407 ? bind compose :kf1 ~e
4410 Note that the entire comma-separated list is first parsed (over) as a
4411 shell-token with whitespace as the field separator, before being parsed
4412 and expanded for real with comma as the field separator, therefore
4413 whitespace needs to be properly quoted, see
4414 .Sx "Shell-style argument quoting" .
4415 Using Unicode reverse solidus escape sequences renders a binding
4416 defunctional if the locale does not support Unicode (see
4417 .Sx "Character sets" ) ,
4418 and using terminal capabilities does so if no (corresponding) terminal
4419 control support is (currently) available.
4421 The following terminal capability names are built-in and can be used in
4422 .Xr terminfo 5
4423 or (if available) the two-letter
4424 .Xr termcap 5
4425 notation.
4426 See the respective manual for a list of capabilities.
4427 The program
4428 .Xr infocmp 1
4429 can be used to show all the capabilities of
4430 .Ev TERM
4431 or the given terminal type;
4432 using the
4433 .Fl \&\&x
4434 flag will also show supported (non-standard) extensions.
4436 .Bl -tag -compact -width kcuuf_or_kcuuf
4437 .It Cd kbs Ns \0or Cd kb
4438 Backspace.
4439 .It Cd kdch1 Ns \0or Cd kD
4440 Delete character.
4441 .It Cd kDC Ns \0or Cd *4
4442 \(em shifted variant.
4443 .It Cd kel Ns \0or Cd kE
4444 Clear to end of line.
4445 .It Cd kext Ns \0or Cd @9
4446 Exit.
4447 .It Cd kich1 Ns \0or Cd kI
4448 Insert character.
4449 .It Cd kIC Ns \0or Cd #3
4450 \(em shifted variant.
4451 .It Cd khome Ns \0or Cd kh
4452 Home.
4453 .It Cd kHOM Ns \0or Cd #2
4454 \(em shifted variant.
4455 .It Cd kend Ns \0or Cd @7
4456 End.
4457 .It Cd knp Ns \0or Cd kN
4458 Next page.
4459 .It Cd kpp Ns \0or Cd kP
4460 Previous page.
4461 .It Cd kcub1 Ns \0or Cd kl
4462 Left cursor (with more modifiers: see below).
4463 .It Cd kLFT Ns \0or Cd #4
4464 \(em shifted variant.
4465 .It Cd kcuf1 Ns \0or Cd kr
4466 Right cursor (ditto).
4467 .It Cd kRIT Ns \0or Cd %i
4468 \(em shifted variant.
4469 .It Cd kcud1 Ns \0or Cd kd
4470 Down cursor (ditto).
4471 .It Cd kDN
4472 \(em shifted variant (only terminfo).
4473 .It Cd kcuu1 Ns \0or Cd ku
4474 Up cursor (ditto).
4475 .It Cd kUP
4476 \(em shifted variant (only terminfo).
4477 .It Cd kf0 Ns \0or Cd k0
4478 Function key 0.
4479 Add one for each function key up to
4480 .Cd kf9
4482 .Cd k9 ,
4483 respectively.
4484 .It Cd kf10 Ns \0or Cd k;
4485 Function key 10.
4486 .It Cd kf11 Ns \0or Cd F1
4487 Function key 11.
4488 Add one for each function key up to
4489 .Cd kf19
4491 .Cd F9 ,
4492 respectively.
4495 Some terminals support key-modifier combination extensions, e.g.,
4496 .Ql Alt+Shift+xy .
4497 For example, the delete key,
4498 .Cd kdch1 :
4499 in its shifted variant, the name is mutated to
4500 .Cd  kDC ,
4501 then a number is appended for the states
4502 .Ql Alt
4503 .Pf ( Cd kDC3 ) ,
4504 .Ql Shift+Alt
4505 .Pf ( Cd kDC4 ) ,
4506 .Ql Control
4507 .Pf ( Cd kDC5 ) ,
4508 .Ql Shift+Control
4509 .Pf ( Cd kDC6 ) ,
4510 .Ql Alt+Control
4511 .Pf ( Cd kDC7 ) ,
4512 finally
4513 .Ql Shift+Alt+Control
4514 .Pf ( Cd kDC8 ) .
4515 The same for the left cursor key,
4516 .Cd kcub1 :
4517 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
4519 It is advisable to use an initial escape or other control character (e.g.,
4520 .Ql \ecA )
4521 for bindings which describe user key combinations (as opposed to purely
4522 terminal capability based ones), in order to avoid ambiguities whether
4523 input belongs to key sequences or not; it also reduces search time.
4524 Adjusting
4525 .Va bind-timeout
4526 may help shall keys and sequences be falsely recognized.
4528 .It Ic call
4529 \*(NQ Calls the given macro, which must have been created via
4530 .Ic define ,
4531 otherwise an
4532 .Va ^ERR Ns -NOENT
4533 error occurs.
4534 Calling macros recursively will at some time excess the stack size
4535 limit, causing a hard program abortion; if recursively calling a macro
4536 is the last command of the current macro, consider to use the command
4537 .Ic xcall ,
4538 which will first release all resources of the current macro before
4539 replacing the current macro with the called one.
4540 Numeric and string operations can be performed via
4541 .Ic vexpr ,
4543 .Ic eval
4544 may be helpful to recreate argument lists.
4546 .It Ic call_if
4547 Identical to
4548 .Ic call
4549 if the given macro has been created via
4550 .Ic define ,
4551 but doesn't fail nor warn if the macro doesn't exist.
4553 .It Ic cd
4554 (ch) Change the working directory to
4555 .Ev HOME
4556 or the given argument.
4557 Synonym for
4558 .Ic chdir .
4560 .It Ic certsave
4561 \*(OP Only applicable to S/MIME signed messages.
4562 Takes a message list and a filename and saves the certificates
4563 contained within the message signatures to the named file in both
4564 human-readable and PEM format.
4565 The certificates can later be used to send encrypted messages to the
4566 respective message senders by setting
4567 .Va smime-encrypt-USER@HOST
4568 variables.
4571 .It Ic charsetalias , uncharsetalias
4572 \*(NQ Manage (character set conversion) character set alias mappings,
4573 as documented in the section
4574 .Sx "Character sets" .
4575 Character set aliases are expanded recursively, but no expansion is
4576 performed on values of the user-settable variables, e.g.,
4577 .Va charset-8bit .
4578 These are effectively no-operations if character set conversion
4579 is not available (i.e., no
4580 .Ql +iconv
4582 .Va features ) .
4583 Without arguments the list of all currently defined aliases is shown,
4584 with one argument the expansion of the given alias.
4585 Otherwise all given arguments are treated as pairs of character sets and
4586 their desired target alias name, creating new or changing already
4587 existing aliases, as necessary.
4589 The latter deletes all aliases given as arguments, the special argument
4590 .Ql *
4591 will remove all aliases.
4593 .It Ic chdir
4594 (ch) Change the working directory to
4595 .Ev HOME
4596 or the given argument.
4597 Synonym for
4598 .Ic cd .
4601 .It Ic collapse , uncollapse
4602 Only applicable to threaded mode.
4603 Takes a message list and makes all replies to these messages invisible
4604 in header summaries, except for
4605 .Ql new
4606 messages and the
4607 .Dq dot .
4608 Also when a message with collapsed replies is displayed,
4609 all of these are automatically uncollapsed.
4610 The latter command undoes collapsing.
4613 .It Ic colour , uncolour
4614 \*(OP\*(NQ Manage colour mappings of and for a
4615 .Sx "Coloured display" .
4616 The type of colour is given as the (case-insensitive) first argument,
4617 which must be one of
4618 .Ql 256
4619 for 256-colour terminals,
4620 .Ql 8 ,
4621 .Ql ansi
4623 .Ql iso
4624 for the standard 8-colour ANSI / ISO 6429 color palette and
4625 .Ql 1
4627 .Ql mono
4628 for monochrome terminals.
4629 Monochrome terminals cannot deal with colours, but only (some) font
4630 attributes.
4632 Without further arguments the list of all currently defined mappings
4633 for the given colour type is shown (as a special case giving
4634 .Ql all
4636 .Ql *
4637 will show the mappings of all types).
4638 Otherwise the second argument defines the mappable slot, and the third
4639 argument a (comma-separated list of) colour and font attribute
4640 specification(s), and the optional fourth argument can be used to
4641 specify a precondition: if conditioned mappings exist they are tested in
4642 (creation) order unless a (case-insensitive) match has been found, and
4643 the default mapping (if any has been established) will only be chosen as
4644 a last resort.
4645 The types of precondition available depend on the mappable slot (see
4646 .Sx "Coloured display"
4647 for some examples), the following of which exist:
4649 Mappings prefixed with
4650 .Ql mle-
4651 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
4652 .Sx "On terminal control and line editor" )
4653 and do not support preconditions.
4655 .Bl -tag -compact -width view-partinfo
4656 .It Ar mle-position
4657 This mapping is used for the position indicator that is visible when
4658 a line cannot be fully displayed on the screen.
4659 .It Ar mle-prompt
4660 Used for the
4661 .Va prompt .
4664 Mappings prefixed with
4665 .Ql sum-
4666 are used in header summaries, and they all understand the preconditions
4667 .Ql dot
4668 (the current message) and
4669 .Ql older
4670 for elder messages (only honoured in conjunction with
4671 .Va datefield-markout-older ) .
4673 .Bl -tag -compact -width view-partinfo
4674 .It Ar sum-dotmark
4675 This mapping is used for the
4676 .Dq dotmark
4677 that can be created with the
4678 .Ql %>
4680 .Ql %<
4681 formats of the variable
4682 .Va headline .
4683 .It Ar sum-header
4684 For the complete header summary line except the
4685 .Dq dotmark
4686 and the thread structure.
4687 .It Ar sum-thread
4688 For the thread structure which can be created with the
4689 .Ql %i
4690 format of the variable
4691 .Va headline .
4694 Mappings prefixed with
4695 .Ql view-
4696 are used when displaying messages.
4698 .Bl -tag -compact -width view-partinfo
4699 .It Ar view-from_
4700 This mapping is used for so-called
4701 .Ql From_
4702 lines, which are MBOX file format specific header lines.
4703 .It Ar view-header
4704 For header lines.
4705 A comma-separated list of headers to which the mapping applies may be
4706 given as a precondition; if the \*(OPal regular expression support is
4707 available then if any of the
4708 .Dq magical
4709 (extended) regular expression characters is seen the precondition will
4710 be evaluated as (an extended) one.
4711 .It Ar view-msginfo
4712 For the introductional message info line.
4713 .It Ar view-partinfo
4714 For MIME part info lines.
4717 The following (case-insensitive) colour definitions and font attributes
4718 are understood, multiple of which can be specified in a comma-separated
4719 list:
4720 .Bl -tag -width ft=
4721 .It Ar ft=
4722 a font attribute:
4723 .Ql bold ,
4724 .Ql reverse
4726 .Ql underline .
4727 It is possible (and often applicable) to specify multiple font
4728 attributes for a single mapping.
4729 .It Ar fg=
4730 foreground colour attribute:
4731 .Ql black ,
4732 .Ql blue ,
4733 .Ql green ,
4734 .Ql red ,
4735 .Ql brown ,
4736 .Ql magenta ,
4737 .Ql cyan
4739 .Ql white .
4740 To specify a 256-color mode a decimal number colour specification in
4741 the range 0 to 255, inclusive, is supported, and interpreted as follows:
4743 .Bl -tag -compact -width "999 - 999"
4744 .It 0 - 7
4745 the standard ISO 6429 colors, as above.
4746 .It 8 - 15
4747 high intensity variants of the standard colors.
4748 .It 16 - 231
4749 216 colors in tuples of 6.
4750 .It 232 - 255
4751 grayscale from black to white in 24 steps.
4753 .Bd -literal -offset indent
4754 #!/bin/sh -
4755 fg() { printf "\e033[38;5;${1}m($1)"; }
4756 bg() { printf "\e033[48;5;${1}m($1)"; }
4758 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
4759 printf "\e033[0m\en"
4761 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
4762 printf "\e033[0m\en"
4764 .It Ar bg=
4765 background colour attribute (see
4766 .Cd fg=
4767 for possible values).
4770 The command
4771 .Ic \&uncolour
4772 will remove for the given colour type (the special type
4773 .Ql *
4774 selects all) the given mapping; if the optional precondition argument is
4775 given only the exact tuple of mapping and precondition is removed.
4776 The special name
4777 .Ql *
4778 will remove all mappings (no precondition allowed), thus
4779 .Ql uncolour * *
4780 will remove all established mappings.
4783 .It Ic commandalias , uncommandalias
4784 \*(NQ Define or list, and remove, respectively, command aliases.
4785 An (command)alias can be used everywhere a normal command can be used,
4786 but always takes precedence: any arguments that are given to the command
4787 alias are joined onto the alias expansion, and the resulting string
4788 forms the command line that is, in effect, executed.
4789 The latter command removes all given aliases, the special name
4790 .Ql *
4791 will remove all existing aliases.
4792 When used without arguments the former shows a list of all currently
4793 known aliases, with one argument only the expansion of the given one.
4795 With two or more arguments a command alias is defined or updated: the
4796 first argument is the name under which the remaining command line should
4797 be accessible, the content of which can be just about anything.
4798 An alias may itself expand to another alias, but to avoid expansion loops
4799 further expansion will be prevented if an alias refers to itself or if
4800 an expansion depth limit is reached.
4801 Explicit expansion prevention is available via reverse solidus
4802 .Cm \e ,
4803 one of the
4804 .Sx "Command modifiers" .
4805 .Bd -literal -offset indent
4806 ? commandalias xx
4807 \*(uA: `commandalias': no such alias: xx
4808 ? commandalias xx echo hello,
4809 ? commandalias xx
4810 commandalias xx 'echo hello,'
4811 ? xx
4812 hello,
4813 ? xx world
4814 hello, world
4817 .It Ic Copy
4818 (C) Copy messages to files whose names are derived from the author of
4819 the respective message and do not mark them as being saved;
4820 otherwise identical to
4821 .Ic Save .
4823 .It Ic copy
4824 (c) Copy messages to the named file and do not mark them as being saved;
4825 otherwise identical to
4826 .Ic save .
4828 .It Ic cwd
4829 Show the name of the current working directory, as reported by
4830 .Xr getcwd 3 .
4831 Supports
4832 .Cm vput
4833 (see
4834 .Sx "Command modifiers" ) .
4835 The return status is tracked via
4836 .Va \&? .
4838 .It Ic Decrypt
4839 \*(OP For unencrypted messages this command is identical to
4840 .Ic Copy ;
4841 Encrypted messages are first decrypted, if possible, and then copied.
4843 .It Ic decrypt
4844 \*(OP For unencrypted messages this command is identical to
4845 .Ic copy ;
4846 Encrypted messages are first decrypted, if possible, and then copied.
4849 .It Ic define , undefine
4850 The latter command deletes the given macro, the special name
4851 .Ql *
4852 will discard all existing macros.
4853 Deletion of (a) macro(s) can be performed from within running (a)
4854 macro(s), including self-deletion.
4855 Without arguments the former command prints the current list of macros,
4856 including their content, otherwise it it defines a macro, replacing an
4857 existing one of the same name as applicable.
4859 A defined macro can be invoked explicitly by using the
4860 .Ic call ,
4861 .Ic call_if
4863 .Ic xcall
4864 commands, or implicitly if a macro hook is triggered, e.g., a
4865 .Va folder-hook .
4866 Execution of a macro body can be stopped from within by calling
4867 .Ic return .
4869 Temporary macro block-scope variables can be created or deleted with the
4870 .Cm local
4871 command modifier in conjunction with the commands
4872 .Ic set
4874 .Ic unset ,
4875 respectively.
4876 To enforce unrolling of changes made to (global)
4877 .Sx "INTERNAL VARIABLES"
4878 the command
4879 .Ic localopts
4880 can be used instead; its covered scope depends on how (i.e.,
4881 .Dq as what :
4882 normal macro, folder hook, hook,
4883 .Ic account
4884 switch) the macro is invoked.
4886 Inside a
4887 .Ic call Ns
4888 ed macro, the given positional parameters are implicitly local
4889 to the macro's scope, and may be accessed via the variables
4890 .Va * ,
4891 .Va @ ,
4892 .Va #
4894 .Va 1
4895 and any other positive unsigned decimal number less than or equal to
4896 .Va # .
4897 Positional parameters can be
4898 .Ic shift Ns
4899 ed, or become completely replaced, removed etc. via
4900 .Ic vpospar .
4901 .Bd -literal -offset indent
4902 define name {
4903   command1
4904   command2
4905   ...
4906   commandN
4909 # E.g.
4910 define exmac {
4911   echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
4912   return 1000 0
4914 call exmac Hello macro exmac!
4915 echo ${?}/${!}/${^ERRNAME}
4919 .It Ic delete , undelete
4920 (d, u) Marks the given message list as being or not being
4921 .Ql deleted ,
4922 respectively; if no argument has been specified then the usual search
4923 for a visible message is performed, as documented for
4924 .Sx "Message list arguments" ,
4925 showing only the next input prompt if the search fails.
4926 Deleted messages will neither be saved in the
4927 .Mx -sx
4928 .Sx "secondary mailbox"
4929 .Ev MBOX
4930 nor will they be available for most other commands.
4931 If the
4932 .Va autoprint
4933 variable is set, the new
4934 .Dq dot
4935 or the last message restored, respectively, is automatically
4936 .Ic type Ns
4937 d; also see
4938 .Ic dp ,
4939 .Ic dt .
4941 .It Ic discard
4942 (di) Identical to
4943 .Ic ignore .
4944 Superseded by the multiplexer
4945 .Ic headerpick .
4948 .It Ic dp , dt
4949 Delete the given messages and automatically
4950 .Ic type
4951 the new
4952 .Dq dot
4953 if one exists, regardless of the setting of
4954 .Va autoprint .
4956 .It Ic dotmove
4957 Move the
4958 .Dq dot
4959 up or down by one message when given
4960 .Ql +
4962 .Ql -
4963 argument, respectively.
4966 .It Ic draft , undraft
4967 Take message lists and mark each given message as being draft, or not
4968 being draft, respectively, as documented in the section
4969 .Sx "Message states" .
4971 .It Ic echo
4972 \*(NQ (ec) Echoes arguments to standard output and writes a trailing
4973 newline, whereas the otherwise identical
4974 .Ic echon
4975 does not.
4976 .Sx "Shell-style argument quoting"
4977 is used,
4978 .Sx "Filename transformations"
4979 are applied to the expanded arguments.
4980 This command also supports
4981 .Cm vput
4982 as documented in
4983 .Sx "Command modifiers" ,
4984 and manages the error number
4985 .Va \&! :
4986 if data is stored in a variable then the return value reflects the
4987 length of the result string in case of success and is
4988 .Ql -1
4989 on error.
4991 .It Ic echoerr
4992 \*(NQ Identical to
4993 .Ic echo
4994 except that is echoes to standard error.
4995 Also see
4996 .Ic echoerrn .
4997 In interactive sessions the \*(OPal message ring queue for
4998 .Ic errors
4999 will be used instead, if available and
5000 .Cm vput
5001 was not used.
5003 .It Ic echon
5004 \*(NQ Identical to
5005 .Ic echo ,
5006 but does not write or store a trailing newline.
5008 .It Ic echoerrn
5009 \*(NQ Identical to
5010 .Ic echoerr ,
5011 but does not write or store a trailing newline.
5013 .It Ic edit
5014 (e) Point the text editor (as defined in
5015 .Ev EDITOR )
5016 at each message from the given list in turn.
5017 Modified contents are discarded unless the
5018 .Va writebackedited
5019 variable is set, and are not used unless the mailbox can be written to
5020 and the editor returns a successful exit status.
5022 .It Ic elif
5023 Part of the
5024 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
5025 conditional \(em if the condition of a preceding
5026 .Ic if
5027 was false, check the following condition and execute the following block
5028 if it evaluates true.
5030 .It Ic else
5031 (el) Part of the
5032 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
5033 conditional \(em if none of the conditions of the preceding
5034 .Ic if
5036 .Ic elif
5037 commands was true, the
5038 .Ic else
5039 block is executed.
5041 .It Ic endif
5042 (en) Marks the end of an
5043 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
5044 conditional execution block.
5046 .It Ic environ
5047 \*(NQ \*(UA has a strict notion about which variables are
5048 .Sx "INTERNAL VARIABLES"
5049 and which are managed in the program
5050 .Sx ENVIRONMENT .
5051 Since some of the latter are a vivid part of \*(UAs functioning,
5052 however, they are transparently integrated into the normal handling of
5053 internal variables via
5054 .Ic set
5056 .Ic unset .
5057 To integrate other environment variables of choice into this
5058 transparent handling, and also to export internal variables into the
5059 process environment where they normally are not, a
5060 .Ql link
5061 needs to become established with this command, as in, e.g.,
5063 .Dl environ link PERL5LIB TZ
5065 Afterwards changing such variables with
5066 .Ic set
5067 will cause automatic updates of the program environment, and therefore
5068 be inherited by newly created child processes.
5069 Sufficient system support provided (it was in BSD as early as 1987, and
5070 is standardized since Y2K) removing such variables with
5071 .Ic unset
5072 will remove them also from the program environment, but in any way
5073 the knowledge they ever have been
5074 .Ql link Ns
5075 ed will be lost.
5076 Note that this implies that
5077 .Ic localopts
5078 may cause loss of such links.
5080 The command
5081 .Ql unlink
5082 will remove an existing link, but leaves the variables as such intact.
5083 Additionally the subcommands
5084 .Ql set
5086 .Ql unset
5087 are provided, which work exactly the same as the documented commands
5088 .Ic set
5090 .Ic unset ,
5091 but (additionally un)link the variable(s) with the program environment
5092 and thus immediately export them to, or remove them from (if possible),
5093 respectively, the program environment.
5095 .It Ic errors
5096 \*(OP Since \*(UA uses the console as a user interface it can happen
5097 that messages scroll by too fast to become recognized.
5098 An error message ring queue is available which stores duplicates of any
5099 error message and notifies the user in interactive sessions whenever
5100 a new error has occurred.
5101 The queue is finite: if its maximum size is reached any new message
5102 replaces the eldest.
5103 The command
5104 .Ic errors
5105 can be used to manage this message queue: if given
5106 .Ar show
5107 or no argument the queue will be displayed and cleared,
5108 .Ar clear
5109 will only clear all messages from the queue.
5111 .It Ic eval
5112 \*(NQ Construct a command by concatenating the arguments, separated with
5113 a single space character, and then evaluate the result.
5114 This command passes through the exit status
5115 .Va \&?
5116 and error number
5117 .Va \&!
5118 of the evaluated command; also see
5119 .Ic call .
5120 .Bd -literal -offset indent
5121 define xxx {
5122   echo "xxx arg <$1>"
5123   shift
5124   if [ $# -gt 0 ]
5125     \excall xxx "$@"
5126   endif
5128 define yyy {
5129   eval "$@ ' ball"
5131 call yyy '\ecall xxx' "b\e$'\et'u ' "
5132 call xxx arg <b      u>
5133 call xxx arg <  >
5134 call xxx arg <ball>
5137 .It Ic exit
5138 (ex or x) Exit from \*(UA without changing the active mailbox and skip
5139 any saving of messages in the
5140 .Mx -sx
5141 .Sx "secondary mailbox"
5142 .Ev MBOX ,
5143 as well as a possibly tracked line editor
5144 .Va history-file .
5145 The optional status number argument will be passed through to
5146 .Xr exit 3 .
5147 \*(ID For now it can happen that the given status will be overwritten,
5148 later this will only occur if a later error needs to be reported onto an
5149 otherwise success indicating status.
5151 .It Ic File
5152 (Fi) Like
5153 .Ic file ,
5154 but open the mailbox read-only.
5156 .It Ic file
5157 (fi) The file command switches to a new mailbox.
5158 Without arguments it shows status information of the current mailbox.
5159 If an argument is given, it will write out changes (such as deletions)
5160 the user has made, open a new mailbox, update the internal variables
5161 .Va mailbox-resolved
5163 .Va mailbox-display ,
5164 and optionally display a summary of
5165 .Ic headers
5166 if the variable
5167 .Va header
5168 is set.
5170 .Sx "Filename transformations"
5171 will be applied to the
5172 .Ar name
5173 argument, and
5174 .Ql protocol://
5175 prefixes are, i.e., URL syntax is understood, e.g.,
5176 .Ql maildir:///tmp/mdirbox :
5177 if a protocol prefix is used the mailbox type is fixated and neither
5178 the auto-detection (read on) nor the
5179 .Va newfolders
5180 mechanisms apply.
5181 \*(OPally URLs can also be used to access network resources, which may
5182 be accessed securely via
5183 .Sx "Encrypted network communication"
5184 if so supported, and it is possible to proxy all network traffic over
5185 a SOCKS5 server given via
5186 .Va socks-proxy .
5188 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
5189 .Dl \*(OU protocol://[user@]host[:port][/path]
5191 \*(OPally supported network protocols are
5192 .Ar pop3
5193 (POP3) and
5194 .Ar pop3s
5195 (POP3 with SSL/TLS encrypted transport),
5196 .Ar imap
5198 .Ar imaps .
5200 .Ar [/path]
5201 part is valid only for IMAP; there it defaults to
5202 .Ar INBOX .
5203 Network URLs require a special encoding as documented in the section
5204 .Sx "On URL syntax and credential lookup" .
5206 If the resulting file protocol (MBOX database)
5207 .Ar name
5208 is located on a local filesystem then the list of all registered
5209 .Ic filetype Ns
5210 s is traversed in order to see whether a transparent intermediate
5211 conversion step is necessary to handle the given mailbox, in which case
5212 \*(UA will use the found hook to load and save data into and from
5213 a temporary file, respectively.
5214 Changing hooks will not affect already opened mailboxes.
5215 For example, the following creates hooks for the
5216 .Xr gzip 1
5217 compression tool and a combined compressed and encrypted format:
5218 .Bd -literal -offset indent
5219 ? filetype \e
5220     gzip 'gzip -dc' 'gzip -c' \e
5221     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5224 MBOX database files are generally locked during file operations in order
5225 to avoid inconsistencies due to concurrent modifications.
5226 \*(OPal Mailbox files which \*(UA treats as the system
5227 .Va inbox
5228 .Pf ( Ev MAIL ) ,
5230 .Mx -sx
5231 .Sx "primary system mailbox" Ns
5232 es in general will also be protected by so-called dotlock files, the
5233 traditional way of mail spool file locking: for any file
5234 .Ql a
5235 a lock file
5236 .Ql a.lock
5237 will be created for the duration of the synchronization \(em
5238 as necessary a privilege-separated dotlock child process will be used
5239 to accommodate for necessary privilege adjustments in order to create
5240 the dotlock file in the same directory
5241 and with the same user and group identities as the file of interest.
5242 Possible dotlock creation errors can be catched by setting
5243 .Va dotlock-ignore-error .
5245 \*(UA by default uses tolerant POSIX rules when reading MBOX database
5246 files, but it will detect invalid message boundaries in this mode and
5247 complain (even more with
5248 .Va debug )
5249 if any is seen: in this case
5250 .Va mbox-rfc4155
5251 can be used to create a valid MBOX database from the invalid input.
5253 If no protocol has been fixated, and
5254 .Ar name
5255 refers to a directory with the subdirectories
5256 .Ql tmp ,
5257 .Ql new
5259 .Ql cur ,
5260 then it is treated as a folder in
5261 .Dq Maildir
5262 format.
5263 The maildir format stores each message in its own file, and has been
5264 designed so that file locking is not necessary when reading or writing
5265 files.
5267 \*(ID If no protocol has been fixated and no existing file has
5268 been found, the variable
5269 .Va newfolders
5270 controls the format of mailboxes yet to be created.
5273 .It Ic filetype , unfiletype
5274 \*(NQ Define or list, and remove, respectively, file handler hooks,
5275 which provide (shell) commands that enable \*(UA to load and save MBOX
5276 files from and to files with the registered file extensions;
5277 it will use an intermediate temporary file to store the plain data.
5278 The latter command removes the hooks for all given extensions,
5279 .Ql *
5280 will remove all existing handlers.
5282 When used without arguments the former shows a list of all currently
5283 defined file hooks, with one argument the expansion of the given alias.
5284 Otherwise three arguments are expected, the first specifying the file
5285 extension for which the hook is meant, and the second and third defining
5286 the load- and save commands, respectively, to deal with the file type,
5287 both of which must read from standard input and write to standard
5288 output.
5289 Changing hooks will not affect already opened mailboxes (\*(ID except below).
5290 \*(ID For now too much work is done, and files are oftened read in twice
5291 where once would be sufficient: this can cause problems if a filetype is
5292 changed while such a file is opened; this was already so with the
5293 built-in support of .gz etc. in Heirloom, and will vanish in v15.
5294 \*(ID For now all handler strings are passed to the
5295 .Ev SHELL for evaluation purposes; in the future a
5296 .Ql \&!
5297 prefix to load and save commands may mean to bypass this shell instance:
5298 placing a leading space will avoid any possible misinterpretations.
5299 .Bd -literal -offset indent
5300 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
5301     gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
5302     zst 'zstd -dc' 'zstd -19 -zc' \e
5303     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5304 ? set record=+sent.zst.pgp
5308 .It Ic flag , unflag
5309 Take message lists and mark the messages as being flagged, or not being
5310 flagged, respectively, for urgent/special attention.
5311 See the section
5312 .Sx "Message states" .
5314 .It Ic folder
5315 (fold) The same as
5316 .Ic file .
5318 .It Ic folders
5319 With no arguments, list the names of the folders in the folder directory.
5320 With an existing folder as an argument,
5321 lists the names of folders below the named folder.
5323 .It Ic Followup
5324 (F) Similar to
5325 .Ic Respond ,
5326 but saves the message in a file named after the local part of the first
5327 recipient's address (instead of in
5328 .Va record Ns ).
5330 .It Ic followup
5331 (fo) Similar to
5332 .Ic respond ,
5333 but saves the message in a file named after the local part of the first
5334 recipient's address (instead of in
5335 .Va record Ns ).
5337 .It Ic followupall
5338 Similar to
5339 .Ic followup ,
5340 but responds to all recipients regardless of the
5341 .Va flipr
5342 variable.
5344 .It Ic followupsender
5345 Similar to
5346 .Ic Followup ,
5347 but responds to the sender only regardless of the
5348 .Va flipr
5349 variable.
5351 .It Ic Forward
5352 Similar to
5353 .Ic forward ,
5354 but saves the message in a file named after the local part of the
5355 recipient's address (instead of in
5356 .Va record Ns ).
5358 .It Ic forward
5359 Takes a message and the address of a recipient
5360 and forwards the message to him.
5361 The text of the original message is included in the new one,
5362 with the value of the
5363 .Va forward-inject-head
5364 variable preceding it.
5365 To filter the included header fields to the desired subset use the
5366 .Ql forward
5367 slot of the white- and blacklisting command
5368 .Ic headerpick .
5369 Only the first part of a multipart message is included unless
5370 .Va forward-as-attachment ,
5371 and recipient addresses will be stripped from comments, names
5372 etc. unless the internal variable
5373 .Va fullnames
5374 is set.
5376 This may generate the errors
5377 .Va ^ERR Ns -DESTADDRREQ
5378 if no receiver has been specified,
5379 .Va ^ERR Ns -PERM
5380 if some addressees where rejected by
5381 .Va expandaddr ,
5382 .Va ^ERR Ns -NODATA
5383 if no applicable messages have been given,
5384 .Va ^ERR Ns -NOTSUP
5385 if multiple messages have been specified,
5386 .Va ^ERR Ns -IO
5387 if an I/O error occurs,
5388 .Va ^ERR Ns -NOTSUP
5389 if a necessary character set conversion fails, and
5390 .Va ^ERR Ns -INVAL
5391 for other errors.
5393 .It Ic from
5394 (f) Takes a list of message specifications and displays a summary of
5395 their message headers, exactly as via
5396 .Ic headers ,
5397 making the first message of the result the new
5398 .Dq dot
5399 (the last message if
5400 .Va showlast
5401 is set).
5402 An alias of this command is
5403 .Ic search .
5404 Also see
5405 .Sx "Specifying messages" .
5406 .It Ic Fwd
5407 \*(OB Alias for
5408 .Ic Forward .
5409 .It Ic fwd
5410 \*(OB Alias for
5411 .Ic forward .
5412 .It Ic fwdignore
5413 \*(OB Superseded by the multiplexer
5414 .Ic headerpick .
5415 .It Ic fwdretain
5416 \*(OB Superseded by the multiplexer
5417 .Ic headerpick .
5418 .It Ic ghost , unghost
5419 \*(OB Replaced by
5420 .Ic commandalias ,
5421 .Ic uncommandalias .
5424 .It Ic headerpick , unheaderpick
5425 \*(NQ Multiplexer command to manage white- and blacklisting
5426 selections of header fields for a variety of applications.
5427 Without arguments the set of contexts that have settings is displayed.
5428 When given arguments, the first argument is the context to which the
5429 command applies, one of (case-insensitive)
5430 .Ql type
5431 for display purposes (via, e.g.,
5432 .Ic type ) ,
5433 .Ql save
5434 for selecting which headers shall be stored persistently when
5435 .Ic save ,
5436 .Ic copy ,
5437 .Ic move
5438 or even
5439 .Ic decrypt Ns
5440 ing messages (note that MIME related etc. header fields should not be
5441 ignored in order to not destroy usability of the message in this case),
5442 .Ql forward
5443 for stripping down messages when
5444 .Ic forward Ns
5445 ing message (has no effect if
5446 .Va forward-as-attachment
5447 is set), and
5448 .Ql top
5449 for defining user-defined set of fields for the command
5450 .Ic top .
5452 The current settings of the given context are displayed if it is the
5453 only argument.
5454 A second argument denotes the type of restriction that is to be chosen,
5455 it may be (a case-insensitive prefix of)
5456 .Ql retain
5458 .Ql ignore
5459 for white- and blacklisting purposes, respectively.
5460 Establishing a whitelist suppresses inspection of the corresponding
5461 blacklist.
5463 If no further argument is given the current settings of the given type
5464 will be displayed, otherwise the remaining arguments specify header
5465 fields, which \*(OPally may be given as regular expressions, to be added
5466 to the given type.
5467 The special wildcard field (asterisk,
5468 .Ql * )
5469 will establish a (fast) shorthand setting which covers all fields.
5471 The latter command always takes three or more arguments and can be used
5472 to remove selections, i.e., from the given context, the given type of
5473 list, all the given headers will be removed, the special argument
5474 .Ql *
5475 will remove all headers.
5477 .It Ic headers
5478 (h) Show the current group of headers, the size of which depends on
5479 the variable
5480 .Va screen ,
5481 and the style of which can be adjusted with the variable
5482 .Va headline .
5483 If a message-specification is given the group of headers containing the
5484 first message therein is shown and the message at the top of the screen
5485 becomes the new
5486 .Dq dot ;
5487 the last message is targeted if
5488 .Va showlast
5489 is set.
5491 .It Ic help
5492 (hel) A synonym for
5493 .Ic \&? .
5495 .It Ic history
5496 \*(OP Without arguments or when given
5497 .Cm show
5498 all history entries are shown (this mode also supports a more
5499 .Va verbose
5500 output).
5501 .Cm load
5502 will replace the list of entries with the content of
5503 .Va history-file ,
5505 .Cm save
5506 will dump the current list to said file, replacing former content.
5507 .Cm clear
5508 will delete all history entries.
5509 The argument can also be a signed decimal
5510 .Ar NUMBER ,
5511 which will select and evaluate the respective history entry, and move it
5512 to the top of the history; a negative number is used as an offset to the
5513 current command, e.g.,
5514 .Ql -1
5515 will select the last command, the history top.
5516 Please see
5517 .Sx "On terminal control and line editor"
5518 for more on this topic.
5520 .It Ic hold
5521 (ho, also
5522 .Ic preserve )
5523 Takes a message list and marks each message therein to be saved in the
5524 user's system
5525 .Va inbox
5526 instead of in the
5527 .Mx -sx
5528 .Sx "secondary mailbox"
5529 .Ev MBOX .
5530 Does not override the
5531 .Ic delete
5532 command.
5533 \*(UA deviates from the POSIX standard with this command, because a
5534 .Ic next
5535 command issued after
5536 .Ic hold
5537 will display the following message, not the current one.
5539 .It Ic if
5540 (i) Part of the nestable
5541 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
5542 conditional execution construct \(em if the given condition is true then
5543 the encapsulated block is executed.
5544 The POSIX standards supports the (case-insensitive) conditions
5545 .Ql r Ns
5546 eceive
5548 .Ql s Ns
5549 end, all remaining conditions are non-portable extensions.
5550 \*(ID These commands do not yet use
5551 .Sx "Shell-style argument quoting"
5552 and therefore do not know about input tokens, so that syntax
5553 elements have to be surrounded by whitespace; in v15 \*(UA will inspect
5554 all conditions bracket group wise and consider the tokens, representing
5555 values and operators, therein, which also means that variables will
5556 already have been expanded at that time (just like in the shell).
5557 .Bd -literal -offset indent
5558 if receive
5559   commands ...
5560 else
5561   commands ...
5562 endif
5565 The (case-insensitive) condition
5566 .Ql t Ns
5567 erminal will evaluate to true if the standard input is a terminal, i.e.,
5568 in interactive sessions.
5569 Another condition can be any boolean value (see the section
5570 .Sx "INTERNAL VARIABLES"
5571 for textual boolean representations) to mark an enwrapped block as
5572 .Dq never execute
5574 .Dq always execute .
5575 (It shall be remarked that a faulty condition skips all branches until
5576 .Ic endif . )
5578 (\*(ID In v15
5579 .Sx "Shell-style argument quoting"
5580 will be used, and this command will simply interpret expanded tokens.)
5581 It is possible to check
5582 .Sx "INTERNAL VARIABLES"
5583 as well as
5584 .Sx ENVIRONMENT
5585 variables for existence or compare their expansion against a user given
5586 value or another variable by using the
5587 .Ql $
5588 .Pf ( Dq variable next )
5589 conditional trigger character;
5590 a variable on the right hand side may be signalled using the same
5591 mechanism.
5592 Variable names may be enclosed in a pair of matching braces.
5593 When this mode has been triggered, several operators are available:
5595 Integer operators treat the arguments on the left and right hand side of
5596 the operator as integral numbers and compare them arithmetically.
5597 It is an error if any of the operands is not a valid integer, an empty
5598 argument (which implies it had been quoted) is treated as if it were 0.
5599 Available operators are
5600 .Ql -lt
5601 (less than),
5602 .Ql -le
5603 (less than or equal to),
5604 .Ql -eq
5605 (equal),
5606 .Ql -ne
5607 (not equal),
5608 .Ql -ge
5609 (greater than or equal to), and
5610 .Ql -gt
5611 (greater than).
5613 String data operators compare the left and right hand side according to
5614 their textual content.
5615 Unset variables are treated as the empty string.
5616 The behaviour of string operators can be adjusted by prefixing the
5617 operator with the modifier trigger commercial at
5618 .Ql @ ,
5619 followed by none to multiple modifiers: for now supported is
5620 .Ql i ,
5621 which turns the comparison into a case-insensitive one: this is
5622 implied if no modifier follows the trigger.
5624 Available string operators are
5625 .Ql <
5626 (less than),
5627 .Ql <=
5628 (less than or equal to),
5629 .Ql ==
5630 (equal),
5631 .Ql !=
5632 (not equal),
5633 .Ql >=
5634 (greater than or equal to),
5635 .Ql >
5636 (greater than),
5637 .Ql =%
5638 (is substring of) and
5639 .Ql !%
5640 (is not substring of).
5641 By default these operators work on bytes and (therefore) do not take
5642 into account character set specifics.
5643 If the case-insensitivity modifier has been used, case is ignored
5644 according to the rules of the US-ASCII encoding, i.e., bytes are
5645 still compared.
5647 When the \*(OPal regular expression support is available, the additional
5648 string operators
5649 .Ql =~
5651 .Ql !~
5652 can be used.
5653 They treat the right hand side as an extended regular expression that is
5654 matched according to the active locale (see
5655 .Sx "Character sets" ) ,
5656 i.e., character sets should be honoured correctly.
5658 Conditions can be joined via AND-OR lists (where the AND operator is
5659 .Ql &&
5660 and the OR operator is
5661 .Ql || ) ,
5662 which have equal precedence and will be evaluated with left
5663 associativity, thus using the same syntax that is known for the
5664 .Xr sh 1 .
5665 It is also possible to form groups of conditions and lists by enclosing
5666 them in pairs of brackets
5667 .Ql [\ \&.\&.\&.\ ] ,
5668 which may be interlocked within each other, and also be joined via
5669 AND-OR lists.
5671 The results of individual conditions and entire groups may be modified
5672 via unary operators: the unary operator
5673 .Ql \&!
5674 will reverse the result.
5675 .Bd -literal -offset indent
5676 # (This not in v15, there [ -n "$debug"]!)
5677 if $debug
5678   echo *debug* is set
5679 endif
5680 if [ "$ttycharset" == UTF-8 ] || \e
5681     [ "$ttycharset" @i== UTF8 ]
5682   echo *ttycharset* is UTF-8, the former case-sensitive!
5683 endif
5684 set t1=one t2=one
5685 if [ "${t1}" == "${t2}" ]
5686   echo These two variables are equal
5687 endif
5688 if [ "$features" =% +regex ] && \e
5689     [ "$TERM" @i=~ "^xterm\&.*" ]
5690   echo ..in an X terminal
5691 endif
5692 if [ [ true ] && [ [ "${debug}" != '' ] || \e
5693     [ "$verbose" != '' ] ] ]
5694   echo Noisy, noisy
5695 endif
5696 if true && [ "$debug" != '' ] || [ "${verbose}" != '' ]
5697   echo Left associativity, as is known from the shell
5698 endif
5701 .It Ic ignore
5702 (ig) Identical to
5703 .Ic discard .
5704 Superseded by the multiplexer
5705 .Ic headerpick .
5707 .It Ic list
5708 Shows the names of all available commands, alphabetically sorted.
5709 If given any non-whitespace argument the list will be shown in the order
5710 in which command prefixes are searched.
5711 \*(OP In conjunction with a set variable
5712 .Va verbose
5713 additional information will be provided for each command: the argument
5714 type will be indicated, the documentation string will be shown,
5715 and the set of command flags will show up:
5717 .Bl -tag -compact -width ".It Ql NEEDS_BOX"
5718 .It Ql "`local'"
5719 command supports the command modifier
5720 .Cm local .
5721 .It Ql "`vput'"
5722 command supports the command modifier
5723 .Cm vput .
5724 .It Ql "*!*"
5725 the error number is tracked in
5726 .Va \&! .
5727 .It Ql "needs box"
5728 commands needs an active mailbox, a
5729 .Ic file .
5730 .It Ql "ok: batch/interactive"
5731 command may only be used in interactive or
5732 .Fl #
5733 batch mode.
5734 .It Ql "ok: send mode"
5735 command can be used in send mode.
5736 .It Ql "not ok: compose mode"
5737 command is not available when in compose mode.
5738 .It Ql "not ok: startup"
5739 command cannot be used during program startup, e.g., while loading
5740 .Sx "Resource files" .
5741 .It Ql "ok: subprocess"
5742 command is allowed to be used when running in a subprocess instance,
5743 e.g., from within a macro that is called via
5744 .Va on-compose-splice .
5745 .It Ql "gabby"
5746 The command produces
5747 .Va history-gabby
5748 .Ic history
5749 entries.
5752 .It Ic localopts
5753 This command can be used to localize changes to (linked)
5754 .Sx ENVIRONMENT
5755 as well as (global)
5756 .Sx "INTERNAL VARIABLES" ,
5757 meaning that their state will be reverted to the former one once the
5758 .Dq covered scope
5759 is left.
5760 Just like the command modifier
5761 .Cm local ,
5762 which provides block-scope localization for some commands (instead),
5763 it can only be used inside of macro definition blocks introduced by
5764 .Ic account
5766 .Ic define .
5767 The covered scope of an
5768 .Ic account
5769 is left once a different account is activated, and some macros, notably
5770 .Va folder-hook Ns s ,
5771 use their own specific notion of covered scope, here it will be extended
5772 until the folder is left again.
5774 This setting stacks up: i.e., if
5775 .Ql macro1
5776 enables change localization and calls
5777 .Ql macro2 ,
5778 which explicitly resets localization, then any value changes within
5779 .Ql macro2
5780 will still be reverted when the scope of
5781 .Ql macro1
5782 is left.
5783 (Caveats: if in this example
5784 .Ql macro2
5785 changes to a different
5786 .Ic account
5787 which sets some variables that are already covered by localizations,
5788 their scope will be extended, and in fact leaving the
5789 .Ic account
5790 will (thus) restore settings in (likely) global scope which actually
5791 were defined in a local, macro private context!)
5793 This command takes one or two arguments, the optional first one
5794 specifies an attribute that may be one of
5795 .Cm \&\&scope ,
5796 which refers to the current scope and is thus the default,
5797 .Cm call ,
5798 which causes any macro that is being
5799 .Ic call Ns
5800 ed to be started with localization enabled by default, as well as
5801 .Cm call-fixate ,
5802 which (if enabled) disallows any called macro to turn off localization:
5803 like this it can be ensured that once the current scope regains control,
5804 any changes made in deeper levels have been reverted.
5805 The latter two are mutually exclusive, and neither affects
5806 .Ic xcall .
5807 The (second) argument is interpreted as a boolean (string, see
5808 .Sx "INTERNAL VARIABLES" )
5809 and states whether the given attribute shall be turned on or off.
5810 .Bd -literal -offset indent
5811 define temporary_settings {
5812   set possibly_global_option1
5813   localopts on
5814   set localized_option1
5815   set localized_option2
5816   localopts scope off
5817   set possibly_global_option2
5821 .It Ic Lreply
5822 Reply to messages that come in via known
5823 .Pf ( Ic mlist )
5824 or subscribed
5825 .Pf ( Ic mlsubscribe )
5826 mailing lists, or pretend to do so (see
5827 .Sx "Mailing lists" ) :
5828 on top of the usual
5829 .Ic reply
5830 functionality this will actively resort and even remove message
5831 recipients in order to generate a message that is supposed to be sent to
5832 a mailing list.
5833 For example it will also implicitly generate a
5834 .Ql Mail-Followup-To:
5835 header if that seems useful, regardless of the setting of the variable
5836 .Va followup-to .
5837 For more documentation please refer to
5838 .Sx "On sending mail, and non-interactive mode" .
5840 This may generate the errors
5841 .Va ^ERR Ns -DESTADDRREQ
5842 if no receiver has been specified,
5843 .Va ^ERR Ns -PERM
5844 if some addressees where rejected by
5845 .Va expandaddr ,
5846 .Va ^ERR Ns -NODATA
5847 if no applicable messages have been given,
5848 .Va ^ERR Ns -IO
5849 if an I/O error occurs,
5850 .Va ^ERR Ns -NOTSUP
5851 if a necessary character set conversion fails, and
5852 .Va ^ERR Ns -INVAL
5853 for other errors.
5854 Any error stops processing of further messages.
5856 .It Ic Mail
5857 Similar to
5858 .Ic mail ,
5859 but saves the message in a file named after the local part of the first
5860 recipient's address (instead of in
5861 .Va record Ns ).
5863 .It Ic mail
5864 (m) Takes a (list of) recipient address(es) as (an) argument(s),
5865 or asks on standard input if none were given;
5866 then collects the remaining mail content and sends it out.
5867 Unless the internal variable
5868 .Va fullnames
5869 is set recipient addresses will be stripped from comments, names etc.
5870 For more documentation please refer to
5871 .Sx "On sending mail, and non-interactive mode" .
5873 This may generate the errors
5874 .Va ^ERR Ns -DESTADDRREQ
5875 if no receiver has been specified,
5876 .Va ^ERR Ns -PERM
5877 if some addressees where rejected by
5878 .Va expandaddr ,
5879 .Va ^ERR Ns -NODATA
5880 if no applicable messages have been given,
5881 .Va ^ERR Ns -NOTSUP
5882 if multiple messages have been specified,
5883 .Va ^ERR Ns -IO
5884 if an I/O error occurs,
5885 .Va ^ERR Ns -NOTSUP
5886 if a necessary character set conversion fails, and
5887 .Va ^ERR Ns -INVAL
5888 for other errors.
5890 .It Ic mbox
5891 (mb) The given message list is to be sent to the
5892 .Mx -sx
5893 .Sx "secondary mailbox"
5894 .Ev MBOX
5895 when \*(UA is quit; this is the default action unless the variable
5896 .Va hold
5897 is set.
5898 \*(ID This command can only be used in a
5899 .Mx -sx
5900 .Sx "primary system mailbox" .
5903 .It Ic mimetype , unmimetype
5904 Without arguments the content of the MIME type cache will displayed;
5905 a more verbose listing will be produced if either of
5906 .Va debug
5908 .Va verbose
5909 are set.
5910 When given arguments they will be joined, interpreted as shown in
5911 .Sx "The mime.types files"
5912 (also see
5913 .Sx "HTML mail and MIME attachments" ) ,
5914 and the resulting entry will be added (prepended) to the cache.
5915 In any event MIME type sources are loaded first as necessary \(en
5916 .Va mimetypes-load-control
5917 can be used to fine-tune which sources are actually loaded.
5919 The latter command deletes all specifications of the given MIME type, thus
5920 .Ql ? unmimetype text/plain
5921 will remove all registered specifications for the MIME type
5922 .Ql text/plain .
5923 The special name
5924 .Ql *
5925 will discard all existing MIME types, just as will
5926 .Ql reset ,
5927 but which also reenables cache initialization via
5928 .Va mimetypes-load-control .
5931 .It Ic mlist , unmlist
5932 The latter command removes all given mailing-lists, the special name
5933 .Ql *
5934 can be used to remove all registered lists.
5935 The former will list all currently defined mailing lists (and their
5936 attributes, if any) when used without arguments; a more verbose listing
5937 will be produced if either of
5938 .Va debug
5940 .Va verbose
5941 are set.
5942 Otherwise all given arguments will be added and henceforth be recognized
5943 as mailing lists.
5944 If the \*(OPal regular expression support is available then any argument
5945 which contains any of the
5946 .Dq magical
5947 regular expression characters
5948 .Ql ^[]*+?|$
5949 (see
5950 .Xr re_format 7 )
5951 will be interpreted as one, which allows matching of many addresses with
5952 a single expression.
5954 .Ic mlsubscribe
5955 pair of commands manages subscription attributes of mailing-lists.
5957 .It Ic mimeview
5958 \*(ID Only available in interactive mode, this command allows one to
5959 display MIME parts which require external MIME handler programs to run
5960 which do not integrate in \*(UAs normal
5961 .Ic type
5962 output (see
5963 .Sx "HTML mail and MIME attachments" ) .
5964 (\*(ID No syntax to directly address parts, this restriction may vanish.)
5965 The user will be asked for each non-text part of the given message in
5966 turn whether the registered handler shall be used to display the part.
5969 .It Ic mlsubscribe , unmlsubscribe
5970 The latter command removes the subscription attribute from all given
5971 mailing-lists, the special name
5972 .Ql *
5973 can be used to do so for any registered list.
5974 The former will list all currently defined mailing lists which have
5975 a subscription attribute when used without arguments; a more verbose
5976 listing will be produced if either of
5977 .Va debug
5979 .Va verbose
5980 are set.
5981 Otherwise this attribute will be set for all given mailing lists,
5982 newly creating them as necessary (as via
5983 .Ic mlist ) .
5984 Also see
5985 .Va followup-to .
5987 .It Ic Move
5988 Similar to
5989 .Ic move ,
5990 but moves the messages to a file named after the local part of the
5991 sender address of the first message (instead of in
5992 .Va record Ns ).
5994 .It Ic move
5995 Acts like
5996 .Ic copy
5997 but marks the messages for deletion if they were transferred
5998 successfully.
6000 .It Ic More
6001 Like
6002 .Ic more ,
6003 but also displays header fields which would not pass the
6004 .Ic headerpick
6005 selection, and all MIME parts.
6006 Identical to
6007 .Ic Page .
6009 .It Ic more
6010 Invokes the
6011 .Ev PAGER
6012 on the given messages, even in non-interactive mode and as long as the
6013 standard output is a terminal.
6014 Identical to
6015 .Ic page .
6017 .It Ic netrc
6018 \*(OP When used without arguments or if
6019 .Ar show
6020 has been given the content of the
6021 .Pa .netrc
6022 cache is shown, loading it first as necessary.
6023 If the argument is
6024 .Ar load
6025 then the cache will only be initialized and
6026 .Ar clear
6027 will remove its contents.
6028 Note that \*(UA will try to load the file only once, use
6029 .Ql Ic \&\&netrc Ns \:\0\:clear
6030 to unlock further attempts.
6032 .Va netrc-lookup ,
6033 .Va netrc-pipe
6034 and the section
6035 .Sx "On URL syntax and credential lookup" ;
6036 the section
6037 .Sx "The .netrc file"
6038 documents the file format in detail.
6040 .It Ic newmail
6041 Checks for new mail in the current folder without committing any changes
6042 before.
6043 If new mail is present, a message is shown.
6044 If the
6045 .Va header
6046 variable is set,
6047 the headers of each new message are also shown.
6048 This command is not available for all mailbox types.
6050 .It Ic next
6051 (n) (like
6052 .Ql +
6054 .Dq ENTER )
6055 Goes to the next message in sequence and types it.
6056 With an argument list, types the next matching message.
6058 .It Ic New
6059 Same as
6060 .Ic Unread .
6062 .It Ic new
6063 Same as
6064 .Ic unread .
6066 .It Ic noop
6067 If the current folder is accessed via a network connection, a
6068 .Dq NOOP
6069 command is sent, otherwise no operation is performed.
6071 .It Ic Page
6072 Like
6073 .Ic page ,
6074 but also displays header fields which would not pass the
6075 .Ic headerpick
6076 selection, and all MIME parts.
6077 Identical to
6078 .Ic More .
6080 .It Ic page
6081 Invokes the
6082 .Ev PAGER
6083 on the given messages, even in non-interactive mode and as long as the
6084 standard output is a terminal.
6085 Identical to
6086 .Ic more .
6088 .It Ic Pipe
6089 Like
6090 .Ic pipe
6091 but also pipes header fields which would not pass the
6092 .Ic headerpick
6093 selection, and all parts of MIME
6094 .Ql multipart/alternative
6095 messages.
6097 .It Ic pipe
6098 (pi) Takes a message list and a shell command
6099 and pipes the messages through the command.
6100 Without an argument the current message is piped through the command
6101 given by the
6102 .Va cmd
6103 variable.
6104 If the
6105 .Va page
6106 variable is set,
6107 every message is followed by a formfeed character.
6109 .It Ic preserve
6110 (pre) A synonym for
6111 .Ic hold .
6113 .It Ic Print
6114 (P) Alias for
6115 .Ic Type .
6117 .It Ic print
6118 (p) Research
6120 equivalent of
6121 .Ic type .
6123 .It Ic quit
6124 (q) Terminates the session, saving all undeleted, unsaved messages in
6125 the current
6126 .Mx -sx
6127 .Sx "secondary mailbox"
6128 .Ev MBOX ,
6129 preserving all messages marked with
6130 .Ic hold
6132 .Ic preserve
6133 or never referenced in the system
6134 .Va inbox ,
6135 and removing all other messages from the
6136 .Mx -sx
6137 .Sx "primary system mailbox" .
6138 If new mail has arrived during the session,
6139 the message
6140 .Dq You have new mail
6141 will be shown.
6142 If given while editing a mailbox file with the command line option
6143 .Fl f ,
6144 then the edit file is rewritten.
6145 A return to the shell is effected,
6146 unless the rewrite of edit file fails,
6147 in which case the user can escape with the exit command.
6148 The optional status number argument will be passed through to
6149 .Xr exit 3 .
6150 \*(ID For now it can happen that the given status will be overwritten,
6151 later this will only occur if a later error needs to be reported onto an
6152 otherwise success indicating status.
6154 .It Ic read
6155 \*(NQ Read a line from standard input, or the channel set active via
6156 .Ic readctl ,
6157 and assign the data, which will be split as indicated by
6158 .Va ifs ,
6159 to the given variables.
6160 The variable names are checked by the same rules as documented for
6161 .Cm vput ,
6162 and the same error codes will be seen in
6163 .Va \&! ;
6164 the exit status
6165 .Va \&?
6166 indicates the number of bytes read, it will be
6167 .Ql -1
6168 with the error number
6169 .Va \&!
6170 set to
6171 .Va ^ERR Ns -BADF
6172 in case of I/O errors, or
6173 .Va ^ERR Ns -NONE
6174 upon End-Of-File.
6175 If there are more fields than variables, assigns successive fields to the
6176 last given variable.
6177 If there are less fields than variables, assigns the empty string to the
6178 remains.
6179 .Bd -literal -offset indent
6180 ? read a b c
6181    H  e  l  l  o
6182 ? echo "<$a> <$b> <$c>"
6183 <H> <e> <l  l  o>
6184 ? wysh set ifs=:; read a b c;unset ifs
6185 hey2.0,:"'you    ",:world!:mars.:
6186 ? echo $?/$^ERRNAME / <$a><$b><$c>
6187 0/NONE / <hey2.0,><"'you    ",><world!:mars.:><><>
6190 .It Ic readall
6191 \*(NQ Read anything from standard input, or the channel set active via
6192 .Ic readctl ,
6193 and assign the data to the given variable.
6194 The variable name is checked by the same rules as documented for
6195 .Cm vput ,
6196 and the same error codes will be seen in
6197 .Va \&! ;
6198 the exit status
6199 .Va \&?
6200 indicates the number of bytes read, it will be
6201 .Ql -1
6202 with the error number
6203 .Va \&!
6204 set to
6205 .Va ^ERR Ns -BADF
6206 in case of I/O errors, or
6207 .Va ^ERR Ns -NONE
6208 upon End-Of-File.
6209 \*(ID The input data length is restricted to 31-bits.
6211 .It Ic readctl
6212 \*(NQ Manages input channels for
6213 .Ic read
6215 .Ic readall ,
6216 to be used to avoid complicated or impracticable code, like calling
6217 .Ic \&\&read
6218 from within a macro in non-interactive mode.
6219 Without arguments, or when the first argument is
6220 .Cm show ,
6221 a listing of all known channels is printed.
6222 Channels can otherwise be
6223 .Cm create Ns
6224 d, and existing channels can be
6225 .Cm set
6226 active and
6227 .Cm remove Ns
6228 d by giving the string used for creation.
6230 The channel name is expected to be a file descriptor number, or,
6231 if parsing the numeric fails, an input file name that undergoes
6232 .Sx "Filename transformations" .
6233 E.g. (this example requires a modern shell):
6234 .Bd -literal -offset indent
6235 $ LC_ALL=C printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
6236   LC_ALL=C \*(uA -R#
6237 hey, you
6238 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
6239   LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
6240 hey, you
6242 .It Ic redirect
6243 \*(OB Same as
6244 .Ic resend .
6245 .It Ic Redirect
6246 \*(OB Same as
6247 .Ic Resend .
6249 .It Ic remove
6250 Removes the named files or directories.
6251 .Sx "Filename transformations"
6252 including shell pathname wildcard pattern expansions
6253 .Pf ( Xr glob 7 )
6254 are performed on the arguments.
6255 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
6256 type specific removal will be performed, deleting the complete mailbox.
6257 The user is asked for confirmation in interactive mode.
6259 .It Ic rename
6260 Takes the name of an existing folder
6261 and the name for the new folder
6262 and renames the first to the second one.
6263 .Sx "Filename transformations"
6264 including shell pathname wildcard pattern expansions
6265 .Pf ( Xr glob 7 )
6266 are performed on both arguments.
6267 Both folders must be of the same type.
6269 .It Ic Reply
6270 (R) Replies to only the sender of each message of the given message
6271 list, by using the first message as the template to quote, for the
6272 .Ql Subject:
6273 etc.
6274 .Va flipr
6275 will exchange this command with
6276 .Ic reply .
6277 Unless the internal variable
6278 .Va fullnames
6279 is set the recipient address will be stripped from comments, names etc.
6280 .Ql Reply-To:
6281 headers will be inspected if
6282 .Va reply-to-honour
6283 is set.
6285 This may generate the errors
6286 .Va ^ERR Ns -DESTADDRREQ
6287 if no receiver has been specified,
6288 .Va ^ERR Ns -PERM
6289 if some addressees where rejected by
6290 .Va expandaddr ,
6291 .Va ^ERR Ns -NODATA
6292 if no applicable messages have been given,
6293 .Va ^ERR Ns -IO
6294 if an I/O error occurs,
6295 .Va ^ERR Ns -NOTSUP
6296 if a necessary character set conversion fails, and
6297 .Va ^ERR Ns -INVAL
6298 for other errors.
6300 .It Ic reply
6301 (r) Take a message and group-responds to it by addressing the sender
6302 and all recipients, subject to
6303 .Ic alternates
6304 processing.
6305 .Va followup-to ,
6306 .Va followup-to-honour ,
6307 .Va reply-to-honour
6308 as well as
6309 .Va recipients-in-cc
6310 influence response behaviour.
6311 Unless the internal variable
6312 .Va fullnames
6313 is set recipient addresses will be stripped from comments, names etc.
6315 .Va flipr
6316 is set the commands
6317 .Ic Reply
6319 .Ic reply
6320 are exchanged.
6321 The command
6322 .Ic Lreply
6323 offers special support for replying to mailing lists.
6324 For more documentation please refer to
6325 .Sx "On sending mail, and non-interactive mode" .
6327 This may generate the errors
6328 .Va ^ERR Ns -DESTADDRREQ
6329 if no receiver has been specified,
6330 .Va ^ERR Ns -PERM
6331 if some addressees where rejected by
6332 .Va expandaddr ,
6333 .Va ^ERR Ns -NODATA
6334 if no applicable messages have been given,
6335 .Va ^ERR Ns -IO
6336 if an I/O error occurs,
6337 .Va ^ERR Ns -NOTSUP
6338 if a necessary character set conversion fails, and
6339 .Va ^ERR Ns -INVAL
6340 for other errors.
6341 Any error stops processing of further messages.
6343 .It Ic replyall
6344 Similar to
6345 .Ic reply ,
6346 but initiates a group-reply regardless of the value of
6347 .Va flipr .
6349 .It Ic replysender
6350 Similar to
6351 .Ic Reply ,
6352 but responds to the sender only regardless of the value of
6353 .Va flipr .
6355 .It Ic Resend
6356 Like
6357 .Ic resend ,
6358 but does not add any header lines.
6359 This is not a way to hide the sender's identity,
6360 but useful for sending a message again to the same recipients.
6362 .It Ic resend
6363 Takes a list of messages and a user name
6364 and sends each message to the named user.
6365 .Ql Resent-From:
6366 and related header fields are prepended to the new copy of the message.
6367 Saving in
6368 .Va record
6369 is only performed if
6370 .Va record-resent
6371 is set.
6373 This may generate the errors
6374 .Va ^ERR Ns -DESTADDRREQ
6375 if no receiver has been specified,
6376 .Va ^ERR Ns -PERM
6377 if some addressees where rejected by
6378 .Va expandaddr ,
6379 .Va ^ERR Ns -NODATA
6380 if no applicable messages have been given,
6381 .Va ^ERR Ns -IO
6382 if an I/O error occurs,
6383 .Va ^ERR Ns -NOTSUP
6384 if a necessary character set conversion fails, and
6385 .Va ^ERR Ns -INVAL
6386 for other errors.
6387 Any error stops processing of further messages.
6389 .It Ic Respond
6390 Same as
6391 .Ic Reply .
6393 .It Ic respond
6394 Same as
6395 .Ic reply .
6397 .It Ic respondall
6398 Same as
6399 .Ic replyall .
6401 .It Ic respondsender
6402 Same as
6403 .Ic replysender .
6405 .It Ic retain
6406 (ret) Superseded by the multiplexer
6407 .Ic headerpick .
6409 .It Ic return
6410 Only available inside the scope of a
6411 .Ic define Ns
6412 d macro or an
6413 .Ic account ,
6414 this will stop evaluation of any further macro content, and return
6415 execution control to the caller.
6416 The two optional parameters must be specified as positive decimal
6417 numbers and default to the value 0:
6418 the first argument specifies the signed 32-bit return value (stored in
6419 .Va \&?
6420 \*(ID and later extended to signed 64-bit),
6421 the second the signed 32-bit error number (stored in
6422 .Va \&! ) .
6423 As documented for
6424 .Va \&?
6425 a non-0 exit status may cause the program to exit.
6427 .It Ic Save
6428 (S) Similar to
6429 .Ic save,
6430 but saves the messages in a file named after the local part of the
6431 sender of the first message instead of (in
6432 .Va record
6433 and) taking a filename argument; the variable
6434 .Va outfolder
6435 is inspected to decide on the actual storage location.
6437 .It Ic save
6438 (s) Takes a message list and a filename and appends each message in turn
6439 to the end of the file.
6440 .Sx "Filename transformations"
6441 including shell pathname wildcard pattern expansions
6442 .Pf ( Xr glob 7 )
6443 is performed on the filename.
6444 If no filename is given, the
6445 .Mx -sx
6446 .Sx "secondary mailbox"
6447 .Ev MBOX
6448 is used.
6449 The filename in quotes, followed by the generated character count
6450 is echoed on the user's terminal.
6451 If editing a
6452 .Mx -sx
6453 .Sx "primary system mailbox"
6454 the messages are marked for deletion.
6455 .Sx "Filename transformations"
6456 will be applied.
6457 To filter the saved header fields to the desired subset use the
6458 .Ql save
6459 slot of the white- and blacklisting command
6460 .Ic headerpick .
6461 .It Ic savediscard
6462 \*(OB Superseded by the multiplexer
6463 .Ic headerpick .
6464 .It Ic saveignore
6465 \*(OB Superseded by the multiplexer
6466 .Ic headerpick .
6467 .It Ic saveretain
6468 \*(OB Superseded by the multiplexer
6469 .Ic headerpick .
6471 .It Ic search
6472 Takes a message specification (list) and displays a header summary of
6473 all matching messages, as via
6474 .Ic headers .
6475 This command is an alias of
6476 .Ic from .
6477 Also see
6478 .Sx "Specifying messages" .
6480 .It Ic seen
6481 Takes a message list and marks all messages as having been read.
6484 .It Ic set , unset
6485 (se, \*(NQ uns) The latter command will delete all given global
6486 variables, or only block-scope local ones if the
6487 .Cm local
6488 command modifier has been used.
6489 The former, when used without arguments, will show all
6490 currently known variables, being more verbose if either of
6491 .Va debug
6493 .Va verbose
6494 is set.
6495 Remarks: this list mode will not automatically link-in known
6496 .Sx ENVIRONMENT
6497 variables, but only explicit addressing will, e.g., via
6498 .Ic varshow ,
6499 using a variable in an
6500 .Ic if
6501 condition or a string passed to
6502 .Ic echo ,
6503 explicit
6504 .Ic \&\&set Ns
6505 ting, as well as some program-internal use cases.
6507 Otherwise the given variables (and arguments) are set or adjusted.
6508 Arguments are of the form
6509 .Ql name=value
6510 (no space before or after
6511 .Ql = ) ,
6512 or plain
6513 .Ql name
6514 if there is no value, i.e., a boolean variable.
6515 If a name begins with
6516 .Ql no ,
6517 as in
6518 .Ql set nosave ,
6519 the effect is the same as invoking the
6520 .Ic \&\&unset
6521 command with the remaining part of the variable
6522 .Pf ( Ql unset save ) .
6523 \*(ID In conjunction with the
6524 .Cm wysh
6525 .Pf (or\0 Cm local )
6526 command prefix(es)
6527 .Sx "Shell-style argument quoting"
6528 can be used to quote arguments as necessary.
6529 \*(ID Otherwise quotation marks may be placed around any part of the
6530 assignment statement to quote blanks or tabs.
6532 When operating in global scope any
6533 .Ql name
6534 that is known to map to an environment variable will automatically cause
6535 updates in the program environment (unsetting a variable in the
6536 environment requires corresponding system support) \(em use the command
6537 .Ic environ
6538 for further environmental control.
6539 If the command modifier
6540 .Cm local
6541 has been used to alter the command to work in block-scope all variables
6542 have values (may they be empty), and creation of names which shadow
6543 .Sx "INTERNAL VARIABLES"
6544 is actively prevented (\*(ID shadowing of linked
6545 .Sx ENVIRONMENT
6546 variables and free-form versions of variable chains is not yet detected).
6547 Also see
6548 .Ic varedit ,
6549 .Ic varshow
6550 and the sections
6551 .Sx "INTERNAL VARIABLES"
6553 .Sx ENVIRONMENT .
6554 .Bd -literal -offset indent
6555 ? wysh set indentprefix=' -> '
6556 ? wysh set atab=$'\t' aspace=' ' zero=0
6559 .It Ic shcodec
6560 Apply shell quoting rules to the given raw-data arguments.
6561 Supports
6562 .Cm vput
6563 (see
6564 .Sx "Command modifiers" ) .
6565 The first argument specifies the operation:
6566 .Ar [+]e[ncode]
6568 .Ar d[ecode]
6569 cause shell quoting to be applied to the remains of the line, and
6570 expanded away thereof, respectively.
6571 If the former is prefixed with a plus-sign, the quoted result will not
6572 be roundtrip enabled, and thus can be decoded only in the very same
6573 environment that was used to perform the encode; also see
6574 .Cd mle-quote-rndtrip .
6575 If the coding operation fails the error number
6576 .Va \&!
6577 is set to
6578 .Va ^ERR Ns -CANCELED ,
6579 and the unmodified input is used as the result; the error number may
6580 change again due to output or result storage errors.
6582 .It Ic shell
6583 \*(NQ (sh) Invokes an interactive version of the shell,
6584 and returns its exit status.
6587 .It Ic shortcut , unshortcut
6588 Without arguments the list of all currently defined shortcuts is
6589 shown, with one argument the expansion of the given shortcut.
6590 Otherwise all given arguments are treated as pairs of shortcuts and
6591 their expansions, creating new or changing already existing shortcuts,
6592 as necessary.
6593 The latter command will remove all given shortcuts, the special name
6594 .Ql *
6595 will remove all registered shortcuts.
6597 .It Ic shift
6598 \*(NQ Shift the positional parameter stack (starting at
6599 .Va 1 )
6600 by the given number (which must be a positive decimal),
6601 or 1 if no argument has been given.
6602 It is an error if the value exceeds the number of positional parameters.
6603 If the given number is 0, no action is performed, successfully.
6604 The stack as such can be managed via
6605 .Ic vpospar .
6606 Note this command will fail in
6607 .Ic account
6608 and hook macros unless the positional parameter stack has been
6609 explicitly created in the current context via
6610 .Ic vpospar .
6612 .It Ic show
6613 Like
6614 .Ic type ,
6615 but performs neither MIME decoding nor decryption, so that the raw
6616 message text is shown.
6618 .It Ic size
6619 (si) Shows the size in characters of each message of the given
6620 message-list.
6622 .It Ic sleep
6623 \*(NQ Sleep for the specified number of seconds (and optionally
6624 milliseconds), by default interruptably.
6625 If a third argument is given the sleep will be uninterruptible,
6626 otherwise the error number
6627 .Va \&!
6628 will be set to
6629 .Va ^ERR Ns -INTR
6630 if the sleep has been interrupted.
6631 The command will fail and the error number will be
6632 .Va ^ERR Ns -OVERFLOW
6633 if the given duration(s) overflow the time datatype, and
6634 .Va ^ERR Ns -INVAL
6635 if the given durations are no valid integers.
6638 .It Ic sort , unsort
6639 The latter command disables sorted or threaded mode, returns to normal
6640 message order and, if the
6641 .Va header
6642 variable is set,
6643 displays a header summary.
6644 The former command shows the current sorting criterion when used without
6645 an argument, but creates a sorted representation of the current folder
6646 otherwise, and changes the
6647 .Ic next
6648 command and the addressing modes such that they refer to messages in
6649 the sorted order.
6650 Message numbers are the same as in regular mode.
6651 If the
6652 .Va header
6653 variable is set,
6654 a header summary in the new order is also displayed.
6655 Automatic folder sorting can be enabled by setting the
6656 .Va autosort
6657 variable, as in, e.g.,
6658 .Ql set autosort=thread .
6659 Possible sorting criterions are:
6661 .Bl -tag -compact -width "subject"
6662 .It Ar date
6663 Sort the messages by their
6664 .Ql Date:
6665 field, that is by the time they were sent.
6666 .It Ar from
6667 Sort messages by the value of their
6668 .Ql From:
6669 field, that is by the address of the sender.
6670 If the
6671 .Va showname
6672 variable is set, the sender's real name (if any) is used.
6673 .It Ar size
6674 Sort the messages by their size.
6675 .It spam
6676 \*(OP Sort the message by their spam score, as has been classified by
6677 .Ic spamrate .
6678 .It Ar status
6679 Sort the messages by their message status.
6680 .It Ar subject
6681 Sort the messages by their subject.
6682 .It Ar thread
6683 Create a threaded display.
6684 .It Ar to
6685 Sort messages by the value of their
6686 .Ql To:
6687 field, that is by the address of the recipient.
6688 If the
6689 .Va showname
6690 variable is set, the recipient's real name (if any) is used.
6693 .It Ic source
6694 \*(NQ (so) The source command reads commands from the given file.
6695 .Sx "Filename transformations"
6696 will be applied.
6697 If the given expanded argument ends with a vertical bar
6698 .Ql |
6699 then the argument will instead be interpreted as a shell command and
6700 \*(UA will read the output generated by it.
6701 Dependent on the settings of
6702 .Va posix
6704 .Va errexit ,
6705 and also dependent on whether the command modifier
6706 .Cm ignerr
6707 had been used, encountering errors will stop sourcing of the given input.
6708 \*(ID Note that
6709 .Ic \&\&source
6710 cannot be used from within macros that execute as
6711 .Va folder-hook Ns s
6713 .Ic account Ns s ,
6714 i.e., it can only be called from macros that were
6715 .Ic call Ns ed .
6717 .It Ic source_if
6718 \*(NQ The difference to
6719 .Ic source
6720 (beside not supporting pipe syntax aka shell command input) is that
6721 this command will not generate an error nor warn if the given file
6722 argument cannot be opened successfully.
6724 .It Ic spamclear
6725 \*(OP Takes a list of messages and clears their
6726 .Ql is-spam
6727 flag.
6729 .It Ic spamforget
6730 \*(OP Takes a list of messages and causes the
6731 .Va spam-interface
6732 to forget it has ever used them to train its Bayesian filter.
6733 Unless otherwise noted the
6734 .Ql is-spam
6735 flag of the message is inspected to chose whether a message shall be
6736 forgotten to be
6737 .Dq ham
6739 .Dq spam .
6741 .It Ic spamham
6742 \*(OP Takes a list of messages and informs the Bayesian filter of the
6743 .Va spam-interface
6744 that they are
6745 .Dq ham .
6746 This also clears the
6747 .Ql is-spam
6748 flag of the messages in question.
6750 .It Ic spamrate
6751 \*(OP Takes a list of messages and rates them using the configured
6752 .Va spam-interface ,
6753 without modifying the messages, but setting their
6754 .Ql is-spam
6755 flag as appropriate; because the spam rating headers are lost the rate
6756 will be forgotten once the mailbox is left.
6757 Refer to the manual section
6758 .Sx "Handling spam"
6759 for the complete picture of spam handling in \*(UA.
6761 .It Ic spamset
6762 \*(OP Takes a list of messages and sets their
6763 .Ql is-spam
6764 flag.
6766 .It Ic spamspam
6767 \*(OP Takes a list of messages and informs the Bayesian filter of the
6768 .Va spam-interface
6769 that they are
6770 .Dq spam .
6771 This also sets the
6772 .Ql is-spam
6773 flag of the messages in question.
6774 .It Ic thread
6775 \*(OB The same as
6776 .Ql sort thread
6777 (consider using a
6778 .Ql commandalias
6779 as necessary).
6781 .It Ic Top
6782 Like
6783 .Ic top
6784 but always uses the
6785 .Ic headerpick
6786 .Ql type
6787 slot for white- and blacklisting header fields.
6789 .It Ic top
6790 (to) Takes a message list and types out the first
6791 .Va toplines
6792 lines of each message on the users' terminal.
6793 Unless a special selection has been established for the
6794 .Ql top
6795 slot of the
6796 .Ic headerpick
6797 command, the only header fields that are displayed are
6798 .Ql From: ,
6799 .Ql To: ,
6800 .Ql CC: ,
6802 .Ql Subject: .
6803 .Ic Top
6804 will always use the
6805 .Ql type
6806 .Ic headerpick
6807 selection instead.
6808 It is possible to apply compression to what is displayed by setting
6809 .Va topsqueeze .
6810 Messages are decrypted and converted to the terminal character set
6811 if necessary.
6813 .It Ic touch
6814 (tou) Takes a message list and marks the messages for saving in the
6815 .Mx -sx
6816 .Sx "secondary mailbox"
6817 .Ev MBOX .
6818 \*(UA deviates from the POSIX standard with this command,
6819 as a following
6820 .Ic next
6821 command will display the following message instead of the current one.
6823 .It Ic Type
6824 (T) Like
6825 .Ic type
6826 but also displays header fields which would not pass the
6827 .Ic headerpick
6828 selection, and all visualizable parts of MIME
6829 .Ql multipart/alternative
6830 messages.
6832 .It Ic type
6833 (t) Takes a message list and types out each message on the users terminal.
6834 The display of message headers is selectable via
6835 .Ic headerpick .
6836 For MIME multipart messages, all parts with a content type of
6837 .Ql text ,
6838 all parts which have a registered MIME type handler (see
6839 .Sx "HTML mail and MIME attachments" )
6840 which produces plain text output, and all
6841 .Ql message
6842 parts are shown, others are hidden except for their headers.
6843 Messages are decrypted and converted to the terminal character set
6844 if necessary.
6845 The command
6846 .Ic mimeview
6847 can be used to display parts which are not displayable as plain text.
6848 .It Ic unaccount
6850 .Ic account .
6851 .It Ic unalias
6852 (una) See
6853 .Ic alias .
6854 .It Ic unanswered
6856 .Ic answered .
6857 .It Ic unbind
6859 .Ic bind .
6860 .It Ic uncollapse
6862 .Ic collapse .
6863 .It Ic uncolour
6865 .Ic colour .
6866 .It Ic undefine
6868 .Ic define .
6869 .It Ic undelete
6871 .Ic delete .
6872 .It Ic undraft
6874 .Ic draft .
6875 .It Ic unflag
6877 .Ic flag .
6878 .It Ic unfwdignore
6879 \*(OB Superseded by the multiplexer
6880 .Ic headerpick .
6881 .It Ic unfwdretain
6882 \*(OB Superseded by the multiplexer
6883 .Ic headerpick .
6885 .It Ic unignore
6886 Superseded by the multiplexer
6887 .Ic headerpick .
6888 .It Ic unmimetype
6890 .Ic mimetype .
6891 .It Ic unmlist
6893 .Ic mlist .
6894 .It Ic unmlsubscribe
6896 .Ic mlsubscribe .
6898 .It Ic Unread
6899 Same as
6900 .Ic unread .
6902 .It Ic unread
6903 Takes a message list and marks each message as not having been read.
6905 .It Ic unretain
6906 Superseded by the multiplexer
6907 .Ic headerpick .
6908 .It Ic unsaveignore
6909 \*(OB Superseded by the multiplexer
6910 .Ic headerpick .
6911 .It Ic unsaveretain
6912 \*(OB Superseded by the multiplexer
6913 .Ic headerpick .
6914 .It Ic unset
6915 \*(NQ (uns) See
6916 .Ic set .
6917 .It Ic unshortcut
6919 .Ic shortcut .
6920 .It Ic unsort
6922 .Ic short .
6923 .It Ic unthread
6924 \*(OB
6925 Same as
6926 .Ic unsort .
6928 .It Ic urlcodec
6929 Perform URL percent codec operations on the raw-data argument, rather
6930 according to RFC 3986.
6931 Supports
6932 .Cm vput
6933 (see
6934 .Sx "Command modifiers" ) ,
6935 and manages the error number
6936 .Va \&! .
6937 This is a character set agnostic and thus locale dependent operation,
6938 and it may decode bytes which are invalid in the current
6939 .Va ttycharset .
6940 \*(ID This command does not know about URLs beside that.
6942 The first argument specifies the operation:
6943 .Ar e[ncode]
6945 .Ar d[ecode]
6946 perform plain URL percent en- and decoding, respectively.
6947 .Ar p[ath]enc[ode]
6949 .Ar p[ath]dec[ode]
6950 perform a slightly modified operation which should be better for
6951 pathnames: it does not allow a tilde
6952 .Ql ~ ,
6953 and will neither accept hyphen-minus
6954 .Ql -
6955 nor dot
6956 .Ql .
6957 as an initial character.
6958 The remains of the line form the URL data which is to be converted.
6959 If the coding operation fails the error number
6960 .Va \&!
6961 is set to
6962 .Va ^ERR Ns -CANCELED ,
6963 and the unmodified input is used as the result; the error number may
6964 change again due to output or result storage errors.
6966 .It Ic varedit
6967 \*(NQ Edit the values of or create the given variable(s) in the
6968 .Ev EDITOR .
6969 Boolean variables cannot be edited, and variables can also not be
6970 .Ic unset
6971 with this command.
6973 .It Ic varshow
6974 \*(NQ This command produces the same output as the listing mode of
6975 .Ic set ,
6976 including
6977 .Va verbose Ns
6978 ity adjustments, but only for the given variables.
6980 .It Ic verify
6981 \*(OP Takes a message list and verifies each message.
6982 If a message is not a S/MIME signed message,
6983 verification will fail for it.
6984 The verification process checks if the message was signed using a valid
6985 certificate,
6986 if the message sender's email address matches one of those contained
6987 within the certificate,
6988 and if the message content has been altered.
6990 .It Ic version
6991 Shows the
6992 .Va version
6994 .Va features
6995 of \*(UA, as well as the build and running system environment.
6996 Supports
6997 .Cm vput
6998 (see
6999 .Sx "Command modifiers" ) .
7001 .It Ic vexpr
7002 \*(NQ Evaluate arguments according to a given operator.
7003 This is a multiplexer command which can be used to perform signed 64-bit
7004 numeric calculations as well as byte string and string operations.
7005 It uses polish notation, i.e., the operator is the first argument and
7006 defines the number and type, and the meaning of the remaining arguments.
7007 An empty argument is replaced with a 0 if a number is expected.
7008 Supports
7009 .Cm vput
7010 (see
7011 .Sx "Command modifiers" ) .
7013 The result that is shown in case of errors is always
7014 .Ql -1
7015 for usage errors and numeric operations, and the empty string for byte
7016 string and string operations;
7017 if the latter two fail to provide result data for
7018 .Dq soft
7019 errors, e.g., when a search operation failed, they also set the
7020 .Va \&!
7021 error number to
7022 .Va ^ERR Ns -NODATA .
7023 Except when otherwise noted numeric arguments are parsed as signed 64-bit
7024 numbers, and errors will be reported in the error number
7025 .Va \&!
7026 as the numeric error
7027 .Va ^ERR Ns -RANGE .
7029 Numeric operations work on one or two signed 64-bit integers.
7030 Numbers prefixed with
7031 .Ql 0x
7033 .Ql 0X
7034 are interpreted as hexadecimal (base 16) numbers, whereas
7035 .Ql 0
7036 indicates octal (base 8), and
7037 .Ql 0b
7038 as well as
7039 .Ql 0B
7040 denote binary (base 2) numbers.
7041 It is possible to use any base in between 2 and 36, inclusive, with the
7042 .Ql BASE#number
7043 notation, where the base is given as an unsigned decimal number, e.g.,
7044 .Ql 16#AFFE
7045 is a different way of specifying a hexadecimal number.
7046 Unsigned interpretation of a number can be enforced by prefixing a
7047 .Ql u
7048 (case-insensitively), e.g.,
7049 .Ql u-110 ;
7050 this is not necessary for power-of-two bases (2, 4, 8, 16 and 32),
7051 which will be interpreted as unsigned by default, but it still makes
7052 a difference regarding overflow detection and overflow constant.
7053 It is possible to enforce signed interpretation by (instead) prefixing a
7054 .Ql s
7055 (case-insensitively).
7057 One integer is expected by assignment (equals sign
7058 .Ql = ) ,
7059 which does nothing but parsing the argument, thus detecting validity and
7060 possible overflow conditions, and unary not (tilde
7061 .Ql ~ ) ,
7062 which creates the bitwise complement.
7063 Two integers are used by addition (plus sign
7064 .Ql + ) ,
7065 subtraction (hyphen-minus
7066 .Ql - ) ,
7067 multiplication (asterisk
7068 .Ql * ) ,
7069 division (solidus
7070 .Ql / )
7071 and modulo (percent sign
7072 .Ql % ) ,
7073 as well as for the bitwise operators logical or (vertical bar
7074 .Ql | ,
7075 to be quoted) ,
7076 bitwise and (ampersand
7077 .Ql \&& ,
7078 to be quoted) ,
7079 bitwise xor (circumflex
7080 .Ql ^ ) ,
7081 the bitwise signed left- and right shifts
7082 .Pf ( Ql << ,
7083 .Ql >> ) ,
7084 as well as for the unsigned right shift
7085 .Ql >>> .
7087 Another numeric operation is
7088 .Cm pbase ,
7089 which takes a number base in between 2 and 36, inclusive, and will act
7090 on the second number given just the same as what equals sign
7091 .Ql =
7092 does, but the number result will be formatted in the base given.
7094 All numeric operators can be prefixed with a commercial at
7095 .Ql @ ,
7096 e.g.,
7097 .Ql @* :
7098 this will turn the operation into a saturated one, which means that
7099 overflow errors and division and modulo by zero are no longer reported
7100 via the exit status, but the result will linger at the minimum or
7101 maximum possible value, instead of overflowing (or trapping).
7102 This is true also for the argument parse step.
7103 For the bitwise shifts, the saturated maximum is 63.
7104 Any caught overflow will be reported via the error number
7105 .Va \&!
7107 .Va ^ERR Ns -OVERFLOW .
7108 .Bd -literal -offset indent
7109 ? vexpr @- +1 -9223372036854775808
7110 ? echo $?/$!/$^ERRNAME
7113 Character set agnostic string functions have no notion of locale
7114 settings and character sets.
7115 .Bl -hang -width ".It Cm random"
7116 .It Cm file-expand
7117 Performs the usual
7118 .Sx "Filename transformations"
7119 on its argument.
7120 .It Cm random
7121 Generates a random string of the given length, or of
7122 .Dv \&\&PATH_MAX
7123 bytes (a constant from
7124 .Pa /usr/include )
7125 if the value 0 is given; the random string will be base64url encoded
7126 according to RFC 4648, and thus be usable as a (portable) filename.
7129 Byte string operations work on 8-bit bytes and have no notion of locale
7130 settings and character sets, effectively assuming ASCII data.
7131 .Bl -hang -width ".It Cm length"
7132 .It Cm length
7133 Queries the length of the given argument.
7134 .It Cm hash
7135 Calculates the Chris Torek hash of the given argument.
7136 .It Cm find
7137 Byte-searches in the first for the second argument.
7138 Shows the resulting 0-based offset shall it have been found.
7139 .It Cm ifind
7140 Identical to
7141 .Cm find ,
7142 but works case-insensitively according to the rules of the ASCII
7143 character set.
7144 .It Cm substring
7145 Creates a substring of its first argument.
7146 The second argument is the 0-based starting offset, a negative one
7147 counts from the end;
7148 the optional third argument specifies the length of the desired result,
7149 a negative length leaves off the given number of bytes at the end of the
7150 original string, by default the entire string is used;
7151 this operation tries to work around faulty arguments (set
7152 .Va verbose
7153 for error logs), but reports them via the error number
7154 .Va \&!
7156 .Va ^ERR Ns -OVERFLOW .
7157 .It Cm trim
7158 Trim away whitespace characters from both ends of the argument.
7159 .It Cm trim-front
7160 Trim away whitespace characters from the begin of the argument.
7161 .It Cm trim-end
7162 Trim away whitespace characters from the end of the argument.
7165 String operations work, sufficient support provided, according to the
7166 active user's locale encoding and character set (see
7167 .Sx "Character sets" ) .
7168 .Bl -hang -width ".It Cm regex"
7169 .It Cm makeprint
7170 (One-way) Converts the argument to something safely printable on the
7171 terminal.
7172 .It Cm regex
7173 \*(OP A string operation that will try to match the first argument with
7174 the regular expression given as the second argument.
7175 If the optional third argument has been given then instead of showing
7176 the match offset a replacement operation is performed: the third
7177 argument is treated as if specified within dollar-single-quote (see
7178 .Sx "Shell-style argument quoting" ) ,
7179 and any occurrence of a positional parameter, e.g.,
7180 .Va 1 ,
7181 is replaced by the corresponding match group of the regular expression:
7182 .Bd -literal -offset indent
7183 ? vput vexpr res regex bananarama \e
7184     (.*)NanA(.*) '\e${1}au\e$2'
7185 ? echo $?/$!/$^ERRNAME: $res
7187 .It Cm iregex
7188 On otherwise identical case-insensitive equivalent to
7189 .Cm regex :
7190 .Bd -literal -offset indent
7191 ? vput vexpr res ire bananarama \e
7192     (.*)NanA(.*) '\e${1}au\e$2'
7193 ? echo $?/$!/$^ERRNAME: $res
7197 .It Ic vpospar
7198 \*(NQ Manage the positional parameter stack (see
7199 .Va 1 , # , * , @
7200 as well as
7201 .Ic shift ) .
7202 If the first argument is
7203 .Ql clear ,
7204 then the positional parameter stack of the current context, or the
7205 global one, if there is none, is cleared.
7206 If it is
7207 .Ql set ,
7208 then the remaining arguments will be used to (re)create the stack,
7209 if the parameter stack size limit is excessed an
7210 .Va ^ERR Ns -OVERFLOW
7211 error will occur.
7213 If the first argument is
7214 .Ql quote ,
7215 a round-trip capable representation of the stack contents is created,
7216 with each quoted parameter separated from each other with the first
7217 character of
7218 .Va ifs ,
7219 and followed by the first character of
7220 .Va if-ws ,
7221 if that is not empty and not identical to the first.
7222 If that results in no separation at all a
7223 .Cm space
7224 character is used.
7225 This mode supports
7226 .Cm vput
7227 (see
7228 .Sx "Command modifiers" ) .
7229 I.e., the subcommands
7230 .Ql set
7232 .Ql quote
7233 can be used (in conjunction with
7234 .Ic eval )
7235 to (re)create an argument stack from and to a single variable losslessly.
7236 .Bd -literal -offset indent
7237 ? vpospar set hey, "'you    ", world!
7238 ? echo $#: <${1}><${2}><${3}>
7239 ? vput vpospar x quote
7240 ? vpospar clear
7241 ? echo $#: <${1}><${2}><${3}>
7242 ? eval vpospar set ${x}
7243 ? echo $#: <${1}><${2}><${3}>
7246 .It Ic visual
7247 (v) Takes a message list and invokes the display editor on each message.
7248 Modified contents are discarded unless the
7249 .Va writebackedited
7250 variable is set, and are not used unless the mailbox can be written to
7251 and the editor returns a successful exit status.
7253 .It Ic write
7254 (w) For conventional messages the body without all headers is written.
7255 The original message is never marked for deletion in the originating
7256 mail folder.
7257 The output is decrypted and converted to its native format as necessary.
7258 If the output file exists, the text is appended.
7259 If a message is in MIME multipart format its first part is written to
7260 the specified file as for conventional messages, handling of the remains
7261 depends on the execution mode.
7262 No special handling of compressed files is performed.
7264 In interactive mode the user is consecutively asked for the filenames of
7265 the processed parts.
7266 For convience saving of each part may be skipped by giving an empty
7267 value, the same result as writing it to
7268 .Pa /dev/null .
7269 Shell piping the part content by specifying a leading vertical bar
7270 .Ql |
7271 character for the filename is supported.
7272 Other user input undergoes the usual
7273 .Sx "Filename transformations" ,
7274 including shell pathname wildcard pattern expansions
7275 .Pf ( Xr glob 7 )
7276 and shell variable expansion for the message as such, not the individual
7277 parts, and contents of the destination file are overwritten if the file
7278 previously existed.
7280 \*(ID In non-interactive mode any part which does not specify a filename
7281 is ignored, and suspicious parts of filenames of the remaining parts are
7282 URL percent encoded (as via
7283 .Ic urlcodec )
7284 to prevent injection of malicious character sequences, resulting in
7285 a filename that will be written into the current directory.
7286 Existing files will not be overwritten, instead the part number or
7287 a dot are appended after a number sign
7288 .Ql #
7289 to the name until file creation succeeds (or fails due to other
7290 reasons).
7292 .It Ic xcall
7293 \*(NQ The sole difference to
7294 .Ic call
7295 is that the new macro is executed in place of the current one, which
7296 will not regain control: all resources of the current macro will be
7297 released first.
7298 This implies that any setting covered by
7299 .Ic localopts
7300 will be forgotten and covered variables will become cleaned up.
7301 If this command is not used from within a
7302 .Ic call Ns
7303 ed macro it will silently be (a more expensive variant of)
7304 .Ic call .
7306 .It Ic xit
7307 (x) A synonym for
7308 .Ic exit .
7310 .It Ic z
7311 \*(NQ \*(UA presents message headers in
7312 .Va screen Ns
7313 fuls as described under the
7314 .Ic headers
7315 command.
7316 Without arguments this command scrolls to the next window of messages,
7317 likewise if the argument is
7318 .Ql + .
7319 An argument of
7320 .Ql -
7321 scrolls to the last,
7322 .Ql ^
7323 scrolls to the first, and
7324 .Ql $
7325 to the last
7326 .Va \&\&screen
7327 of messages.
7328 A number argument prefixed by
7329 .Ql +
7331 .Ql \-
7332 indicates that the window is calculated in relation to the current
7333 position, and a number without a prefix specifies an absolute position.
7335 .It Ic Z
7336 \*(NQ Similar to
7337 .Ic z ,
7338 but scrolls to the next or previous window that contains at least one
7339 .Ql new
7341 .Ic flag Ns
7342 ged message.
7344 .Sh "COMMAND ESCAPES"
7345 Here is a summary of the command escapes available in compose mode,
7346 which are used to perform special functions when composing messages.
7347 Command escapes are only recognized at the beginning of lines, and
7348 consist of a trigger (escape) and a command character.
7349 The actual escape character can be set via the internal variable
7350 .Va escape ,
7351 it defaults to the tilde
7352 .Ql ~ .
7353 Otherwise ignored whitespace characters following the escape character
7354 will prevent a possible addition of the command line to the \*(OPal
7355 history.
7357 Unless otherwise noted all compose mode command escapes ensure proper
7358 updates of the variables which represent the error number
7359 .Va \&!
7360 and the exit status
7361 .Va \&? .
7362 If the variable
7363 .Va errexit
7364 is set they will, unless stated otherwise, error out message compose
7365 mode and cause a progam exit if an operation fails.
7366 It is however possible to place the character hyphen-minus
7367 .Ql -
7368 after (possible whitespace following) the escape character, which has an
7369 effect equivalent to the command modifier
7370 .Cm ignerr .
7371 If the \*(OPal key bindings are available it is possible to create
7372 .Ic bind Ns
7373 ings specifically for the compose mode.
7374 .Bl -tag -width ".It Ic BaNg"
7376 .It Ic ~~ Ar string
7377 Insert the string of text in the message prefaced by a single
7378 .Ql ~ .
7379 (If the escape character has been changed,
7380 that character must be doubled instead.)
7382 .It Ic ~! Ar command
7383 Execute the indicated shell
7384 .Ar command
7385 which follows, replacing unescaped exclamation marks with the previously
7386 executed command if the internal variable
7387 .Va bang
7388 is set, then return to the message.
7390 .It Ic ~.
7391 End compose mode and send the message.
7392 The hooks
7393 .Va on-compose-splice-shell
7395 .Va on-compose-splice ,
7396 in order, will be called when set, after which
7397 .Va askatend
7398 will be checked, a set
7399 .Va on-compose-leave
7400 hook will be called,
7401 .Va autocc
7403 .Va autobcc
7404 will be joined in if set,
7405 .Va asksend
7406 will be honoured in interactive mode, finally a given
7407 .Va message-inject-tail
7408 will be incorporated, after which the compose mode is left.
7410 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
7411 Execute the given \*(UA command.
7412 Not all commands, however, are allowed.
7414 .It Ic ~< Ar filename
7415 Identical to
7416 .Ic ~r .
7418 .It Ic ~<! Ar command
7419 .Ar command
7420 is executed using the shell.
7421 Its standard output is inserted into the message.
7423 .It Ic ~?
7424 Write a summary of command escapes.
7426 .It Ic ~@ Op Ar filename...
7427 Append or edit the list of attachments.
7428 Does not manage the error number
7429 .Va \&!
7430 and the exit status
7431 .Va \&? ,
7432 (please use
7433 .Ic ~^
7434 instead if this is a concern).
7435 A list of
7436 .Ar filename
7437 arguments is expected as shell tokens (see
7438 .Sx "Shell-style argument quoting" ;
7439 token-separating commas are ignored, too), to be
7440 interpreted as documented for the command line option
7441 .Fl a ,
7442 with the message number exception as below.
7444 Without
7445 .Ar filename
7446 arguments the attachment list is edited, entry by entry;
7447 if a filename is left empty, that attachment is deleted from the list;
7448 once the end of the list is reached either new attachments may be
7449 entered or the session can be quit by committing an empty
7450 .Dq new
7451 attachment.
7452 In non-interactive mode or in batch mode
7453 .Pf ( Fl # ) ,
7454 the list of attachments is effectively not edited but instead recreated;
7455 again, an empty input ends list creation.
7457 For all modes, if a given filename solely consists of the number sign
7458 .Ql #
7459 followed by a valid message number of the currently active mailbox, then
7460 the given message is attached as a
7461 .Ql message/rfc822
7462 MIME message part.
7463 The number sign must be quoted to avoid misinterpretation with the shell
7464 comment character.
7466 .It Ic ~| Ar command
7467 Pipe the message through the specified filter command.
7468 If the command gives no output or terminates abnormally,
7469 retain the original text of the message.
7470 E.g., the command
7471 .Xr fmt 1
7472 is often used as a rejustifying filter.
7474 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
7475 Low-level command meant for scripted message access, i.e., for
7476 .Va on-compose-splice
7478 .Va on-compose-splice-shell .
7479 The used protocol is likely subject to changes, and therefore the
7480 mentioned hooks receive the used protocol version as an initial line.
7481 In general the first field of a response line represents a status code
7482 which specifies whether a command was successful or not, whether result
7483 data is to be expected, and if, the format of the result data.
7484 Does not manage the error number
7485 .Va \&!
7486 and the exit status
7487 .Va \&? ,
7488 because errors are reported via the protocol
7489 (hard errors like I/O failures cannot be handled).
7490 This command has read-only access to several virtual pseudo headers in
7491 the \*(UA private namespace, which may not exist (except for the first):
7493 .Bl -tag -compact -width ".It Va BaNg"
7494 .It Ql Mailx-Command:
7495 The name of the command that generates the message, one of
7496 .Ql forward ,
7497 .Ql Lreply ,
7498 .Ql mail ,
7499 .Ql Reply ,
7500 .Ql reply ,
7501 .Ql resend .
7502 .It Ql Mailx-Raw-To:
7503 .It Ql Mailx-Raw-Cc:
7504 .It Ql Mailx-Raw-Bcc:
7505 Represent the frozen initial state of these headers before any
7506 transformation (e.g.,
7507 .Ic alias ,
7508 .Ic alternates ,
7509 .Va recipients-in-cc
7510 etc.) took place.
7511 .It Ql Mailx-Orig-From:
7512 .It Ql Mailx-Orig-To:
7513 .It Ql Mailx-Orig-Cc:
7514 .It Ql Mailx-Orig-Bcc:
7515 The values of said headers of the original message which has been
7516 addressed by any of
7517 .Ic reply , forward , resend .
7520 The status codes are:
7522 .Bl -tag -compact -width ".It Ql 210"
7523 .It Ql 210
7524 Status ok; the remains of the line are the result.
7525 .It Ql 211
7526 Status ok; the rest of the line is optionally used for more status.
7527 What follows are lines of result addresses, terminated by an empty line.
7528 The address lines consist of two fields, the first of which is the
7529 plain address, e.g.,
7530 .Ql bob@exam.ple ,
7531 separated by a single ASCII SP space from the second which contains the
7532 unstripped address, even if that is identical to the first field, e.g.,
7533 .Ql (Lovely) Bob <bob@exam.ple> .
7534 All the input, including the empty line, must be consumed before further
7535 commands can be issued.
7536 .It Ql 212
7537 Status ok; the rest of the line is optionally used for more status.
7538 What follows are lines of furtherly unspecified string content,
7539 terminated by an empty line.
7540 All the input, including the empty line, must be consumed before further
7541 commands can be issued.
7542 .It Ql 500
7543 Syntax error; invalid command.
7544 .It Ql 501
7545 Syntax error in parameters or arguments.
7546 .It Ql 505
7547 Error: an argument fails verification.
7548 For example an invalid address has been specified, or an attempt was
7549 made to modify anything in \*(UA's own namespace.
7550 .It Ql 506
7551 Error: an otherwise valid argument is rendered invalid due to context.
7552 For example, a second address is added to a header which may consist of
7553 a single address only.
7556 If a command indicates failure then the message will have remained
7557 unmodified.
7558 Most commands can fail with
7559 .Ql 500
7560 if required arguments are missing (false command usage).
7561 The following (case-insensitive) commands are supported:
7562 .Bl -hang -width ".It Cm header"
7563 .It Cm header
7564 This command allows listing, inspection, and editing of message headers.
7565 Header name case is not normalized, and case-insensitive comparison
7566 should be used when matching names.
7567 The second argument specifies the subcommand to apply, one of:
7568 .Bl -hang -width ".It Cm remove"
7569 .It Cm list
7570 Without a third argument a list of all yet existing headers is given via
7571 .Ql 210 ;
7572 this command is the default command of
7573 .Cm header
7574 if no second argument has been given.
7575 A third argument restricts output to the given header only, which may
7576 fail with
7577 .Ql 501
7578 if no such field is defined.
7579 .It Cm show
7580 Shows the content of the header given as the third argument.
7581 Dependent on the header type this may respond with
7582 .Ql 211
7584 .Ql 212 ;
7585 any failure results in
7586 .Ql 501 .
7587 .It Cm remove
7588 This will remove all instances of the header given as the third
7589 argument, reporting
7590 .Ql 210
7591 upon success,
7592 .Ql 501
7593 if no such header can be found, and
7594 Ql 505
7595 on \*(UA namespace violations.
7596 .It Cm remove-at
7597 This will remove from the header given as the third argument the
7598 instance at the list position (counting from one!) given with the fourth
7599 argument, reporting
7600 .Ql 210
7601 upon success or
7602 .Ql 505
7603 if the list position argument is not a number or on \*(UA namespace
7604 violations, and
7605 .Ql 501
7606 if no such header instance exists.
7607 .It Cm insert
7608 Create a new or an additional instance of the header given in the third
7609 argument, with the header body content as given in the fourth argument
7610 (the remains of the line).
7611 It may return
7612 .Ql 501
7613 if the third argument specifies a free-form header field name that is
7614 invalid, or if body content extraction fails to succeed,
7615 .Ql 505
7616 if any extracted address does not pass syntax and/or security checks or
7617 on \*(UA namespace violations, and
7618 .Ql 506
7619 to indicate prevention of excessing a single-instance header \(em note that
7620 .Ql Subject:
7621 can be appended to (a space separator will be added automatically first).
7623 .Ql 210
7624 is returned upon success, followed by the name of the header and the list
7625 position of the newly inserted instance.
7626 The list position is always 1 for single-instance header fields.
7627 All free-form header fields are managed in a single list.
7629 .It Cm attachment
7630 This command allows listing, removal and addition of message attachments.
7631 The second argument specifies the subcommand to apply, one of:
7632 .Bl -hang -width ".It Cm remove"
7633 .It Cm list
7634 List all attachments via
7635 .Ql 212 ,
7636 or report
7637 .Ql 501
7638 if no attachments exist.
7639 This command is the default command of
7640 .Cm attachment
7641 if no second argument has been given.
7642 .It Cm remove
7643 This will remove the attachment given as the third argument, and report
7644 .Ql 210
7645 upon success or
7646 .Ql 501
7647 if no such attachment can be found.
7648 If there exists any path component in the given argument, then an exact
7649 match of the path which has been used to create the attachment is used
7650 directly, but if only the basename of that path matches then all
7651 attachments are traversed to find an exact match first, and the removal
7652 occurs afterwards; if multiple basenames match, a
7653 .Ql 506
7654 error occurs.
7655 Message attachments are treated as absolute pathnames.
7657 If no path component exists in the given argument, then all attachments
7658 will be searched for
7659 .Ql filename=
7660 parameter matches as well as for matches of the basename of the path
7661 which has been used when the attachment has been created; multiple
7662 matches result in a
7663 .Ql 506 .
7664 .It Cm remove-at
7665 This will interpret the third argument as a number and remove the
7666 attachment at that list position (counting from one!), reporting
7667 .Ql 210
7668 upon success or
7669 .Ql 505
7670 if the argument is not a number or
7671 .Ql 501
7672 if no such attachment exists.
7673 .It Cm insert
7674 Adds the attachment given as the third argument, specified exactly as
7675 documented for the command line option
7676 .Fl a ,
7677 and supporting the message number extension as documented for
7678 .Ic ~@ .
7679 This reports
7680 .Ql 210
7681 upon success, with the index of the new attachment following,
7682 .Ql 505
7683 if the given file cannot be opened,
7684 .Ql 506
7685 if an on-the-fly performed character set conversion fails, otherwise
7686 .Ql 501
7687 is reported; this is also reported if character set conversion is
7688 requested but not available.
7689 .It Cm attribute
7690 This uses the same search mechanism as described for
7691 .Cm remove
7692 and prints any known attributes of the first found attachment via
7693 .Ql 212
7694 upon success or
7695 .Ql 501
7696 if no such attachment can be found.
7697 The attributes are written as lines of keyword and value tuples, the
7698 keyword being separated from the rest of the line with an ASCII SP space
7699 character.
7700 .It Cm attribute-at
7701 This uses the same search mechanism as described for
7702 .Cm remove-at
7703 and is otherwise identical to
7704 .Cm attribute .
7705 .It Cm attribute-set
7706 This uses the same search mechanism as described for
7707 .Cm remove ,
7708 and will assign the attribute given as the fourth argument, which is
7709 expected to be a value tuple of keyword and other data, separated by
7710 a ASCII SP space or TAB tabulator character.
7711 If the value part is empty, then the given attribute is removed, or
7712 reset to a default value if existence of the attribute is crucial.
7714 It returns via
7715 .Ql 210
7716 upon success, with the index of the found attachment following,
7717 .Ql 505
7718 for message attachments or if the given keyword is invalid, and
7719 .Ql 501
7720 if no such attachment can be found.
7721 The following keywords may be used (case-insensitively):
7723 .Bl -hang -compact -width ".It Ql filename"
7724 .It Ql filename
7725 Sets the filename of the MIME part, i.e., the name that is used for
7726 display and when (suggesting a name for) saving (purposes).
7727 .It Ql content-description
7728 Associate some descriptive information to the attachment's content, used
7729 in favour of the plain filename by some MUAs.
7730 .It Ql content-id
7731 May be used for uniquely identifying MIME entities in several contexts;
7732 this expects a special reference address format as defined in RFC 2045
7733 and generates a
7734 .Ql 505
7735 upon address content verification failure.
7736 .It Ql content-type
7737 Defines the media type/subtype of the part, which is managed
7738 automatically, but can be overwritten.
7739 .It Ql content-disposition
7740 Automatically set to the string
7741 .Ql attachment .
7743 .It Cm attribute-set-at
7744 This uses the same search mechanism as described for
7745 .Cm remove-at
7746 and is otherwise identical to
7747 .Cm attribute-set .
7751 .It Ic ~A
7752 The same as
7753 .Ql Ic ~i Ns \| Va Sign .
7755 .It Ic ~a
7756 The same as
7757 .Ql Ic ~i Ns \| Va sign .
7759 .It Ic ~b Ar name ...
7760 Add the given names to the list of blind carbon copy recipients.
7762 .It Ic ~c Ar name ...
7763 Add the given names to the list of carbon copy recipients.
7765 .It Ic ~d
7766 Read the file specified by the
7767 .Ev DEAD
7768 variable into the message.
7770 .It Ic ~e
7771 Invoke the text editor on the message collected so far.
7772 After the editing session is finished,
7773 the user may continue appending text to the message.
7775 .It Ic ~F Ar messages
7776 Read the named messages into the message being sent, including all
7777 message headers and MIME parts.
7778 If no messages are specified, read in the current message, the
7779 .Dq dot .
7781 .It Ic ~f Ar messages
7782 Read the named messages into the message being sent.
7783 If no messages are specified, read in the current message, the
7784 .Dq dot .
7785 Strips down the list of header fields according to the
7786 .Ql type
7787 white- and blacklist selection of
7788 .Ic headerpick .
7789 For MIME multipart messages,
7790 only the first displayable part is included.
7792 .It Ic ~H
7793 Edit the message header fields
7794 .Ql From: ,
7795 .Ql Reply-To:
7797 .Ql Sender:
7798 by typing each one in turn and allowing the user to edit the field.
7799 The default values for these fields originate from the
7800 .Va from , reply-to
7802 .Va sender
7803 variables.
7805 .It Ic ~h
7806 Edit the message header fields
7807 .Ql To: ,
7808 .Ql Cc: ,
7809 .Ql Bcc:
7811 .Ql Subject:
7812 by typing each one in turn and allowing the user to edit the field.
7814 .It Ic ~I Ar variable
7815 Insert the value of the specified variable into the message.
7816 The message remains unaltered if the variable is unset or empty.
7817 Any embedded character sequences
7818 .Ql \et
7819 horizontal tabulator and
7820 .Ql \en
7821 line feed are expanded in
7822 .Va posix
7823 mode; otherwise the expansion should occur at
7824 .Ic set
7825 time by using the command modifier
7826 .Va wysh .
7828 .It Ic ~i Ar variable
7829 Insert the value of the specified variable followed by a newline
7830 character into the message.
7831 The message remains unaltered if the variable is unset or empty.
7832 Any embedded character sequences
7833 .Ql \et
7834 horizontal tabulator and
7835 .Ql \en
7836 line feed are expanded in
7837 .Va posix
7838 mode; otherwise the expansion should occur at
7839 .Ic set
7840 time by using the command modifier
7841 .Va wysh .
7843 .It Ic ~M Ar messages
7844 Read the named messages into the message being sent,
7845 indented by
7846 .Va indentprefix .
7847 If no messages are specified, read the current message, the
7848 .Dq dot .
7850 .It Ic ~m Ar messages
7851 Read the named messages into the message being sent,
7852 indented by
7853 .Va indentprefix .
7854 If no messages are specified, read the current message, the
7855 .Dq dot .
7856 Strips down the list of header fields according to the
7857 .Ql type
7858 white- and blacklist selection of
7859 .Ic headerpick .
7860 For MIME multipart messages,
7861 only the first displayable part is included.
7863 .It Ic ~p
7864 Display the message collected so far,
7865 prefaced by the message header fields
7866 and followed by the attachment list, if any.
7868 .It Ic ~q
7869 Abort the message being sent,
7870 copying it to the file specified by the
7871 .Ev DEAD
7872 variable if
7873 .Va save
7874 is set.
7876 .It Ic ~R Ar filename
7877 Identical to
7878 .Ic ~r ,
7879 but indent each line that has been read by
7880 .Va indentprefix .
7882 .It Ic ~r Ar filename Op Ar HERE-delimiter
7883 Read the named file, object to the usual
7884 .Sx "Filename transformations" ,
7885 into the message; if (the expanded)
7886 .Ar filename
7887 is the hyphen-minus
7888 .Ql -
7889 then standard input is used, e.g., for pasting purposes.
7890 Only in this latter mode
7891 .Ar HERE-delimiter
7892 may be given: if it is data will be read in until the given
7893 .Ar HERE-delimiter
7894 is seen on a line by itself, and encountering EOF is an error; the
7895 .Ar HERE-delimiter
7896 is a required argument in non-interactive mode; if it is single-quote
7897 quoted then the pasted content will not be expanded, \*(ID otherwise
7898 a future version of \*(UA may perform shell-style expansion on the content.
7900 .It Ic ~s Ar string
7901 Cause the named string to become the current subject field.
7902 Newline (NL) and carriage-return (CR) bytes are invalid and will be
7903 normalized to space (SP) characters.
7905 .It Ic ~t Ar name ...
7906 Add the given name(s) to the direct recipient list.
7908 .It Ic ~U Ar messages
7909 Read in the given / current message(s) excluding all headers, indented by
7910 .Va indentprefix .
7912 .It Ic ~u Ar messages
7913 Read in the given / current message(s), excluding all headers.
7915 .It Ic ~v
7916 Invoke an alternate editor (defined by the
7917 .Ev VISUAL
7918 environment variable) on the message collected so far.
7919 Usually, the alternate editor will be a screen editor.
7920 After the editor is quit,
7921 the user may resume appending text to the end of the message.
7923 .It Ic ~w Ar filename
7924 Write the message onto the named file, which is object to the usual
7925 .Sx "Filename transformations" .
7926 If the file exists,
7927 the message is appended to it.
7929 .It Ic ~x
7930 Same as
7931 .Ic ~q ,
7932 except that the message is not saved at all.
7934 .Sh "INTERNAL VARIABLES"
7935 Internal \*(UA variables are controlled via the
7936 .Ic set
7938 .Ic unset
7939 commands; prefixing a variable name with the string
7940 .Ql no
7941 and calling
7942 .Ic set
7943 has the same effect as using
7944 .Ic unset :
7945 .Ql unset crt
7947 .Ql set nocrt
7948 do the same thing.
7949 Creation or editing of variables can be performed in the
7950 .Ev EDITOR
7951 with the command
7952 .Ic varedit .
7953 .Ic varshow
7954 will give more insight on the given variable(s), and
7955 .Ic set ,
7956 when called without arguments, will show a listing of all variables.
7957 Both commands support a more
7958 .Va verbose
7959 listing mode.
7960 Some well-known variables will also become inherited from the
7961 program
7962 .Sx ENVIRONMENT
7963 implicitly, others can be imported explicitly with the command
7964 .Ic environ
7965 and henceforth share said properties.
7967 Two different kinds of internal variables exist, and both of which can
7968 also form chains.
7969 There are boolean variables, which can only be in one of the two states
7970 .Dq set
7972 .Dq unset ,
7973 and value variables with a(n optional) string value.
7974 For the latter proper quoting is necessary upon assignment time, the
7975 introduction of the section
7976 .Sx COMMANDS
7977 documents the supported quoting rules.
7978 .Bd -literal -offset indent
7979 ? wysh set one=val\e 1 two="val 2" \e
7980     three='val "3"' four=$'val \e'4\e''; \e
7981     varshow one two three four; \e
7982     unset one two three four
7985 Dependent upon the actual option string values may become interpreted as
7986 colour names, command specifications, normal text, etc.
7987 They may be treated as numbers, in which case decimal values are
7988 expected if so documented, but otherwise any numeric format and
7989 base that is valid and understood by the
7990 .Ic vexpr
7991 command may be used, too.
7993 There also exists a special kind of string value, the
7994 .Dq boolean string ,
7995 which must either be a decimal integer (in which case
7996 .Ql 0
7997 is false and
7998 .Ql 1
7999 and any other value is true) or any of the (case-insensitive) strings
8000 .Ql off ,
8001 .Ql no ,
8002 .Ql n
8004 .Ql false
8005 for a false boolean and
8006 .Ql on ,
8007 .Ql yes ,
8008 .Ql y
8010 .Ql true
8011 for a true boolean; a special kind of boolean string is the
8012 .Dq quadoption ,
8013 which is a boolean string that can optionally be prefixed with the
8014 (case-insensitive) term
8015 .Ql ask- ,
8016 as in
8017 .Ql ask-yes ,
8018 which causes prompting of the user in interactive mode, with the given
8019 boolean as the default value.
8021 Variable chains extend a plain
8022 .Ql variable
8023 with
8024 .Ql variable-HOST
8026 .Ql variable-USER@HOST
8027 variants.
8028 Here
8029 .Ql HOST
8030 indeed means
8031 .Ql server:port
8032 if a
8033 .Ql port
8034 had been specified in the contextual Uniform Resource Locator URL, see
8035 .Sx "On URL syntax and credential lookup" .
8036 Even though this mechanism is based on URLs no URL percent encoding may
8037 be applied to neither of
8038 .Ql USER
8040 .Ql HOST ,
8041 variable chains need to be specified using raw data;
8042 the mentioned section contains examples.
8043 Variables which support chains are explicitly documented as such, and
8044 \*(UA treats the base name of any such variable special, meaning that
8045 users should not create custom names like
8046 .Ql variable-xyz
8047 in order to avoid false classifications and treatment of such variables.
8048 .Ss "Initial settings"
8049 The standard POSIX 2008/Cor 2-2016 mandates the following initial
8050 variable settings:
8051 .Pf no Va allnet ,
8052 .Pf no Va append ,
8053 .Va asksub ,
8054 .Pf no Va askbcc ,
8055 .Pf no Va autoprint ,
8056 .Pf no Va bang ,
8057 .Pf no Va cmd ,
8058 .Pf no Va crt ,
8059 .Pf no Va debug ,
8060 .Pf no Va dot ,
8061 .Va escape
8062 set to
8063 .Ql ~ ,
8064 .Pf no Va flipr ,
8065 .Pf no Va folder ,
8066 .Va header ,
8067 .Pf no Va hold ,
8068 .Pf no Va ignore ,
8069 .Pf no Va ignoreeof ,
8070 .Pf no Va keep ,
8071 .Pf no Va keepsave ,
8072 .Pf no Va metoo ,
8073 .Pf no Va outfolder ,
8074 .Pf no Va page ,
8075 .Va prompt
8076 set to
8077 .Ql ?\0 ,
8078 .Pf no Va quiet ,
8079 .Pf no Va record ,
8080 .Va save ,
8081 .Pf no Va sendwait ,
8082 .Pf no Va showto ,
8083 .Pf no Va Sign ,
8084 .Pf no Va sign ,
8085 .Va toplines
8086 set to
8087 .Ql 5 .
8089 Notes: \*(UA does not support the
8090 .Pf no Va onehop
8091 variable \(en use command line options or
8092 .Va mta-arguments
8093 to pass options through to a
8094 .Va mta .
8095 And the default global
8096 .Pa \*(UR
8097 file, which is loaded unless the
8098 .Fl \&:
8099 (with according argument) or
8100 .Fl n
8101 command line options have been used, or the
8102 .Ev MAILX_NO_SYSTEM_RC
8103 environment variable is set (see
8104 .Sx "Resource files" )
8105 bends those initial settings a bit, e.g., it sets the variables
8106 .Va hold ,
8107 .Va keepsave
8109 .Va keep ,
8110 to name a few, establishes a default
8111 .Ic headerpick
8112 selection etc., and should thus be taken into account.
8113 .Ss "Variables"
8114 .Bl -tag -width ".It Va BaNg"
8116 .It Va \&?
8117 \*(RO The exit status of the last command, or the
8118 .Ic return
8119 value of the macro
8120 .Ic call Ns
8121 ed last.
8122 This status has a meaning in the state machine: in conjunction with
8123 .Va errexit
8124 any non-0 exit status will cause a program exit, and in
8125 .Va posix
8126 mode any error while loading (any of the) resource files will have the
8127 same effect.
8128 .Cm ignerr ,
8129 one of the
8130 .Sx "Command modifiers" ,
8131 can be used to instruct the state machine to ignore errors.
8133 .It Va \&!
8134 \*(RO The current error number
8135 .Pf ( Xr errno 3 ) ,
8136 which is set after an error occurred; it is also available via
8137 .Va ^ERR ,
8138 and the error name and documentation string can be queried via
8139 .Va ^ERRNAME
8141 .Va ^ERRDOC .
8142 \*(ID This machinery is new and the error number is only really usable
8143 if a command explicitly states that it manages the variable
8144 .Va \&! ,
8145 for others errno will be used in case of errors, or
8146 .Va ^ERR Ns -INVAL
8147 if that is 0: it thus may or may not reflect the real error.
8148 The error number may be set with the command
8149 .Ic return .
8151 .It Va ^
8152 \*(RO This is a multiplexer variable which performs dynamic expansion of
8153 the requested state or condition, of which there are:
8155 .Bl -tag -compact -width ".It Va BaNg"
8159 .It Va ^ERR , ^ERRDOC , ^ERRNAME
8160 The number, documentation, and name of the current
8161 .Xr errno 3 ,
8162 respectively, which is usually set after an error occurred.
8163 \*(ID This machinery is new and is usually reliable only if a command
8164 explicitly states that it manages the variable
8165 .Va \&! ,
8166 which is effectively identical to
8167 .Va \&\&^ERR .
8168 Each of those variables can be suffixed with a hyphen minus followed by
8169 a name or number, in which case the expansion refers to the given error.
8170 Note this is a direct mapping of (a subset of) the system error values:
8171 .Bd -literal -offset indent
8172 define work {
8173   eval echo \e$1: \e$^ERR-$1:\e
8174     \e$^ERRNAME-$1: \e$^ERRDOC-$1
8175   vput vexpr i + "$1" 1
8176   if [ $i -lt 16 ]
8177     \excall work $i
8178   end
8180 call work 0
8184 .It Va *
8185 \*(RO Expands all positional parameters (see
8186 .Va 1 ) ,
8187 separated by the first character of the value of
8188 .Va ifs .
8189 \*(ID The special semantics of the equally named special parameter of the
8190 .Xr sh 1
8191 are not yet supported.
8193 .It Va @
8194 \*(RO Expands all positional parameters (see
8195 .Va 1 ) ,
8196 separated by a space character.
8197 If placed in double quotation marks, each positional parameter is
8198 properly quoted to expand to a single parameter again.
8200 .It Va #
8201 \*(RO Expands to the number of positional parameters, i.e., the size of
8202 the positional parameter stack in decimal.
8204 .It Va \&0
8205 \*(RO Inside the scope of a
8206 .Ic define Ns
8207 d and
8208 .Ic call Ns
8209 ed macro this expands to the name of the calling macro, or to the empty
8210 string if the macro is running from top-level.
8211 For the \*(OPal regular expression search and replace operator of
8212 .Ic vexpr
8213 this expands to the entire matching expression.
8214 It represents the program name in global context.
8216 .It Va 1
8217 \*(RO Access of the positional parameter stack.
8218 All further parameters can be accessed with this syntax, too, e.g.,
8219 .Ql 2 ,
8220 .Ql 3
8221 etc.; positional parameters can be shifted off the stack by calling
8222 .Ic shift .
8223 The parameter stack contains, e.g., the arguments of a
8224 .Ic call Ns
8226 .Ic define Ns
8227 d macro, the matching groups of the \*(OPal regular expression search
8228 and replace expression of
8229 .Ic vexpr ,
8230 and can be explicitly created or overwritten with the command
8231 .Ic vpospar .
8233 .It Va account
8234 \*(RO Is set to the active
8235 .Ic account .
8237 .It Va add-file-recipients
8238 \*(BO When file or pipe recipients have been specified,
8239 mention them in the corresponding address fields of the message instead
8240 of silently stripping them from their recipient list.
8241 By default such addressees are not mentioned.
8243 .It Va allnet
8244 \*(BO Causes only the local part to be evaluated
8245 when comparing addresses.
8247 .It Va append
8248 \*(BO Causes messages saved in the
8249 .Mx -sx
8250 .Sx "secondary mailbox"
8251 .Ev MBOX
8252 to be appended to the end rather than prepended.
8253 This should always be set.
8255 .It Va askatend
8256 \*(BO Causes the prompts for
8257 .Ql Cc:
8259 .Ql Bcc:
8260 lists to appear after the message has been edited.
8262 .It Va askattach
8263 \*(BO If set, \*(UA asks for files to attach at the end of each message.
8264 An empty line finalizes the list.
8266 .It Va askcc
8267 \*(BO Causes the user to be prompted for carbon copy recipients
8268 (at the end of each message if
8269 .Va askatend
8271 .Va bsdcompat
8272 are set).
8274 .It Va askbcc
8275 \*(BO Causes the user to be prompted for blind carbon copy
8276 recipients (at the end of each message if
8277 .Va askatend
8279 .Va bsdcompat
8280 are set).
8282 .It Va asksend
8283 \*(BO Causes the user to be prompted for confirmation to send the
8284 message or reenter compose mode after having been shown an envelope
8285 summary.
8286 This is by default enabled.
8288 .It Va asksign
8289 \*(BO\*(OP Causes the user to be prompted if the message is to be
8290 signed at the end of each message.
8292 .Va smime-sign
8293 variable is ignored when this variable is set.
8295 .It Va asksub
8296 \*(BO Causes \*(UA to prompt for the subject upon entering compose mode
8297 unless a subject already exists.
8299 .It Va attrlist
8300 A sequence of characters to display in the
8301 .Ql attribute
8302 column of the
8303 .Va headline
8304 as shown in the display of
8305 .Ic headers ;
8306 each for one type of messages (see
8307 .Sx "Message states" ) ,
8308 with the default being
8309 .Ql NUROSPMFAT+\-$~
8311 .Ql NU\ \ *HMFAT+\-$~
8312 if the
8313 .Va bsdflags
8314 variable is set, in the following order:
8316 .Bl -tag -compact -width ".It Ql _"
8317 .It Ql N
8318 new.
8319 .It Ql U
8320 unread but old.
8321 .It Ql R
8322 new but read.
8323 .It Ql O
8324 read and old.
8325 .It Ql S
8326 saved.
8327 .It Ql P
8328 preserved.
8329 .It Ql M
8330 mboxed.
8331 .It Ql F
8332 flagged.
8333 .It Ql A
8334 answered.
8335 .It Ql T
8336 draft.
8337 .It Ql +
8338 start of a collapsed thread.
8339 .It Ql -
8340 an uncollapsed thread (TODO ignored for now).
8341 .It Ql $
8342 classified as spam.
8343 .It Ql ~
8344 classified as possible spam.
8347 .It Va autobcc
8348 Specifies a list of recipients to which a blind carbon copy of each
8349 outgoing message will be sent automatically.
8351 .It Va autocc
8352 Specifies a list of recipients to which a carbon copy of each outgoing
8353 message will be sent automatically.
8355 .It Va autocollapse
8356 \*(BO Causes threads to be collapsed automatically when threaded mode
8357 is entered (see the
8358 .Ic collapse
8359 command).
8361 .It Va autoprint
8362 \*(BO Enable automatic
8363 .Ic type Ns
8364 ing of a(n existing)
8365 .Dq successive
8366 message after
8367 .Ic delete
8369 .Ic undelete
8370 commands, e.g., the message that becomes the new
8371 .Dq dot
8372 is shown automatically, as via
8373 .Ic dp
8375 .Ic dt .
8377 .It Va autosort
8378 Causes sorted mode (see the
8379 .Ic sort
8380 command) to be entered automatically with the value of this variable as
8381 sorting method when a folder is opened, e.g.,
8382 .Ql set autosort=thread .
8384 .It Va bang
8385 \*(BO Enables the substitution of all not (reverse-solidus) escaped
8386 exclamation mark
8387 .Ql \&!
8388 characters by the contents of the last executed command for the
8389 .Ic \&!
8390 shell escape command and
8391 .Ic ~! ,
8392 one of the compose mode
8393 .Sx "COMMAND ESCAPES" .
8394 If this variable is not set no reverse solidus stripping is performed.
8396 .It Va bind-timeout
8397 \*(OP Terminals generate multi-byte sequences for certain forms of
8398 input, for example for function and other special keys.
8399 Some terminals however do not write these multi-byte sequences as
8400 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
8401 This variable specifies the timeout in milliseconds that the MLE (see
8402 .Sx "On terminal control and line editor" )
8403 waits for more bytes to arrive unless it considers a sequence
8404 .Dq complete .
8405 The default is 200.
8407 .It Va bsdcompat
8408 \*(BO Sets some cosmetical features to traditional BSD style;
8409 has the same affect as setting
8410 .Va askatend
8411 and all other variables prefixed with
8412 .Ql bsd ;
8413 it also changes the behaviour of
8414 .Va emptystart
8415 (which does not exist in BSD).
8417 .It Va bsdflags
8418 \*(BO Changes the letters shown in the first column of a header
8419 summary to traditional BSD style.
8421 .It Va bsdheadline
8422 \*(BO Changes the display of columns in a header summary to traditional
8423 BSD style.
8425 .It Va bsdmsgs
8426 \*(BO Changes some informational messages to traditional BSD style.
8428 .It Va bsdorder
8429 \*(BO Causes the
8430 .Ql Subject:
8431 field to appear immediately after the
8432 .Ql To:
8433 field in message headers and with the
8434 .Ic ~h
8435 .Sx "COMMAND ESCAPES" .
8438 .It Va build-os , build-osenv
8439 \*(RO The operating system \*(UA has been build for, usually taken from
8440 .Xr uname 1
8442 .Ql uname -s
8444 .Ql uname -srm ,
8445 respectively, the former being lowercased.
8447 .It Va charset-7bit
8448 The value that should appear in the
8449 .Ql charset=
8450 parameter of
8451 .Ql Content-Type:
8452 MIME header fields when no character set conversion of the message data
8453 was performed.
8454 This defaults to US-ASCII, and the chosen character set should be
8455 US-ASCII compatible.
8457 .It Va charset-8bit
8458 \*(OP The default 8-bit character set that is used as an implicit last
8459 member of the variable
8460 .Va sendcharsets .
8461 This defaults to UTF-8 if character set conversion capabilities are
8462 available, and to ISO-8859-1 otherwise, in which case the only supported
8463 character set is
8464 .Va ttycharset
8465 and this variable is effectively ignored.
8466 Refer to the section
8467 .Sx "Character sets"
8468 for the complete picture of character set conversion in \*(UA.
8470 .It Va charset-unknown-8bit
8471 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
8472 .Dq upgrade
8473 the content of a mail message by using a character set with the name
8474 .Ql unknown-8bit .
8475 Because of the unclassified nature of this character set \*(UA will not
8476 be capable to convert this character set to any other character set.
8477 If this variable is set any message part which uses the character set
8478 .Ql unknown-8bit
8479 is assumed to really be in the character set given in the value,
8480 otherwise the (final) value of
8481 .Va charset-8bit
8482 is used for this purpose.
8484 This variable will also be taken into account if a MIME type (see
8485 .Sx "The mime.types files" )
8486 of a MIME message part that uses the
8487 .Ql binary
8488 character set is forcefully treated as text.
8490 .It Va cmd
8491 The default value for the
8492 .Ic pipe
8493 command.
8495 .It Va colour-disable
8496 \*(BO\*(OP Forcefully disable usage of colours.
8497 Also see the section
8498 .Sx "Coloured display" .
8500 .It Va colour-pager
8501 \*(BO\*(OP Whether colour shall be used for output that is paged through
8502 .Ev PAGER .
8503 Note that pagers may need special command line options, e.g.,
8504 .Xr less 1
8505 requires the option
8506 .Fl \&\&R
8508 .Xr lv 1
8509 the option
8510 .Fl \&\&c
8511 in order to support colours.
8512 Often doing manual adjustments is unnecessary since \*(UA may perform
8513 adjustments dependent on the value of the environment variable
8514 .Ev PAGER
8515 (see there for more).
8518 .It Va contact-mail , contact-web
8519 \*(RO Addresses for contact per email and web, respectively, e.g., for
8520 bug reports, suggestions, or help regarding \*(UA.
8521 The former can be used directly:
8522 .Ql ? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
8524 .It Va crt
8525 In a(n interactive) terminal session, then if this valued variable is
8526 set it will be used as a threshold to determine how many lines the given
8527 output has to span before it will be displayed via the configured
8528 .Ev PAGER ;
8529 Usage of the
8530 .Ev PAGER
8531 can be forced by setting this to the value
8532 .Ql 0 ,
8533 setting it without a value will deduce the current height of the
8534 terminal screen to compute the threshold (see
8535 .Ev LINES ,
8536 .Va screen
8538 .Xr stty 1 ) .
8539 \*(ID At the moment this uses the count of lines of the message in wire
8540 format, which, dependent on the
8541 .Va mime-encoding
8542 of the message, is unrelated to the number of display lines.
8543 (The software is old and historically the relation was a given thing.)
8545 .It Va customhdr
8546 Define a set of custom headers to be injected into newly composed or
8547 forwarded messages.
8548 A custom header consists of the field name followed by a colon
8549 .Ql \&:
8550 and the field content body.
8551 Standard header field names cannot be overwritten by a custom header.
8552 Different to the command line option
8553 .Fl C
8554 the variable value is interpreted as a comma-separated list of custom
8555 headers: to include commas in header bodies they need to become escaped
8556 with reverse solidus
8557 .Ql \e .
8558 Headers can be managed more freely in compose mode via
8559 .Ic ~^ .
8561 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
8563 .It Va datefield
8564 Controls the appearance of the
8565 .Ql %d
8566 date and time format specification of the
8567 .Va headline
8568 variable, that is used, for example, when viewing the summary of
8569 .Ic headers .
8570 If unset, then the local receiving date is used and displayed
8571 unformatted, otherwise the message sending
8572 .Ql Date: .
8573 It is possible to assign a
8574 .Xr strftime 3
8575 format string and control formatting, but embedding newlines via the
8576 .Ql %n
8577 format is not supported, and will result in display errors.
8578 The default is
8579 .Ql %Y-%m-%d %H:%M ,
8580 and also see
8581 .Va datefield-markout-older .
8583 .It Va datefield-markout-older
8584 Only used in conjunction with
8585 .Va datefield .
8586 Can be used to create a visible distinction of messages dated more than
8587 a day in the future, or older than six months, a concept comparable to the
8588 .Fl \&\&l
8589 option of the POSIX utility
8590 .Xr ls 1 .
8591 If set to the empty string, then the plain month, day and year of the
8592 .Ql Date:
8593 will be displayed, but a
8594 .Xr strftime 3
8595 format string to control formatting can be assigned.
8596 The default is
8597 .Ql %Y-%m-%d .
8599 .It Va debug
8600 \*(BO Enables debug messages and obsoletion warnings, disables the
8601 actual delivery of messages and also implies
8602 .Pf no Va record
8603 as well as
8604 .Pf no Va save .
8606 .It Va disposition-notification-send
8607 \*(BO\*(OP Emit a
8608 .Ql Disposition-Notification-To:
8609 header (RFC 3798) with the message.
8610 This requires the
8611 .Va from
8612 variable to be set.
8614 .It Va dot
8615 \*(BO When dot is set, a period
8616 .Ql \&.
8617 on a line by itself during message input in (interactive or batch
8618 .Fl # )
8619 compose mode will be treated as end-of-message (in addition to the
8620 normal end-of-file condition).
8621 This behaviour is implied in
8622 .Va posix
8623 mode with a set
8624 .Va ignoreeof .
8626 .It Va dotlock-ignore-error
8627 \*(BO\*(OP Synchronization of mailboxes which \*(UA treats as
8628 .Mx -sx
8629 .Sx "primary system mailbox" Ns
8630 es (see, e.g., the notes on
8631 .Sx "Filename transformations" ,
8632 as well as the documentation of
8633 .Ic file )
8634 will be protected with so-called dotlock files\(emthe traditional mail
8635 spool file locking method\(emin addition to system file locking.
8636 Because \*(UA ships with a privilege-separated dotlock creation program
8637 that should always be able to create such a dotlock file there is no
8638 good reason to ignore dotlock file creation errors, and thus these are
8639 fatal unless this variable is set.
8641 .It Va editalong
8642 \*(BO If this variable is set then the editor is started automatically
8643 when a message is composed in interactive mode, as if the
8644 .Ic ~e
8645 .Sx "COMMAND ESCAPES"
8646 had been specified.
8648 .Va editheaders
8649 variable is implied for this automatically spawned editor session.
8651 .It Va editheaders
8652 \*(BO When a message is edited while being composed,
8653 its header is included in the editable text.
8655 .It Va emptystart
8656 \*(BO When entering interactive mode \*(UA normally writes
8657 .Dq \&No mail for user
8658 and exits immediately if a mailbox is empty or does not exist.
8659 If this variable is set \*(UA starts even with an empty or non-existent
8660 mailbox (the latter behaviour furtherly depends upon
8661 .Va bsdcompat ,
8662 though).
8664 .It Va errexit
8665 \*(BO Let each command with a non-0 exit status, including every
8666 .Ic call Ns
8667 ed macro which
8668 .Ic return Ns
8669 s a non-0 status, cause a program exit unless prefixed by
8670 .Cm ignerr
8671 (see
8672 .Sx "Command modifiers" ) .
8673 This also affects
8674 .Sx "COMMAND ESCAPES" ,
8675 but which use a different modifier for ignoring the error.
8676 Please refer to the variable
8677 .Va \&?
8678 for more on this topic.
8680 .It Va escape
8681 The first character of this value defines the escape character for
8682 .Sx "COMMAND ESCAPES"
8683 in compose mode.
8684 The default value is the character tilde
8685 .Ql ~ .
8686 If set to the empty string, command escapes are disabled.
8688 .It Va expandaddr
8689 If not set then file and command pipeline targets are not allowed,
8690 and any such address will be filtered out, giving a warning message.
8691 If set without a value then all possible recipient address
8692 specifications will be accepted \(en see the section
8693 .Sx "On sending mail, and non-interactive mode"
8694 for more on this.
8695 To accept them, but only in interactive mode, or when tilde commands
8696 were enabled explicitly by using one of the command line options
8697 .Fl ~
8699 .Fl # ,
8700 set this to the (case-insensitive) value
8701 .Ql restrict
8702 (it actually acts like
8703 .Ql restrict,-all,+name,+addr ,
8704 so that care for ordering issues must be taken) .
8706 In fact the value is interpreted as a comma-separated list of values.
8707 If it contains
8708 .Ql fail
8709 then the existence of disallowed specifications is treated as a hard
8710 send error instead of only filtering them out.
8711 The remaining values specify whether a specific type of recipient
8712 address specification is allowed (optionally indicated by a plus sign
8713 .Ql +
8714 prefix) or disallowed (prefixed with a hyphen-minus
8715 .Ql - ) .
8716 The value
8717 .Ql all
8718 addresses all possible address specifications,
8719 .Ql file
8720 file targets,
8721 .Ql pipe
8722 command pipeline targets,
8723 .Ql name
8724 plain user names and (MTA) aliases and
8725 .Ql addr
8726 network addresses.
8727 These kind of values are interpreted in the given order, so that
8728 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
8729 will cause hard errors for any non-network address recipient address
8730 unless \*(UA is in interactive mode or has been started with the
8731 .Fl ~
8733 .Fl #
8734 command line option; in the latter case(s) any address may be used, then.
8736 Historically invalid network addressees are silently stripped off.
8737 To change this so that any encountered invalid email address causes
8738 a hard error it must be ensured that
8739 .Ql failinvaddr
8740 is an entry in the above list.
8741 Setting this automatically enables network addressees
8742 (it actually acts like
8743 .Ql failinvaddr,+addr ,
8744 so that care for ordering issues must be taken) .
8746 .It Va expandargv
8747 Unless this variable is set additional
8748 .Va mta
8749 (Mail-Transfer-Agent)
8750 arguments from the command line, as can be given after a
8751 .Fl \&\&-
8752 separator, results in a program termination with failure status.
8753 The same can be accomplished by using the special (case-insensitive) value
8754 .Ql fail .
8755 A lesser strict variant is the otherwise identical
8756 .Ql restrict ,
8757 which does accept such arguments in interactive mode, or if tilde
8758 commands were enabled explicitly by using one of the command line options
8759 .Fl ~
8761 .Fl # .
8762 The empty value will allow unconditional usage.
8764 .It Va features
8765 \*(RO String giving a list of optional features.
8766 Features are preceded with a plus sign
8767 .Ql +
8768 if they are available, with a hyphen-minus
8769 .Ql -
8770 otherwise.
8771 The output of the command
8772 .Ic version
8773 will include this information in a more pleasant output.
8775 .It Va flipr
8776 \*(BO This setting reverses the meanings of a set of reply commands,
8777 turning the lowercase variants, which by default address all recipients
8778 included in the header of a message
8779 .Pf ( Ic reply , respond , followup )
8780 into the uppercase variants, which by default address the sender only
8781 .Pf ( Ic Reply , Respond , Followup )
8782 and vice versa.
8783 The commands
8784 .Ic replysender , respondsender , followupsender
8785 as well as
8786 .Ic replyall , respondall , followupall
8787 are not affected by the current setting of
8788 .Va flipr .
8790 .It Va folder
8791 The default path under which mailboxes are to be saved:
8792 filenames that begin with the plus sign
8793 .Ql +
8794 will have the plus sign replaced with the value of this variable if set,
8795 otherwise the plus sign will remain unchanged when doing
8796 .Sx "Filename transformations" ;
8797 also see
8798 .Ic file
8799 for more on this topic.
8800 The value supports a subset of transformations itself, and if the
8801 non-empty value does not start with a solidus
8802 .Ql / ,
8803 then the value of
8804 .Ev HOME
8805 will be prefixed automatically.
8806 Once the actual value is evaluated first, the internal variable
8807 .Va folder-resolved
8808 will be updated for caching purposes.
8809 .Mx Va folder-hook
8810 .It Va folder-hook-FOLDER , Va folder-hook
8811 Names a
8812 .Ic define Ns d
8813 macro which will be called whenever a
8814 .Ic file
8815 is opened.
8816 The macro will also be invoked when new mail arrives,
8817 but message lists for commands executed from the macro
8818 only include newly arrived messages then.
8819 .Ic localopts
8820 are activated by default in a folder hook, causing the covered settings
8821 to be reverted once the folder is left again.
8823 The specialized form will override the generic one if
8824 .Ql FOLDER
8825 matches the file that is opened.
8826 Unlike other folder specifications, the fully expanded name of a folder,
8827 without metacharacters, is used to avoid ambiguities.
8828 However, if the mailbox resides under
8829 .Va folder
8830 then the usual
8831 .Ql +
8832 specification is tried in addition, e.g., if
8833 .Va \&\&folder
8835 .Dq mail
8836 (and thus relative to the user's home directory) then
8837 .Pa /home/usr1/mail/sent
8838 will be tried as
8839 .Ql folder-hook-/home/usr1/mail/sent
8840 first, but then followed by
8841 .Ql folder-hook-+sent .
8843 .It Va folder-resolved
8844 \*(RO Set to the fully resolved path of
8845 .Va folder
8846 once that evaluation has occurred; rather internal.
8848 .It Va followup-to
8849 \*(BO Controls whether a
8850 .Ql Mail-Followup-To:
8851 header is generated when sending messages to known mailing lists.
8852 Also see
8853 .Va followup-to-honour
8854 and the commands
8855 .Ic mlist , mlsubscribe , reply
8857 .Ic Lreply .
8859 .It Va followup-to-honour
8860 Controls whether a
8861 .Ql Mail-Followup-To:
8862 header is honoured when group-replying to a message via
8863 .Ic reply
8865 .Ic Lreply .
8866 This is a quadoption; if set without a value it defaults to
8867 .Dq yes .
8868 Also see
8869 .Va followup-to
8870 and the commands
8871 .Ic mlist
8873 .Ic mlsubscribe .
8875 .It Va forward-as-attachment
8876 \*(BO Original messages are normally sent as inline text with the
8877 .Ic forward
8878 command,
8879 and only the first part of a multipart message is included.
8880 With this setting enabled messages are sent as unmodified MIME
8881 .Ql message/rfc822
8882 attachments with all of their parts included.
8884 .It Va forward-inject-head
8885 The string to put before the text of a message with the
8886 .Ic forward
8887 command instead of the default
8888 .Dq -------- Original Message -------- .
8889 No heading is put if it is set to the empty string.
8890 This variable is ignored if the
8891 .Va forward-as-attachment
8892 variable is set.
8894 .It Va from
8895 The address (or a list of addresses) to put into the
8896 .Ql From:
8897 field of the message header, quoting RFC 5322:
8898 the author(s) of the message, that is, the mailbox(es) of the person(s)
8899 or system(s) responsible for the writing of the message.
8900 According to that RFC setting the
8901 .Va sender
8902 variable is required if
8903 .Va \&\&from
8904 contains more than one address.
8905 When
8906 .Ic reply Ns
8907 ing to messages these addresses are handled as if they were in the
8908 .Ic alternates
8909 list.
8911 If a file-based MTA is used, then
8912 .Va \&\&from
8913 (or, if that contains multiple addresses,
8914 .Va sender )
8915 can nonetheless be enforced to appear as the envelope sender address at
8916 the MTA protocol level (the RFC 5321 reverse-path), either by using the
8917 .Fl r
8918 command line option (with an empty argument; see there for the complete
8919 picture on this topic), or by setting the internal variable
8920 .Va r-option-implicit .
8922 If the machine's hostname is not valid at the Internet (for example at
8923 a dialup machine) then either this variable or
8924 .Va hostname
8925 (\*(IN a SMTP-based
8926 .Va mta
8927 adds even more fine-tuning capabilities with
8928 .Va smtp-hostname ) ,
8929 have to be set; if so the message and MIME part related unique ID fields
8930 .Ql Message-ID:
8932 .Ql Content-ID:
8933 will be created (except when disallowed by
8934 .Va message-id-disable
8936 .Va stealthmua ) .
8938 .It Va fullnames
8939 \*(BO Due to historical reasons comments and name parts of email
8940 addresses are removed by default when sending mail, replying to or
8941 forwarding a message.
8942 If this variable is set such stripping is not performed.
8943 .It Va fwdheading
8944 \*(OB Predecessor of
8945 .Va forward-inject-head .
8947 .It Va header
8948 \*(BO Causes the header summary to be written at startup and after
8949 commands that affect the number of messages or the order of messages in
8950 the current
8951 .Ic folder .
8952 Unless in
8953 .Va posix
8954 mode a header summary will also be displayed on folder changes.
8955 The command line option
8956 .Fl N
8957 can be used to set
8958 .Pf no Va header .
8960 .It Va headline
8961 A format string to use for the summary of
8962 .Ic headers ,
8963 similar to the ones used for
8964 .Xr printf 3
8965 formats.
8966 Format specifiers in the given string start with a percent sign
8967 .Ql %
8968 and may be followed by an optional decimal number indicating the field
8969 width \(em if that is negative, the field is to be left-aligned.
8970 Valid format specifiers are:
8972 .Bl -tag -compact -width ".It Ql _%%_"
8973 .It Ql %%
8974 A plain percent sign.
8975 .It Ql %>
8976 .Dq Dotmark :
8977 a space character but for the current message
8978 .Pf ( Dq dot ) ,
8979 for which it expands to
8980 .Ql >
8981 (dependent on
8982 .Va headline-plain ) .
8983 .It Ql %<
8984 .Dq Dotmark :
8985 a space character but for the current message
8986 .Pf ( Dq dot ) ,
8987 for which it expands to
8988 .Ql <
8989 (dependent on
8990 .Va headline-plain ) .
8991 .It Ql %$
8992 \*(OP The spam score of the message, as has been classified via the
8993 command
8994 .Ic spamrate .
8995 Shows only a replacement character if there is no spam support.
8996 .It Ql %a
8997 Message attribute character (status flag); the actual content can be
8998 adjusted by setting
8999 .Va attrlist .
9000 .It Ql %d
9001 The date found in the
9002 .Ql From:
9003 header of the message when
9004 .Va datefield
9005 is set (the default), otherwise the date when the message was received.
9006 Formatting can be controlled by assigning a
9007 .Xr strftime 3
9008 format string to
9009 .Va datefield .
9010 .It Ql %e
9011 The indenting level in threaded mode.
9012 .It Ql %f
9013 The address of the message sender.
9014 .It Ql %i
9015 The message thread tree structure.
9016 (Note that this format does not support a field width, and honours
9017 .Va headline-plain . )
9018 .It Ql %l
9019 The number of lines of the message, if available.
9020 .It Ql %m
9021 Message number.
9022 .It Ql %o
9023 The number of octets (bytes) in the message, if available.
9024 .It Ql %s
9025 Message subject (if any).
9026 .It Ql %S
9027 Message subject (if any) in double quotes.
9028 .It Ql \&%T
9029 Message recipient flags: is the addressee of the message a known or
9030 subscribed mailing list \(en see
9031 .Ic mlist
9033 .Ic mlsubscribe .
9034 .It Ql %t
9035 The position in threaded/sorted order.
9038 The default is
9039 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
9041 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
9043 .Va bsdcompat
9044 is set.
9045 Also see
9046 .Va attrlist ,
9047 .Va headline-plain
9049 .Va headline-bidi .
9051 .It Va headline-bidi
9052 Bidirectional text requires special treatment when displaying headers,
9053 because numbers (in dates or for file sizes etc.) will not affect the
9054 current text direction, in effect resulting in ugly line layouts when
9055 arabic or other right-to-left text is to be displayed.
9056 On the other hand only a minority of terminals is capable to correctly
9057 handle direction changes, so that user interaction is necessary for
9058 acceptable results.
9059 Note that extended host system support is required nonetheless, e.g.,
9060 detection of the terminal character set is one precondition;
9061 and this feature only works in an Unicode (i.e., UTF-8) locale.
9063 In general setting this variable will cause \*(UA to encapsulate text
9064 fields that may occur when displaying
9065 .Va headline
9066 (and some other fields, like dynamic expansions in
9067 .Va prompt )
9068 with special Unicode control sequences;
9069 it is possible to fine-tune the terminal support level by assigning
9070 a value:
9071 no value (or any value other than
9072 .Ql 1 ,
9073 .Ql 2
9075 .Ql 3 )
9076 will make \*(UA assume that the terminal is capable to properly deal
9077 with Unicode version 6.3, in which case text is embedded in a pair of
9078 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
9079 characters.
9080 In addition no space on the line is reserved for these characters.
9082 Weaker support is chosen by using the value
9083 .Ql 1
9084 (Unicode 6.3, but reserve the room of two spaces for writing the control
9085 sequences onto the line).
9086 The values
9087 .Ql 2
9089 .Ql 3
9090 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
9091 again reserves room for two spaces in addition.
9093 .It Va headline-plain
9094 \*(BO On Unicode (UTF-8) aware terminals enhanced graphical symbols are
9095 used by default for certain entries of
9096 .Va headline .
9097 If this variable is set only basic US-ASCII symbols will be used.
9099 .It Va history-file
9100 \*(OP If a line editor is available then this can be set to
9101 name the (expandable) path of the location of a permanent
9102 .Ic history
9103 file; also see
9104 .Va history-size .
9106 .It Va history-gabby
9107 \*(BO\*(OP Add more entries to the
9108 .Ic history
9109 as is normally done.
9111 .It Va history-gabby-persist
9112 \*(BO\*(OP \*(UA's own MLE will not save the additional
9113 .Va history-gabby
9114 entries in persistent storage unless this variable is set.
9115 On the other hand it will not loose the knowledge of whether
9116 a persistent entry was gabby or not.
9117 Also see
9118 .Va history-file .
9120 .It Va history-size
9121 \*(OP Setting this variable imposes a limit on the number of concurrent
9122 .Ic history
9123 entries.
9124 If set to the value 0 then no further history entries will be added,
9125 and loading and incorporation of the
9126 .Va history-file
9127 upon program startup can also be suppressed by doing this.
9128 Runtime changes will not be reflected, but will affect the number of
9129 entries saved to permanent storage.
9131 .It Va hold
9132 \*(BO This setting controls whether messages are held in the system
9133 .Va inbox ,
9134 and it is set by default.
9136 .It Va hostname
9137 Used instead of the value obtained from
9138 .Xr uname 3
9140 .Xr getaddrinfo 3
9141 as the hostname when expanding local addresses, e.g., in
9142 .Ql From:
9143 (also see
9144 .Sx "On sending mail, and non-interactive mode" ) .
9145 If either of
9146 .Va from
9147 or this variable Is set the message and MIME part related unique ID fields
9148 .Ql Message-ID:
9150 .Ql Content-ID:
9151 will be created (except when disallowed by
9152 .Va message-id-disable
9154 .Va stealthmua ) .
9155 If the \*(OPal IDNA support is available (see
9156 .Va idna-disable )
9157 variable assignment is aborted when a necessary conversion fails.
9159 Setting it to the empty string will cause the normal hostname to be
9160 used, but nonetheless enables creation of said ID fields.
9161 \*(IN in conjunction with the built-in SMTP
9162 .Va mta
9163 .Va smtp-hostname
9164 also influences the results:
9165 one should produce some test messages with the desired combination of
9166 .Va \&\&hostname ,
9167 and/or
9168 .Va from ,
9169 .Va sender
9170 etc. first.
9172 .It Va idna-disable
9173 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
9174 names according to the rules of IDNA (internationalized domain names
9175 for applications).
9176 Since the IDNA code assumes that domain names are specified with the
9177 .Va ttycharset
9178 character set, an UTF-8 locale charset is required to represent all
9179 possible international domain names (before conversion, that is).
9181 .It Va ifs
9182 The input field separator that is used (\*(ID by some functions) to
9183 determine where to split input data.
9185 .Bl -tag -compact -width ".It MMM"
9186 .It 1.
9187 Unsetting is treated as assigning the default value,
9188 .Ql \& \et\en .
9189 .It 2.
9190 If set to the empty value, no field splitting will be performed.
9191 .It 3.
9192 If set to a non-empty value, all whitespace characters are extracted
9193 and assigned to the variable
9194 .Va ifs-ws .
9197 .Bl -tag -compact -width ".It MMM"
9198 .It a.
9199 .Va \&\&ifs-ws
9200 will be ignored at the beginning and end of input.
9201 Diverging from POSIX shells default whitespace is removed in addition,
9202 which is owed to the entirely different line content extraction rules.
9203 .It b.
9204 Each occurrence of a character of
9205 .Va \&\&ifs
9206 will cause field-splitting, any adjacent
9207 .Va \&\&ifs-ws
9208 characters will be skipped.
9211 .It Va ifs-ws
9212 \*(RO Automatically deduced from the whitespace characters in
9213 .Va ifs .
9215 .It Va ignore
9216 \*(BO Ignore interrupt signals from the terminal while entering
9217 messages; instead echo them as
9218 .Ql @
9219 characters and discard the current line.
9221 .It Va ignoreeof
9222 \*(BO Ignore end-of-file conditions
9223 .Pf ( Ql control-D )
9224 in compose mode on message input and in interactive command input.
9225 If set an interactive command input session can only be left by
9226 explicitly using one of the commands
9227 .Ic exit
9229 .Ic quit ,
9230 and message input in compose mode can only be terminated by entering
9231 a period
9232 .Ql \&.
9233 on a line by itself or by using the
9234 .Ic ~.
9235 .Sx "COMMAND ESCAPES" ;
9236 Setting this implies the behaviour that
9237 .Va dot
9238 describes in
9239 .Va posix
9240 mode.
9242 .It Va inbox
9243 If this is set to a non-empty string it will specify the users
9244 .Mx -sx
9245 .Sx "primary system mailbox" ,
9246 overriding
9247 .Ev MAIL
9248 and the system-dependent default, and (thus) be used to replace
9249 .Ql %
9250 when doing
9251 .Sx "Filename transformations" ;
9252 also see
9253 .Ic file
9254 for more on this topic.
9255 The value supports a subset of transformations itself.
9257 .It Va indentprefix
9258 String used by the
9259 .Ic ~m , ~M
9261 .Ic ~R
9262 .Sx "COMMAND ESCAPES"
9263 and by the
9264 .Va quote
9265 option for indenting messages,
9266 in place of the POSIX mandated default tabulator character
9267 .Ql \et .
9268 Also see
9269 .Va quote-chars .
9271 .It Va keep
9272 \*(BO If set, an empty
9273 .Mx -sx
9274 .Sx "primary system mailbox"
9275 file is not removed.
9276 Note that, in conjunction with
9277 .Va posix
9278 mode any empty file will be removed unless this variable is set.
9279 This may improve the interoperability with other mail user agents
9280 when using a common folder directory, and prevents malicious users
9281 from creating fake mailboxes in a world-writable spool directory.
9282 \*(ID Only local regular (MBOX) files are covered, Maildir or other
9283 mailbox types will never be removed, even if empty.
9285 .It Va keep-content-length
9286 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
9287 be told to keep the
9288 .Ql Content-Length:
9290 .Ql Lines:
9291 header fields that some MUAs generate by setting this variable.
9292 Since \*(UA does neither use nor update these non-standardized header
9293 fields (which in itself shows one of their conceptual problems),
9294 stripping them should increase interoperability in between MUAs that
9295 work with with same mailbox files.
9296 Note that, if this is not set but
9297 .Va writebackedited ,
9298 as below, is, a possibly performed automatic stripping of these header
9299 fields already marks the message as being modified.
9300 \*(ID At some future time \*(UA will be capable to rewrite and apply an
9301 .Va mime-encoding
9302 to modified messages, and then those fields will be stripped silently.
9304 .It Va keepsave
9305 \*(BO When a message is saved it is usually discarded from the
9306 originating folder when \*(UA is quit.
9307 This setting causes all saved message to be retained.
9309 .It Va line-editor-disable
9310 \*(BO Turn off any enhanced line editing capabilities (see
9311 .Sx "On terminal control and line editor"
9312 for more).
9314 .It Va line-editor-no-defaults
9315 \*(BO\*(OP Do not establish any default key binding.
9317 .It Va log-prefix
9318 Error log message prefix string
9319 .Pf ( Ql "\*(uA: " ) .
9321 .It Va mailbox-display
9322 \*(RO The name of the current mailbox
9323 .Pf ( Ic file ) ,
9324 possibly abbreviated for display purposes.
9326 .It Va mailbox-resolved
9327 \*(RO The fully resolved path of the current mailbox.
9329 .It Va mailx-extra-rc
9330 An additional startup file that is loaded as the last of the
9331 .Sx "Resource files" .
9332 Use this file for commands that are not understood by other POSIX
9333 .Xr mailx 1
9334 implementations, i.e., mostly anything which is not covered by
9335 .Sx "Initial settings" .
9337 .It Va markanswered
9338 \*(BO When a message is replied to and this variable is set,
9339 it is marked as having been
9340 .Ic answered .
9341 See the section
9342 .Sx "Message states" .
9344 .It Va mbox-rfc4155
9345 \*(BO When opening MBOX mailbox databases \*(UA by default uses tolerant
9346 POSIX rules for detecting message boundaries (so-called
9347 .Ql From_
9348 lines) due to compatibility reasons, instead of the stricter rules that
9349 have been standardized in RFC 4155.
9350 This behaviour can be switched to the stricter RFC 4155 rules by
9351 setting this variable.
9352 (This is never necessary for any message newly generated by \*(UA,
9353 it only applies to messages generated by buggy or malicious MUAs, or may
9354 occur in old MBOX databases: \*(UA itself will choose a proper
9355 .Va mime-encoding
9356 to avoid false interpretation of
9357 .Ql From_
9358 content lines in the MBOX database.)
9360 This may temporarily be handy when \*(UA complains about invalid
9361 .Ql From_
9362 lines when opening a MBOX: in this case setting this variable and
9363 re-opening the mailbox in question may correct the result.
9364 If so, copying the entire mailbox to some other file, as in
9365 .Ql copy * SOME-FILE ,
9366 will perform proper, all-compatible
9367 .Ql From_
9368 quoting for all detected messages, resulting in a valid MBOX mailbox.
9369 Finally the variable can be unset again:
9370 .Bd -literal -offset indent
9371 define mboxfix {
9372   localopts yes; wysh set mbox-rfc4155;\e
9373     wysh File "${1}"; eval copy * "${2}"
9375 call mboxfix /tmp/bad.mbox /tmp/good.mbox
9378 .It Va memdebug
9379 \*(BO Internal development variable.
9381 .It Va message-id-disable
9382 \*(BO By setting this variable the generation of
9383 .Ql Message-ID:
9385 .Ql Content-ID:
9386 message and MIME part headers can be completely suppressed, effectively
9387 leaving this task up to the
9388 .Va mta
9389 (Mail-Transfer-Agent) or the SMTP server.
9390 Note that according to RFC 5321 a SMTP server is not required to add this
9391 field by itself, so it should be ensured that it accepts messages without
9392 .Ql Message-ID .
9394 .It Va message-inject-head
9395 A string to put at the beginning of each new message, followed by a newline.
9396 \*(OB The escape sequences tabulator
9397 .Ql \et
9398 and newline
9399 .Ql \en
9400 are understood (use the
9401 .Cm wysh
9402 prefix when
9403 .Ic set Ns
9404 ting the variable(s) instead).
9406 .It Va message-inject-tail
9407 A string to put at the end of each new message, followed by a newline.
9408 \*(OB The escape sequences tabulator
9409 .Ql \et
9410 and newline
9411 .Ql \en
9412 are understood (use the
9413 .Cm wysh
9414 prefix when
9415 .Ic set Ns
9416 ting the variable(s) instead).
9418 .It Va metoo
9419 \*(BO Usually, when an
9420 .Ic alias
9421 expansion contains the sender, the sender is removed from the expansion.
9422 Setting this option suppresses these removals.
9423 Note that a set
9424 .Va metoo
9425 also causes a
9426 .Ql -m
9427 option to be passed through to the
9428 .Va mta
9429 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
9430 this flag, no MTA is known which does not support it (for historical
9431 compatibility).
9433 .It Va mime-allow-text-controls
9434 \*(BO When sending messages, each part of the message is MIME-inspected
9435 in order to classify the
9436 .Ql Content-Type:
9438 .Ql Content-Transfer-Encoding:
9439 (see
9440 .Va mime-encoding )
9441 that is required to send this part over mail transport, i.e.,
9442 a computation rather similar to what the
9443 .Xr file 1
9444 command produces when used with the
9445 .Ql --mime
9446 option.
9448 This classification however treats text files which are encoded in
9449 UTF-16 (seen for HTML files) and similar character sets as binary
9450 octet-streams, forcefully changing any
9451 .Ql text/plain
9453 .Ql text/html
9454 specification to
9455 .Ql application/octet-stream :
9456 If that actually happens a yet unset charset MIME parameter is set to
9457 .Ql binary ,
9458 effectively making it impossible for the receiving MUA to automatically
9459 interpret the contents of the part.
9461 If this variable is set, and the data was unambiguously identified as
9462 text data at first glance (by a
9463 .Ql .txt
9465 .Ql .html
9466 file extension), then the original
9467 .Ql Content-Type:
9468 will not be overwritten.
9470 .It Va mime-alternative-favour-rich
9471 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
9472 HTML) will be preferred in favour of included plain text versions when
9473 displaying messages, provided that a handler exists which produces
9474 output that can be (re)integrated into \*(UA's normal visual display.
9475 (E.g., at the time of this writing some newsletters ship their full
9476 content only in the rich HTML part, whereas the plain text part only
9477 contains topic subjects.)
9479 .It Va mime-counter-evidence
9480 Normally the
9481 .Ql Content-Type:
9482 field is used to decide how to handle MIME parts.
9483 Some MUAs, however, do not use
9484 .Sx "The mime.types files"
9485 (also see
9486 .Sx "HTML mail and MIME attachments" )
9487 or a similar mechanism to correctly classify content, but specify an
9488 unspecific MIME type
9489 .Pf ( Ql application/octet-stream )
9490 even for plain text attachments.
9491 If this variable is set then \*(UA will try to re-classify such MIME
9492 message parts, if possible, for example via a possibly existing
9493 attachment filename.
9494 A non-empty value may also be given, in which case a number is expected,
9495 actually a carrier of bits, best specified as a binary value, e.g.,
9496 .Ql 0b1111 .
9498 .Bl -bullet -compact
9500 If bit two is set (counting from 1, decimal 2) then the detected
9501 .Ic mimetype
9502 will be carried along with the message and be used for deciding which
9503 MIME handler is to be used, for example;
9504 when displaying such a MIME part the part-info will indicate the
9505 overridden content-type by showing a plus sign
9506 .Ql + .
9508 If bit three is set (decimal 4) then the counter-evidence is always
9509 produced and a positive result will be used as the MIME type, even
9510 forcefully overriding the parts given MIME type.
9512 If bit four is set (decimal 8) as a last resort the actual content of
9513 .Ql application/octet-stream
9514 parts will be inspected, so that data which looks like plain text can be
9515 treated as such.
9516 This mode is even more relaxed when data is to be displayed to the user
9517 or used as a message quote (data consumers which mangle data for display
9518 purposes, which includes masking of control characters, for example).
9521 .It Va mime-encoding
9522 The MIME
9523 .Ql Content-Transfer-Encoding
9524 to use in outgoing text messages and message parts, where applicable.
9525 (7-bit clean text messages are sent as-is, without a transfer encoding.)
9526 Valid values are:
9528 .Bl -tag -compact -width ".It Ql _%%_"
9529 .It Ql 8bit
9530 .Pf (Or\0 Ql 8b . )
9531 8-bit transport effectively causes the raw data be passed through
9532 unchanged, but may cause problems when transferring mail messages over
9533 channels that are not ESMTP (RFC 1869) compliant.
9534 Also, several input data constructs are not allowed by the
9535 specifications and may cause a different transfer-encoding to be used.
9536 .It Ql quoted-printable
9537 .Pf (Or\0 Ql qp . )
9538 Quoted-printable encoding is 7-bit clean and has the property that ASCII
9539 characters are passed through unchanged, so that an english message can
9540 be read as-is; it is also acceptable for other single-byte locales that
9541 share many characters with ASCII, like, e.g., ISO-8859-1.
9542 The encoding will cause a large overhead for messages in other character
9543 sets: e.g., it will require up to twelve (12) bytes to encode a single
9544 UTF-8 character of four (4) bytes.
9545 It is the default encoding.
9546 .It Ql base64
9547 .Pf (Or\0 Ql b64 . )
9548 This encoding is 7-bit clean and will always be used for binary data.
9549 This encoding has a constant input:output ratio of 3:4, regardless of
9550 the character set of the input data it will encode three bytes of input
9551 to four bytes of output.
9552 This transfer-encoding is not human readable without performing
9553 a decoding step.
9556 .It Va mimetypes-load-control
9557 Can be used to control which of
9558 .Sx "The mime.types files"
9559 are loaded: if the letter
9560 .Ql u
9561 is part of the option value, then the user's personal
9562 .Pa ~/.mime.types
9563 file will be loaded (if it exists); likewise the letter
9564 .Ql s
9565 controls loading of the system wide
9566 .Pa /etc/mime.types ;
9567 directives found in the user file take precedence, letter matching is
9568 case-insensitive.
9569 If this variable is not set \*(UA will try to load both files.
9570 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
9571 but they will be matched last (the order can be listed via
9572 .Ic mimetype ) .
9574 More sources can be specified by using a different syntax: if the
9575 value string contains an equals sign
9576 .Ql =
9577 then it is instead parsed as a comma-separated list of the described
9578 letters plus
9579 .Ql f=FILENAME
9580 pairs; the given filenames will be expanded and loaded, and their
9581 content may use the extended syntax that is described in the section
9582 .Sx "The mime.types files" .
9583 Directives found in such files always take precedence (are prepended to
9584 the MIME type cache).
9586 .It Va mta
9587 To choose an alternate Mail-Transfer-Agent, set this option to either
9588 the full pathname of an executable (optionally prefixed with the protocol
9589 .Ql file:// ) ,
9590 or \*(OPally a SMTP a.k.a. SUBMISSION protocol URL, e.g., \*(IN
9592 .Dl smtps?://[user[:password]@]server[:port]
9594 (\*(OU:
9595 .Ql [smtp://]server[:port] . )
9596 The default has been chosen at compile time.
9597 All supported data transfers are executed in child processes, which
9598 run asynchronously and without supervision unless either the
9599 .Va sendwait
9600 or the
9601 .Va verbose
9602 variable is set.
9603 If such a child receives a TERM signal, it will abort and
9604 .Va save
9605 the message to
9606 .Ev DEAD ,
9607 if so configured.
9609 For a file-based MTA it may be necessary to set
9610 .Va mta-argv0
9611 in in order to choose the right target of a modern
9612 .Xr mailwrapper 8
9613 environment.
9614 It will be passed command line arguments from several possible sources:
9615 from the variable
9616 .Va mta-arguments
9617 if set, from the command line if given and the variable
9618 .Va expandargv
9619 allows their use.
9620 Argument processing of the MTA will be terminated with a
9621 .Fl \&\&-
9622 separator.
9624 The otherwise occurring implicit usage of the following MTA command
9625 line arguments can be disabled by setting the boolean variable
9626 .Va mta-no-default-arguments
9627 (which will also disable passing
9628 .Fl \&\&-
9629 to the MTA):
9630 .Fl \&\&i
9631 (for not treating a line with only a dot
9632 .Ql \&.
9633 character as the end of input),
9634 .Fl \&\&m
9635 (shall the variable
9636 .Va metoo
9637 be set) and
9638 .Fl \&\&v
9639 (if the
9640 .Va verbose
9641 variable is set); in conjunction with the
9642 .Fl r
9643 command line option \*(UA will also (not) pass
9644 .Fl \&\&f
9645 as well as possibly
9646 .Fl \&\&F .
9648 \*(OPally \*(UA can send mail over SMTP a.k.a. SUBMISSION network
9649 connections to a single defined smart host by setting this variable to
9650 a SMTP or SUBMISSION URL (see
9651 .Sx "On URL syntax and credential lookup" ) .
9652 An authentication scheme can be specified via the variable chain
9653 .Va smtp-auth .
9654 Encrypted network connections are \*(OPally available, the section
9655 .Sx "Encrypted network communication"
9656 should give an overview and provide links to more information on this.
9657 Note that with some mail providers it may be necessary to set the
9658 .Va smtp-hostname
9659 variable in order to use a specific combination of
9660 .Va from ,
9661 .Va hostname
9663 .Va mta .
9664 \*(UA also supports forwarding of all network traffic over a specified
9665 .Va socks-proxy .
9666 The following SMTP variants may be used:
9667 .Bl -bullet
9669 The plain SMTP protocol (RFC 5321) that normally lives on the
9670 server port 25 and requires setting the
9671 .Va smtp-use-starttls
9672 variable to enter a SSL/TLS encrypted session state.
9673 Assign a value like \*(IN
9674 .Ql smtp://[user[:password]@]server[:port]
9675 (\*(OU
9676 .Ql smtp://server[:port] )
9677 to choose this protocol.
9679 The so-called SMTPS which is supposed to live on server port 465
9680 and is automatically SSL/TLS secured.
9681 Unfortunately it never became a standardized protocol and may thus not
9682 be supported by your hosts network service database
9683 \(en in fact the port number has already been reassigned to other
9684 protocols!
9686 SMTPS is nonetheless a commonly offered protocol and thus can be
9687 chosen by assigning a value like \*(IN
9688 .Ql smtps://[user[:password]@]server[:port]
9689 (\*(OU
9690 .Ql smtps://server[:port] ) ;
9691 due to the mentioned problems it is usually necessary to explicitly
9692 specify the port as
9693 .Ql :465 ,
9694 however.
9696 The SUBMISSION protocol (RFC 6409) lives on server port 587 and
9697 is identically to the SMTP protocol from \*(UA's point of view;
9698 it requires setting
9699 .Va smtp-use-starttls
9700 to enter a SSL/TLS secured session state; e.g., \*(IN
9701 .Ql submission://[user[:password]@]server[:port] .
9703 The SUBMISSIONS protocol (RFC 8314) that lives on server port 465 and is
9704 SSL/TLS secured by default.
9705 It can be chosen by assigning a value like \*(IN
9706 .Ql submissions://[user[:password]@]server[:port] .
9707 Due to the problems mentioned for SMTPS above and the fact that
9708 SUBMISSIONS is new and a successor that lives on the same port as the
9709 historical engineering mismanagement named SMTPS, it is usually
9710 necessary to explicitly specify the port as
9711 .Ql :465 .
9714 .It Va mta-arguments
9715 Arguments to pass through to a file-based
9716 .Va mta
9717 can be given via this variable, which is parsed according to
9718 .Sx "Shell-style argument quoting"
9719 into an array of arguments, and which will be joined onto MTA options
9720 from other sources, and then passed individually to the MTA:
9721 .Ql ? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
9723 .It Va mta-no-default-arguments
9724 \*(BO Unless this variable is set \*(UA will pass some well known
9725 standard command line options to a file-based
9726 .Va mta
9727 (Mail-Transfer-Agent), see there for more.
9729 .It Va mta-no-receiver-arguments
9730 \*(BO By default a file-based
9731 .Va mta
9732 will be passed all receiver addresses on the command line.
9733 This variable can be set to suppress any such argument.
9735 .It Va mta-argv0
9736 Many systems use a so-called
9737 .Xr mailwrapper 8
9738 environment to ensure compatibility with
9739 .Xr sendmail 1 .
9740 This works by inspecting the name that was used to invoke the mail
9741 delivery system.
9742 If this variable is set then the mailwrapper (the program that is
9743 actually executed when calling the file-based
9744 .Va mta )
9745 will treat its contents as that name.
9746 .Mx Va netrc-lookup
9747 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
9748 \*(BO\*(IN\*(OP Used to control usage of the users
9749 .Pa .netrc
9750 file for lookup of account credentials, as documented in the section
9751 .Sx "On URL syntax and credential lookup"
9752 and for the command
9753 .Ic netrc ;
9754 the section
9755 .Sx "The .netrc file"
9756 documents the file format.
9757 Also see
9758 .Va netrc-pipe .
9760 .It Va netrc-pipe
9761 \*(IN\*(OP When
9762 .Pa .netrc
9763 is loaded (see
9764 .Ic netrc
9766 .Va netrc-lookup )
9767 then \*(UA will read the output of a shell pipe instead of the users
9768 .Pa .netrc
9769 file if this variable is set (to the desired shell command).
9770 This can be used to, e.g., store
9771 .Pa .netrc
9772 in encrypted form:
9773 .Ql ? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
9775 .It Va newfolders
9776 If this variable has the value
9777 .Ql maildir ,
9778 newly created local folders will be in Maildir instead of MBOX format.
9780 .It Va newmail
9781 Checks for new mail in the current folder each time the prompt is shown.
9782 A Maildir folder must be re-scanned to determine if new mail has arrived.
9783 If this variable is set to the special value
9784 .Ql nopoll
9785 then a Maildir folder will not be rescanned completely, but only
9786 timestamp changes are detected.
9788 .It Va outfolder
9789 \*(BO Causes the filename given in the
9790 .Va record
9791 variable
9792 and the sender-based filenames for the
9793 .Ic Copy
9795 .Ic Save
9796 commands to be interpreted relative to the directory given in the
9797 .Va folder
9798 variable rather than to the current directory,
9799 unless it is set to an absolute pathname.
9800 .Mx Va on-account-cleanup
9801 .It Va on-account-cleanup-ACCOUNT , Va on-account-cleanup
9802 Macro hook which will be called once an
9803 .Ic account
9804 is left, as the very last step before unrolling per-account
9805 .Ic localopts .
9806 This hook is run even in case of fatal errors, and it is advisable to
9807 perform only absolutely necessary actions, like cleaning up
9808 .Ic alternates ,
9809 for example.
9810 The specialized form is used in favour of the generic one if found.
9812 .It Va on-compose-cleanup
9813 Macro hook which will be called after the message has been sent (or not,
9814 in case of failures), as the very last step before unrolling compose mode
9815 .Ic localopts .
9816 This hook is run even in case of fatal errors, and it is advisable to
9817 perform only absolutely necessary actions, like cleaning up
9818 .Ic alternates ,
9819 for example.
9821 For compose mode hooks that may affect the message content please see
9822 .Va on-compose-enter , on-compose-leave , on-compose-splice .
9823 \*(ID This hook exists because
9824 .Ic alias , alternates , commandalias , shortcut ,
9825 to name a few, are not covered by
9826 .Ic localopts :
9827 changes applied in compose mode will continue to be in effect thereafter.
9830 .It Va on-compose-enter , on-compose-leave
9831 Macro hooks which will be called once compose mode is entered,
9832 and after composing has been finished, but before a set
9833 .Va message-inject-tail
9834 has been injected etc., respectively.
9835 .Ic localopts
9836 are enabled for these hooks, and changes on variables will be forgotten
9837 after the message has been sent.
9838 .Va on-compose-cleanup
9839 can be used to perform other necessary cleanup steps.
9841 The following (read-only) variables will be set temporarily during
9842 execution of the macros to represent respective message headers, to
9843 the empty string otherwise; most of them correspond to according virtual
9844 message headers that can be accessed via
9845 .Ic ~^ ,
9846 one of the
9847 .Sx "COMMAND ESCAPES"
9848 (also from within
9849 .Va on-compose-splice
9850 hooks):
9852 .Bl -tag -compact -width ".It Va mailx_subject"
9853 .It Va mailx-command
9854 The command that generates the message.
9855 .It Va mailx-subject
9856 The subject.
9857 .It Va mailx-from
9858 .Va from .
9859 .It Va mailx-sender
9860 .Va sender .
9861 .It Va mailx-to , mailx-cc , mailx-bcc
9862 The list of receiver addresses as a space-separated list.
9863 .It Va mailx-raw-to , mailx-raw-cc , mailx-raw-bcc
9864 The list of receiver addresses before any mangling (due to, e.g.,
9865 .Ic alternates ,
9866 .Ic alias
9867 .Va recipients-in-cc )
9868 as a space-separated list.
9869 .It Va mailx-orig-from
9870 When replying, forwarding or resending, this will be set to the
9871 .Ql From:
9872 of the given message.
9873 .It Va mailx-orig-to , mailx-orig-cc , mailx-orig-bcc
9874 When replying, forwarding or resending, this will be set to the
9875 receivers of the given message.
9878 Here is am example that injects a signature via
9879 .Va message-inject-tail ;
9880 instead using
9881 .Va on-compose-splice
9882 to simply inject the file of desire via
9883 .Ic ~<
9885 .Ic ~<!
9886 may be a better approach.
9887 .Bd -literal -offset indent
9888 define t_ocl {
9889   vput ! i cat ~/.mysig
9890   if [ $? -eq 0 ]
9891      vput vexpr message-inject-tail trim-end $i
9892   end
9894   # Alternatively
9895   readctl create ~/.mysig
9896   if [ $? -eq 0 ]
9897     readall i
9898     if [ $? -eq 0 ]
9899       vput vexpr message-inject-tail trim-end $i
9900     end
9901     readctl remove ~/.mysig
9902   end
9904 set on-compose-leave=t_ocl
9908 .It Va on-compose-splice , on-compose-splice-shell
9909 These hooks run once the normal compose mode is finished, but before the
9910 .Va on-compose-leave
9911 macro hook is called, the
9912 .Va message-inject-tail
9913 is injected etc.
9914 Both hooks will be executed in a subprocess, with their input and output
9915 connected to \*(UA such that they can act as if they would be an
9916 interactive user.
9917 The difference in between them is that the latter is a
9918 .Ev SHELL
9919 command, whereas the former is a normal \*(UA macro, but which is
9920 restricted to a small set of commands (the
9921 .Va verbose
9922 output of, e.g.,
9923 .Ic list
9924 will indicate said capability).
9925 .Ic localopts
9926 are enabled for these hooks (in the parent process), causing any setting
9927 to be forgotten after the message has been sent;
9928 .Va on-compose-cleanup
9929 can be used to perform other cleanup as necessary.
9931 During execution of these hooks \*(UA will temporarily forget whether it
9932 has been started in interactive mode, (a restricted set of)
9933 .Sx "COMMAND ESCAPES"
9934 will always be available, and for guaranteed reproducibilities sake
9935 .Va escape
9937 .Va ifs
9938 will be set to their defaults.
9939 The compose mode command
9940 .Ic ~^
9941 has been especially designed for scriptability (via these hooks).
9942 The first line the hook will read on its standard input is the protocol
9943 version of said command escape, currently
9944 .Dq 0 0 1 :
9945 backward incompatible protocol changes have to be expected.
9947 Care must be taken to avoid deadlocks and other false control flow:
9948 if both involved processes wait for more input to happen at the
9949 same time, or one does not expect more input but the other is stuck
9950 waiting for consumption of its output, etc.
9951 There is no automatic synchronization of the hook: it will not be
9952 stopped automatically just because it, e.g., emits
9953 .Ql ~x .
9954 The hooks will however receive a termination signal if the parent enters
9955 an error condition.
9956 \*(ID Protection against and interaction with signals is not yet given;
9957 it is likely that in the future these scripts will be placed in an
9958 isolated session, which is signalled in its entirety as necessary.
9959 .Bd -literal -offset indent
9960 define ocs_signature {
9961   read version
9962   echo '~< ~/.mysig' # '~<! fortune pathtofortunefile'
9964 set on-compose-splice=ocs_signature
9966 wysh set on-compose-splice-shell=$'\e
9967   read version;\e
9968   printf "hello $version!  Headers: ";\e
9969   echo \e'~^header list\e';\e
9970   read status result;\e
9971   echo "status=$status result=$result";\e
9972   '
9974 define ocsm {
9975   read version
9976   echo Splice protocol version is $version
9977   echo '~^h l'; read hl; vput vexpr es substring "${hl}" 0 1
9978   if [ "$es" != 2 ]
9979     echoerr 'Cannot read header list'; echo '~x'; xit
9980   endif
9981   if [ "$hl" @i!% ' cc' ]
9982     echo '~^h i cc Diet is your <mirr.or>'; read es;\e
9983       vput vexpr es substring "${es}" 0 1
9984     if [ "$es" != 2 ]
9985       echoerr 'Cannot insert Cc: header'; echo '~x'
9986       # (no xit, macro finishs anyway)
9987     endif
9988   endif
9990 set on-compose-splice=ocsm
9993 .It Va on-resend-cleanup
9994 \*(ID Identical to
9995 .Va on-compose-cleanup ,
9996 but is only triggered by
9997 .Ic resend .
9999 .It Va on-resend-enter
10000 \*(ID Identical to
10001 .Va on-compose-enter ,
10002 but is only triggered by
10003 .Ic resend .
10005 .It Va page
10006 \*(BO If set, each message feed through the command given for
10007 .Ic pipe
10008 is followed by a formfeed character
10009 .Ql \ef .
10010 .Mx Va password
10011 .It Va password-USER@HOST , password-HOST , password
10012 \*(IN Variable chain that sets a password, which is used in case none has
10013 been given in the protocol and account-specific URL;
10014 as a last resort \*(UA will ask for a password on the user's terminal if
10015 the authentication method requires a password.
10016 Specifying passwords in a startup file is generally a security risk;
10017 the file should be readable by the invoking user only.
10018 .It Va password-USER@HOST
10019 \*(OU (see the chain above for \*(IN)
10020 Set the password for
10021 .Ql USER
10022 when connecting to
10023 .Ql HOST .
10024 If no such variable is defined for a host,
10025 the user will be asked for a password on standard input.
10026 Specifying passwords in a startup file is generally a security risk;
10027 the file should be readable by the invoking user only.
10029 .It Va piperaw
10030 \*(BO Send messages to the
10031 .Ic pipe
10032 command without performing MIME and character set conversions.
10034 .It Va pipe-TYPE/SUBTYPE
10035 When a MIME message part of type
10036 .Ql TYPE/SUBTYPE
10037 (case-insensitive) is displayed or quoted,
10038 its text is filtered through the value of this variable interpreted as
10039 a shell command.
10040 Note that only parts which can be displayed inline as plain text (see
10041 .Cd copiousoutput )
10042 are displayed unless otherwise noted, other MIME parts will only be
10043 considered by and for the command
10044 .Ic mimeview .
10046 The special value commercial at
10047 .Ql @
10048 forces interpretation of the message part as plain text, e.g.,
10049 .Ql set pipe-application/xml=@
10050 will henceforth display XML
10051 .Dq as is .
10052 (The same could also be achieved by adding a MIME type marker with the
10053 .Ic mimetype
10054 command.
10055 And \*(OPally MIME type handlers may be defined via
10056 .Sx "The Mailcap files"
10057 \(em these directives,
10058 .Cd copiousoutput
10059 has already been used, should be referred to for further documentation.
10061 The commercial at
10062 .Ql @
10063 can in fact be used as a trigger character to adjust usage and behaviour
10064 of a following shell command specification more thoroughly by appending
10065 more special characters which refer to further mailcap directives, e.g.,
10066 the following hypothetical command specification could be used:
10067 .Bd -literal -offset indent
10068 ? set pipe-X/Y='@!++=@vim ${MAILX_FILENAME_TEMPORARY}'
10071 .Bl -tag -compact -width ".It Ql __"
10072 .It Ql *
10073 The command produces plain text to be integrated in \*(UAs output:
10074 .Cd copiousoutput .
10075 .It Ql #
10076 If set the handler will not be invoked when a message is to be quoted,
10077 but only when it will be displayed:
10078 .Cd x-mailx-noquote .
10079 .It Ql &
10080 Run the command asynchronously, i.e., without blocking \*(UA:
10081 .Cd x-mailx-async .
10082 .It Ql \&!
10083 The command must be run on an interactive terminal, \*(UA will
10084 temporarily release the terminal to it:
10085 .Cd needsterminal .
10086 .It Ql +
10087 Request creation of a zero-sized temporary file, the absolute pathname
10088 of which will be made accessible via the environment variable
10089 .Ev MAILX_FILENAME_TEMPORARY :
10090 .Cd x-mailx-tmpfile .
10091 If given twice then the file will be unlinked automatically by \*(UA
10092 when the command loop is entered again at latest:
10093 .Cd x-mailx-tmpfile-unlink .
10094 .It Ql =
10095 Normally the MIME part content is passed to the handler via standard
10096 input; if this flag is set then the data will instead be written into
10097 .Ev MAILX_FILENAME_TEMPORARY
10098 .Pf ( Cd x-mailx-tmpfile-fill ) ,
10099 the creation of which is implied; note however that in order to cause
10100 deletion of the temporary file you still have to use two plus signs
10101 .Ql ++
10102 explicitly!
10103 .It Ql @
10104 To avoid ambiguities with normal shell command content you can use
10105 another commercial at to forcefully terminate interpretation of
10106 remaining characters.
10107 (Any character not in this list will have the same effect.)
10110 Some information about the MIME part to be displayed is embedded into
10111 the environment of the shell command:
10113 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
10115 .It Ev MAILX_CONTENT
10116 The MIME content-type of the part, if known, the empty string otherwise.
10118 .It Ev MAILX_CONTENT_EVIDENCE
10120 .Va mime-counter-evidence
10121 includes the carry-around-bit (2), then this will be set to the detected
10122 MIME content-type; not only then identical to
10123 .Ev \&\&MAILX_CONTENT
10124 otherwise.
10126 .It Ev MAILX_EXTERNAL_BODY_URL
10127 MIME parts of type
10128 .Ql message/external-body access-type=url
10129 will store the access URL in this variable, it is empty otherwise.
10131 .It Ev MAILX_FILENAME
10132 The filename, if any is set, the empty string otherwise.
10134 .It Ev MAILX_FILENAME_GENERATED
10135 A random string.
10137 .It Ev MAILX_FILENAME_TEMPORARY
10138 If temporary file creation has been requested through the command prefix
10139 this variable will be set and contain the absolute pathname of the
10140 temporary file.
10143 .It Va pipe-EXTENSION
10144 This is identical to
10145 .Va pipe-TYPE/SUBTYPE
10146 except that
10147 .Ql EXTENSION
10148 (normalized to lowercase using character mappings of the ASCII charset)
10149 names a file extension, e.g.,
10150 .Ql xhtml .
10151 Handlers registered using this method take precedence.
10152 .Mx Va pop3-auth
10153 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
10154 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
10155 The only possible value as of now is
10156 .Ql plain ,
10157 which is thus the default.
10158 .Mx Va pop3-bulk-load
10159 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
10160 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
10161 the messages, and only requests the message bodies on user request.
10162 For the POP3 protocol this means that the message headers will be
10163 downloaded twice.
10164 If this variable is set then \*(UA will download only complete messages
10165 from the given POP3 server(s) instead.
10166 .Mx Va pop3-keepalive
10167 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
10168 \*(OP POP3 servers close the connection after a period of inactivity;
10169 the standard requires this to be at least 10 minutes,
10170 but practical experience may vary.
10171 Setting this variable to a numeric value greater than
10172 .Ql 0
10173 causes a
10174 .Ql NOOP
10175 command to be sent each value seconds if no other operation is performed.
10176 .Mx Va pop3-no-apop
10177 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
10178 \*(BO\*(OP Unless this variable is set the
10179 .Ql APOP
10180 authentication method will be used when connecting to a POP3 server that
10181 advertises support.
10182 The advantage of
10183 .Ql APOP
10184 is that the password is not sent in clear text over the wire and that
10185 only a single packet is sent for the user/password tuple.
10186 Note that
10187 .Va pop3-no-apop-HOST
10188 requires \*(IN.
10189 .Mx Va pop3-use-starttls
10190 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
10191 \*(BO\*(OP Causes \*(UA to issue a
10192 .Ql STLS
10193 command to make an unencrypted POP3 session SSL/TLS encrypted.
10194 This functionality is not supported by all servers,
10195 and is not used if the session is already encrypted by the POP3S method.
10196 Note that
10197 .Va pop3-use-starttls-HOST
10198 requires \*(IN.
10200 .It Va posix
10201 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
10202 where that deviates from standardized behaviour.
10203 It will be set implicitly before the
10204 .Sx "Resource files"
10205 are loaded if the environment variable
10206 .Ev POSIXLY_CORRECT
10207 is set, and adjusting any of those two will be reflected by the other
10208 one implicitly.
10209 The following behaviour is covered and enforced by this mechanism:
10211 .Bl -bullet -compact
10213 In non-interactive mode, any error encountered while loading resource
10214 files during program startup will cause a program exit, whereas in
10215 interactive mode such errors will stop loading of the currently loaded
10216 (stack of) file(s, i.e., recursively).
10217 These exits can be circumvented on a per-command base by using
10218 .Cm ignerr ,
10219 one of the
10220 .Sx "Command modifiers" ,
10221 for each command which shall be allowed to fail.
10223 .Ic alternates
10224 will replace the list of alternate addresses instead of appending to it.
10226 The variable inserting
10227 .Sx "COMMAND ESCAPES"
10228 .Ic ~A ,
10229 .Ic ~a ,
10230 .Ic ~I
10232 .Ic ~i
10233 will expand embedded character sequences
10234 .Ql \et
10235 horizontal tabulator and
10236 .Ql \en
10237 line feed.
10238 \*(ID For compatibility reasons this step will always be performed.
10240 Upon changing the active
10241 .Ic file
10242 no summary of
10243 .Ic headers
10244 will be displayed even if
10245 .Va header
10246 is set.
10248 Setting
10249 .Va ignoreeof
10250 implies the behaviour described by
10251 .Va dot .
10253 The variable
10254 .Va keep
10255 is extended to cover any empty mailbox, not only empty
10256 .Mx -sx
10257 .Sx "primary system mailbox" Ns
10258 es: they will be removed when they are left in empty state otherwise.
10261 .It Va print-alternatives
10262 \*(BO When a MIME message part of type
10263 .Ql multipart/alternative
10264 is displayed and it contains a subpart of type
10265 .Ql text/plain ,
10266 other parts are normally discarded.
10267 Setting this variable causes all subparts to be displayed,
10268 just as if the surrounding part was of type
10269 .Ql multipart/mixed .
10271 .It Va prompt
10272 The string used as a prompt in interactive mode.
10273 Whenever the variable is evaluated the value is treated as if specified
10274 within dollar-single-quotes (see
10275 .Sx "Shell-style argument quoting" ) .
10276 This (post-assignment, i.e., second) expansion can be used to embed
10277 status information, for example
10278 .Va \&? ,
10279 .Va \&! ,
10280 .Va account
10282 .Va mailbox-display .
10284 In order to embed characters which should not be counted when
10285 calculating the visual width of the resulting string, enclose the
10286 characters of interest in a pair of reverse solidus escaped brackets:
10287 .Ql \e[\eE[0m\e] ;
10288 a slot for coloured prompts is also available with the \*(OPal command
10289 .Ic colour .
10290 Prompting may be prevented by setting this to the null string
10291 (a.k.a.\|
10292 .Ql set noprompt ) .
10294 .It Va prompt2
10295 This string is used for secondary prompts, but is otherwise identical to
10296 .Va prompt .
10297 The default is
10298 .Ql ..\0 .
10300 .It Va quiet
10301 \*(BO Suppresses the printing of the version when first invoked.
10303 .It Va quote
10304 If set, \*(UA starts a replying message with the original message
10305 prefixed by the value of the variable
10306 .Va indentprefix .
10307 Normally, a heading consisting of
10308 .Dq Fromheaderfield wrote:
10309 is put before the quotation.
10310 If the string
10311 .Ql noheading
10312 is assigned to the
10313 .Va \&\&quote
10314 variable, this heading is omitted.
10315 If the string
10316 .Ql headers
10317 is assigned, only the headers selected by the
10318 .Ql type
10319 .Ic headerpick
10320 selection are put above the message body,
10321 thus
10322 .Va \&\&quote
10323 acts like an automatic
10324 .Pf ` Ic ~m Ns '
10325 .Sx "COMMAND ESCAPES"
10326 command, then.
10327 If the string
10328 .Ql allheaders
10329 is assigned, all headers are put above the message body and all MIME
10330 parts are included, making
10331 .Va \&\&quote
10332 act like an automatic
10333 .Pf ` Ic ~M Ns '
10334 command; also see
10335 .Va quote-as-attachment .
10337 .It Va quote-as-attachment
10338 \*(BO Add the original message in its entirety as a
10339 .Ql message/rfc822
10340 MIME attachment when replying to a message.
10341 Note this works regardless of the setting of
10342 .Va quote .
10344 .It Va quote-chars
10345 Can be set to a string consisting of non-whitespace ASCII characters
10346 which shall be treated as quotation leaders, the default being
10347 .Ql >|}: .
10349 .It Va quote-fold
10350 \*(OP Can be set in addition to
10351 .Va indentprefix .
10352 Setting this turns on a more fancy quotation algorithm in that leading
10353 quotation characters
10354 .Pf ( Va quote-chars )
10355 are compressed and overlong lines are folded.
10356 .Va \&\&quote-fold
10357 can be set to either one or two (space separated) numeric values,
10358 which are interpreted as the maximum (goal) and the minimum line length,
10359 respectively, in a spirit rather equal to the
10360 .Xr fmt 1
10361 program, but line-, not paragraph-based.
10362 If not set explicitly the minimum will reflect the goal algorithmically.
10363 The goal cannot be smaller than the length of
10364 .Va indentprefix
10365 plus some additional pad.
10366 Necessary adjustments take place silently.
10368 .It Va r-option-implicit
10369 \*(BO Setting this option evaluates the contents of
10370 .Va from
10371 (or, if that contains multiple addresses,
10372 .Va sender )
10373 and passes the results onto the used (file-based) MTA as described for the
10374 .Fl r
10375 option (empty argument case).
10377 .It Va recipients-in-cc
10378 \*(BO When doing a
10379 .Ic reply ,
10380 the original
10381 .Ql From:
10383 .Ql To:
10384 are by default merged into the new
10385 .Ql To: .
10386 If this variable is set, only the original
10387 .Ql From:
10388 ends in the new
10389 .Ql To: ,
10390 the rest is merged into
10391 .Ql Cc: .
10393 .It Va record
10394 Unless this variable is defined, no copies of outgoing mail will be saved.
10395 If defined it gives the pathname, subject to the usual
10396 .Sx "Filename transformations" ,
10397 of a folder where all new, replied-to or forwarded messages are saved:
10398 when saving to this folder fails the message is not sent, but instead
10399 .Va save Ns
10400 d to
10401 .Ev DEAD .
10402 The standard defines that relative (fully expanded) paths are to be
10403 interpreted relative to the current directory
10404 .Pf ( Ic cwd ) ,
10405 to force interpretation relative to
10406 .Va folder
10407 .Va outfolder
10408 needs to be set in addition.
10410 .It Va record-files
10411 \*(BO If this variable is set the meaning of
10412 .Va record
10413 will be extended to cover messages which target only file and pipe
10414 recipients (see
10415 .Va expandaddr ) .
10416 These address types will not appear in recipient lists unless
10417 .Va add-file-recipients
10418 is also set.
10420 .It Va record-resent
10421 \*(BO If this variable is set the meaning of
10422 .Va record
10423 will be extended to also cover the
10424 .Ic resend
10426 .Ic Resend
10427 commands.
10429 .It Va reply-in-same-charset
10430 \*(BO If this variable is set \*(UA first tries to use the same
10431 character set of the original message for replies.
10432 If this fails, the mechanism described in
10433 .Sx "Character sets"
10434 is evaluated as usual.
10436 .It Va reply-strings
10437 Can be set to a comma-separated list of (case-insensitive according to
10438 ASCII rules) strings which shall be recognized in addition to the
10439 built-in strings as
10440 .Ql Subject:
10441 reply message indicators \(en built-in are
10442 .Ql Re: ,
10443 which is mandated by RFC 5322, as well as the german
10444 .Ql Aw: ,
10445 .Ql Antw: ,
10446 and the
10447 .Ql Wg:
10448 which often has been seen in the wild;
10449 I.e., the separating colon has to be specified explicitly.
10451 .It Va reply-to
10452 A list of addresses to put into the
10453 .Ql Reply-To:
10454 field of the message header.
10455 Members of this list are handled as if they were in the
10456 .Ic alternates
10457 list.
10458 .It Va replyto
10459 \*(OB Variant of
10460 .Va reply-to .
10462 .It Va reply-to-honour
10463 Controls whether a
10464 .Ql Reply-To:
10465 header is honoured when replying to a message via
10466 .Ic reply
10468 .Ic Lreply .
10469 This is a quadoption; if set without a value it defaults to
10470 .Dq yes .
10472 .It Va rfc822-body-from_
10473 \*(BO This variable can be used to force displaying a so-called
10474 .Ql From_
10475 line for messages that are embedded into an envelope mail via the
10476 .Ql message/rfc822
10477 MIME mechanism, for more visual convenience.
10479 .It Va save
10480 \*(BO Enable saving of (partial) messages in
10481 .Ev DEAD
10482 upon interrupt or delivery error.
10484 .It Va screen
10485 The number of lines that represents a
10486 .Dq screenful
10487 of lines, used in
10488 .Ic headers
10489 summary display,
10490 .Ic from
10491 .Ic search Ns
10492 ing, message
10493 .Ic top Ns
10494 line display and scrolling via
10495 .Ic z .
10496 If this variable is not set \*(UA falls back to a calculation based upon
10497 the detected terminal window size and the baud rate: the faster the
10498 terminal, the more will be shown.
10499 Overall screen dimensions and pager usage is influenced by the
10500 environment variables
10501 .Ev COLUMNS
10503 .Ev LINES
10504 and the variable
10505 .Va crt .
10507 .It Va searchheaders
10508 \*(BO Expand message-list specifiers in the form
10509 .Ql /x:y
10510 to all messages containing the substring
10511 .Dq y
10512 in the header field
10513 .Ql x .
10514 The string search is case insensitive.
10516 .It Va sendcharsets
10517 \*(OP A comma-separated list of character set names that can be used in
10518 outgoing internet mail.
10519 The value of the variable
10520 .Va charset-8bit
10521 is automatically appended to this list of character sets.
10522 If no character set conversion capabilities are compiled into \*(UA then
10523 the only supported charset is
10524 .Va ttycharset .
10525 Also see
10526 .Va sendcharsets-else-ttycharset
10527 and refer to the section
10528 .Sx "Character sets"
10529 for the complete picture of character set conversion in \*(UA.
10531 .It Va sendcharsets-else-ttycharset
10532 \*(BO\*(OP If this variable is set, but
10533 .Va sendcharsets
10534 is not, then \*(UA acts as if
10535 .Va sendcharsets
10536 had been set to the value of the variable
10537 .Va ttycharset .
10538 In effect this combination passes through the message data in the
10539 character set of the current locale encoding:
10540 therefore mail message text will be (assumed to be) in ISO-8859-1
10541 encoding when send from within a ISO-8859-1 locale, and in UTF-8
10542 encoding when send from within an UTF-8 locale.
10544 The 8-bit fallback
10545 .Va charset-8bit
10546 never comes into play as
10547 .Va ttycharset
10548 is implicitly assumed to be 8-bit and capable to represent all files the
10549 user may specify (as is the case when no character set conversion
10550 support is available in \*(UA and the only supported character set is
10551 .Va ttycharset :
10552 .Sx "Character sets" ) .
10553 This might be a problem for scripts which use the suggested
10554 .Ql LC_ALL=C
10555 setting, since in this case the character set is US-ASCII by definition,
10556 so that it is better to also override
10557 .Va ttycharset ,
10558 then.
10560 .It Va sender
10561 An address that is put into the
10562 .Ql Sender:
10563 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
10564 responsible for the actual transmission of the message.
10565 This field should normally not be used unless the
10566 .Va from
10567 field contains more than one address, on which case it is required.
10569 .Va \&\&sender
10570 address is handled as if it were in the
10571 .Ic alternates
10572 list; also see
10573 .Fl r ,
10574 .Va r-option-implicit .
10575 .It Va sendmail
10576 \*(OB Predecessor of
10577 .Va mta .
10578 .It Va sendmail-arguments
10579 \*(OB Predecessor of
10580 .Va mta-arguments .
10581 .It Va sendmail-no-default-arguments
10582 \*(OB\*(BO Predecessor of
10583 .Va mta-no-default-arguments .
10584 .It Va sendmail-progname
10585 \*(OB Predecessor of
10586 .Va mta-argv0 .
10588 .It Va sendwait
10589 \*(BO When sending a message wait until the
10590 .Va mta
10591 (including the built-in SMTP one) exits before accepting further commands.
10592 .Sy Only
10593 with this variable set errors reported by the MTA will be recognizable!
10594 If the MTA returns a non-zero exit status,
10595 the exit status of \*(UA will also be non-zero.
10597 .It Va showlast
10598 \*(BO This setting causes \*(UA to start at the last message
10599 instead of the first one when opening a mail folder, as well as with
10600 .Ic from
10602 .Ic headers .
10604 .It Va showname
10605 \*(BO Causes \*(UA to use the sender's real name instead of the plain
10606 address in the header field summary and in message specifications.
10608 .It Va showto
10609 \*(BO Causes the recipient of the message to be shown in the header
10610 summary if the message was sent by the user.
10612 .It Va Sign
10613 The value backing
10614 .Ic ~A ,
10615 one of the
10616 .Sx "COMMAND ESCAPES" .
10617 Also see
10618 .Va message-inject-tail ,
10619 .Va on-compose-leave
10621 .Va on-compose-splice .
10623 .It Va sign
10624 The value backing
10625 .Ic ~a ,
10626 one of the
10627 .Sx "COMMAND ESCAPES" .
10628 Also see
10629 .Va message-inject-tail ,
10630 .Va on-compose-leave
10632 .Va on-compose-splice .
10634 .It Va signature
10635 \*(OB Please use
10636 .Va on-compose-splice
10638 .Va on-compose-splice-shell
10640 .Va on-compose-leave
10641 and (if necessary)
10642 .Va message-inject-tail
10643 instead!
10645 .It Va skipemptybody
10646 \*(BO If an outgoing message does not contain any text in its first or
10647 only message part, do not send it but discard it silently (see also the
10648 command line option
10649 .Fl E ) .
10652 .It Va smime-ca-dir , smime-ca-file
10653 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
10654 Enhanced Mail) format as a directory and a file, respectively, for the
10655 purpose of verification of S/MIME signed messages.
10656 It is possible to set both, the file will be loaded immediately, the
10657 directory will be searched whenever no match has yet been found.
10658 The set of CA certificates which are built into the SSL/TLS library can
10659 be explicitly turned off by setting
10660 .Va smime-ca-no-defaults ,
10661 and further fine-tuning is possible via
10662 .Va smime-ca-flags .
10664 .It Va smime-ca-flags
10665 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
10666 storage, and the certificate verification that is used.
10667 The actual values and their meanings are documented for
10668 .Va ssl-ca-flags .
10670 .It Va smime-ca-no-defaults
10671 \*(BO\*(OP Do not load the default CA locations that are built into the
10672 used to SSL/TLS library to verify S/MIME signed messages.
10673 .Mx Va smime-cipher
10674 .It Va smime-cipher-USER@HOST , smime-cipher
10675 \*(OP Specifies the cipher to use when generating S/MIME encrypted
10676 messages (for the specified account).
10677 RFC 5751 mandates a default of
10678 .Ql aes128
10679 (AES-128 CBC).
10680 Possible values are (case-insensitive and) in decreasing cipher strength:
10681 .Ql aes256
10682 (AES-256 CBC),
10683 .Ql aes192
10684 (AES-192 CBC),
10685 .Ql aes128
10686 (AES-128 CBC),
10687 .Ql des3
10688 (DES EDE3 CBC, 168 bits; default if
10689 .Ql aes128
10690 is not available) and
10691 .Ql des
10692 (DES CBC, 56 bits).
10694 The actually available cipher algorithms depend on the cryptographic
10695 library that \*(UA uses.
10696 \*(OP Support for more cipher algorithms may be available through
10697 dynamic loading via, e.g.,
10698 .Xr EVP_get_cipherbyname 3
10699 (OpenSSL) if \*(UA has been compiled to support this.
10701 .It Va smime-crl-dir
10702 \*(OP Specifies a directory that contains files with CRLs in PEM format
10703 to use when verifying S/MIME messages.
10705 .It Va smime-crl-file
10706 \*(OP Specifies a file that contains a CRL in PEM format to use when
10707 verifying S/MIME messages.
10709 .It Va smime-encrypt-USER@HOST
10710 \*(OP If this variable is set, messages send to the given receiver are
10711 encrypted before sending.
10712 The value of the variable must be set to the name of a file that
10713 contains a certificate in PEM format.
10715 If a message is sent to multiple recipients,
10716 each of them for whom a corresponding variable is set will receive an
10717 individually encrypted message;
10718 other recipients will continue to receive the message in plain text
10719 unless the
10720 .Va smime-force-encryption
10721 variable is set.
10722 It is recommended to sign encrypted messages, i.e., to also set the
10723 .Va smime-sign
10724 variable.
10726 .It Va smime-force-encryption
10727 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
10729 .It Va smime-sign
10730 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
10731 and include the user's certificate as a MIME attachment.
10732 Signing a message enables a recipient to verify that the sender used
10733 a valid certificate,
10734 that the email addresses in the certificate match those in the message
10735 header and that the message content has not been altered.
10736 It does not change the message text,
10737 and people will be able to read the message as usual.
10738 Also see
10739 .Va smime-sign-cert , smime-sign-include-certs
10741 .Va smime-sign-message-digest .
10742 .Mx Va smime-sign-cert
10743 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
10744 \*(OP Points to a file in PEM format.
10745 For the purpose of signing and decryption this file needs to contain the
10746 user's private key, followed by his certificate.
10748 For message signing
10749 .Ql USER@HOST
10750 is always derived from the value of
10751 .Va from
10752 (or, if that contains multiple addresses,
10753 .Va sender ) .
10754 For the purpose of encryption the recipient's public encryption key
10755 (certificate) is expected; the command
10756 .Ic certsave
10757 can be used to save certificates of signed messages (the section
10758 .Sx "Signed and encrypted messages with S/MIME"
10759 gives some details).
10760 This mode of operation is usually driven by the specialized form.
10762 When decrypting messages the account is derived from the recipient
10763 fields
10764 .Pf ( Ql To:
10766 .Ql Cc: )
10767 of the message, which are searched for addresses for which such
10768 a variable is set.
10769 \*(UA always uses the first address that matches,
10770 so if the same message is sent to more than one of the user's addresses
10771 using different encryption keys, decryption might fail.
10773 For signing and decryption purposes it is possible to use encrypted
10774 keys, and the pseudo-host(s)
10775 .Ql USER@HOST.smime-cert-key
10776 for the private key
10777 (and
10778 .Ql USER@HOST.smime-cert-cert
10779 for the certificate stored in the same file)
10780 will be used for performing any necessary password lookup,
10781 therefore the lookup can be automated via the mechanisms described in
10782 .Sx "On URL syntax and credential lookup" .
10783 For example, the hypothetical address
10784 .Ql bob@exam.ple
10785 could be driven with a private key / certificate pair path defined in
10786 .Va \&\&smime-sign-cert-bob@exam.ple ,
10787 and needed passwords would then be looked up via the pseudo hosts
10788 .Ql bob@exam.ple.smime-cert-key
10789 (and
10790 .Ql bob@exam.ple.smime-cert-cert ) .
10791 To include intermediate certificates, use
10792 .Va smime-sign-include-certs .
10793 .Mx Va smime-sign-include-certs
10794 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
10795 \*(OP If used, this is supposed to a consist of a comma-separated list
10796 of files, each of which containing a single certificate in PEM format to
10797 be included in the S/MIME message in addition to the
10798 .Va smime-sign-cert
10799 certificate.
10800 This can be used to include intermediate certificates of the certificate
10801 authority, in order to allow the receiver's S/MIME implementation to
10802 perform a verification of the entire certificate chain, starting from
10803 a local root certificate, over the intermediate certificates, down to the
10804 .Va smime-sign-cert .
10805 Even though top level certificates may also be included in the chain,
10806 they won't be used for the verification on the receiver's side.
10808 For the purpose of the mechanisms involved here,
10809 .Ql USER@HOST
10810 refers to the content of the internal variable
10811 .Va from
10812 (or, if that contains multiple addresses,
10813 .Va sender ) .
10814 The pseudo-host
10815 .Ql USER@HOST.smime-include-certs
10816 will be used for performing password lookups for these certificates,
10817 shall they have been given one, therefore the lookup can be automated
10818 via the mechanisms described in
10819 .Sx "On URL syntax and credential lookup" .
10820 .Mx Va smime-sign-message-digest
10821 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
10822 \*(OP Specifies the message digest to use when signing S/MIME messages.
10823 RFC 5751 mandates a default of
10824 .Ql sha1 .
10825 Possible values are (case-insensitive and) in decreasing cipher strength:
10826 .Ql sha512 ,
10827 .Ql sha384 ,
10828 .Ql sha256 ,
10829 .Ql sha224
10831 .Ql md5 .
10833 The actually available message digest algorithms depend on the
10834 cryptographic library that \*(UA uses.
10835 \*(OP Support for more message digest algorithms may be available
10836 through dynamic loading via, e.g.,
10837 .Xr EVP_get_digestbyname 3
10838 (OpenSSL) if \*(UA has been compiled to support this.
10839 Remember that for this
10840 .Ql USER@HOST
10841 refers to the variable
10842 .Va from
10843 (or, if that contains multiple addresses,
10844 .Va sender ) .
10845 .It Va smtp
10846 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
10847 .Va mta .
10848 \*(ID For compatibility reasons a set
10849 .Va smtp
10850 is used in preference of
10851 .Va mta .
10852 .Mx Va smtp-auth
10853 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
10854 \*(OP Variable chain that controls the SMTP
10855 .Va mta
10856 authentication method, possible values are
10857 .Ql none
10858 (\*(OU default),
10859 .Ql plain
10860 (\*(IN default),
10861 .Ql login
10862 as well as the \*(OPal methods
10863 .Ql cram-md5
10865 .Ql gssapi .
10867 .Ql none
10868 method does not need any user credentials,
10869 .Ql gssapi
10870 requires a user name and all other methods require a user name and
10871 a password.
10872 See \*(IN
10873 .Va mta ,
10874 .Va user
10876 .Va password
10877 (\*(OU
10878 .Va smtp-auth-password
10880 .Va smtp-auth-user ) .
10881 Note that
10882 .Va smtp-auth-HOST
10883 is \*(IN.
10884 \*(OU: Note for
10885 .Va smtp-auth-USER@HOST :
10886 may override dependent on sender address in the variable
10887 .Va from .
10888 .It Va smtp-auth-password
10889 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
10890 If the authentication method requires a password, but neither
10891 .Va smtp-auth-password
10892 nor a matching
10893 .Va smtp-auth-password-USER@HOST
10894 can be found,
10895 \*(UA will ask for a password on the user's terminal.
10896 .It Va smtp-auth-password-USER@HOST
10897 \*(OU Overrides
10898 .Va smtp-auth-password
10899 for specific values of sender addresses, dependent upon the variable
10900 .Va from .
10901 .It Va smtp-auth-user
10902 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
10903 If the authentication method requires a user name, but neither
10904 .Va smtp-auth-user
10905 nor a matching
10906 .Va smtp-auth-user-USER@HOST
10907 can be found,
10908 \*(UA will ask for a user name on the user's terminal.
10909 .It Va smtp-auth-user-USER@HOST
10910 \*(OU Overrides
10911 .Va smtp-auth-user
10912 for specific values of sender addresses, dependent upon the variable
10913 .Va from .
10915 .It Va smtp-hostname
10916 \*(OP\*(IN Normally \*(UA uses the variable
10917 .Va from
10918 to derive the necessary
10919 .Ql USER@HOST
10920 information in order to issue a
10921 .Ql MAIL FROM:<>
10922 SMTP
10923 .Va mta
10924 command.
10925 Setting
10926 .Va smtp-hostname
10927 can be used to use the
10928 .Ql USER
10929 from the SMTP account
10930 .Pf ( Va mta
10931 or the
10932 .Va user
10933 variable chain)
10934 and the
10935 .Ql HOST
10936 from the content of this variable (or, if that is the empty string,
10937 .Va hostname
10938 or the local hostname as a last resort).
10939 This often allows using an address that is itself valid but hosted by
10940 a provider other than which (in
10941 .Va from )
10942 is about to send the message.
10943 Setting this variable also influences generated
10944 .Ql Message-ID:
10946 .Ql Content-ID:
10947 header fields.
10948 If the \*(OPal IDNA support is available (see
10949 .Va idna-disable )
10950 variable assignment is aborted when a necessary conversion fails.
10951 .Mx Va smtp-use-starttls
10952 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
10953 \*(BO\*(OP Causes \*(UA to issue a
10954 .Ql STARTTLS
10955 command to make an SMTP
10956 .Va mta
10957 session SSL/TLS encrypted, i.e., to enable transport layer security.
10958 .Mx Va socks-proxy
10959 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
10960 \*(OP If this is set to the hostname (SOCKS URL) of a SOCKS5 server then
10961 \*(UA will proxy all of its network activities through it.
10962 This can be used to proxy SMTP, POP3 etc. network traffic through the
10963 Tor anonymizer, for example.
10964 The following would create a local SOCKS proxy on port 10000 that
10965 forwards to the machine
10966 .Ql HOST ,
10967 and from which the network traffic is actually instantiated:
10968 .Bd -literal -offset indent
10969 # Create local proxy server in terminal 1 forwarding to HOST
10970 $ ssh -D 10000 USER@HOST
10971 # Then, start a client that uses it in terminal 2
10972 $ \*(uA -Ssocks-proxy-USER@HOST=localhost:10000
10975 .It Va spam-interface
10976 \*(OP In order to use any of the spam-related commands (like, e.g.,
10977 .Ic spamrate )
10978 the desired spam interface must be defined by setting this variable.
10979 Please refer to the manual section
10980 .Sx "Handling spam"
10981 for the complete picture of spam handling in \*(UA.
10982 All or none of the following interfaces may be available:
10983 .Bl -tag -width ".It Ql _ilte_"
10984 .It Ql spamc
10985 Interaction with
10986 .Xr spamc 1
10987 from the
10988 .Xr spamassassin 1
10989 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
10990 suite.
10991 Different to the generic filter interface \*(UA will automatically add
10992 the correct arguments for a given command and has the necessary
10993 knowledge to parse the program's output.
10994 A default value for
10995 .Va spamc-command
10996 will have been compiled into the \*(UA binary if
10997 .Xr spamc 1
10998 has been found in
10999 .Ev PATH
11000 during compilation.
11001 Shall it be necessary to define a specific connection type (rather than
11002 using a configuration file for that), the variable
11003 .Va spamc-arguments
11004 can be used as in, e.g.,
11005 .Ql -d server.example.com -p 783 .
11006 It is also possible to specify a per-user configuration via
11007 .Va spamc-user .
11008 Note that this interface does not inspect the
11009 .Ql is-spam
11010 flag of a message for the command
11011 .Ic spamforget .
11012 .It Ql filter
11013 generic spam filter support via freely configurable hooks.
11014 This interface is meant for programs like
11015 .Xr bogofilter 1
11016 and requires according behaviour in respect to the hooks' exit
11017 status for at least the command
11018 .Ic spamrate
11019 .Pf ( Ql 0
11020 meaning a message is spam,
11021 .Ql 1
11022 for non-spam,
11023 .Ql 2
11024 for unsure and any other return value indicating a hard error);
11025 since the hooks can include shell code snippets diverting behaviour
11026 can be intercepted as necessary.
11027 The hooks are
11028 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
11029   spamfilter-rate
11031 .Va spamfilter-spam ;
11032 the manual section
11033 .Sx "Handling spam"
11034 contains examples for some programs.
11035 The process environment of the hooks will have the variable
11036 .Ev MAILX_FILENAME_GENERATED
11037 set.
11038 Note that spam score support for
11039 .Ic spamrate
11040 is not supported unless the \*(OPtional regular expression support is
11041 available and the
11042 .Va spamfilter-rate-scanscore
11043 variable is set.
11046 .It Va spam-maxsize
11047 \*(OP Messages that exceed this size will not be passed through to the
11048 configured
11049 .Va spam-interface .
11050 If unset or 0, the default of 420000 bytes is used.
11052 .It Va spamc-command
11053 \*(OP The path to the
11054 .Xr spamc 1
11055 program for the
11056 .Ql spamc
11057 .Va spam-interface .
11058 Note that the path is not expanded, but used
11059 .Dq as is .
11060 A fallback path will have been compiled into the \*(UA binary if the
11061 executable had been found during compilation.
11063 .It Va spamc-arguments
11064 \*(OP Even though \*(UA deals with most arguments for the
11065 .Ql spamc
11066 .Va spam-interface
11067 automatically, it may at least sometimes be desirable to specify
11068 connection-related ones via this variable, e.g.,
11069 .Ql -d server.example.com -p 783 .
11071 .It Va spamc-user
11072 \*(OP Specify a username for per-user configuration files for the
11073 .Ql spamc
11074 .Va spam-interface .
11075 If this is set to the empty string then \*(UA will use the name of the
11076 current
11077 .Va user .
11083 .It Va spamfilter-ham , spamfilter-noham , \
11084   spamfilter-nospam , spamfilter-rate , spamfilter-spam
11085 \*(OP Command and argument hooks for the
11086 .Ql filter
11087 .Va spam-interface .
11088 The manual section
11089 .Sx "Handling spam"
11090 contains examples for some programs.
11092 .It Va spamfilter-rate-scanscore
11093 \*(OP Because of the generic nature of the
11094 .Ql filter
11095 .Va spam-interface
11096 spam scores are not supported for it by default, but if the \*(OPnal
11097 regular expression support is available then setting this variable can
11098 be used to overcome this restriction.
11099 It is interpreted as follows: first a number (digits) is parsed that
11100 must be followed by a semicolon
11101 .Ql \&;
11102 and an extended regular expression.
11103 Then the latter is used to parse the first output line of the
11104 .Va spamfilter-rate
11105 hook, and, in case the evaluation is successful, the group that has been
11106 specified via the number is interpreted as a floating point scan score.
11107 .Mx Va ssl-ca-dir
11108 .Mx Va ssl-ca-file
11109 .It Va ssl-ca-dir-USER@HOST , ssl-ca-dir-HOST , ssl-ca-dir ,\
11110   ssl-ca-file-USER@HOST , ssl-ca-file-HOST , ssl-ca-file
11111 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
11112 Enhanced Mail) format as a directory and a file, respectively, for the
11113 purpose of verification of SSL/TLS server certificates.
11114 It is possible to set both, the file will be loaded immediately, the
11115 directory will be searched whenever no match has yet been found.
11116 The set of CA certificates which are built into the SSL/TLS library can
11117 be explicitly turned off by setting
11118 .Va ssl-ca-no-defaults ,
11119 and further fine-tuning is possible via
11120 .Va ssl-ca-flags ;
11121 also see
11122 .Xr SSL_CTX_load_verify_locations 3
11123 for more information.
11124 \*(UA will try to use the TLS/SNI (ServerNameIndication) extension when
11125 establishing TLS connections to servers identified with hostnames.
11126 .Mx Va ssl-ca-flags
11127 .It Va ssl-ca-flags-USER@HOST , ssl-ca-flags-HOST , ssl-ca-flags
11128 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
11129 storage, and the certificate verification that is used (also see
11130 .Va ssl-verify ) .
11131 The value is expected to consist of a comma-separated list of
11132 configuration directives, with any intervening whitespace being ignored.
11133 The directives directly map to flags that can be passed to
11134 .Xr X509_STORE_set_flags 3 ,
11135 which are usually defined in a file
11136 .Pa openssl/x509_vfy.h ,
11137 and the availability of which depends on the used SSL/TLS library
11138 version: a directive without mapping is ignored (error log subject to
11139 .Va debug ) .
11140 Directives currently understood (case-insensitively) include:
11142 .Bl -tag -compact -width ".It Cd BaNg"
11143 .It Cd no-alt-chains
11144 If the initial chain is not trusted, do not attempt to build an
11145 alternative chain.
11146 Setting this flag will make OpenSSL certificate verification match that
11147 of older OpenSSL versions, before automatic building and checking of
11148 alternative chains has been implemented; also see
11149 .Cd trusted-first .
11150 .It Cd no-check-time
11151 Do not check certificate/CRL validity against current time.
11152 .It Cd partial-chain
11153 By default partial, incomplete chains which cannot be verified up to the
11154 chain top, a self-signed root certificate, will not verify.
11155 With this flag set, a chain succeeds to verify if at least one signing
11156 certificate of the chain is in any of the configured trusted stores of
11157 CA certificates.
11158 The OpenSSL manual page
11159 .Xr SSL_CTX_load_verify_locations 3
11160 gives some advise how to manage your own trusted store of CA certificates.
11161 .It Cd strict
11162 Disable workarounds for broken certificates.
11163 .It Cd trusted-first
11164 Try building a chain using issuers in the trusted store first to avoid
11165 problems with server-sent legacy intermediate certificates.
11166 Newer versions of OpenSSL support alternative chain checking and enable
11167 it by default, resulting in the same behaviour; also see
11168 .Cd no-alt-chains .
11170 .Mx Va ssl-ca-no-defaults
11171 .It Va ssl-ca-no-defaults-USER@HOST , ssl-ca-no-defaults-HOST ,\
11172   ssl-ca-no-defaults
11173 \*(BO\*(OP Do not load the default CA locations that are built into the
11174 used to SSL/TLS library to verify SSL/TLS server certificates.
11175 .Mx Va ssl-cert
11176 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
11177 \*(OB\*(OP Please use the
11178 .Cd Certificate
11179 slot of
11180 .Va ssl-config-pairs .
11181 .Mx Va ssl-cipher-list
11182 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
11183 \*(OB\*(OP Please use the
11184 .Cd CipherList
11185 slot of
11186 .Va ssl-config-pairs .
11188 .It Va ssl-config-file
11189 \*(OP If this variable is set
11190 .Xr CONF_modules_load_file 3
11191 (if announced via
11192 .Ql +modules-load-file
11194 .Va ssl-features )
11195 is used to allow resource file based configuration of the SSL/TLS library.
11196 This happens once the library is used first, which may also be early
11197 during startup (logged with
11198 .Va verbose ) !
11199 If a non-empty value is given then the given file, after performing
11200 .Sx "Filename transformations" ,
11201 will be used instead of the global OpenSSL default, and it is an error
11202 if the file cannot be loaded.
11203 The application name will always be passed as
11204 .Ql \*(uA .
11205 Some SSL/TLS libraries support application-specific configuration via
11206 resource files loaded like this, please see
11207 .Va ssl-config-module .
11208 .Mx Va ssl-config-module
11209 .It Va ssl-config-module-USER@HOST , ssl-config-module-HOST ,\
11210   ssl-config-module
11211 \*(OP If file based application-specific configuration via
11212 .Va ssl-config-file
11213 is available, announced as
11214 .Ql +ctx-config
11216 .Va ssl-features ,
11217 indicating availability of
11218 .Xr SSL_CTX_config 3 ,
11219 then, it becomes possible to use a central SSL/TLS configuration file
11220 for all programs, including \*(uA, e.g.:
11221 .Bd -literal -offset indent
11222 # Register a configuration section for \*(uA
11223 \*(uA = mailx_master
11224 # The top configuration section creates a relation
11225 # in between dynamic SSL configuration and an actual
11226 # program specific configuration section
11227 [mailx_master]
11228 ssl_conf = mailx_ssl_config
11229 # Well that actual program specific configuration section
11230 # now can map individual ssl-config-module names to sections,
11231 # e.g., ssl-config-module=account_xy
11232 [mailx_ssl_config]
11233 account_xy = mailx_account_xy
11234 account_yz = mailx_account_yz
11235 [mailx_account_xy]
11236 MinProtocol = TLSv1.2
11237 Curves=P-521
11238 [mailx_account_yz]
11239 CipherString = TLSv1.2:!aNULL:!eNULL:
11240 MinProtocol = TLSv1.1
11241 Options = Bugs
11243 .Mx Va ssl-config-pairs
11244 .It Va ssl-config-pairs-USER@HOST , ssl-config-pairs-HOST , ssl-config-pairs
11245 \*(OP The value of this variable chain will be interpreted as
11246 a comma-separated list of directive/value pairs.
11247 Different to when placing these pairs in a
11248 .Va ssl-config-module
11249 section of a
11250 .Va ssl-config-file
11251 commas
11252 .Ql \&,
11253 need to be escaped with a reverse solidus
11254 .Ql \e
11255 when included in pairs.
11256 Just likewise directives and values need to be separated by equals signs
11257 .Ql = ,
11258 any whitespace surrounding pair members is removed.
11259 Keys are (usually) case-insensitive.
11260 Unless proper support is announced by
11261 .Va ssl-features
11262 .Pf ( Ql +conf-ctx )
11263 only the keys below are supported, otherwise the pairs will be used
11264 directly as arguments to the function
11265 .Xr SSL_CONF_cmd 3 .
11266 Said equals sign
11267 .Ql =
11268 may be preceded with an asterisk
11269 .Ql *
11270 to indicate that
11271 .Sx "Filename transformations"
11272 shall be performed on the value; it is an error if these fail.
11274 .Bl -tag -compact -width ".It Cd C_rtificate"
11275 .It Cd Certificate
11276 Filename of a SSL/TLS client certificate (chain) required by some servers.
11277 Fallback support via
11278 .Xr SSL_CTX_use_certificate_chain_file 3 .
11279 .Sx "Filename transformations"
11280 are performed.
11281 .Sy Note:
11282 if you use this you need to specify the private key via
11283 .Cd PrivateKey ,
11284 .Va ssl-key
11285 will not be used!
11286 .It Cd CipherList
11287 A list of ciphers for SSL/TLS connections, see
11288 .Xr ciphers 1 .
11289 By default no list of ciphers is set, resulting in a
11290 .Cd Protocol Ns - Ns
11291 specific list of ciphers (the protocol standards define lists of
11292 acceptable ciphers; possibly cramped by the used SSL/TLS library).
11293 Fallback support via
11294 .Xr SSL_CTX_set_cipher_list 3 .
11295 .It Cd Curves
11296 A list of supported elliptic curves, if applicable.
11297 By default no curves are set.
11298 Fallback support via
11299 .Xr SSL_CTX_set1_curves_list 3 ,
11300 if available.
11301 .It Cd MaxProtocol , MinProtocol
11302 The maximum and minimum supported SSL/TLS versions, respectively.
11303 Optional fallback support via
11304 .Xr SSL_CTX_set_max_proto_version 3
11306 .Xr SSL_CTX_set_min_proto_version 3
11308 .Va ssl-features
11309 announces
11310 .Ql +ctx-set-maxmin-proto ,
11311 otherwise this directive results in an error.
11312 The fallback uses an internal parser which understands the strings
11313 .Ql SSLv3 ,
11314 .Ql TLSv1 ,
11315 .Ql TLSv1.1 ,
11316 .Ql TLSv1.2 ,
11317 and the special value
11318 .Ql None ,
11319 which disables the given limit.
11320 .It Cd Options
11321 Various flags to set.
11322 Fallback via
11323 .Xr SSL_CTX_set_options 3 ,
11324 in which case any other value but (exactly)
11325 .Ql Bugs
11326 results in an error.
11327 .It Cd PrivateKey
11328 Filename of the private key in PEM format of a SSL/TLS client certificate.
11329 If unset, the name of the certificate file is used.
11330 .Sx "Filename transformations"
11331 are performed.
11332 Fallback via
11333 .Xr SSL_CTX_use_PrivateKey_file 3 .
11334 .Sy Note:
11335 if you use this you need to specify the certificate (chain) via
11336 .Cd Certificate ,
11337 .Va ssl-cert
11338 will not be used!
11339 .It Cd Protocol
11340 The used SSL/TLS protocol.
11342 .Va ssl-features
11343 announces
11344 .Ql +conf-ctx
11346 .Ql ctx-set-maxmin-proto
11347 then using
11348 .Cd MaxProtocol
11350 .Cd MinProtocol
11351 is preferable.
11352 Fallback is
11353 .Xr SSL_CTX_set_options 3 ,
11354 driven via an internal parser which understands the strings
11355 .Ql SSLv3 ,
11356 .Ql TLSv1 ,
11357 .Ql TLSv1.1 ,
11358 .Ql TLSv1.2 ,
11359 and the special value
11360 .Ql ALL .
11361 Multiple protocols may be given as a comma-separated list, any
11362 whitespace is ignored, an optional plus sign
11363 .Ql +
11364 prefix enables, a hyphen-minus
11365 .Ql -
11366 prefix disables a protocol, so that
11367 .Ql -ALL, TLSv1.2
11368 enables only the TLSv1.2 protocol.
11372 .It Va ssl-crl-dir , ssl-crl-file
11373 \*(OP Specify a directory / a file, respectively that contains a CRL in
11374 PEM format to use when verifying SSL/TLS server certificates.
11375 .Mx Va ssl-curves
11376 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
11377 \*(OB\*(OP Please use the
11378 .Cd Curves
11379 slot of
11380 .Va ssl-config-pairs .
11382 .It Va ssl-features
11383 \*(OP\*(RO This expands to a comma separated list of the TLS/SSL library
11384 identity and optional TLS/SSL library features.
11385 Currently supported identities are
11386 .Ql libressl
11387 (LibreSSL) ,
11388 .Ql libssl-0x10100
11389 (OpenSSL v1.1.x series)
11391 .Ql libssl-0x10000
11392 (elder OpenSSL series, other clones).
11393 Optional features are preceded with a plus sign
11394 .Ql +
11395 when available, and with a hyphen-minus
11396 .Ql -
11397 otherwise:
11398 .Ql modules-load-file
11399 .Pf ( Va ssl-config-file ) ,
11400 .Ql conf-ctx
11401 .Pf ( Va ssl-config-pairs ) ,
11402 .Ql ctx-config
11403 .Pf ( Va ssl-config-module ) ,
11404 .Ql ctx-set-maxmin-proto
11405 .Pf ( Va ssl-config-pairs )
11407 .Ql rand-egd
11408 .Pf ( Va ssl-rand-egd ) .
11409 .Mx Va ssl-key
11410 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
11411 \*(OB\*(OP Please use the
11412 .Cd PrivateKey
11413 slot of
11414 .Va ssl-config-pairs .
11415 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
11416 \*(OB\*(OP Please use the
11417 .Cd Protocol
11418 slot of
11419 .Va ssl-config-pairs .
11420 .Mx Va ssl-protocol
11421 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
11422 \*(OB\*(OP Please use the
11423 .Cd Protocol
11424 slot of
11425 .Va ssl-config-pairs .
11427 .It Va ssl-rand-egd
11428 \*(OP Gives the pathname to an entropy daemon socket, see
11429 .Xr RAND_egd 3 .
11430 Not all SSL/TLS libraries support this,
11431 .Va ssl-features
11432 announces availability with
11433 .Ql +rand-egd .
11435 .It Va ssl-rand-file
11436 \*(OP Gives the filename to a file with random entropy data, see
11437 .Xr RAND_load_file 3 .
11438 If this variable is not set, or set to the empty string, or if the
11439 .Sx "Filename transformations"
11440 fail, then
11441 .Xr RAND_file_name 3
11442 will be used to create the filename.
11443 If the SSL PRNG was seeded successfully
11444 The file will be updated
11445 .Pf ( Xr RAND_write_file 3 )
11446 if and only if seeding and buffer stirring succeeds.
11447 This variable is only used if
11448 .Va ssl-rand-egd
11449 is not set (or not supported by the SSL/TLS library).
11450 .Mx Va ssl-verify
11451 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
11452 \*(OP Variable chain that sets the action to be performed if an error
11453 occurs during SSL/TLS server certificate validation against the
11454 specified or default trust stores
11455 .Va ssl-ca-dir ,
11456 .Va ssl-ca-file ,
11457 or the SSL/TLS library built-in defaults (unless usage disallowed via
11458 .Va ssl-ca-no-defaults ) ,
11459 and as fine-tuned via
11460 .Va ssl-ca-flags .
11461 Valid (case-insensitive) values are
11462 .Ql strict
11463 (fail and close connection immediately),
11464 .Ql ask
11465 (ask whether to continue on standard input),
11466 .Ql warn
11467 (show a warning and continue),
11468 .Ql ignore
11469 (do not perform validation).
11470 The default is
11471 .Ql ask .
11473 .It Va stealthmua
11474 If only set without an assigned value, then this setting inhibits the
11475 generation of the
11476 .Ql Message-ID: ,
11477 .Ql Content-ID:
11479 .Ql User-Agent:
11480 header fields that include obvious references to \*(UA.
11481 There are two pitfalls associated with this:
11482 First, the message id of outgoing messages is not known anymore.
11483 Second, an expert may still use the remaining information in the header
11484 to track down the originating mail user agent.
11485 If set to the value
11486 .Ql noagent ,
11487 then the mentioned
11488 .Ql Message-ID:
11490 .Ql Content-ID:
11491 suppression does not occur.
11493 .It Va termcap
11494 (\*(OP) This specifies a comma-separated list of
11495 .Lb libterminfo
11496 and/or
11497 .Lb libtermcap
11498 capabilities (see
11499 .Sx "On terminal control and line editor" ,
11500 escape commas with reverse solidus) to be used to overwrite or define
11501 entries.
11502 .Sy Note
11503 this variable will only be queried once at program startup and can
11504 thus only be specified in resource files or on the command line.
11506 String capabilities form
11507 .Ql cap=value
11508 pairs and are expected unless noted otherwise.
11509 Numerics have to be notated as
11510 .Ql cap#number
11511 where the number is expected in normal decimal notation.
11512 Finally, booleans do not have any value but indicate a true or false
11513 state simply by being defined or not; this indeed means that \*(UA
11514 does not support undefining an existing boolean.
11515 String capability values will undergo some expansions before use:
11516 for one notations like
11517 .Ql ^LETTER
11518 stand for
11519 .Ql control-LETTER ,
11520 and for clarification purposes
11521 .Ql \eE
11522 can be used to specify
11523 .Ql escape
11524 (the control notation
11525 .Ql ^[
11526 could lead to misreadings when a left bracket follows, which it does for
11527 the standard CSI sequence);
11528 finally three letter octal sequences, as in
11529 .Ql \e061 ,
11530 are supported.
11531 To specify that a terminal supports 256-colours, and to define sequences
11532 that home the cursor and produce an audible bell, one might write:
11533 .Bd -literal -offset indent
11534 ? set termcap='Co#256,home=\eE[H,bel=^G'
11537 The following terminal capabilities are or may be meaningful for the
11538 operation of the built-in line editor or \*(UA in general:
11540 .Bl -tag -compact -width ".It Cd yay"
11541 .It Cd colors Ns \0or Cd Co
11542 .Cd max_colors :
11543 numeric capability specifying the maximum number of colours.
11544 Note that \*(UA does not actually care about the terminal beside that,
11545 but always emits ANSI / ISO 6429 escape sequences.
11546 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
11547 .Cd exit_ca_mode
11549 .Cd enter_ca_mode ,
11550 respectively: exit and enter the alternative screen ca-mode,
11551 effectively turning \*(UA into a fullscreen application.
11552 This must be enabled explicitly by setting
11553 .Va termcap-ca-mode .
11554 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
11555 .Cd keypad_xmit
11557 .Cd keypad_local ,
11558 respectively: enable and disable the keypad.
11559 This is always enabled if available, because it seems even keyboards
11560 without keypads generate other key codes for, e.g., cursor keys in that
11561 case, and only if enabled we see the codes that we are interested in.
11562 .It Cd ed Ns \0or Cd cd
11563 .Cd clr_eos :
11564 clear the screen.
11565 .It Cd clear Ns \0or Cd cl
11566 .Cd clear_screen :
11567 clear the screen and home cursor.
11568 (Will be simulated via
11569 .Cd ho
11570 plus
11571 .Cd cd . )
11572 .It Cd home Ns \0or Cd ho
11573 .Cd cursor_home :
11574 home cursor.
11575 .It Cd el Ns \0or Cd ce
11576 .Cd clr_eol :
11577 clear to the end of line.
11578 (Will be simulated via
11579 .Cd ch
11580 plus repetitions of space characters.)
11581 .It Cd hpa Ns \0or Cd ch
11582 .Cd column_address :
11583 move the cursor (to the given column parameter) in the current row.
11584 (Will be simulated via
11585 .Cd cr
11586 plus
11587 .Cd nd . )
11588 .It Cd cr
11589 .Cd carriage_return :
11590 move to the first column in the current row.
11591 The default built-in fallback is
11592 .Ql \er .
11593 .It Cd cub1 Ns \0or Cd le
11594 .Cd cursor_left :
11595 move the cursor left one space (non-destructively).
11596 The default built-in fallback is
11597 .Ql \eb .
11598 .It Cd cuf1 Ns \0or Cd nd
11599 .Cd cursor_right :
11600 move the cursor right one space (non-destructively).
11601 The default built-in fallback is
11602 .Ql \eE[C ,
11603 which is used by most terminals.
11604 Less often occur
11605 .Ql \eEC
11607 .Ql \eEOC .
11610 Many more capabilities which describe key-sequences are documented for
11611 .Ic bind .
11613 .It Va termcap-ca-mode
11614 \*(OP Allow usage of the
11615 .Cd exit_ca_mode
11617 .Cd enter_ca_mode
11618 terminal capabilities, effectively turning \*(UA into a fullscreen
11619 application, as documented for
11620 .Va termcap .
11621 .Sy Note
11622 this variable will only be queried once at program startup and can
11623 thus only be specified in resource files or on the command line.
11625 .It Va termcap-disable
11626 \*(OP Disable any interaction with a terminal control library.
11627 If set only some generic fallback built-ins and possibly the content of
11628 .Va termcap
11629 describe the terminal to \*(UA.
11630 .Sy Note
11631 this variable will only be queried once at program startup and can
11632 thus only be specified in resource files or on the command line.
11634 .It Va toplines
11635 If defined, gives the number of lines of a message to be displayed
11636 with the command
11637 .Ic top ;
11638 if unset, the first five lines are printed, if set to 0 the variable
11639 .Va screen
11640 is inspected.
11641 If the value is negative then its absolute value will be used for
11642 unsigned right shifting (see
11643 .Ic vexpr )
11645 .Va screen
11646 height.
11648 .It Va topsqueeze
11649 \*(BO If set then the
11650 .Ic top
11651 command series will strip adjacent empty lines and quotations.
11653 .It Va ttycharset
11654 The character set of the terminal \*(UA operates on,
11655 and the one and only supported character set that \*(UA can use if no
11656 character set conversion capabilities have been compiled into it,
11657 in which case it defaults to ISO-8859-1.
11658 Otherwise it defaults to UTF-8.
11659 Sufficient locale support provided the default will be preferably
11660 deduced from the locale environment if that is set (e.g.,
11661 .Ev LC_CTYPE ,
11662 see there for more); runtime locale changes will be reflected by
11663 .Va \&\&ttycharset
11664 except during the program startup phase and if
11665 .Fl S
11666 had been used to freeze the given value.
11667 Refer to the section
11668 .Sx "Character sets"
11669 for the complete picture about character sets.
11671 .It Va typescript-mode
11672 \*(BO A special multiplex variable that disables all variables and
11673 settings which result in behaviour that interferes with running \*(UA in
11674 .Xr script 1 ,
11675 e.g., it sets
11676 .Va colour-disable ,
11677 .Va line-editor-disable
11678 and (before startup completed only)
11679 .Va termcap-disable .
11680 Unsetting it does not restore the former state of the covered settings.
11682 .It Va umask
11683 For a safe-by-default policy the process file mode creation mask
11684 .Xr umask 2
11685 will be set to
11686 .Ql 0077
11687 on program startup by default.
11688 Child processes inherit the file mode creation mask of their parent, and
11689 by setting this variable to an empty value no change will be applied,
11690 and the inherited value will be used.
11691 Otherwise the given value will be made the new file mode creation mask.
11692 .Mx Va user
11693 .It Va user-HOST , user
11694 \*(IN Variable chain that sets a global fallback user name, which is
11695 used in case none has been given in the protocol and account-specific
11696 URL.
11697 This variable defaults to the name of the user who runs \*(UA.
11699 .It Va v15-compat
11700 \*(BO Setting this enables upward compatibility with \*(UA
11701 version 15.0 in respect to which configuration options are available and
11702 how they are handled.
11703 This manual uses \*(IN and \*(OU to refer to the new and the old way of
11704 doing things, respectively.
11706 .It Va verbose
11707 \*(BO This setting, also controllable via the command line option
11708 .Fl v ,
11709 causes \*(UA to be more verbose, e.g., it will display obsoletion
11710 warnings and SSL/TLS certificate chains.
11711 Even though marked \*(BO this option may be set twice in order to
11712 increase the level of verbosity even more, in which case even details of
11713 the actual message delivery and protocol conversations are shown.
11714 A single
11715 .Pf no Va verbose
11716 is sufficient to disable verbosity as such.
11722 .It Va version , version-date , \
11723   version-hexnum , version-major , version-minor , version-update
11724 \*(RO \*(UA version information: the first variable is a string with
11725 the complete version identification, the second the release date in ISO
11726 8601 notation without time.
11727 The third is a 32-bit hexadecimal number with the upper 8 bits storing
11728 the major, followed by the minor and update version numbers which occupy
11729 12 bits each.
11730 The latter three variables contain only decimal digits: the major, minor
11731 and update version numbers.
11732 The output of the command
11733 .Ic version
11734 will include this information.
11736 .It Va writebackedited
11737 If this variable is set messages modified using the
11738 .Ic edit
11740 .Ic visual
11741 commands are written back to the current folder when it is quit;
11742 it is only honoured for writable folders in MBOX format, though.
11743 Note that the editor will be pointed to the raw message content in that
11744 case, i.e., neither MIME decoding nor decryption will have been
11745 performed, and proper RFC 4155
11746 .Ql From_
11747 quoting of newly added or edited content is also left as an exercise to
11748 the user.
11750 .Sh ENVIRONMENT
11751 The term
11752 .Dq environment variable
11753 should be considered an indication that these variables are either
11754 standardized as vivid parts of process environments, or that they are
11755 commonly found in there.
11756 The process environment is inherited from the
11757 .Xr sh 1
11758 once \*(UA is started, and unless otherwise explicitly noted handling of
11759 the following variables transparently integrates into that of the
11760 .Sx "INTERNAL VARIABLES"
11761 from \*(UA's point of view.
11762 This means that, e.g., they can be managed via
11763 .Ic set
11765 .Ic unset ,
11766 causing automatic program environment updates (to be inherited by
11767 newly created child processes).
11769 In order to transparently integrate other environment variables equally
11770 they need to be imported (linked) with the command
11771 .Ic environ .
11772 This command can also be used to set and unset non-integrated
11773 environment variables from scratch, sufficient system support provided.
11774 The following example, applicable to a POSIX shell, sets the
11775 .Ev COLUMNS
11776 environment variable for \*(UA only, and beforehand exports the
11777 .Ev EDITOR
11778 in order to affect any further processing in the running shell:
11779 .Bd -literal -offset indent
11780 $ EDITOR="vim -u ${HOME}/.vimrc"
11781 $ export EDITOR
11782 $ COLUMNS=80 \*(uA -R
11784 .Bl -tag -width ".It Ev BaNg"
11786 .It Ev COLUMNS
11787 The user's preferred width in column positions for the terminal screen
11788 or window.
11789 Queried and used once on program startup, actively managed for child
11790 processes and the MLE (see
11791 .Sx "On terminal control and line editor" )
11792 in interactive mode thereafter.
11793 Ignored in non-interactive mode, which always uses 80 columns, unless in
11794 .fl #
11795 batch mode.
11797 .It Ev DEAD
11798 The name of the (mailbox)
11799 .Ic file
11800 to use for saving aborted messages if
11801 .Va save
11802 is set; this defaults to
11803 .Pa dead.letter
11804 in the user's
11805 .Ev HOME
11806 directory.
11807 If the variable
11808 .Va debug
11809 is set no output will be generated, otherwise the contents of the file
11810 will be replaced.
11812 .It Ev EDITOR
11813 Pathname of the text editor to use in the
11814 .Ic edit
11815 command and
11816 .Ic ~e
11817 .Sx "COMMAND ESCAPES" .
11818 A default editor is used if this value is not defined.
11820 .It Ev HOME
11821 The user's home directory.
11822 This variable is only used when it resides in the process environment.
11823 The calling user's home directory will be used instead if this directory
11824 does not exist, is not accessible or cannot be read;
11825 it will always be used for the root user.
11826 (No test for being writable is performed to allow usage by
11827 non-privileged users within read-only jails, but dependent on the
11828 variable settings this directory is a default write target, e.g. for
11829 .Ev DEAD ,
11830 .Ev MBOX
11831 and more.)
11835 .It Ev LC_ALL , LC_CTYPE , LANG
11836 \*(OP The (names in lookup order of the)
11837 .Xr locale 7
11838 (and / or see
11839 .Xr setlocale 3 )
11840 which indicates the used
11841 .Sx "Character sets" .
11842 Runtime changes trigger automatic updates of the entire locale system,
11843 which includes updating
11844 .Va ttycharset
11845 (except during startup if the variable has been frozen via
11846 .Fl S ) .
11848 .It Ev LINES
11849 The user's preferred number of lines on a page or the vertical screen
11850 or window size in lines.
11851 Queried and used once on program startup, actively managed for child
11852 processes in interactive mode thereafter.
11853 Ignored in non-interactive mode, which always uses 24 lines, unless in
11854 .fl #
11855 batch mode.
11857 .It Ev LISTER
11858 Pathname of the directory lister to use in the
11859 .Ic folders
11860 command when operating on local mailboxes.
11861 Default is
11862 .Xr ls 1
11863 (path search through
11864 .Ev SHELL ) .
11866 .It Ev LOGNAME
11867 Upon startup \*(UA will actively ensure that this variable refers to the
11868 name of the user who runs \*(UA, in order to be able to pass a verified
11869 name to any newly created child process.
11871 .It Ev MAIL
11872 Is used as the users
11873 .Mx -sx
11874 .Sx "primary system mailbox"
11875 unless
11876 .Va inbox
11877 is set.
11878 This is assumed to be an absolute pathname.
11880 .It Ev MAILCAPS
11881 \*(OP Overrides the default path search for
11882 .Sx "The Mailcap files" ,
11883 which is defined in the standard RFC 1524 as
11884 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
11885 (\*(UA makes it a configuration option, however.)
11886 Note this is not a search path, but a path search.
11888 .It Ev MAILRC
11889 Is used as a startup file instead of
11890 .Pa \*(ur
11891 if set.
11892 In order to avoid side-effects from configuration files scripts should
11893 either set this variable to
11894 .Pa /dev/null
11895 or the
11896 .Fl \&:
11897 command line option should be used.
11899 .It Ev MAILX_NO_SYSTEM_RC
11900 If this variable is set then reading of
11901 .Pa \*(UR
11902 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
11903 had been started up with the option
11904 .Fl \&:
11905 (and according argument) or
11906 .Fl n .
11907 This variable is only used when it resides in the process environment.
11909 .It Ev MBOX
11910 The name of the users
11911 .Mx -sx
11912 .Sx "secondary mailbox"
11913 file.
11914 A logical subset of the special
11915 .Sx "Filename transformations"
11916 (also see
11917 .Ic file )
11918 are supported.
11919 The default is
11920 .Pa ~/mbox .
11921 Traditionally this MBOX is used as the file to save messages from the
11922 .Mx -sx
11923 .Sx "primary system mailbox"
11924 that have been read.
11925 Also see
11926 .Sx "Message states" .
11928 .It Ev NETRC
11929 \*(IN\*(OP This variable overrides the default location of the user's
11930 .Pa ~/.netrc
11931 file.
11933 .It Ev PAGER
11934 Pathname of the program to use for backing the command
11935 .Ic more ,
11936 and when the
11937 .Va crt
11938 variable enforces usage of a pager for output.
11939 The default paginator is
11940 .Xr more 1
11941 (path search through
11942 .Ev SHELL ) .
11944 \*(UA inspects the contents of this variable: if its contains the string
11945 .Dq less
11946 then a non-existing environment variable
11947 .Ev LESS
11948 will be set to
11949 .Ql Ri ,
11950 likewise for
11951 .Dq lv
11952 .Ev LV
11953 will optionally be set to
11954 .Ql -c .
11955 Alse see
11956 .Va colour-pager .
11958 .It Ev PATH
11959 A colon-separated list of directories that is searched by the shell when
11960 looking for commands, e.g.,
11961 .Ql /bin:/usr/bin:/usr/local/bin .
11963 .It Ev POSIXLY_CORRECT
11964 This variable is automatically looked for upon startup, see
11965 .Va posix
11966 for more.
11968 .It Ev SHELL
11969 The shell to use for the commands
11970 .Ic \&! ,
11971 .Ic shell ,
11973 .Ic ~!
11974 .Sx "COMMAND ESCAPES"
11975 and when starting subprocesses.
11976 A default shell is used if this environment variable is not defined.
11978 .It Ev SOURCE_DATE_EPOCH
11979 Specifies a time in seconds since the Unix epoch (1970-01-01) to be
11980 used in place of the current time.
11981 This variable is looked up upon program startup, and its existence will
11982 switch \*(UA to a reproducible mode
11983 .Pf ( Lk https://reproducible-builds.org )
11984 which uses deterministic random numbers, a special fixated pseudo
11985 .Ev LOGNAME
11986 and more.
11987 This operation mode is used for development and by software packagers.
11988 \*(ID Currently an invalid setting is only ignored, rather than causing
11989 a program abortion.
11991 .Dl $ SOURCE_DATE_EPOCH=`date +%s` \*(uA
11993 .It Ev TERM
11994 \*(OP The terminal type for which output is to be prepared.
11995 For extended colour and font control please refer to
11996 .Sx "Coloured display" ,
11997 and for terminal management in general to
11998 .Sx "On terminal control and line editor" .
12000 .It Ev TMPDIR
12001 Except for the root user this variable defines the directory for
12002 temporary files to be used instead of
12003 .Pa /tmp
12004 (or the given compile-time constant) if set, existent, accessible as
12005 well as read- and writable.
12006 This variable is only used when it resides in the process environment,
12007 but \*(UA will ensure at startup that this environment variable is
12008 updated to contain a usable temporary directory.
12010 .It Ev USER
12011 Identical to
12012 .Ev LOGNAME
12013 (see there), but this variable is not standardized, should therefore not
12014 be used, and is only corrected if already set.
12016 .It Ev VISUAL
12017 Pathname of the text editor to use in the
12018 .Ic visual
12019 command and
12020 .Ic ~v
12021 .Sx "COMMAND ESCAPES" .
12023 .Sh FILES
12024 .Bl -tag -width ".It Pa BaNg"
12025 .It Pa \*(ur
12026 File giving initial commands, one of the
12027 .Sx "Resource files" .
12028 .It Pa \*(UR
12029 System wide initialization file, one of the
12030 .Sx "Resource files" .
12032 .It Pa ~/.mailcap
12033 \*(OP Personal MIME type handler definition file, see
12034 .Sx "The Mailcap files" .
12035 This location is part of the RFC 1524 standard search path, which is
12036 a configuration option and can be overridden via
12037 .Ev MAILCAPS .
12039 .It Pa /etc/mailcap
12040 \*(OP System wide MIME type handler definition file, see
12041 .Sx "The Mailcap files" .
12042 This location is part of the RFC 1524 standard search path, which is
12043 a configuration option and can be overridden via
12045 .It Pa ~/mbox
12046 The default value for
12047 .Ev MBOX .
12048 The actually used path is a configuration option.
12050 .It Pa ~/.mime.types
12051 Personal MIME types, see
12052 .Sx "The mime.types files" .
12053 The actually used path is a configuration option.
12055 .It Pa /etc/mime.types
12056 System wide MIME types, see
12057 .Sx "The mime.types files" .
12058 The actually used path is a configuration option.
12060 .It Pa ~/.netrc
12061 \*(IN\*(OP The default location of the users
12062 .Pa .netrc
12063 file \(en the section
12064 .Sx "The .netrc file"
12065 documents the file format.
12066 The actually used path is a configuration option and can be overridden via
12067 .Ev NETRC .
12069 .It Pa /dev/null
12070 The data sink
12071 .Xr null 4 .
12072 The actually used path is a compile-time constant.
12074 .Ss "Resource files"
12075 Upon startup \*(UA reads in several resource files:
12076 .Bl -tag -width ".It Pa BaNg"
12078 .It Pa \*(UR
12079 System wide initialization file.
12080 Reading of this file can be suppressed, either by using the
12081 .Fl \&:
12082 (and according argument) or
12083 .Fl n
12084 command line options, or by setting the
12085 .Sx ENVIRONMENT
12086 variable
12087 .Ev MAILX_NO_SYSTEM_RC .
12089 .It Pa \*(ur
12090 File giving initial commands.
12091 A different file can be chosen by setting the
12092 .Sx ENVIRONMENT
12093 variable
12094 .Ev MAILRC .
12095 Reading of this file can be suppressed with the
12096 .Fl \&:
12097 command line option.
12098 .It Va mailx-extra-rc
12099 Defines a startup file to be read after all other resource files.
12100 It can be used to specify settings that are not understood by other
12101 .Xr mailx 1
12102 implementations, for example.
12103 This variable is only honoured when defined in a resource file, e.g.,
12104 it is one of the
12105 .Sx "INTERNAL VARIABLES" .
12108 The content of these files is interpreted as follows:
12110 .Bl -bullet -compact
12112 The whitespace characters space, tabulator and newline,
12113 as well as those defined by the variable
12114 .Va ifs ,
12115 are removed from the beginning and end of input lines.
12117 Empty lines are ignored.
12119 Any other line is interpreted as a command.
12120 It may be spread over multiple input lines if the newline character is
12121 .Dq escaped
12122 by placing a reverse solidus character
12123 .Ql \e
12124 as the last character of the line; whereas any leading whitespace of
12125 follow lines is ignored, trailing whitespace before a escaped newline
12126 remains in the input.
12128 If the line (content) starts with the number sign
12129 .Ql #
12130 then it is a comment-command and also ignored.
12131 (The comment-command is a real command, which does nothing, and
12132 therefore the usual follow lines mechanism applies!)
12135 Unless \*(UA is about to enter interactive mode syntax errors that occur
12136 while loading these files are treated as errors and cause program exit.
12137 More files with syntactically equal content can be
12138 .Ic source Ns ed .
12139 The following, saved in a file, would be an examplary content:
12140 .Bd -literal -offset indent
12141  # This line is a comment command.  And y\e
12142     es, it is really continued here.
12143 set debug \e
12144     verbose
12145     set editheaders
12147 .Ss "The mime.types files"
12148 As stated in
12149 .Sx "HTML mail and MIME attachments"
12150 \*(UA needs to learn about MIME (Multipurpose Internet Mail Extensions)
12151 media types in order to classify message and attachment content.
12152 One source for them are
12153 .Pa mime.types
12154 files, the loading of which can be controlled by setting the variable
12155 .Va mimetypes-load-control .
12156 Another is the command
12157 .Ic mimetype ,
12158 which also offers access to \*(UAs MIME type cache.
12159 .Pa mime.types
12160 files have the following syntax:
12161 .Bd -literal -offset indent
12162 type/subtype extension [extension ...]
12163 # E.g., text/html html htm
12166 where
12167 .Ql type/subtype
12168 define the MIME media type, as standardized in RFC 2046:
12169 .Ql type
12170 is used to declare the general type of data, while the
12171 .Ql subtype
12172 specifies a specific format for that type of data.
12173 One or multiple filename
12174 .Ql extension Ns
12175 s, separated by whitespace, can be bound to the media type format.
12176 Comments may be introduced anywhere on a line with a number sign
12177 .Ql # ,
12178 causing the remaining line to be discarded.
12179 \*(UA also supports an extended, non-portable syntax in especially
12180 crafted files, which can be loaded via the alternative value syntax of
12181 .Va mimetypes-load-control ,
12182 and prepends an optional
12183 .Ql type-marker :
12185 .Dl [type-marker ]type/subtype extension [extension ...]
12187 The following type markers are supported:
12189 .Bl -tag -compact -width ".It Ar _n_u"
12190 .It Ar @
12191 Treat message parts with this content as plain text.
12192 .It Ar @t
12193 The same as plain
12194 .Ar @ .
12195 .It Ar @h
12196 Treat message parts with this content as HTML tagsoup.
12197 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
12198 the content as plain text instead.
12199 .It Ar @H
12200 Likewise
12201 .Ar @h ,
12202 but instead of falling back to plain text require an explicit content
12203 handler to be defined.
12204 .It Ar @q
12205 If no handler can be found a text message is displayed which says so.
12206 This can be annoying, for example signatures serve a contextual purpose,
12207 their content is of no use by itself.
12208 This marker will avoid displaying the text message.
12211 Further reading:
12212 for sending messages:
12213 .Ic mimetype ,
12214 .Va mime-allow-text-controls ,
12215 .Va mimetypes-load-control .
12216 For reading etc. messages:
12217 .Sx "HTML mail and MIME attachments" ,
12218 .Sx "The Mailcap files" ,
12219 .Ic mimetype ,
12220 .Va mime-counter-evidence ,
12221 .Va mimetypes-load-control ,
12222 .Va pipe-TYPE/SUBTYPE ,
12223 .Va pipe-EXTENSION .
12224 .Ss "The Mailcap files"
12225 .Sy This feature is not available in v14.9.0, sorry!
12226 RFC 1524 defines a
12227 .Dq User Agent Configuration Mechanism
12228 which \*(UA \*(OPally supports (see
12229 .Sx "HTML mail and MIME attachments" ) .
12230 It defines a file format to be used to inform mail user agent programs
12231 about the locally-installed facilities for handling various data
12232 formats, i.e., about commands and how they can be used to display, edit
12233 et cetera MIME part contents, as well as a default path search that
12234 includes multiple possible locations of
12235 .Dq mailcap
12236 files and the
12237 .Ev MAILCAPS
12238 environment variable that can be used to overwrite that (repeating here
12239 that it is not a search path, but instead a path search specification).
12240 Any existing files will be loaded in sequence, appending any content to
12241 the list of MIME type handler directives.
12243 .Dq Mailcap
12244 files consist of a set of newline separated entries.
12245 Comment lines start with a number sign
12246 .Ql #
12247 (in the first column!) and are ignored.
12248 Empty lines are also ignored.
12249 All other lines form individual entries that must adhere to the syntax
12250 described below.
12251 To extend a single entry (not comment) its line can be continued on
12252 follow lines if newline characters are
12253 .Dq escaped
12254 by preceding them with the reverse solidus character
12255 .Ql \e .
12256 The standard does not specify how leading whitespace of follow lines
12257 is to be treated, therefore \*(UA retains it.
12259 .Dq Mailcap
12260 entries consist of a number of semicolon
12261 .Ql \&;
12262 separated fields, and the reverse solidus
12263 .Ql \e
12264 character can be used to escape any following character including
12265 semicolon and itself.
12266 The first two fields are mandatory and must occur in the specified
12267 order, the remaining fields are optional and may appear in any order.
12268 Leading and trailing whitespace of content is ignored (removed).
12270 The first field defines the MIME
12271 .Ql TYPE/SUBTYPE
12272 the entry is about to handle (case-insensitively, and no reverse solidus
12273 escaping is possible in this field).
12274 If the subtype is specified as an asterisk
12275 .Ql *
12276 the entry is meant to match all subtypes of the named type, e.g.,
12277 .Ql audio/*
12278 would match any audio type.
12279 The second field defines the shell command which shall be used to
12280 .Dq display
12281 MIME parts of the given type; it is implicitly called the
12282 .Cd view
12283 command.
12285 For data
12286 .Dq consuming
12287 shell commands message (MIME part) data is passed via standard input
12288 unless the given shell command includes one or more instances of the
12289 (unquoted) string
12290 .Ql %s ,
12291 in which case these instances will be replaced with a temporary filename
12292 and the data will have been stored in the file that is being pointed to.
12293 Likewise, for data
12294 .Dq producing
12295 shell commands data is assumed to be generated on standard output unless
12296 the given command includes (one ore multiple)
12297 .Ql %s .
12298 In any case any given
12299 .Ql %s
12300 format is replaced with a(n already) properly quoted filename.
12301 Note that when a command makes use of a temporary file via
12302 .Ql %s
12303 then \*(UA will remove it again, as if the
12304 .Cd x-mailx-tmpfile ,
12305 .Cd x-mailx-tmpfile-fill
12307 .Cd x-mailx-tmpfile-unlink
12308 flags had been set; see below for more.
12310 The optional fields either define a shell command or an attribute (flag)
12311 value, the latter being a single word and the former being a keyword
12312 naming the field followed by an equals sign
12313 .Ql =
12314 succeeded by a shell command, and as usual for any
12315 .Dq Mailcap
12316 content any whitespace surrounding the equals sign will be removed, too.
12317 Optional fields include the following:
12318 .Bl -tag -width ".It Cd BaNg"
12319 .It Cd compose
12320 A program that can be used to compose a new body or body part in the
12321 given format.
12322 (Currently unused.)
12323 .It Cd composetyped
12324 Similar to the
12325 .Cd compose
12326 field, but is to be used when the composing program needs to specify the
12327 .Ql Content-type:
12328 header field to be applied to the composed data.
12329 (Currently unused.)
12330 .It Cd edit
12331 A program that can be used to edit a body or body part in the given
12332 format.
12333 (Currently unused.)
12334 .It Cd print
12335 A program that can be used to print a message or body part in the given
12336 format.
12337 (Currently unused.)
12338 .It Cd test
12339 Specifies a program to be run to test some condition, e.g., the machine
12340 architecture, or the window system in use, to determine whether or not
12341 this mailcap entry applies.
12342 If the test fails, a subsequent mailcap entry should be sought; also see
12343 .Cd x-mailx-test-once .
12345 .It Cd needsterminal
12346 This flag field indicates that the given shell command must be run on
12347 an interactive terminal.
12348 \*(UA will temporarily release the terminal to the given command in
12349 interactive mode, in non-interactive mode this entry will be entirely
12350 ignored; this flag implies
12351 .Cd x-mailx-noquote .
12353 .It Cd copiousoutput
12354 A flag field which indicates that the output of the
12355 .Cd view
12356 command will be an extended stream of textual output that can be
12357 (re)integrated into \*(UA's normal visual display.
12358 It is mutually exclusive with
12359 .Cd needsterminal .
12360 .It Cd textualnewlines
12361 A flag field which indicates that this type of data is line-oriented and
12362 that, if encoded in
12363 .Ql base64 ,
12364 all newlines should be converted to canonical form (CRLF) before
12365 encoding, and will be in that form after decoding.
12366 (Currently unused.)
12367 .It Cd nametemplate
12368 This field gives a filename format, in which
12369 .Ql %s
12370 will be replaced by a random string, the joined combination of which
12371 will be used as the filename denoted by
12372 .Ev MAILX_FILENAME_TEMPORARY .
12373 One could specify that a GIF file being passed to an image viewer should
12374 have a name ending in
12375 .Ql .gif
12376 by using
12377 .Ql nametemplate=%s.gif .
12378 Note that \*(UA ignores the name template unless that solely specifies
12379 a filename suffix that consists of (ASCII) alphabetic and numeric
12380 characters, the underscore and dot only.
12381 .It Cd x11-bitmap
12382 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
12383 icon to be used to visually denote the presence of this kind of data.
12384 This field is not used by \*(UA.
12385 .It Cd description
12386 A textual description that describes this type of data.
12388 .It Cd x-mailx-even-if-not-interactive
12389 An extension flag test field \(em by default handlers without
12390 .Cd copiousoutput
12391 are entirely ignored in non-interactive mode, but if this flag is set
12392 then their use will be considered.
12393 It is an error if this flag is set for commands that use the flag
12394 .Cd needsterminal .
12396 .It Cd x-mailx-noquote
12397 An extension flag field that indicates that even a
12398 .Cd copiousoutput
12399 .Cd view
12400 command shall not be used to generate message quotes
12401 (as it would be by default).
12403 .It Cd x-mailx-async
12404 Extension flag field that denotes that the given
12405 .Cd view
12406 command shall be executed asynchronously, without blocking \*(UA.
12407 Cannot be used in conjunction with
12408 .Cd needsterminal .
12410 .It Cd x-mailx-test-once
12411 Extension flag which denotes whether the given
12412 .Cd test
12413 command shall be evaluated once only and the (boolean) result be cached.
12414 This is handy if some global unchanging condition is to be queried, like
12415 .Dq running under the X Window System .
12417 .It Cd x-mailx-tmpfile
12418 Extension flag field that requests creation of a zero-sized temporary
12419 file, the name of which is to be placed in the environment variable
12420 .Ev MAILX_FILENAME_TEMPORARY .
12421 It is an error to use this flag with commands that include a
12422 .Ql %s
12423 format.
12425 .It Cd x-mailx-tmpfile-fill
12426 Normally the MIME part content is passed to the handler via standard
12427 input; if this flag is set then the data will instead be written into
12428 the implied
12429 .Cd x-mailx-tmpfile .
12430 In order to cause deletion of the temporary file you will have to set
12431 .Cd x-mailx-tmpfile-unlink
12432 explicitly!
12433 It is an error to use this flag with commands that include a
12434 .Ql %s
12435 format.
12437 .It Cd x-mailx-tmpfile-unlink
12438 Extension flag field that requests that the temporary file shall be
12439 deleted automatically when the command loop is entered again at latest.
12440 (Do not use this for asynchronous handlers.)
12441 It is an error to use this flag with commands that include a
12442 .Ql %s
12443 format, or in conjunction with
12444 .Cd x-mailx-async ,
12445 or without also setting
12446 .Cd x-mailx-tmpfile
12448 .Cd x-mailx-tmpfile-fill .
12450 .It Cd x-mailx-tmpfile-keep
12451 Using the string
12452 .Ql %s
12453 implies the three tmpfile related flags above, but if you want, e.g.,
12454 .Cd x-mailx-async
12455 and deal with the temporary file yourself, you can add in this flag to
12456 forcefully ignore
12457 .Cd x-mailx-tmpfile-unlink .
12460 The standard includes the possibility to define any number of additional
12461 entry fields, prefixed by
12462 .Ql x- .
12463 Flag fields apply to the entire
12464 .Dq Mailcap
12465 entry \(em in some unusual cases, this may not be desirable, but
12466 differentiation can be accomplished via separate entries, taking
12467 advantage of the fact that subsequent entries are searched if an earlier
12468 one does not provide enough information.
12469 E.g., if a
12470 .Cd view
12471 command needs to specify the
12472 .Cd needsterminal
12473 flag, but the
12474 .Cd compose
12475 command shall not, the following will help out the latter (with enabled
12476 .Va debug
12477 or an increased
12478 .Va verbose
12479 level \*(UA will show information about handler evaluation):
12480 .Bd -literal -offset indent
12481 application/postscript; ps-to-terminal %s; needsterminal
12482 application/postscript; ps-to-terminal %s; compose=idraw %s
12485 In fields any occurrence of the format string
12486 .Ql %t
12487 will be replaced by the
12488 .Ql TYPE/SUBTYPE
12489 specification.
12490 Named parameters from the
12491 .Ql Content-type:
12492 field may be placed in the command execution line using
12493 .Ql %{
12494 followed by the parameter name and a closing
12495 .Ql }
12496 character.
12497 The entire parameter should appear as a single command line argument,
12498 regardless of embedded spaces; thus:
12499 .Bd -literal -offset indent
12500 # Message
12501 Content-type:  multipart/mixed; boundary=42
12503 # Mailcap file
12504 multipart/*; /usr/local/bin/showmulti \e
12505   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
12507 # Executed shell command
12508 /usr/local/bin/showmulti multipart/mixed 42
12511 Note that \*(UA does not support handlers for multipart MIME parts as
12512 shown in this example (as of today).
12513 \*(UA does not support the additional formats
12514 .Ql %n
12516 .Ql %F .
12517 An example file, also showing how to properly deal with the expansion of
12518 .Ql %s ,
12519 which includes any quotes that are necessary to make it a valid shell
12520 argument by itself and thus will cause undesired behaviour when placed
12521 in additional user-provided quotes:
12522 .Bd -literal -offset indent
12523 # Comment line
12524 text/richtext; richtext %s; copiousoutput
12526 text/x-perl; perl -cWT %s
12528 application/pdf; \e
12529   infile=%s\e; \e
12530     trap "rm -f ${infile}" EXIT\e; \e
12531     trap "exit 75" INT QUIT TERM\e; \e
12532     mupdf %s; \e
12533   x-mailx-async; x-mailx-tmpfile-keep
12535 application/*; echo "This is \e"%t\e" but \e
12536     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vET; \e
12537   copiousoutput; x-mailx-noquote
12540 Further reading:
12541 .Sx "HTML mail and MIME attachments" ,
12542 .Sx "The mime.types files" ,
12543 .Ic mimetype ,
12544 .Ev MAILCAPS ,
12545 .Va mime-counter-evidence ,
12546 .Va pipe-TYPE/SUBTYPE ,
12547 .Va pipe-EXTENSION .
12548 .Ss "The .netrc file"
12550 .Pa .netrc
12551 file contains user credentials for machine accounts.
12552 The default location in the user's
12553 .Ev HOME
12554 directory may be overridden by the
12555 .Ev NETRC
12556 environment variable.
12557 The file consists of space, tabulator or newline separated tokens.
12558 \*(UA implements a parser that supports a superset of the original BSD
12559 syntax, but users should nonetheless be aware of portability glitches
12560 of that file format, shall their
12561 .Pa .netrc
12562 be usable across multiple programs and platforms:
12564 .Bl -bullet -compact
12566 BSD does not support single, but only double quotation marks, e.g.,
12567 .Ql password="pass with spaces" .
12569 BSD (only?) supports escaping of single characters via a reverse solidus
12570 (e.g., a space can be escaped via
12571 .Ql \e\0 ) ,
12572 in- as well as outside of a quoted string.
12574 BSD does not require a final quotation mark of the last user input token.
12576 The original BSD (Berknet) parser also supported a format which allowed
12577 tokens to be separated with commas \(en whereas at least Hewlett-Packard
12578 still seems to support this syntax, \*(UA does not!
12580 As a non-portable extension some widely-used programs support
12581 shell-style comments: if an input line starts, after any amount of
12582 whitespace, with a number sign
12583 .Ql # ,
12584 then the rest of the line is ignored.
12586 Whereas other programs may require that the
12587 .Pa .netrc
12588 file is accessible by only the user if it contains a
12589 .Cd password
12590 token for any other
12591 .Cd login
12592 than
12593 .Dq anonymous ,
12594 \*(UA will always require these strict permissions.
12597 Of the following list of supported tokens \*(UA only uses (and caches)
12598 .Cd machine ,
12599 .Cd login
12601 .Cd password .
12602 At runtime the command
12603 .Ic netrc
12604 can be used to control \*(UA's
12605 .Pa .netrc
12606 cache.
12607 .Bl -tag -width ".It Cd BaNg"
12608 .It Cd machine Ar name
12609 The hostname of the entries' machine, lowercase-normalized by \*(UA
12610 before use.
12611 Any further file content, until either end-of-file or the occurrence
12612 of another
12613 .Cd machine
12614 or a
12615 .Cd default
12616 first-class token is bound (only related) to the machine
12617 .Ar name .
12619 As an extension that should not be the cause of any worries
12620 \*(UA supports a single wildcard prefix for
12621 .Ar name :
12622 .Bd -literal -offset indent
12623 machine *.example.com login USER password PASS
12624 machine pop3.example.com login USER password PASS
12625 machine smtp.example.com login USER password PASS
12628 which would match
12629 .Ql xy.example.com
12630 as well as
12631 .Ql pop3.example.com ,
12632 but neither
12633 .Ql example.com
12635 .Ql local.smtp.example.com .
12636 Note that in the example neither
12637 .Ql pop3.example.com
12639 .Ql smtp.example.com
12640 will be matched by the wildcard, since the exact matches take
12641 precedence (it is however faster to specify it the other way around).
12642 .It Cd default
12643 This is the same as
12644 .Cd machine
12645 except that it is a fallback entry that is used shall none of the
12646 specified machines match; only one default token may be specified,
12647 and it must be the last first-class token.
12648 .It Cd login Ar name
12649 The user name on the remote machine.
12650 .It Cd password Ar string
12651 The user's password on the remote machine.
12652 .It Cd account Ar string
12653 Supply an additional account password.
12654 This is merely for FTP purposes.
12655 .It Cd macdef Ar name
12656 Define a macro.
12657 A macro is defined with the specified
12658 .Ar name ;
12659 it is formed from all lines beginning with the next line and continuing
12660 until a blank line is (consecutive newline characters are) encountered.
12661 (Note that
12662 .Cd macdef
12663 entries cannot be utilized by multiple machines, too, but must be
12664 defined following the
12665 .Ic machine
12666 they are intended to be used with.)
12667 If a macro named
12668 .Ar init
12669 exists, it is automatically run as the last step of the login process.
12670 This is merely for FTP purposes.
12672 .Sh EXAMPLES
12673 .Ss "An example configuration"
12674 .Bd -literal -offset indent
12675 # This example assumes v15.0 compatibility mode
12676 set v15-compat
12678 # Request strict SSL/TLS transport security checks
12679 set ssl-verify=strict
12681 # Where are the up-to-date SSL/TLS certificates?
12682 # (Since we manage up-to-date ones explicitly, do not use any,
12683 # possibly outdated, default certificates shipped with OpenSSL)
12684 #set ssl-ca-dir=/etc/ssl/certs
12685 set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
12686 set ssl-ca-no-defaults
12687 #set ssl-ca-flags=partial-chain
12688 wysh set smime-ca-file="${ssl-ca-file}" \e
12689   smime-ca-no-defaults #smime-ca-flags="${ssl-ca-flags}"
12691 # This could be outsourced to a central configuration file via
12692 # ssl-config-file plus ssl-config-module if the used library allows.
12693 # CipherList: explicitly define the list of ciphers, which may
12694 #   improve security, especially with protocols older than TLS v1.2.
12695 #   See ciphers(1).  Possibly best to only use ssl-cipher-list-HOST
12696 #   (or -USER@HOST), as necessary, again..
12697 # Curves: especially with TLSv1.3 curves selection may be desired.
12698 # MinProtocol,MaxProtocol: do not use protocols older than TLS v1.2.
12699 #   Change this only when the remote server does not support it:
12700 #   maybe use chain support via ssl-config-pairs-HOST / -USER@HOST
12701 #   to define such explicit exceptions, then, e.g.
12702 #     MinProtocol=TLSv1.1
12703 if [ "$ssl-features" =% +ctx-set-maxmin-proto ]
12704   wysh set ssl-config-pairs='\e
12705       CipherList=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
12706       Curves=P-521:P-384:P-256,\e
12707       MinProtocol=TLSv1.1'
12708 else
12709   wysh set ssl-config-pairs='\e
12710       CipherList=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
12711       Curves=P-521:P-384:P-256,\e
12712       Protocol=-ALL\e,+TLSv1.1 \e, +TLSv1.2'
12713 endif
12715 # Essential setting: select allowed character sets
12716 set sendcharsets=utf-8,iso-8859-1
12718 # A very kind option: when replying to a message, first try to
12719 # use the same encoding that the original poster used herself!
12720 set reply-in-same-charset
12722 # When replying, do not merge From: and To: of the original message
12723 # into To:.  Instead old From: -> new To:, old To: -> merge Cc:.
12724 set recipients-in-cc
12726 # When sending messages, wait until the Mail-Transfer-Agent finishs.
12727 # Only like this you will be able to see errors reported through the
12728 # exit status of the MTA (including the built-in SMTP one)!
12729 set sendwait
12731 # Only use built-in MIME types, no mime.types(5) files
12732 set mimetypes-load-control
12734 # Default directory where we act in (relative to $HOME)
12735 set folder=mail
12736 # A leading "+" (often) means: under *folder*
12737 # *record* is used to save copies of sent messages
12738 set MBOX=+mbox.mbox DEAD=+dead.txt \e
12739   record=+sent.mbox record-files record-resent
12741 # Make "file mymbox" and "file myrec" go to..
12742 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
12744 # Not really optional, e.g., for S/MIME
12745 set from='Your Name <address@exam.ple>'
12747 # It may be necessary to set hostname and/or smtp-hostname
12748 # if the "SERVER" of mta and "domain" of from do not match.
12749 # The `urlencode' command can be used to encode USER and PASS
12750 set mta=(smtps?|submission)://[USER[:PASS]@]SERVER[:PORT] \e
12751   smtp-auth=login/plain... \e
12752   smtp-use-starttls
12754 # Never refuse to start into interactive mode, and more
12755 set emptystart \e
12756   colour-pager crt= \e
12757   followup-to followup-to-honour=ask-yes fullnames \e
12758   history-file=+.\*(uAhist history-size=-1 history-gabby \e
12759   mime-counter-evidence=0b1111 \e
12760   prompt='?\e$?!\e$!/\e$^ERRNAME[\e$account#\e$mailbox-display]? ' \e
12761   reply-to-honour=ask-yes \e
12762   umask=
12764 # Only include the selected header fields when typing messages
12765 headerpick type retain from_ date from to cc subject \e
12766   message-id mail-followup-to reply-to
12767 # ...when forwarding messages
12768 headerpick forward retain subject date from to cc
12769 # ...when saving message, etc.
12770 #headerpick save ignore ^Original-.*$ ^X-.*$
12772 # Some mailing lists
12773 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
12774 mlsubscribe '^xfans@xfans\e.xyz$'
12776 # Handle a few file extensions (to store MBOX databases)
12777 filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
12778   gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
12779   zst 'zstd -dc' 'zstd -19 -zc' \e
12780   zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
12782 # A real life example of a very huge free mail provider
12783 # Instead of directly placing content inside `account',
12784 # we `define' a macro: like that we can switch "accounts"
12785 # from within *on-compose-splice*, for example!
12786 define XooglX {
12787   set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
12788   set from='Your Name <address@examp.ple>'
12790   set pop3-no-apop-pop.gmXil.com
12791   shortcut pop %:pop3s://pop.gmXil.com
12792   shortcut imap %:imaps://imap.gmXil.com
12793   #set record="+[Gmail]/Sent Mail"
12794   # Select: File imaps://imap.gmXil.com/[Gmail]/Sent\e Mail
12796   set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
12797   # Alternatively:
12798   set mta=smtps://USER:PASS@smtp.gmail.com:465
12800 account XooglX {
12801   \ecall XooglX
12804 # Here is a pretty large one which does not allow sending mails
12805 # if there is a domain name mismatch on the SMTP protocol level,
12806 # which would bite us if the value of from does not match, e.g.,
12807 # for people who have a sXXXXeforge project and want to speak
12808 # with the mailing list under their project account (in from),
12809 # still sending the message through their normal mail provider
12810 define XandeX {
12811   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
12812   set from='Your Name <address@exam.ple>'
12814   shortcut pop %:pop3s://pop.yaXXex.com
12815   shortcut imap %:imaps://imap.yaXXex.com
12817   set mta=smtps://USER:PASS@smtp.yaXXex.com:465 \e
12818     hostname=yaXXex.com smtp-hostname=
12820 account XandeX {
12821   \ecall Xandex
12824 # Create some new commands so that, e.g., `ls /tmp' will..
12825 commandalias lls '!ls ${LS_COLOR_FLAG} -aFlrS'
12826 commandalias llS '!ls ${LS_COLOR_FLAG} -aFlS'
12828 set pipe-message/external-body='@* echo $MAILX_EXTERNAL_BODY_URL'
12830 # We do not support gpg(1) directly yet.  But simple --clearsign'd
12831 # message parts can be dealt with as follows:
12832 define V {
12833   localopts yes
12834   wysh set pipe-text/plain=$'@*#++=@\e
12835     < "${MAILX_FILENAME_TEMPORARY}" awk \e
12836         -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
12837       BEGIN{done=0}\e
12838       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
12839         if(done++ != 0)\e
12840           next;\e
12841         print "--- GPG --verify ---";\e
12842         system("gpg --verify " TMPFILE " 2>&1");\e
12843         print "--- GPG --verify ---";\e
12844         print "";\e
12845         next;\e
12846       }\e
12847       /^-----BEGIN PGP SIGNATURE-----/,\e
12848           /^-----END PGP SIGNATURE-----/{\e
12849         next;\e
12850       }\e
12851       {print}\e
12852     \e''
12853     print
12855 commandalias V '\e'call V
12858 When storing passwords in
12859 .Pa \*(ur
12860 appropriate permissions should be set on this file with
12861 .Ql $ chmod 0600 \*(ur .
12862 If the \*(OPal
12863 .Va netrc-lookup
12864 is available user credentials can be stored in the central
12865 .Pa .netrc
12866 file instead; e.g., here is a different version of the example account
12867 that sets up SMTP and POP3:
12868 .Bd -literal -offset indent
12869 define XandeX {
12870   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
12871   set from='Your Name <address@exam.ple>'
12872   set netrc-lookup
12873   # Load an encrypted ~/.netrc by uncommenting the next line
12874   #set netrc-pipe='gpg -qd ~/.netrc.pgp'
12876   set mta=smtps://smtp.yXXXXx.ru:465 \e
12877       smtp-hostname= hostname=yXXXXx.com
12878   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
12879   commandalias xp fi pop3s://pop.yXXXXx.ru
12881 account XandeX {
12882   \ecall XandeX
12886 and, in the
12887 .Pa .netrc
12888 file:
12889 .Bd -literal -offset indent
12890 machine *.yXXXXx.ru login USER password PASS
12893 This configuration should now work just fine:
12895 .Dl $ echo text | \*(uA -dvv -AXandeX -s Subject user@exam.ple
12896 .Ss "S/MIME step by step"
12897 \*(OP The first thing you need for participating in S/MIME message
12898 exchange is your personal certificate, including a private key.
12899 The certificate contains public information, in particular your name and
12900 your email address(es), and the public key that is used by others to
12901 encrypt messages for you,
12902 and to verify signed messages they supposedly received from you.
12903 The certificate is included in each signed message you send.
12904 The private key must be kept secret.
12905 It is used to decrypt messages that were previously encrypted with your
12906 public key, and to sign messages.
12908 For personal use it is recommended that you get a S/MIME certificate
12909 from one of the major CAs on the Internet using your WWW browser.
12910 Many CAs offer such certificates for free.
12911 There is also
12912 .Lk https://www.CAcert.org
12913 which issues client and server certificates to members of their
12914 community for free; their root certificate
12915 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
12916 is often not in the default set of trusted CA root certificates, though,
12917 which means you will have to download their root certificate separately
12918 and ensure it is part of our S/MIME certificate validation chain by
12919 including it in
12920 .Va smime-ca-dir
12921 or as a vivid member of the
12922 .Va smime-ca-file .
12923 But let us take a step-by-step tour on how to setup S/MIME with
12924 a certificate from CAcert.org despite this situation!
12926 First of all you will have to become a member of the CAcert.org
12927 community, simply by registrating yourself via the web interface.
12928 Once you are, create and verify all email addresses you want to be able
12929 to create signed and encrypted messages for/with using the corresponding
12930 entries of the web interface.
12931 Now ready to create S/MIME certificates, so let us create a new
12932 .Dq client certificate ,
12933 ensure to include all email addresses that should be covered by the
12934 certificate in the following web form, and also to use your name as the
12935 .Dq common name .
12937 Create a private key and a certificate request on your local computer
12938 (please see the manual pages of the used commands for more in-depth
12939 knowledge on what the used arguments etc. do):
12941 .Dl $ openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
12943 Afterwards copy-and-paste the content of
12944 .Dq creq.pem
12945 into the certificate-request (CSR) field of the web form on the
12946 CAcert.org website (you may need to unfold some
12947 .Dq advanced options
12948 to see the corresponding text field).
12949 This last step will ensure that your private key (which never left your
12950 box) and the certificate belong together (through the public key that
12951 will find its way into the certificate via the certificate-request).
12952 You are now ready and can create your CAcert certified certificate.
12953 Download and store or copy-and-paste it as
12954 .Dq pub.crt .
12956 Yay.
12957 In order to use your new S/MIME setup a combined private key/public key
12958 (certificate) file has to be created:
12960 .Dl $ cat key.pem pub.crt > ME@HERE.com.paired
12962 This is the file \*(UA will work with.
12963 If you have created your private key with a passphrase then \*(UA will
12964 ask you for it whenever a message is signed or decrypted.
12965 Set the following variables to henceforth use S/MIME (setting
12966 .Va smime-ca-file
12967 is of interest for verification only):
12968 .Bd -literal -offset indent
12969 ? set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
12970     smime-sign-cert=ME@HERE.com.paired \e
12971     smime-sign-message-digest=SHA256 \e
12972     smime-sign
12974 .Ss "Using CRLs with S/MIME or SSL/TLS"
12975 \*(OP Certification authorities (CAs) issue certificate revocation
12976 lists (CRLs) on a regular basis.
12977 These lists contain the serial numbers of certificates that have been
12978 declared invalid after they have been issued.
12979 Such usually happens because the private key for the certificate has
12980 been compromised,
12981 because the owner of the certificate has left the organization that is
12982 mentioned in the certificate, etc.
12983 To seriously use S/MIME or SSL/TLS verification,
12984 an up-to-date CRL is required for each trusted CA.
12985 There is otherwise no method to distinguish between valid and
12986 invalidated certificates.
12987 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
12988 the Internet, so they have to be retrieved by some external mechanism.
12990 \*(UA accepts CRLs in PEM format only;
12991 CRLs in DER format must be converted, like, e.\|g.:
12993 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
12995 To tell \*(UA about the CRLs, a directory that contains all CRL files
12996 (and no other files) must be created.
12998 .Va smime-crl-dir
13000 .Va ssl-crl-dir
13001 variables, respectively, must then be set to point to that directory.
13002 After that, \*(UA requires a CRL to be present for each CA that is used
13003 to verify a certificate.
13004 .Sh "FAQ"
13005 In general it is a good idea to turn on
13006 .Va debug
13007 .Pf ( Fl d )
13008 and / or
13009 .Va verbose
13010 .Pf ( Fl v ,
13011 twice) if something does not work well.
13012 Very often a diagnostic message can be produced that leads to the
13013 problems' solution.
13014 .Ss "\*(UA shortly hangs on startup"
13015 This can have two reasons, one is the necessity to wait for a file lock
13016 and cannot be helped, the other being that \*(UA calls the function
13017 .Xr uname 2
13018 in order to query the nodename of the box (sometimes the real one is
13019 needed instead of the one represented by the internal variable
13020 .Va hostname ) .
13021 One may have varying success by ensuring that the real hostname and
13022 .Ql localhost
13023 have entries in
13024 .Pa /etc/hosts ,
13025 or, more generally, that the name service is properly setup \(en
13026 and does
13027 .Xr hostname 1
13028 return the expected value?
13029 Does this local hostname have a domain suffix?
13030 RFC 6762 standardized the link-local top-level domain
13031 .Ql .local ,
13032 try again after adding an (additional) entry with this extension.
13033 .Ss "I cannot login to Google mail aka GMail"
13034 Since 2014 some free service providers classify programs as
13035 .Dq less secure
13036 unless they use a special authentication method (OAuth 2.0) which
13037 was not standardized for non-HTTP protocol authentication token query
13038 until August 2015 (RFC 7628).
13040 Different to Kerberos / GSSAPI, which is developed since the mid of the
13041 1980s, where a user can easily create a local authentication ticket for
13042 her- and himself with the locally installed
13043 .Xr kinit 1
13044 program, that protocol has no such local part but instead requires
13045 a world-wide-web query to create or fetch a token; since there is no
13046 local cache this query would have to be performed whenever \*(UA is
13047 invoked (in interactive sessions situation may differ).
13049 \*(UA does not support OAuth.
13050 Because of this it is necessary to declare \*(UA a
13051 .Dq less secure app
13052 (on the providers account web page) in order to read and send mail.
13053 However, it also seems possible to take the following steps instead:
13055 .Bl -enum -compact
13057 give the provider the number of a mobile phone,
13059 enable
13060 .Dq 2-Step Verification ,
13062 create an application specific password (16 characters), and
13064 use that special password instead of the real Google account password in
13065 \*(UA (for more on that see the section
13066 .Sx "On URL syntax and credential lookup" ) .
13068 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
13069 It can happen that the terminal library (see
13070 .Sx "On terminal control and line editor",
13071 .Ic bind ,
13072 .Va termcap )
13073 reports different codes than the terminal really sends, in which case
13074 \*(UA will tell that a key binding is functional, but will not be able to
13075 recognize it because the received data does not match anything expected.
13076 Especially without the \*(OPal terminal capability library support one
13077 reason for this may be that the (possibly even non-existing) keypad
13078 is not turned on and the resulting layout reports the keypad control
13079 codes for the normal keyboard keys.
13081 .Va verbose
13082 listing of
13083 .Ic bind Ns
13084 ings will show the byte sequences that are expected.
13086 To overcome the situation, use, e.g., the program
13087 .Xr cat 1 ,
13088 in conjunction with the command line option
13089 .Fl \&\&v ,
13090 if available, to see the byte sequences which are actually produced
13091 by keypresses, and use the variable
13092 .Va termcap
13093 to make \*(UA aware of them.
13094 E.g., the terminal this is typed on produces some false sequences, here
13095 an example showing the shifted home key:
13096 .Bd -literal -offset indent
13097 ? set verbose
13098 ? bind*
13099 # 1B 5B=[ 31=1 3B=; 32=2 48=H
13100   bind base :kHOM z0
13101 ? x
13102 $ cat -v
13103 ^[[H
13104 ? \*(uA -v -Stermcap='kHOM=\eE[H'
13105 ? bind*
13106 # 1B 5B=[ 48=H
13107   bind base :kHOM z0
13109 .Ss "Can \*(UA git-send-email?"
13110 Yes.
13111 Put (at least parts of) the following in your
13112 .Pa ~/.gitconfig :
13113 .Bd -literal -offset indent
13114 [sendemail]
13115 smtpserver = /usr/bin/s-mailx
13116 smtpserveroption = -t
13117 #smtpserveroption = -Sexpandaddr
13118 smtpserveroption = -Athe-account-you-need
13120 suppresscc = all
13121 suppressfrom = false
13122 assume8bitEncoding = UTF-8
13123 #to = /tmp/OUT
13124 confirm = always
13125 chainreplyto = true
13126 multiedit = false
13127 thread = true
13128 quiet = true
13129 annotate = true
13131 .Sh "IMAP CLIENT"
13132 \*(OPally there is IMAP client support available.
13133 This part of the program is obsolete and will vanish in v15 with the
13134 large MIME and I/O layer rewrite, because it uses old-style blocking I/O
13135 and makes excessive use of signal based long code jumps.
13136 Support can hopefully be readded later based on a new-style I/O, with
13137 SysV signal handling.
13138 In fact the IMAP support had already been removed from the codebase, but
13139 was reinstantiated on user demand: in effect the IMAP code is at the
13140 level of \*(UA v14.8.16 (with
13141 .Ic imapcodec
13142 being the sole exception), and should be treated with some care.
13144 IMAP uses the
13145 .Ql imap://
13147 .Ql imaps://
13148 protocol prefixes, and an IMAP-based
13149 .Va folder
13150 may be used.
13151 IMAP URLs (paths) undergo inspections and possible transformations
13152 before use (and the command
13153 .Ic imapcodec
13154 can be used to manually apply them to any given argument).
13155 Hierarchy delimiters are normalized, a step which is configurable via the
13156 .Va imap-delim
13157 variable chain, but defaults to the first seen delimiter otherwise.
13158 \*(UA supports internationalised IMAP names, and en- and decodes the
13159 names from and to the
13160 .Va ttycharset
13161 as necessary and possible.
13162 If a mailbox name is expanded (see
13163 .Sx "Filename transformations" )
13164 to an IMAP mailbox, all names that begin with `+' then refer to IMAP
13165 mailboxes below the
13166 .Va folder
13167 target box, while folder names prefixed by `@' refer to folders below
13168 the hierarchy base, e.g., the following lists all folders below the
13169 current one when in an IMAP mailbox:
13170 .Ql folders @ .
13172 Note: some IMAP servers do not accept the creation of mailboxes in
13173 the hierarchy base, but require that they are created as subfolders of
13174 `INBOX' \(en with such servers a folder name of the form
13176 .Dl imaps://mylogin@imap.myisp.example/INBOX.
13178 should be used (the last character is the server's hierarchy
13179 delimiter).
13180 The following IMAP-specific commands exist:
13181 .Bl -tag -width ".It Ic BaNg"
13183 .It Ic cache
13184 Only applicable to cached IMAP mailboxes;
13185 takes a message list and reads the specified messages into the IMAP
13186 cache.
13188 .It Ic connect
13189 If operating in disconnected mode on an IMAP mailbox,
13190 switch to online mode and connect to the mail server while retaining
13191 the mailbox status.
13192 See the description of the
13193 .Va disconnected
13194 variable for more information.
13196 .It Ic disconnect
13197 If operating in online mode on an IMAP mailbox,
13198 switch to disconnected mode while retaining the mailbox status.
13199 See the description of the
13200 .Va disconnected
13201 variable for more.
13202 A list of messages may optionally be given as argument;
13203 the respective messages are then read into the cache before the
13204 connection is closed, thus
13205 .Ql disco *
13206 makes the entire mailbox available for disconnected use.
13208 .It Ic imap
13209 Sends command strings directly to the current IMAP server.
13210 \*(UA operates always in IMAP `selected state' on the current mailbox;
13211 commands that change this will produce undesirable results and should be
13212 avoided.
13213 Useful IMAP commands are:
13214 .Bl -tag -offset indent -width ".Ic getquotearoot"
13215 .It create
13216 Takes the name of an IMAP mailbox as an argument and creates it.
13217 .It getquotaroot
13218 (RFC 2087) Takes the name of an IMAP mailbox as an argument
13219 and prints the quotas that apply to the mailbox.
13220 Not all IMAP servers support this command.
13221 .It namespace
13222 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
13223 the Other User's Namespaces and the Shared Namespaces.
13224 Each namespace type is printed in parentheses;
13225 if there are multiple namespaces of the same type,
13226 inner parentheses separate them.
13227 For each namespace a prefix and a hierarchy separator is listed.
13228 Not all IMAP servers support this command.
13231 .It Ic imapcodec
13232 Perform IMAP path transformations.
13233 Supports
13234 .Cm vput
13235 (see
13236 .Sx "Command modifiers" ) ,
13237 and manages the error number
13238 .Va \&! .
13239 The first argument specifies the operation:
13240 .Ar e[ncode]
13241 normalizes hierarchy delimiters (see
13242 .Va imap-delim )
13243 and converts the strings from the locale
13244 .Va ttycharset
13245 to the internationalized variant used by IMAP,
13246 .Ar d[ecode]
13247 performs the reverse operation.
13250 The following IMAP-specific internal variables exist:
13251 .Bl -tag -width ".It Va BaNg"
13253 .It Va disconnected
13254 \*(BO When an IMAP mailbox is selected and this variable is set,
13255 no connection to the server is initiated.
13256 Instead, data is obtained from the local cache (see
13257 .Va imap-cache Ns
13259 Mailboxes that are not present in the cache
13260 and messages that have not yet entirely been fetched from the server
13261 are not available;
13262 to fetch all messages in a mailbox at once,
13263 the command
13264 .No ` Ns Li copy * /dev/null Ns '
13265 can be used while still in connected mode.
13266 Changes that are made to IMAP mailboxes in disconnected mode are queued
13267 and committed later when a connection to that server is made.
13268 This procedure is not completely reliable since it cannot be guaranteed
13269 that the IMAP unique identifiers (UIDs) on the server still match the
13270 ones in the cache at that time.
13271 Data is saved to
13272 .Ev DEAD
13273 when this problem occurs.
13274 .It Va disconnected-USER@HOST
13275 The specified account is handled as described for the
13276 .Va disconnected
13277 variable above,
13278 but other accounts are not affected.
13279 .Mx Va imap-auth
13280 .It Va imap-auth-USER@HOST , imap-auth
13281 Sets the IMAP authentication method.
13282 Valid values are `login' for the usual password-based authentication
13283 (the default),
13284 `cram-md5', which is a password-based authentication that does not send
13285 the password over the network in clear text,
13286 and `gssapi' for GSS-API based authentication.
13288 .It Va imap-cache
13289 Enables caching of IMAP mailboxes.
13290 The value of this variable must point to a directory that is either
13291 existent or can be created by \*(UA.
13292 All contents of the cache can be deleted by \*(UA at any time;
13293 it is not safe to make assumptions about them.
13294 .Mx Va imap-delim
13295 .It Va imap-delim-USER@HOST , imap-delim-HOST , imap-delim
13296 The hierarchy separator used by the IMAP server.
13297 Whenever an IMAP path is specified it will undergo normalization.
13298 One of the normalization steps is the squeezing and adjustment of
13299 hierarchy separators.
13300 If this variable is set, any occurrence of any character of the given
13301 value that exists in the path will be replaced by the first member of
13302 the value; an empty value will cause the default to be used, it is
13303 .Ql /. .
13304 If not set, we will reuse the first hierarchy separator character that
13305 is discovered in a user-given mailbox name.
13306 .Mx Va imap-keepalive
13307 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
13308 IMAP servers may close the connection after a period of
13309 inactivity; the standard requires this to be at least 30 minutes,
13310 but practical experience may vary.
13311 Setting this variable to a numeric `value' greater than 0 causes
13312 a `NOOP' command to be sent each `value' seconds if no other operation
13313 is performed.
13315 .It Va imap-list-depth
13316 When retrieving the list of folders on an IMAP server, the
13317 .Ic folders
13318 command stops after it has reached a certain depth to avoid possible
13319 infinite loops.
13320 The value of this variable sets the maximum depth allowed.
13321 The default is 2.
13322 If the folder separator on the current IMAP server is a slash `/',
13323 this variable has no effect and the
13324 .Ic folders
13325 command does not descend to subfolders.
13326 .Mx Va imap-use-starttls
13327 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
13328 Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
13329 IMAP session SSL/TLS encrypted.
13330 This functionality is not supported by all servers,
13331 and is not used if the session is already encrypted by the IMAPS method.
13333 .Sh "SEE ALSO"
13334 .Xr bogofilter 1 ,
13335 .Xr gpg 1 ,
13336 .Xr more 1 ,
13337 .Xr newaliases 1 ,
13338 .Xr openssl 1 ,
13339 .Xr sendmail 1 ,
13340 .Xr sh 1 ,
13341 .Xr spamassassin 1 ,
13342 .Xr iconv 3 ,
13343 .Xr setlocale 3 ,
13344 .Xr aliases 5 ,
13345 .Xr termcap 5 ,
13346 .Xr terminfo 5 ,
13347 .Xr locale 7 ,
13348 .Xr mailaddr 7 ,
13349 .Xr re_format 7 ,
13350 .Xr mailwrapper 8 ,
13351 .Xr sendmail 8
13352 .Sh HISTORY
13353 M. Douglas McIlroy writes in his article
13354 .Dq A Research UNIX Reader: Annotated Excerpts \
13355 from the Programmer's Manual, 1971-1986
13356 that a
13357 .Xr mail 1
13358 command already appeared in First Edition
13360 in 1971:
13361 .Bd -ragged -offset indent
13362 Electronic mail was there from the start.
13363 Never satisfied with its exact behavior, everybody touched it at one
13364 time or another: to assure the safety of simultaneous access, to improve
13365 privacy, to survive crashes, to exploit uucp, to screen out foreign
13366 freeloaders, or whatever.
13367 Not until v7 did the interface change (Thompson).
13368 Later, as mail became global in its reach, Dave Presotto took charge and
13369 brought order to communications with a grab-bag of external networks
13370 (v8).
13374 Mail was written in 1978 by Kurt Shoens and developed as part of the
13377 distribution until 1995.
13378 Mail has then seen further development in open source
13380 variants, noticeably by Christos Zoulas in
13381 .Pf Net Bx .
13382 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
13383 Ritter in the years 2000 until 2008.
13384 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
13385 This man page is derived from
13386 .Dq The Mail Reference Manual
13387 that was originally written by Kurt Shoens.
13388 .Sh AUTHORS
13389 .An -nosplit
13390 .An "Kurt Shoens" ,
13391 .An "Edward Wang" ,
13392 .An "Keith Bostic" ,
13393 .An "Christos Zoulas" ,
13394 .An "Gunnar Ritter" .
13395 \*(UA is developed by
13396 .An "Steffen Nurpmeso" Aq steffen@sdaoden.eu .
13397 .Sh CAVEATS
13398 \*(ID Interrupting an operation via
13399 .Dv \&\&SIGINT
13401 .Ql control-C
13402 from anywhere else but a command prompt is very problematic and likely
13403 to leave the program in an undefined state: many library functions
13404 cannot deal with the
13405 .Fn siglongjmp 3
13406 that this software (still) performs; even though efforts have been taken
13407 to address this, no sooner but in v15 it will have been worked out:
13408 interruptions have not been disabled in order to allow forceful breakage
13409 of hanging network connections, for example (all this is unrelated to
13410 .Va ignore ) .
13412 The SMTP and POP3 protocol support of \*(UA is very basic.
13413 Also, if it fails to contact its upstream SMTP server, it will not make
13414 further attempts to transfer the message at a later time (setting
13415 .Va save
13417 .Va sendwait
13418 may be useful).
13419 If this is a concern, it might be better to set up a local SMTP server
13420 that is capable of message queuing.
13421 .Sh BUGS
13422 After deleting some message of a POP3 mailbox the header summary falsely
13423 claims that there are no messages to display, one needs to perform
13424 a scroll or dot movement to restore proper state.
13425 In threaded display a power user may encounter crashes very
13426 occasionally (this is may and very).
13427 The file
13428 .Pa TODO
13429 in the source repository lists future directions.
13431 Please report bugs to the
13432 .Va contact-mail
13433 address, e.g., from within \*(uA:
13434 .Ql ? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
13435 Including the output of the command
13436 .Ic version
13437 may be helpful, e.g.,
13438 .Bd -literal -offset indent
13439 ? vput version xy; wysh set escape=!; eval mail $contact-mail
13440 Bug subject
13441 !I xy
13445 More information is available on the web:
13446 .Ql $ \*(uA -X 'echo Ns \| $ Ns Va contact-web Ns ' -Xx .