Re: [S-mailx] Fwd: Re: signature

2022-09-16 Thread Steffen Nurpmeso
Steffen Nurpmeso wrote in
 <20220916232307.d3bwb%stef...@sdaoden.eu>:
 |..hm, i am about to evaluate what i press with these now..

Ah!  Oh!  They were private messages.


Sorry Stephen!!!


Time to go now, i think. :}

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


[S-mailx] Fwd: Re: signature

2022-09-16 Thread Steffen Nurpmeso
..hm, i am about to evaluate what i press with these now..

--- Forwarded from Steffen Nurpmeso  ---
Date: Sat, 17 Sep 2022 01:17:30 +0200
Author: Steffen Nurpmeso 
From: Steffen Nurpmeso 
To: "Stephen Isard" 
Subject: Re: [S-mailx] signature
Message-ID: <20220916231730.go3bi%stef...@sdaoden.eu>
OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; 
url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt

Stephen Isard wrote in
 <2371-1663367648-862...@sneakemail.com>:
 |> I also rewrite splice hook docu with credits to you.
 |
 |Sure, that clarifies it (somewhat) for me, but really a new user who 
 |just wants to include a signature shouldn't have to take that in, even 
 |if they manage to find it.  Please don't remove the signature variable. 
 |Adding a signature is the only case of splicing that most users will 
 |ever care about and it ought to be straightforward.

Isn't it much easier to write

  set message-inject-tail=$'\nMoney\nGet back\nGrab that cash!'

than to have a dedicated signature _file_?

I really want to have this go.  It is obsoloted for over half
a decade, without anyone complaining about it!

Btw i first only used the standardized *sign* and *Sign*
variables.  They are in POSIX, they were in mailx of the 10th
edition, in 1991.  In fact i do it still, both, and then

  \set message-inject-tail=$sign

Really i want to have this go.  v14.10 will ship better examples,
also for message-inject-tail, with credit to you.

  ? set sign=$'\n  Tony'  Sign=$'\n  Tony\n  I am fixing things!'
  ? set message-inject-tail=${Sign}

Fix it again, Tony!
Ciao.
  ...
 -- End forward <20220916231730.go3bi%stef...@sdaoden.eu>

Almost prophetical.  hmhm

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


[S-mailx] Fwd: Re: signature

2022-09-16 Thread Steffen Nurpmeso
Sorry, somehow false keypress.

--- Forwarded from Steffen Nurpmeso  ---
Date: Sat, 17 Sep 2022 00:20:13 +0200
Author: Steffen Nurpmeso 
From: Steffen Nurpmeso 
To: "Stephen Isard" 
Subject: Re: [S-mailx] signature
Message-ID: <20220916222013.9o0q2%stef...@sdaoden.eu>
OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; 
url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt

Stephen Isard wrote in
 <1791-1663362752-327...@sneakemail.com>:
 |> Well the splice hooks run in a dedicated subprocess that can act
 |> "as if it were a user", so you basically have to echo the commands
 |> you want "the user" to run.  The process itself can only run
 |> a restricted set of commands itself (it is a separate process,
 |> say).
 |
 |I maintain that that is pretty fancy stuff and a user shouldn't have 
 |to get into it to include a signature.

Ah, it is not so bad.  And hopefully better now.
In the end this is not about:config!!
But thanks, yes, over the years i became even more idiotic than
i naturally am, good to hear other voices!!

(In fact there is a major rewrite of the manual going on _because
of that_, Ashton Fagg came over with critics, and i think the
first radical stretch, the first 51% of the manual, says vim,
improved language quite a bit: 3107 insertions(+), 3405
deletions(-).  But it is much too large, and it is not as easy as
clicking a button or two.  And then the program is so _incapable_
of doing things that it drives me up the wall.)

A nice weekend i wish, .. even to America!!
  ...
 -- End forward <20220916222013.9o0q2%stef...@sdaoden.eu>

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


Re: [S-mailx] signature

2022-09-16 Thread Steffen Nurpmeso
Steffen Nurpmeso wrote in
 <20220916204431.ldtoq%stef...@sdaoden.eu>:
 ...

