1 .\"@ nail.1 - S-nail(1) reference manual.
3 .\" Copyright (c) 2012 - 2020 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
4 .\" SPDX-License-Identifier: ISC
6 .\" Permission to use, copy, modify, and/or distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 .\"@ S-nail v14.9.24 / 2022-03-26
27 .ds VD \\%~/dead.letter
31 .ds vS /etc/mime.types
36 .ds ID [v15 behaviour may differ]
38 .ds NQ [Only new quoting rules]
41 .ds OU [no v15-compat]
44 .if !d str-Lb-libterminfo \
45 .ds str-Lb-libterminfo Terminal Information Library (libterminfo, \-lterminfo)
48 .\" Uncomment for mandoc(1) compat.:
49 .\".ds mx-toc-name TABLE OF CONTENTS
50 .Mx -enable -preprocessed
51 .Mx -anchor-spass Sh "NAME" 1
52 .Mx -anchor-spass Sh "SYNOPSIS" 2
53 .Mx -anchor-spass Sh "\*[mx-toc-name]" 3
54 .Mx -anchor-spass Sh "DESCRIPTION" 4
55 .Mx -anchor-spass Ss "Options" 4
56 .Mx -anchor-spass Ss "A starter" 4
57 .Mx -anchor-spass Ss "On sending mail, and non-interactive mode" 4
58 .Mx -anchor-spass Ss "Compose mode" 4
59 .Mx -anchor-spass Ss "On reading mail, and more on interactive mode" 4
60 .Mx -anchor-spass Ss "HTML mail and MIME attachments" 4
61 .Mx -anchor-spass Ss "Mailing lists" 4
62 .Mx -anchor-spass Ss "Signed and encrypted messages with S/MIME" 4
63 .Mx -anchor-spass Ss "On URL syntax and credential lookup" 4
64 .Mx -anchor-spass Ss "Encrypted network communication" 4
65 .Mx -anchor-spass Ss "Character sets" 4
66 .Mx -anchor-spass Ss "Message states" 4
67 .Mx -anchor-spass Ss "Specifying messages" 4
68 .Mx -anchor-spass Ss "On terminal control and line editor" 4
69 .Mx -anchor-spass Ss "Coloured display" 4
70 .Mx -anchor-spass Ss "Handling spam" 4
71 .Mx -anchor-spass Sh "COMMANDS" 5
72 .Mx -anchor-spass Ss "Command modifiers" 5
73 .Mx -anchor-spass Ss "Old-style argument quoting" 5
74 .Mx -anchor-spass Ss "Shell-style argument quoting" 5
75 .Mx -anchor-spass Ss "Message list arguments" 5
76 .Mx -anchor-spass Ss "Raw data arguments for codec commands" 5
77 .Mx -anchor-spass Ss "Filename transformations" 5
78 .Mx -anchor-spass Ss "Commands" 5
79 .Mx -anchor-spass Sh "COMMAND ESCAPES" 6
80 .Mx -anchor-spass Sh "INTERNAL VARIABLES" 7
81 .Mx -anchor-spass Ss "Initial settings" 7
82 .Mx -anchor-spass Ss "Variables" 7
83 .Mx -anchor-spass Sh "ENVIRONMENT" 8
84 .Mx -anchor-spass Sh "FILES" 9
85 .Mx -anchor-spass Ss "Resource files" 9
86 .Mx -anchor-spass Ss "The mime.types files" 9
87 .Mx -anchor-spass Ss "The Mailcap files" 9
88 .Mx -anchor-spass Ss "The .netrc file" 9
89 .Mx -anchor-spass Sh "EXAMPLES" 10
90 .Mx -anchor-spass Ss "An example configuration" 10
91 .Mx -anchor-spass Ss "S/MIME step by step" 10
92 .Mx -anchor-spass Ss "Using CRLs with S/MIME or TLS" 10
93 .Mx -anchor-spass Sh "FAQ" 11
94 .Mx -anchor-spass Ss "\*(UA shortly hangs on startup" 11
95 .Mx -anchor-spass Ss "I cannot login to Google mail \&(via OAuth\&)" 11
96 .Mx -anchor-spass Ss "But, how about XOAUTH2 / OAUTHBEARER?" 11
97 .Mx -anchor-spass Ss "Not \(dqdefunctional\(dq, but the editor key does not work" 11
98 .Mx -anchor-spass Ss "Can \*(UA git-send-email?" 11
99 .Mx -anchor-spass Ss "Howto handle stale dotlock files" 11
100 .Mx -anchor-spass Sh "IMAP CLIENT" 12
101 .Mx -anchor-spass Sh "SEE ALSO" 13
102 .Mx -anchor-spass Sh "HISTORY" 14
103 .Mx -anchor-spass Sh "AUTHORS" 15
104 .Mx -anchor-spass Sh "CAVEATS" 16
105 .Mx -anchor-spass Sh "BUGS" 17
106 .Mx -anchor-spass Fl ":"
107 .Mx -anchor-spass Fl "A"
108 .Mx -anchor-spass Fl "a"
109 .Mx -anchor-spass ixsx "character set specification"
110 .Mx -anchor-spass Fl "b"
111 .Mx -anchor-spass Fl "C"
112 .Mx -anchor-spass Fl "c"
113 .Mx -anchor-spass Fl "D"
114 .Mx -anchor-spass Fl "d"
115 .Mx -anchor-spass Fl "E"
116 .Mx -anchor-spass Fl "e"
117 .Mx -anchor-spass Fl "F"
118 .Mx -anchor-spass Fl "f"
119 .Mx -anchor-spass Fl "H"
120 .Mx -anchor-spass Fl "h"
121 .Mx -anchor-spass Fl "i"
122 .Mx -anchor-spass Fl "L"
123 .Mx -anchor-spass Fl "M"
124 .Mx -anchor-spass Fl "m"
125 .Mx -anchor-spass Fl "N"
126 .Mx -anchor-spass Fl "n"
127 .Mx -anchor-spass Fl "q"
128 .Mx -anchor-spass Fl "R"
129 .Mx -anchor-spass Fl "r"
130 .Mx -anchor-spass Fl "S"
131 .Mx -anchor-spass Fl "s"
132 .Mx -anchor-spass Fl "T"
133 .Mx -anchor-spass Fl "t"
134 .Mx -anchor-spass Fl "u"
135 .Mx -anchor-spass Fl "V"
136 .Mx -anchor-spass Fl "v"
137 .Mx -anchor-spass Fl "X"
138 .Mx -anchor-spass Fl "Y"
139 .Mx -anchor-spass Fl "~"
140 .Mx -anchor-spass Fl "#"
141 .Mx -anchor-spass Fl "."
142 .Mx -anchor-spass ixsx "magic regular expression characters"
143 .Mx -anchor-spass Cd "mle-go-home"
144 .Mx -anchor-spass Cd "mle-go-bwd"
145 .Mx -anchor-spass Cd "mle-raise-int"
146 .Mx -anchor-spass Cd "mle-del-fwd"
147 .Mx -anchor-spass Cd "mle-go-end"
148 .Mx -anchor-spass Cd "mle-go-fwd"
149 .Mx -anchor-spass Cd "mle-reset"
150 .Mx -anchor-spass Cd "mle-del-bwd"
151 .Mx -anchor-spass Cd "mle-complete"
152 .Mx -anchor-spass Cd "mle-commit"
153 .Mx -anchor-spass Cd "mle-snarf-end"
154 .Mx -anchor-spass Cd "mle-repaint"
155 .Mx -anchor-spass Cd "mle-hist-fwd"
156 .Mx -anchor-spass Cd "mle-hist-bwd"
157 .Mx -anchor-spass Cd "mle-quote-rndtrip"
158 .Mx -anchor-spass Cd "mle-hist-srch-bwd"
159 .Mx -anchor-spass Cd "mle-hist-srch-fwd"
160 .Mx -anchor-spass Cd "mle-paste"
161 .Mx -anchor-spass Cd "mle-snarf-line"
162 .Mx -anchor-spass Cd "mle-prompt-char"
163 .Mx -anchor-spass Cd "mle-snarf-word-bwd"
164 .Mx -anchor-spass Cd "mle-go-word-fwd"
165 .Mx -anchor-spass Cd "mle-go-word-bwd"
166 .Mx -anchor-spass Cd "mle-raise-tstp"
167 .Mx -anchor-spass Cd "mle-cancel"
168 .Mx -anchor-spass Cd "mle-snarf-word-fwd"
169 .Mx -anchor-spass Cd "mle-bell"
170 .Mx -anchor-spass Cd "mle-clear-screen"
171 .Mx -anchor-spass Cd "mle-fullreset"
172 .Mx -anchor-spass Cd "mle-go-screen-bwd"
173 .Mx -anchor-spass Cd "mle-go-screen-fwd"
174 .Mx -anchor-spass Cd "mle-raise-quit:"
175 .Mx -anchor-spass Cm "\e"
176 .Mx -anchor-spass Cm "ignerr"
177 .Mx -anchor-spass Cm "local"
178 .Mx -anchor-spass Cm "scope"
179 .Mx -anchor-spass Cm "u"
180 .Mx -anchor-spass Cm "vput"
181 .Mx -anchor-spass Cm "wysh"
182 .Mx -anchor-spass ixsx "primary system mailbox"
183 .Mx -anchor-spass ixsx "secondary mailbox"
184 .Mx -anchor-spass Ic "!"
185 .Mx -anchor-spass Ic "#"
186 .Mx -anchor-spass Ic "+"
187 .Mx -anchor-spass Ic "-"
188 .Mx -anchor-spass Ic "="
189 .Mx -anchor-spass Ic "?"
190 .Mx -anchor-spass Ic "|"
191 .Mx -anchor-spass Ic "account"
192 .Mx -anchor-spass Ic "unaccount"
193 .Mx -anchor-spass Ic "addrcodec"
194 .Mx -anchor-spass Ic "alias"
195 .Mx -anchor-spass Ic "unalias"
196 .Mx -anchor-spass Ic "alternates"
197 .Mx -anchor-spass Ic "unalternates"
198 .Mx -anchor-spass Ic "answered"
199 .Mx -anchor-spass Ic "unanswered"
200 .Mx -anchor-spass Ic "bind"
201 .Mx -anchor-spass Ic "unbind"
202 .Mx -anchor-spass Ic "call"
203 .Mx -anchor-spass Ic "call_if"
204 .Mx -anchor-spass Ic "cd"
205 .Mx -anchor-spass Ic "certsave"
206 .Mx -anchor-spass Ic "charsetalias"
207 .Mx -anchor-spass Ic "uncharsetalias"
208 .Mx -anchor-spass Ic "chdir"
209 .Mx -anchor-spass Ic "collapse"
210 .Mx -anchor-spass Ic "uncollapse"
211 .Mx -anchor-spass Ic "colour"
212 .Mx -anchor-spass Ic "uncolour"
213 .Mx -anchor-spass Ic "commandalias"
214 .Mx -anchor-spass Ic "uncommandalias"
215 .Mx -anchor-spass Ic "Copy"
216 .Mx -anchor-spass Ic "copy"
217 .Mx -anchor-spass Ic "csop"
218 .Mx -anchor-spass Ic "cwd"
219 .Mx -anchor-spass Ic "Decrypt"
220 .Mx -anchor-spass Ic "decrypt"
221 .Mx -anchor-spass Ic "define"
222 .Mx -anchor-spass Ic "undefine"
223 .Mx -anchor-spass Ic "delete"
224 .Mx -anchor-spass Ic "undelete"
225 .Mx -anchor-spass Ic "digmsg"
226 .Mx -anchor-spass Ic "discard"
227 .Mx -anchor-spass Ic "dp"
228 .Mx -anchor-spass Ic "dt"
229 .Mx -anchor-spass Ic "dotmove"
230 .Mx -anchor-spass Ic "draft"
231 .Mx -anchor-spass Ic "undraft"
232 .Mx -anchor-spass Ic "echo"
233 .Mx -anchor-spass Ic "echoerr"
234 .Mx -anchor-spass Ic "echon"
235 .Mx -anchor-spass Ic "echoerrn"
236 .Mx -anchor-spass Ic "edit"
237 .Mx -anchor-spass Ic "elif"
238 .Mx -anchor-spass Ic "else"
239 .Mx -anchor-spass Ic "endif"
240 .Mx -anchor-spass Ic "environ"
241 .Mx -anchor-spass Ic "errors"
242 .Mx -anchor-spass Ic "eval"
243 .Mx -anchor-spass Ic "exit"
244 .Mx -anchor-spass Ic "File"
245 .Mx -anchor-spass Ic "file"
246 .Mx -anchor-spass Ic "filetype"
247 .Mx -anchor-spass Ic "unfiletype"
248 .Mx -anchor-spass Ic "flag"
249 .Mx -anchor-spass Ic "unflag"
250 .Mx -anchor-spass Ic "Folder"
251 .Mx -anchor-spass Ic "folder"
252 .Mx -anchor-spass ixsx "dotlock files"
253 .Mx -anchor-spass Ic "folders"
254 .Mx -anchor-spass Ic "Followup"
255 .Mx -anchor-spass Ic "followup"
256 .Mx -anchor-spass Ic "Forward"
257 .Mx -anchor-spass Ic "forward"
258 .Mx -anchor-spass Ic "from"
259 .Mx -anchor-spass Ic "headerpick"
260 .Mx -anchor-spass Ic "unheaderpick"
261 .Mx -anchor-spass Ic "headers"
262 .Mx -anchor-spass Ic "help"
263 .Mx -anchor-spass Ic "history"
264 .Mx -anchor-spass Ic "hold"
265 .Mx -anchor-spass Ic "if"
266 .Mx -anchor-spass Ic "ignore"
267 .Mx -anchor-spass Ic "list"
268 .Mx -anchor-spass Ic "localopts"
269 .Mx -anchor-spass Ic "Lfollowup"
270 .Mx -anchor-spass Ic "Lreply"
271 .Mx -anchor-spass Ic "Mail"
272 .Mx -anchor-spass Ic "mail"
273 .Mx -anchor-spass Ic "mailcap"
274 .Mx -anchor-spass Ic "mbox"
275 .Mx -anchor-spass Ic "mimetype"
276 .Mx -anchor-spass Ic "unmimetype"
277 .Mx -anchor-spass Ic "mimeview"
278 .Mx -anchor-spass Ic "mlist"
279 .Mx -anchor-spass Ic "unmlist"
280 .Mx -anchor-spass Ic "mlsubscribe"
281 .Mx -anchor-spass Ic "unmlsubscribe"
282 .Mx -anchor-spass Ic "Move"
283 .Mx -anchor-spass Ic "move"
284 .Mx -anchor-spass Ic "More"
285 .Mx -anchor-spass Ic "more"
286 .Mx -anchor-spass Ic "mtaaliases"
287 .Mx -anchor-spass Ic "netrc"
288 .Mx -anchor-spass Ic "newmail"
289 .Mx -anchor-spass Ic "next"
290 .Mx -anchor-spass Ic "New"
291 .Mx -anchor-spass Ic "new"
292 .Mx -anchor-spass Ic "noop"
293 .Mx -anchor-spass Ic "Page"
294 .Mx -anchor-spass Ic "page"
295 .Mx -anchor-spass Ic "Pipe"
296 .Mx -anchor-spass Ic "pipe"
297 .Mx -anchor-spass Ic "preserve"
298 .Mx -anchor-spass Ic "Print"
299 .Mx -anchor-spass Ic "print"
300 .Mx -anchor-spass Ic "quit"
301 .Mx -anchor-spass Ic "read"
302 .Mx -anchor-spass Ic "readsh"
303 .Mx -anchor-spass Ic "readall"
304 .Mx -anchor-spass Ic "readctl"
305 .Mx -anchor-spass Ic "remove"
306 .Mx -anchor-spass Ic "rename"
307 .Mx -anchor-spass Ic "Reply"
308 .Mx -anchor-spass Ic "Respond"
309 .Mx -anchor-spass Ic "reply"
310 .Mx -anchor-spass Ic "respond"
311 .Mx -anchor-spass Ic "Resend"
312 .Mx -anchor-spass Ic "resend"
313 .Mx -anchor-spass Ic "retain"
314 .Mx -anchor-spass Ic "return"
315 .Mx -anchor-spass Ic "Save"
316 .Mx -anchor-spass Ic "save"
317 .Mx -anchor-spass Ic "search"
318 .Mx -anchor-spass Ic "seen"
319 .Mx -anchor-spass Ic "set"
320 .Mx -anchor-spass Ic "unset"
321 .Mx -anchor-spass Ic "shcodec"
322 .Mx -anchor-spass Ic "shell"
323 .Mx -anchor-spass Ic "shortcut"
324 .Mx -anchor-spass Ic "unshortcut"
325 .Mx -anchor-spass Ic "shift"
326 .Mx -anchor-spass Ic "show"
327 .Mx -anchor-spass Ic "size"
328 .Mx -anchor-spass Ic "sleep"
329 .Mx -anchor-spass Ic "sort"
330 .Mx -anchor-spass Ic "unsort"
331 .Mx -anchor-spass Ic "source"
332 .Mx -anchor-spass Ic "source_if"
333 .Mx -anchor-spass Ic "spamclear"
334 .Mx -anchor-spass Ic "spamforget"
335 .Mx -anchor-spass Ic "spamham"
336 .Mx -anchor-spass Ic "spamrate"
337 .Mx -anchor-spass Ic "spamset"
338 .Mx -anchor-spass Ic "spamspam"
339 .Mx -anchor-spass Ic "tls"
340 .Mx -anchor-spass Ic "Top"
341 .Mx -anchor-spass Ic "top"
342 .Mx -anchor-spass Ic "touch"
343 .Mx -anchor-spass Ic "Type"
344 .Mx -anchor-spass Ic "type"
345 .Mx -anchor-spass Ic "unignore"
346 .Mx -anchor-spass Ic "Unread"
347 .Mx -anchor-spass Ic "unread"
348 .Mx -anchor-spass Ic "unretain"
349 .Mx -anchor-spass Ic "urlcodec"
350 .Mx -anchor-spass Ic "varshow"
351 .Mx -anchor-spass Ic "verify"
352 .Mx -anchor-spass Ic "version"
353 .Mx -anchor-spass Ic "vexpr"
354 .Mx -anchor-spass Ic "vpospar"
355 .Mx -anchor-spass Ic "visual"
356 .Mx -anchor-spass Ic "write"
357 .Mx -anchor-spass Ic "xcall"
358 .Mx -anchor-spass Ic "xit"
359 .Mx -anchor-spass Ic "z"
360 .Mx -anchor-spass Ic "Z"
361 .Mx -anchor-spass Ic "~~"
362 .Mx -anchor-spass Ic "~!"
363 .Mx -anchor-spass Ic "~."
364 .Mx -anchor-spass Ic "~:"
365 .Mx -anchor-spass Ic "~<"
366 .Mx -anchor-spass Ic "~<!"
367 .Mx -anchor-spass Ic "~?"
368 .Mx -anchor-spass Ic "~@"
369 .Mx -anchor-spass Ic "~|"
370 .Mx -anchor-spass Ic "~^"
371 .Mx -anchor-spass Ic "~A"
372 .Mx -anchor-spass Ic "~a"
373 .Mx -anchor-spass Ic "~b"
374 .Mx -anchor-spass Ic "~c"
375 .Mx -anchor-spass Ic "~d"
376 .Mx -anchor-spass Ic "~e"
377 .Mx -anchor-spass Ic "~F"
378 .Mx -anchor-spass Ic "~f"
379 .Mx -anchor-spass Ic "~H"
380 .Mx -anchor-spass Ic "~h"
381 .Mx -anchor-spass Ic "~I"
382 .Mx -anchor-spass Ic "~i"
383 .Mx -anchor-spass Ic "~M"
384 .Mx -anchor-spass Ic "~m"
385 .Mx -anchor-spass Ic "~p"
386 .Mx -anchor-spass Ic "~Q"
387 .Mx -anchor-spass Ic "~q"
388 .Mx -anchor-spass Ic "~R"
389 .Mx -anchor-spass Ic "~r"
390 .Mx -anchor-spass Ic "~s"
391 .Mx -anchor-spass Ic "~t"
392 .Mx -anchor-spass Ic "~U"
393 .Mx -anchor-spass Ic "~u"
394 .Mx -anchor-spass Ic "~v"
395 .Mx -anchor-spass Ic "~w"
396 .Mx -anchor-spass Ic "~x"
397 .Mx -anchor-spass ixsx "quadoption"
398 .Mx -anchor-spass Va "?"
399 .Mx -anchor-spass Va "!"
400 .Mx -anchor-spass Va "^"
401 .Mx -anchor-spass Va "^ERR"
402 .Mx -anchor-spass Va "^ERRDOC"
403 .Mx -anchor-spass Va "^ERRNAME"
404 .Mx -anchor-spass Va "^ERRQUEUE-COUNT"
405 .Mx -anchor-spass Va "^ERRQUEUE-EXISTS"
406 .Mx -anchor-spass Va "*"
407 .Mx -anchor-spass Va "@"
408 .Mx -anchor-spass Va "#"
409 .Mx -anchor-spass Va "0"
410 .Mx -anchor-spass Va "1"
411 .Mx -anchor-spass Va "account"
412 .Mx -anchor-spass Va "add-file-recipients"
413 .Mx -anchor-spass Va "allnet"
414 .Mx -anchor-spass Va "append"
415 .Mx -anchor-spass Va "askatend"
416 .Mx -anchor-spass Va "askattach"
417 .Mx -anchor-spass Va "askcc"
418 .Mx -anchor-spass Va "askbcc"
419 .Mx -anchor-spass Va "asksend"
420 .Mx -anchor-spass Va "asksign"
421 .Mx -anchor-spass Va "asksub"
422 .Mx -anchor-spass Va "attrlist"
423 .Mx -anchor-spass Va "autobcc"
424 .Mx -anchor-spass Va "autocc"
425 .Mx -anchor-spass Va "autocollapse"
426 .Mx -anchor-spass Va "autoprint"
427 .Mx -anchor-spass Va "autosort"
428 .Mx -anchor-spass Va "bang"
429 .Mx -anchor-spass Va "bind-timeout"
430 .Mx -anchor-spass Va "bind-inter-byte-timeout"
431 .Mx -anchor-spass Va "bind-inter-key-timeout"
432 .Mx -anchor-spass Va "bsdcompat"
433 .Mx -anchor-spass Va "bsdflags"
434 .Mx -anchor-spass Va "bsdheadline"
435 .Mx -anchor-spass Va "bsdmsgs"
436 .Mx -anchor-spass Va "bsdorder"
437 .Mx -anchor-spass Va "build-cc"
438 .Mx -anchor-spass Va "build-ld"
439 .Mx -anchor-spass Va "build-os"
440 .Mx -anchor-spass Va "build-rest"
441 .Mx -anchor-spass Va "charset-7bit"
442 .Mx -anchor-spass Va "charset-8bit"
443 .Mx -anchor-spass Va "charset-unknown-8bit"
444 .Mx -anchor-spass Va "cmd"
445 .Mx -anchor-spass Va "colour-disable"
446 .Mx -anchor-spass Va "colour-pager"
447 .Mx -anchor-spass Va "contact-mail"
448 .Mx -anchor-spass Va "contact-web"
449 .Mx -anchor-spass Va "content-description-forwarded-message"
450 .Mx -anchor-spass Va "content-description-quote-attachment"
451 .Mx -anchor-spass Va "content-description-smime-message"
452 .Mx -anchor-spass Va "content-description-smime-signature"
453 .Mx -anchor-spass Va "crt"
454 .Mx -anchor-spass Va "customhdr"
455 .Mx -anchor-spass Va "datefield"
456 .Mx -anchor-spass Va "datefield-markout-older"
457 .Mx -anchor-spass Va "debug"
458 .Mx -anchor-spass Va "disposition-notification-send"
459 .Mx -anchor-spass Va "dot"
460 .Mx -anchor-spass Va "dotlock-disable"
461 .Mx -anchor-spass Va "editalong"
462 .Mx -anchor-spass Va "editheaders"
463 .Mx -anchor-spass Va "emptystart"
464 .Mx -anchor-spass Va "errexit"
465 .Mx -anchor-spass Va "errors-limit"
466 .Mx -anchor-spass Va "escape"
467 .Mx -anchor-spass Va "expandaddr"
468 .Mx -anchor-spass Va "expandaddr-domaincheck"
469 .Mx -anchor-spass Va "expandargv"
470 .Mx -anchor-spass Va "features"
471 .Mx -anchor-spass Va "flipr"
472 .Mx -anchor-spass Va "folder"
473 .Mx -anchor-spass Va "folder-hook"
474 .Mx -anchor-spass Va "folder-resolved"
475 .Mx -anchor-spass Va "followup-to"
476 .Mx -anchor-spass Va "followup-to-add-cc"
477 .Mx -anchor-spass Va "followup-to-honour"
478 .Mx -anchor-spass Va "forward-add-cc"
479 .Mx -anchor-spass Va "forward-as-attachment"
480 .Mx -anchor-spass Va "forward-inject-head"
481 .Mx -anchor-spass Va "forward-inject-tail"
482 .Mx -anchor-spass Va "from"
483 .Mx -anchor-spass Va "fullnames"
484 .Mx -anchor-spass Va "header"
485 .Mx -anchor-spass Va "headline"
486 .Mx -anchor-spass Va "headline-bidi"
487 .Mx -anchor-spass Va "headline-plain"
488 .Mx -anchor-spass Va "history-file"
489 .Mx -anchor-spass Va "history-gabby"
490 .Mx -anchor-spass Va "history-gabby-persist"
491 .Mx -anchor-spass Va "history-size"
492 .Mx -anchor-spass Va "hold"
493 .Mx -anchor-spass Va "hostname"
494 .Mx -anchor-spass Va "idna-disable"
495 .Mx -anchor-spass Va "ifs"
496 .Mx -anchor-spass Va "ifs-ws"
497 .Mx -anchor-spass Va "ignore"
498 .Mx -anchor-spass Va "ignoreeof"
499 .Mx -anchor-spass Va "inbox"
500 .Mx -anchor-spass Va "indentprefix"
501 .Mx -anchor-spass Va "keep"
502 .Mx -anchor-spass Va "keep-content-length"
503 .Mx -anchor-spass Va "keepsave"
504 .Mx -anchor-spass Va "line-editor-cpl-word-breaks"
505 .Mx -anchor-spass Va "line-editor-disable"
506 .Mx -anchor-spass Va "line-editor-no-defaults"
507 .Mx -anchor-spass Va "log-prefix"
508 .Mx -anchor-spass Va "mailbox-display"
509 .Mx -anchor-spass Va "mailbox-resolved"
510 .Mx -anchor-spass Va "mailcap-disable"
511 .Mx -anchor-spass Va "mailx-extra-rc"
512 .Mx -anchor-spass Va "markanswered"
513 .Mx -anchor-spass Va "mbox-fcc-and-pcc"
514 .Mx -anchor-spass Va "mbox-rfc4155"
515 .Mx -anchor-spass Va "memdebug"
516 .Mx -anchor-spass Va "message-id-disable"
517 .Mx -anchor-spass Va "message-inject-head"
518 .Mx -anchor-spass Va "message-inject-tail"
519 .Mx -anchor-spass Va "metoo"
520 .Mx -anchor-spass Va "mime-allow-text-controls"
521 .Mx -anchor-spass Va "mime-alternative-favour-rich"
522 .Mx -anchor-spass Va "mime-counter-evidence"
523 .Mx -anchor-spass Va "mime-encoding"
524 .Mx -anchor-spass Va "mime-force-sendout"
525 .Mx -anchor-spass Va "mimetypes-load-control"
526 .Mx -anchor-spass Va "mta"
527 .Mx -anchor-spass Va "mta-aliases"
528 .Mx -anchor-spass Va "mta-arguments"
529 .Mx -anchor-spass Va "mta-no-default-arguments"
530 .Mx -anchor-spass Va "mta-no-receiver-arguments"
531 .Mx -anchor-spass Va "mta-argv0"
532 .Mx -anchor-spass Va "mta-bcc-ok"
533 .Mx -anchor-spass Va "netrc-lookup"
534 .Mx -anchor-spass Va "netrc-pipe"
535 .Mx -anchor-spass Va "newfolders"
536 .Mx -anchor-spass Va "newmail"
537 .Mx -anchor-spass Va "outfolder"
538 .Mx -anchor-spass Va "on-account-cleanup"
539 .Mx -anchor-spass Va "on-compose-cleanup"
540 .Mx -anchor-spass Va "on-compose-enter"
541 .Mx -anchor-spass Va "on-compose-leave"
542 .Mx -anchor-spass Va "on-compose-splice"
543 .Mx -anchor-spass Va "on-compose-splice-shell"
544 .Mx -anchor-spass Va "on-history-addition"
545 .Mx -anchor-spass Va "on-main-loop-tick"
546 .Mx -anchor-spass Va "on-program-exit"
547 .Mx -anchor-spass Va "on-resend-cleanup"
548 .Mx -anchor-spass Va "on-resend-enter"
549 .Mx -anchor-spass Va "page"
550 .Mx -anchor-spass Va "password"
551 .Mx -anchor-spass Va "piperaw"
552 .Mx -anchor-spass Va "pipe-EXTENSION"
553 .Mx -anchor-spass Va "pipe-TYPE/SUBTYPE"
554 .Mx -anchor-spass Ev "MAILX_CONTENT"
555 .Mx -anchor-spass Ev "MAILX_CONTENT_EVIDENCE"
556 .Mx -anchor-spass Ev "MAILX_EXTERNAL_BODY_URL"
557 .Mx -anchor-spass Ev "MAILX_FILENAME"
558 .Mx -anchor-spass Ev "MAILX_FILENAME_GENERATED"
559 .Mx -anchor-spass Ev "MAILX_FILENAME_TEMPORARY"
560 .Mx -anchor-spass Va "pop3-auth"
561 .Mx -anchor-spass Va "pop3-bulk-load"
562 .Mx -anchor-spass Va "pop3-keepalive"
563 .Mx -anchor-spass Va "pop3-no-apop"
564 .Mx -anchor-spass Va "pop3-use-starttls"
565 .Mx -anchor-spass Va "posix"
566 .Mx -anchor-spass Va "print-alternatives"
567 .Mx -anchor-spass Va "prompt"
568 .Mx -anchor-spass Va "prompt2"
569 .Mx -anchor-spass Va "quiet"
570 .Mx -anchor-spass Va "quote"
571 .Mx -anchor-spass Va "quote-add-cc"
572 .Mx -anchor-spass Va "quote-as-attachment"
573 .Mx -anchor-spass Va "quote-chars"
574 .Mx -anchor-spass Va "quote-fold"
575 .Mx -anchor-spass Va "quote-inject-head"
576 .Mx -anchor-spass Va "quote-inject-tail"
577 .Mx -anchor-spass Va "r-option-implicit"
578 .Mx -anchor-spass Va "recipients-in-cc"
579 .Mx -anchor-spass Va "record"
580 .Mx -anchor-spass Va "record-files"
581 .Mx -anchor-spass Va "record-resent"
582 .Mx -anchor-spass Va "reply-in-same-charset"
583 .Mx -anchor-spass Va "reply-strings"
584 .Mx -anchor-spass Va "reply-to"
585 .Mx -anchor-spass Va "reply-to-honour"
586 .Mx -anchor-spass Va "reply-to-swap-in"
587 .Mx -anchor-spass Va "rfc822-body-from_"
588 .Mx -anchor-spass Va "save"
589 .Mx -anchor-spass Va "screen"
590 .Mx -anchor-spass Va "searchheaders"
591 .Mx -anchor-spass Va "sendcharsets"
592 .Mx -anchor-spass Va "sendcharsets-else-ttycharset"
593 .Mx -anchor-spass Va "sender"
594 .Mx -anchor-spass Va "sendwait"
595 .Mx -anchor-spass Va "showlast"
596 .Mx -anchor-spass Va "showname"
597 .Mx -anchor-spass Va "showto"
598 .Mx -anchor-spass Va "Sign"
599 .Mx -anchor-spass Va "sign"
600 .Mx -anchor-spass Va "signature"
601 .Mx -anchor-spass Va "skipemptybody"
602 .Mx -anchor-spass Va "smime-ca-dir"
603 .Mx -anchor-spass Va "smime-ca-file"
604 .Mx -anchor-spass Va "smime-ca-flags"
605 .Mx -anchor-spass Va "smime-ca-no-defaults"
606 .Mx -anchor-spass Va "smime-cipher"
607 .Mx -anchor-spass Va "smime-crl-dir"
608 .Mx -anchor-spass Va "smime-crl-file"
609 .Mx -anchor-spass Va "smime-encrypt-USER@HOST"
610 .Mx -anchor-spass Va "smime-force-encryption"
611 .Mx -anchor-spass Va "smime-sign"
612 .Mx -anchor-spass Va "smime-sign-cert"
613 .Mx -anchor-spass Va "smime-sign-digest"
614 .Mx -anchor-spass Va "smime-sign-include-certs"
615 .Mx -anchor-spass Va "smtp-auth"
616 .Mx -anchor-spass Va "smtp-hostname"
617 .Mx -anchor-spass Va "smtp-use-starttls"
618 .Mx -anchor-spass Va "socket-connect-timeout"
619 .Mx -anchor-spass Va "socks-proxy"
620 .Mx -anchor-spass Va "spam-interface"
621 .Mx -anchor-spass Va "spam-maxsize"
622 .Mx -anchor-spass Va "spamc-command"
623 .Mx -anchor-spass Va "spamc-arguments"
624 .Mx -anchor-spass Va "spamc-user"
625 .Mx -anchor-spass Va "spamfilter-ham"
626 .Mx -anchor-spass Va "spamfilter-noham"
627 .Mx -anchor-spass Va "spamfilter-nospam"
628 .Mx -anchor-spass Va "spamfilter-rate"
629 .Mx -anchor-spass Va "spamfilter-spam"
630 .Mx -anchor-spass Va "spamfilter-rate-scanscore"
631 .Mx -anchor-spass Va "stealthmua"
632 .Mx -anchor-spass Va "system-mailrc"
633 .Mx -anchor-spass Va "termcap"
634 .Mx -anchor-spass Va "termcap-ca-mode"
635 .Mx -anchor-spass Va "termcap-disable"
636 .Mx -anchor-spass Va "tls-ca-dir"
637 .Mx -anchor-spass Va "tls-ca-file"
638 .Mx -anchor-spass Va "tls-ca-flags"
639 .Mx -anchor-spass Va "tls-ca-no-defaults"
640 .Mx -anchor-spass Va "tls-config-file"
641 .Mx -anchor-spass Va "tls-config-module"
642 .Mx -anchor-spass Va "tls-config-pairs"
643 .Mx -anchor-spass Va "tls-crl-dir"
644 .Mx -anchor-spass Va "tls-crl-file"
645 .Mx -anchor-spass Va "tls-features"
646 .Mx -anchor-spass Va "tls-fingerprint"
647 .Mx -anchor-spass Va "tls-fingerprint-digest"
648 .Mx -anchor-spass Va "tls-rand-file"
649 .Mx -anchor-spass Va "tls-verify"
650 .Mx -anchor-spass Va "toplines"
651 .Mx -anchor-spass Va "topsqueeze"
652 .Mx -anchor-spass Va "ttycharset"
653 .Mx -anchor-spass Va "typescript-mode"
654 .Mx -anchor-spass Va "umask"
655 .Mx -anchor-spass Va "user"
656 .Mx -anchor-spass Va "v15-compat"
657 .Mx -anchor-spass Va "verbose"
658 .Mx -anchor-spass Va "version"
659 .Mx -anchor-spass Va "version-date"
660 .Mx -anchor-spass Va "version-hexnum"
661 .Mx -anchor-spass Va "version-major"
662 .Mx -anchor-spass Va "version-minor"
663 .Mx -anchor-spass Va "version-update"
664 .Mx -anchor-spass Va "writebackedited"
665 .Mx -anchor-spass Ev "COLUMNS"
666 .Mx -anchor-spass Ev "DEAD"
667 .Mx -anchor-spass Ev "EDITOR"
668 .Mx -anchor-spass Ev "HOME"
669 .Mx -anchor-spass Ev "LC_ALL"
670 .Mx -anchor-spass Ev "LC_CTYPE"
671 .Mx -anchor-spass Ev "LANG"
672 .Mx -anchor-spass Ev "LINES"
673 .Mx -anchor-spass Ev "LISTER"
674 .Mx -anchor-spass Ev "LOGNAME"
675 .Mx -anchor-spass Ev "MAIL"
676 .Mx -anchor-spass Ev "MAILCAPS"
677 .Mx -anchor-spass Ev "MAILRC"
678 .Mx -anchor-spass Ev "MAILX_NO_SYSTEM_RC"
679 .Mx -anchor-spass Ev "MBOX"
680 .Mx -anchor-spass Ev "NETRC"
681 .Mx -anchor-spass Ev "PAGER"
682 .Mx -anchor-spass Ev "PATH"
683 .Mx -anchor-spass Ev "POSIXLY_CORRECT"
684 .Mx -anchor-spass Ev "SHELL"
685 .Mx -anchor-spass Ev "SOCKS5_PROXY"
686 .Mx -anchor-spass Ev "SOURCE_DATE_EPOCH"
687 .Mx -anchor-spass Ev "TERM"
688 .Mx -anchor-spass Ev "TMPDIR"
689 .Mx -anchor-spass Ev "USER"
690 .Mx -anchor-spass Ev "VISUAL"
691 .Mx -anchor-spass Pa "~/.mailcap"
692 .Mx -anchor-spass Pa "/etc/mailcap"
693 .Mx -anchor-spass Pa "\*(VM"
694 .Mx -anchor-spass Pa "\*(vU"
695 .Mx -anchor-spass Pa "\*(vS"
696 .Mx -anchor-spass Pa "\*(VN"
697 .Mx -anchor-spass Pa "/dev/null"
698 .Mx -anchor-spass Pa "~/.rnd"
699 .Mx -anchor-spass Pa "\*(UR"
700 .Mx -anchor-spass Pa "\*(ur"
701 .Mx -anchor-spass Cd "copiousoutput"
702 .Mx -anchor-spass Cd "needsterminal"
703 .Mx -anchor-spass Cd "x-mailx-async"
704 .Mx -anchor-spass Cd "x-mailx-noquote"
705 .Mx -anchor-spass Cd "x-mailx-test-once"
706 .Mx -anchor-spass Cd "x-mailx-tmpfile"
707 .Mx -anchor-spass Cd "x-mailx-tmpfile-fill"
708 .Mx -anchor-spass Cd "x-mailx-tmpfile-unlink"
709 .Mx -anchor-spass Cd "x-mailx-last-resort"
710 .Mx -anchor-spass Cd "x-mailx-ignore"
711 .Mx -anchor-spass Ic "cache"
712 .Mx -anchor-spass Ic "connect"
713 .Mx -anchor-spass Ic "disconnect"
714 .Mx -anchor-spass Ic "imap"
715 .Mx -anchor-spass Ic "imapcodec"
716 .Mx -anchor-spass Va "disconnected"
717 .Mx -anchor-spass Va "imap-auth"
718 .Mx -anchor-spass Va "imap-cache"
719 .Mx -anchor-spass Va "imap-delim"
720 .Mx -anchor-spass Va "imap-keepalive"
721 .Mx -anchor-spass Va "imap-list-depth"
722 .Mx -anchor-spass Va "imap-use-starttls"
725 .Nd send and receive Internet mail
732 .Op : Ns Fl a Ar attachment Ns \&:
733 .Op : Ns Fl b Ar bcc-addr Ns \&:
734 .Op : Ns Fl C Ar """field:\0body""" Ns \&:
735 .Op : Ns Fl c Ar cc-addr Ns \&:
736 .Op Fl M Ar type | Fl m Ar file | Fl q Ar file | Fl t
737 .Op Fl r Ar from-addr
738 .Oo : Ns Fl S\0 Ns Ar var Ns Oo Ns = Ns Ar value Ns Oc Ns : Ns Oc
740 .Op : Ns Fl T Ar """field:\0addr""" Ns \&:
741 .Op : Ns Fl X Ar cmd Ns \&:
742 .Op : Ns Fl Y Ar cmd Ns \&:
744 .Pf : Ar to-addr Ns \&:
745 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
753 .Op : Ns Fl C Ar """field:\0body""" Ns \&:
755 .Op Fl r Ar from-addr
756 .Oo : Ns Fl S\0 Ns Ar var Ns Oo Ns = Ns Ar value Ns Oc Ns : Ns Oc
758 .Op : Ns Fl X Ar cmd Ns \&:
759 .Op : Ns Fl Y Ar cmd Ns \&:
760 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
767 .Op : Ns Fl C Ar """field:\0body""" Ns \&:
770 .Op Fl r Ar from-addr
771 .Oo : Ns Fl S\0 Ns Ar var Ns Oo Ns = Ns Ar value Ns Oc Ns : Ns Oc
772 .Op : Ns Fl X Ar cmd Ns \&:
773 .Op : Ns Fl Y Ar cmd Ns \&:
775 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
781 .Fl V | Fl Fl version
782 .Mx -toc -tree html pdf ps xhtml
784 .Bd -filled -compact -offset indent
786 S-nail (\*(UA) will see major changes in v15.0 (circa 2022).
787 Some backward incompatibilities cannot be avoided.
790 .Sx "Shell-style argument quoting" ,
791 and shell metacharacters will become (more) meaningful.
792 Some commands accept new syntax today via
794 .Pf ( Sx "Command modifiers" ) .
795 Behaviour is flagged \*(IN and \*(OU,
799 .Pf ( Sx "INTERNAL VARIABLES" )
800 will choose new behaviour when applicable;
801 giving it a value makes
804 \*(OB flags what will vanish.
808 (with value) will be a default in v14.10.0!
811 \*(UA provides a simple and friendly environment for sending and
813 It is intended to provide the functionality of the POSIX
815 command, but is MIME capable and optionally offers extensions for
816 line editing, S/MIME, SMTP and POP3, among others.
817 \*(UA divides incoming mail into its constituent messages and allows
818 the user to deal with them in any order.
822 .Sx "INTERNAL VARIABLES"
823 for manipulating messages and sending mail.
824 It provides the user simple editing capabilities to ease the composition
825 of outgoing messages, and increasingly powerful and reliable
826 non-interactive scripting capabilities.
828 .Bl -tag -width ".It Fl BaNg"
830 .It Fl \&: Ar spec , Fl Fl resource-files Ns =..
831 Controls loading of (as via
833 .Sx "Resource files" :
835 is parsed case-insensitively, the letter
837 corresponds to the system wide
840 the user's personal file
842 The (original) system wide resource is also compiled-in, accessible via
848 disable usage of resource files.
849 Order matters, default is
851 This option overrides
854 .It Fl A Ar name , Fl Fl account Ns =..
858 after program startup is complete (resource files loaded, only
860 commands are to be executed), and switch to its
862 .Sx "primary system mailbox"
865 If activation fails the program
867 s if used non-interactively, or if any of
873 .It Fl a Ar file Ns Oo Ar =input-charset Ns Oo Ar #output-charset Oc Oc , \
877 For \*(CM opportunities refer to
882 is subject to tilde expansion (see
883 .Sx "Filename transformations"
886 if it is not accessible but contains a
888 character, anything before the last
890 will be used as the filename, anything thereafter as a character set
891 specification, as shown.
893 If only an input character set
894 .Mx -ix "character set specification"
895 is specified, the input side is fixed, and no character set conversion
896 will be applied; an empty or the special string hyphen-minus
901 If an output character set has also been specified the desired
902 conversion is performed immediately, not considering file type and
903 content, except for an empty string or hyphen-minus
905 which select the default conversion algorithm (see
906 .Sx "Character sets" ) :
907 no immediate conversion is performed,
909 and its contents will be MIME-classified
910 .Pf ( Sx "HTML mail and MIME attachments" , "The mime.types files")
911 first \(em only the latter mode is available unless
916 (\*(OB: \*(UA will always use line-buffered output, to gain
917 line-buffered input even in batch mode enable batch mode via
920 .It Fl b Ar addr , Fl Fl bcc Ns =..
921 \*(SM Send a blind carbon copy to recipient
923 The option may be used multiple times.
925 .Sx "On sending mail, and non-interactive mode" .
927 .It Fl C Ar """field: body""" , Fl Fl custom-header Ns =..
928 Create a custom header which persists for an entire session.
929 A custom header consists of the field name followed by a colon
931 and the field content body, for example
932 .Ql -C """Blah: Neminem laede; imo omnes, quantum potes, juva""" .
933 Standard header field names cannot be overwritten by custom headers.
934 Runtime adjustable custom headers are available via the variable
939 .Sx "COMMAND ESCAPES" ,
942 are the most flexible and powerful options to manage message headers.
943 This option may be used multiple times.
945 .It Fl c Ar addr , Fl Fl cc Ns =..
948 except it places the argument in the list of carbon copies.
950 .It Fl D , Fl Fl disconnected
955 .It Fl d , Fl Fl debug
956 Enter a debug-only sandbox mode by setting the internal variable
958 the same can be achieved via
959 .Ql Fl S Va \&\&debug
961 .Ql Ic set Va \&\&debug .
965 .It Fl E , Fl Fl discard-empty-messages
969 and thus discard messages with an empty message part body, successfully.
971 .It Fl e , Fl Fl check-and-exit
972 Just check if mail is present (in the system
974 or the one specified via
976 if yes, return an exit status of zero, a non-zero value otherwise.
977 To restrict the set of mails to consider in this evaluation a message
978 specification can be added with the option
980 Quickrun: does not open an interactive session.
983 \*(SM Save the message to send in a file named after the local part of
984 the first recipient's address (instead of in
987 .It Fl f , Fl Fl file
988 Read in the contents of the user's
990 .Sx "secondary mailbox"
992 (or the specified file) for processing;
993 when \*(UA is quit, it writes undeleted messages back to this file
999 argument will undergo some special
1000 .Sx "Filename transformations"
1005 is not an argument to the flag
1007 but is instead taken from the command line after option processing has
1011 that starts with a hyphen-minus, prefix with a relative path, as in
1012 .Ql ./-hyphenbox.mbox .
1014 .It Fl H , Fl Fl header-summary
1015 Display a summary of
1027 A configurable summary view is available via the option
1029 This mode does not honour
1031 Quickrun: does not open an interactive session.
1033 .It Fl h , Fl Fl help
1034 Show a brief usage summary; use
1036 for a list long options.
1041 to ignore tty interrupt signals.
1043 .It Fl L Ar spec , Fl Fl search Ns =..
1044 Display a summary of
1046 of all messages that match the given
1050 found by the same algorithm used by
1054 .Sx "Specifying messages"
1057 This mode does not honour
1062 option has been given in addition no header summary is produced,
1063 but \*(UA will instead indicate via its exit status whether
1065 matched any messages
1069 note that any verbose output is suppressed in this mode and must instead
1070 be enabled explicitly (see
1072 Quickrun: does not open an interactive session.
1075 \*(SM Will flag standard input with the MIME
1077 set to the given known
1079 .Pf ( Sx "HTML mail and MIME attachments" , "The mime.types files" )
1080 and use it as the main message body.
1081 \*(ID Using this option will bypass processing of
1082 .Va message-inject-head
1084 .Va message-inject-tail .
1089 \*(SM MIME classify the specified
1091 and use it as the main message body.
1092 \*(ID Using this option will bypass processing of
1093 .Va message-inject-head
1095 .Va message-inject-tail .
1099 .It Fl N , Fl Fl no-header-summary
1100 inhibit the initial display of message headers when reading mail or
1105 for the internal variable
1109 Standard flag that inhibits reading the system wide
1114 allows more control over the startup sequence; also see
1115 .Sx "Resource files" .
1117 .It Fl q Ar file , Fl Fl quote-file Ns =..
1118 \*(SM Initialize the message body with the contents of
1120 which may be standard input
1122 only in non-interactive context.
1126 .It Fl R , Fl Fl read-only
1131 opened will be in read-only mode.
1133 .It Fl r Ar from-addr , Fl Fl from-address Ns =..
1134 The RFC 5321 reverse-path used for relaying and delegating messages to
1135 its destination(s), for example to report delivery errors, is normally
1136 derived from the address which appears in the
1138 header (or, if that contains multiple addresses, in
1140 A file-based aka local executable
1142 (Mail-Transfer-Agent), however, instead uses the local identity of the
1145 When this command line option is used the given single addressee
1147 will be assigned to the internal variable
1149 but in addition the command line option
1150 .Fl \&\&f Ar from-addr
1151 will be passed to a file-based
1153 whenever a message is sent.
1156 include a user name the address components will be separated and
1157 the name part will be passed to a file-based
1161 Even though not a recipient the
1166 If an empty string is passed as
1168 then the content of the variable
1170 (or, if that contains multiple addresses,
1172 will be evaluated and used for this purpose whenever the file-based
1181 command line options are used when contacting a file-based MTA, unless
1182 this automatic deduction is enforced by
1184 ting the internal variable
1185 .Va r-option-implicit .
1187 Remarks: many default installations and sites disallow overriding the
1188 local user identity like this unless either the MTA has been configured
1189 accordingly or the user is member of a group with special privileges.
1190 Passing an invalid address will cause an error.
1192 .It Fl S Ar var Ns Oo = Ns value Oc , Fl Fl set Ns =..
1194 (or, with a prefix string
1197 .Sx "INTERNAL VARIABLES" ,
1200 iable and optionally assign
1202 if supported; \*(ID the entire expression is evaluated as if specified
1203 within dollar-single-quotes (see
1204 .Sx "Shell-style argument quoting" )
1205 if the internal variable
1208 If the operation fails the program will exit if any of
1213 Settings established via
1215 cannot be changed from within
1216 .Sx "Resource files"
1217 or an account switch initiated by
1219 They will become mutable again before commands registered via
1223 .It Fl s Ar subject , Fl Fl subject Ns =..
1224 \*(SM Specify the subject of the message to be sent.
1225 Newline (NL) and carriage-return (CR) bytes are invalid and will be
1226 normalized to space (SP) characters.
1228 .It Fl T Ar """field: addr""" , Fl Fl target Ns =..
1231 to the list of receivers targeted by
1233 for now supported are only
1239 Field and body (address) are separated by a colon
1241 and optionally blank (space, tabulator) characters.
1247 is parsed like a message header address line, as if it would be part of
1248 a template message fed in via
1250 and the same modifier suffix is supported.
1251 This option may be used multiple times.
1253 .It Fl t , Fl Fl template
1254 \*(SM The text message given (on standard input) is expected to contain,
1255 separated from the message body by an empty line, one or multiple
1256 plain text message headers.
1257 \*(ID Readily prepared MIME mail messages cannot be passed.
1258 Headers can span multiple consecutive lines if follow lines start with
1259 any amount of whitespace.
1260 A line starting with the number sign
1262 in the first column is ignored.
1263 Message recipients can be given via the message headers
1269 modifier enforces treatment as a single addressee, for example
1270 .Ql To?single: exa, <m@ple> )
1273 they will be added to any recipients specified on the command line,
1274 and are likewise subject to
1277 If a message subject is specified via
1279 then it will be used in favour of one given on the command line.
1281 More optional headers are
1283 (possibly overriding
1295 .Ql Mail-Followup-To: ,
1296 by default created automatically dependent on message context, will
1297 be used if specified (a special address massage will however still occur
1299 Any other custom header field (also see
1304 is passed through entirely
1305 unchanged, and in conjunction with the options
1309 it is possible to embed
1310 .Sx "COMMAND ESCAPES" .
1314 .It Fl u Ar user , Fl Fl inbox-of Ns =..
1317 .Sx "primary system mailbox"
1320 appropriate privileges presumed; effectively identical to
1321 .Ql Fl \&\&f Ns \0%user .
1323 .It Fl V , Fl Fl version
1329 will also show the list of
1331 .Ql $ \*(uA -:/ -Xversion -Xx .
1333 .It Fl v , Fl Fl verbose
1335 s the internal variable
1337 to enable logging of informational context messages.
1338 (Increases level of verbosity when used multiple times.)
1342 .It Fl X Ar cmd , Fl Fl startup-cmd Ns =..
1343 Add the given (or multiple for a multiline argument)
1345 to a list of commands to be executed before normal operation starts.
1346 The commands will be evaluated as a unit, just as via
1353 .It Fl Y Ar cmd , Fl Fl cmd Ns =..
1354 Add the given (or multiple for a multiline argument)
1356 to a list of commands to be executed after normal operation has started.
1357 The commands will be evaluated successively in the given order, and as
1358 if given on the program's standard input \(em before interactive
1359 prompting begins in interactive mode, after standard input has been
1362 .It Fl ~ , Fl Fl enable-cmd-escapes
1364 .Sx "COMMAND ESCAPES"
1365 in \*(CM even in non-interactive use cases.
1366 This can for example be used to automatically format the composed
1367 message text before sending the message:
1368 .Bd -literal -offset indent
1369 $ ( echo 'line one. Word. Word2.';\e
1370 echo '~| /usr/bin/fmt -tuw66' ) |\e
1371 LC_ALL=C \*(uA -d~:/ -Sttycharset=utf-8 bob@exam.ple
1374 .It Fl # , Fl Fl batch-mode
1375 Enables batch mode: standard input is made line buffered, the complete
1376 set of (interactive) commands is available, processing of
1377 .Sx "COMMAND ESCAPES"
1379 .Sx "Compose mode" ,
1381 .Sx "INTERNAL VARIABLES"
1382 are adjusted for batch necessities, exactly as if done via
1396 (the latter three to
1402 are looked up, and acted upon.
1403 The following prepares an email message in a batched dry run:
1404 .Bd -literal -offset indent
1405 $ for name in bob alice@exam.ple lisa@exam.ple; do
1406 printf 'mail %s\en~s ubject\enText\en~.\en' "${name}"
1408 LC_ALL=C \*(uA -#:x -Smta=test \e
1409 -X'alias bob bob@exam.ple'
1412 .It Fl \&. , Fl Fl end-options
1413 This flag forces termination of option processing in order to prevent
1414 .Dq option injection
1416 It also forcefully puts \*(UA into send mode, see
1417 .Sx "On sending mail, and non-interactive mode" .
1422 allows their recognition all
1424 arguments given at the end of the command line after a
1426 separator will be passed through to a file-based
1428 (Mail-Transfer-Agent) and persist for the entire session.
1430 constraints do not apply to the content of
1432 Command line receiver address handling supports the
1437 .Sx "On sending mail, and non-interactive mode" .
1438 .Bd -literal -offset indent
1439 $ \*(uA -#:/ -X 'addrcodec enc Hey, ho <silver@go>' -Xx
1442 \*(UA is a direct descendant of
1444 Mail, itself a successor to the Research
1447 .Dq was there from the start
1450 It thus represents the user side of the
1452 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
1453 traditionally taken by
1455 (and most MTAs provide a binary of this name for compatibility reasons).
1460 of \*(UA then the system side is not a mandatory precondition for mail
1463 \*(UA strives for compliance with the POSIX
1468 .Sx "INTERNAL VARIABLES" ,
1472 .Ev POSIXLY_CORRECT ,
1473 needs to be set to adjust behaviour to be almost on par.
1474 Almost, because there is one important difference: POSIX
1475 .Sx "Shell-style argument quoting"
1476 is (\*(ID increasingly) used instead of the
1477 .Sx "Old-style argument quoting"
1478 that the standard documents, which is believed to be a feature.
1479 The builtin as well as the (default) global
1481 .Sx "Resource files"
1482 already bend the standard imposed settings a bit.
1490 in order to suppress the automatic moving of messages to the
1492 .Sx "secondary mailbox"
1494 that would otherwise occur (see
1495 .Sx "Message states" ) ,
1498 to not remove empty system MBOX mailbox files (or all empty such files in
1500 mode) to avoid mangling of file permissions when files eventually get
1503 To enter interactive mode even if the initial mailbox is empty
1507 to allow editing of headers as well as
1509 to not strip down addresses in
1510 .Sx "Compose mode" ,
1513 to include the message that is being responded to when
1515 ing, which is indented by an
1517 that also deviates from standard imposed settings.
1518 .Va mime-counter-evidence
1519 is fully enabled, too.
1521 .Va followup-to-honour
1524 to comply with reply address desires.
1526 Credentials and other settings are easily addressable by grouping them via
1528 The file mode creation mask can be managed with
1530 Files and shell pipe output can be
1534 uation, also during startup from within the
1535 .Sx "Resource files" .
1536 Informational context can be available by
1544 .Ss "On sending mail, and non-interactive mode"
1545 To send a message to one or more people, using a local or built-in
1547 (Mail-Transfer-Agent) transport to actually deliver the generated mail
1548 message, \*(UA can be invoked with arguments which are the names of
1549 people to whom the mail will be sent, and the command line options
1553 can be used to add (blind) carbon copy receivers:
1554 .Bd -literal -offset indent
1556 $ echo Hello, world | \*(uA -:/ -Smta=test -s test $LOGNAME
1558 # Via sendmail(1) MTA
1559 $ </dev/null \*(uA -:x -s test $LOGNAME
1561 # Debug dry-run mode:
1562 $ </dev/null LC_ALL=C \*(uA -d -:/ \e
1563 -Sttycharset=utf8 -Sfullnames \e
1564 -b bcc@exam.ple -c cc@exam.ple -. \e
1565 '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
1567 # With SMTP (no real sending due to -d debug dry-run)
1568 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Sttycharset=utf8 \e
1569 -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
1570 -S from=scriptreply@exam.ple \e
1571 -a /etc/mail.rc --end-options \e
1572 eric@exam.ple < /tmp/letter.txt
1575 Email addresses and plain user names are subject to
1577 filtering, names only are first expanded through
1581 An address in angle brackets consisting only of a valid local user
1583 will be converted to a fully qualified address if either
1585 is not set, or set to a non-empty value; if set to the empty value the
1586 conversion is left up to the
1590 fine-grained control of recipient address types other than user names
1591 and network addresses is possible.
1592 Recipients are classified as follows:
1593 any name that starts with a vertical bar
1595 character specifies a command pipe \(en the command string following the
1597 is executed and the message is sent to its standard input;
1598 likewise, any name that consists only of hyphen-minus
1600 or starts with the character solidus
1602 or the character sequence dot solidus
1604 is treated as a file, regardless of the remaining content.
1605 Any other name which contains a commercial at
1607 character is a network address;
1608 Any other name which starts with a plus sign
1610 character is a mailbox name;
1611 Any other name which contains a solidus
1613 character but no exclamation mark
1617 character before is also a mailbox name;
1618 What remains is treated as a network address.
1619 This classification can be avoided by using a
1622 .Sx "Compose mode" .
1623 .Bd -literal -offset indent
1624 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1625 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1626 $ echo safe | LC_ALL=C \e
1627 \*(uA -:/ -Smta=test -Sv15-compat -Sttycharset=utf8 \e
1628 --set mime-force-sendout --set fullnames \e
1629 -S expandaddr=fail,-all,+addr,failinvaddr -s test \e
1630 --end-options 'Imagine John <cold@turk.ey>'
1633 Before messages are sent they undergo editing in
1634 .Sx "Compose mode" .
1635 But many settings are static and can be set more generally.
1636 The envelope sender address for example is defined by
1638 explicitly defining an originating
1640 may be desirable, especially with the built-in SMTP Mail-Transfer-Agent
1642 .Sx "Character sets"
1643 for outgoing message and MIME part content are configurable via
1645 whereas input data is assumed to be in
1647 Message data will be passed over the wire in a
1649 and MIME parts aka attachments need a
1651 usually taken out of
1652 .Sx "The mime.types files" .
1653 Saving copies of sent messages in a
1655 mailbox may be desirable \(en as for most mailbox
1658 .Sx "Filename transformations"
1661 For the purpose of arranging a complete environment of settings that can
1662 be switched to with a single command or command line option there are
1664 Alternatively a flat configuration could be possible, making use
1665 of so-called variable chains which automatically pick
1669 context-dependent variants some variables support: for example addressing
1670 .Ql Ic Folder Ns \& pop3://yaa@exam.ple
1672 .Va \&\&pop3-no-apop-yaa@exam.ple ,
1673 .Va \&\&pop3-no-apop-exam.ple
1678 .Sx "On URL syntax and credential lookup"
1680 .Sx "INTERNAL VARIABLES" .
1682 To avoid environmental noise scripts should create a script-local
1683 environment, ideally with the command line options
1685 to disable configuration files in conjunction with repetitions of
1687 to specify variables:
1688 .Bd -literal -offset indent
1689 $ env LC_ALL=C \*(uA -:/ \e
1691 -Sttycharset=utf-8 -Smime-force-sendout \e
1692 -Sexpandaddr=fail,-all,failinvaddr \e
1693 -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1694 -S from=scriptreply@exam.ple \e
1695 -s 'Subject to go' -a attachment_file \e
1697 'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1701 As shown, scripts producing messages can
1703 a locale environment, the above specifies the all-compatible 7-bit clean
1706 but will nonetheless take and send UTF-8 in the message text by using
1708 If character set conversion is compiled in
1712 invalid (according to
1714 character input data would normally cause errors; setting
1715 .Va mime-force-sendout
1716 will instead, as a last resort, classify the input as binary data, and
1717 therefore allow message creation to be successful.
1718 (Such content can then be inspected either by installing a
1719 .Va pipe-TYPE/SUBTYPE
1721 .Ql application/octet-stream ,
1722 or possibly automatically through
1723 .Va mime-counter-evidence ) .
1725 In interactive mode, introduced soon, messages can be sent by calling the
1727 command with a list of recipient addresses:
1728 .Bd -literal -offset indent
1729 $ \*(uA -:/ -Squiet -Semptystart -Sfullnames -Smta=test
1730 "/var/spool/mail/user": 0 messages
1731 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1733 ? # Will do the right thing (tm)
1734 ? m rec1@exam.ple rec2@exam.ple
1737 If standard input is a terminal rather than the message to be sent,
1738 the user is expected to type in the message contents.
1739 In compose mode lines beginning with the character
1741 (in fact the value of
1743 are special \(en these are so-called
1744 .Sx "COMMAND ESCAPES"
1745 which can be used to read in files, process shell commands, add and edit
1746 attachments and more.
1755 respectively, to revise the message in its current state,
1757 allows editing of the most important message headers, with the potent
1759 custom headers can be created, for example (more specifically than with
1765 gives an overview of most other available command escapes.
1767 To create file-carbon-copies the special recipient header
1769 may be used as often as desired, for example via
1771 Its entire value (or body in standard terms) is interpreted as a
1773 target, after having been subject to
1774 .Sx "Filename transformations" :
1775 this is the only way to create a file-carbon-copy without introducing an
1776 ambiguity regarding the interpretation of the address, file names with
1777 leading vertical bars or commercial ats can be used.
1778 Like all other recipients
1780 is subject to the checks of
1782 Any local file and pipe command addressee honours the setting of
1783 .Va mbox-fcc-and-pcc .
1785 Once finished with editing the command escape
1787 (see there) will call hooks, insert automatic injections and receivers,
1788 leave compose mode and send the message once it is completed.
1789 Aborting letter composition is possible with either of
1793 the latter of which will save the message in the file denoted by
1800 is set the effect of
1802 can also be achieved by typing end-of-transmission (EOT) via
1805 at the beginning of an empty line, and
1807 is always reachable by typing end-of-text (ETX) twice via
1811 The compose mode hooks
1812 .Va on-compose-enter , on-compose-splice , on-compose-leave
1814 .Va on-compose-cleanup
1817 d macros and provide reliable and increasingly powerful mechanisms to
1818 perform automated message adjustments dependent on message context,
1819 for example addition of message signatures
1820 .Pf ( Va message-inject-head , message-inject-tail )
1821 or creation of additional receiver lists (also by setting
1822 .Va autocc , autobcc ) .
1823 To achieve that the command
1825 may be used in order to query and adjust status of message(s).
1826 The splice hook can also make use of
1827 .Sx "COMMAND ESCAPES" .
1828 (\*(ID The compose mode hooks work for
1829 .Ic forward , mail , reply
1834 only provide the hooks
1837 .Va on-resend-cleanup ,
1838 which are pretty restricted due to the nature of the operation.)
1839 .Ss "On reading mail, and more on interactive mode"
1840 When invoked without addressees \*(UA enters interactive mode in which
1842 When used like that the user's system
1844 (for more on mailbox types please see the command
1846 is read in and a one line header of each message therein is displayed if
1850 The visual style of this summary of
1852 can be adjusted through the variable
1854 and the possible sorting criterion via
1860 can be performed with the command
1862 If the initially opened mailbox is empty \*(UA will instead exit
1863 immediately (after displaying a message) unless the variable
1871 will give a listing of all available commands and
1873 will \*(OPally give a summary of some common ones.
1874 If the \*(OPal documentation strings are available (see
1878 .Pf "(or " Ql \&?X )
1879 and see the actual expansion of
1881 and what its purpose is, i.e., commands can be abbreviated
1882 (note that POSIX defines some abbreviations, so that the alphabetical
1883 order of commands does not necessarily relate to the abbreviations; it is
1884 however possible to define overwrites with
1885 .Ic commandalias ) .
1886 These commands can also produce a more
1890 Messages are given numbers (starting at 1) which uniquely identify
1891 messages; the current message \(en the
1893 \(en will either be the first new message, or the first unread message,
1894 or the first message of the mailbox; the internal variable
1896 will instead cause usage of the last message for this purpose.
1901 ful of header summaries containing the
1905 will display only the summaries of the given messages, defaulting to the
1908 Message content can be displayed with the command
1915 controls whether and when \*(UA will use the configured
1917 for display instead of directly writing to the user terminal
1919 the sole difference to the command
1921 which will always use the
1925 will instead only show the first
1927 of a message (maybe even compressed if
1930 Message display experience may improve by setting and adjusting
1931 .Va mime-counter-evidence ,
1933 .Sx "HTML mail and MIME attachments" .
1935 By default the current message
1937 is displayed, but like with many other commands it is possible to give
1938 a fancy message specification (see
1939 .Sx "Specifying messages" ) ,
1942 will display all unread messages,
1947 will type the messages 1 and 5,
1949 will type the messages 1 through 5, and
1953 will display the previous and the next message, respectively.
1956 (a more substantial alias for
1958 will display a header summary of the given message specification list
1959 instead of their content; the following will search for subjects:
1961 .Dl ? from "'@Some subject to search for'"
1963 In the default setup all header fields of a message will be
1965 d, but fields can be white- or blacklisted for a variety of
1966 applications by using the command
1968 e.g., to restrict their display to a very restricted set for
1970 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1971 In order to display all header fields of a message regardless of
1972 currently active ignore or retain lists, use the commands
1977 will show the raw message content.
1978 Note that historically the global
1980 not only adjusts the list of displayed headers, but also sets
1982 (\*(ID A yet somewhat restricted) Reliable scriptable message
1983 inspection is available via
1986 Dependent upon the configuration a line editor (see the section
1987 .Sx "On terminal control and line editor" )
1988 aims at making the user experience with the many
1991 When reading the system
1997 specified a mailbox explicitly prefixed with the special
1999 modifier (to propagate it to a
2001 .Sx "primary system mailbox" ) ,
2002 then messages which have been read
2003 .Pf (see\0 Sx "Message states" )
2004 will be automatically moved to a
2006 .Sx "secondary mailbox" ,
2009 file, when the mailbox is left, either by changing the active mailbox or
2010 by quitting \*(UA \(en this automatic moving from a system- or primary-
2011 to the secondary mailbox is not performed when the variable
2014 Messages can also be explicitly
2016 d to other mailboxes, whereas
2018 keeps the original message.
2020 can be used to write out data content of specific parts of messages.
2022 After examining a message the user can
2024 to the sender and all recipients (which will also be placed in
2027 .Va recipients-in-cc
2030 exclusively to the sender(s).
2031 To comply with with the receivers desired reply address the
2035 .Va followup-to-honour
2038 should usually be set.
2043 know how to apply a special addressee massage, see
2044 .Sx "Mailing lists" .
2045 Dependent on the presence and value of
2047 the message being replied to will be included in a quoted form.
2049 ing a message will allow editing the new message: the original message
2050 will be contained in the message body, adjusted according to
2056 messages: the former will add a series of
2058 headers, whereas the latter will not; different to newly created
2059 messages editing is not possible and no copy will be saved even with
2061 unless the additional variable
2064 When sending, replying or forwarding messages comments and full names
2065 will be stripped from recipient addresses unless the internal variable
2069 Of course messages can be
2071 and they can spring into existence again via
2073 or when the \*(UA session is ended via the
2077 commands to perform a quick program termation.
2078 To end a mail processing session regularly and perform a full program
2079 exit one may issue the command
2081 It will, among others, move read messages to the
2083 .Sx "secondary mailbox"
2085 as necessary, discard deleted messages in the current mailbox,
2086 and update the \*(OPal (see
2090 By the way, whenever the main event loop is about to look out for the
2091 next input line it will trigger the hook
2092 .Va on-main-loop-tick .
2093 .Ss "HTML mail and MIME attachments"
2094 HTML-only messages become more and more common, and many messages come
2095 bundled with a bouquet of MIME (Multipurpose Internet Mail Extensions)
2096 parts and attachments.
2097 To get a notion of MIME types there is a built-in default set,
2098 onto which the content of
2099 .Sx "The mime.types files"
2100 will be added (as configured and allowed by
2101 .Va mimetypes-load-control ) .
2102 Types can also become registered and listed with the command
2104 To improve interaction with the faulty MIME part declarations of real life
2105 .Va mime-counter-evidence
2106 will allow verification of the given assertion, and the possible
2107 provision of an alternative, better MIME type.
2108 Note plain text parts will always be preferred in
2109 .Ql multipart/alternative
2110 MIME messages unless
2111 .Va mime-alternative-favour-rich
2114 Whereas a simple HTML-to-text filter for displaying HTML messages is
2115 \*(OPally supported (indicated by
2116 .Ql ,+filter-html-tagsoup,
2119 MIME types other than plain text cannot be handled directly.
2120 To deal with specific non-text MIME types or file extensions programs
2121 need to be registered which either prepare (re-)integrable plain text
2122 versions of their input (a mode which is called
2123 .Cd copiousoutput ) ,
2124 or display the content externally, for example in a graphical window:
2125 the latter type is only considered by and for the command
2128 To install a handler program for a MIME type an according
2129 .Va pipe-TYPE/SUBTYPE
2130 variable needs to be set; to define a handler for a file extension
2132 can be used \(en these handlers take precedence.
2133 \*(OPally mail user agent configuration is supported (see
2134 .Sx "The Mailcap files" ) ,
2135 and will be queried for display or quote handlers after the former ones.
2136 Type-markers registered via
2138 are the last possible source for information how to handle a MIME type.
2140 For example, to display HTML messages integrated via the text browsers
2144 register a MathML MIME type and enable its plain text display, and to
2145 open PDF attachments in an external PDF viewer, asynchronously and with
2146 some other magic attached:
2147 .Bd -literal -offset indent
2148 ? if "$features" !% ,+filter-html-tagsoup,
2149 ? #set pipe-text/html='?* elinks -force-html -dump 1'
2150 ? set pipe-text/html='?* lynx -stdin -dump -force_html'
2151 ? # Display HTML as plain text instead
2152 ? #set pipe-text/html=?t
2155 ? mimetype ?t application/mathml+xml mathml
2157 ? wysh set pipe-application/pdf='?&=? \e
2158 trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
2159 trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
2160 mupdf "${MAILX_FILENAME_TEMPORARY}"'
2164 ? \eset mime-alternative-favour-rich pipe-text/html=?h?
2167 ? \ecommandalias html \e\ecall showhtml
2170 Known or subscribed-to mailing lists may be flagged in the summary of
2175 and will gain special treatment when sending mails: the variable
2176 .Va followup-to-honour
2178 .Ql Mail-\:Followup-\:To:
2179 header is honoured when a message is being replied to
2186 controls creation of this header when creating
2188 s, if the necessary user setup
2189 .Pf ( from , sender ) ;
2190 is available; then, it may also be created automatically, for example
2191 when list-replying via
2199 is used and the messages
2200 .Ql Mail-Followup-To:
2207 manage \*(UAs notion of which addresses are mailing lists.
2208 With the \*(OPal regular expression support any address
2209 .Mx -ix "magic regular expression characters"
2210 which contains any of the magic regular expression characters
2216 dependent on the host system)
2217 will be compiled and used as one, possibly matching many addresses.
2218 It is not possible to escape the
2220 in order to match special characters as-is, bracket expressions must be
2222 .Ql Ic search Li @subject@'[[]open bracket' .
2223 .Bd -literal -offset indent
2224 ? set followup-to followup-to-honour=ask-yes \e
2225 reply-to-honour=ask-yes
2226 ? mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
2227 ? mlsubscribe a4@b4.c4 exact@lists.c3
2230 Known and subscribed lists differ in that for the latter the
2232 s address is not part of a generated
2233 .Ql Mail-Followup-To: .
2234 There are exceptions, for example if multiple lists are addressed and
2235 not all have the subscription attribute.
2236 When replying to a message its list address
2238 header) is automatically and temporarily treated like a known
2240 dependent on the variable
2244 is used instead (if it is a single address on the same domain as
2246 in order to accept a list administrator's wish that is supposed to have
2247 been manifested like that.
2249 For convenience and compatibility with mail programs that do not honour
2250 the non-standard M-F-T, an automatic user entry in the carbon-copy
2252 address list of generated message can be created by setting
2253 .Va followup-to-add-cc .
2254 This entry will be added whenever the user will be placed in the
2255 .Ql Mail-Followup-To:
2256 list, and is not a regular addressee already.
2257 .Va reply-to-swap-in
2258 tries to deal with the address rewriting that many mailing-lists nowadays
2259 perform to work around DKIM / DMARC etc. standard imposed problems.
2260 .Ss "Signed and encrypted messages with S/MIME"
2261 \*(OP S/MIME provides two central mechanisms:
2262 message signing and message encryption.
2263 A signed message contains some data in addition to the regular text.
2264 The data can be used to verify that the message has been sent using
2265 a valid certificate, that the sender address matches that in the
2266 certificate, and that the message text has not been altered.
2267 Signing a message does not change its regular text;
2268 it can be read regardless of whether the recipients software is able to
2270 It is thus usually possible to sign all outgoing messages if so desired.
2272 Encryption, in contrast, makes the message text invisible for all people
2273 except those who have access to the secret decryption key.
2274 To encrypt a message, the specific recipients public encryption key
2276 It is therefore not possible to send encrypted mail to people unless their
2277 key has been retrieved from either previous communication or public key
2279 Because signing is performed with private keys, and encryption with
2280 public keys, messages should always be signed before being encrypted.
2282 A central concept to S/MIME is that of the certification authority (CA).
2283 A CA is a trusted institution that issues certificates.
2284 For each of these certificates it can be verified that it really
2285 originates from the CA, provided that the CA's own certificate is
2287 A set of CA certificates is usually delivered and installed together
2288 with the cryptographical library that is used on the local system.
2289 Therefore reasonable security for S/MIME on the Internet is provided if
2290 the source that provides that library installation is trusted.
2291 It is also possible to use a specific pool of trusted certificates.
2293 .Va smime-ca-no-defaults
2294 should be set to avoid using the default certificate pool, and
2298 should be pointed to a trusted pool of certificates.
2299 A certificate cannot be more secure than the method its CA certificate
2300 has been retrieved with.
2302 This trusted pool of certificates is used by the command
2304 to ensure that the given S/MIME messages can be trusted.
2305 If so, verified sender certificates that were embedded in signed
2306 messages can be saved locally with the command
2308 and used by \*(UA to encrypt further communication with these senders:
2309 .Bd -literal -offset indent
2311 ? set smime-encrypt-USER@HOST=FILENAME \e
2312 smime-cipher-USER@HOST=AES256
2315 To sign outgoing messages, in order to allow receivers to verify the
2316 origin of these messages, a personal S/MIME certificate is required.
2317 \*(UA supports password-protected personal certificates (and keys), see
2318 .Va smime-sign-cert .
2320 .Sx "On URL syntax and credential lookup"
2321 gives an overview of the possible sources of user credentials, and
2322 .Sx "S/MIME step by step"
2323 shows examplarily how a private S/MIME certificate can be obtained.
2324 In general, if such a private key plus certificate
2326 is available, all that needs to be done is to set some variables:
2327 .Bd -literal -offset indent
2328 ? set smime-sign-cert=ME@exam.ple.paired \e
2329 smime-sign-digest=SHA512 \e
2330 smime-sign from=myname@my.host
2333 Variables of interest for S/MIME in general are
2336 .Va smime-ca-flags ,
2337 .Va smime-ca-no-defaults ,
2339 .Va smime-crl-file .
2340 For S/MIME signing of interest are
2342 .Va smime-sign-cert ,
2343 .Va smime-sign-include-certs
2345 .Va smime-sign-digest .
2346 Additional variables of interest for S/MIME en- and decryption:
2349 .Va smime-encrypt-USER@HOST .
2350 Variables of secondary interest may be
2351 .Va content-description-smime-message
2353 .Va content-description-smime-signature .
2354 S/MIME is available if
2359 \*(ID Note that neither S/MIME signing nor encryption applies to
2360 message subjects or other header fields yet.
2361 Thus they may not contain sensitive information for encrypted messages,
2362 and cannot be trusted even if the message content has been verified.
2363 When sending signed messages,
2364 it is recommended to repeat any important header information in the
2366 .Ss "On URL syntax and credential lookup"
2367 For accessing protocol-specific resources Uniform Resource Locators
2368 (URL, RFC 3986) have become omnipresent.
2369 Here they are expected in a
2371 variant, not used in data exchange, but only meant as a compact,
2372 easy-to-use way of defining and representing information in a well-known
2373 notation; as such they do not conform to any real standard.
2374 Optional parts are placed in brackets
2376 optional either because there also exist other ways to define the
2377 information, or because the part is protocol specific.
2379 for example is used by the \*(OPal Maildir
2381 type and the IMAP protocol, but not by POP3.
2386 are included in an URL server specification, URL percent encoded
2387 (RFC 3986) forms are needed, generable with
2390 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
2393 .Sx "INTERNAL VARIABLES"
2394 exist in multiple versions, called
2396 in this document: the plain
2401 .Ql variable-USER@HOST .
2402 If a port was specified
2410 is never in URL percent encoded form.
2411 For example, whether the hypothetical
2412 .Ql smtp://\:wings\:%3A\:of\:@a.dove
2413 including user and password was used, or whether it was
2415 and it came from a different source, to lookup the chain
2416 .Va tls-config-pairs
2418 .Ql tls-\:config-\:pairs-\:wings:of@a.dove
2420 .Ql tls-\:config-pairs\-\:a.dove ,
2421 before finally looking up the plain variable.
2423 The logic to collect (an
2425 s) credential information is as follows:
2428 A user is always required.
2431 has been given in the URL the variables
2436 Afterwards, when enforced by the \*(OPal variables
2437 .Va netrc-lookup-HOST
2440 .Sx "The .netrc file"
2441 of the user will be searched for a
2443 specific entry which provides a
2445 name: only unambiguous entries are used (one possible matching entry for
2448 If there is still no
2452 known to be a valid user on the current host, is used.
2454 Authentication: unless otherwise noted the chain
2455 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
2456 is checked, falling back to a protocol-specific default as necessary.
2460 has been given in the URL, then if the
2462 has been found through the \*(OPal
2464 that may have also provided the password.
2466 .Va password-USER@HOST , password-HOST , password
2469 Thereafter the (now complete) \*(OPal chain
2470 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
2471 is checked, if set the
2473 cache is searched for a password only (multiple user accounts for
2474 a single machine may exist as well as a fallback entry without user
2475 but with a password).
2477 If at that point there is still no password available, but the
2478 (protocols') chosen authentication type requires a password, then in
2479 interactive mode the user will be prompted on the terminal.
2483 S/MIME verification works relative to the values found in the
2487 header field(s), which means the values of
2488 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
2490 .Va smime-sign-digest
2491 will not be looked up using the
2495 chains from above, but instead use the corresponding values from the
2496 message that is being worked on.
2497 If no address matches we assume and use the setting of
2499 In unusual cases multiple and different
2503 combinations may therefore be involved \(en on the other hand those
2504 unusual cases become possible.
2505 The usual case is as short as:
2506 .Bd -literal -offset indent
2507 set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
2508 smime-sign smime-sign-cert=+smime.pair \e
2514 contains complete example configurations.
2515 .Ss "Encrypted network communication"
2516 \*(OP SSL (Secure Sockets Layer) aka its successor TLS (Transport Layer
2517 Security) are protocols which aid in securing communication by providing
2518 a safely initiated and encrypted network connection.
2519 A central concept of TLS are certificates: as part of each network
2520 connection setup a (set of) certificates will be exchanged through which
2521 the identity of the network peer can be cryptographically verified;
2522 if possible the TLS/SNI (ServerNameIndication) extension will be enabled
2523 to allow servers fine-grained control over the certificates being used.
2524 A locally installed pool of trusted certificates will then be inspected,
2525 and verification will succeed if it contains a(n in)direct signer of the
2526 presented certificate(s).
2528 The local pool of trusted so-called CA (Certification Authority)
2529 certificates is usually delivered with and used along the TLS library.
2530 A custom pool of trusted certificates can be selected by pointing
2532 and/or (with special preparation)
2534 to the desired location; setting
2535 .Va tls-ca-no-defaults
2536 in addition will avoid additional inspection of the default pool.
2537 A certificate cannot be more secure than the method its CA certificate
2538 has been retrieved with.
2539 For inspection or other purposes, the certificate of a server (as seen
2540 when connecting to it) can be fetched with the command
2542 (port can usually be the protocol name, too, and
2544 is taken into account here):
2545 .Bd -literal -offset indent
2546 $ \*(uA -vX 'tls certchain SERVER-URL[:PORT]; x'
2549 A local pool of CA certificates is not strictly necessary, however,
2550 server certificates can also be verified via their fingerprint.
2551 For this a message digest will be calculated and compared against the
2553 .Va tls-fingerprint ,
2554 and verification will succeed if the fingerprint matches.
2555 The message digest (algorithm) can be configured via the variable chain
2556 .Va tls-fingerprint-digest ;
2559 .Bd -literal -offset indent
2560 $ \*(uA -X 'wysh set verbose; tls fingerprint SERVER-URL[:PORT]; x'
2563 It depends on the used protocol whether encrypted communication is
2564 possible, and which configuration steps have to be taken to enable it.
2565 Some protocols, like POP3S, are implicitly encrypted, others, like
2566 POP3, can upgrade a plain text connection if so requested.
2567 For example, to use the
2569 that POP3 offers (a member of) the variable (chain)
2570 .Va pop3-use-starttls
2571 needs to be set, with convenience via
2573 .Bd -literal -offset indent
2574 shortcut encpop1 pop3s://pop1.exam.ple
2576 shortcut encpop2 pop3://pop2.exam.ple
2577 set pop3-use-starttls-pop2.exam.ple
2579 set mta=smtps://smtp.exam.ple:465
2580 set mta=smtp://smtp.exam.ple smtp-use-starttls
2583 Normally that is all there is to do, given that TLS libraries try to
2584 provide safe defaults, plenty of knobs however exist to adjust settings.
2585 For example certificate verification settings can be fine-tuned via
2587 and the TLS configuration basics are accessible via
2588 .Va tls-config-pairs ,
2589 for example to control protocol versions or cipher lists.
2590 In the past hints on how to restrict the set of protocols to highly
2591 secure ones were indicated, but as of the time of this writing the list
2592 of protocols or ciphers may need to become relaxed in order to be able
2593 to connect to some servers; the following example allows connecting to a
2595 that uses OpenSSL 0.9.8za from June 2014 (refer to
2596 .Sx "INTERNAL VARIABLES"
2597 for more on variable chains):
2598 .Bd -literal -offset indent
2599 wysh set tls-config-pairs-lion@exam.ple='MinProtocol=TLSv1.1,\e
2600 CipherString=TLSv1.2:!aNULL:!eNULL:\e
2601 ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
2602 DHE-RSA-AES256-SHA:@STRENGTH'
2607 should be referred to when creating a custom cipher list.
2608 Variables of interest for TLS in general are
2612 .Va tls-ca-no-defaults ,
2613 .Va tls-config-file ,
2614 .Va tls-config-module ,
2615 .Va tls-config-pairs ,
2627 .Ss "Character sets"
2628 \*(OP The user's locale environment is detected by looking at the
2630 environment variable.
2631 The internal variable
2633 will be set to the detected terminal character set accordingly,
2634 and will thus show up in the output of commands like
2638 This character set will be targeted when trying to display data,
2639 and user input data is expected to be in this character set, too.
2641 When creating messages their character input data is classified.
2642 7-bit clean text data and attachments will be classified as
2644 8-bit data will \*(OPally be converted into members of
2646 until a character set conversion succeeds.
2648 is the implied default last member of this list.
2649 If no 8-bit character set is capable to represent input data,
2650 no message will be sent, and its text will optionally be
2654 If that is not acceptable, for example in script environments,
2655 .Va mime-force-sendout
2656 can be set to force sending of non-convertible data as
2657 .Ql application/octet-stream
2658 classified binary content instead: like this receivers still have the
2659 option to inspect message content (for example via
2660 .Va mime-counter-evidence ) .
2661 If the \*(OPal character set conversion is not available
2666 is the only supported character set for non 7-bit clean data, and
2667 it is simply assumed it can be used to exchange 8-bit messages.
2670 may also be given an explicit value to send mail in a completely
2672 locale environment, which can be used to generate and send for
2673 example 8-bit UTF-8 input data in a pure 7-bit US-ASCII
2675 environment (an example of this can be found in the section
2676 .Sx "On sending mail, and non-interactive mode" ) .
2677 Due to lack of programming interfaces reading mail will not really work
2678 as expected in a faked environment: whereas
2680 might be addressable, any output will be made safely printable, as via
2683 according to the actual locale environment, which is not affected by
2686 Classifying 7-bit clean data as
2688 is a problem if the input character set
2689 .Pf ( Va ttycharset )
2690 is a multibyte character set that is itself 7-bit clean.
2691 For example, the Japanese character set ISO-2022-JP is, but is capable
2692 to encode the rich set of Japanese Kanji, Hiragana and Katakana
2693 characters: in order to notify receivers of this character set the mail
2694 message must be MIME encoded so that the character set ISO-2022-JP can
2695 be advertised, otherwise an invalid email message would result!
2696 To achieve this, the variable
2698 can be set to ISO-2022-JP.
2699 (Today a better approach regarding email is the usage of UTF-8, which
2700 uses 8-bit bytes for non-US-ASCII data.)
2702 When replying to a message and the variable
2703 .Va reply-in-same-charset
2704 is set, the character set of the message being replied to is tried first
2705 as a target character set (still being a subject of
2707 filtering, however).
2708 Another opportunity is
2709 .Va sendcharsets-else-ttycharset
2710 to reflect the user's locale environment automatically, it will treat
2712 as an implied member of (an unset)
2715 \*(OP When reading messages, their text data is converted into
2717 as necessary in order to display them on the user's terminal.
2718 Unprintable characters and invalid byte sequences are detected
2719 and replaced by substitution characters.
2720 Character set mappings for source character sets can be established with
2722 which may be handy to work around faulty or incomplete character set
2723 catalogues (one could for example add a missing LATIN1 to ISO-8859-1
2724 mapping), or to enforce treatment of one character set as another one
2725 .Pf ( Dq interpret LATIN1 as CP1252 ) .
2727 .Va charset-unknown-8bit
2728 to deal with another hairy aspect of message interpretation.
2730 In general, if a message saying
2731 .Dq cannot convert from a to b
2732 appears, either some characters are not appropriate for the currently
2733 selected (terminal) character set,
2734 or the needed conversion is not supported by the system.
2735 In the first case, it is necessary to set an appropriate
2737 locale and/or the variable
2739 The best results are usually achieved when running in a UTF-8
2740 locale on a UTF-8 capable terminal, in which case the full Unicode
2741 spectrum of characters is available.
2742 In this setup characters from various countries can be displayed,
2743 while it is still possible to use more simple character sets for sending
2744 to retain maximum compatibility with older mail clients.
2746 On the other hand the POSIX standard defines a locale-independent 7-bit
2747 .Dq portable character set
2748 that should be used when overall portability is an issue, the even more
2749 restricted subset named
2750 .Dq portable filename character set
2751 consists of A-Z, a-z, 0-9, period
2757 .Ss "Message states"
2758 \*(UA differentiates in between several message states; the current
2759 state will be reflected in the summary of
2766 .Sx "Specifying messages"
2767 dependent on their state is possible.
2768 When operating on the system
2772 .Sx "primary system mailbox" ,
2773 special actions, like the automatic moving of messages to the
2775 .Sx "secondary mailbox"
2777 may be applied when the mailbox is left (also implicitly by program
2778 termination, unless the command
2780 was used) \(en however, because this may be irritating to users which
2783 mail-user-agents, the provided global
2785 template sets the internal
2789 variables in order to suppress this behaviour.
2790 .Bl -hang -width ".It Ql new"
2792 Message has neither been viewed nor moved to any other state.
2793 Such messages are retained even in the
2795 .Sx "primary system mailbox" .
2797 Message has neither been viewed nor moved to any other state, but the
2798 message was present already when the mailbox has been opened last:
2799 Such messages are retained even in the
2801 .Sx "primary system mailbox" .
2803 The message has been processed by one of the following commands:
2822 will always try to automatically
2828 logical message, and may thus mark multiple messages as read, the
2830 command will do so if the internal variable
2836 command is used, messages that are in a
2838 .Sx "primary system mailbox"
2841 state when the mailbox is left will be saved in the
2843 .Sx "secondary mailbox"
2845 unless the internal variable
2849 The message has been processed by one of the following commands:
2855 can be used to access such messages.
2857 The message has been processed by a
2859 command and it will be retained in its current location.
2861 The message has been processed by one of the following commands:
2867 command is used, messages that are in a
2869 .Sx "primary system mailbox"
2872 state when the mailbox is left will be deleted; they will be saved in the
2874 .Sx "secondary mailbox"
2876 when the internal variable
2881 In addition to these message states, flags which otherwise have no
2882 technical meaning in the mail system except allowing special ways of
2883 addressing them when
2884 .Sx "Specifying messages"
2885 can be set on messages.
2886 These flags are saved with messages and are thus persistent, and are
2887 portable between a set of widely used MUAs.
2888 .Bl -hang -width ".It Ic answered"
2890 Mark messages as having been answered.
2892 Mark messages as being a draft.
2894 Mark messages which need special attention.
2896 .Ss "Specifying messages"
2900 .Sx "Message list arguments" ,
2907 can perform actions on a number of messages at once.
2908 Specifying invalid messages, or using illegal syntax, will cause errors
2909 to be reported through the
2910 .Sx "INTERNAL VARIABLES"
2913 and companions, as well as the command exit status
2918 deletes the messages 1 and 2,
2921 will delete the messages 1 through 5.
2922 In sorted or threaded mode (see the
2926 will delete the messages that are located between (and including)
2927 messages 1 through 5 in the sorted/threaded order, as shown in the
2931 Errors can for example be
2933 when requesting an invalid message,
2935 if no applicable message can be found,
2936 .Va ^ERR Ns -CANCELED
2937 for missing informational data (mostly thread-related).
2939 for invalid syntax as well as
2941 for input/output errors can happen.
2942 The following special message names exist:
2943 .Bl -tag -width ".It Ar BaNg"
2945 The current message, the so-called
2948 The message that was previously the current message; needs to be quoted.
2950 The parent message of the current message,
2951 that is the message with the Message-ID given in the
2953 field or the last entry of the
2955 field of the current message.
2957 The previous undeleted message, or the previous deleted message for the
2963 ed mode, the previous such message in the according order.
2965 The next undeleted message, or the next deleted message for the
2971 ed mode, the next such message in the according order.
2973 The first undeleted message,
2974 or the first deleted message for the
2980 ed mode, the first such message in the according order.
2982 The last message; In
2986 ed mode, the last such message in the according order.
2993 mode, selects the message addressed with
2997 is any other message specification,
2998 and all messages from the thread that begins at it.
2999 Otherwise it is identical to
3004 the thread beginning with the current message is selected.
3008 All messages that were included in the
3009 .Sx "Message list arguments"
3010 of the previous command; needs to be quoted.
3011 (A convenient way to read all new messages is to select them via
3013 as below, and then to read them in order with the default command \(em
3015 \(em simply by successively typing
3021 An inclusive range of message numbers.
3022 Selectors that may also be used as endpoints include any of
3026 .Dq any substring matches
3029 header, which will match addresses (too) even if
3031 is set (and POSIX says
3032 .Dq any address as shown in a header summary shall be matchable in this form ) ;
3035 variable is set, only the local part of the address is evaluated
3036 for the comparison, not ignoring case, and the setting of
3038 is completely ignored.
3039 For finer control and match boundaries use the
3042 .It Ar / Ns Ar string
3043 All messages that contain
3045 in the subject field (case ignored according to locale).
3052 the string from the previous specification of that type is used again.
3053 .It Xo Op Ar @ Ns Ar name-list Ns
3056 All messages that contain the given case-insensitive search
3058 ession; If the \*(OPal regular expression support is available
3060 will be interpreted as (an extended) one if any of the
3062 .Sx "magic regular expression characters"
3065 .Ar @ Ns Ar name-list
3066 part is missing the search is restricted to the subject field body,
3069 specifies a comma-separated list of header fields to search, for example
3071 .Dl '@to,from,cc@Someone i ought to know'
3073 In order to search for a string that includes a
3075 (commercial at) character the
3077 is effectively non-optional, but may be given as the empty string.
3078 Also, specifying an empty search
3080 ession will effectively test for existence of the given header fields.
3081 Some special header fields may be abbreviated:
3095 respectively and case-insensitively.
3096 \*(OPally, and just like
3099 will be interpreted as (an extended) regular expression if any of the
3101 .Sx "magic regular expression characters"
3108 can be used to search in (all of) the header(s) of the message, and the
3117 will perform full text searches \(en whereas the former searches only
3118 the body, the latter also searches the message header (\*(ID this mode
3119 yet brute force searches over the entire decoded content of messages,
3120 including administrativa strings).
3122 This specification performs full text comparison, but even with
3123 regular expression support it is almost impossible to write a search
3124 expression that safely matches only a specific address domain.
3125 To request that the body content of the header is treated as a list of
3126 addresses, and to strip those down to the plain email address which the
3127 search expression is to be matched against, prefix the effective
3132 .Dl '@~f,c@@a\e.safe\e.domain\e.match$'
3134 All messages of state or with matching condition
3138 is one or multiple of the following colon modifiers:
3140 .Bl -tag -compact -width ".It Ar :M"
3143 messages (cf. the variable
3144 .Va markanswered ) .
3156 Messages with receivers that match
3160 Messages with receivers that match
3167 Old messages (any not in state
3175 \*(OP Messages with unsure spam classification (see
3176 .Sx "Handling spam" ) .
3178 \*(OP Messages classified as spam.
3188 \*(OP IMAP-style SEARCH expressions may also be used.
3189 These consist of keywords and criterions, and because
3190 .Sx "Message list arguments"
3191 are split into tokens according to
3192 .Sx "Shell-style argument quoting"
3193 it is necessary to quote the entire IMAP search expression in order to
3194 ensure that it remains a single token.
3195 This addressing mode is available with all types of mailbox
3197 s; \*(UA will perform the search locally as necessary.
3198 Strings must be enclosed by double quotation marks
3200 in their entirety if they contain whitespace or parentheses;
3201 within the quotes, only reverse solidus
3203 is recognized as an escape character.
3204 All string searches are case-insensitive.
3205 When the description indicates that the
3207 representation of an address field is used,
3208 this means that the search string is checked against both a list
3210 .Bd -literal -offset indent
3211 \&'(\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)'
3215 and the addresses without real names from the respective header field.
3216 These search expressions can be nested using parentheses, see below for
3219 .Bl -tag -compact -width ".It Ar _n_u"
3220 .It Ar ( criterion )
3221 All messages that satisfy the given
3223 .It Ar ( criterion1 criterion2 ... criterionN )
3224 All messages that satisfy all of the given criteria.
3225 .It Ar ( or criterion1 criterion2 )
3226 All messages that satisfy either
3231 To connect more than two criteria using
3233 specifications have to be nested using additional parentheses,
3235 .Ql (or a (or b c)) ,
3239 .Ql ((a or b) and c) .
3242 operation of independent criteria on the lowest nesting level,
3243 it is possible to achieve similar effects by using three separate
3246 .It Ar ( not criterion )
3247 All messages that do not satisfy
3249 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
3250 All messages that contain
3252 in the envelope representation of the
3255 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
3256 All messages that contain
3258 in the envelope representation of the
3261 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
3262 All messages that contain
3264 in the envelope representation of the
3267 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
3268 All messages that contain
3273 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
3274 All messages that contain
3276 in the envelope representation of the
3279 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
3280 All messages that contain
3285 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
3286 All messages that contain
3289 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
3290 All messages that contain
3292 in their header or body.
3293 .It Ar ( larger size )
3294 All messages that are larger than
3297 .It Ar ( smaller size )
3298 All messages that are smaller than
3301 .It Ar ( before date )
3302 All messages that were received before
3304 which must be in the form
3308 denotes the day of the month as one or two digits,
3310 is the name of the month \(en one of
3311 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
3314 is the year as four digits, for example
3317 All messages that were received on the specified date.
3318 .It Ar ( since date )
3319 All messages that were received since the specified date.
3320 .It Ar ( sentbefore date )
3321 All messages that were sent on the specified date.
3322 .It Ar ( senton date )
3323 All messages that were sent on the specified date.
3324 .It Ar ( sentsince date )
3325 All messages that were sent since the specified date.
3327 The same criterion as for the previous search.
3328 This specification cannot be used as part of another criterion.
3329 If the previous command line contained more than one independent
3330 criterion then the last of those criteria is used.
3332 .Ss "On terminal control and line editor"
3333 \*(OP Terminal control through one of the standard
3342 inal defined in the environment interactive usage aspects, for example
3343 .Sx "Coloured display" ,
3344 and insight of cursor and function keys for the Mailx-Line-Editor
3345 (MLE), will be enhanced or enabled.
3346 Library interaction can be disabled on a per-invocation basis via
3347 .Va termcap-disable ,
3348 whereas the internal variable
3350 is always used as a preferred source of terminal capabilities.
3351 (For a usage example see the
3354 .Sx "Not \(dqdefunctional\(dq, but the editor key does not work" . )
3356 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
3357 environments which comply to the ISO C standard
3359 and will support wide glyphs if possible (the necessary functionality
3360 had been removed from ISO C, but was included in
3362 Usage of a line editor in interactive mode can be prevented by setting
3363 .Va line-editor-disable .
3364 Especially if the \*(OPal terminal control support is missing setting
3367 will help shall the MLE misbehave, see there for more.
3368 The MLE can support a little bit of
3373 feature is available then input from line editor prompts will be saved
3374 in a history list that can be searched in and be expanded from.
3375 Such saving can be prevented by prefixing input with any amount of
3377 Aspects of history, like allowed content and maximum size, as well as
3378 whether history shall be saved persistently, can be configured with the
3382 .Va history-gabby-persist
3385 There also exists the macro hook
3386 .Va on-history-addition
3387 which can be used to apply finer control on what enters history.
3389 The MLE supports a set of editing and control commands.
3390 By default (as) many (as possible) of these will be assigned to a set of
3391 single-letter control codes, which should work on any terminal (and can
3392 be generated by holding the
3394 key while pressing the key of desire, for example
3398 command is available then the MLE commands can also be accessed freely
3399 by assigning the command name, which is shown in parenthesis in the list
3400 below, to any desired key-sequence, and the MLE will instead and also use
3402 to establish its built-in key bindings
3403 (more of them if the \*(OPal terminal control is available),
3404 an action which can then be suppressed completely by setting
3405 .Va line-editor-no-defaults .
3406 .Sx "Shell-style argument quoting"
3407 notation is used in the following:
3409 .Bl -tag -compact -width ".It Ql \eBa"
3411 Go to the start of the line
3413 .Pf ( Cd mle-go-home ) .
3415 Move the cursor backward one character
3417 .Pf ( Cd mle-go-bwd ) .
3422 .Pf ( Cd mle-raise-int ) .
3424 Forward delete the character under the cursor;
3425 quits \*(UA if used on the empty line unless the internal variable
3429 .Pf ( Cd mle-del-fwd ) .
3431 Go to the end of the line
3433 .Pf ( Cd mle-go-end ) .
3435 Move the cursor forward one character
3437 .Pf ( Cd mle-go-fwd ) .
3439 Cancel current operation, full reset.
3440 If there is an active history search or tabulator expansion then this
3441 command will first reset that, reverting to the former line content;
3442 thus a second reset is needed for a full reset in this case
3444 .Pf ( Cd mle-reset ) .
3446 Backspace: backward delete one character
3448 .Pf ( Cd mle-del-bwd ) .
3451 Horizontal tabulator:
3452 try to expand the word before the cursor, supporting the usual
3453 .Sx "Filename transformations"
3455 .Pf ( Cd mle-complete ;
3457 .Cd mle-quote-rndtrip
3459 .Va line-editor-cpl-word-breaks ) .
3462 commit the current line
3464 .Pf ( Cd mle-commit ) .
3466 Cut all characters from the cursor to the end of the line
3468 .Pf ( Cd mle-snarf-end ) .
3472 .Pf ( Cd mle-repaint ) .
3474 \*(OP Go to the next history entry
3476 .Pf ( Cd mle-hist-fwd ) .
3478 (\*(OPally context-dependent) Invokes the command
3481 \*(OP Go to the previous history entry
3483 .Pf ( Cd mle-hist-bwd ) .
3485 Toggle roundtrip mode shell quotes, where produced,
3488 .Pf ( Cd mle-quote-rndtrip ) .
3489 This setting is temporary, and will be forgotten once the command line
3490 is committed; also see
3493 \*(OP Complete the current line from (the remaining) older history entries
3495 .Pf ( Cd mle-hist-srch-bwd ) .
3497 \*(OP Complete the current line from (the remaining) newer history entries
3499 .Pf ( Cd mle-hist-srch-fwd ) .
3501 Paste the snarf buffer
3503 .Pf ( Cd mle-paste ) .
3510 .Pf ( Cd mle-snarf-line ) .
3512 Prompts for a Unicode character (hexadecimal number without prefix, see
3516 .Pf ( Cd mle-prompt-char ) .
3517 Note this command needs to be assigned to a single-letter control code
3518 in order to become recognized and executed during input of
3519 a key-sequence (only three single-letter control codes can be used for
3520 that shortcut purpose); this control code is then special-treated and
3521 thus cannot be part of any other sequence (because it will trigger the
3522 .Cd \&\&mle-prompt-char
3523 function immediately).
3525 Cut the characters from the one preceding the cursor to the preceding
3528 .Pf ( Cd mle-snarf-word-bwd ) .
3530 Move the cursor forward one word boundary
3532 .Pf ( Cd mle-go-word-fwd ) .
3534 Move the cursor backward one word boundary
3536 .Pf ( Cd mle-go-word-bwd ) .
3541 .Pf ( Cd mle-raise-tstp ) .
3543 Escape: reset a possibly used multibyte character input state machine
3544 and \*(OPally a lingering, incomplete key binding
3546 .Pf ( Cd mle-cancel ) .
3547 This command needs to be assigned to a single-letter control code in
3548 order to become recognized and executed during input of a key-sequence
3549 (only three single-letter control codes can be used for that shortcut
3551 This control code may also be part of a multi-byte sequence, but if
3552 a sequence is active and the very control code is currently also an
3553 expected input, then the active sequence takes precedence and will
3554 consume the control code.
3556 (\*(OPally context-dependent) Invokes the command
3559 (\*(OPally context-dependent) Invokes the command
3562 (\*(OPally context-dependent) Invokes the command
3565 Cut the characters from the one after the cursor to the succeeding word
3568 .Pf ( Cd mle-snarf-word-fwd ) .
3575 ring the audible bell.
3579 .Cd mle-clear-screen :
3580 move the cursor home and clear the screen.
3586 this will immediately reset a possibly active search etc.
3589 .Cd mle-go-screen-bwd :
3590 move the cursor backward one screen width.
3593 .Cd mle-go-screen-fwd :
3594 move the cursor forward one screen width.
3601 .Ss "Coloured display"
3602 \*(OP Colours and font attributes through ANSI a.k.a. ISO 6429 SGR
3603 (select graphic rendition) escape sequences are optionally supported.
3604 Usage of colours and font attributes solely depends upon the
3605 capability of the detected terminal type
3607 and as fine-tuned through
3609 Colours and font attributes can be managed with the multiplexer command
3613 removes the given mappings.
3616 suppresses usage of colour and font attribute sequences, while leaving
3617 established mappings unchanged.
3619 Whether actually applicable colour and font attribute sequences should
3620 also be generated when output is going to be paged through the external
3624 ) depends upon the setting of
3626 because pagers usually need to be configured in order to support ISO
3628 Knowledge of some widely used pagers is however built-in, and in a clean
3629 environment it is often enough to simply set
3631 please refer to that variable for more on this topic.
3633 It might make sense to conditionalize colour setup on interactive mode via
3638 .Bd -literal -offset indent
3639 if terminal && "$features" =% ,+colour,
3640 colour iso view-msginfo ft=bold,fg=green
3641 colour iso view-header ft=bold,fg=red (from|subject) # regex
3642 colour iso view-header fg=red
3644 uncolour iso view-header from,subject
3645 colour iso view-header ft=bold,fg=magenta,bg=cyan
3646 colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
3647 colour mono view-header ft=bold
3648 colour mono view-header ft=bold,ft=reverse subject,from
3652 \*(OP \*(UA can make use of several spam interfaces for the purpose of
3653 identification of, and, in general, dealing with spam messages.
3654 A precondition of most commands in order to function is that the
3656 variable is set to one of the supported interfaces.
3657 .Sx "Specifying messages"
3658 that have been identified as spam is possible via their (volatile)
3664 specifications, and their
3666 entries will be used when displaying the
3673 rates the given messages and sets their
3676 If the spam interface offers spam scores these can be shown in
3685 will interact with the Bayesian filter of the chosen interface and learn
3686 the given messages as
3690 respectively; the last command can be used to cause
3692 of messages; it adheres to their current
3694 state and thus reverts previous teachings.
3699 will simply set and clear, respectively, the mentioned volatile
3701 message flag, without any interface interaction.
3709 requires a running instance of the
3711 server in order to function, started with the option
3713 shall Bayesian filter learning be possible.
3714 .Bd -literal -offset indent
3715 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
3716 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
3717 --daemonize [--local] [--allow-tell]
3720 Thereafter \*(UA can make use of these interfaces:
3721 .Bd -literal -offset indent
3722 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3723 -Sspamc-command=/usr/local/bin/spamc \e
3724 -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
3726 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3727 -Sspamc-command=/usr/local/bin/spamc \e
3728 -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
3731 Using the generic filter approach allows usage of programs like
3733 Here is an example, requiring it to be accessible via
3735 .Bd -literal -offset indent
3736 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
3737 -Sspamfilter-ham="bogofilter -n" \e
3738 -Sspamfilter-noham="bogofilter -N" \e
3739 -Sspamfilter-nospam="bogofilter -S" \e
3740 -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
3741 -Sspamfilter-spam="bogofilter -s" \e
3742 -Sspamfilter-rate-scanscore="1;^(.+)$"
3745 Because messages must exist on local storage in order to be scored (or
3746 used for Bayesian filter training), it is possibly a good idea to
3747 perform the local spam check last.
3748 Spam can be checked automatically when opening specific folders by
3749 setting a specialized form of the internal variable
3751 .Bd -literal -offset indent
3752 define spamdelhook {
3754 spamset (header x-dcc-brand-metrics "bulk")
3755 # Server-side spamassassin(1)
3756 spamset (header x-spam-flag "YES")
3757 del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
3763 set folder-hook-SOMEFOLDER=spamdelhook
3766 See also the documentation for the variables
3767 .Va spam-interface , spam-maxsize ,
3768 .Va spamc-command , spamc-arguments , spamc-user ,
3769 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
3772 .Va spamfilter-rate-scanscore .
3774 \*(UA reads input in lines.
3775 An unquoted reverse solidus
3777 at the end of a command line
3779 the newline character: it is discarded and the next line of input is
3780 used as a follow-up line, with all leading whitespace removed;
3781 once an entire line is completed, the whitespace characters
3782 .Cm space , tabulator , newline
3783 as well as those defined by the variable
3785 are removed from the beginning and end.
3786 Placing any whitespace characters at the beginning of a line will
3787 prevent a possible addition of the command line to the \*(OPal
3790 The beginning of such input lines is then scanned for the name of
3791 a known command: command names may be abbreviated, in which case the
3792 first command that matches the given prefix will be used.
3793 .Sx "Command modifiers"
3794 may prefix a command in order to modify its behaviour.
3795 A name may also be a
3797 which will become expanded until no more expansion is possible.
3798 Once the command that shall be executed is known, the remains of the
3799 input line will be interpreted according to command-specific rules,
3800 documented in the following.
3802 This behaviour is different to the
3804 ell, which is a programming language with syntactic elements of clearly
3805 defined semantics, and therefore capable to sequentially expand and
3806 evaluate individual elements of a line.
3807 .Ql \&? set one=value two=$one
3808 for example will never possibly assign value to one, because the
3809 variable assignment is performed no sooner but by the command
3811 long after the expansion happened.
3813 A list of all commands in lookup order is dumped by the command
3815 \*(OPally the command
3819 when given an argument, will show a documentation string for the
3820 command matching the expanded argument, as in
3822 which should be a shorthand of
3824 with these documentation strings both commands support a more
3826 listing mode which includes the argument type of the command and other
3827 information which applies; a handy suggestion might thus be:
3828 .Bd -literal -offset indent
3830 # Before v15: need to enable sh(1)ell-style on _entire_ line!
3831 localopts yes;wysh set verbose;ignerr eval "${@}";return ${?}
3833 ? commandalias xv '\ecall __xv'
3836 .Ss "Command modifiers"
3837 Commands may be prefixed by none to multiple command modifiers.
3838 Some command modifiers can be used with a restricted set of commands
3843 will (\*(OPally) show which modifiers apply.
3846 The modifier reverse solidus
3849 to be placed first, prevents
3851 expansions on the remains of the line, for example
3853 will always evaluate the command
3855 even if an (command)alias of the same name exists.
3857 content may itself contain further command modifiers, including
3858 an initial reverse solidus to prevent further expansions.
3863 indicates that any error generated by the following command should be
3864 ignored by the state machine and not cause a program exit with enabled
3866 or for the standardized exit cases in
3871 .Sx "INTERNAL VARIABLES" ,
3872 will be set to the real exit status of the command regardless.
3876 will alter the called command to apply changes only temporarily,
3877 local to block-scope, and can thus only be used inside of a
3882 Specifying it implies the modifier
3884 Local variables will not be inherited by macros deeper in the
3886 chain, and all local settings will be garbage collected once the local
3888 To record and unroll changes in the global scope use the command
3893 does yet not implement any functionality.
3897 does yet not implement any functionality.
3899 Some commands support the
3902 modifier: if used, they expect the name of a variable, which can itself
3903 be a variable, i.e., shell expansion is applied, as their first
3904 argument, and will place their computation result in it instead of the
3905 default location (it is usually written to standard output).
3907 The given name will be tested for being a valid
3909 variable name, and may therefore only consist of upper- and lowercase
3910 characters, digits, and the underscore; the hyphen-minus may be used as
3911 a non-portable extension; digits may not be used as first, hyphen-minus
3912 may not be used as last characters.
3913 In addition the name may either not be one of the known
3914 .Sx "INTERNAL VARIABLES" ,
3915 or must otherwise refer to a writable (non-boolean) value variable.
3916 The actual put operation may fail nonetheless, for example if the
3917 variable expects a number argument only a number will be accepted.
3918 Any error during these operations causes the command as such to fail,
3919 and the error number
3922 .Va ^ERR Ns -NOTSUP ,
3927 but some commands deviate from the latter, which is documented.
3929 Last, but not least, the modifier
3932 can be used for some old and established commands to choose the new
3933 .Sx "Shell-style argument quoting"
3934 rules over the traditional
3935 .Sx "Old-style argument quoting" .
3936 This modifier is implied if
3938 is set to a non-empty value.
3940 .Ss "Old-style argument quoting"
3941 \*(ID This section documents the traditional and POSIX standardized
3942 style of quoting non-message list arguments to commands which expect
3943 this type of arguments: whereas still used by the majority of such
3945 .Sx "Shell-style argument quoting"
3946 may be available even for those via
3949 .Sx "Command modifiers" .
3950 Nonetheless care must be taken, because only new commands have been
3951 designed with all the capabilities of the new quoting rules in mind,
3952 which can, for example generate control characters.
3953 .Bl -bullet -offset indent
3955 An argument can be enclosed between paired double-quotes
3960 any whitespace, shell word expansion, or reverse solidus characters
3961 (except as described next) within the quotes are treated literally as
3962 part of the argument.
3963 A double-quote will be treated literally within single-quotes and vice
3965 Inside such a quoted string the actually used quote character can be
3966 used nonetheless by escaping it with a reverse solidus
3971 An argument that is not enclosed in quotes, as above, can usually still
3972 contain space characters if those spaces are reverse solidus escaped, as in
3975 A reverse solidus outside of the enclosing quotes is discarded
3976 and the following character is treated literally as part of the argument.
3978 .Ss "Shell-style argument quoting"
3980 ell-style, and therefore POSIX standardized, argument parsing and
3981 quoting rules are used by most commands.
3982 \*(ID Most new commands only support these new rules and are flagged
3983 \*(NQ, some elder ones can use them with the command modifier
3985 in the future only this type of argument quoting will remain.
3987 A command line is parsed from left to right and an input token is
3988 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3989 Metacharacters are vertical bar
3995 as well as all characters from the variable
3998 .Cm space , tabulator , newline .
3999 The additional metacharacters left and right parenthesis
4001 and less-than and greater-than signs
4005 supports are not used, and are treated as ordinary characters: for one
4006 these characters are a vivid part of email addresses, and it seems
4007 highly unlikely that their function will become meaningful to \*(UA.
4008 .Bd -filled -offset indent
4009 .Sy Compatibility note:
4010 \*(ID Please note that even many new-style commands do not yet honour
4012 to parse their arguments: whereas the
4014 ell is a language with syntactic elements of clearly defined semantics,
4015 \*(UA parses entire input lines and decides on a per-command base what
4016 to do with the rest of the line.
4017 This also means that whenever an unknown command is seen all that \*(UA
4018 can do is cancellation of the processing of the remains of the line.
4020 It also often depends on an actual subcommand of a multiplexer command
4021 how the rest of the line should be treated, and until v15 we are not
4022 capable to perform this deep inspection of arguments.
4023 Nonetheless, at least the following commands which work with positional
4024 parameters fully support
4026 for an almost shell-compatible field splitting:
4027 .Ic call , call_if , read , vpospar , xcall .
4030 Any unquoted number sign
4032 at the beginning of a new token starts a comment that extends to the end
4033 of the line, and therefore ends argument processing.
4034 An unquoted dollar sign
4036 will cause variable expansion of the given name, which must be a valid
4038 ell-style variable name (see
4040 .Sx "INTERNAL VARIABLES"
4043 (shell) variables can be accessed through this mechanism, brace
4044 enclosing the name is supported (i.e., to subdivide a token).
4046 Whereas the metacharacters
4047 .Cm space , tabulator , newline
4048 only complete an input token, vertical bar
4054 also act as control operators and perform control functions.
4055 For now supported is semicolon
4057 which terminates a single command, therefore sequencing the command line
4058 and making the remainder of the line a subject to reevaluation.
4059 With sequencing, multiple command argument types and quoting rules may
4060 therefore apply to a single line, which can become problematic before
4061 v15: e.g., the first of the following will cause surprising results.
4063 .Dl ? echo one; set verbose; echo verbose=$verbose.
4064 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
4066 Quoting is a mechanism that will remove the special meaning of
4067 metacharacters and reserved words, and will prevent expansion.
4068 There are four quoting mechanisms: the escape character, single-quotes,
4069 double-quotes and dollar-single-quotes:
4070 .Bl -bullet -offset indent
4072 The literal value of any character can be preserved by preceding it
4073 with the escape character reverse solidus
4076 Arguments which are enclosed in
4077 .Ql 'single-\:quotes'
4078 retain their literal value.
4079 A single-quote cannot occur within single-quotes.
4081 The literal value of all characters enclosed in
4082 .Ql \(dqdouble-\:quotes\(dq
4083 is retained, with the exception of dollar sign
4085 which will cause variable expansion, as above, backquote (grave accent)
4087 (which not yet means anything special), reverse solidus
4089 which will escape any of the characters dollar sign
4091 (to prevent variable expansion), backquote (grave accent)
4095 (to prevent ending the quote) and reverse solidus
4097 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
4098 but has no special meaning otherwise.
4100 Arguments enclosed in
4101 .Ql $'dollar-\:single-\:quotes'
4102 extend normal single quotes in that reverse solidus escape sequences are
4103 expanded as follows:
4105 .Bl -tag -compact -width ".Ql \eNNN"
4107 bell control character (ASCII and ISO-10646 BEL).
4109 backspace control character (ASCII and ISO-10646 BS).
4111 escape control character (ASCII and ISO-10646 ESC).
4115 form feed control character (ASCII and ISO-10646 FF).
4117 line feed control character (ASCII and ISO-10646 LF).
4119 carriage return control character (ASCII and ISO-10646 CR).
4121 horizontal tabulator control character (ASCII and ISO-10646 HT).
4123 vertical tabulator control character (ASCII and ISO-10646 VT).
4125 emits a reverse solidus character.
4129 double quote (escaping is optional).
4131 eight-bit byte with the octal value
4133 (one to three octal digits), optionally prefixed by an additional
4135 A 0 byte will suppress further output for the quoted argument.
4137 eight-bit byte with the hexadecimal value
4139 (one or two hexadecimal characters, no prefix, see
4141 A 0 byte will suppress further output for the quoted argument.
4143 the Unicode / ISO-10646 character with the hexadecimal codepoint value
4145 (one to eight hexadecimal characters) \(em note that Unicode defines the
4146 maximum codepoint ever to be supported as
4151 This escape is only supported in locales that support Unicode (see
4152 .Sx "Character sets" ) ,
4153 in other cases the sequence will remain unexpanded unless the given code
4154 point is ASCII compatible or (if the \*(OPal character set conversion is
4155 available) can be represented in the current locale.
4156 The character NUL will suppress further output for the quoted argument.
4160 except it takes only one to four hexadecimal characters.
4162 Emits the non-printable (ASCII and compatible) C0 control codes
4163 0 (NUL) to 31 (US), and 127 (DEL).
4164 Printable representations of ASCII control codes can be created by
4165 mapping them to a different, visible part of the ASCII character set.
4166 Adding the number 64 achieves this for the codes 0 to 31, here 7 (BEL):
4167 .Ql 7 + 64 = 71 = G .
4168 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
4170 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
4171 .Ql \&?\0vexpr\0^\0127\064 .
4173 Whereas historically circumflex notation has often been used for
4174 visualization purposes of control codes, as in
4176 the reverse solidus notation has been standardized:
4178 Some control codes also have standardized (ISO-10646, ISO C) aliases,
4184 whenever such an alias exists it will be used for display purposes.
4185 The control code NUL
4187 a non-standard extension) will suppress further output for the remains
4188 of the token (which may extend beyond the current quote), or, depending
4189 on the context, the remains of all arguments for the current command.
4191 Non-standard extension: expand the given variable name, as above.
4192 Brace enclosing the name is supported.
4194 Not yet supported, just to raise awareness: Non-standard extension.
4199 .Bd -literal -offset indent
4200 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
4201 ? echo Quotes ${HOME} and tokens differ! # comment
4202 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
4204 .Ss "Message list arguments"
4205 Many commands operate on message list specifications, as documented in
4206 .Sx "Specifying messages" .
4207 The argument input is first split into individual tokens via
4208 .Sx "Shell-style argument quoting" ,
4209 which are then interpreted as the mentioned specifications.
4210 If no explicit message list has been specified, many commands will
4211 search for and use the next message forward that satisfies the commands'
4212 requirements, and if there are no messages forward of the current
4213 message, the search proceeds backwards;
4214 if there are no good messages at all to be found, an error message is
4215 shown and the command is aborted.
4218 output of the command
4220 will indicate whether a command searches for a default message, or not.
4221 .Ss "Raw data arguments for codec commands"
4222 A special set of commands, which all have the string
4228 take raw string data as input, which means that the content of the
4229 command input line is passed completely unexpanded and otherwise
4230 unchanged: like this the effect of the actual codec is visible without
4231 any noise of possible shell quoting rules etc., i.e., the user can input
4232 one-to-one the desired or questionable data.
4233 To gain a level of expansion, the entire command line can be
4235 uated first, for example
4236 .Bd -literal -offset indent
4237 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
4239 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
4241 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
4242 ? eval shcodec d $res
4243 /usr/Sch\[:o]nes Wetter/heute.txt
4245 .Ss "Filename transformations"
4246 Filenames, where expected, and unless documented otherwise, are
4247 subsequently subject to the following filename transformations, in
4249 .Bl -bullet -offset indent
4251 If the given name is a registered
4253 it will be replaced with the expanded shortcut.
4254 This step is mostly taken for
4258 The filename is matched against the following patterns or strings.
4262 expansion this step is mostly taken for
4266 .Bl -hang -compact -width ".Ar %user"
4268 (Number sign) is expanded to the previous file.
4270 (Percent sign) is replaced by the invoking
4271 .Mx -ix "primary system mailbox"
4272 user's primary system mailbox, which either is the (itself expandable)
4274 if that is set, the standardized absolute pathname indicated by
4276 if that is set, or a built-in compile-time default otherwise.
4279 the used name is actively checked for being a primary mailbox, first
4285 Expands to the primary system mailbox of
4287 (and never the value of
4289 regardless of its actual setting).
4291 (Ampersand) is replaced with the invoking user's
4292 .Mx -ix "secondary mailbox"
4293 secondary mailbox, the
4300 directory (if that variable is set).
4302 Expands to the same value as
4304 but has special meaning when used with, for example, the command
4306 the file will be treated as a primary system mailbox by, among others, the
4310 commands, meaning that messages that have been read in the current
4311 session will be moved to the
4313 mailbox instead of simply being flagged as read.
4316 Meta expansions may be applied to the resulting filename, as allowed by
4317 the operation and applicable to the resulting access protocol (also see
4318 .Sx "On URL syntax and credential lookup" ) .
4319 For the file-protocol, a leading tilde
4321 character will be replaced by the expansion of
4323 except when followed by a valid user name, in which case the home
4324 directory of the given user is used instead.
4326 A shell expansion as if specified in double-quotes (see
4327 .Sx "Shell-style argument quoting" )
4328 may be applied, so that any occurrence of
4332 will be replaced by the expansion of the variable, if possible;
4333 .Sx "INTERNAL VARIABLES"
4336 (shell) variables can be accessed through this mechanism.
4338 Shell pathname wildcard pattern expansions
4340 may be applied as documented.
4341 If the fully expanded filename results in multiple pathnames and the
4342 command is expecting only one file, an error results.
4344 In interactive context, in order to allow simple value acceptance (via
4346 arguments will usually be displayed in a properly quoted form, so a file
4347 .Ql diet\e is \ecurd.txt
4349 .Ql 'diet\e is \ecurd.txt' .
4352 The following commands are available:
4353 .Bl -tag -width ".It Ic BaNg"
4358 command which follows, replacing unescaped exclamation marks with the
4359 previously executed command if the internal variable
4362 This command supports
4365 .Sx "Command modifiers" ,
4366 and manages the error number
4368 A 0 or positive exit status
4370 reflects the exit status of the command, negative ones that
4371 an error happened before the command was executed, or that the program
4372 did not exit cleanly, but maybe due to a signal: the error number is
4373 .Va ^ERR Ns -CHILD ,
4376 In conjunction with the
4378 modifier the following special cases exist:
4379 a negative exit status occurs if the collected data could not be stored
4380 in the given variable, which is a
4382 error that should otherwise not occur.
4383 .Va ^ERR Ns -CANCELED
4384 indicates that no temporary file could be created to collect the command
4385 output at first glance.
4386 In case of catchable out-of-memory situations
4388 will occur and \*(UA will try to store the empty string, just like with
4389 all other detected error conditions.
4392 The comment-command causes the entire line to be ignored.
4394 this really is a normal command which' purpose is to discard its
4397 indicating special character, which means that for example trailing
4398 comments on a line are not possible (except for commands which use
4399 .Sx "Shell-style argument quoting" ) .
4402 Goes to the next message in sequence and types it
4407 Display the preceding message, or the n'th previous message if given
4408 a numeric argument n.
4411 Shows the message number of the current message (the
4413 when used without arguments, that of the given list otherwise.
4414 Output numbers will be separated from each other with the first
4417 and followed by the first character of
4419 if that is not empty and not identical to the first.
4420 If that results in no separation at all a
4423 This command supports
4426 .Sx "Command modifiers" ) ,
4427 and manages the error number
4431 \*(OP Show a brief summary of commands.
4432 \*(OP Given an argument a synopsis for the command in question is
4433 shown instead; commands can be abbreviated in general and this command
4434 can be used to see the full expansion of an abbreviation including the
4435 synopsis, try, for example
4440 and see how the output changes.
4441 To avoid that aliases are resolved the modifier
4443 can be prepended to the argument, but note it must be quoted.
4444 This mode also supports a more
4446 output, which will provide the information documented for
4455 .It Ic account , unaccount
4456 (ac, una) Creates, selects or lists (an) account(s).
4457 Accounts are special incarnations of
4459 macros and group commands and variable settings which together usually
4460 arrange the environment for the purpose of creating an email account.
4461 Different to normal macros settings which are covered by
4463 \(en here by default enabled! \(en will not be reverted before the
4468 (case-insensitive) always exists, and all but it can be deleted by the
4469 latter command, and in one operation with the special name
4471 Also for all but it a possibly set
4472 .Va on-account-cleanup
4473 hook is called once they are left, also for program exit.
4475 Without arguments a listing of all defined accounts is shown.
4476 With one argument the given account is activated: the system
4478 of that account will be activated (as via
4480 a possibly installed
4482 will be run, and the internal variable
4485 The two argument form behaves identical to defining a macro as via
4487 Important settings for accounts include
4488 .Va folder , from , hostname , inbox , mta , password
4491 .Pf ( Sx "On URL syntax and credential lookup" ) ,
4492 as well as things like
4493 .Va tls-config-pairs
4494 .Pf ( Sx "Encrypted network communication" ) ,
4495 and protocol specifics like
4496 .Va imap-auth , pop3-auth , smtp-auth .
4497 .Bd -literal -offset indent
4499 set folder=~/mail inbox=+syste.mbox record=+sent.mbox
4500 set from='(My Name) myname@myisp.example'
4501 set mta=smtp://mylogin@smtp.myisp.example
4506 Perform email address codec transformations on raw-data argument, rather
4507 according to email standards (RFC 5322; \*(ID will furtherly improve).
4511 .Sx "Command modifiers" ) ,
4512 and manages the error number
4514 The first argument must be either
4515 .Ar [+[+[+]]]e[ncode] ,
4520 and specifies the operation to perform on the rest of the line.
4522 Decoding will show how a standard-compliant MUA will display the given
4523 argument, which should be an email address.
4524 Please be aware that most MUAs have difficulties with the address
4525 standards, and vary wildly when (comments) in parenthesis,
4527 strings, or quoted-pairs, as below, become involved.
4528 \*(ID \*(UA currently does not perform decoding when displaying addresses.
4530 Skinning is identical to decoding but only outputs the plain address,
4531 without any string, comment etc. components.
4532 Another difference is that it may fail with the error number
4536 if decoding fails to find a(n) (valid) email address, in which case the
4537 unmodified input will be output again.
4540 first performs a skin operation, and thereafter checks a valid
4541 address for whether it is a registered mailing list (see
4545 eventually reporting that state in the error number
4548 .Va ^ERR Ns -EXIST .
4549 (This state could later become overwritten by an I/O error, though.)
4551 Encoding supports four different modes, lesser automated versions can be
4552 chosen by prefixing one, two or three plus signs: the standard imposes
4553 a special meaning on some characters, which thus have to be transformed
4554 to so-called quoted-pairs by pairing them with a reverse solidus
4556 in order to remove the special meaning; this might change interpretation
4557 of the entire argument from what has been desired, however!
4558 Specify one plus sign to remark that parenthesis shall be left alone,
4559 two for not turning double quotation marks into quoted-pairs, and three
4560 for also leaving any user-specified reverse solidus alone.
4561 The result will always be valid, if a successful exit status is reported
4562 (\*(ID the current parser fails this assertion for some constructs).
4563 \*(ID Addresses need to be specified in between angle brackets
4566 if the construct becomes more difficult, otherwise the current parser
4567 will fail; it is not smart enough to guess right.
4568 .Bd -literal -offset indent
4569 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
4570 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4571 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4572 "Hey, you", \e out\e there <diet@exam.ple>
4573 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4578 .It Ic alias , unalias
4579 \*(NQ(a, una) Define or list, and remove, respectively, address aliases,
4580 which are a method of creating personal distribution lists that map
4581 a single name to none to multiple receivers, to be expanded after
4583 is left; the expansion correlates with
4585 The latter command removes all given aliases, the special name asterisk
4587 will remove all existing aliases.
4588 When used without arguments the former shows a list of all currently
4589 known aliases, with one argument only the target(s) of the given one.
4590 When given two arguments, hyphen-minus
4592 being the first, the target(s) of the second is/are expanded recursively.
4594 In all other cases the given alias is newly defined, or will be appended
4595 to: arguments must either be themselves valid alias names, or any
4596 other address type (see
4597 .Sx "On sending mail, and non-interactive mode" ) .
4598 Recursive expansion of aliases can be prevented by prefixing the desired
4599 argument with the modifier reverse solidus
4601 A valid alias name conforms to
4603 syntax, but follow-up characters can also be the number sign
4614 .Dq any character that has the high bit set .
4617 may be the last character.
4621 .Sx "Shell-style argument quoting" .
4623 \*(ID Unfortunately the colon is currently not supported, as it
4624 interferes with normal address parsing rules.
4625 \*(ID Such high bit characters will likely cause warnings at the moment
4626 for the same reasons why colon is unsupported; also, in the future
4627 locale dependent character set validity checks will be performed.
4628 .Bd -literal -offset indent
4629 ? alias cohorts bill jkf mark kridle@ucbcory ~/cohorts.mbox
4630 ? alias mark mark@exam.ple
4631 ? set mta-aliases=/etc/aliases
4635 .It Ic alternates , unalternates
4636 \*(NQ (alt) Manage a list of alternate addresses or names of the active
4637 user, members of which will be removed from recipient lists (except one).
4638 There is a set of implicit alternates which is formed of the values of
4648 The latter command removes the given list of alternates, the special name
4650 will discard all existing alternate names.
4652 The former command manages the error number
4654 It shows the current set of alternates when used without arguments; in
4655 this mode only it also supports
4658 .Sx "Command modifiers" ) .
4659 Otherwise the given arguments (after being checked for validity) are
4660 appended to the list of alternate names; in
4662 mode they replace that list instead.
4665 .It Ic answered , unanswered
4666 Take a message lists and mark each message as (not) having been answered.
4667 Messages will be marked answered when being
4669 to automatically if the
4673 .Sx "Message states" .
4676 .It Ic bind , unbind
4677 \*(OP\*(NQ The bind command extends the MLE (see
4678 .Sx "On terminal control and line editor" )
4679 with freely configurable key bindings.
4680 The latter command removes from the given context the given key binding,
4681 both of which may be specified as a wildcard
4685 will remove all bindings of all contexts.
4686 Due to initialization order unbinding will not work for built-in key
4687 bindings upon program startup, however: please use
4688 .Va line-editor-no-defaults
4689 for this purpose instead.
4691 With zero arguments, or with a context name the former command shows
4692 all key bindings (of the given context; an asterisk
4694 will iterate over all contexts); a more verbose listing will be
4695 produced if either of
4700 With two or more arguments a specific binding is shown, or
4701 (re)established: the first argument is the context to which the binding
4702 shall apply, the second argument is a comma-separated list of the
4704 which form the binding.
4705 Further arguments will be joined to form the expansion, and cause the
4706 binding to be created or updated.
4707 To indicate that a binding shall not be auto-committed, but that the
4708 expansion shall instead be furtherly editable by the user, a commercial at
4710 (that will be removed) can be placed last in the expansion, from which
4711 leading and trailing whitespace will finally be removed.
4712 Reverse solidus cannot be used as the last character of expansion.
4713 An empty expansion will be rejected.
4715 Contexts define when a binding applies, i.e., a binding will not be seen
4716 unless the context for which it is defined for is currently active.
4717 This is not true for the shared binding
4719 which is the foundation for all other bindings and as such always
4720 applies, its bindings, however, only apply secondarily.
4721 The available contexts are the shared
4725 context which is used in all not otherwise documented situations, and
4727 which applies only to
4728 .Sx "Compose mode" .
4730 Bindings are specified as a comma-separated list of byte-sequences,
4731 where each list entry corresponds to one
4734 Byte sequence boundaries will be forcefully terminated after
4735 .Va bind-inter-byte-timeout
4736 milliseconds, whereas key sequences can be timed out via
4737 .Va bind-inter-key-timeout .
4738 A list entry may, indicated by a leading colon character
4740 also refer to the name of a terminal capability; several dozen names
4741 are compiled in and may be specified either by their
4743 or, if existing, by their
4745 name, regardless of the actually used \*(OPal terminal control library.
4746 But any capability may be used, as long as the name is resolvable by the
4747 \*(OPal control library, or was defined via the internal variable
4749 Input sequences are not case-normalized, an exact match is required to
4750 update or remove a binding.
4751 It is advisable to use an initial escape or other control character (like
4753 for user (as opposed to purely terminal capability based) bindings in
4754 order to avoid ambiguities; it also reduces search time.
4756 .Bd -literal -offset indent
4757 ? bind base a,b echo one
4758 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
4759 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc,Delete
4760 ? bind default $'\ecA',:khome,w 'echo Editable binding@'
4761 ? bind default a,b,c rm -irf / @ # Also editable
4762 ? bind default :kf1 File %
4763 ? bind compose :kf1 ~v
4766 Note that the entire comma-separated list is first parsed (over) as a
4767 shell-token with whitespace as the field separator, then parsed and
4768 expanded for real with comma as the field separator, therefore
4769 whitespace needs to be properly quoted, see
4770 .Sx "Shell-style argument quoting" .
4771 Using Unicode reverse solidus escape sequences renders a binding
4772 defunctional if the locale does not support Unicode (see
4773 .Sx "Character sets" ) ,
4774 and using terminal capabilities does so if no (corresponding) terminal
4775 control support is (currently) available.
4776 Adding, deleting or modifying a key binding invalidates the internal
4777 prebuilt lookup tree, it will be recreated as necessary: this process
4778 will be visualized in most
4784 The following terminal capability names are built-in and can be used in
4786 or (if available) the two-letter
4789 See the respective manual for a list of capabilities.
4792 can be used to show all the capabilities of
4794 or the given terminal type;
4797 flag will also show supported (non-standard) extensions.
4799 .Bl -tag -compact -width kcuuf_or_kcuuf
4800 .It Cd kbs Ns \0or Cd kb
4802 .It Cd kdch1 Ns \0or Cd kD
4804 .It Cd kDC Ns \0or Cd *4
4805 \(em shifted variant.
4806 .It Cd kel Ns \0or Cd kE
4807 Clear to end of line.
4808 .It Cd kext Ns \0or Cd @9
4810 .It Cd kich1 Ns \0or Cd kI
4812 .It Cd kIC Ns \0or Cd #3
4813 \(em shifted variant.
4814 .It Cd khome Ns \0or Cd kh
4816 .It Cd kHOM Ns \0or Cd #2
4817 \(em shifted variant.
4818 .It Cd kend Ns \0or Cd @7
4820 .It Cd knp Ns \0or Cd kN
4822 .It Cd kpp Ns \0or Cd kP
4824 .It Cd kcub1 Ns \0or Cd kl
4825 Left cursor (with more modifiers: see below).
4826 .It Cd kLFT Ns \0or Cd #4
4827 \(em shifted variant.
4828 .It Cd kcuf1 Ns \0or Cd kr
4829 Right cursor (ditto).
4830 .It Cd kRIT Ns \0or Cd %i
4831 \(em shifted variant.
4832 .It Cd kcud1 Ns \0or Cd kd
4833 Down cursor (ditto).
4835 \(em shifted variant (only terminfo).
4836 .It Cd kcuu1 Ns \0or Cd ku
4839 \(em shifted variant (only terminfo).
4840 .It Cd kf0 Ns \0or Cd k0
4842 Add one for each function key up to
4847 .It Cd kf10 Ns \0or Cd k;
4849 .It Cd kf11 Ns \0or Cd F1
4851 Add one for each function key up to
4858 Some terminals support key-modifier combination extensions, e.g.,
4860 For example, the delete key,
4862 in its shifted variant, the name is mutated to
4864 then a number is appended for the states
4876 .Ql Shift+Alt+Control
4878 The same for the left cursor key,
4880 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
4883 \*(NQ Calls the given macro, which must have been created via
4885 (see there for more), otherwise an
4888 Calling macros recursively will at some time excess the stack size
4889 limit, causing a hard program abortion; if recursively calling a macro
4890 is the last command of the current macro, consider to use the command
4892 which will first release all resources of the current macro before
4893 replacing the current macro with the called one.
4898 if the given macro has been created via
4900 but does not fail nor warn if the macro does not exist.
4907 \*(OP Only applicable to S/MIME signed messages.
4908 Takes an optional message list and a filename and saves the certificates
4909 contained within the message signatures to the named file in both
4910 human-readable and PEM format.
4911 The certificates can later be used to send encrypted messages to the
4912 respective message senders by setting
4913 .Va smime-encrypt-USER@HOST
4917 .It Ic charsetalias , uncharsetalias
4918 \*(NQ Manage alias mappings for (conversion of)
4919 .Sx "Character sets" .
4920 Alias processing is not performed for
4921 .Sx "INTERNAL VARIABLES" ,
4924 and mappings are ineffective if character set conversion is not available
4928 Expansion happens recursively for cases where aliases point to other
4929 aliases (built-in loop limit: 8).
4931 The latter command deletes all aliases given as arguments,
4932 or all at once when given the asterisk
4934 The former shows the list of all currently defined aliases if used
4935 without arguments, or the target of the given single argument;
4936 when given two arguments, hyphen-minus
4938 being the first, the second is instead expanded recursively.
4939 In all other cases the given arguments are treated as pairs of character
4940 sets and their desired target alias name, creating new or updating
4941 already existing aliases.
4944 \*(NQ(ch) Change the working directory to
4946 or the given argument.
4951 .It Ic collapse , uncollapse
4957 Takes a message list and makes all replies to these messages invisible
4958 in header summaries, except for
4962 Also when a message with collapsed replies is displayed,
4963 all of these are automatically uncollapsed.
4964 The latter command undoes collapsing.
4967 .It Ic colour , uncolour
4968 \*(OP\*(NQ Manage colour mappings of and for a
4969 .Sx "Coloured display" .
4970 Without arguments the former shows all currently defined mappings.
4971 Otherwise a colour type is expected (case-insensitively),
4974 for 256-colour terminals,
4979 for the standard 8-colour ANSI / ISO 6429 colour palette, and
4983 for monochrome terminals, which only support (some) font attributes.
4984 Without further arguments the list of all currently defined mappings
4985 of the given type is shown (here the special
4989 also show all currently defined mappings).
4991 Otherwise the second argument defines the mappable slot, the third
4992 argument a (comma-separated list of) colour and font attribute
4993 specification(s), and the optionally supported fourth argument can be
4994 used to specify a precondition: if conditioned mappings exist they are
4995 tested in (creation) order unless a (case-insensitive) match has been
4996 found, and the default mapping (if any has been established) will only
4997 be chosen as a last resort.
4998 The types of available preconditions depend on the mappable slot,
4999 the following of which exist:
5001 Mappings prefixed with
5003 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
5004 .Sx "On terminal control and line editor" )
5005 and do not support preconditions.
5007 .Bl -tag -compact -width view-partinfo
5009 This mapping is used for the position indicator that is visible when
5010 a line cannot be fully displayed on the screen.
5015 Used for the occasionally appearing error indicator that is joined onto
5017 \*(ID Also used for error messages written on standard error .
5020 Mappings prefixed with
5022 are used in header summaries, and they all understand the preconditions
5024 (the current message) and
5026 for elder messages (only honoured in conjunction with
5027 .Va datefield-markout-older ) .
5029 .Bl -tag -compact -width view-partinfo
5031 This mapping is used for the
5033 that can be created with the
5037 formats of the variable
5040 For the complete header summary line except the
5042 and the thread structure.
5044 For the thread structure which can be created with the
5046 format of the variable
5050 Mappings prefixed with
5052 are used when displaying messages.
5054 .Bl -tag -compact -width view-partinfo
5056 This mapping is used for so-called
5058 lines, which are MBOX file format specific header lines (also see
5059 .Va mbox-rfc4155 ) .
5062 A comma-separated list of headers to which the mapping applies may be
5063 given as a precondition; if the \*(OPal regular expression support is
5064 available then if any of the
5066 .Sx "magic regular expression characters"
5067 is seen the precondition will be evaluated as (an extended) one.
5069 For the introductional message info line.
5070 .It Ar view-partinfo
5071 For MIME part info lines.
5074 The following (case-insensitive) colour definitions and font attributes
5075 are understood, multiple of which can be specified in a comma-separated
5084 It is possible (and often applicable) to specify multiple font
5085 attributes for a single mapping.
5087 foreground colour attribute, in order (numbers 0 - 7)
5097 To specify a 256-colour mode a decimal number colour specification in
5098 the range 0 to 255, inclusive, is supported, and interpreted as follows:
5100 .Bl -tag -compact -width "999 - 999"
5102 the standard ISO 6429 colours, as above.
5104 high intensity variants of the standard colours.
5106 216 colours in tuples of 6.
5108 grayscale from black to white in 24 steps.
5110 .Bd -literal -offset indent
5112 fg() { printf "\e033[38;5;${1}m($1)"; }
5113 bg() { printf "\e033[48;5;${1}m($1)"; }
5115 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
5116 printf "\e033[0m\en"
5118 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
5119 printf "\e033[0m\en"
5122 background colour attribute (see
5124 for possible values).
5129 will remove for the given colour type (the special type
5131 selects all) the given mapping; if the optional precondition argument is
5132 given only the exact tuple of mapping and precondition is removed.
5135 will remove all mappings (no precondition allowed), thus
5137 will remove all established mappings.
5140 .It Ic commandalias , uncommandalias
5141 \*(NQ Define or list, and remove, respectively, command aliases.
5142 An (command)alias can be used everywhere a normal command can be used,
5143 but always takes precedence: any arguments that are given to the command
5144 alias are joined onto the alias expansion, and the resulting string
5145 forms the command line that is, in effect, executed.
5146 The latter command removes all given aliases, the special name asterisk
5148 will remove all existing aliases.
5149 When used without arguments the former shows a list of all currently
5150 known aliases, with one argument only the expansion of the given one.
5152 With two or more arguments a command alias is defined or updated: the
5153 first argument is the name under which the remaining command line should
5154 be accessible, the content of which can be just about anything.
5155 An alias may itself expand to another alias, but to avoid expansion loops
5156 further expansion will be prevented if an alias refers to itself or if
5157 an expansion depth limit is reached.
5158 Explicit expansion prevention is available via reverse solidus
5161 .Sx "Command modifiers" .
5162 .Bd -literal -offset indent
5164 \*(uA: `commandalias': no such alias: xx
5165 ? commandalias xx echo hello,
5167 commandalias xx 'echo hello,'
5177 but copy the messages to a file named after the local part of the
5178 sender of the first message instead of taking a filename argument;
5180 is inspected to decide on the actual storage location.
5183 (c) Copy messages to the named file and do not mark them as being saved;
5184 otherwise identical to
5188 \*(NQ A multiplexer command which provides C-style string operations on
5189 8-bit bytes without a notion of locale settings and character sets,
5190 effectively assuming ASCII data.
5191 For numeric and other operations refer to
5195 .Sx "Command modifiers" ,
5199 for usage errors and numeric results, the empty string otherwise;
5200 missing data errors, as for unsuccessful searches, result in the
5202 error number being set to
5203 .Va ^ERR Ns -NODATA .
5204 Where the question mark
5206 modifier suffix is supported, a case-insensitive (ASCII mapping)
5207 operation mode is supported; the keyword
5214 .Bl -hang -width ".It Cm length"
5216 Queries the length of the given argument.
5217 .It Cm hash , Cm hash32
5218 Calculates a hash value of the given argument.
5219 The latter will return a 32-bit result regardless of host environment.
5221 modifier suffix is supported.
5222 These use Chris Torek's hash algorithm, the resulting hash value is
5223 bit mixed as shown by Bret Mulvey.
5225 Search for the second in the first argument.
5226 Shows the resulting 0-based offset shall it have been found.
5228 modifier suffix is supported.
5230 Creates a substring of its first argument.
5231 The optional second argument is the 0-based starting offset,
5232 a negative one counts from the end;
5233 the optional third argument specifies the length of the desired result,
5234 a negative length leaves off the given number of bytes at the end of the
5235 original string; by default the entire string is used.
5236 This operation tries to work around faulty arguments (set
5238 for error logs), but reports them via the error number
5241 .Va ^ERR Ns -OVERFLOW .
5243 Trim away whitespace characters from both ends of the argument.
5245 Trim away whitespace characters from the begin of the argument.
5247 Trim away whitespace characters from the end of the argument.
5251 Show the name of the current working directory, as reported by
5256 .Sx "Command modifiers" ) .
5257 The return status is tracked via
5261 \*(OP For unencrypted messages this command is identical to
5263 Encrypted messages are first decrypted, if possible, and then copied.
5266 \*(OP For unencrypted messages this command is identical to
5268 Encrypted messages are first decrypted, if possible, and then copied.
5271 .It Ic define , undefine
5272 The latter command deletes the given macro, the special name
5274 will discard all existing macros.
5275 Deletion of (a) macro(s) can be performed from within running (a)
5276 macro(s), including self-deletion.
5277 Without arguments the former command prints the current list of macros,
5278 including their content, otherwise it defines a macro, replacing an
5279 existing one of the same name as applicable.
5281 A defined macro can be invoked explicitly by using the
5286 commands, or implicitly if a macro hook is triggered, for example a
5288 Execution of a macro body can be stopped from within by calling
5291 Temporary macro block-scope variables can be created or deleted with the
5293 command modifier in conjunction with the commands
5298 To enforce unrolling of changes made to (global)
5299 .Sx "INTERNAL VARIABLES"
5302 can be used instead; its covered scope depends on how (i.e.,
5304 normal macro, folder hook, hook,
5306 switch) the macro is invoked.
5310 ed macro, the given positional parameters are implicitly local
5311 to the macro's scope, and may be accessed via the variables
5317 and any other positive unsigned decimal number less than or equal to
5319 Positional parameters can be
5321 ed, or become completely replaced, removed etc. via
5323 A helpful command for numeric computation and string evaluations is
5326 offers C-style byte string operations.
5327 .Bd -literal -offset indent
5336 echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
5339 call exmac Hello macro exmac!
5340 echo ${?}/${!}/${^ERRNAME}
5344 .It Ic delete , undelete
5345 (d, u) Marks the given message list as being or not being
5347 respectively; if no argument has been specified then the usual search
5348 for a visible message is performed, as documented for
5349 .Sx "Message list arguments" ,
5350 showing only the next input prompt if the search fails.
5351 Deleted messages will neither be saved in the
5353 .Sx "secondary mailbox"
5355 nor will they be available for most other commands.
5358 variable is set, the new
5360 or the last message restored, respectively, is automatically
5367 \*(NQ Digging (information out of) messages is possible through
5369 objects, which can be
5371 d for the given message number; in
5375 will instead open the message that is being composed.
5376 If a hyphen-minus is given as the optional third argument then output
5377 will be generated on the standard output channel instead of being
5378 subject to consumption by the
5385 Note: output must be consumed before normal processing can continue; for
5387 objects this means each command output has to be read until the end of
5388 file (EOF) state occurs.
5392 d again by giving the same identifier used for creation;
5393 this step could be omitted: objects will be automatically closed
5396 (mailbox) or the compose mode is left, respectively.
5397 In all other use cases the second argument is an object identifier,
5398 and the third and all following arguments are interpreted as via
5401 .Sx "COMMAND ESCAPES" ) :
5402 .Bd -literal -offset indent
5403 ? vput = msgno; digmsg create $msgno
5404 ? digmsg $msgno header list; readall x; echon $x
5405 210 Subject From To Message-ID References In-Reply-To
5406 ? digmsg $msgno header show Subject;readall x;echon $x
5410 ? digmsg remove $msgno
5416 Superseded by the multiplexer
5421 Delete the given messages and automatically
5425 if one exists, regardless of the setting of
5431 up or down by one message when given
5435 argument, respectively.
5438 .It Ic draft , undraft
5439 Take message lists and mark each given message as being draft, or not
5440 being draft, respectively, as documented in the section
5441 .Sx "Message states" .
5444 \*(NQ(ec) Print the given strings, equivalent to the shell utility
5447 .Sx "Shell-style argument quoting"
5448 expansion is performed and, different to the otherwise identical
5450 a trailing newline is echoed.
5453 .Sx "Command modifiers"
5454 is supported, and the error number
5456 is managed: if data is stored in a variable then the return value
5457 reflects the length of the result string in case of success and is
5462 this command traditionally (in BSD Mail) also performed
5463 .Sx "Filename transformations" ,
5464 which is standard incompatible and hard to handle because quoting
5465 transformation patterns is not possible; the subcommand
5469 can be used to expand filenames.
5474 but the message is written to standard error, and prefixed by
5478 In interactive sessions the \*(OPal message ring queue for
5480 will be used instead, if available and
5487 but does not write or store a trailing newline.
5492 but does not write or store a trailing newline.
5497 at each message from the given list in turn.
5498 Modified contents are discarded unless the
5500 variable is set, and are not used unless the mailbox can be written to
5501 and the editor returns a successful exit status.
5503 can be used instead for a more display oriented editor.
5508 (see there for more),
5509 .Ic elif , else , endif
5510 conditional \(em if the condition of a preceding
5512 was false, check the following condition and execute the following block
5513 if it evaluates true.
5518 (see there for more),
5519 .Ic elif , else , endif
5520 conditional \(em if none of the conditions of the preceding
5524 commands was true, the
5529 (en) Marks the end of an
5531 (see there for more),
5532 .Ic elif , else , endif
5533 conditional execution block.
5536 \*(NQ There is a strict separation in between
5537 .Sx "INTERNAL VARIABLES"
5540 which is inherited by child processes.
5541 Some variables of the latter are however vivid for program operation,
5542 their purpose is known, therefore they have been integrated
5543 transparently into handling of the former, as accessible via
5547 To integrate any other environment variable, and/or to export internal
5548 variables into the process environment where they normally are not, a
5550 needs to become established with this command, for example
5552 .Dl environ link PERL5LIB TZ
5554 Afterwards changing such variables with
5556 will cause automatic updates of the environment, too.
5557 Sufficient system support provided (it was in BSD as early as 1987, and
5558 is standardized since Y2K) removing such variables with
5560 will remove them also from the environment, but in any way the knowledge
5566 may cause loss of such links.
5570 removes an existing link without otherwise touching variables, the
5574 subcommands are identical to
5578 but additionally update the program environment accordingly; removing
5579 a variable breaks any freely established
5583 \*(OP As console user interfaces at times scroll error messages by too
5584 fast and/or out of scope, data can additionally be sent to an error queue
5585 manageable by this command:
5587 or no argument will display and clear the queue,
5590 As the queue becomes filled with
5592 entries the eldest entries are being dropped.
5593 There are also the variables
5596 .Va ^ERRQUEUE-EXISTS .
5599 \*(NQ Construct a command by concatenating the arguments, separated with
5600 a single space character, and then evaluate the result.
5601 This command passes through the exit status
5605 of the evaluated command; also see
5607 .Bd -literal -offset indent
5618 call yyy '\ecall xxx' "b\e$'\et'u ' "
5625 (ex or x) Exit from \*(UA without changing the active mailbox and skip
5626 any saving of messages in the
5628 .Sx "secondary mailbox"
5630 as well as a possibly tracked line editor
5633 .Va on-account-cleanup
5634 will be invoked, however.
5635 The optional status number argument will be passed through to
5637 \*(ID For now it can happen that the given status will be overwritten,
5638 later this will only occur if a later error needs to be reported onto an
5639 otherwise success indicating status.
5644 but open the mailbox read-only.
5651 .It Ic filetype , unfiletype
5652 \*(NQ Define, list, and remove, respectively, file handler hooks,
5653 which provide (shell) commands that enable \*(UA to load and save MBOX
5654 files from and to files with the registered file extensions, as shown
5657 The extensions are used case-insensitively, yet the auto-completion
5658 feature of for example
5660 will only work case-sensitively.
5661 An intermediate temporary file will be used to store the expanded data.
5662 The latter command will remove hooks for all given extensions, asterisk
5664 will remove all existing handlers.
5666 When used without arguments the former shows a list of all currently
5667 defined file hooks, with one argument the expansion of the given alias.
5668 Otherwise three arguments are expected, the first specifying the file
5669 extension for which the hook is meant, and the second and third defining
5670 the load- and save commands to deal with the file type, respectively,
5671 both of which must read from standard input and write to standard
5673 Changing hooks will not affect already opened mailboxes (\*(ID except below).
5674 \*(ID For now too much work is done, and files are oftened read in twice
5675 where once would be sufficient: this can cause problems if a filetype is
5676 changed while such a file is opened; this was already so with the
5677 built-in support of .gz etc. in Heirloom, and will vanish in v15.
5678 \*(ID For now all handler strings are passed to the
5679 .Ev SHELL for evaluation purposes; in the future a
5681 prefix to load and save commands may mean to bypass this shell instance:
5682 placing a leading space will avoid any possible misinterpretations.
5683 .Bd -literal -offset indent
5684 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
5685 gz 'gzip -dc' 'gzip -c' xz 'xz -dc' 'xz -zc' \e
5686 zst 'zstd -dc' 'zstd -19 -zc' \e
5687 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5688 ? set record=+sent.zst.pgp
5692 .It Ic flag , unflag
5693 Take message lists and mark the messages as being flagged, or not being
5694 flagged, respectively, for urgent/special attention.
5696 .Sx "Message states" .
5701 but open the mailbox read-only.
5704 (fold) Open a new, or show status information of the current mailbox.
5705 If an argument is given, changes (such as deletions) will be written
5706 out, a new mailbox will be opened, the internal variables
5707 .Va mailbox-resolved
5710 will be updated, a set according
5712 is executed, and optionally a summary of
5714 is displayed if the variable
5718 .Sx "Filename transformations"
5719 will be applied to the
5723 prefixes are, i.e., URL (see
5724 .Sx "On URL syntax and credential lookup" )
5725 syntax is understood, as in
5726 .Ql mbox:///tmp/somefolder .
5727 If a protocol prefix is used the mailbox type is fixated, otherwise
5728 opening none-existing
5730 uses the protocol defined in
5737 (MBOX database), as well as
5739 (electronic mail message \*(ID read-only) the list of all registered
5741 s is traversed to check whether hooks shall be used to load (and save)
5742 data from (and to) the given
5744 Changing hooks will not affect already opened mailboxes.
5745 For example, the following creates hooks for the
5747 compression tool and a combined compressed and encrypted format:
5748 .Bd -literal -offset indent
5750 gzip 'gzip -dc' 'gzip -c' \e
5751 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5754 For historic reasons
5756 s provide limited (case-sensitive) auto-completion capabilities.
5761 provided that corresponding handlers are installed.
5762 It will neither find
5766 however, but an explicit
5767 .Ql \&? file mbox.GZ
5768 will find and use the handler for
5770 \*(ID The latter mode can only be used for MBOX files.
5772 EML files consist of only one mail message,
5773 \*(ID and can only be opened read-only.
5774 When reading MBOX files tolerant POSIX rules are used by default.
5775 Invalid message boundaries that can be found quite often in historic
5776 MBOX files will be complained about (even more with
5778 in this case the method described for
5780 can be used to create a valid MBOX database from the invalid input.
5782 MBOX databases and EML files will always be protected via file-region locks
5784 during file operations to protect against concurrent modifications.
5785 .Mx -ix "dotlock files"
5791 .Sx "primary system mailbox"
5792 will also be protected by so-called dotlock files,
5793 the traditional way of mail spool file locking: for any file
5797 will be created during the synchronization, in the same directory and
5798 with the same user and group identities as the file of interest \(em
5799 as necessary created by an external privileged dotlock helper.
5801 disables dotlock files.
5804 .Sx "Howto handle stale dotlock files" .
5806 \*(OP If no protocol has been fixated, and
5808 refers to a directory with the subdirectories
5813 then it is treated as a folder in
5816 The maildir format stores each message in its own file, and has been
5817 designed so that file locking is not necessary when reading or writing
5820 \*(OPally URLs can be used to access network resources, securely via
5821 .Sx "Encrypted network communication" ,
5823 Network communication socket timeouts are configurable via
5824 .Va socket-connect-timeout .
5825 All network traffic may be proxied over a SOCKS server via
5828 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
5829 .Dl \*(OU protocol://[user@]host[:port][/path]
5831 \*(OPally supported network protocols are
5835 (POP3 with TLS encrypted transport),
5841 part is valid only for IMAP; there it defaults to
5843 Network URLs require a special encoding as documented in the section
5844 .Sx "On URL syntax and credential lookup" .
5847 Lists the names of all folders below the given argument or
5849 For file-based protocols
5851 will be used for display purposes.
5854 .It Ic Followup , followup
5855 \*(CM(F,fo) Similar to
5859 respectively, but save the message in a file named after the local part
5860 of the (first) recipient's address, possibly overwriting
5872 but saves the message in a file named after the local part of the
5873 recipient's address (instead of in
5877 \*(CM Take a message list and the address of a recipient, subject to
5879 to whom the messages are sent.
5880 The text of the original message is included in the new one,
5881 enclosed by the values of
5882 .Va forward-inject-head
5884 .Va forward-inject-tail .
5885 .Va content-description-forwarded-message
5887 The list of included headers can be filtered with the
5889 slot of the white- and blacklisting command
5891 Only the first part of a multipart message is included but for
5892 .Va forward-as-attachment .
5894 This may generate the errors
5895 .Va ^ERR Ns -DESTADDRREQ
5896 if no receiver has been specified, or was rejected by
5900 if an I/O error occurs,
5902 if a necessary character set conversion fails, and
5905 It can also fail with errors of
5906 .Sx "Specifying messages" .
5907 Any error stops processing of further messages.
5910 (f) Takes a list of message specifications and displays a summary of
5911 their message headers, exactly as via
5913 making the first message of the result the new
5915 (the last message if
5918 An alias of this command is
5921 .Sx "Specifying messages" .
5929 \*(OB Superseded by the multiplexer
5932 \*(OB Superseded by the multiplexer
5934 .It Ic ghost , unghost
5937 .Ic uncommandalias .
5940 .It Ic headerpick , unheaderpick
5941 \*(NQ Multiplexer command to manage white- and blacklisting
5942 selections of header fields for a variety of applications.
5943 Without arguments the set of contexts that have settings is displayed.
5944 When given arguments, the first argument is the context to which the
5945 command applies, one of (case-insensitive)
5947 for display purposes (for example
5950 for selecting which headers shall be stored persistently when
5956 ing messages (note that MIME related etc. header fields should not be
5957 ignored in order to not destroy usability of the message in this case),
5959 for stripping down messages when
5961 ing message (has no effect if
5962 .Va forward-as-attachment
5965 for defining user-defined set of fields for the command
5968 The current settings of the given context are displayed if it is the
5970 A second argument denotes the type of restriction that is to be chosen,
5971 it may be (a case-insensitive prefix of)
5975 for white- and blacklisting purposes, respectively.
5976 Establishing a whitelist suppresses inspection of the corresponding
5979 If no further argument is given the current settings of the given type
5980 will be displayed, otherwise the remaining arguments specify header
5981 fields, which \*(OPally may be given as regular expressions, to be added
5983 The special wildcard field (asterisk,
5985 will establish a (fast) shorthand setting which covers all fields.
5987 The latter command always takes three or more arguments and can be used
5988 to remove selections, i.e., from the given context, the given type of
5989 list, all the given headers will be removed, the special argument
5991 will remove all headers.
5994 (h) Show the current group of headers, the size of which depends on
5997 in interactive mode, and the format of which can be defined with
5999 If a message-specification is given the group of headers containing the
6000 first message therein is shown and the message at the top of the screen
6003 the last message is targeted if
6012 \*(OP Without arguments or when given
6014 all history entries are shown (this mode also supports a more
6018 will replace the list of entries with the content of
6022 will dump all entries to said file, replacing former content, and
6024 will delete all entries.
6025 The argument can also be a signed decimal
6027 which will select and evaluate the respective history entry, and move it
6028 to the top of the history; a negative number is used as an offset to the
6029 current command so that
6031 will select the last command, the history top, whereas
6033 will delete all given entries
6034 .Pf ( Ar :NUMBER: ) .
6036 .Sx "On terminal control and line editor" .
6041 Takes a message list and marks each message therein to be saved in the
6046 .Sx "secondary mailbox"
6048 Does not override the
6051 \*(UA deviates from the POSIX standard with this command, because a
6053 command issued after
6055 will display the following message, not the current one.
6059 .Ic \&\&if , Ic elif , else , endif
6060 conditional execution construct \(em if the given condition is true then
6061 the encapsulated block is executed.
6062 The POSIX standard only supports the (case-insensitive) conditions
6067 end, the remaining are non-portable extensions.
6068 \*(ID In conjunction with the
6071 .Sx "Shell-style argument quoting"
6072 and more test operators are available.
6073 .Bd -literal -offset indent
6081 Further (case-insensitive) one-argument conditions are
6083 erminal which evaluates to true in interactive terminal sessions
6084 (running with standard input or standard output attached to a terminal,
6087 command line options
6092 have been used), as well as any boolean value (see
6093 .Sx "INTERNAL VARIABLES"
6094 for textual boolean representations) to mark an enwrapped block as
6097 .Dq always execute .
6098 (Remarks: condition syntax errors skip all branches until
6103 It is possible to check
6104 .Sx "INTERNAL VARIABLES"
6107 variables for existence or compare their expansion against a user given
6108 value or another variable by using the
6110 .Pf ( Dq variable next )
6111 conditional trigger character;
6112 a variable on the right hand side may be signalled using the same
6114 Variable names may be enclosed in a pair of matching braces.
6115 When this mode has been triggered, several operators are available
6118 they are always available, and there is no trigger: variables will have
6119 been expanded by the shell-compatible parser before the
6121 etc. command sees them).
6123 \*(IN Two argument conditions.
6124 Variables can be tested for existence and expansion:
6126 will test whether the given variable exists, so that
6128 will evaluate to true when
6133 .Ql -n """$editalong"""
6134 will be true if the variable is set and expands to a non-empty string,
6135 .Ql -z $'\e$editalong'
6136 only if the expansion is empty, whether the variable exists or not.
6137 The remaining conditions take three arguments.
6139 Integer operators treat the arguments on the left and right hand side of
6140 the operator as integral numbers and compare them arithmetically.
6141 It is an error if any of the operands is not a valid integer, an empty
6142 argument (which implies it had been quoted) is treated as if it were 0.
6143 Via the question mark
6145 modifier suffix a saturated operation mode is available where numbers
6146 will linger at the minimum or maximum possible value, instead of
6147 overflowing (or trapping), the keyword
6154 are therefore identical.
6155 Available operators are
6159 (less than or equal to),
6165 (greater than or equal to), and
6169 String and regular expression data operators compare the left and right
6170 hand side according to their textual content.
6171 Unset variables are treated as the empty string.
6172 Via the question mark
6174 modifier suffix a case-insensitive operation mode is available, the keyword
6182 Available string operators are
6186 (less than or equal to),
6192 (greater than or equal to),
6196 (is substring of) and
6198 (is not substring of).
6199 By default these operators work on bytes and (therefore) do not take
6200 into account character set specifics.
6201 If the case-insensitivity modifier has been used, case is ignored
6202 according to the rules of the US-ASCII encoding, i.e., bytes are
6205 When the \*(OPal regular expression support is available, the additional
6211 They treat the right hand side as an extended regular expression that is
6212 matched according to the active locale (see
6213 .Sx "Character sets" ) ,
6214 i.e., character sets should be honoured correctly.
6216 Conditions can be joined via AND-OR lists (where the AND operator is
6218 and the OR operator is
6220 which have equal precedence and will be evaluated with left
6221 associativity, thus using the same syntax that is known for the
6223 It is also possible to form groups of conditions and lists by enclosing
6224 them in pairs of brackets
6225 .Ql [\ \&.\&.\&.\ ] ,
6226 which may be interlocked within each other, and also be joined via
6229 The results of individual conditions and entire groups may be modified
6230 via unary operators: the unary operator
6232 will reverse the result.
6233 .Bd -literal -offset indent
6234 wysh set v15-compat=yes # with value: automatic "wysh"!
6235 if -N debug;echo *debug* set;else;echo not;endif
6236 if "$ttycharset" == UTF-8 || "$ttycharset" ==?cas UTF8
6237 echo ttycharset is UTF-8, the former case-sensitive!
6240 if [ "${t1}" == "${t2}" ]
6241 echo These two variables are equal
6243 if "$features" =% ,+regex, && "$TERM" =~?case ^xterm\&.*
6244 echo ..in an X terminal
6246 if [ [ true ] && [ [ "${debug}" != '' ] || \e
6247 [ "$verbose" != '' ] ] ]
6250 if true && [ -n "$debug" || -n "${verbose}" ]
6251 echo Left associativity, as is known from the shell
6258 Superseded by the multiplexer
6262 Shows the names of all available commands, in command lookup order.
6263 \*(OP In conjunction with a set variable
6265 additional information will be provided for each command: the argument
6266 type will be indicated, the documentation string will be shown,
6267 and the set of command flags will show up:
6269 .Bl -tag -compact -width ".It Ql NEEDS_BOX"
6271 command supports the command modifier
6274 command supports the command modifier
6277 the error number is tracked in
6280 whether the command needs an active mailbox, a
6283 indicators whether command is \&.\h'.3m'.\h'.3m'.
6284 .Bl -tag -compact -width ".It Ql SUBPROCESS"
6285 .It Ql batch/interactive
6286 usable in interactive or batch mode
6289 usable in send mode.
6291 allowed to be used when running in a subprocess instance,
6292 for example from within a macro that is called via
6293 .Va on-compose-splice .
6296 indicators whether command is not \&.\h'.3m'.\h'.3m'.
6297 .Bl -tag -compact -width ".It Ql COMPOSE_MODE"
6302 available during program startup, like in
6303 .Sx "Resource files" .
6306 The command produces
6313 Enforce change localization of
6318 .Sx "INTERNAL VARIABLES" ,
6319 meaning that their state will be reverted to the former one once the
6322 Just like the command modifier
6324 which provides block-scope localization for some commands (instead),
6325 it can only be used inside of macro definition blocks introduced by
6329 The covered scope of an
6331 is left once a different account is activated, and some macros, notably
6332 .Va folder-hook Ns s ,
6333 use their own specific notion of covered scope, here it will be extended
6334 until the folder is left again.
6336 This setting stacks up: i.e., if
6338 enables change localization and calls
6340 which explicitly resets localization, then any value changes within
6342 will still be reverted when the scope of
6345 (Caveats: if in this example
6347 changes to a different
6349 which sets some variables that are already covered by localizations,
6350 their scope will be extended, and in fact leaving the
6352 will (thus) restore settings in (likely) global scope which actually
6353 were defined in a local, macro private context!)
6355 This command takes one or two arguments, the optional first one
6356 specifies an attribute that may be one of
6358 which refers to the current scope and is thus the default,
6360 which causes any macro that is being
6362 ed to be started with localization enabled by default, as well as
6364 which (if enabled) disallows any called macro to turn off localization:
6365 like this it can be ensured that once the current scope regains control,
6366 any changes made in deeper levels have been reverted.
6367 The latter two are mutually exclusive, and neither affects
6369 The (second) argument is interpreted as a boolean (string, see
6370 .Sx "INTERNAL VARIABLES" )
6371 and states whether the given attribute shall be turned on or off.
6372 .Bd -literal -offset indent
6373 define temporary_settings {
6374 set possibly_global_option1
6376 set localized_option1
6377 set localized_option2
6379 set possibly_global_option2
6384 .It Ic Lfollowup , Lreply
6385 \*(CM Reply to messages that come in via known
6388 .Pf ( Ic mlsubscribe )
6389 mailing lists, or pretend to do so (see
6390 .Sx "Mailing lists" ) :
6395 respectively, functionality this will actively resort and even remove
6396 message recipients in order to generate a message that is supposed to be
6397 sent to a mailing list.
6398 For example it will also implicitly generate a
6399 .Ql Mail-Followup-To:
6400 header if that seems useful, regardless of the setting of the variable
6402 For more documentation please refer to
6403 .Sx "On sending mail, and non-interactive mode" .
6405 This may generate the errors
6406 .Va ^ERR Ns -DESTADDRREQ
6407 if no receiver has been specified,
6409 if some addressees where rejected by
6412 if an I/O error occurs,
6414 if a necessary character set conversion fails, and
6417 It can also fail with errors of
6418 .Sx "Specifying messages" .
6419 Occurrence of some of the errors depend on the value of
6421 Any error stops processing of further messages.
6426 but saves the message in a file named after the local part of the first
6427 recipient's address (instead of in
6431 \*(CM(m) Takes a (list of) recipient address(es) as (an) argument(s),
6432 or asks on standard input if none were given;
6433 then collects the remaining mail content and sends it out.
6434 Unless the internal variable
6436 is set recipient addresses will be stripped from comments, names etc.
6437 For more documentation please refer to
6438 .Sx "On sending mail, and non-interactive mode" .
6440 This may generate the errors
6441 .Va ^ERR Ns -DESTADDRREQ
6442 if no receiver has been specified,
6444 if some addressees where rejected by
6447 if multiple messages have been specified,
6449 if an I/O error occurs,
6451 if a necessary character set conversion fails, and
6454 It can also fail with errors of
6455 .Sx "Specifying messages" .
6456 Occurrence of some of the errors depend on the value of
6460 \*(OP When used without arguments or if
6462 has been given the content of
6463 .Sx "The Mailcap files"
6464 cache is shown, (re-)initializing it first (as necessary.
6467 then the cache will only be (re-)initialized, and
6469 will remove its contents.
6470 Note that \*(UA will try to load the files only once, use
6471 .Ql Ic \&\&mailcap Ns \:\0\:clear
6472 to unlock further attempts.
6473 Loading and parsing can be made more
6477 (mb) The given message list is to be sent to the
6479 .Sx "secondary mailbox"
6481 when \*(UA is quit; this is the default action unless the variable
6484 \*(ID This command can only be used in a
6486 .Sx "primary system mailbox" .
6489 .It Ic mimetype , unmimetype
6490 \*(NQ Without arguments the content of the MIME type cache will displayed;
6491 a more verbose listing will be produced if either of
6496 When given arguments they will be joined, interpreted as shown in
6497 .Sx "The mime.types files"
6499 .Sx "HTML mail and MIME attachments" ) ,
6500 and the resulting entry will be added (prepended) to the cache.
6501 In any event MIME type sources are loaded first as necessary \(en
6502 .Va mimetypes-load-control
6503 can be used to fine-tune which sources are actually loaded.
6505 The latter command deletes all specifications of the given MIME type, thus
6506 .Ql \&? unmimetype text/plain
6507 will remove all registered specifications for the MIME type
6511 will discard all existing MIME types, just as will
6513 but which also reenables cache initialization via
6514 .Va mimetypes-load-control .
6517 \*(ID Only available in interactive mode, this command allows execution
6518 of external MIME type handlers which do not integrate into the normal
6521 .Sx "HTML mail and MIME attachments" ) .
6522 (\*(ID No syntax to directly address parts, this restriction may vanish.)
6523 The user will be asked for each non-text part of the given message in
6524 turn whether the registered handler shall be used to display the part.
6527 .It Ic mlist , unmlist
6528 \*(NQ Manage the list of known
6529 .Sx "Mailing lists" ;
6530 subscriptions are controlled via
6532 The latter command deletes all given arguments,
6533 or all at once when given the asterisk
6535 The former shows the list of all currently known lists if used
6536 without arguments, otherwise the given arguments will become known.
6537 \*(OP In the latter case, arguments which contain any of the
6539 .Sx "magic regular expression characters"
6540 will be interpreted as one, possibly matching many addresses;
6541 these will be sequentially matched via linked lists instead of being
6542 looked up in a dictionary.
6545 .It Ic mlsubscribe , unmlsubscribe
6546 Building upon the command pair
6547 .Ic mlist , unmlist ,
6548 but only managing the subscription attribute of mailing lists.
6549 (The former will also create not yet existing mailing lists.)
6554 but move the messages to a file named after the local part of the
6555 sender of the first message instead of taking a filename argument;
6557 is inspected to decide on the actual storage location.
6562 but marks the messages for deletion if they were transferred
6568 but also displays header fields which would not pass the
6570 selection, and all MIME parts.
6577 on the given messages, even in non-interactive mode and as long as the
6578 standard output is a terminal.
6583 \*(OP When used without arguments or if
6585 has been given the content of the
6587 cache is shown, (re-)initializing it first (as necessary).
6590 then the cache will only be (re-)initialized, and
6592 will remove its contents.
6595 \*(OP When used without arguments, or when the argument was
6599 cache is shown, initializing it as necessary.
6602 then the cache will be (re)loaded, whereas
6605 Loading and parsing can be made more
6608 will query the cache for the URL given as the second argument
6609 .Pf ( Ql [USER@]HOST ) .
6614 .Sx "On URL syntax and credential lookup" ;
6616 .Sx "The .netrc file"
6617 documents the file format in detail.
6620 Checks for new mail in the current folder without committing any changes
6622 If new mail is present, a message is shown.
6626 the headers of each new message are also shown.
6627 This command is not available for all mailbox types.
6634 Goes to the next message in sequence and types it.
6635 With an argument list, types the next matching message.
6646 If the current folder is accessed via a network connection, a
6648 command is sent, otherwise no operation is performed.
6653 but also displays header fields which would not pass the
6655 selection, and all MIME parts.
6662 on the given messages, even in non-interactive mode and as long as the
6663 standard output is a terminal.
6670 but also pipes header fields which would not pass the
6672 selection, and all parts of MIME
6673 .Ql multipart/alternative
6677 (pi) Takes an optional message list and shell command (that defaults to
6679 and pipes the messages through the command.
6683 every message is followed by a formfeed character.
6700 (q) Terminates the session, saving all undeleted, unsaved messages in
6703 .Sx "secondary mailbox"
6705 preserving all messages marked with
6709 or never referenced in the system
6711 and removing all other messages from the
6713 .Sx "primary system mailbox" .
6714 If new mail has arrived during the session,
6716 .Dq You have new mail
6718 If given while editing a mailbox file with the command line option
6720 then the edit file is rewritten.
6721 A return to the shell is effected,
6722 unless the rewrite of edit file fails,
6723 in which case the user can escape with the exit command.
6724 The optional status number argument will be passed through to
6726 \*(ID For now it can happen that the given status will be overwritten,
6727 later this will only occur if a later error needs to be reported onto an
6728 otherwise success indicating status.
6731 \*(NQ Read a line from standard input, or the channel set active via
6733 and assign the data, which will be split as indicated by
6735 to the given variables.
6736 The variable names are checked by the same rules as documented for
6738 and the same error codes will be seen in
6742 indicates the number of bytes read, it will be
6744 with the error number
6748 in case of I/O errors, or
6751 If there are more fields than variables, assigns successive fields to the
6752 last given variable.
6753 If there are less fields than variables, assigns the empty string to the
6755 .Bd -literal -offset indent
6758 ? echo "<$a> <$b> <$c>"
6760 ? wysh set ifs=:; read a b c;unset ifs
6761 hey2.0,:"'you ",:world!:mars.:
6762 ? echo $?/$^ERRNAME / <$a><$b><$c>
6763 0/NONE / <hey2.0,><"'you ",><world!:mars.:><><>
6769 but splits on shell token boundaries (see
6770 .Sx "Shell-style argument quoting" )
6773 \*(ID Could become a
6776 .Ql read --tokenize -- .
6779 \*(NQ Read anything from standard input, or the channel set active via
6781 and assign the data to the given variable.
6782 The variable name is checked by the same rules as documented for
6784 and the same error codes will be seen in
6788 indicates the number of bytes read, it will be
6790 with the error number
6794 in case of I/O errors, or
6797 \*(ID The input data length is restricted to 31-bits.
6800 \*(NQ Manages input channels for
6805 to be used to avoid complicated or impracticable code, like calling
6807 from within a macro in non-interactive mode.
6808 Without arguments, or when the first argument is
6810 a listing of all known channels is printed.
6811 Channels can otherwise be
6813 d, and existing channels can be
6817 d by giving the string used for creation.
6819 The channel name is expected to be a file descriptor number, or,
6820 if parsing the numeric fails, an input file name that undergoes
6821 .Sx "Filename transformations" .
6822 For example (this example requires a modern shell):
6823 .Bd -literal -offset indent
6824 $ printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
6827 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
6828 LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
6833 \*(NQ Removes the named files or directories.
6834 If a name refers to a mailbox, say a Maildir mailbox, then a mailbox
6835 type specific removal will be performed, deleting the complete mailbox.
6836 In interactive mode the user is asked for confirmation.
6839 \*(NQ Takes the name of an existing folder
6840 and the name for the new folder
6841 and renames the first to the second one.
6842 .Sx "Filename transformations"
6843 including shell pathname wildcard pattern expansions
6845 are performed on both arguments.
6846 Both folders must be of the same type.
6849 .It Ic Reply , Respond
6850 \*(CM(R) Identical to
6852 except that it replies to only the sender of each message of the given
6853 list, by using the first message as the template to quote, for the
6857 will exchange this command with
6861 .It Ic reply , respond
6862 \*(CM(r) Take a message (list) and group-respond (to each in turn)
6863 by addressing the sender and all recipients, subject to
6869 .Va followup-to-honour ,
6872 .Va recipients-in-cc
6873 influence response behaviour.
6876 .Va quote-as-attachment
6877 configure whether responded-to message shall be quoted etc.,
6878 .Va content-description-quote-attachment
6882 will exchange this command with
6886 offers special support for replying to mailing lists.
6887 For more documentation please refer to
6888 .Sx "On sending mail, and non-interactive mode" .
6890 This may generate the errors
6891 .Va ^ERR Ns -DESTADDRREQ
6892 if no receiver has been specified, or was rejected by
6896 if an I/O error occurs,
6898 if a necessary character set conversion fails, and
6901 It can also fail with errors of
6902 .Sx "Specifying messages" .
6903 Any error stops processing of further messages.
6908 but does not add any header lines.
6909 This is not a way to hide the sender's identity,
6910 but useful for sending a message again to the same recipients.
6913 Takes a list of messages and a name,
6914 and sends each message to the given addressee, which is subject to
6917 and related header fields are prepended to the new copy of the message.
6920 is only performed if
6923 \*(ID\*(CM is not entered, the only supported hooks are
6926 .Va on-resend-cleanup .
6928 This may generate the errors
6929 .Va ^ERR Ns -DESTADDRREQ
6930 if no receiver has been specified, or was rejected by
6934 if an I/O error occurs,
6936 if a necessary character set conversion fails, and
6939 It can also fail with errors of
6940 .Sx "Specifying messages" .
6941 Any error stops processing of further messages.
6944 (ret) Superseded by the multiplexer
6948 Only available inside of a
6952 this command returns control of execution to the outer scope.
6953 The two optional parameters are positive decimal numbers and default to 0:
6954 the first specifies the 32-bit return value (stored in
6956 \*(ID and later extended to 64-bit),
6957 the second the 32-bit error number (stored in
6961 a non-0 exit status may cause the program to exit.
6966 but saves the messages in a file named after the local part of the
6967 sender of the first message instead of taking a filename argument;
6969 is inspected to decide on the actual storage location.
6972 (s) Takes a message list and a filename and appends each message in turn
6973 to the end of the file.
6974 .Sx "Filename transformations"
6975 including shell pathname wildcard pattern expansions
6977 is performed on the filename.
6978 If no filename is given, the
6980 .Sx "secondary mailbox"
6983 The filename in quotes, followed by the generated character count
6984 is echoed on the user's terminal.
6987 .Sx "primary system mailbox"
6988 the messages are marked for deletion.
6989 To filter the saved header fields to the desired subset use the
6991 slot of the white- and blacklisting command
6996 \*(OB Superseded by the multiplexer
6999 \*(OB Superseded by the multiplexer
7002 \*(OB Superseded by the multiplexer
7006 Takes a message specification (list) and displays a header summary of
7007 all matching messages, as via
7009 This command is an alias of
7012 .Sx "Specifying messages" .
7015 Takes a message list and marks all messages as having been read.
7019 (se, \*(NQ uns) The latter command will delete all given global
7020 variables, or only block-scope local ones if the
7022 command modifier has been used.
7023 The former, when used without arguments, will show all
7024 currently known variables, being more verbose if either of
7029 Remarks: this list mode will not automatically link-in (known)
7031 variables, this only happens for explicit addressing, examples are
7033 using a variable in an
7035 condition or a string passed to
7039 ting, as well as some program-internal use cases (look-ups).
7041 Otherwise the given variables (and arguments) are set or adjusted.
7042 Arguments are of the form
7044 (no space before or after
7048 if there is no value, i.e., a boolean variable.
7049 If a name begins with
7053 the effect is the same as invoking the
7055 command with the remaining part of the variable
7056 .Pf ( Ql unset save ) .
7057 \*(ID In conjunction with the
7059 .Pf (or\0 Cm local )
7061 .Sx "Shell-style argument quoting"
7062 can be used to quote arguments as necessary.
7063 \*(ID Otherwise quotation marks may be placed around any part of the
7064 assignment statement to quote blanks or tabs.
7066 When operating in global scope any
7068 that is known to map to an environment variable will automatically cause
7069 updates in the program environment (unsetting a variable in the
7070 environment requires corresponding system support) \(em use the command
7072 for further environmental control.
7073 If the command modifier
7075 has been used to enforce local scoping then the given user variables
7076 will be garbage collected when the local scope is left;
7078 .Sx "INTERNAL VARIABLES" ,
7081 behaves the same as if
7083 would have been set (temporarily), which means that changes are
7084 inherited by deeper scopes.
7088 .Sx "INTERNAL VARIABLES"
7091 .Bd -literal -offset indent
7092 ? wysh set indentprefix=' -> '
7093 ? wysh set atab=$'\t' aspace=' ' zero=0
7097 Apply shell quoting rules to the given raw-data arguments.
7101 .Sx "Command modifiers" ) .
7102 The first argument specifies the operation:
7106 cause shell quoting to be applied to the remains of the line, and
7107 expanded away thereof, respectively.
7108 If the former is prefixed with a plus-sign, the quoted result will not
7109 be roundtrip enabled, and thus can be decoded only in the very same
7110 environment that was used to perform the encode; also see
7111 .Cd mle-quote-rndtrip .
7112 If the coding operation fails the error number
7115 .Va ^ERR Ns -CANCELED ,
7116 and the unmodified input is used as the result; the error number may
7117 change again due to output or result storage errors.
7120 \*(NQ (sh) Invokes an interactive version of the shell,
7121 and returns its exit status.
7124 .It Ic shortcut , unshortcut
7125 \*(NQ Manage the file- or pathname shortcuts as documented for
7127 The latter command deletes all shortcuts given as arguments,
7128 or all at once when given the asterisk
7130 The former shows the list of all currently defined shortcuts if used
7131 without arguments, the target of the given with a single argument.
7132 Otherwise arguments are treated as pairs of shortcuts and their desired
7133 expansion, creating new or updating already existing ones.
7136 \*(NQ Shift the positional parameter stack (starting at
7138 by the given number (which must be a positive decimal),
7139 or 1 if no argument has been given.
7140 It is an error if the value exceeds the number of positional parameters.
7141 If the given number is 0, no action is performed, successfully.
7142 The stack as such can be managed via
7144 Note this command will fail in
7146 and hook macros unless the positional parameter stack has been
7147 explicitly created in the current context via
7153 but performs neither MIME decoding nor decryption, so that the raw
7154 message text is shown.
7157 (si) Shows the size in characters of each message of the given
7161 \*(NQ Sleep for the specified number of seconds (and optionally
7162 milliseconds), by default interruptible.
7163 If a third argument is given the sleep will be uninterruptible,
7164 otherwise the error number
7168 if the sleep has been interrupted.
7169 The command will fail and the error number will be
7170 .Va ^ERR Ns -OVERFLOW
7171 if the given duration(s) overflow the time datatype, and
7173 if the given durations are no valid integers.
7176 .It Ic sort , unsort
7177 The latter command disables sorted or threaded mode, returns to normal
7178 message order and, if the
7181 displays a header summary.
7182 The former command shows the current sorting criterion when used without
7183 an argument, but creates a sorted representation of the current folder
7184 otherwise, and changes the
7186 command and the addressing modes such that they refer to messages in
7188 Message numbers are the same as in regular mode.
7192 a header summary in the new order is also displayed.
7193 Automatic folder sorting can be enabled by setting the
7196 .Ql set autosort=thread .
7197 Possible sorting criterions are:
7199 .Bl -tag -compact -width "subject"
7201 Sort the messages by their
7203 field, that is by the time they were sent.
7205 Sort messages by the value of their
7207 field, that is by the address of the sender.
7210 variable is set, the sender's real name (if any) is used.
7212 Sort the messages by their size.
7214 \*(OP Sort the message by their spam score, as has been classified by
7217 Sort the messages by their message status.
7219 Sort the messages by their subject.
7221 Create a threaded display.
7223 Sort messages by the value of their
7225 field, that is by the address of the recipient.
7228 variable is set, the recipient's real name (if any) is used.
7232 \*(NQ (so) The source command reads commands from the given file.
7233 .Sx "Filename transformations"
7235 If the given expanded argument ends with a vertical bar
7237 then the argument will instead be interpreted as a shell command and
7238 \*(UA will read the output generated by it.
7239 Dependent on the settings of
7243 and also dependent on whether the command modifier
7245 had been used, encountering errors will stop sourcing of the given input.
7248 cannot be used from within macros that execute as
7249 .Va folder-hook Ns s
7252 i.e., it can only be called from macros that were
7256 \*(NQ The difference to
7258 (beside not supporting pipe syntax aka shell command input) is that
7259 this command will not generate an error nor warn if the given file
7260 argument cannot be opened successfully.
7263 \*(OP Takes a list of messages and clears their
7268 \*(OP Takes a list of messages and causes the
7270 to forget it has ever used them to train its Bayesian filter.
7271 Unless otherwise noted the
7273 flag of the message is inspected to chose whether a message shall be
7280 \*(OP Takes a list of messages and informs the Bayesian filter of the
7284 This also clears the
7286 flag of the messages in question.
7289 \*(OP Takes a list of messages and rates them using the configured
7290 .Va spam-interface ,
7291 without modifying the messages, but setting their
7293 flag as appropriate; because the spam rating headers are lost the rate
7294 will be forgotten once the mailbox is left.
7295 Refer to the manual section
7297 for the complete picture of spam handling in \*(UA.
7300 \*(OP Takes a list of messages and sets their
7305 \*(OP Takes a list of messages and informs the Bayesian filter of the
7311 flag of the messages in question.
7320 \*(NQ TLS information and management command multiplexer to aid in
7321 .Sx "Encrypted network communication" ,
7322 mostly available only if the term
7328 if so documented (see
7329 .Sx "Command modifiers" ) .
7330 The result that is shown in case of errors is always the empty string,
7331 errors can be identified via the error number
7333 For example, string length overflows are caught and set
7336 .Va ^ERR Ns -OVERFLOW .
7337 The TLS configuration is honoured, especially
7339 .Bd -literal -offset indent
7340 ? vput tls result fingerprint pop3s://ex.am.ple
7341 ? echo $?/$!/$^ERRNAME: $result
7343 .Bl -hang -width ".It Cm random"
7345 Show the complete verified peer certificate chain.
7346 Includes informational fields in conjunction with
7349 Show only the peer certificate, without any signers.
7350 Includes informational fields in conjunction with
7354 .Va tls-fingerprint-digest Ns
7355 ed fingerprint of the certificate of the given HOST
7356 .Pf ( Ql server:port ,
7357 where the port defaults to the HTTPS port, 443).
7359 is actively ignored for the runtime of this command.
7368 slot for white- and blacklisting header fields.
7371 (to) Takes a message list and types out the first
7373 lines of each message on the user's terminal.
7374 Unless a special selection has been established for the
7378 command, the only header fields that are displayed are
7389 It is possible to apply compression to what is displayed by setting
7391 Messages are decrypted and converted to the terminal character set
7395 (tou) Takes a message list and marks the messages for saving in the
7397 .Sx "secondary mailbox"
7399 \*(UA deviates from the POSIX standard with this command,
7402 command will display the following message instead of the current one.
7407 but also displays header fields which would not pass the
7409 selection, and all visualizable parts of MIME
7410 .Ql multipart/alternative
7414 (t) Takes a message list and types out each message on the user's terminal.
7415 The display of message headers is selectable via
7417 For MIME multipart messages, all parts with a content type of
7419 all parts which have a registered MIME type handler (see
7420 .Sx "HTML mail and MIME attachments" )
7421 which produces plain text output, and all
7423 parts are shown, others are hidden except for their headers.
7424 Messages are decrypted and converted to the terminal character set
7428 can be used to display parts which are not displayable as plain text.
7460 \*(OB Superseded by the multiplexer
7463 \*(OB Superseded by the multiplexer
7467 Superseded by the multiplexer
7475 .It Ic unmlsubscribe
7484 Takes a message list and marks each message as not having been read.
7487 Superseded by the multiplexer
7490 \*(OB Superseded by the multiplexer
7493 \*(OB Superseded by the multiplexer
7510 Perform URL percent codec operations on the raw-data argument, rather
7511 according to RFC 3986.
7512 The first argument specifies the operation:
7516 perform plain URL percent en- and decoding, respectively.
7520 perform a slightly modified operation which should be better for
7521 pathnames: it does not allow a tilde
7523 and will neither accept hyphen-minus
7527 as an initial character.
7528 The remains of the line form the URL data which is to be converted.
7529 This is a character set agnostic operation,
7530 and it may thus decode bytes which are invalid in the current
7536 .Sx "Command modifiers" ) ,
7537 and manages the error number
7539 If the coding operation fails the error number
7542 .Va ^ERR Ns -CANCELED ,
7543 and the unmodified input is used as the result; the error number may
7544 change again due to output or result storage errors.
7545 \*(ID This command does not know about URLs beside what is documented.
7549 subcommand, shall the URL be displayed.)
7552 \*(NQ This command produces the same output as the listing mode of
7556 ity adjustments, but only for the given variables.
7559 \*(OP Takes a message list and verifies each message.
7560 If a message is not a S/MIME signed message,
7561 verification will fail for it.
7562 The verification process checks if the message was signed using a valid
7564 if the message sender's email address matches one of those contained
7565 within the certificate,
7566 and if the message content has been altered.
7573 of \*(UA, optionally in a more
7575 form which also includes the build and running system environment.
7576 This command supports
7579 .Sx "Command modifiers" ) .
7582 \*(NQ A multiplexer command which offers signed 64-bit numeric
7583 calculations, as well as other, mostly string-based operations.
7584 C-style byte string operations are available via
7586 The first argument defines the number, type, and meaning of the
7587 remaining arguments.
7588 An empty number argument is treated as 0.
7592 .Sx "Command modifiers" ) .
7593 The result shown in case of errors is
7595 for usage errors and numeric operations, the empty string otherwise;
7597 errors, like when a search operation failed, will also set the
7600 .Va ^ERR Ns -NODATA .
7601 Except when otherwise noted numeric arguments are parsed as signed 64-bit
7602 numbers, and errors will be reported in the error number
7604 as the numeric error
7605 .Va ^ERR Ns -RANGE .
7607 Numeric operations work on one or two signed 64-bit integers.
7608 Numbers prefixed with
7612 are interpreted as hexadecimal (base 16) numbers, whereas
7614 indicates octal (base 8), and
7618 denote binary (base 2) numbers.
7619 It is possible to use any base in between 2 and 36, inclusive, with the
7621 notation, where the base is given as an unsigned decimal number, so
7623 is a different way of specifying a hexadecimal number.
7624 Unsigned interpretation of a number can be enforced by prefixing an
7626 (case-insensitively), as in
7628 this is not necessary for power-of-two bases (2, 4, 8, 16 and 32),
7629 which will be interpreted as unsigned by default, but it still makes
7630 a difference regarding overflow detection and overflow constant.
7631 It is possible to enforce signed interpretation by (instead) prefixing a
7633 (case-insensitively).
7634 The number sign notation uses a permissive parse mode and as such
7635 supports complicated conditions out of the box:
7636 .Bd -literal -offset indent
7637 ? wysh set ifs=:;read i;unset ifs;echo $i;vexpr pb 2 10#$i
7643 One integer is expected by assignment (equals sign
7645 which does nothing but parsing the argument, thus detecting validity and
7646 possible overflow conditions, unary not (tilde
7648 which creates the bitwise complement, and unary plus and minus.
7649 Two integers are used by addition (plus sign
7651 subtraction (hyphen-minus
7653 multiplication (asterisk
7657 and modulo (percent sign
7659 as well as for the bitwise operators logical or (vertical bar
7662 bitwise and (ampersand
7665 bitwise xor (circumflex
7667 the bitwise signed left- and right shifts
7670 as well as for the unsigned right shift
7673 Another numeric operation is
7675 which takes a number base in between 2 and 36, inclusive, and will act
7676 on the second number given just the same as what equals sign
7678 does, but the number result will be formatted in the base given, as
7679 a signed 64-bit number unless unsigned interpretation of the input
7680 number had been forced (with an u prefix).
7682 Numeric operations support a saturated mode via the question mark
7684 modifier suffix; the keyword
7691 are therefore identical.
7692 In saturated mode overflow errors and division and modulo by zero are no
7693 longer reported via the exit status, but the result will linger at the
7694 minimum or maximum possible value, instead of overflowing (or trapping).
7695 This is true also for the argument parse step.
7696 For the bitwise shifts, the saturated maximum is 63.
7697 Any caught overflow will be reported via the error number
7700 .Va ^ERR Ns -OVERFLOW .
7701 .Bd -literal -offset indent
7702 ? vput vexpr res -? +1 -9223372036854775808
7703 ? echo $?/$!/$^ERRNAME:$res
7704 0/75/OVERFLOW:-9223372036854775808
7707 Character set agnostic string functions have no notion of locale
7708 settings and character sets.
7709 .Bl -hang -width ".It Cm random"
7711 Outputs the current date and time in UTC (Coordinated Universal Time)
7712 with values named such that
7713 .Ql vput vexpr x date-utc; eval wysh set $x
7714 creates accessible variables.
7715 .It Cm date-stamp-utc
7716 Outputs a RFC 3339 internet date/time format of UTC.
7718 The seconds and nanoseconds since the Unix epoch (1970-01-01T00:00:00)
7724 .Ql vput vexpr x epoch; eval wysh set $x
7725 creates accessible variables.
7728 .Sx "Filename transformations"
7730 .It Cm file-stat , file-lstat
7732 .Sx "Filename transformations"
7733 on the argument, then call
7737 respectively, and output values such that
7738 .Ql vput vexpr x file-stat FILE; eval wysh set $x
7739 creates accessible variables.
7744 to denote directories, commercial at
7746 for links, number sign
7748 for block devices, percent sign
7750 for for character devices, vertical bar
7752 for FIFOs, equal sign
7754 for sockets, and the period
7758 Generates a random string of the given length, or of
7760 bytes (a constant from
7762 if the value 0 is given; the random string will be base64url encoded
7763 according to RFC 4648, and thus be usable as a (portable) filename.
7766 String operations work, sufficient support provided, according to the
7767 active user's locale encoding and character set (see
7768 .Sx "Character sets" ) .
7769 Where the question mark
7771 modifier suffix is supported, a case-insensitive operation mode is
7772 available; the keyword
7778 are therefore identical.
7779 .Bl -hang -width ".It Cm regex"
7781 (One-way) Converts the argument to something safely printable on the
7784 \*(OP A string operation that will try to match the first argument with
7785 the regular expression given as the second argument.
7787 modifier suffix is supported.
7788 If the optional third argument has been given then instead of showing
7789 the match offset a replacement operation is performed: the third
7790 argument is treated as if specified within dollar-single-quote (see
7791 .Sx "Shell-style argument quoting" ) ,
7792 and any occurrence of a positional parameter, for example
7794 etc. is replaced with the according match group of the regular expression:
7795 .Bd -literal -offset indent
7796 ? vput vexpr res regex bananarama \e
7797 (.*)NanA(.*) '\e${1}au\e$2'
7798 ? echo $?/$!/$^ERRNAME:$res:
7800 ? vput vexpr res regex?case bananarama \e
7801 (.*)NanA(.*) '\e${1}uauf\e$2'
7802 ? echo $?/$!/$^ERRNAME:$res:
7803 0/0/NONE:bauauframa:
7808 \*(NQ Manage the positional parameter stack (see
7812 If the first argument is
7814 then the positional parameter stack of the current context, or the
7815 global one, if there is none, is cleared.
7818 then the remaining arguments will be used to (re)create the stack,
7819 if the parameter stack size limit is excessed an
7820 .Va ^ERR Ns -OVERFLOW
7823 If the first argument is
7825 a round-trip capable representation of the stack contents is created,
7826 with each quoted parameter separated from each other with the first
7829 and followed by the first character of
7831 if that is not empty and not identical to the first.
7832 If that results in no separation at all a
7838 .Sx "Command modifiers" ) .
7839 I.e., the subcommands
7843 can be used (in conjunction with
7845 to (re)create an argument stack from and to a single variable losslessly.
7846 .Bd -literal -offset indent
7847 ? vpospar set hey, "'you ", world!
7848 ? echo $#: <${1}><${2}><${3}>
7849 ? vput vpospar x quote
7851 ? echo $#: <${1}><${2}><${3}>
7852 ? eval vpospar set ${x}
7853 ? echo $#: <${1}><${2}><${3}>
7857 (v) Takes a message list and invokes the
7859 display editor on each message.
7860 Modified contents are discarded unless the
7862 variable is set, and are not used unless the mailbox can be written to
7863 and the editor returns a successful exit status.
7865 can be used instead for a less display oriented editor.
7868 (w) For conventional messages the body without all headers is written.
7869 The original message is never marked for deletion in the originating
7871 The output is decrypted and converted to its native format as necessary.
7872 If the output file exists, the text is appended.
7873 If a message is in MIME multipart format its first part is written to
7874 the specified file as for conventional messages, handling of the remains
7875 depends on the execution mode.
7876 No special handling of compressed files is performed.
7878 In interactive mode the user is consecutively asked for the filenames of
7879 the processed parts.
7880 For convenience saving of each part may be skipped by giving an empty
7881 value, the same result as writing it to
7883 Shell piping the part content by specifying a leading vertical bar
7885 character for the filename is supported.
7886 Other user input undergoes the usual
7887 .Sx "Filename transformations" ,
7888 including shell pathname wildcard pattern expansions
7890 and shell variable expansion for the message as such, not the individual
7891 parts, and contents of the destination file are overwritten if the file
7893 Character set conversion to
7895 is performed when saving text data.
7897 \*(ID In non-interactive mode any part which does not specify a filename
7898 is ignored, and suspicious parts of filenames of the remaining parts are
7899 URL percent encoded (as via
7901 to prevent injection of malicious character sequences, resulting in
7902 a filename that will be written into the current directory.
7903 Existing files will not be overwritten, instead the part number or
7904 a dot are appended after a number sign
7906 to the name until file creation succeeds (or fails due to other
7910 \*(NQ The sole difference to
7912 is that the new macro is executed in place of the current one, which
7913 will not regain control: all resources of the current macro will be
7915 This implies that any setting covered by
7917 will be forgotten and covered variables will become cleaned up.
7918 If this command is not used from within a
7920 ed macro it will silently be (a more expensive variant of)
7928 \*(NQ \*(UA presents message headers in
7930 fuls as described under the
7933 Without arguments this command scrolls to the next window of messages,
7934 likewise if the argument is
7938 scrolls to the last,
7940 scrolls to the first, and
7945 A number argument prefixed by
7949 indicates that the window is calculated in relation to the current
7950 position, and a number without a prefix specifies an absolute position.
7955 but scrolls to the next or previous window that contains at least one
7961 .Sh "COMMAND ESCAPES"
7962 Command escapes are available in
7964 during interactive usage, when explicitly requested via
7968 They perform special functions, like editing headers of the message
7969 being composed, calling normal
7971 yielding a shell, etc.
7972 Command escapes are only recognized at the beginning of lines, and
7973 consist of an escape followed by a command character.
7976 character is the tilde
7979 Unless otherwise documented command escapes ensure proper updates of
7986 controls whether a failed operation errors out message compose mode and
7987 causes program exit.
7988 Escapes may be prefixed by none to multiple single character command
7989 modifiers, interspersed whitespace is ignored:
7992 An effect equivalent to the command modifier
7994 can be achieved with hyphen-minus
8002 uates the remains of the line; also see
8003 .Sx "Shell-style argument quoting" .
8004 \*(ID For now the entire input line is evaluated as a whole; to avoid
8005 that control operators like semicolon
8007 are interpreted unintentionally, they must be quoted.
8010 Addition of the command line to the \*(OPal history can be prevented by
8011 placing whitespace directly after
8015 ings support a compose mode specific context.
8016 The following command escapes are supported:
8017 .Bl -tag -width ".It Ic BaNg"
8020 Insert the string of text in the message prefaced by a single
8022 (If the escape character has been changed,
8023 that character must be doubled instead.)
8025 .It Ic ~! Ar command
8026 Execute the indicated shell
8028 which follows, replacing unescaped exclamation marks with the previously
8029 executed command if the internal variable
8031 is set, then return to the message.
8034 End compose mode and send the message.
8036 .Va on-compose-splice-shell
8038 .Va on-compose-splice ,
8039 in order, will be called when set, after which, in interactive mode
8042 .Va askcc , askbcc )
8045 will be checked as well as
8048 .Va on-compose-leave
8049 hook will be called,
8053 will be joined in if set,
8055 .Va message-inject-tail
8056 will be incorporated, after which the compose mode is left.
8058 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
8059 Can be used to execute
8061 (which are allowed in compose mode).
8063 .It Ic ~< Ar filename
8067 .It Ic ~<! Ar command
8069 is executed using the shell.
8070 Its standard output is inserted into the message.
8073 \*(OP Write a summary of command escapes.
8075 .It Ic ~@ Op Ar filename...
8076 Append or edit the list of attachments.
8077 Does not manage the error number
8083 if error handling is necessary).
8084 The append mode expects a list of
8086 arguments as shell tokens (see
8087 .Sx "Shell-style argument quoting" ;
8088 token-separating commas are ignored, too), to be
8089 interpreted as documented for the command line option
8091 with the message number exception as below.
8095 arguments the attachment list is edited, entry by entry;
8096 if a filename is left empty, that attachment is deleted from the list;
8097 once the end of the list is reached either new attachments may be
8098 entered or the session can be quit by committing an empty
8101 In non-interactive mode or in batch mode
8103 the list of attachments is effectively not edited but instead recreated;
8104 again, an empty input ends list creation.
8106 For all modes, if a given filename solely consists of the number sign
8108 followed by either a valid message number of the currently active
8109 mailbox, or by a period
8111 referring to the current message of the active mailbox, the so-called
8113 then the given message is attached as a
8116 The number sign must be quoted to avoid misinterpretation as a shell
8119 .It Ic ~| Ar command
8120 Pipe the message text through the specified filter command.
8121 If the command gives no output or terminates abnormally,
8122 retain the original text of the message.
8125 is often used as a rejustifying filter.
8127 If the first character of the command is a vertical bar, then the entire
8128 message including header fields is subject to the filter command, so
8129 .Ql ~|| echo Fcc: /tmp/test; cat
8130 will prepend a file-carbon-copy message header.
8134 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
8135 Inspect and modify the message using the semantics of
8137 therefore arguments are evaluated according to
8138 .Sx "Shell-style argument quoting" .
8143 are not managed: errors are handled via the protocol,
8144 and hard errors like I/O failures cannot be handled.
8146 The protocol consists of command lines followed by (a) response line(s).
8147 The first field of the response line represents a status code
8148 which specifies whether a command was successful or not, whether result
8149 data is to be expected, and if, the format of the result data.
8150 Response data will be shell quoted as necessary for consumption by
8157 Error status code lines may optionally contain additional context:
8159 .Bl -tag -compact -width ".It Ql 210"
8161 Status ok; the remains of the line are the result.
8163 Status ok; the rest of the line is optionally used for more status.
8164 What follows are lines of result addresses, terminated by an empty line.
8165 All the input, including the empty line, must be consumed before further
8166 commands can be issued.
8167 Address lines consist of two token, first the plain network address, e.g.,
8169 followed by the (quoted) full address as known:
8170 .Ql '(Lovely) Bob <bob@exam.ple>' .
8171 Non-network addresses use the first field to indicate the type (hyphen-minus
8173 for files, vertical bar
8175 for pipes, and number sign
8177 for names which will undergo
8179 processing) instead, the actual value will be in the second field.
8181 Status ok; the rest of the line is optionally used for more status.
8182 What follows are lines of furtherly unspecified (quoted) string content,
8183 terminated by an empty line.
8184 All the input, including the empty line, must be consumed before further
8185 commands can be issued.
8187 Syntax error; invalid command.
8189 Syntax error or otherwise invalid parameters or arguments.
8191 Error: an argument fails verification.
8192 For example an invalid address has been specified (also see
8194 or an attempt was made to modify anything in \*(UA's own namespace,
8195 or a modifying subcommand has been used on a read-only message.
8197 Error: an otherwise valid argument is rendered invalid due to context.
8198 For example, a second address is added to a header which may consist of
8199 a single address only.
8202 If a command indicates failure then the message will have remained
8204 Most commands can fail with
8206 if required arguments are missing, or excessive arguments have been
8207 given (false command usage).
8208 (\*(ID The latter does not yet occur regularly, because as stated in
8209 .Sx "Shell-style argument quoting"
8210 our argument parser is not yet smart enough to work on subcommand base;
8211 for example one might get excess argument error for a three argument
8212 subcommand that receives four arguments, but not for a four argument
8213 subcommand which receives six arguments: here excess will be joined.)
8214 The following (case-insensitive) commands are supported:
8215 .Bl -hang -width ".It Cm version"
8217 This command allows listing, removal and addition of message attachments.
8218 The second argument specifies the subcommand to apply, one of:
8219 .Bl -hang -width ".It Cm remove"
8221 This uses the same search mechanism as described for
8223 and prints any known attributes of the first found attachment via
8227 if no such attachment can be found.
8228 The attributes are written as lines with a keyword and a value token.
8230 This uses the same search mechanism as described for
8232 and is otherwise identical to
8234 .It Cm attribute-set
8235 This uses the same search mechanism as described for
8237 and will set the attribute given as the fourth to the value given as
8238 the fifth token argument.
8239 If the value is an empty token, then the given attribute is removed,
8240 or reset to a default value if existence of the attribute is crucial.
8244 upon success, with the index of the found attachment following,
8246 for message attachments or if the given keyword is invalid, and
8248 if no such attachment can be found.
8249 The following keywords may be used (case-insensitively):
8251 .Bl -hang -compact -width ".It Ql filename"
8253 Sets the filename of the MIME part, i.e., the name that is used for
8254 display and when (suggesting a name for) saving (purposes).
8255 .It Ql content-description
8256 Associate some descriptive information to the attachment's content, used
8257 in favour of the plain filename by some MUAs.
8259 May be used for uniquely identifying MIME entities in several contexts;
8260 this expects a special reference address format as defined in RFC 2045
8263 upon address content verification failure.
8265 Defines the media type/subtype of the part, which is managed
8266 automatically, but can be overwritten.
8267 .It Ql content-disposition
8268 Automatically set to the string
8271 .It Cm attribute-set-at
8272 This uses the same search mechanism as described for
8274 and is otherwise identical to
8277 Adds the attachment given as the third argument, specified exactly as
8278 documented for the command line option
8280 and supporting the message number extension as documented for
8284 upon success, with the index of the new attachment following,
8286 if the given file cannot be opened,
8288 if an on-the-fly performed character set conversion fails, otherwise
8290 is reported; this is also reported if character set conversion is
8291 requested but not available.
8293 List all attachments via
8297 if no attachments exist.
8298 This command is the default command of
8300 if no second argument has been given.
8302 This will remove the attachment given as the third argument, and report
8306 if no such attachment can be found.
8307 If there exists any path component in the given argument, then an exact
8308 match of the path which has been used to create the attachment is used
8309 directly, but if only the basename of that path matches then all
8310 attachments are traversed to find an exact match first, and the removal
8311 occurs afterwards; if multiple basenames match, a
8314 Message attachments are treated as absolute pathnames.
8316 If no path component exists in the given argument, then all attachments
8317 will be searched for
8319 parameter matches as well as for matches of the basename of the path
8320 which has been used when the attachment has been created; multiple
8324 This will interpret the third argument as a number and remove the
8325 attachment at that list position (counting from one!), reporting
8329 if the argument is not a number or
8331 if no such attachment exists.
8334 This command allows listing, inspection, and editing of message headers.
8335 Header name case is not normalized, so that case-insensitive comparison
8336 should be used when matching names.
8337 The second argument specifies the subcommand to apply, one of:
8338 .Bl -hang -width ".It Cm remove"
8340 Create a new or an additional instance of the header given in the third
8341 argument, with the header body content as given in the fourth token.
8344 if the third argument specifies a free-form header field name that is
8345 invalid, or if body content extraction fails to succeed,
8347 if any extracted address does not pass syntax and/or security checks or
8348 on \*(UA namespace violations, and
8350 to indicate prevention of excessing a single-instance header \(em note that
8352 can be appended to (a space separator will be added automatically first).
8359 modifier to enforce treatment as a single addressee, for example
8360 .Ql header insert To?single: 'exa, <m@ple>' ;
8366 is returned upon success, followed by the name of the header and the list
8367 position of the newly inserted instance.
8368 The list position is always 1 for single-instance header fields.
8369 All free-form header fields are managed in a single list; also see
8372 Without a third argument a list of all yet existing headers is given via
8374 this command is the default command of
8376 if no second argument has been given.
8377 A third argument restricts output to the given header only, which may
8380 if no such field is defined.
8382 This will remove all instances of the header given as the third
8387 if no such header can be found, and
8389 on \*(UA namespace violations.
8391 This will remove from the header given as the third argument the
8392 instance at the list position (counting from one!) given with the fourth
8397 if the list position argument is not a number or on \*(UA namespace
8400 if no such header instance exists.
8402 Shows the content of the header given as the third argument.
8403 Dependent on the header type this may respond with
8407 any failure results in
8411 In compose-mode read-only access to optional pseudo headers in the \*(UA
8412 private namespace is available:
8414 .Bl -tag -compact -width ".It Va BaNg"
8415 .It Ql Mailx-Command:
8416 The name of the command that generates the message, one of
8423 This pseudo header always exists (in compose-mode).
8424 .It Ql Mailx-Raw-To:
8425 .It Ql Mailx-Raw-Cc:
8426 .It Ql Mailx-Raw-Bcc:
8427 Represent the frozen initial state of these headers before any
8431 .Va recipients-in-cc
8433 .It Ql Mailx-Orig-Sender:
8434 .It Ql Mailx-Orig-From:
8435 .It Ql Mailx-Orig-To:
8436 .It Ql Mailx-Orig-Cc:
8437 .It Ql Mailx-Orig-Bcc:
8438 The values of said headers of the original message which has been
8440 .Ic reply , forward , resend .
8441 The sender field is special as it is filled in with the sole sender
8442 according to RFC 5322 rules, it may thus be equal to the from field.
8445 Show an abstract of the above commands via
8448 This command will print the protocol version via
8454 .Ql Ic ~i Ns \| Va Sign .
8458 .Ql Ic ~i Ns \| Va sign .
8460 .It Ic ~b Ar name ...
8461 Add the given names to the list of blind carbon copy recipients.
8463 .It Ic ~c Ar name ...
8464 Add the given names to the list of carbon copy recipients.
8467 Read the file specified by the
8469 variable into the message.
8474 on the message collected so far, then return to compose mode.
8476 can be used for a more display oriented editor, and
8478 offers a pipe-based editing approach.
8480 .It Ic ~F Ar messages
8481 Read the named messages into the message being sent, including all
8482 message headers and MIME parts, and honouring
8485 .Va forward-inject-head
8487 .Va forward-inject-tail .
8488 If no messages are specified, read in the current message, the
8491 .It Ic ~f Ar messages
8492 Read the named messages into the message being sent.
8493 If no messages are specified, read in the current message, the
8495 Strips down the list of header fields according to the
8500 white- and blacklist selection of
8505 .Va forward-inject-head
8507 .Va forward-inject-tail .
8508 For MIME multipart messages,
8509 only the first displayable part is included.
8512 In interactive mode, edit the message header fields
8517 by typing each one in turn and allowing the user to edit the field.
8518 The default values for these fields originate from the
8523 In non-interactive mode this sets
8524 .Va ^ERR Ns -NOTTY .
8527 In interactive mode, edit the message header fields
8533 by typing each one in turn and allowing the user to edit the field.
8534 In non-interactive mode this sets
8535 .Va ^ERR Ns -NOTTY .
8537 .It Ic ~I Ar variable
8538 Insert the value of the specified variable into the message.
8539 The message remains unaltered if the variable is unset or empty.
8540 Any embedded character sequences
8542 horizontal tabulator and
8544 line feed are expanded in
8546 mode; otherwise the expansion should occur at
8548 time (\*(ID by using the command modifier
8551 .It Ic ~i Ar variable
8554 but appends a newline character.
8556 .It Ic ~M Ar messages
8557 Read the named messages into the message being sent,
8560 If no messages are specified, read the current message, the
8565 .Va forward-inject-head
8567 .Va forward-inject-tail .
8569 .It Ic ~m Ar messages
8570 Read the named messages into the message being sent,
8573 If no messages are specified, read the current message, the
8575 Strips down the list of header fields according to the
8577 white- and blacklist selection of
8582 .Va forward-inject-head
8584 .Va forward-inject-tail .
8585 For MIME multipart messages,
8586 only the first displayable part is included.
8589 Display the message collected so far,
8590 prefaced by the message header fields
8591 and followed by the attachment list, if any.
8594 Read in the given / current message(s) using the algorithm of
8596 (except that is implicitly assumed, even if not set), honouring
8600 Abort the message being sent,
8601 copying it to the file specified by the
8607 .It Ic ~R Ar filename
8610 but indent each line that has been read by
8613 .It Ic ~r Ar filename Op Ar HERE-delimiter
8614 Read the named file, object to
8615 .Sx "Filename transformations"
8616 excluding shell globs and variable expansions, into the message; if
8620 then standard input is used (for pasting, for example).
8621 Only in this latter mode
8623 may be given: if it is data will be read in until the given
8625 is seen on a line by itself, and encountering EOF is an error; the
8627 is a required argument in non-interactive mode; if it is single-quote
8628 quoted then the pasted content will not be expanded, \*(ID otherwise
8629 a future version of \*(UA may perform shell-style expansion on the content.
8632 Cause the named string to become the current subject field.
8633 Newline (NL) and carriage-return (CR) bytes are invalid and will be
8634 normalized to space (SP) characters.
8636 .It Ic ~t Ar name ...
8637 Add the given name(s) to the direct recipient list.
8639 .It Ic ~U Ar messages
8640 Read in the given / current message(s) excluding all headers, indented by
8645 .Va forward-inject-head
8647 .Va forward-inject-tail .
8649 .It Ic ~u Ar messages
8650 Read in the given / current message(s), excluding all headers.
8654 .Va forward-inject-head
8656 .Va forward-inject-tail .
8661 editor on the message collected so far, then return to compose mode.
8663 can be used for a less display oriented editor, and
8665 offers a pipe-based editing approach.
8667 .It Ic ~w Ar filename
8668 Write the message onto the named file, which is object to the usual
8669 .Sx "Filename transformations" .
8671 the message is appended to it.
8676 except that the message is not saved at all.
8678 .Sh "INTERNAL VARIABLES"
8679 Internal \*(UA variables are controlled via the
8683 commands; prefixing a variable name with the string
8687 has the same effect as using
8694 will give more insight on the given variable(s), and
8696 when called without arguments, will show a listing of all variables.
8697 Both commands support a more
8700 Some well-known variables will also become inherited from the
8703 implicitly, others can be imported explicitly with the command
8705 and henceforth share said properties.
8707 Two different kinds of internal variables exist, and both of which can
8709 There are boolean variables, which can only be in one of the two states
8713 and value variables with a(n optional) string value.
8714 For the latter proper quoting is necessary upon assignment time, the
8715 introduction of the section
8717 documents the supported quoting rules.
8718 .Bd -literal -offset indent
8719 ? wysh set one=val\e 1 two="val 2" \e
8720 three='val "3"' four=$'val \e'4\e''; \e
8721 varshow one two three four; \e
8722 unset one two three four
8725 Dependent upon the actual option string values may become interpreted as
8726 colour names, command specifications, normal text, etc.
8727 They may be treated as numbers, in which case decimal values are
8728 expected if so documented, but otherwise any numeric format and
8729 base that is valid and understood by the
8731 command may be used, too.
8733 There also exists a special kind of string value, the
8734 .Dq boolean string ,
8735 which must either be a decimal integer (in which case
8739 and any other value is true) or any of the (case-insensitive) strings
8745 for a false boolean and
8753 a special kind of boolean string is the
8755 it can optionally be prefixed with the (case-insensitive) term
8759 in interactive mode the user will be prompted, otherwise the actual
8762 Variable chains extend a plain
8767 .Ql variable-USER@HOST
8771 will be converted to all lowercase when looked up (but not when the
8772 variable is set or unset!), \*(OPally IDNA converted, and indeed means
8776 had been specified in the contextual Uniform Resource Locator URL, see
8777 .Sx "On URL syntax and credential lookup" .
8778 Even though this mechanism is based on URLs no URL percent encoding may
8779 be applied to neither of
8783 variable chains need to be specified using raw data;
8784 the mentioned section contains examples.
8785 Variables which support chains are explicitly documented as such, and
8786 \*(UA treats the base name of any such variable special, meaning that
8787 users should not create custom names like
8789 in order to avoid false classifications and treatment of such variables.
8790 .Ss "Initial settings"
8791 The standard POSIX 2008/Cor 2-2016 mandates the following initial
8797 .Pf no Va autoprint ,
8811 .Pf no Va ignoreeof ,
8813 .Pf no Va keepsave ,
8815 .Pf no Va outfolder ,
8823 .Pf no Va sendwait ,
8831 However, \*(UA has built-in some initial (and some default) settings
8832 which (may) diverge, others may become adjusted by one of the
8833 .Sx "Resource files" .
8834 Displaying the former is accomplished via
8836 .Ql $ \*(uA -:/ -v -Xset -Xx .
8837 In general this implementation sets (and has extended the meaning of)
8839 and does not support the
8841 variable \(en use command line options or
8843 to pass options through to a
8845 The default global resource file sets, among others, the variables
8850 establishes a default
8852 selection etc., and should thus be taken into account.
8854 .Bl -tag -width ".It Va BaNg"
8857 \*(RO The exit status of the last command, or the
8862 This status has a meaning in the state machine: in conjunction with
8864 any non-0 exit status will cause a program exit, and in
8866 mode any error while loading (any of the) resource files will have the
8870 .Sx "Command modifiers" ,
8871 can be used to instruct the state machine to ignore errors.
8874 \*(RO The current error number
8875 .Pf ( Xr errno 3 ) ,
8876 which is set after an error occurred; it is also available via
8878 and the error name and documentation string can be queried via
8882 \*(ID This machinery is new and the error number is only really usable
8883 if a command explicitly states that it manages the variable
8885 for others errno will be used in case of errors, or
8887 if that is 0: it thus may or may not reflect the real error.
8888 The error number may be set with the command
8892 \*(RO This is a multiplexer variable which performs dynamic expansion of
8893 the requested state or condition, of which there are:
8894 .Bl -tag -width ".It Va BaNg"
8898 .It Va ^ERR , ^ERRDOC , ^ERRNAME
8899 The number, documentation, and name of the current
8901 respectively, which is usually set after an error occurred.
8902 The documentation is an \*(OP, the name is used if not available.
8903 \*(ID This machinery is new and is usually reliable only if a command
8904 explicitly states that it manages the variable
8906 which is effectively identical to
8908 Each of those variables can be suffixed with a hyphen minus followed by
8909 a name or number, in which case the expansion refers to the given error.
8910 Note this is a direct mapping of (a subset of) the system error values:
8911 .Bd -literal -offset indent
8913 eval echo \e$1: \e$^ERR-$1:\e
8914 \e$^ERRNAME-$1: \e$^ERRDOC-$1
8915 vput vexpr i + "$1" 1
8924 .It Va ^ERRQUEUE-COUNT , ^ERRQUEUE-EXISTS
8925 The number of messages in the \*(OPal queue of
8927 and a string indicating queue state: empty or (translated)
8929 Always 0 and the empty string, respectively, unless
8936 \*(RO Expands all positional parameters (see
8938 separated by the first character of the value of
8940 \*(ID The special semantics of the equally named special parameter of the
8942 are not yet supported.
8945 \*(RO Expands all positional parameters (see
8947 separated by a space character.
8948 If placed in double quotation marks, each positional parameter is
8949 properly quoted to expand to a single parameter again.
8952 \*(RO Expands to the number of positional parameters, i.e., the size of
8953 the positional parameter stack in decimal.
8956 \*(RO Inside the scope of a
8960 ed macro this expands to the name of the calling macro, or to the empty
8961 string if the macro is running from top-level.
8962 For the \*(OPal regular expression search and replace operator of
8964 this expands to the entire matching expression.
8965 It represents the program name in global context.
8968 \*(RO Access of the positional parameter stack.
8969 All further parameters can be accessed with this syntax, too,
8972 etc.; positional parameters can be shifted off the stack by calling
8974 The parameter stack contains, for example, the arguments of a
8978 d macro, the matching groups of the \*(OPal regular expression search
8979 and replace expression of
8981 and can be explicitly created or overwritten with the command
8985 \*(RO Is set to the active
8988 .It Va add-file-recipients
8989 \*(BO When file or pipe recipients have been specified,
8990 mention them in the corresponding address fields of the message instead
8991 of silently stripping them from their recipient list.
8992 By default such addressees are not mentioned.
8995 \*(BO Causes only the local part to be evaluated
8996 when comparing addresses.
8999 \*(BO Causes messages saved in the
9001 .Sx "secondary mailbox"
9003 to be appended to the end rather than prepended.
9004 This should always be set.
9007 \*(BO Causes the prompts for
9011 lists to appear after the message has been edited.
9014 \*(BO If set, \*(UA asks an interactive user for files to attach at the
9015 end of each message; An empty line finalizes the list.
9018 \*(BO Causes the interactive user to be prompted for carbon copy
9019 recipients (at the end of each message if
9026 \*(BO Causes the interactive user to be prompted for blind carbon copy
9027 recipients (at the end of each message if
9034 \*(BO Causes the interactive user to be prompted for confirmation to
9035 send the message or reenter compose mode after having been shown
9036 a preliminary envelope summary.
9039 \*(BO\*(OP Causes the interactive user to be prompted if the message is
9040 to be signed at the end of each message.
9043 variable is ignored when this variable is set.
9046 \*(BO Causes \*(UA to prompt the interactive user for the subject upon
9047 entering compose mode unless a subject already exists.
9050 A sequence of characters to display in the
9054 as shown in the display of
9056 each for one type of messages (see
9057 .Sx "Message states" ) ,
9058 with the default being
9061 .Ql NU\ \ *HMFAT+\-$~
9064 variable is set, in the following order:
9066 .Bl -tag -compact -width ".It Ql _"
9088 \*(ID start of a (collapsed) thread in threaded mode (see
9092 \*(ID an uncollapsed thread in threaded mode; only used in conjunction with
9097 classified as possible spam.
9101 Specifies a list of recipients to which a blind carbon copy of each
9102 outgoing message will be sent automatically.
9105 Specifies a list of recipients to which a carbon copy of each outgoing
9106 message will be sent automatically.
9109 \*(BO Causes threads to be collapsed automatically when .Ql thread Ns
9112 mode is entered (see the
9117 \*(BO Enable automatic
9119 ing of a(n existing)
9125 commands: the message that becomes the new
9127 is shown automatically, as via
9133 Causes sorted mode (see the
9135 command) to be entered automatically with the value of this variable as
9136 sorting method when a folder is opened, for example
9137 .Ql set autosort=thread .
9140 \*(BO Enables the substitution of all not (reverse-solidus) escaped
9143 characters by the contents of the last executed command for the
9145 shell escape command and
9147 one of the compose mode
9148 .Sx "COMMAND ESCAPES" .
9149 If this variable is not set no reverse solidus stripping is performed.
9152 \*(OB Predecessor of
9153 .Va bind-inter-byte-timeout .
9154 \*(ID Setting this automatically sets the successor.
9156 .It Va bind-inter-byte-timeout
9157 \*(OP Terminals may generate multi-byte sequences for special function
9158 keys, for example, but these sequences may not become read as a unit.
9159 And multi-byte sequences can be defined freely via
9161 This variable specifies the timeout in milliseconds that the MLE (see
9162 .Sx "On terminal control and line editor" )
9163 waits for more bytes to arrive unless it considers a sequence
9165 The default is 200, the maximum is about 10 seconds.
9166 In the following example the comments state which sequences are
9167 affected by this timeout:
9168 .Bd -literal -offset indent
9169 ? bind base abc echo 0 # abc
9170 ? bind base ab,c echo 1 # ab
9171 ? bind base abc,d echo 2 # abc
9172 ? bind base ac,d echo 3 # ac
9173 ? bind base a,b,c echo 4
9174 ? bind base a,b,c,d echo 5
9175 ? bind base a,b,cc,dd echo 6 # cc and dd
9178 .It Va bind-inter-key-timeout
9181 sequences do not time out by default.
9182 If this variable is set, then the current key sequence is forcefully
9183 terminated once the timeout (in milliseconds) triggers.
9184 The value should be (maybe significantly) larger than
9185 .Va bind-inter-byte-timeout ,
9186 but may not excess the maximum, too.
9189 \*(BO Sets some cosmetical features to traditional BSD style;
9190 has the same affect as setting
9192 and all other variables prefixed with
9194 it also changes the behaviour of
9196 (which does not exist in BSD).
9199 \*(BO Changes the letters shown in the first column of a header
9200 summary to traditional BSD style.
9203 \*(BO Changes the display of columns in a header summary to traditional
9207 \*(BO Changes some informational messages to traditional BSD style.
9212 field to appear immediately after the
9214 field in message headers and with the
9216 .Sx "COMMAND ESCAPES" .
9221 .It Va build-cc , build-ld , build-os , build-rest
9222 \*(RO The build environment, including the compiler, the linker, the
9223 operating system \*(UA has been build for, usually taken from
9227 and then lowercased, as well as all the possibly interesting rest of the
9228 configuration and build environment.
9229 This information is also available in the
9231 output of the command
9235 The value that should appear in the
9239 MIME header fields when no character set conversion of the message data
9241 This defaults to US-ASCII, and the chosen character set should be
9242 US-ASCII compatible.
9245 \*(OP The default 8-bit character set that is used as an implicit last
9246 member of the variable
9248 This defaults to UTF-8 if character set conversion capabilities are
9249 available, and to ISO-8859-1 otherwise (unless the operating system
9250 environment is known to always and exclusively support UTF-8 locales),
9251 in which case the only supported character set is
9253 and this variable is effectively ignored.
9255 .It Va charset-unknown-8bit
9256 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
9258 the content of a mail message by using a character set with the name
9260 Because of the unclassified nature of this character set \*(UA will not
9261 be capable to convert this character set to any other character set.
9262 If this variable is set any message part which uses the character set
9264 is assumed to really be in the character set given in the value,
9265 otherwise the (final) value of
9267 is used for this purpose.
9269 This variable will also be taken into account if a MIME type (see
9270 .Sx "The mime.types files" )
9271 of a MIME message part that uses the
9273 character set is forcefully treated as text.
9276 The default value for the
9280 .It Va colour-disable
9281 \*(BO\*(OP Forcefully disable usage of colours.
9282 Also see the section
9283 .Sx "Coloured display" .
9286 \*(BO\*(OP Whether colour shall be used for output that is paged through
9288 Note that pagers may need special command line options, for example
9296 in order to support colours.
9297 Often doing manual adjustments is unnecessary since \*(UA may perform
9298 adjustments dependent on the value of the environment variable
9300 (see there for more).
9303 .It Va contact-mail , contact-web
9304 \*(RO Addresses for contact per email and web, respectively, for
9305 bug reports, suggestions, or anything else regarding \*(UA.
9306 The former can be used directly:
9307 .Ql \&? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
9312 .It Va content-description-forwarded-message , \
9313 content-description-quote-attachment , \
9314 content-description-smime-message , \
9315 content-description-smime-signature
9316 \*(OP(partially) Strings which will be placed in according
9317 .Ql Content-Description:
9318 headers if non-empty.
9319 They all have default values, for example
9320 .Ql Forwarded message .
9323 In a(n interactive) terminal session, then if this valued variable is
9324 set it will be used as a threshold to determine how many lines the given
9325 output has to span before it will be displayed via the configured
9329 can be forced by setting this to the value
9331 setting it without a value will deduce the current height of the
9332 terminal screen to compute the threshold (see
9337 \*(ID At the moment this uses the count of lines of the message in wire
9338 format, which, dependent on the
9340 of the message, is unrelated to the number of display lines.
9341 (The software is old and historically the relation was a given thing.)
9344 Define a set of custom headers to be injected into newly composed or
9346 A custom header consists of the field name followed by a colon
9348 and the field content body.
9349 Standard header field names cannot be overwritten by a custom header,
9350 with the exception of
9354 Different to the command line option
9356 the variable value is interpreted as a comma-separated list of custom
9357 headers: to include commas in header bodies they need to become escaped
9358 with reverse solidus
9360 Headers can be managed more freely in
9365 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2, Hdr2: Body2'
9368 Controls the appearance of the
9370 date and time format specification of the
9372 variable, that is used, for example, when viewing the summary of
9374 If unset, then the local receiving date is used and displayed
9375 unformatted, otherwise the message sending
9377 It is possible to assign a
9379 format string and control formatting, but embedding newlines via the
9381 format is not supported, and will result in display errors.
9383 .Ql %Y-%m-%d %H:%M ,
9385 .Va datefield-markout-older .
9387 .It Va datefield-markout-older
9388 Only used in conjunction with
9390 Can be used to create a visible distinction of messages dated more than
9391 a day in the future, or older than six months, a concept comparable to the
9393 option of the POSIX utility
9395 If set to the empty string, then the plain month, day and year of the
9397 will be displayed, but a
9399 format string to control formatting can be assigned.
9404 \*(BO (Almost) Enter a debug-only sandbox mode which generates many
9405 log messages, disables the actual delivery of messages, and also implies
9412 .It Va disposition-notification-send
9414 .Ql Disposition-Notification-To:
9415 header (RFC 3798) with the message.
9421 \*(BO When dot is set, a period
9423 on a line by itself during message input in (interactive or batch
9426 will be treated as end-of-message (in addition to the
9427 normal end-of-file condition).
9428 This behaviour is implied in
9433 .It Va dotlock-disable
9434 \*(BO\*(OP Disable creation of
9438 .It Va dotlock-ignore-error
9439 \*(OB\*(BO\*(OP Ignore failures when creating
9441 .Sx "dotlock files" .
9447 If this variable is set then the editor is started automatically when
9448 a message is composed in interactive mode.
9449 If the value starts with the letter
9451 then this acts as if
9455 .Pf (see\0 Sx "COMMAND ESCAPES" )
9459 variable is implied for this automatically spawned editor session.
9462 \*(BO When a message is edited while being composed,
9463 its header is included in the editable text.
9466 \*(BO When entering interactive mode \*(UA normally writes
9467 .Dq \&No mail for user
9468 and exits immediately if a mailbox is empty or does not exist.
9469 If this variable is set \*(UA starts even with an empty or non-existent
9470 mailbox (the latter behaviour furtherly depends upon
9475 \*(BO Let each command with a non-0 exit status, including every
9479 s a non-0 status, cause a program exit unless prefixed by
9482 .Sx "Command modifiers" ) .
9484 .Sx "COMMAND ESCAPES" ,
9485 but which use a different modifier for ignoring the error.
9486 Please refer to the variable
9488 for more on this topic.
9491 \*(OP Maximum number of entries in the
9496 The first character of this value defines the escape character for
9497 .Sx "COMMAND ESCAPES"
9499 .Sx "Compose mode" .
9500 The default value is the character tilde
9502 If set to the empty string, command escapes are disabled.
9505 If unset only user name and email address recipients are allowed
9506 .Sx "On sending mail, and non-interactive mode" .
9507 If set without value all possible recipient types will be accepted.
9508 A value is parsed as a comma-separated list of case-insensitive strings,
9509 and if that contains
9511 behaviour equals the former except when in interactive mode or if
9512 .Sx "COMMAND ESCAPES"
9517 in which case it equals the latter, allowing all address types.
9520 .Ql restrict,\:-all,\:+name,\:+addr ,
9521 so care for ordering issues must be taken.
9523 Recipient types can be added and removed with a plus sign
9527 prefix, respectively.
9528 By default invalid or disallowed types are filtered out and
9529 cause a warning, hard send errors need to be enforced by including
9537 header targets regardless of other settings,
9539 file targets (it includes
9542 command pipeline targets,
9544 user names still unexpanded after
9548 processing and thus left for expansion by the
9550 (invalid for the built-in SMTP one), and
9553 Targets are interpreted in the given order, so that
9554 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
9555 will cause hard errors for any non-network address recipient address
9556 unless running interactively or having been started with the option
9560 in the latter case(s) any type may be used.
9562 User name receivers addressing valid local users can be expanded to
9563 fully qualified network addresses (also see
9568 Historically invalid recipients were stripped off without causing
9569 errors, this can be changed by making
9571 an entry of the list (it really acts like
9572 .Ql failinvaddr,\:+addr ) .
9575 .Pf (really\0\: Ql domaincheck,\:+addr )
9576 compares address domain names against a whitelist and strips off
9578 for hard errors) addressees which fail this test; the domain name
9580 and the non-empty value of
9582 (the real hostname otherwise) are always whitelisted,
9583 .Va expandaddr-domaincheck
9584 can be set to extend this list.
9585 Finally some address providers (for example
9587 and all other command line recipients) will be evaluated as
9588 if specified within dollar-single-quotes (see
9589 .Sx "Shell-style argument quoting" )
9590 if the value list contains the string
9593 .It Va expandaddr-domaincheck
9594 Can be set to a comma-separated list of domain names which should be
9595 whitelisted for the evaluation of the
9599 IDNA encoding is not automatically performed,
9601 can be used to prepare the domain (of an address).
9604 Unless this variable is set additional
9606 (Mail-Transfer-Agent)
9607 arguments from the command line, as can be given after a
9609 separator, results in a program termination with failure status.
9610 The same can be accomplished by using the special (case-insensitive) value
9612 A lesser strict variant is the otherwise identical
9614 which does accept such arguments in interactive mode, or if tilde
9615 commands were enabled explicitly by using one of the command line options
9619 The empty value will allow unconditional usage.
9622 \*(RO String giving a list of optional features.
9623 Features are preceded with a plus sign
9625 if they are available, with a hyphen-minus
9628 To ease substring matching the string starts and ends with a comma.
9629 The output of the command
9631 includes this information in a more pleasant output.
9634 \*(BO This setting reverses the meanings of a set of reply commands,
9635 turning the lowercase variants, which by default address all recipients
9636 included in the header of a message
9637 .Pf ( Ic reply , respond , followup )
9638 into the uppercase variants, which by default address the sender only
9639 .Pf ( Ic Reply , Respond , Followup )
9643 The default path under which mailboxes are to be saved:
9644 filenames that begin with the plus sign
9646 will have the plus sign replaced with the value of this variable if set,
9647 otherwise the plus sign will remain unchanged when doing
9648 .Sx "Filename transformations" ;
9651 for more on this topic, and know about standard imposed implications of
9653 The value supports a subset of transformations itself, and if the
9654 non-empty value does not start with a solidus
9658 will be prefixed automatically.
9659 Once the actual value is evaluated first, the internal variable
9661 will be updated for caching purposes.
9663 .It Va folder-hook-FOLDER , Va folder-hook
9666 macro which will be called whenever a
9669 The macro will also be invoked when new mail arrives,
9670 but message lists for commands executed from the macro
9671 only include newly arrived messages then.
9673 are activated by default in a folder hook, causing the covered settings
9674 to be reverted once the folder is left again.
9676 The specialized form will override the generic one if
9678 matches the file that is opened.
9679 Unlike other folder specifications, the fully expanded name of a folder,
9680 without metacharacters, is used to avoid ambiguities.
9681 However, if the mailbox resides under
9685 specification is tried in addition, so that if
9689 (and thus relative to the user's home directory) then
9690 .Pa /home/usr1/mail/sent
9692 .Ql folder-hook-/home/usr1/mail/sent
9693 first, but then followed by
9694 .Ql folder-hook-+sent .
9696 .It Va folder-resolved
9697 \*(RO Set to the fully resolved path of
9699 once that evaluation has occurred; rather internal.
9702 \*(BO Controls whether a
9703 .Ql Mail-Followup-To:
9704 header is generated when sending messages to known mailing lists.
9705 The user as determined via
9707 (or, if that contains multiple addresses,
9709 will be placed in there if any list addressee is not a subscribed list.
9711 .Va followup-to-honour
9713 .Ic mlist , mlsubscribe , reply
9717 .It Va followup-to-add-cc
9718 \*(BO Controls whether the user will be added to the messages'
9720 list in addition to placing an entry in
9721 .Ql Mail-Followup-To:
9725 .It Va followup-to-honour
9727 .Ql Mail-Followup-To:
9728 header is honoured when group-replying to a message via
9735 if set without a value it defaults to
9740 .It Va forward-add-cc
9741 \*(BO Whether senders of messages forwarded via
9742 .Ic ~F , ~f , ~m , ~U
9745 shall be made members of the carbon copies
9749 .It Va forward-as-attachment
9750 \*(BO Original messages are normally sent as inline text with the
9753 and only the first part of a multipart message is included.
9754 With this setting enabled messages are sent as unmodified MIME
9756 attachments with all of their parts included.
9759 .It Va forward-inject-head , forward-inject-tail
9760 The strings to put before and after the text of a message with the
9762 command, respectively.
9763 The former defaults to
9764 .Ql -------- Original Message --------\en .
9765 Special format directives in these strings will be expanded if possible,
9766 and if so configured the output will be folded according to
9768 for more please refer to
9769 .Va quote-inject-head .
9770 Injections will not be performed by
9773 .Va forward-as-attachment
9775 .Sx "COMMAND ESCAPES"
9776 .Ic ~F , ~f , ~M , ~m , ~U , ~u
9780 The address (or a list of addresses) to put into the
9782 field of the message header, quoting RFC 5322:
9783 the author(s) of the message, that is, the mailbox(es) of the person(s)
9784 or system(s) responsible for the writing of the message.
9785 According to that RFC setting the
9787 variable is required if
9789 contains more than one address.
9790 \*(ID Please expect automatic management of the
9795 Dependent on the context these addresses are handled as if they were in
9799 If a file-based MTA is used, then
9801 (or, if that contains multiple addresses,
9803 can nonetheless be used as the envelope sender address at the MTA
9804 protocol level (the RFC 5321 reverse-path), either via the
9806 command line option (without argument; see there for more), or by setting
9807 .Va r-option-implicit .
9809 If the machine's hostname is not valid at the Internet (for example at
9810 a dialup machine), then either this variable or
9814 adds even more fine-tuning capabilities with
9816 have to be set: if so the message and MIME part related unique ID fields
9820 will be created (except when disallowed by
9821 .Va message-id-disable
9826 \*(BO Due to historical reasons comments and name parts of email
9827 addresses are removed by default when sending mail, replying to or
9828 forwarding a message.
9829 If this variable is set such stripping is not performed.
9831 \*(OB Predecessor of
9832 .Va forward-inject-head .
9835 \*(BO Causes the header summary to be written at startup and after
9836 commands that affect the number of messages or the order of messages in
9841 mode a header summary will also be displayed on folder changes.
9842 The command line option
9848 A format string to use for the summary of
9850 Format specifiers in the given string start with a percent sign
9852 and may be followed by an optional decimal number indicating the field
9853 width \(em if that is negative, the field is to be left-aligned.
9854 Names and addresses are subject to modifications according to
9858 Valid format specifiers are:
9860 .Bl -tag -compact -width ".It Ql _%%_"
9862 A plain percent sign.
9865 a space character but for the current message
9867 for which it expands to
9870 .Va headline-plain ) .
9873 a space character but for the current message
9875 for which it expands to
9878 .Va headline-plain ) .
9880 \*(OP The spam score of the message, as has been classified via the
9883 Shows only a replacement character if there is no spam support.
9885 Message attribute character (status flag); the actual content can be
9889 The date found in the
9891 header of the message when
9893 is set (the default), otherwise the date when the message was received.
9894 Formatting can be controlled by assigning a
9899 .Va datefield-markout-older ) .
9901 The indenting level in
9907 The address of the message sender.
9909 The message thread tree structure.
9910 (Note that this format does not support a field width, and honours
9911 .Va headline-plain . )
9913 Mailing list status: is the addressee of the message a known
9922 announces the presence of a RFC 2369
9924 header, which makes a message a valuable target of
9927 The number of lines of the message, if available.
9931 The number of octets (bytes) in the message, if available.
9933 Message subject (if any) in double quotes.
9935 Message subject (if any).
9937 The position in threaded/sorted order.
9939 The value 0 except in an IMAP mailbox,
9940 where it expands to the UID of the message.
9944 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
9946 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
9956 .It Va headline-bidi
9957 Bidirectional text requires special treatment when displaying headers,
9958 because numbers (in dates or for file sizes etc.) will not affect the
9959 current text direction, in effect resulting in ugly line layouts when
9960 arabic or other right-to-left text is to be displayed.
9961 On the other hand only a minority of terminals is capable to correctly
9962 handle direction changes, so that user interaction is necessary for
9964 Note that extended host system support is required nonetheless, e.g.,
9965 detection of the terminal character set is one precondition;
9966 and this feature only works in an Unicode (i.e., UTF-8) locale.
9968 In general setting this variable will cause \*(UA to encapsulate text
9969 fields that may occur when displaying
9971 (and some other fields, like dynamic expansions in
9973 with special Unicode control sequences;
9974 it is possible to fine-tune the terminal support level by assigning
9976 no value (or any value other than
9981 will make \*(UA assume that the terminal is capable to properly deal
9982 with Unicode version 6.3, in which case text is embedded in a pair of
9983 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
9985 In addition no space on the line is reserved for these characters.
9987 Weaker support is chosen by using the value
9989 (Unicode 6.3, but reserve the room of two spaces for writing the control
9990 sequences onto the line).
9995 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
9996 again reserves room for two spaces in addition.
9998 .It Va headline-plain
9999 \*(BO On Unicode (UTF-8) aware terminals enhanced graphical symbols are
10000 used by default for certain entries of
10002 If this variable is set only basic US-ASCII symbols will be used.
10004 .It Va history-file
10005 \*(OP The (expandable) location of a permanent
10007 file for the MLE line editor
10008 .Pf ( Sx "On terminal control and line editor" ) .
10012 .It Va history-gabby
10013 \*(OP Add more entries to the MLE
10015 as is normally done.
10016 A comma-separated list of case-insensitive strings can be used to
10017 fine-tune which gabby entries shall be allowed.
10020 erroneous commands will also be added.
10022 adds all optional entries, and is the fallback chattiness identifier of
10023 .Va on-history-addition .
10025 .It Va history-gabby-persist
10028 entries will not be saved in persistent storage unless this variable is set.
10029 The knowledge of whether a persistent entry was gabby is not lost.
10033 .It Va history-size
10034 \*(OP Setting this variable imposes a limit on the number of concurrent
10037 If set to the value 0 then no further history entries will be added,
10038 and loading and incorporation of the
10040 upon program startup can also be suppressed by doing this.
10041 Runtime changes will not be reflected before the
10043 is saved or loaded (again).
10046 \*(BO This setting controls whether messages are held in the system
10048 and it is set by default.
10051 Used instead of the value obtained from
10055 as the hostname when expanding local addresses, for example in
10058 .Sx "On sending mail, and non-interactive mode" ,
10059 for expansion of addresses that have a valid user-, but no domain
10060 name in angle brackets).
10063 or this variable is set the message and MIME part related unique ID fields
10067 will be created (except when disallowed by
10068 .Va message-id-disable
10071 If the \*(OPal IDNA support is available (see
10073 variable assignment is aborted when a necessary conversion fails.
10075 Setting it to the empty string will cause the normal hostname to be
10076 used, but nonetheless enables creation of said ID fields.
10077 \*(IN in conjunction with the built-in SMTP
10080 also influences the results:
10081 one should produce some test messages with the desired combination of
10088 .It Va idna-disable
10089 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
10090 names according to the rules of IDNA (internationalized domain names
10092 Since the IDNA code assumes that domain names are specified with the
10094 character set, an UTF-8 locale charset is required to represent all
10095 possible international domain names (before conversion, that is).
10098 The input field separator that is used (\*(ID by some functions) to
10099 determine where to split input data.
10101 .Bl -tag -compact -width ".It MMM"
10103 Unsetting is treated as assigning the default value,
10106 If set to the empty value, no field splitting will be performed.
10108 If set to a non-empty value, all whitespace characters are extracted
10109 and assigned to the variable
10113 .Bl -tag -compact -width ".It MMM"
10116 will be ignored at the beginning and end of input.
10117 Diverging from POSIX shells default whitespace is removed in addition,
10118 which is owed to the entirely different line content extraction rules.
10120 Each occurrence of a character of
10122 will cause field-splitting, any adjacent
10124 characters will be skipped.
10128 \*(RO Automatically deduced from the whitespace characters in
10132 \*(BO Ignore interrupt signals from the terminal while entering
10133 messages; instead echo them as
10135 characters and discard the current line.
10138 \*(BO Ignore end-of-file conditions
10139 .Pf ( Ql control-D )
10142 on message input and in interactive command input.
10143 If set an interactive command input session can only be left by
10144 explicitly using one of the commands
10148 and message input in compose mode can only be terminated by entering
10151 on a line by itself or by using the
10153 .Sx "COMMAND ESCAPES" ;
10154 Setting this implies the behaviour that
10161 If this is set to a non-empty string it will specify the user's
10163 .Sx "primary system mailbox" ,
10166 and the system-dependent default, and (thus) be used to replace
10169 .Sx "Filename transformations" ;
10172 for more on this topic.
10173 The value supports a subset of transformations itself.
10175 .It Va indentprefix
10180 .Sx "COMMAND ESCAPES"
10183 option for indenting messages,
10184 in place of the POSIX mandated default tabulator character
10190 \*(BO If set, an empty
10192 .Sx "primary system mailbox"
10193 file is not removed.
10194 Note that, in conjunction with
10196 mode any empty file will be removed unless this variable is set.
10197 This may improve the interoperability with other mail user agents
10198 when using a common folder directory, and prevents malicious users
10199 from creating fake mailboxes in a world-writable spool directory.
10200 \*(ID Only local regular (MBOX) files are covered, Maildir and other
10201 mailbox types will never be removed, even if empty.
10203 .It Va keep-content-length
10204 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
10205 be told to keep the
10206 .Ql Content-Length:
10209 header fields that some MUAs generate by setting this variable.
10210 Since \*(UA does neither use nor update these non-standardized header
10211 fields (which in itself shows one of their conceptual problems),
10212 stripping them should increase interoperability in between MUAs that
10213 work with with same mailbox files.
10214 Note that, if this is not set but
10215 .Va writebackedited ,
10216 as below, is, a possibly performed automatic stripping of these header
10217 fields already marks the message as being modified.
10218 \*(ID At some future time \*(UA will be capable to rewrite and apply an
10220 to modified messages, and then those fields will be stripped silently.
10223 \*(BO When a message is saved it is usually discarded from the
10224 originating folder when \*(UA is quit.
10225 This setting causes all saved message to be retained.
10227 .It Va line-editor-cpl-word-breaks
10228 \*(OP List of bytes which are used by the
10230 tabulator completion to decide where word boundaries exist, by default
10232 \*(ID This mechanism is yet restricted.
10234 .It Va line-editor-disable
10235 \*(BO Turn off any line editing capabilities (from \*(UAs POW, see
10236 .Sx "On terminal control and line editor"
10239 .It Va line-editor-no-defaults
10240 \*(BO\*(OP Do not establish any default key binding.
10243 Error log message prefix string
10244 .Pf ( Ql "\*(uA: " ) .
10246 .It Va mailbox-display
10247 \*(RO The name of the current mailbox
10248 .Pf ( Ic folder ) ,
10249 possibly abbreviated for display purposes.
10251 .It Va mailbox-resolved
10252 \*(RO The fully resolved path of the current mailbox.
10254 .It Va mailcap-disable
10255 \*(BO\*(OP Turn off consideration of MIME type handlers from,
10256 and implicit loading of
10257 .Sx "The Mailcap files" .
10259 .It Va mailx-extra-rc
10260 An additional startup file that is loaded as the last of the
10261 .Sx "Resource files" .
10262 Use this file for commands that are not understood by other POSIX
10264 implementations, i.e., mostly anything which is not covered by
10265 .Sx "Initial settings" .
10267 .It Va markanswered
10268 \*(BO When a message is replied to and this variable is set,
10269 it is marked as having been
10272 .Sx "Message states" .
10274 .It Va mbox-fcc-and-pcc
10275 \*(BO By default all file and pipe message receivers (see
10277 will be fed valid MBOX database entry message data (see
10279 .Va mbox-rfc4155 ) ,
10280 and existing file targets will become extended in compliance to RFC 4155.
10281 If this variable is unset then a plain standalone RFC 5322 message will
10282 be written, and existing file targets will be overwritten.
10284 .It Va mbox-rfc4155
10285 \*(BO When opening MBOX mailbox databases, and in order to achieve
10286 compatibility with old software, the very tolerant POSIX standard rules
10287 for detecting message boundaries (so-called
10289 lines) are used instead of the stricter rules from the standard RFC 4155.
10290 This behaviour can be switched by setting this variable.
10292 This may temporarily be handy when \*(UA complains about invalid
10294 lines when opening a MBOX: in this case setting this variable and
10295 re-opening the mailbox in question may correct the result.
10296 If so, copying the entire mailbox to some other file, as in
10297 .Ql copy * SOME-FILE ,
10298 will perform proper, all-compatible
10300 quoting for all detected messages, resulting in a valid MBOX mailbox.
10301 (\*(ID The better and non-destructive approach is to re-encode invalid
10302 messages, as if it would be created anew, instead of mangling the
10304 lines; this requires the structural code changes of the v15 rewrite.)
10305 Finally the variable can be unset again:
10306 .Bd -literal -offset indent
10308 localopts yes; wysh set mbox-rfc4155;\e
10309 wysh File "${1}"; copy * "${2}"
10311 call mboxfix /tmp/bad.mbox /tmp/good.mbox
10315 \*(BO Internal development variable.
10316 (Keeps memory debug enabled even if
10320 .It Va message-id-disable
10321 \*(BO By setting this variable the generation of
10325 message and MIME part headers can be completely suppressed, effectively
10326 leaving this task up to the
10328 (Mail-Transfer-Agent) or the SMTP server.
10329 Note that according to RFC 5321 a SMTP server is not required to add this
10330 field by itself, so it should be ensured that it accepts messages without
10333 .It Va message-inject-head
10334 A string to put at the beginning of each new message, followed by a newline.
10335 \*(OB The escape sequences tabulator
10339 are understood (use the
10343 ting the variable(s) instead).
10345 .It Va message-inject-tail
10346 A string to put at the end of each new message, followed by a newline.
10347 \*(OB The escape sequences tabulator
10351 are understood (use the
10355 ting the variable(s) instead).
10357 .Va on-compose-leave .
10360 \*(BO Usually, when an
10362 expansion contains the sender, the sender is removed from the expansion.
10363 Setting this option suppresses these removals.
10368 option to be passed through to the
10370 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
10371 this flag, no MTA is known which does not support it (for historical
10374 .It Va mime-allow-text-controls
10375 \*(BO When sending messages, each part of the message is MIME-inspected
10376 in order to classify the
10379 .Ql Content-Transfer-Encoding:
10381 .Va mime-encoding )
10382 that is required to send this part over mail transport, i.e.,
10383 a computation rather similar to what the
10385 command produces when used with the
10389 This classification however treats text files which are encoded in
10390 UTF-16 (seen for HTML files) and similar character sets as binary
10391 octet-streams, forcefully changing any
10396 .Ql application/octet-stream :
10397 If that actually happens a yet unset charset MIME parameter is set to
10399 effectively making it impossible for the receiving MUA to automatically
10400 interpret the contents of the part.
10402 If this variable is set, and the data was unambiguously identified as
10403 text data at first glance (by a
10407 file extension), then the original
10409 will not be overwritten.
10411 .It Va mime-alternative-favour-rich
10412 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
10413 HTML) will be preferred in favour of included plain text versions when
10414 displaying messages, provided that a handler exists which produces
10415 output that can be (re)integrated into \*(UA's normal visual display.
10417 .It Va mime-counter-evidence
10420 field is used to decide how to handle MIME parts.
10421 Some MUAs, however, do not use
10422 .Sx "The mime.types files"
10424 .Sx "HTML mail and MIME attachments" )
10425 or a similar mechanism to correctly classify content, but specify an
10426 unspecific MIME type
10427 .Pf ( Ql application/octet-stream )
10428 even for plain text attachments.
10429 If this variable is set then \*(UA will try to re-classify such MIME
10430 message parts, if possible, for example via a possibly existing
10431 attachment filename.
10432 A non-empty value may also be given, in which case a number is expected,
10433 actually a carrier of bits, best specified as a binary value, like
10436 .Bl -bullet -compact
10438 If bit two is set (counting from 1, decimal 2) then the detected
10440 will be carried along with the message and be used for deciding which
10441 MIME handler is to be used, for example;
10442 when displaying such a MIME part the part-info will indicate the
10443 overridden content-type by showing a plus sign
10446 If bit three is set (decimal 4) then the counter-evidence is always
10447 produced and a positive result will be used as the MIME type, even
10448 forcefully overriding the parts given MIME type.
10450 If bit four is set (decimal 8) as a last resort the actual content of
10451 .Ql application/octet-stream
10452 parts will be inspected, so that data which looks like plain text can be
10454 This mode is even more relaxed when data is to be displayed to the user
10455 or used as a message quote (data consumers which mangle data for display
10456 purposes, which includes masking of control characters, for example).
10459 .It Va mime-encoding
10461 .Ql Content-Transfer-Encoding
10462 to use in outgoing text messages and message parts, where applicable
10463 (7-bit clean text messages are without an encoding if possible):
10465 .Bl -tag -compact -width ".It Ql _%%_"
10467 .Pf (Or\0 Ql 8b . )
10468 8-bit transport effectively causes the raw data be passed through
10469 unchanged, but may cause problems when transferring mail messages over
10470 channels that are not ESMTP (RFC 1869) compliant.
10471 Also, several input data constructs are not allowed by the
10472 specifications and may cause a different transfer-encoding to be used.
10473 By established rules and popular demand occurrences of
10477 will be MBOXO quoted (prefixed with greater-than sign
10479 instead of causing a non-destructive encoding like
10480 .Ql quoted-printable
10481 to be chosen, unless context (like message signing) requires otherwise.
10482 .It Ql quoted-printable
10483 .Pf (Or\0 Ql qp . )
10484 Quoted-printable encoding is 7-bit clean and has the property that ASCII
10485 characters are passed through unchanged, so that an english message can
10486 be read as-is; it is also acceptable for other single-byte locales that
10487 share many characters with ASCII, for example ISO-8859-1.
10488 The encoding will cause a large overhead for messages in other character
10489 sets: for example it will require up to twelve (12) bytes to encode
10490 a single UTF-8 character of four (4) bytes.
10491 It is the default encoding.
10493 .Pf (Or\0 Ql b64 . )
10494 This encoding is 7-bit clean and will always be used for binary data.
10495 This encoding has a constant input:output ratio of 3:4, regardless of
10496 the character set of the input data it will encode three bytes of input
10497 to four bytes of output.
10498 This transfer-encoding is not human readable without performing
10502 .It Va mime-force-sendout
10503 \*(BO\*(OP Whenever it is not acceptable to fail sending out messages
10504 because of non-convertible character content this variable may be set.
10505 It will, as a last resort, classify the part content as
10506 .Ql application/octet-stream .
10507 Please refer to the section
10508 .Sx "Character sets"
10509 for the complete picture of character set conversion, and
10510 .Sx "HTML mail and MIME attachments"
10511 for how to internally or externally handle part content.
10513 .It Va mimetypes-load-control
10514 Can be used to control which of
10515 .Sx "The mime.types files"
10516 are loaded: if the letter
10518 is part of the option value, then the user's personal
10520 file will be loaded (if it exists); likewise the letter
10522 controls loading of the system wide
10524 directives found in the user file take precedence, letter matching is
10526 If this variable is not set \*(UA will try to load both files.
10527 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
10528 but they will be matched last (the order can be listed via
10531 More sources can be specified by using a different syntax: if the
10532 value string contains an equals sign
10534 then it is instead parsed as a comma-separated list of the described
10537 pairs; the given filenames will be expanded and loaded, and their
10538 content may use the extended syntax that is described in the section
10539 .Sx "The mime.types files" .
10540 Directives found in such files always take precedence (are prepended to
10541 the MIME type cache).
10544 Select an alternate Mail-Transfer-Agent by either specifying the full
10545 pathname of an executable (a
10547 prefix may be given), or \*(OPally a SMTP aka SUBMISSION protocol URL \*(IN:
10549 .Dl submissions://[user[:password]@]server[:port]
10552 .Ql [smtp://]server[:port] . )
10553 The default has been chosen at compile time.
10554 MTA data transfers are always performed in asynchronous child processes,
10555 and without supervision unless either the
10562 \*(OPally expansion of
10564 can be performed by setting
10567 For testing purposes there is the
10569 pseudo-MTA, which dumps to standard output or optionally to a file,
10571 .Va mbox-fcc-and-pcc :
10572 .Bd -literal -offset indent
10573 $ echo text | \*(uA -:/ -Smta=test -s ubject ex@am.ple
10574 $ </dev/null \*(uA -:/ -Smta=test://./xy ex@am.ple
10577 For a file-based MTA it may be necessary to set
10579 in in order to choose the right target of a modern
10582 It will be passed command line arguments from several possible sources:
10585 if set, from the command line if given and the variable
10588 Argument processing of the MTA will be terminated with a
10592 The otherwise occurring implicit usage of the following MTA command
10593 line arguments can be disabled by setting the boolean variable
10594 .Va mta-no-default-arguments
10595 (which will also disable passing
10599 (for not treating a line with only a dot
10601 character as the end of input),
10603 (shall the variable
10609 variable is set); in conjunction with the
10611 command line option or
10612 .Va r-option-implicit
10614 as well as possibly
10616 will (not) be passed.
10618 \*(OPally \*(UA can send mail over SMTP aka SUBMISSION network
10619 connections to a single defined smart host by setting this variable to
10620 a SMTP or SUBMISSION URL (see
10621 .Sx "On URL syntax and credential lookup" ) .
10622 An authentication scheme can be specified via the variable chain
10624 Encrypted network connections are \*(OPally available, the section
10625 .Sx "Encrypted network communication"
10626 should give an overview and provide links to more information on this.
10627 Note that with some mail providers it may be necessary to set the
10629 variable in order to use a specific combination of
10634 Network communication socket timeouts are configurable via
10635 .Va socket-connect-timeout .
10636 All generated network traffic may be proxied over a SOCKS
10638 it can be logged by setting
10641 The following SMTP variants may be used:
10644 The plain SMTP protocol (RFC 5321) that normally lives on the
10645 server port 25 and requires setting the
10646 .Va smtp-use-starttls
10647 variable to enter a TLS encrypted session state.
10648 Assign a value like \*(IN
10649 .Ql smtp://[user[:password]@]server[:port]
10651 .Ql smtp://server[:port] )
10652 to choose this protocol.
10654 The so-called SMTPS which is supposed to live on server port 465
10655 and is automatically TLS secured.
10656 Unfortunately it never became a standardized protocol and may thus not
10657 be supported by your hosts network service database
10658 \(en in fact the port number has already been reassigned to other
10661 SMTPS is nonetheless a commonly offered protocol and thus can be
10662 chosen by assigning a value like \*(IN
10663 .Ql smtps://[user[:password]@]server[:port]
10665 .Ql smtps://server[:port] ) ;
10666 due to the mentioned problems it is usually necessary to explicitly
10667 specify the port as
10671 The SUBMISSION protocol (RFC 6409) lives on server port 587 and
10672 is identically to the SMTP protocol from \*(UA's point of view;
10673 it requires setting
10674 .Va smtp-use-starttls
10675 to enter a TLS secured session state; e.g., \*(IN
10676 .Ql submission://[user[:password]@]server[:port] .
10678 The SUBMISSIONS protocol (RFC 8314) that lives on server port 465 and is
10679 TLS secured by default.
10680 It can be chosen by assigning a value like \*(IN
10681 .Ql submissions://[user[:password]@]server[:port] .
10682 Due to the problems mentioned for SMTPS above and the fact that
10683 SUBMISSIONS is new and a successor that lives on the same port as the
10684 historical engineering mismanagement named SMTPS, it is usually
10685 necessary to explicitly specify the port as
10690 \*(OP If set to a path pointing to a text file in valid MTA (Postfix)
10692 format, the file is loaded and cached (manageable with
10694 and henceforth plain
10698 message receiver names are recursively expanded as a last expansion
10699 step, after the distribution lists which can be created with
10703 content support: only local addresses (names) which are valid usernames
10704 .Pf ( Ql [a-z_][a-z0-9_-]*[$]? )
10705 are treated as expandable aliases, and \*(ID
10706 .Ql :include:/file/name
10707 directives are not supported.
10712 it can be asserted that only expanded names (mail addresses) are passed
10713 through to the MTA.
10715 .It Va mta-arguments
10716 Arguments to pass through to a file-based
10718 (Mail-Transfer-Agent), parsed according to
10719 .Sx "Shell-style argument quoting"
10720 into an array of arguments which will be joined onto MTA options
10721 from other sources, for example
10722 .Ql \&? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
10724 .It Va mta-no-default-arguments
10725 \*(BO Avoids passing standard command line options to a file-based
10727 (please see there).
10729 .It Va mta-no-receiver-arguments
10730 \*(BO By default all receiver addresses will be passed as command line
10731 options to a file-based
10733 Setting this variable disables this behaviour to aid those MTAs which
10734 employ special treatment of such arguments.
10735 Doing so can make it necessary to pass a
10738 .Va mta-arguments ,
10739 to testify the MTA that it should use the passed message as a template.
10742 Many systems use a so-called
10744 environment to ensure compatibility with
10746 This works by inspecting the name that was used to invoke the mail
10748 If this variable is set then the mailwrapper (the program that is
10749 actually executed when calling the file-based
10751 will treat its contents as that name.
10754 \*(BO In violation of RFC 5322 some MTAs do not remove
10756 header lines from transported messages after having noted the respective
10757 receivers for addressing purposes.
10758 (The MTAs Exim and Courier for example require the command line option
10760 to enforce removal.)
10761 Unless this is set corresponding receivers are addressed by
10762 protocol-specific means or MTA command line options only, the header
10763 itself is stripped before being sent over the wire.
10764 .Mx Va netrc-lookup
10765 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
10766 \*(BO\*(IN\*(OP Used to control usage of the user's
10768 file for lookup of account credentials, as documented in the section
10769 .Sx "On URL syntax and credential lookup"
10770 and for the command
10773 .Sx "The .netrc file"
10774 documents the file format.
10785 then \*(UA will read the output of a shell pipe instead of the user's
10787 file if this variable is set (to the desired shell command).
10788 This can be used to, for example, store
10791 .Ql \&? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
10794 \*(OP If this variable has the value
10796 newly created local folders will be in Maildir instead of MBOX format.
10799 Checks for new mail in the current folder each time the prompt is shown.
10800 A Maildir folder must be re-scanned to determine if new mail has arrived.
10801 If this variable is set to the special value
10803 then a Maildir folder will not be rescanned completely, but only
10804 timestamp changes are detected.
10805 Maildir folders are \*(OPal.
10808 \*(BO Causes a non-absolute filename specified in
10810 as well as the sender-based filenames of the
10816 commands to be interpreted relative to the
10818 directory rather than relative to the current directory.
10819 .Mx Va on-account-cleanup
10820 .It Va on-account-cleanup-ACCOUNT , Va on-account-cleanup
10821 Macro hook which will be called once an
10823 is left, as the very last step before unrolling per-account
10825 This hook is run even in case of fatal errors, including those generated
10826 by switching to the account as such, and it is advisable to perform only
10827 absolutely necessary actions, like cleaning up
10830 The specialized form is used in favour of the generic one if found.
10832 .It Va on-compose-cleanup
10833 Macro hook which will be called after the message has been sent (or not,
10834 in case of failures), as the very last step before unrolling compose mode
10836 This hook is run even in case of fatal errors, and it is advisable to
10837 perform only absolutely necessary actions, like cleaning up
10841 For compose mode hooks that may affect the message content please see
10842 .Va on-compose-enter , on-compose-leave , on-compose-splice .
10843 \*(ID This hook exists because
10844 .Ic alias , alternates , commandalias , shortcut ,
10845 to name a few, are neither covered by
10849 changes applied in compose mode will continue to be in effect thereafter.
10852 .It Va on-compose-enter , on-compose-leave
10853 Macro hooks which will be called once compose mode is entered,
10854 and after composing has been finished, respectively;
10855 the exact order of the steps taken is documented for
10858 .Sx "COMMAND ESCAPES" .
10859 Context about the message being worked on can be queried via
10862 are enabled for these hooks, and changes on variables will be forgotten
10863 after the message has been sent.
10864 .Va on-compose-cleanup
10865 can be used to perform other necessary cleanup steps.
10867 Here is an example that injects a signature via
10868 .Va message-inject-tail ;
10870 .Va on-compose-splice
10871 to simply inject the file of desire via
10875 may be a better approach.
10876 .Bd -literal -offset indent
10878 vput ! i cat ~/.mysig
10880 vput csop message-inject-tail trim-end $i
10884 readctl create ~/.mysig
10888 vput csop message-inject-tail trim-end $i
10890 readctl remove ~/.mysig
10893 set on-compose-leave=t_ocl
10897 .It Va on-compose-splice , on-compose-splice-shell
10898 These hooks run once the normal compose mode is finished, but before the
10899 .Va on-compose-leave
10900 macro hook is called etc.
10901 Both hooks will be executed in a subprocess, with their input and output
10902 connected to \*(UA such that they can act as if they would be an
10904 The difference in between them is that the latter is a
10906 command, whereas the former is a normal
10908 d macro, but which is restricted to a small set of commands (the
10910 output of for example
10912 will indicate said capability).
10914 are enabled for these hooks (in the parent process), causing any setting
10915 to be forgotten after the message has been sent;
10916 .Va on-compose-cleanup
10917 can be used to perform other cleanup as necessary.
10919 During execution of these hooks \*(UA will temporarily forget whether it
10920 has been started in interactive mode, (a restricted set of)
10921 .Sx "COMMAND ESCAPES"
10922 will always be available, and for guaranteed reproducibilities sake
10926 will be set to their defaults.
10927 The compose mode command
10929 has been especially designed for scriptability (via these hooks).
10930 The first line the hook will read on its standard input is the protocol
10931 version of said command escape, currently
10933 backward incompatible protocol changes have to be expected.
10935 Care must be taken to avoid deadlocks and other false control flow:
10936 if both involved processes wait for more input to happen at the
10937 same time, or one does not expect more input but the other is stuck
10938 waiting for consumption of its output, etc.
10939 There is no automatic synchronization of the hook: it will not be
10940 stopped automatically just because it, e.g., emits
10942 The hooks will however receive a termination signal if the parent enters
10943 an error condition.
10944 \*(ID Protection against and interaction with signals is not yet given;
10945 it is likely that in the future these scripts will be placed in an
10946 isolated session, which is signalled in its entirety as necessary.
10947 .Bd -literal -offset indent
10948 define ocs_signature {
10950 echo '~< ~/.mysig' # '~<! fortune pathtofortunefile'
10952 set on-compose-splice=ocs_signature
10954 wysh set on-compose-splice-shell=$'\e
10956 printf "hello $version! Headers: ";\e
10957 echo \e'~^header list\e';\e
10958 read status result;\e
10959 echo "status=$status result=$result";\e
10964 echo Splice protocol version is $version
10965 echo '~^h l'; read hl; vput csop es subs "${hl}" 0 1
10967 echoerr 'Cannot read header list'; echo '~x'; xit
10969 if "$hl" !%?case ' cc'
10970 echo '~^h i cc "Diet is your <mirr.or>"'; read es;\e
10971 vput csop es substring "${es}" 0 1
10973 echoerr 'Cannot insert Cc: header'; echo '~x'
10974 # (no xit, macro finishes anyway)
10978 set on-compose-splice=ocsm
10981 .It Va on-history-addition
10982 This hook will be called if an entry is about to be added to the
10984 of the MLE, as documented in
10985 .Sx "On terminal control and line editor" .
10986 It will be called with three arguments: the first is the name of the
10989 the second is either an empty string or the matching
10991 type, and the third being the complete command line to be added.
10992 The entry will not be added to history if the hook uses a non-0
10994 \*(ID A future version will give the expanded command name as the third
10995 argument, followed by the tokenized command line as parsed in the
10996 remaining arguments, the first of which is the original unexpanded
10997 command name; i.e., one may do
10998 .Ql Ic shift Ns \| 4
10999 and will then be able to access the positional parameters as usual via
11003 .It Va on-main-loop-tick
11004 This hook will be called whenever the program's main event loop is
11005 about to read the next input line.
11006 Note variable and other changes it performs are not scoped as via
11009 .It Va on-program-exit
11010 This hook will be called when the program exits, whether via
11014 or because the send mode is done.
11016 this runs late and so terminal settings etc. are already teared down.
11018 .It Va on-resend-cleanup
11020 .Va on-compose-cleanup ,
11021 but is only triggered by
11024 .It Va on-resend-enter
11026 .Va on-compose-enter ,
11027 but is only triggered by
11029 currently there is no
11031 support, for example.
11034 \*(BO If set, each message feed through the command given for
11036 is followed by a formfeed character
11039 .It Va password-USER@HOST , password-HOST , password
11040 \*(IN Variable chain that sets a password, which is used in case none has
11041 been given in the protocol and account-specific URL;
11042 as a last resort \*(UA will ask for a password on the user's terminal if
11043 the authentication method requires a password.
11044 Specifying passwords in a startup file is generally a security risk;
11045 the file should be readable by the invoking user only.
11046 .It Va password-USER@HOST
11047 \*(OU (see the chain above for \*(IN)
11048 Set the password for
11052 If no such variable is defined for a host,
11053 the user will be asked for a password on standard input.
11054 Specifying passwords in a startup file is generally a security risk;
11055 the file should be readable by the invoking user only.
11058 \*(BO Send messages to the
11060 command without performing MIME and character set conversions.
11062 .It Va pipe-EXTENSION
11064 .Va pipe-TYPE/SUBTYPE
11067 (normalized to lowercase using character mappings of the ASCII charset)
11068 denotes a file extension, for example
11070 Handlers registered using this method take precedence.
11072 .It Va pipe-TYPE/SUBTYPE
11073 A MIME message part identified as
11075 (case-insensitive, normalized to lowercase using character mappings of
11076 the ASCII charset) is displayed or quoted,
11077 its text is filtered through the value of this variable interpreted as
11079 Unless noted only parts displayable as inline plain text (see
11080 .Cd copiousoutput )
11081 are covered, other MIME parts will only be considered by and for
11084 The special value question mark
11086 forces interpretation of the message part as plain text, for example
11087 .Ql set pipe-application/xml=? .
11088 (This can also be achieved by adding a MIME type-marker via
11090 \*(OPally MIME type handlers may be defined via
11091 .Sx "The Mailcap files"
11092 to which should be referred to for documentation of flags like
11093 .Cd copiousoutput .
11094 Question mark is indeed a trigger character to indicate flags that
11095 adjust behaviour and usage of the rest of the value, the shell command,
11097 .Bd -literal -offset indent
11098 ? set pipe-X/Y='?!++=? vim ${MAILX_FILENAME_TEMPORARY}'
11101 .Bl -tag -compact -width ".It Ql __"
11103 The command output can be reintegrated into this MUA's normal processing:
11104 .Cd copiousoutput .
11105 Implied when using a plain
11108 Only use this handler for display, not for quoting a message:
11109 .Cd x-mailx-noquote .
11111 Run the command asynchronously, do not wait for the handler to exit:
11112 .Cd x-mailx-async .
11113 The standard output of the command will go to
11116 The command must be run on an interactive terminal, the terminal will
11117 temporarily be released for it to run:
11118 .Cd needsterminal .
11120 Request creation of a zero-sized temporary file, the absolute pathname
11121 of which will be made accessible via the environment variable
11122 .Ev MAILX_FILENAME_TEMPORARY :
11123 .Cd x-mailx-tmpfile .
11124 If given twice then the file will be unlinked automatically by \*(UA
11125 when the command loop is entered again at latest:
11126 .Cd x-mailx-tmpfile-unlink ;
11127 it is an error to use automatic deletion in conjunction with
11128 .Cd x-mailx-async .
11130 Normally the MIME part content is passed to the handler via standard
11131 input; with this the data will instead be written into
11132 .Ev MAILX_FILENAME_TEMPORARY
11133 .Pf ( Cd x-mailx-tmpfile-fill ) ,
11134 the creation of which is implied; in order to cause automatic deletion
11135 of the temporary file two plus signs
11137 still have to be used.
11139 Text type-marker: display this as normal plain text (for type-markers:
11140 .Sx "The mime.types files" ) .
11141 Identical to only giving plain
11144 .Cd copiousoutput .
11146 \*(OP HTML type-marker: display via built-in HTML-to-text filter.
11148 .Cd copiousoutput .
11150 To avoid ambiguities with normal shell command content another
11151 question mark can be used to forcefully terminate interpretation of
11152 remaining characters.
11153 (Any character not in this list will have the same effect.)
11156 Some information about the MIME part to be displayed is embedded into
11157 the environment of the shell command:
11159 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
11161 .It Ev MAILX_CONTENT
11162 The MIME content-type of the part, if known, the empty string otherwise.
11164 .It Ev MAILX_CONTENT_EVIDENCE
11166 .Va mime-counter-evidence
11167 includes the carry-around-bit (2), then this will be set to the detected
11168 MIME content-type; not only then identical to
11169 .Ev \&\&MAILX_CONTENT
11172 .It Ev MAILX_EXTERNAL_BODY_URL
11174 .Ql message/external-body access-type=url
11175 will store the access URL in this variable, it is empty otherwise.
11176 URL targets should not be activated automatically, without supervision.
11178 .It Ev MAILX_FILENAME
11179 The filename, if any is set, the empty string otherwise.
11181 .It Ev MAILX_FILENAME_GENERATED
11184 .It Ev MAILX_FILENAME_TEMPORARY
11185 If temporary file creation has been requested through the command prefix
11186 this variable will be set and contain the absolute pathname of the
11190 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
11191 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
11192 Supported are the default
11199 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" ) ,
11204 for TLS secured connections which pass a client certificate via
11205 .Va tls-config-pairs .
11206 There may be the \*(OPal method \*(IN
11209 does not need any user credentials,
11215 the remains also require a
11218 solely builds upon the credentials passed via a client certificate,
11219 and is usually the way to go since tested servers do not actually follow
11220 RFC 4422, and fail if additional credentials are actually passed.
11225 method will \*(OPally be replaced with APOP if possible (see there).
11226 .Mx Va pop3-bulk-load
11227 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
11228 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
11229 the messages, and only requests the message bodies on user request.
11230 For the POP3 protocol this means that the message headers will be
11232 If this variable is set then \*(UA will download only complete messages
11233 from the given POP3 server(s) instead.
11234 .Mx Va pop3-keepalive
11235 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
11236 \*(OP POP3 servers close the connection after a period of inactivity;
11237 the standard requires this to be at least 10 minutes,
11238 but practical experience may vary.
11239 Setting this variable to a numeric value greater than
11243 command to be sent each value seconds if no other operation is performed.
11244 .Mx Va pop3-no-apop
11245 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
11246 \*(BO\*(OP Unless this variable is set the MD5 based
11248 authentication method will be used instead of a chosen
11251 when connecting to a POP3 server that advertises support.
11254 is that only a single packet is sent for the user/password tuple.
11255 (Originally also that the password is not sent in clear text over the
11256 wire, but for one MD5 does not any longer offer sufficient security,
11257 and then today transport is almost ever TLS secured.)
11259 .Va pop3-no-apop-HOST
11261 .Mx Va pop3-use-starttls
11262 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
11263 \*(BO\*(OP Causes \*(UA to issue a
11265 command to make an unencrypted POP3 session TLS encrypted.
11266 This functionality is not supported by all servers,
11267 and is not used if the session is already encrypted by the POP3S method.
11269 .Va pop3-use-starttls-HOST
11273 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
11274 where that deviates from standardized behaviour.
11275 It is automatically squared with the environment variable
11276 .Ev POSIXLY_CORRECT ,
11277 changing the one will adjust the other.
11278 The following behaviour is covered and enforced by this mechanism:
11280 .Bl -bullet -compact
11282 In non-interactive mode, any error encountered while loading resource
11283 files during program startup will cause a program exit, whereas in
11284 interactive mode such errors will stop loading of the currently loaded
11285 (stack of) file(s, i.e., recursively).
11286 These exits can be circumvented on a per-command base by using
11289 .Sx "Command modifiers" ,
11290 for each command which shall be allowed to fail.
11293 will replace the list of alternate addresses instead of appending to it.
11294 In addition alternates will only be honoured for any sort of message
11298 The variable inserting
11299 .Sx "COMMAND ESCAPES"
11305 will expand embedded character sequences
11307 horizontal tabulator and
11310 \*(ID For compatibility reasons this step will always be performed.
11312 Reading in messages via
11314 .Pf ( Sx "COMMAND ESCAPES" )
11322 Upon changing the active
11326 will be displayed even if
11332 implies the behaviour described by
11337 is extended to cover any empty mailbox, not only empty
11339 .Sx "primary system mailbox" Ns
11340 es: they will be removed when they are left in empty state otherwise.
11342 Each command has an exit
11346 status that overwrites that of the last command.
11347 In POSIX mode the program exit status will signal failure regardless
11348 unless all messages were successfully sent out to the
11354 .It Va print-alternatives
11355 \*(BO When a MIME message part of type
11356 .Ql multipart/alternative
11357 is displayed and it contains a subpart of type
11359 other parts are normally discarded.
11360 Setting this variable causes all subparts to be displayed,
11361 just as if the surrounding part was of type
11362 .Ql multipart/mixed .
11365 The string used as a prompt in interactive mode.
11366 Whenever the variable is evaluated the value is treated as if specified
11367 within dollar-single-quotes (see
11368 .Sx "Shell-style argument quoting" ) .
11369 This (post-assignment, i.e., second) expansion can be used to embed
11370 status information, for example
11375 .Va mailbox-display .
11377 In order to embed characters which should not be counted when
11378 calculating the visual width of the resulting string, enclose the
11379 characters of interest in a pair of reverse solidus escaped brackets:
11381 a slot for coloured prompts is also available with the \*(OPal command
11383 Prompting may be prevented by setting this to the null string
11385 .Ql set noprompt ) .
11388 This string is used for secondary prompts, but is otherwise identical to
11394 \*(BO Suppresses the printing of the version when first invoked.
11397 If set messages processed by variants of
11401 will start with the original message, lines of which prefixed by
11403 taking into account
11407 No headers will be quoted when set without value or for
11414 selection will be included in the quote,
11416 embeds the (body) contents of all MIME parts, and
11418 also includes all headers.
11419 The quoted message will be enclosed by the expansions of
11420 .Va quote-inject-head
11422 .Va quote-inject-tail .
11425 .Va quote-as-attachment
11429 .Sx "COMMAND ESCAPES" .
11431 .It Va quote-add-cc
11432 \*(BO Whether senders of messages quoted via
11434 shall be made members of the carbon copies
11438 .It Va quote-as-attachment
11439 \*(BO Add the original message in its entirety as a
11441 MIME attachment when replying to a message.
11442 Note this works regardless of the setting of
11446 Can be set to a string consisting of non-whitespace ASCII characters
11447 which shall be treated as quotation leaders, the default being
11451 \*(OP Can be set in addition to
11453 and creates a more fancy quotation in that leading quotation characters
11454 .Pf ( Va quote-chars )
11455 are compressed and overlong lines are folded.
11457 can be set to either one, two or three (space separated) numeric values,
11458 which are interpreted as the maximum (goal) and the minimum line length,
11459 respectively, in a spirit rather equal to the
11461 program, but line- instead of paragraph-based.
11462 The third value is used as the maximum line length instead of the first
11463 if no better break point can be found; it is ignored unless it is larger
11464 than the minimum and smaller than the maximum.
11465 If not set explicitly the minimum will reflect the goal algorithmically.
11466 The goal cannot be smaller than the length of
11468 plus some additional pad; necessary adjustments take place silently.
11471 .It Va quote-inject-head , quote-inject-tail
11472 The strings to put before and after the text of a
11474 d message, if non-empty, and respectively.
11475 The former defaults to
11476 .Ql %f wrote:\en\en .
11477 Special format directives will be expanded if possible, and if so
11478 configured the output will be folded according to
11480 Format specifiers in the given strings start with a percent sign
11482 and expand values of the original message, unless noted otherwise.
11483 Note that names and addresses are not subject to the setting of
11485 Valid format specifiers are:
11487 .Bl -tag -compact -width ".It Ql _%%_"
11489 A plain percent sign.
11491 The address(es) of the sender(s).
11493 The date found in the
11495 header of the message when
11497 is set (the default), otherwise the date when the message was received.
11498 Formatting can be controlled by assigning a
11503 .Va datefield-markout-older ) .
11505 The full name(s) (name and address, as given) of the sender(s).
11510 The real name(s) of the sender(s) if there is one and
11512 allows usage, the address(es) otherwise.
11514 The senders real name(s) if there is one, the address(es) otherwise.
11517 .It Va r-option-implicit
11518 \*(BO Setting this option evaluates the contents of
11520 (or, if that contains multiple addresses,
11522 and passes the results onto the used (file-based) MTA as described for the
11524 option (empty argument case).
11526 .It Va recipients-in-cc
11533 as well as addressees which possibly came in via
11536 .Ql Mail-Followup-To:
11537 are by default merged into the new
11539 If this variable is set a sensitive algorithm tries to place in
11541 only the sender of the message being replied to, others are placed in
11545 Unless this variable is defined, no copies of outgoing mail will be saved.
11546 If defined it gives the pathname, subject to the usual
11547 .Sx "Filename transformations" ,
11548 of a folder where all new, replied-to or forwarded messages are saved:
11549 when saving to this folder fails the message is not sent, but instead
11553 The standard defines that relative (fully expanded) paths are to be
11554 interpreted relative to the current directory
11556 to force interpretation relative to
11559 needs to be set in addition.
11561 .It Va record-files
11562 \*(BO If this variable is set the meaning of
11564 will be extended to cover messages which target only file and pipe
11567 These address types will not appear in recipient lists unless
11568 .Va add-file-recipients
11571 .It Va record-resent
11572 \*(BO If this variable is set the meaning of
11574 will be extended to also cover the
11580 .It Va reply-in-same-charset
11581 \*(BO If this variable is set \*(UA first tries to use the same
11582 character set of the original message for replies.
11583 If this fails, the mechanism described in
11584 .Sx "Character sets"
11585 is evaluated as usual.
11587 .It Va reply-strings
11588 Can be set to a comma-separated list of (case-insensitive according to
11589 ASCII rules) strings which shall be recognized in addition to the
11590 built-in strings as
11592 reply message indicators \(en built-in are
11594 which is mandated by RFC 5322, as well as the german
11599 which often has been seen in the wild;
11600 I.e., the separating colon has to be specified explicitly.
11603 A list of addresses to put into the
11605 field of the message header.
11606 Members of this list are handled as if they were in the
11613 .It Va reply-to-honour
11616 header is honoured when replying to a message via
11623 if set without a value it defaults to
11626 .It Va reply-to-swap-in
11627 Standards like DKIM and (in conjunction with) DMARC caused many
11628 .Sx "Mailing lists"
11629 to use sender address rewriting in the style of
11630 .Ql Name via List <list@address> ,
11631 where the original sender address often being placed in
11633 If this is set and a
11635 exists, and consists of only one addressee (!), then that is used in
11636 place of the pretended sender.
11637 This works independently from
11638 .Va reply-to-honour .
11639 The optional value, a comma-separated list of strings, offers more
11640 fine-grained control on when swapping shall be used; for now supported is
11642 here swapping occurs if the sender is a mailing-list as defined by
11645 .It Va rfc822-body-from_
11646 \*(BO This variable can be used to force displaying a so-called
11648 line for messages that are embedded into an envelope mail via the
11650 MIME mechanism, for more visual convenience, also see
11654 \*(BO Enable saving of (partial) messages in
11656 upon interrupt or delivery error.
11659 The number of lines that represents a
11668 line display and scrolling via
11670 If this variable is not set \*(UA falls back to a calculation based upon
11671 the detected terminal window size and the baud rate: the faster the
11672 terminal, the more will be shown.
11673 Overall screen dimensions and pager usage is influenced by the
11674 environment variables
11681 .It Va searchheaders
11682 \*(BO Expand message list specifiers in the form
11684 to all messages containing the substring
11686 in the header field
11688 The string search is case insensitive.
11690 .It Va sendcharsets
11691 \*(OP A comma-separated list of character set names that can be used in
11692 outgoing internet mail.
11693 The value of the variable
11695 is automatically appended to this list of character sets.
11696 If no character set conversion capabilities are compiled into \*(UA then
11697 the only supported charset is
11700 .Va sendcharsets-else-ttycharset
11701 and refer to the section
11702 .Sx "Character sets"
11703 for the complete picture of character set conversion in \*(UA.
11705 .It Va sendcharsets-else-ttycharset
11706 \*(BO\*(OP If this variable is set, but
11708 is not, then \*(UA acts as if
11710 had been set to the value of the variable
11712 In effect this combination passes through the message data in the
11713 character set of the current locale encoding:
11714 therefore mail message text will be (assumed to be) in ISO-8859-1
11715 encoding when send from within a ISO-8859-1 locale, and in UTF-8
11716 encoding when send from within an UTF-8 locale.
11720 never comes into play as
11722 is implicitly assumed to be 8-bit and capable to represent all files the
11723 user may specify (as is the case when no character set conversion
11724 support is available in \*(UA and the only supported character set is
11727 .Sx "Character sets" ) .
11728 This might be a problem for scripts which use the suggested
11730 setting, since in this case the character set is US-ASCII by definition,
11731 so that it is better to also override
11733 then; and/or do something like the following in the resource file:
11734 .Bd -literal -offset indent
11735 # Avoid ASCII "propagates to 8-bit" when scripting
11736 \eif ! t && "$LC_ALL" != C && "$LC_CTYPE" != C
11737 \eset sendcharsets-else-ttycharset
11742 An address that is put into the
11744 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
11745 responsible for the actual transmission of the message.
11746 This field should normally not be used unless the
11748 field contains more than one address, on which case it is required.
11749 \*(ID Please expect automatic management of the
11754 Dependent on the context this address is handled as if it were in
11759 .Va r-option-implicit .
11761 \*(OB Predecessor of
11763 .It Va sendmail-arguments
11764 \*(OB Predecessor of
11765 .Va mta-arguments .
11766 .It Va sendmail-no-default-arguments
11767 \*(OB\*(BO Predecessor of
11768 .Va mta-no-default-arguments .
11769 .It Va sendmail-progname
11770 \*(OB Predecessor of
11774 Sending messages to the chosen
11776 or to command-pipe receivers (see
11777 .Sx "On sending mail, and non-interactive mode" )
11778 will be performed asynchronously.
11779 This means that only startup errors of the respective program will be
11780 recognizable, but no delivery errors.
11781 Also, no guarantees can be made as to when the respective program will
11782 actually run, as well as to when they will have produced output.
11784 If this variable is set then child program exit is waited for, and its
11785 exit status code is used to decide about success.
11786 Remarks: in conflict with the POSIX standard this variable is built-in
11787 to be initially set.
11788 Another difference is that it can have a value, which is interpreted as
11789 a comma-separated list of case-insensitive strings naming specific
11790 subsystems for which synchronousness shall be ensured (only).
11791 Possible values are
11797 for command-pipe receivers.
11800 \*(BO This setting causes \*(UA to start at the last message
11801 instead of the first one when opening a mail folder, as well as with
11807 \*(BO Causes \*(UA to use the sender's real name instead of the plain
11808 address in the header field summary and in message specifications.
11811 \*(BO Causes the recipient of the message to be shown in the header
11812 summary if the message was sent by the user.
11818 .Sx "COMMAND ESCAPES" .
11820 .Va message-inject-tail ,
11821 .Va on-compose-leave
11823 .Va on-compose-splice .
11829 .Sx "COMMAND ESCAPES" .
11831 .Va message-inject-tail ,
11832 .Va on-compose-leave
11834 .Va on-compose-splice .
11838 .Va on-compose-splice
11840 .Va on-compose-splice-shell
11842 .Va on-compose-leave
11844 .Va message-inject-tail
11847 .It Va skipemptybody
11848 \*(BO If an outgoing message has an empty first or only message part, do
11849 not send, but discard it, successfully (also see the command line option
11853 .It Va smime-ca-dir , smime-ca-file
11854 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
11855 Enhanced Mail) for the purpose of verification of S/MIME signed messages.
11857 documents the necessary preparation steps to use the former.
11858 The set of CA certificates which are built into the TLS library can
11859 be explicitly turned off by setting
11860 .Va smime-ca-no-defaults ,
11861 and further fine-tuning is possible via
11862 .Va smime-ca-flags .
11864 .It Va smime-ca-flags
11865 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
11866 storage, and the certificate verification that is used.
11867 The actual values and their meanings are documented for
11870 .It Va smime-ca-no-defaults
11871 \*(BO\*(OP Do not load the default CA locations that are built into the
11872 used to TLS library to verify S/MIME signed messages.
11873 .Mx Va smime-cipher
11874 .It Va smime-cipher-USER@HOST , smime-cipher
11875 \*(OP Specifies the cipher to use when generating S/MIME encrypted
11876 messages (for the specified account).
11877 RFC 5751 mandates a default of
11880 Possible values are (case-insensitive and) in decreasing cipher strength:
11888 (DES EDE3 CBC, 168 bits; default if
11890 is not available) and
11892 (DES CBC, 56 bits).
11894 The actually available cipher algorithms depend on the cryptographic
11895 library that \*(UA uses.
11896 \*(OP Support for more cipher algorithms may be available through
11897 dynamic loading via
11898 .Xr EVP_get_cipherbyname 3
11899 (OpenSSL) if \*(UA has been compiled to support this.
11901 .It Va smime-crl-dir
11902 \*(OP Specifies a directory that contains files with CRLs in PEM format
11903 to use when verifying S/MIME messages.
11905 .It Va smime-crl-file
11906 \*(OP Specifies a file that contains a CRL in PEM format to use when
11907 verifying S/MIME messages.
11909 .It Va smime-encrypt-USER@HOST
11910 \*(OP If this variable is set, messages send to the given receiver are
11911 encrypted before sending.
11912 The value of the variable must be set to the name of a file that
11913 contains a certificate in PEM format.
11915 If a message is sent to multiple recipients,
11916 each of them for whom a corresponding variable is set will receive an
11917 individually encrypted message;
11918 other recipients will continue to receive the message in plain text
11920 .Va smime-force-encryption
11922 It is recommended to sign encrypted messages, i.e., to also set the
11925 .Va content-description-smime-message
11926 will be inspected for messages which become encrypted.
11928 .It Va smime-force-encryption
11929 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
11932 \*(BO\*(OP S/MIME sign outgoing messages with the user's
11934 private key and include the users certificate as a MIME attachment.
11935 Signing a message enables a recipient to verify that the sender used
11936 a valid certificate,
11937 that the email addresses in the certificate match those in the message
11938 header and that the message content has not been altered.
11939 It does not change the message text,
11940 and people will be able to read the message as usual.
11941 .Va content-description-smime-signature
11944 .Va smime-sign-cert , smime-sign-include-certs
11946 .Va smime-sign-digest .
11947 .Mx Va smime-sign-cert
11948 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
11949 \*(OP Points to a file in PEM format.
11950 For the purpose of signing and decryption this file needs to contain the
11951 user's private key, followed by his certificate.
11953 For message signing
11955 is always derived from the value of
11957 (or, if that contains multiple addresses,
11959 For the purpose of encryption the recipients public encryption key
11960 (certificate) is expected; the command
11962 can be used to save certificates of signed messages (the section
11963 .Sx "Signed and encrypted messages with S/MIME"
11964 gives some details).
11965 This mode of operation is usually driven by the specialized form.
11967 When decrypting messages the account is derived from the recipient
11972 of the message, which are searched for addresses for which such
11974 \*(UA always uses the first address that matches,
11975 so if the same message is sent to more than one of the user addresses
11976 using different encryption keys, decryption might fail.
11978 Password-encrypted keys may be used for signing and decryption.
11979 Automated password lookup is possible via the
11981 .Ql USER@HOST.smime-cert-key
11982 for the private key, and
11983 .Ql USER@HOST.smime-cert-cert
11984 for the certificate stored in the same file.
11985 For example, the hypothetical address
11987 could be driven with a private key / certificate pair path defined in
11988 .Va \&\&smime-sign-cert-bob@exam.ple ,
11989 and the needed passwords would then be looked up as
11990 .Ql bob@exam.ple.smime-cert-key
11992 .Ql bob@exam.ple.smime-cert-cert .
11993 When decrypting the value of
11995 will be tried as a fallback to provide the necessary
11997 To include intermediate certificates, use
11998 .Va smime-sign-include-certs .
11999 The possible password sources are documented in
12000 .Sx "On URL syntax and credential lookup" .
12001 .Mx Va smime-sign-digest
12002 .It Va smime-sign-digest-USER@HOST , smime-sign-digest
12003 \*(OP Specifies the message digest to use when signing S/MIME messages.
12004 Please remember that for this use case
12006 refers to the variable
12008 (or, if that contains multiple addresses,
12010 The available algorithms depend on the used cryptographic library, but
12011 at least one usable built-in algorithm is ensured as a default.
12012 If possible the standard RFC 5751 will be violated by using
12014 instead of the mandated
12016 due to security concerns.
12017 This variable is ignored for very old (released before 2010)
12018 cryptographic libraries which do not offer the necessary interface:
12019 it will be logged if that happened.
12021 \*(UA will try to add built-in support for the following message
12022 digests, names are case-insensitive:
12029 as well as the widely available
12034 and the proposed insecure
12038 More digests may \*(OPally be available through dynamic loading via the
12040 .Xr EVP_get_digestbyname 3 .
12041 .Mx Va smime-sign-include-certs
12042 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
12043 \*(OP If used, this is supposed to a consist of a comma-separated list
12044 of files, each of which containing a single certificate in PEM format to
12045 be included in the S/MIME message in addition to the
12046 .Va smime-sign-cert
12048 This can be used to include intermediate certificates of the certificate
12049 authority, in order to allow the receiver's S/MIME implementation to
12050 perform a verification of the entire certificate chain, starting from
12051 a local root certificate, over the intermediate certificates, down to the
12052 .Va smime-sign-cert .
12053 Even though top level certificates may also be included in the chain,
12054 they will not be used for the verification on the receiver's side.
12056 For the purpose of the mechanisms involved here,
12058 refers to the content of the internal variable
12060 (or, if that contains multiple addresses,
12063 .Ql USER@HOST.smime-include-certs
12064 will be used for performing password lookups for these certificates,
12065 shall they have been given one, therefore the lookup can be automated
12066 via the mechanisms described in
12067 .Sx "On URL syntax and credential lookup" .
12068 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
12069 \*(OB\*(OP Predecessor(s) of
12070 .Va smime-sign-digest .
12072 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
12074 \*(ID For compatibility reasons a set
12076 is used in preference of
12079 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
12080 \*(OP Variable chain that controls the SMTP
12082 authentication method, possible values are
12093 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" )
12098 for TLS secured connections which pass a client certificate via
12099 .Va tls-config-pairs .
12100 There may be the \*(OPal methods
12107 do not need any user credentials,
12111 require a user name, and all other methods require a
12116 solely builds upon the credentials passed via a client certificate,
12117 and is usually the way to go since tested servers do not actually follow
12118 RFC 4422 aka RFC 4954, and fail if additional credentials are passed.
12125 .Va smtp-auth-password
12127 .Va smtp-auth-user .
12129 .Va smtp-auth-USER@HOST :
12130 may override dependent on sender address in the variable
12132 .It Va smtp-auth-password
12133 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
12134 If the authentication method requires a password, but neither
12135 .Va smtp-auth-password
12137 .Va smtp-auth-password-USER@HOST
12139 \*(UA will ask for a password on the user's terminal.
12140 .It Va smtp-auth-password-USER@HOST
12142 .Va smtp-auth-password
12143 for specific values of sender addresses, dependent upon the variable
12145 .It Va smtp-auth-user
12146 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
12147 If the authentication method requires a user name, but neither
12150 .Va smtp-auth-user-USER@HOST
12152 \*(UA will ask for a user name on the user's terminal.
12153 .It Va smtp-auth-user-USER@HOST
12156 for specific values of sender addresses, dependent upon the variable
12159 .It Va smtp-hostname
12160 \*(OP\*(IN Normally \*(UA uses the variable
12162 to derive the necessary
12164 information in order to issue a
12171 can be used to use the
12173 from the SMTP account
12181 if the empty string is given, or the local hostname as a last resort).
12182 This often allows using an address that is itself valid but hosted by
12183 a provider other than from which (in
12185 the message is sent.
12186 Setting this variable also influences generated
12191 If the \*(OPal IDNA support is available (see
12193 variable assignment is aborted when a necessary conversion fails.
12194 .Mx Va smtp-use-starttls
12195 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
12196 \*(BO\*(OP Causes \*(UA to issue a
12198 command to make an SMTP
12200 session TLS encrypted, i.e., to enable transport layer security.
12202 .It Va socket-connect-timeout
12203 \*(OP A positive number that defines the timeout to wait for
12204 establishing a socket connection before forcing
12205 .Va ^ERR Ns -TIMEDOUT .
12207 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
12208 \*(OP If set to the URL of a SOCKS5 server then all network activities
12209 are proxied through it, except for the single DNS name lookup necessary
12210 to resolve the proxy URL (unnecessary when given an already resolved IP
12212 It is automatically squared with the environment variable
12214 changing the one will adjust the other.
12215 This example creates a local SOCKS5 proxy on port 10000 that forwards to
12220 and from which actual network traffic happens:
12221 .Bd -literal -offset indent
12222 $ ssh -D 10000 USER@HOST
12223 $ \*(uA -Ssocks-proxy=[socks5://]localhost:10000
12224 # or =localhost:10000; no local DNS: =127.0.0.1:10000
12227 .It Va spam-interface
12228 \*(OP In order to use any of the spam-related commands (like
12230 the desired spam interface must be defined by setting this variable.
12231 Please refer to the manual section
12232 .Sx "Handling spam"
12233 for the complete picture of spam handling in \*(UA.
12234 All or none of the following interfaces may be available:
12235 .Bl -tag -width ".It Ql _ilte_"
12241 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
12243 Different to the generic filter interface \*(UA will automatically add
12244 the correct arguments for a given command and has the necessary
12245 knowledge to parse the program's output.
12246 A default value for
12248 will have been compiled into the \*(UA binary if
12252 during compilation.
12253 Shall it be necessary to define a specific connection type (rather than
12254 using a configuration file for that), the variable
12255 .Va spamc-arguments
12256 can be used as in for example
12257 .Ql -d server.example.com -p 783 .
12258 It is also possible to specify a per-user configuration via
12260 Note that this interface does not inspect the
12262 flag of a message for the command
12265 generic spam filter support via freely configurable hooks.
12266 This interface is meant for programs like
12268 and requires according behaviour in respect to the hooks' exit
12269 status for at least the command
12272 meaning a message is spam,
12276 for unsure and any other return value indicating a hard error);
12277 since the hooks can include shell code snippets diverting behaviour
12278 can be intercepted as necessary.
12280 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
12283 .Va spamfilter-spam ;
12285 .Sx "Handling spam"
12286 contains examples for some programs.
12287 The process environment of the hooks will have the variable
12288 .Ev MAILX_FILENAME_GENERATED
12290 Note that spam score support for
12292 is not supported unless the \*(OPtional regular expression support is
12294 .Va spamfilter-rate-scanscore
12298 .It Va spam-maxsize
12299 \*(OP Messages that exceed this size will not be passed through to the
12301 .Va spam-interface .
12302 If unset or 0, the default of 420000 bytes is used.
12304 .It Va spamc-command
12305 \*(OP The path to the
12309 .Va spam-interface .
12310 Note that the path is not expanded, but used
12312 A fallback path will have been compiled into the \*(UA binary if the
12313 executable had been found during compilation.
12315 .It Va spamc-arguments
12316 \*(OP Even though \*(UA deals with most arguments for the
12319 automatically, it may at least sometimes be desirable to specify
12320 connection-related ones via this variable, for example
12321 .Ql -d server.example.com -p 783 .
12324 \*(OP Specify a username for per-user configuration files for the
12326 .Va spam-interface .
12327 If this is set to the empty string then \*(UA will use the name of the
12335 .It Va spamfilter-ham , spamfilter-noham , \
12336 spamfilter-nospam , spamfilter-rate , spamfilter-spam
12337 \*(OP Command and argument hooks for the
12339 .Va spam-interface .
12341 .Sx "Handling spam"
12342 contains examples for some programs.
12344 .It Va spamfilter-rate-scanscore
12345 \*(OP Because of the generic nature of the
12348 spam scores are not supported for it by default, but if the \*(OPnal
12349 regular expression support is available then setting this variable can
12350 be used to overcome this restriction.
12351 It is interpreted as follows: first a number (digits) is parsed that
12352 must be followed by a semicolon
12354 and an extended regular expression.
12355 Then the latter is used to parse the first output line of the
12356 .Va spamfilter-rate
12357 hook, and, in case the evaluation is successful, the group that has been
12358 specified via the number is interpreted as a floating point scan score.
12359 .It Va ssl-ca-dir-USER@HOST , ssl-ca-dir-HOST , ssl-ca-dir ,\
12360 ssl-ca-file-USER@HOST , ssl-ca-file-HOST , ssl-ca-file
12361 \*(OB\*(OP Predecessors of
12364 .It Va ssl-ca-flags-USER@HOST , ssl-ca-flags-HOST , ssl-ca-flags
12365 \*(OB\*(OP Predecessor of
12367 .It Va ssl-ca-no-defaults-USER@HOST , ssl-ca-no-defaults-HOST ,\
12369 \*(OB\*(BO\*(OP Predecessor of
12370 .Va tls-ca-no-defaults .
12371 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
12372 \*(OB\*(OP Please use the
12375 .Va tls-config-pairs .
12376 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
12377 \*(OB\*(OP Please use the
12380 .Va tls-config-pairs .
12381 .It Va ssl-config-file
12382 \*(OB\*(OP Predecessor of
12383 .Va tls-config-file .
12384 .It Va ssl-config-module-USER@HOST , ssl-config-module-HOST ,\
12386 \*(OB\*(OP Predecessor of
12387 .Va tls-config-module .
12388 .It Va ssl-config-pairs-USER@HOST , ssl-config-pairs-HOST , ssl-config-pairs
12389 \*(OB\*(OP Predecessor of
12390 .Va tls-config-pairs .
12391 .It Va ssl-crl-dir , ssl-crl-file
12392 \*(OB\*(OP Predecessors of
12395 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
12396 \*(OB\*(OP Please use the
12399 .Va tls-config-pairs .
12400 .It Va ssl-features
12401 \*(OB\*(OP\*(RO Predecessor of
12403 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
12404 \*(OB\*(OP Please use the
12407 .Va tls-config-pairs .
12408 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
12409 \*(OB\*(OP Please use the
12412 .Va tls-config-pairs .
12413 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
12414 \*(OB\*(OP Please use the
12417 .Va tls-config-pairs .
12418 .It Va ssl-rand-file
12419 \*(OB\*(OP Predecessor of
12420 .Va tls-rand-file .
12421 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
12422 \*(OB\*(OP Predecessor of
12426 If only set without an assigned value, then this setting inhibits the
12432 header fields that include obvious references to \*(UA.
12433 There are two pitfalls associated with this:
12434 First, the message id of outgoing messages is not known anymore.
12435 Second, an expert may still use the remaining information in the header
12436 to track down the originating mail user agent.
12437 If set to the value
12443 suppression does not occur.
12445 .It Va system-mailrc
12446 \*(RO The compiled in path of the system wide initialization file
12448 .Sx "Resource files" :
12452 (\*(OP) This specifies a comma-separated list of
12457 .Sx "On terminal control and line editor" ,
12458 escape commas with reverse solidus
12460 to be used to overwrite or define entries.
12462 this variable will only be queried once at program startup and can
12463 thus only be specified in resource files or on the command line.
12464 It will always be inspected, regardless of whether
12466 denotes termcap/terminfo library support via
12469 String capabilities form
12471 pairs and are expected unless noted otherwise.
12472 Numerics have to be notated as
12474 where the number is expected in normal decimal notation.
12475 Finally, booleans do not have any value but indicate a true or false
12476 state simply by being defined or not; this indeed means that \*(UA
12477 does not support undefining an existing boolean.
12478 String capability values will undergo some expansions before use:
12479 for one notations like
12482 .Ql control-LETTER ,
12483 and for clarification purposes
12485 can be used to specify
12487 (the control notation
12489 could lead to misreadings when a left bracket follows, which it does for
12490 the standard CSI sequence);
12491 finally three letter octal sequences, as in
12494 To specify that a terminal supports 256-colours, and to define sequences
12495 that home the cursor and produce an audible bell, one might write:
12496 .Bd -literal -offset indent
12497 ? set termcap='Co#256,home=\eE[H,bel=^G'
12500 The following terminal capabilities are or may be meaningful for the
12501 operation of the built-in line editor or \*(UA in general:
12503 .Bl -tag -compact -width ".It Cd yay"
12505 .Cd auto_right_margin :
12506 boolean which indicates if the right margin needs special treatment; the
12508 capability is related, for more see
12510 This capability is only used when backed by library support.
12511 .It Cd clear Ns \0or Cd cl
12513 clear the screen and home cursor.
12514 (Will be simulated via
12518 .It Cd colors Ns \0or Cd Co
12520 numeric capability specifying the maximum number of colours.
12521 Note that \*(UA does not actually care about the terminal beside that,
12522 but always emits ANSI / ISO 6429 escape sequences; also see
12525 .Cd carriage_return :
12526 move to the first column in the current row.
12527 The default built-in fallback is
12529 .It Cd cub1 Ns \0or Cd le
12531 move the cursor left one space (non-destructively).
12532 The default built-in fallback is
12534 .It Cd cuf1 Ns \0or Cd nd
12536 move the cursor right one space (non-destructively).
12537 The default built-in fallback is
12539 which is used by most terminals.
12544 .It Cd ed Ns \0or Cd cd
12547 .It Cd el Ns \0or Cd ce
12549 clear to the end of line.
12550 (Will be simulated via
12552 plus repetitions of space characters.)
12553 .It Cd home Ns \0or Cd ho
12556 .It Cd hpa Ns \0or Cd ch
12557 .Cd column_address :
12558 move the cursor (to the given column parameter) in the current row.
12559 (Will be simulated via
12563 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
12566 .Cd enter_ca_mode ,
12567 respectively: exit and enter the alternative screen ca-mode,
12568 effectively turning \*(UA into a fullscreen application.
12569 This must be enabled explicitly by setting
12570 .Va termcap-ca-mode .
12571 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
12575 respectively: enable and disable the keypad.
12576 This is always enabled if available, because it seems even keyboards
12577 without keypads generate other key codes for, e.g., cursor keys in that
12578 case, and only if enabled we see the codes that we are interested in.
12579 .It Cd xenl Ns \0or Cd xn
12580 .Cd eat_newline_glitch :
12581 boolean which indicates whether a newline written in the last column of an
12582 .Cd auto_right_margin
12583 indicating terminal is ignored.
12584 With it the full terminal width is available even on autowrap terminals.
12585 This will be inspected even without
12590 Many more capabilities which describe key-sequences are documented for
12593 .It Va termcap-ca-mode
12594 \*(OP Allow usage of the
12599 abilities in order to enter an alternative exclusive screen, the
12600 so-called ca-mode; this usually requires special configuration of the
12602 also dependent on the value of
12605 this variable will only be queried once at program startup and can
12606 thus only be specified in resource files or on the command line.
12608 .It Va termcap-disable
12609 \*(OP Disable any interaction with a terminal control library.
12610 If set only some generic fallback built-ins and possibly the content of
12612 describe the terminal to \*(UA.
12614 this variable will only be queried once at program startup and can
12615 thus only be specified in resource files or on the command line.
12618 .It Va tls-ca-dir-USER@HOST , tls-ca-dir-HOST , tls-ca-dir ,\
12619 tls-ca-file-USER@HOST , tls-ca-file-HOST , tls-ca-file
12620 \*(OP Directory and file, respectively, for pools of trusted CA
12621 certificates in PEM (Privacy Enhanced Mail) format, for the purpose of
12622 verification of TLS server certificates.
12623 Concurrent use is possible, the file is loaded once needed first, the
12624 directory lookup is performed anew as a last resort whenever necessary.
12625 The CA certificate pool built into the TLS library can be disabled via
12626 .Va tls-ca-no-defaults ,
12627 further fine-tuning is possible via
12629 The directory search requires special filename conventions, please see
12630 .Xr SSL_CTX_load_verify_locations 3
12635 .Mx Va tls-ca-flags
12636 .It Va tls-ca-flags-USER@HOST , tls-ca-flags-HOST , tls-ca-flags
12637 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
12638 storage, and the certificate verification that is used (also see
12640 The value is expected to consist of a comma-separated list of
12641 configuration directives, with any intervening whitespace being ignored.
12642 The directives directly map to flags that can be passed to
12643 .Xr X509_STORE_set_flags 3 ,
12644 which are usually defined in a file
12645 .Pa openssl/x509_vfy.h ,
12646 and the availability of which depends on the used TLS library
12647 version: a directive without mapping is ignored (error log subject to
12649 Directives currently understood (case-insensitively) include:
12651 .Bl -tag -compact -width ".It Cd BaNg"
12652 .It Cd no-alt-chains
12653 If the initial chain is not trusted, do not attempt to build an
12655 Setting this flag will make OpenSSL certificate verification match that
12656 of older OpenSSL versions, before automatic building and checking of
12657 alternative chains has been implemented; also see
12658 .Cd trusted-first .
12659 .It Cd no-check-time
12660 Do not check certificate/CRL validity against current time.
12661 .It Cd partial-chain
12662 By default partial, incomplete chains which cannot be verified up to the
12663 chain top, a self-signed root certificate, will not verify.
12664 With this flag set, a chain succeeds to verify if at least one signing
12665 certificate of the chain is in any of the configured trusted stores of
12667 The OpenSSL manual page
12668 .Xr SSL_CTX_load_verify_locations 3
12669 gives some advise how to manage your own trusted store of CA certificates.
12671 Disable workarounds for broken certificates.
12672 .It Cd trusted-first
12673 Try building a chain using issuers in the trusted store first to avoid
12674 problems with server-sent legacy intermediate certificates.
12675 Newer versions of OpenSSL support alternative chain checking and enable
12676 it by default, resulting in the same behaviour; also see
12677 .Cd no-alt-chains .
12679 .Mx Va tls-ca-no-defaults
12680 .It Va tls-ca-no-defaults-USER@HOST , tls-ca-no-defaults-HOST ,\
12682 \*(BO\*(OP Do not load the default CA locations that are built into the
12683 used to TLS library to verify TLS server certificates.
12685 .It Va tls-config-file
12686 \*(OP If this variable is set
12687 .Xr CONF_modules_load_file 3
12689 .Ql ,+modules-load-file,
12692 is used to allow resource file based configuration of the TLS library.
12693 This happens once the library is used first, which may also be early
12694 during startup (logged with
12696 If a non-empty value is given then the given file, after performing
12697 .Sx "Filename transformations" ,
12698 will be used instead of the TLS libraries global default, and it is an
12699 error if the file cannot be loaded.
12700 The application name will always be passed as
12702 Some TLS libraries support application-specific configuration via
12703 resource files loaded like this, please see
12704 .Va tls-config-module .
12705 .Mx Va tls-config-module
12706 .It Va tls-config-module-USER@HOST , tls-config-module-HOST ,\
12708 \*(OP If file based application-specific configuration via
12709 .Va tls-config-file
12710 is available, announced as
12714 indicating availability of
12715 .Xr SSL_CTX_config 3 ,
12716 then, it becomes possible to use a central TLS configuration file
12717 for all programs, including \*(uA, for example
12718 .Bd -literal -offset indent
12719 # Register a configuration section for \*(uA
12720 \*(uA = mailx_master
12721 # The top configuration section creates a relation
12722 # in between dynamic SSL configuration and an actual
12723 # program specific configuration section
12725 ssl_conf = mailx_tls_config
12726 # And that program specific configuration section now
12727 # can map diverse tls-config-module names to sections,
12728 # as in: tls-config-module=account_xy
12730 account_xy = mailx_account_xy
12731 account_yz = mailx_account_yz
12733 MinProtocol = TLSv1.2
12736 CipherString = TLSv1.2:!aNULL:!eNULL:
12737 MinProtocol = TLSv1.1
12740 .Mx Va tls-config-pairs
12741 .It Va tls-config-pairs-USER@HOST , tls-config-pairs-HOST , tls-config-pairs
12742 \*(OP The value of this variable chain will be interpreted as
12743 a comma-separated list of directive/value pairs.
12744 Directives and values need to be separated by equals signs
12746 any whitespace surrounding pair members is removed.
12747 Keys are (usually) case-insensitive.
12748 Different to when placing these pairs in a
12749 .Va tls-config-module
12751 .Va tls-config-file ,
12754 need to be escaped with a reverse solidus
12756 when included in pairs; also different: if the equals sign
12758 is preceded with an asterisk
12760 .Sx "Filename transformations"
12761 will be performed on the value; it is an error if these fail.
12762 Unless proper support is announced by
12764 .Pf ( Ql ,+conf-ctx, )
12765 only the keys below are supported, otherwise the pairs will be used
12766 directly as arguments to the function
12767 .Xr SSL_CONF_cmd 3 .
12769 .Bl -tag -compact -width ".It Cd C_rtificate_"
12771 Filename of a TLS client certificate (chain) required by some servers.
12772 Fallback support via
12773 .Xr SSL_CTX_use_certificate_chain_file 3 .
12774 .Sx "Filename transformations"
12777 will be set to the same value if not initialized explicitly.
12778 Some services support so-called
12780 authentication if a TLS client certificate was successfully presented
12781 during connection establishment
12782 .Pf ( Dq connecting is authenticating ) .
12783 .It Cd CipherString
12784 A list of ciphers for TLS connections, see
12786 By default no list of ciphers is set, resulting in a
12787 .Cd Protocol Ns - Ns
12788 specific list of ciphers (the protocol standards define lists of
12789 acceptable ciphers; possibly cramped by the used TLS library).
12790 Fallback support via
12791 .Xr SSL_CTX_set_cipher_list 3 .
12792 .It Cd Ciphersuites
12793 A list of ciphers used for TLSv1.3 connections, see
12795 These will be joined onto the list of ciphers from
12800 .Ql ,+ctx-set-ciphersuites, ,
12802 .Xr SSL_CTX_set_ciphersuites 3 .
12804 A list of supported elliptic curves, if applicable.
12805 By default no curves are set.
12806 Fallback support via
12807 .Xr SSL_CTX_set1_curves_list 3 ,
12809 .It Cd MaxProtocol , MinProtocol
12810 The maximum and minimum supported TLS versions, respectively.
12814 .Ql ,+ctx-set-maxmin-proto, ,
12816 .Xr SSL_CTX_set_max_proto_version 3
12818 .Xr SSL_CTX_set_min_proto_version 3 ;
12819 these fallbacks use an internal parser which understands the strings
12825 and the special value
12827 which disables the given limit.
12829 Various flags to set.
12831 .Xr SSL_CTX_set_options 3 ,
12832 in which case any other value but (exactly)
12834 results in an error.
12836 Filename of the private key in PEM format of a TLS client certificate.
12837 If unset, the value of
12840 .Sx "Filename transformations"
12843 .Xr SSL_CTX_use_PrivateKey_file 3 .
12845 The used TLS protocol.
12851 .Ql ctx-set-maxmin-proto
12858 .Xr SSL_CTX_set_options 3 ,
12859 driven via an internal parser which understands the strings
12865 and the special value
12867 Multiple protocols may be given as a comma-separated list, any
12868 whitespace is ignored, an optional plus sign
12870 prefix enables, a hyphen-minus
12872 prefix disables a protocol, so that
12874 enables only the TLSv1.2 protocol.
12878 .It Va tls-crl-dir , tls-crl-file
12879 \*(OP Specify a directory / a file, respectively, that contains a CRL in
12880 PEM format to use when verifying TLS server certificates.
12882 .It Va tls-features
12883 \*(OP\*(RO This expands to a comma-separated list of the TLS library
12884 identity and optional features.
12885 To ease substring matching the string starts and ends with a comma.
12886 Currently supported identities are
12890 (OpenSSL v3.0.0 series),
12892 (OpenSSL v1.1.x series)
12895 (elder OpenSSL series, other clones).
12896 Optional features are preceded with a plus sign
12898 when available, and with a hyphen-minus
12902 Currently known features are
12904 .Pf ( Va tls-config-pairs ) ,
12906 .Pf ( Va tls-config-module ) ,
12907 .Ql ctx-set-ciphersuites
12908 .Pf ( Cd Ciphersuites
12910 .Va tls-config-pairs ) ,
12911 .Ql ctx-set-maxmin-proto
12912 .Pf ( Va tls-config-pairs ) ,
12913 .Ql modules-load-file
12914 .Pf ( Va tls-config-file ) ,
12917 .Pf ( Va tls-rand-file ) .
12918 .Mx Va tls-fingerprint
12919 .It Va tls-fingerprint-USER@HOST , tls-fingerprint-HOST , tls-fingerprint
12920 \*(OP It is possible to replace the verification of the connection
12921 peer certificate against the entire local pool of CAs (for more see
12922 .Sx "Encrypted network communication" )
12923 with the comparison against a precalculated certificate message digest,
12924 the so-called fingerprint, to be specified as the used
12925 .Va tls-fingerprint-digest .
12926 This fingerprint can for example be calculated with
12927 .Ql Ic tls Ns \:\0\:fingerprint HOST .
12928 .Mx Va tls-fingerprint-digest
12929 .It Va tls-fingerprint-digest-USER@HOST , tls-fingerprint-digest-HOST , \
12930 tls-fingerprint-digest
12931 \*(OP The message digest to be used when creating TLS certificate
12932 fingerprints, the defaults, if available, in test order, being
12935 For the complete list of digest algorithms refer to
12936 .Va smime-sign-digest .
12938 .It Va tls-rand-file
12942 .Ql ,+tls-rand-file,
12943 then this will be queried to find a file with random entropy data which
12944 can be used to seed the P(seudo)R(andom)N(umber)G(enerator), see
12945 .Xr RAND_load_file 3 .
12946 The default filename
12947 .Pf ( Xr RAND_file_name 3 ,
12950 will be used if this variable is not set or empty, or if the
12951 .Sx "Filename transformations"
12953 Shall seeding the PRNG have been successful,
12954 .Xr RAND_write_file 3
12955 will be called to update the entropy.
12956 Remarks: libraries which do not announce this feature seed the PRNG by
12959 .It Va tls-verify-USER@HOST , tls-verify-HOST , tls-verify
12960 \*(OP Variable chain that sets the action to be performed if an error
12961 occurs during TLS server certificate validation against the
12962 specified or default trust stores
12965 or the TLS library built-in defaults (unless usage disallowed via
12966 .Va tls-ca-no-defaults ) ,
12967 and as fine-tuned via
12969 Valid (case-insensitive) values are
12971 (fail and close connection immediately),
12973 (ask whether to continue on standard input),
12975 (show a warning and continue),
12977 (do not perform validation).
12982 If defined, gives the number of lines of a message to be displayed
12985 if unset, the first five lines are printed, if set to 0 the variable
12988 If the value is negative then its absolute value will be used for
12989 unsigned right shifting (see
12996 \*(BO If set then the
12998 command series will strip adjacent empty lines and quotations.
13001 The character set of the terminal \*(UA operates on,
13002 and the one and only supported character set that \*(UA can use if no
13003 character set conversion capabilities have been compiled into it,
13004 in which case it defaults to ISO-8859-1.
13005 Otherwise it defaults to UTF-8.
13006 Sufficient locale support provided the default will be preferably
13007 deduced from the locale environment if that is set (for example
13009 see there for more); runtime locale changes will be reflected by
13011 except during the program startup phase and if
13013 had been used to freeze the given value.
13014 Refer to the section
13015 .Sx "Character sets"
13016 for the complete picture about character sets.
13018 .It Va typescript-mode
13019 \*(BO A special multiplex variable that disables all variables and
13020 settings which result in behaviour that interferes with running \*(UA in
13023 .Va colour-disable ,
13024 .Va line-editor-disable
13025 and (before startup completed only)
13026 .Va termcap-disable .
13027 Unsetting it does not restore the former state of the covered settings.
13030 For a safe-by-default policy the process file mode creation mask
13034 on program startup after the resource files have been loaded,
13035 and unless this variable is set.
13036 By assigning this an empty value the active setting will not be changed,
13037 otherwise the given value will be made the new file mode creation mask.
13038 Child processes inherit the file mode creation mask of their parent.
13040 .It Va user-HOST , user
13041 \*(IN Variable chain that sets a global fallback user name, used in case
13042 none has been given in the protocol and account-specific URL.
13043 This variable defaults to the name of the user who runs \*(UA.
13046 Enable upward compatibility with \*(UA version 15.0 in respect to which
13047 configuration options are available and how they are handled.
13048 If set to a non-empty value the command modifier
13050 is implied and thus enforces
13051 .Sx "Shell-style argument quoting"
13053 .Sx "Old-style argument quoting"
13054 for all commands which support both.
13055 This manual uses \*(IN and \*(OU to refer to the new and the old way of
13056 doing things, respectively.
13059 Verbose mode enables logging of informational context messages.
13060 Historically a \*(BO variable, this can either be set multiple times
13061 (what the command line option
13063 uses), or be assigned a numeric value in order to increase verbosity.
13064 Assigning the value 0 disables verbosity and thus (almost) equals
13066 The maximum number is 3.
13075 .It Va version , version-date , \
13076 version-hexnum , version-major , version-minor , version-update
13077 \*(RO \*(UA version information: the first variable is a string with
13078 the complete version identification, the second the release date in ISO
13079 8601 notation without time.
13080 The third is a 32-bit hexadecimal number with the upper 8 bits storing
13081 the major, followed by the minor and update version numbers which occupy
13083 The latter three variables contain only decimal digits: the major, minor
13084 and update version numbers.
13085 The output of the command
13087 will include this information.
13089 .It Va writebackedited
13090 If this variable is set messages modified using the
13094 commands are written back to the current folder when it is quit;
13095 it is only honoured for writable folders in MBOX format, though.
13096 Note that the editor will be pointed to the raw message content in that
13097 case, i.e., neither MIME decoding nor decryption will have been
13098 performed, and proper
13101 quoting of newly added or edited content is also left as an exercise
13106 .Dq environment variable
13107 should be considered an indication that these variables are either
13108 standardized as vivid parts of process environments, or that they are
13109 commonly found in there.
13110 The process environment is inherited from the
13112 once \*(UA is started, and unless otherwise explicitly noted handling of
13113 the following variables transparently integrates into that of the
13114 .Sx "INTERNAL VARIABLES"
13115 from \*(UA's point of view.
13116 This means they can be managed via
13120 causing automatic program environment updates (to be inherited by
13121 newly created child processes).
13123 In order to integrate other environment variables equally they need to
13124 be imported (linked) with the command
13126 This command can also be used to set and unset non-integrated
13127 environment variables from scratch, sufficient system support provided.
13128 The following example, applicable to a POSIX shell, sets the
13130 environment variable for \*(UA only, and beforehand exports the
13132 in order to affect any further processing in the running shell:
13133 .Bd -literal -offset indent
13134 $ EDITOR="vim -u ${HOME}/.vimrc"
13136 $ COLUMNS=80 \*(uA -R
13138 .Bl -tag -width ".It Ev BaNg"
13141 The user's preferred width in column positions for the terminal screen.
13142 Queried and used once on program startup in interactive or batch
13144 mode, actively managed for child processes and the MLE (see
13145 .Sx "On terminal control and line editor" )
13146 in interactive mode thereafter.
13147 Non-interactive mode always uses, and the fallback default is
13148 a compile-time constant, by default 80 columns.
13153 are both set but not both are usable (empty, not a number, or 0) at
13154 program startup, then the real terminal screen size will be (tried to
13155 be) determined once.
13158 manages these variables, and unsets them for pipe specifications etc.)
13161 The name of the (mailbox)
13163 to use for saving aborted messages if
13165 is set; this defaults to
13169 is set no output will be generated, otherwise the contents of the file
13172 .Sx "Filename transformations"
13178 Pathname of the text editor to use for the
13182 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
13184 is used for a more display oriented editor.
13187 The user's home directory.
13188 This variable is only used when it resides in the process environment.
13189 The calling user's home directory will be used instead if this directory
13190 does not exist, is not accessible or cannot be read;
13191 it will always be used for the root user.
13192 (No test for being writable is performed to allow usage by
13193 non-privileged users within read-only jails, but dependent on settings
13194 this directory is a default write target for, for example,
13201 .It Ev LC_ALL , LC_CTYPE , LANG
13202 \*(OP The (names in lookup order of the)
13206 which indicates the used
13207 .Sx "Character sets" .
13208 Runtime changes trigger automatic updates of the entire locale system,
13209 which includes updating
13211 (except during startup if the variable has been frozen via
13215 The user's preferred number of lines for the terminal screen.
13216 The behaviour is as described for
13218 yet the compile-time constant used in non-interactive mode and as
13219 a fallback defaults to 24 (lines).
13222 Pathname of the directory lister to use in the
13224 command when operating on local mailboxes.
13227 (path search through
13231 Upon startup \*(UA will actively ensure that this variable refers to the
13232 name of the user who runs \*(UA, in order to be able to pass a verified
13233 name to any newly created child process.
13236 Is used as the user's
13238 .Sx "primary system mailbox"
13242 If the environmental fallback is also not set, a built-in compile-time
13244 This is assumed to be an absolute pathname.
13247 \*(OP Override the default path search of
13248 .Sx "The Mailcap files" :
13249 any existing file therein will be loaded in sequence, appending any
13250 content to the list of MIME type handler directives.
13251 The RFC 1524 standard imposed default value is assigned otherwise:
13252 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
13253 (The default value is a compile-time \*(OP.)
13256 Is used as a startup file instead of
13259 In order to avoid side-effects from configuration files scripts should
13260 either set this variable to
13264 command line option should be used.
13266 .It Ev MAILX_NO_SYSTEM_RC
13267 If this variable is set then reading of
13270 .Va system-mailrc )
13271 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
13272 had been started up with the option
13274 (and according argument) or
13276 This variable is only used when it resides in the process environment.
13279 The name of the user's
13281 .Sx "secondary mailbox"
13283 A logical subset of the special
13284 .Sx "Filename transformations"
13290 Traditionally this MBOX is used as the file to save messages from the
13292 .Sx "primary system mailbox"
13293 that have been read.
13295 .Sx "Message states" .
13298 \*(IN\*(OP This variable overrides the default location of the user's
13303 Pathname of the program to use for backing the command
13307 variable enforces usage of a pager for output.
13308 The default paginator is
13310 (path search through
13313 \*(UA inspects the contents of this variable: if its contains the string
13315 then a non-existing environment variable
13317 will be set to (the portable)
13322 will optionally be set to
13328 A colon-separated list of directories that is searched by the shell when
13329 looking for commands, for example
13330 .Ql /bin:/usr/bin:/usr/local/bin .
13332 .It Ev POSIXLY_CORRECT
13333 This environment entry is automatically squared with
13337 The shell to use for the commands
13342 .Sx "COMMAND ESCAPES"
13343 and when starting subprocesses.
13344 A default shell is used if this environment variable is not defined.
13346 .It Ev SOCKS5_PROXY
13347 This environment entry is automatically squared with
13350 .It Ev SOURCE_DATE_EPOCH
13351 Specifies a time in seconds since the Unix epoch (1970-01-01) to be
13352 used in place of the current time.
13353 This variable is looked up upon program startup, and its existence will
13354 switch \*(UA to a reproducible mode
13355 .Pf ( Lk https://reproducible-builds.org )
13356 which uses deterministic random numbers, a special fixated pseudo
13359 This operation mode is used for development and by software packagers.
13360 \*(ID Currently an invalid setting is only ignored, rather than causing
13361 a program abortion.
13363 .Dl $ SOURCE_DATE_EPOCH=`date +%s` \*(uA
13366 \*(OP The terminal type for which output is to be prepared.
13367 For extended colour and font control please refer to
13368 .Sx "Coloured display" ,
13369 and for terminal management in general to
13370 .Sx "On terminal control and line editor" .
13373 Except for the root user this variable defines the directory for
13374 temporary files to be used instead of
13376 (or the given compile-time constant) if set, existent, accessible as
13377 well as read- and writable.
13378 This variable is only used when it resides in the process environment,
13379 but \*(UA will ensure at startup that this environment variable is
13380 updated to contain a usable temporary directory.
13385 (see there), but this variable is not standardized, should therefore not
13386 be used, and is only corrected if already set.
13389 Pathname of the text editor to use for the
13393 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
13395 is used for a less display oriented editor.
13398 .Bl -tag -width ".It Pa BaNg"
13401 .It Pa ~/.mailcap , /etc/mailcap
13402 \*(OP Personal and system-wide MIME type handler definition files, see
13403 .Sx "The Mailcap files" .
13404 (The shown names are part of the RFC 1524 standard search path
13406 .It Pa \*(ur , \*(UR
13407 User-specific and system-wide files giving initial commands, the
13408 .Sx "Resource files" .
13409 (The used filenames come from
13412 .Va system-mailrc ,
13416 The default value for
13420 .It Pa \*(vU , \*(vS
13421 Personal and system-wide MIME types, see
13422 .Sx "The mime.types files" .
13425 \*(IN\*(OP The default location of the user's
13427 file \(en the section
13428 .Sx "The .netrc file"
13429 documents the file format.
13430 The used path can be set via
13438 \*(OP Possible location for persistent random entropy seed storage, see
13439 .Va tls-rand-file .
13441 .Ss "Resource files"
13442 Upon startup \*(UA reads in several resource files, in order:
13443 .Bl -tag -width ".It Pa BaNg"
13446 System wide initialization file
13447 .Pf ( Va system-mailrc ) .
13448 Reading of this file can be suppressed, either by using the
13450 (and according argument) or
13452 command line options, or by setting the
13455 .Ev MAILX_NO_SYSTEM_RC .
13458 File giving initial commands.
13459 A different file can be chosen by setting the
13463 Reading of this file can be suppressed with the
13465 command line option.
13466 .It Va mailx-extra-rc
13467 Defines a startup file to be read after all other resource files.
13468 It can be used to specify settings that are not understood by other
13470 implementations, for example.
13473 The content of these files is interpreted as follows:
13475 .Bl -bullet -compact
13477 The whitespace characters space, tabulator and newline,
13478 as well as those defined by the variable
13480 are removed from the beginning and end of input lines.
13482 Empty lines are ignored.
13484 Any other line is interpreted as a command.
13485 It may be spread over multiple input lines if the newline character is
13487 by placing a reverse solidus character
13489 as the last character of the line; whereas any leading whitespace of
13490 follow lines is ignored, trailing whitespace before a escaped newline
13491 remains in the input.
13493 If the line (content) starts with the number sign
13495 then it is a comment-command and also ignored.
13496 (The comment-command is a real command, which does nothing, and
13497 therefore the usual follow lines mechanism applies!)
13500 Errors while loading these files are subject to the settings of
13504 More files with syntactically equal content can be
13506 The following, saved in a file, would be an examplary content:
13507 .Bd -literal -offset indent
13508 # This line is a comment command. And y\e
13509 es, it is really continued here.
13514 .Ss "The mime.types files"
13516 .Sx "HTML mail and MIME attachments"
13517 \*(UA needs to learn about MIME (Multipurpose Internet Mail Extensions)
13518 media types in order to classify message and attachment content.
13519 One source for them are
13521 files, the loading of which can be controlled by setting the variable
13522 .Va mimetypes-load-control .
13523 Another is the command
13525 which also offers access to \*(UAs MIME type cache.
13527 files have the following syntax:
13528 .Bd -literal -offset indent
13529 type/subtype extension [extension ...]
13530 # For example text/html html htm
13535 define the MIME media type, as standardized in RFC 2046:
13537 is used to declare the general type of data, while the
13539 specifies a specific format for that type of data.
13540 One or multiple filename
13542 s, separated by whitespace, can be bound to the media type format.
13543 Comments may be introduced anywhere on a line with a number sign
13545 causing the remaining line to be discarded.
13546 \*(UA also supports an extended, non-portable syntax in especially
13547 crafted files, which can be loaded via the alternative value syntax of
13548 .Va mimetypes-load-control ,
13549 and prepends an optional
13552 .Dl [type-marker ]type/subtype extension [extension ...]
13554 The following type markers are supported:
13556 .Bl -tag -compact -width ".It Ar _n_u"
13558 Treat message parts with this content as plain text.
13563 Treat message parts with this content as HTML tagsoup.
13564 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
13565 the content as plain text instead.
13569 but instead of falling back to plain text require an explicit content
13570 handler to be defined.
13572 If no handler can be found a text message is displayed which says so.
13573 This can be annoying, for example signatures serve a contextual purpose,
13574 their content is of no use by itself.
13575 This marker will avoid displaying the text message.
13579 for sending messages:
13581 .Va mime-allow-text-controls ,
13582 .Va mimetypes-load-control .
13583 For reading etc. messages:
13584 .Sx "HTML mail and MIME attachments" ,
13585 .Sx "The Mailcap files" ,
13587 .Va mime-counter-evidence ,
13588 .Va mimetypes-load-control ,
13589 .Va pipe-TYPE/SUBTYPE ,
13590 .Va pipe-EXTENSION .
13591 .Ss "The Mailcap files"
13592 \*(OP RFC 1524 defines a
13593 .Dq User Agent Configuration Mechanism
13594 to be used to inform mail user agent programs about the locally
13595 installed facilities for handling various data formats, i.e., about
13596 commands and how they can be used to display, edit et cetera MIME part
13597 contents, as well as a default path search that includes multiple
13598 possible locations of resource files, and the
13600 environment variable to overwrite that.
13601 Handlers found from doing the path search will be cached, the command
13603 operates on that cache, and the variable
13604 .Va mailcap-disable
13605 will suppress automatic loading, and usage of any mailcap handlers.
13606 .Sx "HTML mail and MIME attachments"
13607 gives a general overview of how MIME types are handled.
13610 files consist of a set of newline separated entries.
13611 Comment lines start with a number sign
13613 (in the first column!) and are ignored.
13614 Empty lines are ignored.
13615 All other lines are interpreted as mailcap entries.
13616 An entry definition may be split over multiple lines by placing the
13617 reverse solidus character
13619 last in all but the final line.
13620 The standard does not specify how leading whitespace of successive lines
13621 is to be treated, therefore they are retained.
13624 entries consist of a number of semicolon
13627 The first two fields are mandatory and must occur in the specified
13628 order, the remaining fields are optional and may appear in any order.
13629 Leading and trailing whitespace of field content is ignored (removed).
13630 The reverse solidus
13632 character can be used to escape any following character including
13633 semicolon and itself in the content of the second field, and in value
13634 parts of any optional key/value field.
13636 The first field defines the MIME
13638 the entry is about to handle (case-insensitively).
13639 If the subtype is specified as an asterisk
13641 the entry is meant to match all subtypes of the named type, e.g.,
13643 would match any audio type.
13644 The second field is the
13646 shell command used to display MIME parts of the given type.
13648 Data consuming shell commands will be fed message (MIME part) data on
13649 standard input unless one or more instances of the (unquoted) string
13651 are used: these formats will be replaced with a temporary file(name)
13652 that has been prefilled with the parts data.
13653 Data producing shell commands are expected to generata data on their
13654 standard output unless that format is used.
13655 In all cases any given
13657 format is replaced with a properly shell quoted filename.
13658 When a command requests a temporary file via
13660 then that will be removed again, as if the
13661 .Cd x-mailx-tmpfile
13663 .Cd x-mailx-tmpfile-fill
13664 flags had been set; unless the command requests
13667 .Cd x-mailx-tmpfile-unlink
13668 flag is also implied; see below for more.
13670 Optional fields define single-word flags (case-insensitive), or key
13671 / value pairs consisting of a case-insensitive keyword, an equals sign
13673 and a shell command; whitespace surrounding the equals sign is removed.
13674 Optional fields include the following:
13675 .Bl -tag -width ".It Cd BaNg"
13677 A program that can be used to compose a new body or body part in the
13679 (Currently unused.)
13680 .It Cd composetyped
13683 field, but is to be used when the composing program needs to specify the
13685 header field to be applied to the composed data.
13686 (Currently unused.)
13688 .It Cd copiousoutput
13689 A flag field which indicates that the output of the
13691 command is integrable into \*(UAs normal visual display.
13692 It is mutually exclusive with
13693 .Cd needsterminal .
13695 A textual description that describes this type of data.
13696 The text may optionally be enclosed within double quotation marks
13699 A program that can be used to edit a body or body part in the given
13701 (Currently unused.)
13702 .It Cd nametemplate
13703 This field specifies a filename format for the
13705 format used in the shell command fields, in which
13707 will be replaced by a random string.
13708 (The filename is also stored in and passed to subprocesses via
13709 .Ev MAILX_FILENAME_TEMPORARY . )
13710 The standard says this is
13711 .Dq only expected to be relevant in environments \
13712 where filename extensions are meaningful ,
13713 and so this field is ignored unless the
13715 is a prefix, optionally followed by (ASCII) alphabetic and numeric
13716 characters, the underscore and the period.
13717 For example, to specify that a JPG file is to be passed to an image
13718 viewer with a name ending in
13720 .Ql nametemplate=%s.jpg
13723 .It Cd needsterminal
13724 This flag field indicates that the given shell command must be run on
13725 an interactive terminal.
13726 \*(UA will temporarily release the terminal to the given command in
13727 interactive mode, in non-interactive mode this entry will be entirely
13728 ignored; this flag implies
13729 .Cd x-mailx-noquote .
13731 A program that can be used to print a message or body part in the given
13733 (Currently unused.)
13735 Specifies a program to be run to test some condition, for example, the
13736 machine architecture, or the window system in use, to determine whether
13737 or not this mailcap entry applies.
13738 If the test fails, a subsequent mailcap entry should be sought; also see
13739 .Cd x-mailx-test-once .
13740 Standard I/O of the test program is redirected from and to
13744 is not supported (the data does not yet exist).
13745 .It Cd textualnewlines
13746 A flag field which indicates that this type of data is line-oriented and
13747 that, if encoded in
13749 all newlines should be converted to canonical form (CRLF) before
13750 encoding, and will be in that form after decoding.
13751 (Currently unused.)
13753 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
13754 icon to be used to visually denote the presence of this kind of data.
13755 This field is not used by \*(UA.
13757 .It Cd x-mailx-async
13758 Extension flag field that denotes that the given
13760 command shall be executed asynchronously, without blocking \*(UA.
13761 Cannot be used in conjunction with
13762 .Cd needsterminal ;
13763 the standard output of the command will go to
13766 .It Cd x-mailx-noquote
13767 An extension flag field that indicates that even a
13770 command shall not be used when
13772 ing messages, as it would by default.
13774 .It Cd x-mailx-test-once
13775 Extension flag which denotes whether the given
13777 command shall be evaluated once only with its exit status being cached.
13778 This is handy if some global unchanging condition is to be queried, like
13779 .Dq running under the X Window System .
13781 .It Cd x-mailx-tmpfile
13782 Extension flag field that requests creation of a zero-sized temporary
13783 file, the name of which is to be placed in the environment variable
13784 .Ev MAILX_FILENAME_TEMPORARY .
13785 It is an error to use this flag with commands that include a
13787 format (because that is implemented by means of this temporary file).
13789 .It Cd x-mailx-tmpfile-fill
13790 Normally the MIME part content is passed to the handler via standard
13791 input; if this flag is set then the data will instead be written into
13793 .Cd x-mailx-tmpfile .
13794 In order to cause deletion of the temporary file you will have to set
13795 .Cd x-mailx-tmpfile-unlink
13797 It is an error to use this flag with commands that include a
13801 .It Cd x-mailx-tmpfile-unlink
13802 Extension flag field that requests that the temporary file shall be
13803 deleted automatically when the command loop is entered again at latest.
13804 It is an error to use this flag with commands that include a
13806 format, or in conjunction with
13807 .Cd x-mailx-async .
13808 .Cd x-mailx-tmpfile
13811 .It Cd x-mailx-last-resort
13812 An extension flag that indicates that this handler shall only be used
13813 as a last resort, when no other source (see
13814 .Sx "HTML mail and MIME attachments" )
13815 provides a MIME handler.
13817 .It Cd x-mailx-ignore
13818 An extension that enforces that this handler is not used at all.
13821 The standard includes the possibility to define any number of additional
13822 fields, prefixed by
13824 Flag fields apply to the entire
13826 entry \(em in some unusual cases, this may not be desirable, but
13827 differentiation can be accomplished via separate entries, taking
13828 advantage of the fact that subsequent entries are searched if an earlier
13829 one does not provide enough information.
13832 command needs to specify the
13836 command shall not, the following will help out the latter:
13837 .Bd -literal -offset indent
13838 application/postscript; ps-to-terminal %s; needsterminal
13839 application/postscript; ps-to-terminal %s; compose=idraw %s
13842 In value parts of command fields any occurrence of the format string
13844 will be replaced by the
13847 Any named parameter from a messages'
13849 field may be embedded into the command line using the format
13851 followed by the parameter name and a closing brace
13854 The entire parameter should appear as a single command line argument,
13855 regardless of embedded spaces, shell quoting will be performed by the
13856 RFC 1524 processor, thus:
13857 .Bd -literal -offset indent
13859 Content-type: multipart/mixed; boundary=42
13862 multipart/*; /usr/local/bin/showmulti \e
13863 %t %{boundary} ; composetyped = /usr/local/bin/makemulti
13865 # Executed shell command
13866 /usr/local/bin/showmulti multipart/mixed 42
13869 Note that \*(UA does not support handlers for multipart MIME parts as
13870 shown in this example (as of today).
13871 It does not support the additional formats
13875 An example file, also showing how to properly deal with the expansion of
13877 which includes any quotes that are necessary to make it a valid shell
13878 argument by itself and thus will cause undesired behaviour when placed
13879 in additional user-provided quotes:
13880 .Bd -literal -offset indent
13882 text/richtext; richtext %s; copiousoutput
13884 text/x-perl; perl -cWT %s; nametemplate = %s.pl
13886 # Exit EX_TEMPFAIL=75 on signal
13887 application/pdf; \e
13889 trap "rm -f ${infile}" EXIT\e; \e
13890 trap "exit 75" INT QUIT TERM\e; \e
13891 mupdf "${infile}"; \e
13892 test = [ -n "${DISPLAY}" ]; \e
13893 nametemplate = %s.pdf; x-mailx-async
13894 application/pdf; pdftotext -layout - -; copiousoutput
13896 application/*; echo "This is \e\e"%t\e\e" but \e
13897 is 50 \e% Greek to me" \e; < %s head -c 512 | cat -vet; \e
13898 copiousoutput; x-mailx-noquote; x-mailx-last-resort
13902 .Sx "HTML mail and MIME attachments" ,
13903 .Sx "The mime.types files" ,
13906 .Va mime-counter-evidence ,
13907 .Va pipe-TYPE/SUBTYPE ,
13908 .Va pipe-EXTENSION .
13909 .Ss "The .netrc file"
13910 User credentials for machine accounts (see
13911 .Sx "On URL syntax and credential lookup" )
13912 can be placed in the
13914 file, which will be loaded and cached when requested by
13916 The default location
13918 may be overridden by the
13920 environment variable.
13921 As long as syntax constraints are honoured the file source may be
13922 replaced with the output of the shell command set in
13924 to load an encrypted file, for example.
13925 The cache can be managed with the command
13928 The file consists of space, tabulator or newline separated tokens.
13929 This parser implements a superset of the original BSD syntax, but users
13930 should nonetheless be aware of portability glitches, shall their
13932 be usable across multiple programs and platforms:
13934 .Bl -bullet -compact
13936 BSD only supports double quotation marks, for example
13937 .Ql password """pass with spaces""" .
13939 BSD (only?) supports escaping of single characters via a reverse solidus
13940 (a space could be escaped via
13942 in- as well as outside of a quoted string.
13943 This method is assumed to be present, and will actively be used to quote
13944 double quotation marks
13946 and reverse solidus
13948 characters inside the
13952 tokens, for example for display purposes.
13954 BSD does not require a final quotation mark of the last user input token.
13956 The original BSD (Berknet) parser also supported a format which allowed
13957 tokens to be separated with commas \(en whereas at least Hewlett-Packard
13958 still seems to support this syntax, this parser does not!
13960 As a non-portable extension some widely-used programs support
13961 shell-style comments: if an input line starts, after any amount of
13962 whitespace, with a number sign
13964 then the rest of the line is ignored.
13966 Whereas other programs may require that the
13968 file is accessible by only the user if it contains a
13970 token for any other
13974 this parser will always require these strict permissions.
13977 Of the following list of supported tokens this parser uses (and caches)
13984 entry will not be used.
13985 .Bl -tag -width ".It Cd BaNg"
13986 .It Cd machine Ar name
13987 The hostname of the entries' machine, lowercase-normalized before use.
13988 Any further file content, until either end-of-file or the occurrence
13993 first-class token is bound (only related) to the machine
13996 As an extension that should not be the cause of any worries this parser
13997 supports a single wildcard prefix for
13999 .Bd -literal -offset indent
14000 machine *.example.com login USER password PASS
14001 machine pop3.example.com login USER password PASS
14002 machine smtp.example.com login USER password PASS
14008 .Ql pop3.example.com ,
14012 .Ql local.smtp.example.com .
14013 In the example neither
14014 .Ql pop3.example.com
14016 .Ql smtp.example.com
14017 will be matched by the wildcard, since the exact matches take
14018 precedence (it is however faster to specify it the other way around).
14020 This is the same as
14022 except that it is a fallback entry that is used shall none of the
14023 specified machines match; only one default token may be specified,
14024 and it must be the last first-class token.
14025 .It Cd login Ar name
14026 The user name on the remote machine.
14027 .It Cd password Ar string
14028 The user's password on the remote machine.
14029 .It Cd account Ar string
14030 Supply an additional account password.
14031 This is merely for FTP purposes.
14032 .It Cd macdef Ar name
14034 A macro is defined with the specified
14036 it is formed from all lines beginning with the next line and continuing
14037 until a blank line is (consecutive newline characters are) encountered.
14040 entries cannot be utilized by multiple machines, too, but must be
14041 defined following the
14043 they are intended to be used with.)
14046 exists, it is automatically run as the last step of the login process.
14047 This is merely for FTP purposes.
14050 .Ss "An example configuration"
14051 .Bd -literal -offset indent
14052 # This example assumes v15.0 compatibility mode
14055 # Request strict TLL transport layer security checks
14056 set tls-verify=strict
14058 # Where are the up-to-date TLS certificates?
14059 # (Since we manage up-to-date ones explicitly, do not use any,
14060 # possibly outdated, default certificates shipped with OpenSSL)
14061 #set tls-ca-dir=/etc/ssl/certs
14062 set tls-ca-file=/etc/ssl/certs/ca-certificates.crt
14063 set tls-ca-no-defaults
14064 #set tls-ca-flags=partial-chain
14065 wysh set smime-ca-file="${tls-ca-file}" \e
14066 smime-ca-no-defaults #smime-ca-flags="${tls-ca-flags}"
14068 # This could be outsourced to a central configuration file via
14069 # tls-config-file plus tls-config-module if the used library allows.
14070 # CipherString: explicitly define the list of ciphers, which may
14071 # improve security, especially with protocols older than TLS v1.2.
14072 # See ciphers(1). Possibly best to only use tls-config-pairs-HOST
14073 # (or -USER@HOST), as necessary, again..
14074 # Note that TLSv1.3 uses Ciphersuites= instead, which will join
14075 # with CipherString (if protocols older than v1.3 are allowed)
14076 # Curves: especially with TLSv1.3 curves selection may be desired.
14077 # MinProtocol,MaxProtocol: do not use protocols older than TLS v1.2.
14078 # Change this only when the remote server does not support it:
14079 # maybe use chain support via tls-config-pairs-HOST / -USER@HOST
14080 # to define such explicit exceptions, then, e.g.,
14081 # MinProtocol=TLSv1.1
14082 if "$tls-features" =% ,+ctx-set-maxmin-proto,
14083 wysh set tls-config-pairs='\e
14084 CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
14085 Curves=P-521:P-384:P-256,\e
14086 MinProtocol=TLSv1.1'
14088 wysh set tls-config-pairs='\e
14089 CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
14090 Curves=P-521:P-384:P-256,\e
14091 Protocol=-ALL\e,+TLSv1.1 \e, +TLSv1.2\e, +TLSv1.3'
14094 # Essential setting: select allowed character sets
14095 set sendcharsets=utf-8,iso-8859-1
14097 # A very kind option: when replying to a message, first try to
14098 # use the same encoding that the original poster used herself!
14099 set reply-in-same-charset
14101 # When replying, do not merge From: and To: of the original message
14102 # into To:. Instead old From: -> new To:, old To: -> merge Cc:.
14103 set recipients-in-cc
14105 # When sending messages, wait until the Mail-Transfer-Agent finishs.
14106 # Only like this you will be able to see errors reported through the
14107 # exit status of the MTA (including the built-in SMTP one)!
14110 # Only use built-in MIME types, no mime.types(5) files
14111 set mimetypes-load-control
14113 # Default directory where we act in (relative to $HOME)
14115 # A leading "+" (often) means: under *folder*
14116 # *record* is used to save copies of sent messages
14117 set MBOX=+mbox.mbox DEAD=+dead.txt \e
14118 record=+sent.mbox record-files record-resent
14120 # Make "file mymbox" and "file myrec" go to..
14121 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
14123 # Not really optional, e.g., for S/MIME
14124 set from='Your Name <address@exam.ple>'
14126 # It may be necessary to set hostname and/or smtp-hostname
14127 # if the "SERVER" of mta and "domain" of from do not match.
14128 # The `urlencode' command can be used to encode USER and PASS
14129 set mta=(smtps?|submissions?)://[USER[:PASS]@]SERVER[:PORT] \e
14130 smtp-auth=login/plain... \e
14133 # Never refuse to start into interactive mode, and more
14135 colour-pager crt= \e
14136 followup-to followup-to-honour=ask-yes fullnames \e
14137 history-file=+.\*(uAhist history-size=-1 history-gabby \e
14138 mime-counter-evidence=0b1111 \e
14139 prompt='?\e$?!\e$!/\e$^ERRNAME[\e$account#\e$mailbox-display]? ' \e
14140 reply-to-honour=ask-yes \e
14143 # Only include the selected header fields when typing messages
14144 headerpick type retain from_ date from to cc subject \e
14145 message-id mail-followup-to reply-to
14146 # ...when forwarding messages
14147 headerpick forward retain subject date from to cc
14148 # ...when saving message, etc.
14149 #headerpick save ignore ^Original-.*$ ^X-.*$
14151 # Some mailing lists
14152 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
14153 mlsubscribe '^xfans@xfans\e.xyz$'
14155 # Handle a few file extensions (to store MBOX databases)
14156 filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
14157 gz 'gzip -dc' 'gzip -c' xz 'xz -dc' 'xz -zc' \e
14158 zst 'zstd -dc' 'zstd -19 -zc' \e
14159 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
14161 # A real life example of a very huge free mail provider
14162 # Instead of directly placing content inside `account',
14163 # we `define' a macro: like that we can switch "accounts"
14164 # from within *on-compose-splice*, for example!
14166 set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
14167 set from='Your Name <address@examp.ple>'
14169 set pop3-no-apop-pop.gmXil.com
14170 shortcut pop %:pop3s://pop.gmXil.com
14171 shortcut imap %:imaps://imap.gmXil.com
14172 # Or, entirely IMAP based setup
14173 #set folder=imaps://imap.gmail.com record="+[Gmail]/Sent Mail" \e
14174 # imap-cache=~/spool/cache
14176 set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
14178 set mta=smtps://USER:PASS@smtp.gmail.com:465
14184 # Here is a pretty large one which does not allow sending mails
14185 # if there is a domain name mismatch on the SMTP protocol level,
14186 # which would bite us if the value of from does not match, e.g.,
14187 # for people who have a sXXXXeforge project and want to speak
14188 # with the mailing list under their project account (in from),
14189 # still sending the message through their normal mail provider
14191 set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
14192 set from='Your Name <address@exam.ple>'
14194 shortcut pop %:pop3s://pop.yaXXex.com
14195 shortcut imap %:imaps://imap.yaXXex.com
14197 set mta=smtps://USER:PASS@smtp.yaXXex.com:465 \e
14198 hostname=yaXXex.com smtp-hostname=
14204 # Create some new commands so that, e.g., `ls /tmp' will..
14205 commandalias lls '!ls ${LS_COLOUR_FLAG} -aFlrS'
14206 commandalias llS '!ls ${LS_COLOUR_FLAG} -aFlS'
14208 set pipe-message/external-body='?* echo $MAILX_EXTERNAL_BODY_URL'
14210 # We do not support gpg(1) directly yet. But simple --clearsign'd
14211 # message parts can be dealt with as follows:
14214 wysh set pipe-text/plain=$'?*#++=?\e
14215 < "${MAILX_FILENAME_TEMPORARY}" awk \e
14216 -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
14218 /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
14221 print "--- GPG --verify ---";\e
14222 system("gpg --verify " TMPFILE " 2>&1");\e
14223 print "--- GPG --verify ---";\e
14227 /^-----BEGIN PGP SIGNATURE-----/,\e
14228 /^-----END PGP SIGNATURE-----/{\e
14235 commandalias V '\e'call V
14238 When storing passwords in
14240 appropriate permissions should be set on this file with
14241 .Ql $ chmod 0600 \*(ur .
14244 is available user credentials can be stored in the central
14246 file instead; e.g., here is a different version of the example account
14247 that sets up SMTP and POP3:
14248 .Bd -literal -offset indent
14250 set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
14251 set from='Your Name <address@exam.ple>'
14253 # Load an encrypted ~/.netrc by uncommenting the next line
14254 #set netrc-pipe='gpg -qd ~/.netrc.pgp'
14256 set mta=smtps://smtp.yXXXXx.ru:465 \e
14257 smtp-hostname= hostname=yXXXXx.com
14258 set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
14259 commandalias xp fi pop3s://pop.yXXXXx.ru
14269 .Bd -literal -offset indent
14270 machine *.yXXXXx.ru login USER password PASS
14273 This configuration should now work just fine:
14275 .Dl $ echo text | \*(uA -dvv -AXandeX -s Subject user@exam.ple
14276 .Ss "S/MIME step by step"
14277 \*(OP The first thing that is needed for
14278 .Sx "Signed and encrypted messages with S/MIME"
14279 is a personal certificate, and a private key.
14280 The certificate contains public information, in particular a name and
14281 email address(es), and the public key that can be used by others to
14282 encrypt messages for the certificate holder (the owner of the private
14285 signed messages generated with that certificate('s private key).
14286 Whereas the certificate is included in each signed message, the private
14287 key must be kept secret.
14288 It is used to decrypt messages that were previously encrypted with the
14289 public key, and to sign messages.
14291 For personal use it is recommended to get a S/MIME certificate from
14292 one of the major CAs on the Internet.
14293 Many CAs offer such certificates for free.
14294 Usually offered is a combined certificate and private key in PKCS#12
14295 format which \*(UA does not accept directly.
14296 To convert it to PEM format, the following shell command can be used;
14297 please read on for how to use these PEM files.
14298 .Bd -literal -offset indent
14299 $ openssl pkcs12 -in cert.p12 -out certpem.pem -clcerts -nodes
14301 $ openssl pkcs12 -in cert.p12 -out cert.pem -clcerts -nokeys
14302 $ openssl pkcs12 -in cert.p12 -out key.pem -nocerts -nodes
14306 .Lk https://www.CAcert.org
14307 which issues client and server certificates to members of their
14308 community for free; their root certificate
14309 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
14310 is often not in the default set of trusted CA root certificates, though,
14311 which means their root certificate has to be downloaded separately,
14312 and needs to be part of the S/MIME certificate validation chain by
14315 or as a vivid member of the
14316 .Va smime-ca-file .
14317 But let us take a step-by-step tour on how to setup S/MIME with
14318 a certificate from CAcert.org despite this situation!
14320 First of all you will have to become a member of the CAcert.org
14321 community, simply by registrating yourself via the web interface.
14322 Once you are, create and verify all email addresses you want to be able
14323 to create signed and encrypted messages for/with using the corresponding
14324 entries of the web interface.
14325 Now ready to create S/MIME certificates, so let us create a new
14326 .Dq client certificate ,
14327 ensure to include all email addresses that should be covered by the
14328 certificate in the following web form, and also to use your name as the
14331 Create a private key and a certificate request on your local computer
14332 (please see the manual pages of the used commands for more in-depth
14333 knowledge on what the used arguments etc. do):
14335 .Dl $ openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
14337 Afterwards copy-and-paste the content of
14339 into the certificate-request (CSR) field of the web form on the
14340 CAcert.org website (you may need to unfold some
14341 .Dq advanced options
14342 to see the corresponding text field).
14343 This last step will ensure that your private key (which never left your
14344 box) and the certificate belong together (through the public key that
14345 will find its way into the certificate via the certificate-request).
14346 You are now ready and can create your CAcert certified certificate.
14347 Download and store or copy-and-paste it as
14351 In order to use your new S/MIME setup a combined private key/public key
14352 (certificate) file has to be created:
14354 .Dl $ cat key.pem pub.crt > ME@HERE.com.paired
14356 This is the file \*(UA will work with.
14357 If you have created your private key with a passphrase then \*(UA will
14358 ask you for it whenever a message is signed or decrypted, unless this
14359 operation has been automated as described in
14360 .Sx "Signed and encrypted messages with S/MIME" .
14361 Set the following variables to henceforth use S/MIME (setting
14363 is of interest for verification only):
14364 .Bd -literal -offset indent
14365 ? set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
14366 smime-sign-cert=ME@HERE.com.paired \e
14367 smime-sign-digest=SHA512 \e
14368 smime-sign from=myname@my.host
14370 .Ss "Using CRLs with S/MIME or TLS"
14371 \*(OP Certification authorities (CAs) issue certificate revocation
14372 lists (CRLs) on a regular basis.
14373 These lists contain the serial numbers of certificates that have been
14374 declared invalid after they have been issued.
14375 Such usually happens because the private key for the certificate has
14377 because the owner of the certificate has left the organization that is
14378 mentioned in the certificate, etc.
14379 To seriously use S/MIME or TLS verification,
14380 an up-to-date CRL is required for each trusted CA.
14381 There is otherwise no method to distinguish between valid and
14382 invalidated certificates.
14383 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
14384 the Internet, so they have to be retrieved by some external mechanism.
14386 \*(UA accepts CRLs in PEM format only;
14387 CRLs in DER format must be converted, like, e.\|g.:
14389 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
14391 To tell \*(UA about the CRLs, a directory that contains all CRL files
14392 (and no other files) must be created.
14397 variables, respectively, must then be set to point to that directory.
14398 After that, \*(UA requires a CRL to be present for each CA that is used
14399 to verify a certificate.
14401 In general it is a good idea to turn on
14407 twice) if something does not work well.
14408 Very often a diagnostic message can be produced that leads to the
14409 problems' solution.
14410 .Ss "\*(UA shortly hangs on startup"
14411 This can have two reasons, one is the necessity to wait for a file lock
14412 and cannot be helped, the other being that \*(UA calls the function
14414 in order to query the nodename of the box (sometimes the real one is
14415 needed instead of the one represented by the internal variable
14417 One may have varying success by ensuring that the real hostname and
14421 or, more generally, that the name service is properly setup \(en
14424 return the expected value?
14425 Does this local hostname have a domain suffix?
14426 RFC 6762 standardized the link-local top-level domain
14428 try again after adding an (additional) entry with this extension.
14429 .Ss "I cannot login to Google mail \&(via OAuth\&)"
14430 Since 2014 some free service providers classify programs as
14432 unless they use a special authentication method (OAuth 2.0) which
14433 was not standardized for non-HTTP protocol authentication token query
14434 until August 2015 (RFC 7628).
14436 Different to Kerberos / GSSAPI, which is developed since the mid of the
14437 1980s, where a user can easily create a local authentication ticket for
14438 her- and himself with the locally installed
14440 program, that protocol has no such local part but instead requires
14441 a world-wide-web query to create or fetch a token; since there is no
14442 local cache this query would have to be performed whenever \*(UA is
14443 invoked (in interactive sessions situation may differ).
14445 \*(UA does not directly support OAuth.
14446 It, however, supports XOAUTH2 / OAUTHBEARER, see
14447 .Sx "But, how about XOAUTH2 / OAUTHBEARER?"
14448 If that is not used it is necessary to declare \*(UA a
14449 .Dq less secure app
14450 (on the providers account web page) in order to read and send mail.
14451 However, it also seems possible to take the following steps instead:
14455 give the provider the number of a mobile phone,
14458 .Dq 2-Step Verification ,
14460 create an application specific password (16 characters), and
14462 use that special password instead of the real Google account password in
14463 \*(UA (for more on that see the section
14464 .Sx "On URL syntax and credential lookup" ) .
14466 .Ss "But, how about XOAUTH2 / OAUTHBEARER?"
14468 .Sx "I cannot login to Google mail \&(via OAuth\&)"
14469 one OAuth-based authentication method is available:
14470 the OAuth 2.0 bearer token usage as standardized in RFC 6750 (according
14471 SASL mechanism in RFC 7628), also known as XOAUTH2 and OAUTHBEARER,
14472 allows fetching a temporary access token via the web that can locally be
14475 The protocol is simple and extendable, token updates or even password
14476 changes via a simple TLS secured server login would be possible in
14477 theory, but today a web browser and an external support tool are
14478 prerequisites for using this authentication method.
14479 The token times out and must be periodically refreshed via the web.
14481 Some hurdles must be taken before being able to use this method.
14482 Using GMail as an example, an application (that is a name) must be
14483 registered, for which credentials, a
14486 .Dq client secret ,
14487 need to be created and saved locally (in a secure way).
14488 These initial configuration steps can be performed at
14489 .Lk https://console.developers.google.com/apis/credentials .
14490 Thereafter a refresh token can be requested;
14491 a python program to do this for GMail accounts is
14492 .Lk https://github.com/google/\:gmail-oauth2-tools/\:raw/\:\
14493 master/\:python/\:oauth2.py :
14494 .Bd -literal -offset indent
14495 $ python oauth2.py --user=EMAIL \e
14496 --client-id=THE-ID --client-secret=THE-SECRET \e
14497 --generate_oauth2_token
14498 To authorize token, visit this url and follow the directions:
14499 https://accounts.google.com/o/oauth2/auth?client_id=...
14500 Enter verification code: ...
14503 Access Token Expiration Seconds: 3600
14504 $ # Of which the last three are actual token responses.
14505 $ # Thereafter access tokens can regularly be refreshed
14506 $ # via the created refresh token (read on)
14509 The generated refresh token must also be saved locally (securely).
14510 The procedure as a whole can be read at
14511 .Lk https://github.com/google/\:gmail-oauth2-tools/\:wiki/\:\
14512 OAuth2DotPyRunThrough .
14513 Since periodic timers are not yet supported, keeping an access token
14514 up-to-date (from within \*(UA) can only be performed via the hook
14515 .Va on-main-loop-tick ,
14516 or (for sending only)
14517 .Va on-compose-enter
14518 (for more on authentication please see the section
14519 .Sx "On URL syntax and credential lookup" ) :
14520 .Bd -literal -offset indent
14521 set on-main-loop-tick=o-m-l-t on-compose-enter=o-c-e
14523 xcall update_access_token
14526 xcall update_access_token
14529 set access_token_=0
14530 define update_access_token {
14531 local set i epoch_sec epoch_nsec
14533 eval set $i # set epoch_sec/_nsec of vexpr epoch
14534 vput vexpr i + $access_token_ 2100
14535 if $epoch_sec -ge $i
14536 vput ! password python oauth2.py --user=EMAIL \e
14537 --client-id=THE-ID --client-secret=THE-SECRET \e
14538 --refresh-token=THE-REFRESH-TOKEN |\e
14539 sed '1b PASS;d; :PASS s/^.\e{1,\e}:\e(.\e{1,\e}\e)$/\e1/'
14540 vput csop password trim "$password"
14542 echo password is <$password>
14544 set access_token_=$epoch_sec
14548 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
14549 Two thinkable situations: the first is a shadowed sequence; setting
14551 or the most possible
14553 mode, causes a printout of the
14555 tree after that is built; being a cache, this happens only upon startup
14556 or after modifying bindings.
14558 Or second, terminal libraries (see
14559 .Sx "On terminal control and line editor",
14562 may report different codes than the terminal really sends, rendering
14563 bindings dysfunctional because expected and received data do not match; the
14567 ings will show the byte sequences that are expected.
14568 (One common source of problems is that the \(em possibly even
14569 non-existing \(em keypad is not turned on, and the resulting layout
14570 reports the keypad control codes for the normal keyboard keys.)
14572 To overcome the situation use for example the program
14576 if available, to see the byte sequences which are actually produced
14577 by keypresses, and use the variable
14579 to make \*(UA aware of them.
14580 The terminal this is typed on produces some unexpected sequences,
14581 here for an example the shifted home key:
14582 .Bd -literal -offset indent
14585 # 1B 5B=[ 31=1 3B=; 32=2 48=H
14590 $ \*(uA -v -Stermcap='kHOM=\eE[H'
14595 .Ss "Can \*(UA git-send-email?"
14597 Put (at least parts of) the following in your
14599 .Bd -literal -offset indent
14601 smtpserver = /usr/bin/\*(uA
14602 smtpserveroption = -t
14603 #smtpserveroption = -Sexpandaddr
14604 smtpserveroption = -Athe-account-you-need
14607 suppressfrom = false
14608 assume8bitEncoding = UTF-8
14611 chainreplyto = true
14620 versions (v2.33.0) added the option
14622 Patches can also be send directly, for example:
14623 .Bd -literal -offset indent
14624 $ git format-patch -M --stdout HEAD^ |
14625 \*(uA -A the-account-you-need -t RECEIVER
14627 .Ss "Howto handle stale dotlock files"
14629 sometimes fails to open MBOX mail databases because creation of
14631 .Sx "dotlock files"
14632 is impossible due to existing but unowned lock files.
14633 \*(UA does not offer an option to deal with those files, because it is
14634 considered a site policy what counts as unowned, and what not.
14635 The site policy is usually defined by administrator(s), and expressed in
14636 the configuration of a locally installed MTA (for example Postfix
14637 .Ql stale_lock_time=500s ) .
14638 Therefore the suggestion:
14639 .Bd -literal -offset indent
14640 $ </dev/null \*(uA -s 'MTA: be no frog, handle lock' $LOGNAME
14643 By sending a mail to yourself the local MTA can use its normal queue
14644 mechanism to try the delivery multiple times, finally decide a lock file
14645 has become stale, and remove it.
14647 \*(OPally there is IMAP client support available.
14648 This part of the program is obsolete and will vanish in v15 with the
14649 large MIME and I/O layer rewrite, because it uses old-style blocking I/O
14650 and makes excessive use of signal based long code jumps.
14651 Support can hopefully be readded later based on a new-style I/O, with
14652 SysV signal handling.
14653 In fact the IMAP support had already been removed from the codebase, but
14654 was reinstantiated on user demand: in effect the IMAP code is at the
14655 level of \*(UA v14.8.16 (with
14657 being the sole exception), and should be treated with some care.
14663 protocol prefixes, and an IMAP-based
14666 IMAP URLs (paths) undergo inspections and possible transformations
14667 before use (and the command
14669 can be used to manually apply them to any given argument).
14670 Hierarchy delimiters are normalized, a step which is configurable via the
14672 variable chain, but defaults to the first seen delimiter otherwise.
14673 \*(UA supports internationalised IMAP names, and en- and decodes the
14674 names from and to the
14676 as necessary and possible.
14677 If a mailbox name is expanded (see
14678 .Sx "Filename transformations" )
14679 to an IMAP mailbox, all names that begin with `+' then refer to IMAP
14680 mailboxes below the
14682 target box, while folder names prefixed by `@' refer to folders below
14683 the hierarchy base, so the following will list all folders below the
14684 current one when in an IMAP mailbox:
14687 Note: some IMAP servers do not accept the creation of mailboxes in
14688 the hierarchy base, but require that they are created as subfolders of
14689 `INBOX' \(en with such servers a folder name of the form
14691 .Dl imaps://mylogin@imap.myisp.example/INBOX.
14693 should be used (the last character is the server's hierarchy
14695 The following IMAP-specific commands exist:
14696 .Bl -tag -width ".It Ic BaNg"
14699 Only applicable to cached IMAP mailboxes;
14700 takes a message list and reads the specified messages into the IMAP
14704 If operating in disconnected mode on an IMAP mailbox,
14705 switch to online mode and connect to the mail server while retaining
14706 the mailbox status.
14707 See the description of the
14709 variable for more information.
14712 If operating in online mode on an IMAP mailbox,
14713 switch to disconnected mode while retaining the mailbox status.
14714 See the description of the
14717 A list of messages may optionally be given as argument;
14718 the respective messages are then read into the cache before the
14719 connection is closed, thus
14721 makes the entire mailbox available for disconnected use.
14724 Sends command strings directly to the current IMAP server.
14725 \*(UA operates always in IMAP `selected state' on the current mailbox;
14726 commands that change this will produce undesirable results and should be
14728 Useful IMAP commands are:
14729 .Bl -tag -offset indent -width ".Ic getquotearoot"
14731 Takes the name of an IMAP mailbox as an argument and creates it.
14733 (RFC 2087) Takes the name of an IMAP mailbox as an argument
14734 and prints the quotas that apply to the mailbox.
14735 Not all IMAP servers support this command.
14737 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
14738 the Other User's Namespaces and the Shared Namespaces.
14739 Each namespace type is printed in parentheses;
14740 if there are multiple namespaces of the same type,
14741 inner parentheses separate them.
14742 For each namespace a prefix and a hierarchy separator is listed.
14743 Not all IMAP servers support this command.
14747 Perform IMAP path transformations.
14751 .Sx "Command modifiers" ) ,
14752 and manages the error number
14754 The first argument specifies the operation:
14756 normalizes hierarchy delimiters (see
14758 and converts the strings from the locale
14760 to the internationalized variant used by IMAP,
14762 performs the reverse operation.
14763 Encoding will honour the (global) value of
14767 The following IMAP-specific internal variables exist:
14768 .Bl -tag -width ".It Va BaNg"
14770 .It Va disconnected
14771 \*(BO When an IMAP mailbox is selected and this variable is set,
14772 no connection to the server is initiated.
14773 Instead, data is obtained from the local cache (see
14776 Mailboxes that are not present in the cache
14777 and messages that have not yet entirely been fetched from the server
14779 to fetch all messages in a mailbox at once,
14781 .No ` Ns Li copy * /dev/null Ns '
14782 can be used while still in connected mode.
14783 Changes that are made to IMAP mailboxes in disconnected mode are queued
14784 and committed later when a connection to that server is made.
14785 This procedure is not completely reliable since it cannot be guaranteed
14786 that the IMAP unique identifiers (UIDs) on the server still match the
14787 ones in the cache at that time.
14790 when this problem occurs.
14791 .It Va disconnected-USER@HOST
14792 The specified account is handled as described for the
14795 but other accounts are not affected.
14797 .It Va imap-auth-USER@HOST , imap-auth
14798 Sets the IMAP authentication method.
14799 Supported are the default
14809 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" ) ,
14814 (for TLS secured connections which pass a client certificate via
14815 .Va tls-config-pairs ) ,
14816 as well as the \*(OPal
14828 which only need the former.
14830 solely builds upon the credentials passed via a client certificate,
14831 and is usually the way to go since tested servers do not actually follow
14832 RFC 4422, and fail if additional credentials are actually passed.
14835 Enables caching of IMAP mailboxes.
14836 The value of this variable must point to a directory that is either
14837 existent or can be created by \*(UA.
14838 All contents of the cache can be deleted by \*(UA at any time;
14839 it is not safe to make assumptions about them.
14841 .It Va imap-delim-USER@HOST , imap-delim-HOST , imap-delim
14842 The hierarchy separator used by the IMAP server.
14843 Whenever an IMAP path is specified it will undergo normalization.
14844 One of the normalization steps is the squeezing and adjustment of
14845 hierarchy separators.
14846 If this variable is set, any occurrence of any character of the given
14847 value that exists in the path will be replaced by the first member of
14848 the value; an empty value will cause the default to be used, it is
14850 If not set, we will reuse the first hierarchy separator character that
14851 is discovered in a user-given mailbox name.
14852 .Mx Va imap-keepalive
14853 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
14854 IMAP servers may close the connection after a period of
14855 inactivity; the standard requires this to be at least 30 minutes,
14856 but practical experience may vary.
14857 Setting this variable to a numeric `value' greater than 0 causes
14858 a `NOOP' command to be sent each `value' seconds if no other operation
14861 .It Va imap-list-depth
14862 When retrieving the list of folders on an IMAP server, the
14864 command stops after it has reached a certain depth to avoid possible
14866 The value of this variable sets the maximum depth allowed.
14868 If the folder separator on the current IMAP server is a slash `/',
14869 this variable has no effect and the
14871 command does not descend to subfolders.
14872 .Mx Va imap-use-starttls
14873 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
14874 Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
14875 IMAP session TLS encrypted.
14876 This functionality is not supported by all servers,
14877 and is not used if the session is already encrypted by the IMAPS method.
14887 .Xr spamassassin 1 ,
14896 .Pf (or\0 Xr regex 7 ) ,
14897 .Xr mailwrapper 8 ,
14900 M. Douglas McIlroy writes in his article
14901 .Dq A Research UNIX Reader: Annotated Excerpts \
14902 from the Programmer's Manual, 1971-1986
14905 command already appeared in First Edition
14908 .Bd -ragged -offset indent
14909 Electronic mail was there from the start.
14910 Never satisfied with its exact behavior, everybody touched it at one
14911 time or another: to assure the safety of simultaneous access, to improve
14912 privacy, to survive crashes, to exploit uucp, to screen out foreign
14913 freeloaders, or whatever.
14914 Not until v7 did the interface change (Thompson).
14915 Later, as mail became global in its reach, Dave Presotto took charge and
14916 brought order to communications with a grab-bag of external networks
14921 Mail, in large parts compatible with
14923 mail, was written in 1978 by Kurt Shoens and developed as part of the
14926 distribution until 1995.
14927 This manual page is derived from
14928 .Dq The Mail Reference Manual
14929 that Kurt Shoens wrote for Mail 1.3, included in 3BSD in 1980.
14934 denominator became standardized as
14936 in the X/Open Portability Guide Issue 2 (January 1987).
14937 After the rise of Open Source
14940 Mail saw continuous development in the individual code forks,
14941 noticeably by Christos Zoulas in
14943 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
14944 Ritter in the years 2000 until 2008.
14945 Since 2012 S-nail is maintained by Steffen Nurpmeso.
14947 Electronic mail exchange in general is a concept even older.
14948 The earliest well documented electronic mail system was part of the
14949 Compatible Time Sharing System (CTSS) at MIT, its MAIL command had been
14950 proposed in a staff planning memo at the end of 1964 and was implemented
14951 in mid-1965 when Tom Van Vleck and Noel Morris wrote the necessary code.
14952 Similar communication programs were built for other timesharing systems.
14953 One of the most ambitious and influential was Murray Turoff's EMISARI.
14954 Created in 1971 for the United States Office of Emergency Preparedness,
14955 EMISARI combined private electronic messages with a chat system, public
14956 postings, voting, and a user directory.
14958 During the 1960s it was common to connect a large number of terminals to
14959 a single, central computer.
14960 Connecting two computers together was relatively unusual.
14961 This began to change with the development of the ARPANET, the ancestor
14962 of today's Internet.
14963 In 1971 Ray Tomlinson adapted the SNDMSG program, originally developed
14964 for the University of California at Berkeley timesharing system, to give
14965 it the ability to transmit a message across the network into the mailbox
14966 of a user on a different computer.
14967 For the first time it was necessary to specify the recipient's computer
14968 as well as an account name.
14969 Tomlinson decided that the underused commercial at
14971 would work to separate the two.
14973 Sending a message across the network was originally treated as a special
14974 instance of transmitting a file, and so a MAIL command was included in
14975 RFC 385 on file transfer in 1972.
14976 Because it was not always clear when or where a message had come from,
14977 RFC 561 in 1973 aimed to formalize electronic mail headers, including
14982 In 1975 RFC 680 described fields to help with the transmission of
14983 messages to multiple users, including
14988 In 1977 these features and others went from best practices to a binding
14989 standard in RFC 733.
14990 Queen Elizabeth II of England became the first head of state to send
14991 electronic mail on March 26 1976 while ceremonially opening a building
14992 in the British Royal Signals and Radar Establishment (RSRE) in Malvern.
14995 .An "Kurt Shoens" ,
14996 .An "Edward Wang" ,
14997 .An "Keith Bostic" ,
14998 .An "Christos Zoulas" ,
14999 .An "Gunnar Ritter" .
15000 \*(UA is developed by
15001 .An "Steffen Nurpmeso" Aq s-mailx@lists.sdaoden.eu .
15003 \*(ID Interrupting an operation via
15007 from anywhere else but a command prompt is very problematic and likely
15008 to leave the program in an undefined state: many library functions
15009 cannot deal with the
15011 that this software (still) performs; even though efforts have been taken
15012 to address this, no sooner but in v15 it will have been worked out:
15013 interruptions have not been disabled in order to allow forceful breakage
15014 of hanging network connections, for example (all this is unrelated to
15017 The SMTP and POP3 protocol support of \*(UA is very basic.
15018 Also, if it fails to contact its upstream SMTP server, it will not make
15019 further attempts to transfer the message at a later time (setting
15024 If this is a concern, it might be better to set up a local SMTP server
15025 that is capable of message queuing.
15027 When a network-based mailbox is open, directly changing to another
15028 network-based mailbox of a different protocol (i.e., from POP3 to IMAP
15029 or vice versa) will cause a
15032 After deleting some message of a POP3 mailbox the header summary falsely
15033 claims that there are no messages to display, one needs to perform
15034 a scroll or dot movement to restore proper state.
15040 mode a power user may encounter crashes very occasionally (this is may
15043 Please report bugs to the
15045 address, for example from within \*(uA:
15046 .Ql \&? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
15049 output of the command
15052 .Bd -literal -offset indent
15053 ? wysh set escape=! verbose; vput version xy; unset verbose;\e
15054 eval mail $contact-mail
15060 Information on the web at
15061 .Ql $ \*(uA -X 'echo Ns \| $ Ns Va contact-web Ns ; x' .