make-config.in: complete path (leftover of [807f64e2], 2015-12-26!)
[s-mailx.git] / TODO
blobe1d6cf4819832006005ea1136e41ef2a5ee2c79f
1 TODO reminder.
3 Rename S-nail to S-mailx in v15.0, change things i've messed with
4 a single, massively backward incompatible change.
6 Release S-mailx v20 on 2020-03-25, the 42nd anniversary of BSD Mail.
7 With a clean, conforming and efficient codebase, then.
9 In general the code is in a pretty bad shape due to the signal handling.
10 I should have sat back in 2012/13 and consider what i am doing.
11 My fault.  If i would, we would have a blocked signal mask anywhere in
12 this software except in a few cases where it is necessary and/or
13 possible to deal with signals, and possibly we would not even have to
14 consider to switch the entire codebase to (the much superior, and the
15 only sane approach) SysV signal handling, without SA_RESTART.
17 But some things are already pretty good, except for normal iterations
18 and a review once we have a better signal handling, and can be taken
19 with us.  For example termcap.c, most of tty.c, shexp.c, memory.c.
20 It all has to be converted to use a mx_ prefix and follow the coding
21 style of the mentioned (mx_ is anything public / external, mx__ is
22 public/e but not really, FILENAME/ABBREV_symbol are statics,
23 FILENAME/ABBREV__symbol are helpers of a single other static (function
24 group) (-> colour.c, lex_input.c: done)).
26 Note n_(UN)?LIKELY() usage is yet a bit weird,
27 we should not use it for entire conditions but instead repeat its use
28 for each subcondition.
30 - We should have generic ENOMEM conditions, now that we have $!.
31   I.e., test overflow (e.g., nam-a-grp.c, whether an alias _can_ be
32   created / extended), like n_ENOMEM_CHECK(INTTYPE, SIZE1, SIZE2, NULL
33   or message), which returns m_bool (now bool_t).
34   Callers need to be aware of NULL returns and pass through errors,
35   then.
37 - We need a "void" box that can be jumped to, i.e., a state in which no box
38   at all is active.
40 -- When a MBOX mailbox is removed while it is opened then changing the
41   folder is not possible.  This is an inherent problem of the Berkeley
42   Mail codebase, and we need to have a fully functional intermediate
43   VOID box mechanism plus an object-based mailbox implementation to
44   overcome it.
46 -- Also, when the folder was modified concurrently we should bail, or,
47    in an interactive session, prompt the user what to do.
49 - IDNA decoding.  Needs a complete design change.
50   (Unless wants to brute force decode anything before display, of course.)
52 - If pipes fail for part viewers then at least the usual PART X.Y should be
53   shown, maybe even including some error message.
54   I had 'set pipe-text/html="lynx -dump -force_html /dev/stdin"' but NetBSD
55   does not have lynx(1), and i thought i've found a S-nail(1) bug.
57 - Line editing should gain possibility of context sensitive tab completion.
59 - Maybe there should be an additional ZOMBIE directive that is served in
60   equal spirit to DEAD, but that could be a valid MBOX... ?
61   What i want is a *real* resend, best if possible from command line.
62   Meaning, also the possibility to postpone a message.  In general.
64 - Having a newsreader would be a really cool thing.  (RFC 977 and 2980)
66 - printhead()/hprf(): support %n newline format (%t tab?).
67   Make it possible to use the *datefield* algorithm for plain From_ derived
68   dates (needs a From_ parser, i.e., strptime()-alike).
69   Once we have that, rename *datefield-markout-older* to
70   *date-markout-older* ??
71   Note that NetBSD's mail(1) has some other nice things.
72   Note also that our code is quite unflexible.
74 - headerpick: add resend-retain/ignore!  (Ralph Corderoy, Norman Shapiro)
75         (Delivered-To thread on nmh.  Will be hard to do because of
76         codepaths!)
78 - -r should be the Sender:, which should automatically propagate to
79   From: if possible and/or necessary.  It should be possible to suppress
80   -r stuff from From: and Sender:, but fallback to special -r arg as
81   appropriate.
83 Low-Level
84 ---------
86 - Improve name extraction rules.  And field parsing.  There
87   are structured and unstructured fields.  There are quoted pairs and
88   comments etc.  Rewrite the entire parsing mechanism to comply to RFC
89   5322, and try to merge all those many subparsers around in the codebase,
90   and accordingly.  So much duplicated work ...
91   Name parsing improved a bit for v13 and v14.9, but it's still broken.
92   yankword(), *extract(), etc.: RFC 5322 says that comments in address
93   fields SHOULD NOT be used (mutt(1) maps them to full name-addr forms if
94   approbiate, even if that actually changes content!!?), and that full
95   name-addr SHOULD be used.
97 - many uses of whitechar() should be spacechar(), and spacechar() should
98   be blankspacechar(), and blankspacechar() should be dropped.  then
99   drop onlywhitechar() again, too.  maybe reduce char_class bits then.
101 - After I/O layer rework we should optionally be able to read RSS
102   (Atom?) feeds -- Expat should be available almost everywhere and
103   should be able to parse that?
104   Atom is harder because it may support html+.
105   I mean, yeah, it's stupid, but we could fill in header fields with
106   dummies and still use S-nail to look into the separated feeds as if
107   they were mail messages; anyway i would like to save me from using too
108   many tools -- three seems reasonable.
110 - `sync'hronize commando -- robin@stjerndorff.org (Robin Stjerndorff):
111     Wondering how to update back to my Maildir, moving new read mails
112     in ~/Maildir from new to cur, without exiting the application.
113     Automation available?  [And simply re-`[Ff]i' involves a lot of
114     unnecessary work]
116 -- Provide sync'ing options -- Jacob Gelbman <gelbman@gmail.com>:
117     If I open two instances of mailx, I then delete a message and then
118     quit in one. Then in the other one I read a message and quit, mailx
119     saves the status of the read message and the fact that a message was
120     deleted, even though it was opened before the other instance deleted
121     it. How is it doing that?  [Of course he was using Maildir]
123 - Add TODO notes for those RFCs:
124   RFC 977 -> 3977 - Network News Transfer Protocol
125   RFC 1036 - Standard for USENET Messages
126   RFC 1524 - True support for mailcap files?
127     TODO YES!  We really need to replace the pipe-TYPE/SUBTYPE mechanism
128     with something real.  When we can work on the parsed MAIL DOM.
129   RFC 1939 - Post Office Protocol v3
130   RFC 2017 - URL External-Body Access-Type
131   RFC 2183 - The Content-Disposition Header
132   RFC 2369 - The Use of URLs as Meta-Syntax for Core Mail List Commands
133              and their Transport through Message Header Fields
134              (RFC 6068 - The 'mailto' URL scheme)
135   RFC 2384,1738 - I.e., Much better URL support
136   RFC 2387 - multipart/related  -- yet handled like /alternative
137   RFC 2392 - Content-ID and Message-ID Uniform Resource Locators
138   RFC 2405 - The format of MIME message bodies.
139   RFC 2406 - Common multimedia types.
140   RFC 2407 - Encoding of non-ASCII text in message headers.
141   RFC 2449 - POP3 Extensions (including SASL)
142   RFC 2595 - TLS for POP3 (among others)
143   RFC 2980 - Common NNTP Extensions
144   RFC 3156 - MIME Security with OpenPGP
145   RFC 3207 - SMTP over TLS
146   RFC 3461, 3464 -
147     Simple Mail Transfer Protocol (SMTP) Service Extension for Delivery
148       Status Notifications (DSNs),
149     An Extensible Message Format for Delivery Status Notifications
150   RFC 3676 - Updates to the text/plain MIME type and extensions for flowed
151     text (format=flowed).   (Martin Neitzel)
152   rfc4315.txt Internet Message Access Protocol (IMAP) - UIDPLUS extension
153   RFC 4422, 4505 - Simple Authentication and Security layer (SASL)
154             (Tarqi Kazan)
155   RFC 4551          IMAP Extension for Conditional STORE
156   RFC 4880 - OpenPGP Message Format
157   RFC 4954 - SMTP Authentication
158   rfc4959.txt IMAP Extension for Simple Authentication and Security
159     Layer (SASL) Initial Client Response
160   rfc4978.txt The IMAP COMPRESS Extension
161   rfc5161.txt The IMAP ENABLE Extension
162   rfc5198.txt Unicode Format for Network Interchange
163   RFC 5246 - Transport Layer Security (TLS)
164   RFC 5321 - Simple Mail Transfer Protocol.
165   RFC 5322 - The basic format of email messages.
166   RFC 5598 - Internet Mail Architecture
167   RFC 5751 - Secure/Multipurpose Internet Mail Extensions (S/MIME)
168     TODO NOTE that our S/MIME support is extremely weak regarding
169     TODO understanding, we should not rely on OpenSSL but instead
170     TODO handle it ourselfs; the RFC says:
171     S/MIME is used to secure MIME entities.  A MIME entity can be a sub-
172        part, sub-parts of a message, or the whole message with all its sub-
173        parts.  A MIME entity that is the whole message includes only the
174        MIME message headers and MIME body, and does not include the RFC-822
175        header.  Note that S/MIME can also be used to secure MIME entities
176        used in applications other than Internet mail.  If protection of the
177        RFC-822 header is required, the use of the message/rfc822 media type
178        is explained later in this section.
179   RFC 6125 - Representation and Verification of Domain-Based Application
180     Service Identity within Internet Public Key Infrastructure Using
181     X.509 (PKIX) Certificates in the Context of Transport Layer Security
182     (TLS)
183   RFC 6152 - SMTP Service Extension for 8-bit MIME Transport
184   RFC 6409 - Message Submission for Mail
185   rfc6530.txt Overview and Framework for Internationalized Email
186   rfc6531.txt SMTP Extension for Internationalized Email
187   rfc6532.txt Internationalized Email Headers
188   rfc6854.txt Update to Internet Message Format to Allow Group Syntax in
189     the "From:" and "Sender:" Header Fields
190   rfc6855.txt IMAP Support for UTF-8
191   rfc6856.txt Post Office Protocol Version 3 (POP3) Support for UTF-8
192   rfc6857.txt Post-Delivery Message Downgrading for Internationalized
193     Email Messages
194   rfc6858.txt Simplified POP and IMAP Downgrading for Internationalized Email
195   RFC 7162                IMAP CONDSTORE & QRESYNC
196   RFC 8058 Signaling One-Click Functionality for List Email Headers
198   draft-ietf-uta-email-tls-certs-01.txt
199    SMTP security via opportunistic DANE TLS draft-ietf-dane-smtp-with-dane-15
200   draft-melnikov-smime-header-signing
201    Considerations for protecting Email header with S/MIME
202   Read https://tools.ietf.org/html/draft-ietf-uta-tls-bcp-07.
203     Can we implement OCSP (see RFC 6066; -> RFC 6960)????
205 - This is how the codebase has to be reworked in respect to signals and
206   jumping:
208   1. We introduce some environment/carrier structs: struct eval_ctx,
209      struct cmd_ctx, (struct send_ctx).  All of these form lists.
210      eval_ctx gets a new instance every time evaluate() is entered; for
211      the interactive mode, commands() instantiates an outermost eval_ctx
212      that "cannot be left".
214      cmd_ctx knows about the eval_ctx in which it is was created; it is
215      created for each command that has an entry in cmd_tab and is passed
216      as the new argument of these kind of functions.
217      (send_ctx is the carrier for the MIME and send layer rewrite.)
218   2. cmd_tab handling becomes more intelligent: add bit fields so that
219      for some arguments (i.e., the first two or three) automatic
220      normalization can be specified, like whitespace trimming, like
221      automatic expansion of variables etc.  For getrawlist.
222      It knows about the short synopsis and longer help of its program.
224       - and: commands that work only in interactive mode, and are
225         _silently_ ignored otherwise (no error).
226         I.e., commands which work on only with true user interaction
227         should not need to take care no more, but simply assume that
228         there will be true user interaction.  And like that.
230      E.g., customhdr header field is always to be WS trimmed, just the
231      same as the body.  shortcut at least should have trimmed name, etc.
232      To do that right, properly parse from left to right, take care
233      about backslash escaping, and (optionally) expand shell variables
234      and backtick substituations.
236      The cmd_ctx needs to carry around the cmd_tab structure so that the
237      commands can themselves print the synopsis in case of errors --
238      alternatively we need a return bit which should cause the command
239      callee to emit the synopsis as an error message, whatever is best.
240      Some (hopefully) duplicate occurrances of such strings can vanish.
241   2.1 We have some commands which offer "show" subcommands.
242       Those should only work in interactive mode OR SO.
243       This could be done with a flag, too.  (Driven from the lexer.)
244   X. Offer a central "`[un]onevent' EVENT MACRO [conditions]" register.
245      Change all hooks to use that one, optimize the case where a single
246      macro is registered for a single event but with different
247      preconditions.
249      E.g., "on_interactive_mode_enter" could then be hooked to call
250      `bind' and set `colour's, for example.  In conjunction with 2.
251      above those commands could simply be (silent, successful) no-ops
252      before we reach that state (and again after
253      on_interactive_mode_leave is processed).
255   8. The line buffer used in evaluate() that is passed through to
256      commands (thus: in cmd_ctx, then) needs to become `const'.
257      (I tried to do so in the past, but some commands write into it,
258      thus i stopped and iirc even added some changes on my own which
259      take favour of reusing that buffer.)
260      + Macro execution then no longer needs to clone the macro content
261      lines before executing then.
262      + The command context also takes preparsed command array if so
263      specified in cmd_tab, and entries are cleaned up (see 2.)
264   9. We should unite all the un*() commands with their non-un*
265      versions, if they have one.  They may take a different argument
266      list etc., but only one entry in the command table for such.
267      - The POSIX standard command abbreviations must remain, so maybe
268        outsource those in a hashtable or whatever that is checked first,
269        but detach command table order from that anyway.
270      - Offer a(n optional, and on/off switchable) Damerau-Levenshtein
271        mode for command completion;
272  10. We MUST switch the entire codebase to use SysV signal handling, don't
273      do the BSDish SA_RESTART, which is why we still suffer the way we
274      do and need jumps.  I can't dig BSD signal handling, and never ever
275      did so myself until i got here.
276  20. The attachment charset selection loop can then be rewritten to
277      check whether an ^C occurred and treat that as end-of-loop
278      condition.  In v14.6.3 this was introduced, but it should act
279      differently depending on whether the interrupt occurred during
280      character set selection or attachment filename input.
281      Also in respect whether the interrupt is "propagated" or not.
282      It's ugly, and documented accordingly.
283  30. It should be considered to drop many variables in favour of
284        ?SEARCH usage for keys, or key=value pairs, e.g.
285         smtp://exam.ple?starttls=yes;smtp-hostname=;
286        etc.   USER@HOST is neat, but that is possibly preferable?
287        Question: what is with smtp-hostname and such??
288  31. Flag updates of individual messages must find their way through to
289      the protocol.
290  32. Use deque (on partial views).
291  34. We need a new abstraction: `vie[ws]'.  I.e, viewset, viewclear,
292      view(show|look)?  We will have (possibly readonly) boxes, a summary
293      cache file, which is created when a mailbox is read in, and all
294      that crap that we currently have (setptr(), setmsize(), etc.!) must
295      vanish.  Instead there is another, in-memory abstraction, the view.
296      Some views are built-in and are somehow selectable (the "all" view,
297      for example, and the "new" view).
298      It is possible to make a view persistent by giving it a name, e.g.,
299      'viewset NAME MSG-SPEC' -- 'viewset allnew :n' (and 'viewset XY `'
300      or something must be capable to tag the last a.k.a current).
301      Switching to a named view would thus look over the entire current
302      view (!) for all messages that comply to the message-spec of the
303      view, then create a sorted/threaded display of that subset and
304      create a new anonymous "result" view.  It must be possible to
305      specify that a view is to be applied to the entire mailbox instead
306      of the current view, via a simple easy understandable syntax.
308      Or name it "msgset".
309      We won't extend macros that much because it would require much too
310      much logic for no purpose, instead we'll (hopefully) add some
311      scriptable abstraction, with an optional built-in Lua binding.
312      E.g., it would be too complicated to create a language to access
313      individual message parts (headers etc.), add error handling etc.
314      Better to make it all directly accessible via language binding, and
315      offer commands which relinquish execution to such a binding, maybe
316      even with some arguments, as in "? lua ARG" - it should be possible
317      that ARG is a msgset, then.
318      On the other hand, ~^ text-protocol stuff isn't that bad, and if
319      a text-protocol command mode could be added, that would be cool.
320      Even things like 'create temporary file', write data until EOT in
321      descriptor / temporary file / etc. and such!
323      But what macros should be able to do is iterating over such
324      a msgset / view, as in
325         msgset create NAME :SPEC:
326         msgset add NAME :SPEC:
327       and then either
328         for[-each] NAME
329           normal-cmd SOMEHOW-REFER-TO-ITER
330           if SOMEHOW-ACCESS-LAST-STATUS
331           endif
332         endfor
333       as well as
334         msgset cmd NAME normal-cmd
335       and even
336         normal-cmd NAME
337       in which case NAME should simply be treated as a SPEC, likely that
338       this requires a new trigger, though, e.g. {NAME}, [NAME] or !NAME...
339       I.e., the new namelist (likely a deque) should contain MsgRef
340       objects which point to a Message and a Mailbox (for cross-mailbox
341       msgset's and without the need for a Message to store a pointer to
342       the owning mailbox?  Or make MsgRef a superclass that may have
343       a subclass which offers such cross-refs).
345  50. Support SASL, unite all GSS-API etc. under an abstraction!
346      Maybe even drop direct GSS-API and support only through SASL.
347      That is, we can very well provide our own little SASL-client
348      abstraction with what we have already by simply defining some
349      "readline" abstraction plus struct ccred for use by the
350      authentication layer: the protocols must set it up by passing in
351      a line of authentication mechanisms and a callback mechanism.
352      Possibly the user should be able to permit or forbid automatic
353      selection of GSS-API (to avoid useless round-trips) etc. etc.
354  80. The MIME rewrite: mime_parser <-> mime "DOM" analyzer <->
355      selectively create filter chains per part and do XY.
357      This also affects sending, and it will allow us to dig MIME
358      (multipart) mail for -t/-m _correctly_.  Also in sofar as we can
359      hook a content-decoder before diving into the MIME structure, and
360      with a DOM, we can re-encode such things properly as we (re)send
361      such mails.  All this is wrong at the time of this writing!
362      We still need to special treat things like, e.g., RFC 2046, 5.2.1.
363      But on top of we-can, as opposed to the opposite.
365     (Brezn Stangl, brezn DOT stangl AT yandex DOT com)
366  99. Now i'm dreaming some more: with the new object-based approach
367      multiple mailboxes could be in an open state.  And it should be
368      possible to do so for the user (`file' and `folder' are required to
369      quit the current mailbox [first -- this not yet]), which is why we
370      either need new trigger characters or new commands.
371      The absolute sensation would be joinable operations over multiple
372      open mailboxes, e.g., views over multiple such!
373 100. If i say `p 3 2 1' then i mean `3 2 1' not `1 2 3'.
375 - The thread sort doesn't get
377     [A is deleted]
378     B answers A
379       C answers B
380       D answers B
381     E is unrelated
382     F answers A
384   The current sort fails to recognize that F and the thread starting at
385   B are related, which results in a mess.
386   Tests: 41.bad-thread, 58.bad-thread ..
388 -- Being able to sort the outermost level of threads was a suggestion
389    of Rudolf Sykora, especially being able to sort the outermost level
390    according to the date of the newest message in a thread.
392 - Drop **use-starttls* in favour of something better: support 'auto',
393   'no' and 'yes' and act accordingly.  For the former be smart enough on
394   the protocol side.  (RFC 3207 describes man-in-the-middle attacks due
395   to 'auto' TLS, so explicit 'yes' should be favoured).
397 - NOTE: we do not really support IPv6 sofar in that we are not prepared to
398   deal with IPv6 addresses (as in '[ADDR]:PORT').  Pimp url_parse().
399   And socket I/O.
401 - I had a connection collapse during a POP3 download, and neither was
402   there a chance to get access to the 22 yet downloaded mails (after
403   five minutes of waiting followed by CNTRL-C), nor did the layer
404   recognize this very well (got myriads of `POP3 connection already
405   closed.' messages, btw., the thirty-something messages which were not
406   yet downloaded caused (after CNTRL-C) this: ETC. ETC.
408 - I got an email in base64 that obviously used CRNL line endings, and once
409   i've replied the CR where quoted as *control* characters.
410   Get rid of those (kwcrtest.mbox; may be hard to do everywhere for some
411   time, due to how we deal with I/O and Send layer etc).
413 - edit.c doesn't do NEED_BODY (but IMAP won't work anyway).
415 - Stuff
416   .. s-nail </dev/null should work interactively when STDERR_FILENO is
417     a terminal!  (Built-in editor; how do editline and readline work?
418     should this be documented?  What does NetBSD Mail do?  Should we NOT
419     be interactive??  POSIX says for sh(1) (APPLICATION USAGE): 'sh
420     2>FILE' is not interactive, even though it accepts terminal input.)
421   . Just like the RFC 3676 link above, it would be nice if it would be
422     somehow possible to recognize links in a document; i don't know yet
423     how this could be achieved without losing formatting information (i
424     mean, we could enable this and inject terminal colour sequences, but
425     one should be able to say 'follow link x', starting an action
426     handler, and the 'x' must come from somwhere - simply injecting
427     '[NUMBER]' references distorts visual).  Anyway, it's just a filter
428     that recognized the usual <SCHEME:/> stuff, and of course we can
429     simply have a buffer which records all such occurrences, so that
430     user can say '? xy NUMBER', but without the context it soon gets
431     hard.
432   . TTY layer: the tc*() family may fail with EINTR, which MUST be
433     handled; setting also generates SIGTTOU when we're not in foreground
434     pgrp, so we better deal with all that and ENSURE WE GET THROUGH when
435     resetting terminal attributes!
436   .. TTY "I guess it would be much better to create our own session via
437      setpgid(2) and then tcsetpgrp(3) any processes we run synchronously,
438      and properly deal with SIGTTOU, but it always has been like that and
439      i won't do that before other things have been changed.
440   .. NOTE: TTY: place (at least n_child_run()) childs which go over
441      terminal into own group.
442      Introduce global "terminal state" manager which tracks who
443      currently owns the terminal, so that we can gracefully switch it
444      on/off, check in main loop whether restore is necessary.
445      It that can deal with multiple "windows" then we could have open
446      multiple of those, i.e., multiple PAGER instances, and non-PAGER
447      instances (fflush() if there is FILE before switch off).
449      TTY thus: "needsterminal" could be driven gracefully EVEN IF
450      a PAGER is open because the current user action is "print*", since
451      we KNOW that there is a PAGER and can temporarily lay it down to
452      sleep, fflush()ing/adjusting as necessary, and wake it up again
453      afterwards (or, with some work, gracefully shut it down if ^C ^C).
454      This is of course also true for user questions ("really display
455      part XY?", "need decryption password:", etc.!!!)!!
456   . Remove all occurrences of mbtowc() with mbrtowc(); temporarily add (some)
457     global mbstate_t objects until the send / MIME layer rewrite is done and
458     has the carrier.  Use flip states and add aux funs with only update the
459     state+toggle on success -- CURRENTLY MBTOWC FAILURES ARE PRACTICALLY NOT
460     HANDLED!!
461     P.S.: the standards do not allow that well at all.
462     Since we work so much with *ttycharset* we would need
463     a setlocale_from_charset(), but which does not exist (except
464     implicitly for UTF-8 locales).  But we need char classification!
465     This task up to S-CText.
466   . which_protocol(), *newmail* mechanism, displayname, mailname: all of
467     this <rude>SHIT</rude> must vanish and be replaced by a URL, and
468     a nice "VFS" mailbox object that carries all necessary state so that
469     one can work with it.
471     If not mentioned somewhere else: struct message should be splitted
472     into a tree of objects, with a base class that has as few fields as
473     possible; the global *message should be a deque, only accessible via
474     iterator; it should store pointers to (the actually used subtype of)
475     message structures instead; i.e., for maildir boxes the path is yet
476     allocated separately, then it could be part of the message object,
477     etc.
478     It should contain a ui8_t that tracks the number of contained parts,
479     so that the "fits-onto-the-screen" tests are more useful than today;
480     i think 8-bit is sufficient, with 0xFF meaning more-than-fits-here.
481   . Given how many temporary files we use, it would make sense to
482     support a reusable single temporary file, as in singletmp_take() and
483     singletmp_release(), where singletmp_release() would close and thus
484     drop the file if it excesses a specific (configurable) size, and the
485     mainloop tick would close it (after X (configurable) unused ticks))
486     otherwise.  I guess this would improve performance for searching
487     etc. etc.
488   . _(), N_(), V_():
489     use GNU tools for extraction etc., and write a simple helper program
490     which converts these files to a serialized hashmap, just like we did
491     for the okeys (and *exactly* so); add a config check whether the ({})
492     extension is supported and finally use that for some ({static char
493     const *tr_res;}) injection optimization, then.  (Think SFSYS)
494   . Searching body/text yet includes headers from attachments and
495     attachment data.  This is shit.  :)
496   . The "nifty" unregister_file()->_compress() mechanism that even
497     shovels '-Sfolder=imaps://user1@localhost -Srecord="+Sent Items"'
498     *records* calls clearerr() on the descriptor before performing it's
499     action anyway.  when we really make it even to the I/O rewrite, it
500     should be possible to dis-/allow such -- it doesn't make sense to
501     add something faulty to whatever was not faulty before!
502   . `dp' prints EOF at the end of a thread even if unread messages
503     follow
504   . `resend' doesn't smime-sign.
505   . Really do extend the test already today; test S/MIME
506     signing/encryption/decryption with two pairs of identities, instead
507     of of one.
508   . RFC 5751 describes a message multipart layout that also includes the
509     headers in the signature; it would be nice (for completeness sake)
510     to be able to support that.  Note shutup@ietf.org.
511   . The capability to save a message under the name of a recipient is in
512     the standard etc., but i've never used it.
513     What would be cool, otoh, would be if there would be the possibility
514     to register a regular expression, and if just *any* recipient of
515     a message matches, store the message in the given folder instead.
516     I.e., if i send a message to s-nail-users@ then i most likely want
517     to get a copy to the corresponding box, regardless of whoever the
518     message was sent To: Cc: or Bcc: else..
519   . mutt list handling (`~') is very powerful
520   . We have some use of *at() functions, especially anything which
521     temporarily switches cwd.
522   . *newmail* is terrible.  At some later time we need to do somethings
523     with timeouts etc. (for MBOX and Maildir it's not that bad, but for
524     anything over the network, yet the mentioned may come in over NFS).
525     Remove it until we have something better?
526   . The RFC 8098 *disposition-notification-send* mechanism is yet not
527     truly conforming (and works with *from*).  Also, this is only the
528     sender side, there should be support for creating the MDN response.
529     (Maybe ternary option: off (default),
530     create-when-unread-flag-goes-away, ditto-but-also-strip-header)
531   .. Also, there is DSN as a SMTP extension, see the RFCs 3461, 346 (as
532      above) and 6522 (Wikipedia).
533   . The var_* series should return "const char*" not "char*".
534     This should already work today because otherwise we would get SEGV
535     all through the way.
536   .. While here: rename enum okeys to enum internal_variables, and the
537      ok_*() series to iv_().  And see below for env_*() series.
538   . fexpand() the 2nd: it should return structure because we need to
539      check for FEDIT_SYSBOX, which currently only checks whether the first
540      character of a file name is '%', not whether it is '%', '%:FILEPATH'
541      or '%VALIDUSER', because that is impossible to do!
542   . On the long run in-memory password storage should be zeroed after
543     use, possibly even encoded *during* use.  After v15.
544   . We need a `spamcheck' command that is like `spamrate' but updates
545     the mail in-place, i.e., with the headers that the spam engine adds.
546   . __narrow_suffix() is wrong (for stateful encodings that we
547     don't support yet) and should inject a reset sequence if it shortens
548     the string.
549   . When a user edits a specific header, it should no longer be
550     modified.  (Do not loose knowledge that collect() edited it.)
551   . Regular expression list resorting is no good; the user should be
552     able to specify a match order weight, as in:
553       mlist 10 a@b.org 8 c@d.org .*@else@org 0 almost@never.com
554     So: optional digit 0-10, where 0-4 are never relinked and always
555     placed at the tail, 6-10 are never relinked and always placed at
556     head (all in decreasing order, head to tail), and 5 is the implicit
557     value, placed in between and automatically resorted just as is the
558     sole algorithm we currently have.
559   .. And maybe we should have an event mechanism with one-shot etc..
560      Then install a resorter function when we actually have lookups and
561      one-shot sort the entire thing once (when the loop ticks).
562      Instead of busy resorting, that is.
563   . The new internal ~/$ expansion mechanism should get support
564      for POSIX parameter expansions ${[:]-} and ${[:]+} (and ${[:]?}).
565      There is no real way to get the functionality otherwise...
566   . Make S/MIME an option separate of SSL/TLS, i.e., optional.
567   . With very long input Heirloom mailx(1) / S-nail(1) can produce
568     encoded-words (RFC 2047) with incomplete multibyte sequences (i.e.,
569     non self-contained encoded-words).
570   . Group addresses, especially the undisclosed recipients but also
571     "Bla": addresses; are missing.
572   . Per-folder (S/MIME) en- and decryption key (Tarqi Kazan): if a xy
573     variable is set (that points to a key) add a transparent en- and
574     decryption layer on top of any per-message operation (for boxes for
575     which the variable is set).
576   . For v15.0: remember private thread with Tarqi Kazan (2015-05) and
577     try to improve situation with *record*, so that only messages enter
578     it which have really been sent.  If we support postponing and have
579     a multi-process layout and add an intermediate *record-queue* we
580     may be able to improve the situation.
581   . [Dd]ecrypt should transport decryption errors, not silently be like
582     copy and copy undecrypted content, because this is what it's for?
583     ..We need atomic operations with rollback support in order to make
584       this happen, but i think maybe file truncation (decryption always
585       appends?) is enough provided that files are locked?
586       WE NEED ATOMIC OPERATION SUPPORT for quite some operations.
587       Man, are we far from that.
588   . `pipe' is total shit regarding MIME.  We need some defined and
589      documented method to configure which parts are displayed and/or how
590      they are visually separated.
591   . The new n_err() facility is nice, but we need n_msg() too, maybe
592     more.  Maybe à la Log:: and macro wrappers with priority unrolled,
593     then add user-settable treshold, too.  Btw. C99 adds vararg macros.
594     .. We must handle embedded newlines properly
595     .. In PARTICULAR we MUST NOT use stdout when in batch mode:
596          ssh X "echo 'move * |cat' | s-nail -#f %" >> download
597        should do the right thing, but can't like that due to unwanted
598        noise in the stdout output!  Best would be if it would be
599        possible to explicitly define a file/dev to be used, but falling
600        back to stderr in batch mode otherwise. (think S-Web42)
601   . Exit status handling is sick.
602   . *mime-allow-text-controls* is a no-brainer: instead we should
603      introduce something that allows us to switch and detect UTF-16 once
604      we run into the problematic situation, then start all over in an
605      Unicode mode?  I.e.: continue to force the user to set such
606      a switch, but do it in a sensible fashion, because the UTF-16 data
607      stream may nonetheless contain control characters??
610   . We can "steal" features from msmtp(1) that make sense: /etc/aliases
611     ($mta_alias_file).  At least postfix(1) also supports file and pipe
612     addressees...  It also supports include files via :include:/filename
613     but which i think should be supported in a second step.  Ditto
614     caching (timestamp check and a mechanism to support/disable
615     caching.)
619 . smime_verify(): only dump the multipart that is signed into the file for
620   verification purposes.  DOCUMENT that only the FIRST such part is verified.
621   Ditto, we don't decrypt but on toplevel.  Sic.
623 . convert iconv so that it always "places the reset sequence" i.e.
624  finalizes the string properly.  we don't do this at all right now!
626 . -:, *mimetypes-load-control*, ?, should honour the given load order; as
627   appropriate, add a "b" for built-in!
628   It happened to me that i searched for at least 30 minutes for a bug
629   that resulted in text/plain not text/x-diff only to find out that this
630   was because of ArchLinux's /etc/mime.types!
632 . getapproval() should support a TRUM1 return, meaning "cancel",
633   to be understood as appropriate.
635 . `mbox' _can_ be made usable anywhere with yet another PS_MBOX global
636   bypass!  ditto touch,save,Save
638 . We should be much smarter regarding when we allow a PAGER
639   etc. to be used, which is supposed to be a possibly useful thing in
640      $ s-nail -Scrt=0 >LOG 2>&1
642 . when doing Lreply we may ask for Reply-To:, but strip out the address
643   actively even if user said yes to the question.  That should not
644   happen?  It somehow matches the documentation however.  unsure.
646 . if -t is used and the file includes Mail-Followup-To:, then we should
647   NOT add to it, OR we need to offer a way to get there!
649 # s-ts-mode