I also rewrite splice hook docu with credits to you.

 These hooks run after compose mode is finished, but before
 on-compose-leave[492].  Both are executed in a subprocess, with
 their input and output connected such that they can act like an
 interactive user: S-nail's output they read[252], input for
 S-nail they can echo[184].  Whereas the latter is a SHELL[638]
 command, the former is a define[173]d macro that is evaluated
 in a restricted mode with only a small set of commands avail-
 able (the verbose[611] output of for example list[219] indi-
 cates the `subprocess' capability).

 In the subprocess (a restricted set of) COMMAND ESCAPES[30]
 will always be available.  For guaranteed reproducibilities'
 sake escape[416] and ifs[444] are set to their defaults.  The
 escape ~^[320] has been especially designed for scriptability:
 the first line these hooks will read on standard input is the
 escape's protocol version ("0 0 2"), backward incompatible pro-
 tocol changes have to be expected.

 Care must be taken to avoid deadlocks and other false control
 flow: if subprocess and S-nail both wait for more input, or if
 one does not expect more input, whereas the other waits for
 consumption of its output.  Hooks are not automatically syn-
 chronized: if a hook emits `~x' to cause S-nail to exit compose
 mode, the subprocess will keep running nonetheless until the
 macro is completely worked or xit[309] is called explicitly.
 They will however receive a termination signal if the parent
 enters an error condition.  [v15 behaviour may differ] Protec-
 tion against and interaction with signals is not yet given; it
 is likely that in the future these scripts will be placed in an
 isolated session, which is signalled in its entirety as neces-
 sary.

Ciao!  And thanks (and sorry -- ach, i hate it!)

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


Re: [S-mailx] oauth timeout

2022-09-16 Thread Steffen Nurpmeso
Stephen Isard wrote in
 <472-1663353345-38...@sneakemail.com>:
 |On Fri, 16 Sep 2022, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:
 |...
 |> So for now there is _nothing_ you can do.
 |
 |That's what I suspected.  It's possible that the davmail thing that I 
 |mentioned last week takes care of renewing its tokens on time.  That 
 |could be the way to go.

Yes it is a pity.  Sorry!
I would need say 1/2 year or better twice as long where i can
really sit down and work in silence, consciously and dedicated,
six hours or more in a row, a day.  This is impossible here, too
much to do in the household, and with the animal friends an hour
away, back and forth.  I am (still) hoping we can leave for
a little piece of land in the south where it all comes together
_soon_.  But not yet, unfortunately.

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


Re: [S-mailx] signature

2022-09-16 Thread Steffen Nurpmeso
Hello Stephen.

Stephen Isard wrote in
 <853-1663355387-506...@sneakemail.com>:
 |On Fri, 16 Sep 2022, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:
 |...
 |> Well ok but the manual includes a fully spelled out example for
 |> on-compose-splice:
 |>
 |>   define ocs_signature {
 |> read version
 |> echo '~< ~/.mysig' # '~}
 |>   set on-compose-splice=ocs_signature
 |
 |This works, but I don't actually understand how.  The man page says that 
 |'read' reads a line from standard input and assigns it to the given 
 |variable.  What is standard input going to be in this case?  Is it the 
 |output of echo?[.]

Well the splice hooks run in a dedicated subprocess that can act
"as if it were a user", so you basically have to echo the commands
you want "the user" to run.  The process itself can only run
a restricted set of commands itself (it is a separate process,
say).

 |[.]The given variable is 'version', which is read-only, so 
 |can't get assigned to.  What causes the quoted string to get evaluated?

Oops.  Well i think bitrot hammered into this one.  I'll fix it in
a second, thanks for noticing!  (And as above.)

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


Re: [S-mailx] signature

2022-09-16 Thread Stephen Isard

On Fri, 16 Sep 2022, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:
...

Well ok but the manual includes a fully spelled out example for
on-compose-splice:

  define ocs_signature {
read version
echo '~< ~/.mysig' # '~

This works, but I don't actually understand how.  The man page says that 
'read' reads a line from standard input and assigns it to the given 
variable.  What is standard input going to be in this case?  Is it the 
output of echo?  The given variable is 'version', which is read-only, so 
can't get assigned to.  What causes the quoted string to get evaluated?


Stephen Isard


Re: [S-mailx] oauth timeout

2022-09-16 Thread Stephen Isard

On Fri, 16 Sep 2022, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:
...

So for now there is _nothing_ you can do.


That's what I suspected.  It's possible that the davmail thing that I 
mentioned last week takes care of renewing its tokens on time.  That 
could be the way to go.


Stephen Isard


Re: [S-mailx] oauth timeout

2022-09-16 Thread Steffen Nurpmeso
Stephen Isard wrote in
 <32464-1663350444-642...@sneakemail.com>:
 |It turns out that using on-main-loop-tick to check whether it is time to 
 |renew the auth token doesn't cover the case where you spend a long time 
 |writing a message in the external editor.  You come back from the editor 
 |to find that imap has timed out and there is no open folder.

Yes.
The main loop ticks whenever a mailx command can be entered.

 |Since I have defined an account for logging in with oauth, I should be 
 |able to give the command
 |account oauth
 |to reconnect.  However, I find that I have to issue the command twice. 
 |The first time, I just get a message that there is no open folder.

Well there is an old account that is now bogus.  That is one of
the problem with setting inbox aka folder to an IMAP account.
This software never got this right, Stephen, it needs the I/O and
MIME layer rewrite to get over all these problems.

 |Is there some way of trapping the imap disconnection error to trigger a 
 |new 'account oauth'?  I see code snippets involving 'trap' in the man 
 |page, but no entry for it in the list of commands.

No.  I _could_ add a hook in v14.10 that could be sprung in the
-keepalive- machinery, but that is in a signal handler, since that
is driven by ALARM yet.  That is the problem with this software...
One should always have a non-blocking event loop that only sleeps
sitting on select(2) (now *poll, kevent, or what), waiting for
events to happen.  Everything else is grazy.  If that is no good,
you need to separate UI and machinery, i think Rob Pike did so
first with the sam text editor in the early 80s.  With OAuth and
its hm user location tracking capabilities, at least for many
maybe the majority, that primitive way that Heirloom unfortunately
followed for at least mailx (the doctools are a different thing,
as far as i know).  Yes how often i said this, i should have
thrown it away, take the signal-clean minimal OpenBSD variant, and
then just take over what is necessary.  We would be at
a completely different level.  My fault.  I never overtook
maintainership of a wreck (that has had some great ideas).

I would normally suggest driving a cron job that then creates
shared credentials to be used by many programs, with S-nail only
picking up the latest when necessary.  I mean i _could_ hack some
concurrent loop in for v14.10 to drive this mess.  In fact
i rather hammered against a wall two years ago, because of all
this, OAUTH with its HTTP[123] / JSON / TIMEOUT mess.  Very user
unfriendly, almost fascist.  Is it.  You have even seen the web
interfaces these giant companies throw upon you.  I always said
Kerberos / kinit is much nicer.  The timeout problem is a bit
easier, at least.  The renewal is a lot so.

So for now there is _nothing_ you can do.  But driving an external
thing, via cron, or a simple backgrounded job.  It seems to me you
_could_ use the shell (`!') command within an account to create
a backgrounded thing, and on-account-cleanup to kill it.  This,
however, does not help with refreshing the credentials within
s-nail, within the open connection, of course.

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


Re: [S-mailx] signature

2022-09-16 Thread Steffen Nurpmeso
Hello Stephen.

(..yaya i will look at modifying the fetchmail oauth thing for
s-nail in the upcoming days, next week thus likely..)

Stephen Isard wrote in
 <31588-1663344718-314...@sneakemail.com>:
 |Steffen,
 |
 |I don't use a signature myself, but a colleague who does recently 
 |updated his s-nail from the out of date version in the ubuntu repository 
 |and got a warning that signature was obsolete and he should use 
 |on-compose-leave and message-inject-tail.  That is, replace the single 
 |line
 |
 |signature=~/.signature
 |
 |whose meaning is pretty obvious to the ordinary user, with half a dozen 
 |lines of - if you will forgive my saying so - rather arcane low level 
 |code.  You shouldn't have to understand the semantics of "vput csop" 
 |to include a signature your emails.
 |
 |Please don't misunderstand. I think it is great that you have exposed 
 |low level workings of s-nail so that, for instance, someone who wants to 
 |include different signatures for different classes of recipients can 
 |arrange that.  But it shouldn't be at the expense of over-complicating 
 |everyday use.  Please retain the signature variable.

message-inject-tail.  signature loads a file.
Well ok but the manual includes a fully spelled out example for
on-compose-splice:

   define ocs_signature {
 read version
 echo '~< ~/.mysig' # '~MAILX)_TAIL.
With credits to you this "duplicating to the interactive terminal"
i removed.

I mean you can place multiline strings in v15-compat=y, and you
can `source' whatever file you want, for example

  $ cat .MYSIG
  set message-inject-tail=$'\nThe land returns to how it has always been\n\
  Thyme carried on the wind'
  $ MAILRC=$(pwd)/.MYSIG 

[S-mailx] oauth timeout

2022-09-16 Thread Stephen Isard
It turns out that using on-main-loop-tick to check whether it is time to 
renew the auth token doesn't cover the case where you spend a long time 
writing a message in the external editor.  You come back from the editor 
to find that imap has timed out and there is no open folder.


Since I have defined an account for logging in with oauth, I should be 
able to give the command

account oauth
to reconnect.  However, I find that I have to issue the command twice. 
The first time, I just get a message that there is no open folder.


Is there some way of trapping the imap disconnection error to trigger a 
new 'account oauth'?  I see code snippets involving 'trap' in the man 
page, but no entry for it in the list of commands.


Stephen Isard


Re: [S-mailx] viewing images

2022-09-16 Thread Steffen Nurpmeso
Hello Mr. Bell.

rb...@alumni.caltech.edu wrote in
 <202209161411.28gebpax014...@randytool.net>:
 | I try to view images in s-mailx with fbi.  The .mailcap entry:
 |
 | image/jpg; fbi -e -noverbose --autodown  %s
 |
 |It pops the images up momentarily, too quickly to see, and fbi
 |reports:
 |
 | ioctl VT_GETMODE: Inappropriate ioctl for device
 | NOTICE: No vt switching available on terminal.
 | NOTICE: Not started from linux console?  CONFIG_VT=n?
 |
 |lynx uses the same .mailcap and works.  What's up with s-mailx?

Hm, lynx uses the ncurses library to drive the terminal i think,
whereas we drive it on our own, mostly.  You could try

  image/jpg; fbi -e -noverbose --autodown  %s; needsterminal

which maybe helps?

   This flag field indicates that the given shell command must be
   run on an interactive terminal.  S-nail will temporarily re-
   lease the terminal to the given command in interactive mode, in
   non‐interactive mode this entry will be entirely ignored; this
   flag implies x-mailx-noquote.

Framebuffer console!  I really loved it twenty years ago, when it
"suddenly was there" after installing a new Linux distro which
came with it!  Now that made me look, "by then" there was
a library noted in i think the Linux Magazin (Germany), and now
searching for it yes it was DirectFB, and that lead me to
DirectFB2 on github, and that reads: "2021-12-06 Revival of
DirectFB" !!  Hey!  Back in that day, i shortly dreamed of such an
environment!  Today i will not work without a graphical browser
here.  hm.

That reminded me that dire 13 months ago we had this with another
program, and i then also (beside needsterminal) said

  I also have CONFIG_VT_CONSOLE=y.

  P.S.: i was coming over
https://git.kraxel.org/cgit/fbida/tree/fbpdf.c#n324
  and
https://git.kraxel.org/cgit/fbida/tree/vt.c#n84
  in case that helps.

  Try adding VT_CONSOLE.

Did it help?  Hm.  Try "needsterminal".

Does this help?

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


[S-mailx] signature

2022-09-16 Thread Stephen Isard

Steffen,

I don't use a signature myself, but a colleague who does recently 
updated his s-nail from the out of date version in the ubuntu repository 
and got a warning that signature was obsolete and he should use 
on-compose-leave and message-inject-tail.  That is, replace the single 
line


signature=~/.signature

whose meaning is pretty obvious to the ordinary user, with half a dozen 
lines of - if you will forgive my saying so - rather arcane low level 
code.  You shouldn't have to understand the semantics of "vput csop" 
to include a signature your emails.


Please don't misunderstand. I think it is great that you have exposed 
low level workings of s-nail so that, for instance, someone who wants to 
include different signatures for different classes of recipients can 
arrange that.  But it shouldn't be at the expense of over-complicating 
everyday use.  Please retain the signature variable.


All that said, I tried making a signature for myself by copying code 
from the man page.  It worked, in that the lines of my .signature file 
got tacked on correctly, but I was surprised to have the contents of 
message-inject-tail echoed to my screen when I sent the message.  Is 
there a way of stopping that?


Stephen Isard