Re: [S-mailx] OAuth, and Microsoft, and this little MUA

2023-04-17 Thread Stephen Isard

On Mon, 17 Apr 2023, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


I fixed that, and for me the Microsoft stuff works again
completely.  (They however strip "offline_access" from it, and we
faithfully take what they give us iirc.)  I am only a lonely user
and what do i know of your setup.


For info again:

I don't know whether you thought this change might enable me to 
authorize with your client id.  It doesn't.  (But, as we keep saying, I 
don't need to.)


Stephen Isard


Re: [S-mailx] OAuth, and Microsoft, and this little MUA

2023-04-17 Thread Stephen Isard

On Mon, 17 Apr 2023, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


But client_secret is definetely not freely inventable by users,
but if available is linked to the application.
Alpine .. seems to have added an Outlook client_secret on
2020-07-09 with 0f89ad88df81df9d2ca7eafa276fecf8206fb598, and did
not have one before.  Maybe with paying or something you can
choose a longer validity than 30 months?  It passed the 30 months
by now, that much is plain.


The interval between alpine reauthorizations has definitely been less 
than 30 months.  More like 6, although I haven't tried to keep track. 
It's infrequent enough, and easy enough to do, that it isn't a problem.



you are the only person i know who sits
"in some special department" that causes additional access checks
to kick in.  And lucky that your own configuration works.


Yes, I'm ok and not asking you to do anything for my sake at this point. 
I only replied to your message "for information".



Stephen Isard


Re: [S-mailx] OAuth, and Microsoft, and this little MUA

2023-04-16 Thread Stephen Isard

On Sun, 16 Apr 2023, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


Stephen Isard wrote in
<10085-1681666242-947...@sneakemail.com>:
|I still get a message saying I need admin approval when I try to
|authorize with your client id.  I think it must be a decision by the

With the new script, aka after replacing the tenant=ID with
tenant=common in the configuration, and refreshing it?


With the new script and starting with an empty resourcefile

...

Hmmm, Alpine has a client_secret, whereas we have not; we only
have an application/client ID, and Object ID, and
a Directory/tenant ID, but which must not be used for real.
I have not set a client secret, likely because that has a maximum
lifetime, as i see (again).


Well, alpine has asked me to reauthorize a couple of times since it has 
started using oauth.  I can't recall the intervals exactly, but several 
months at least.


Stephen Isard


Re: [S-mailx] OAuth, and Microsoft, and this little MUA

2023-04-16 Thread Stephen Isard

Hello Steffen,

I still get a message saying I need admin approval when I try to 
authorize with your client id.  I think it must be a decision by the 
organization that outsourced me to Microsoft, rather than Microsoft 
itself.  Microsoft sends me to log in to my organization account and it 
is only after logging in that I get that message.


As I've said, I am ok if I use the client id for s-nail that I created 
for myself while logged in on Microsoft Azure with my organization 
credentials.


This all sounds like standard irritating organizational behaviour.  The 
only puzzle is why I don't have similar problems authorizing alpine, 
another non-Microsoft mua.


Stephen Isard

On Sun, 16 Apr 2023, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:



Hello list, hello Stephen.

A follow-up to this.  As some may remember, the S-nail/s-mailx
application stopped working via OAuth, that is, IMAP was possible,
but sending via SMTP caused only failed authentications.

It magically works again: i took part in a thread on mutt-dev@,
and it was Ian Collier of Oxford University who dropped the word
about "common instead of tenant ID".

Now, whereas our oauth-helper.py script itself uses "tenant=common" for
Microsoft, the registered S-nail (s-mailx) application instead uses
the generated tenant ID, and it worked like that back in last
October.
Interestingly refresh_token is now totally missing, outlook.com
only manages access_token .. currently.  But hey -- it works!

So i updated the manual in the script, and the S-nail/s-mailx
config itself, to be downloaded at will from [1].

Ciao from Germany, and a nice rest-Sunday!

 [1] https://git.sdaoden.eu/browse/s-toolbox.git/plain/oauth-helper.py
 Note: user "moon", password "mars", as in:
 $ curl -u moon:mars --basic -O 
https://git.sdaoden.eu/browse/s-toolbox.git/plain/oauth-helper.py

--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, and Microsoft, and this little MUA

2023-03-16 Thread Stephen Isard




On Thu, 16 Mar 2023, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


|On the remote machine that I am testing with, I have to set 'from' to my
|login name at the organization.  If I set it to my email address at the
|organization, which is different, I get an error message.  Could that be
|the same problem that you are having?

No.  IMAP is ok


Sorry, I wasn't being clear.  IMAP was ok for me as well.  I only got 
the error message when trying to use SMTP with the "wrong" from setting.


Stephen Isard


Re: [S-mailx] OAuth, and Microsoft, and this little MUA

2023-03-16 Thread Stephen Isard

On Thu, 16 Mar 2023, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


(The instructions are included in oauth-helper.py via action=manual
provider=Microsoft.  And oh i see -- this should not be enabled by
default, maybe someone misused that ID for bad things, and now
Microsoft has disabled?  But .. i can login via IMAP, POP3
protocols does not exist anyhow, and SMTP is rejected with
unauthorized.)


On the remote machine that I am testing with, I have to set 'from' to my 
login name at the organization.  If I set it to my email address at the 
organization, which is different, I get an error message.  Could that be 
the same problem that you are having?


Stephen Isard


Re: [S-mailx] OAuth, and Microsoft, and this little MUA

2023-03-15 Thread Stephen Isard

On Wed, 15 Mar 2023, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


So i would assume you are using that "department tenant" and
client ID like you did last September, and not the "s-mailx"
"application"?


I am using the client id that I set up for myself, following the 
instructions that you pointed me at.  I think that they were from the 
mutt website.  I believe that you were able to connect using that client 
id as well.  I have just tried

/s-nail-oauth-helper.py -a authorize -p Microsoft -R resourcefile
where resourcefile came from running
s-nail-oauth-helper.py -p Microsoft -a template -R resourcefile

This was on a machine that I was logged in on remotely via ssh, so I 
changed flow from redirect to devicecode.  Everything went ok until I 
was asked to log in to my organization's website.  When I did that, I 
was told that s-nail was not trusted and I would need permission from 
some higher authority.  I don't get that if I use my own client id 
instead of the one that s-nail-oauth-helper.py puts into the 
resourcefile.


Stephen Isard




Re: [S-mailx] OAuth, and Microsoft, and this little MUA

2023-03-14 Thread Stephen Isard




On Tue, 14 Mar 2023, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:

Is anybody using the oauth-helper.py with Microsoft?


Hello Steffen,

Sorry for the delay in responding.  I'm using oauth with Microsoft, but 
after you taught me enough to make it work with the mutt oauth script
mutt_oauth2.py, I never converted to your (much superior) script, 
because I had a working setup and didn't want to disturb it.


My account definition includes the lines
set mta=submission://smtp.office365.com
set smtp-auth=oauthbearer
and I can send mail.

Stephen Isard


Re: [S-mailx] How download attachment of incoming mail?

2023-02-27 Thread Stephen Isard

On Mon, 27 Feb 2023, Χάρης Καραχριστιανίδης hariskar-at-otenet.gr |s-nail| 
wrote:

I received an email with a *.fit attachment. 2 problems: How can I 
download it?


Try
write /dev/null

See the entry for the 'write' command in the manual.

Hope that helps.

Stephen Isard

Re: [S-mailx] OAuth 2.0 password helper for Google, Microsoft, Yandex

2022-10-03 Thread Stephen Isard




On Mon, 3 Oct 2022, Stephen Isard wrote:
...

  'invalid_client', 'error_description': "AADSTS70002: The provided client
  is not supported for this feature. The client application must be
  marked as 'mobile.

I can't see how to mark the client registration as mobile.  Did "mobile" come 
up when you registered your client?


Never mind. I've found it.  At the bottom of the "Authentication" menu 
page, there is


  Allow public client flows
  Enable the following mobile and desktop flows:
No keyboard (Device Code Flow)

and you have to change the default "no" to "yes"

Stephen Isard


Re: [S-mailx] OAuth 2.0 password helper for Google, Microsoft, Yandex

2022-10-03 Thread Stephen Isard

On Mon, 3 Oct 2022, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:
...

|For all I know, that might be a problem specific to office365 accounts
|tied to organizations and someone with a personal Microsoft account
|could be ok.  If any s-nail user has chosen on their own to use
|Microsoft as their email provider, as opposed to being outsourced to
|them by an organization, it would be interesting if they could check.

I have two free accounts on outlook.com, and i can access without
any problem with either.


Good.


So likely it is that your organization tries to avoid getting
third party code behind some walls.  That however makes me wonder
why your own id works without such trouble, then?


Well, I set up the id when logged in to my organization account, so 
maybe that makes it ok?


Unsurprisingly, I get the same unverified app message if I try to 
authorize with your account using flow=devicecode from an ssh login, 
where running a browser on the same machine is not practical.  However, 
when I try with my own client id and device id, I get a different error 
message:


  'invalid_client', 'error_description': "AADSTS70002: The provided client
  is not supported for this feature. The client application must be
  marked as 'mobile.

I can't see how to mark the client registration as mobile.  Did "mobile" 
come up when you registered your client?


Stephen Isard


Re: [S-mailx] OAuth 2.0 password helper for Google, Microsoft, Yandex

2022-10-02 Thread Stephen Isard

Hello Steffen,

Thanks for doing all this work!

A couple of snags:

On Sun, 2 Oct 2022, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


 _If_ you only have one account at a service provider, say,
 Google, then all you need to do to get yourself going is:

   # s-nail-oauth-helper.y --resource CONFIG-PATH --provider Yandex


Typo: s-nail-oauth-helper.py --resource CONFIG-PATH --provider Google 
:-)


More seriously, in the definition of act_authorize in the python script

def act_authorize(args, cfg, dt): #{{{
   global auth_code
   print('* OAuth 2.0 RFC 6749, 4.1.1. Authorization Request', file=sys.stderr)
   e = False
   for k in client.keys():
  if k != 'refresh_token' and k != 'access_token' \
and not cfg.get(k) and client.get(k, '.') == '':
 print('! Missing client key: %s' % k, file=sys.stderr)
 e = True
   if e:
  print('PANIC: configuration incomplete or invalid', file=sys.stderr)
  return EX_DATAERR

   return EX_OK

   p = {}
...

The return line occurs too early.  It causes the script to finish 
without doing anything.  Commenting it out lets authorization go ahead.


Also, when I try to authorize using the Microsoft client id that the 
script puts into the config file during --action=template, I get an 
error page from Microsoft with the text:


myname@myorganization
Need admin approval
unverified
This app may be risky. If you trust this app, please ask your admin to 
grant you access. Learn more

Have an admin account? Sign in with that account
Return to the application without granting consent

If I edit in my own client_id, obtained by following the Mutt advice 
that you quote, then all is well and I get authorized successfully.


For all I know, that might be a problem specific to office365 accounts 
tied to organizations and someone with a personal Microsoft account 
could be ok.  If any s-nail user has chosen on their own to use 
Microsoft as their email provider, as opposed to being outsourced to 
them by an organization, it would be interesting if they could check.


Stephen Isard


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


[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


[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



Re: [S-mailx] microsoft outlook server with xoauth2

2022-09-12 Thread Stephen Isard




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

...

|s-nail -X 'call update_access_token' -A oauth
|
|The initial call to update_access_token uses the refresh token in your
|~/.s-nail-tokenfile to get an access token that s-nail treats as a
|password for logging in.  The settings of on-main-loop-tick and

Why do you need this initial call?  Ah, you directly log into IMAP
and use that as your base, hmhm, we really deal bad with that.
Call it from within the account?


You are right, calling it at the beginning of the account definition 
works.  I didn't do it that way because I wasn't certain that s-nail 
would set the password before attempting the imap login.  It makes sense 
that the lines in the account definition would get executed in order, 
but I wasn't sure.


Stephen Isard


Re: [S-mailx] microsoft outlook server with xoauth2

2022-09-12 Thread Stephen Isard




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

| set user=loginname@organization #the name you log in with on their \
| website
| set from=emailname@organization # might be the same as user, or not

Really!?!  That is interesting, i added smtp-from (superceeding
smtp-hostname) to make this work on Microsoft, but it seems they
plugged it, as last week it did no longer work.


My experience is that
1) Making from be the same as user works, but then emails say that they 
are from the login name, which in my case isn't my email address

2) Making from be my actual email address there does what I want
3) Making from be somename@somewhereelse produces an error saying that 
user can't send as that person


Stephen Isard


Re: [S-mailx] microsoft outlook server with xoauth2

2022-09-11 Thread Stephen Isard
efresh token in your 
~/.s-nail-tokenfile to get an access token that s-nail treats as a 
password for logging in.  The settings of on-main-loop-tick and 
on-compose-enter are for fetching a new access token if the original one 
expires during your session, as explained in the man page.


Stephen Isard


Re: [S-mailx] microsoft outlook server with xoauth2

2022-09-05 Thread Stephen Isard

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

|microsoft says it [basic authentication] will stop
|working next month, which is why I am trying to set up

They do?!


They do.  See 
https://docs.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-onl

ine/deprecation-of-basic-authentication-exchange-online


I have no idea how to get an application ID for S-nail that can
simply be used.


Nor do I, but alpine has a fairly painless process for setting up 
xoauth2 for microsoft.  See 
https://alpineapp.email/alpine/alpine-info/misc/xoauth2.html (which 
starts off by explaining that "The idea of XOAUTH2 is to create the 
illusion of security").


I've also discovered davmail http://davmail.sourceforge.net/, which does 
the xoauth2 stuff for you and shows your mail on a local server.  It 
works with s-nail and I'll use it if I can't manage to connect with 
s-nail directly.


Stephen Isard


Re: [S-mailx] microsoft outlook server with xoauth2

2022-09-05 Thread Stephen Isard

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

|>|authenticating with xoauth2?
|>
|> The released S-nail's have oauthbearer which de facto _is_
|> XOAUTH2.  No?  I think yes.
|
|Can you post the imap authentication settings for your fozzi-baer
|account?  That would be very helpful.

I actually do not have any.


But aren't you then getting plain/basic/password authentication for 
imap, rather than xoauth2/oathbearer?  (I have no problem connecting 
with plain authentication at the moment, but microsoft says it will stop 
working next month, which is why I am trying to set up 
xoauth2/oathbearer.)


Stephen Isard


Re: [S-mailx] microsoft outlook server with xoauth2

2022-09-05 Thread Stephen Isard

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



Stephen Isard wrote in
<3452-1662299186-348...@sneakemail.com>:

...

|So is your report
|
|>  s-nail: >>> SERVER: * OK The Microsoft Exchange IMAP4 service is \
|>  ready. ..
|>  s-nail: >>> T8 CAPABILITY
|>  s-nail: >>> SERVER: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2\
|>   SAS$
|>  s-nail: >>> SERVER: T8 OK CAPABILITY completed.
|>  s-nail: >>> T9 LOGIN "fozzi-b...@outlook.com" "..."
|>  s-nail: >>> SERVER: T9 OK LOGIN completed.
|
|authenticating with xoauth2?

The released S-nail's have oauthbearer which de facto _is_
XOAUTH2.  No?  I think yes.


Can you post the imap authentication settings for your fozzi-baer 
account?  That would be very helpful.


Thanks,

Stephen Isard



Re: [S-mailx] microsoft outlook server with xoauth2

2022-09-04 Thread Stephen Isard
Thanks very much for the pointers, Steffen.  I don't actually need to 
use the microsoft smtp server.  There is another server that I can send 
through.  I just need to read mail on the imap server.  So is your 
report



 s-nail: >>> SERVER: * OK The Microsoft Exchange IMAP4 service is ready. ..
 s-nail: >>> T8 CAPABILITY
 s-nail: >>> SERVER: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SAS$
 s-nail: >>> SERVER: T8 OK CAPABILITY completed.
 s-nail: >>> T9 LOGIN "fozzi-b...@outlook.com" "..."
 s-nail: >>> SERVER: T9 OK LOGIN completed.


authenticating with xoauth2?


But regarding your question, in the mutt(1) MUA repository there
is contrib/mutt_oauth2.py*, and it reads

 -- How to create a Microsoft registration --

...

That looks promising.  I'll give it a try.

Stephen Isard


[S-mailx] microsoft outlook server with xoauth2

2022-09-03 Thread Stephen Isard

Good evening all,

A university mail server that I use was outsourced to microsoft.  I have 
been connecting to this server in s-nail using "plain" authentication, 
i.e., a password.  Now microsoft is about to stop supporting plain 
authentication 
https://docs.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online 
and it will be necessary to use xoauth2.  I have read the s-nail man 
page section "But, how about XOAUTH2 / OAUTHBEARER?" and can copy the 
oauth2.py stuff, but I don't know the microsoft equivalents to the gmail 
instructions for getting and storing the “client ID” and “client secret” 
given in 
https://github.com/google/gmail-oauth2-tools/wiki/OAuth2DotPyRunThrough.


Has anyone been connecting to an outlook account using xoauth2 with 
s-nail?  Steffen, did you try to use xoauth2 with your fozzi-baer 
account?


Thanks,

Stephen Isard


Re: [S-mailx] Using data from shell for command

2022-07-22 Thread Stephen Isard

Hi Hans,

On Fri, 22 Jul 2022, hbezemer-at-kliksafe.nl |s-nail| wrote:

I want to delete all mail which is older then one year. This can be 
done with the '(before date)' search expression as described in the 
manpage. To automate this process, I would like to use the shell 
date(1) command to get the date one year ago. How can I import the 
outcome of command into mailx? I get the right string with: date 
--date='last year' +%d-%b-%Y So I'm looking for something like: ?move 
'(before )' +Trash


If you call s-nail with

s-nail -S yearold=`date --date='last year' +%d-%b-%Y`

the variable yearold within s-nail will contain the date string.

Hope that's useful.

Stephen Isard


Re: [S-mailx] Retrieving filename of message

2022-06-20 Thread Stephen Isard

Hello Hans and Steffen,

I used to use munpack before mailx 'write' developed the capabilities 
that Steffen describes.  Write gives you more control over which 
attachments will be extracted and what they will be called.


Munpack can read from its standard input, so if you are in mailx/s-nail, 
you don't need to know the absolute file location of the current 
message.  Simply '|munpack' will unpack it.  As with 'write', the 
message doesn't need to be in a local file at all; it can be on a remote 
imap server.


I hope that is helpful.

Stephen Isard

On Mon, 20 Jun 2022, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:



Hello Hans,

sorry for the late reply.

hbeze...@kliksafe.nl wrote in
<20220618191419.schb7%hbeze...@kliksafe.nl>:
|I would like to be able to save attachments from messages within mailx.
|I'm using munpack(1) to extract the attachments.

I have never heard of munpack, interesting.
Were there a need, i would possibly look into nmh(1) and use one
of its tools as long as this MUA cannot directly address things.

|Is it possible to retrieve the filename(location) of a message?
|For example:
|!munpack 

I do not know nothing about munpack.
mailx has the `write' command to save message parts [1]; manual is
a bit weird, you give it the message and a filename that is used
for the main text part (or the entire message for non-MIME
messages), for any other part you are prompted in interactive
mode.

 [1] http://sdaoden.eu/code-nail.html#306

The best however would be if mailx finally could address parts
directly ("write 1.2.1"), or if the `digmsg' command would learn
how to write individual parts.  This 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] Lost edit

2021-09-13 Thread Stephen Isard

On Mon, 6 Sep 2021, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


I hope you are rich enough to have not only survived the flooding,
but are also able to solve the damage done!


Thanks for your concern.  I was fortunate and was not personally 
affected by the floods.



We will always read back the edited
file _if_ the size or its timestamp changed (aka whenever it seems
to have been modified, easy approach aka not checksum-checked),
_unless_ the editor exits with a non-0 exit status.


I hadn't realized about that "unless", and that the non-0 status could 
be caused by a signal passed down by the parent s-nail process, as 
opposed to some event within the editor itself.



If your editor would be

 #!/bin/sh -
 trap : ALRM HUP INT QUIT TERM
 the-real-editor "$@"
 exit 0

then your problem with not reading back the temporary file should
not happen.


Right, that does seem to prevent the edit from getting lost.  It is 
difficult to test, because the imap server disconnects in an 
unpredictable way, but, so far, so good.



 5.4.Autologout Timer

If a server has an inactivity autologout timer, the duration
of that timer MUST be at least 30 minutes.  The receipt of
ANY command from the client during that interval SHOULD
suffice to reset the autologout timer.


My impression is that the disconnections are caused by something other 
than the timer timing out.  Some days it happens a lot, other days not 
at all.



The problem that lasted after my first (second with that
SO_RCVTIMEOU) patch was that now SIGALRM was allowed again while
editing, but that an installed alarm(2) timer is inherited by
child processes, which is why your version of ed(1) seems to have
exited with a non-0 exit status, after having seen a SIGALRM,
though the default action of SIGARLM is

SIGALRM  P1990  TermTimer signal from alarm(2)

terminate says signal(7).  So the next patch on top of the first
patch drops such installed alarm(2) actions in child processes.

With these three patches which are on [master, stable/stable,
stable/latest, stable/v14.9] (uff) i can wholeheartly put the
blame on other people.


So with the patches in place, why should I need to wrap the editor with 
the script above?  Is there some other way for signals to get through?


Stephen Isard


Re: [S-mailx] Lost edit

2021-09-05 Thread Stephen Isard

Hello Steffen,

I'm sorry to report that the problem has not gone away entirely.  I 
appear to get two kinds of error conditions.  As I last reported



I've had the error message

s-nail: TLS socket read error, retrying: Resource temporarily unavailable
s-nail: IMAP: error::lib(0):func(0):reason(0)

while in the editor, and when I saved and quit, the edited version DID
appear in the message.


That seems to happen when I lose my connection to the internet 
altogether, not just to the IMAP server, and the error message comes up 
in the s-nail window while I am still in the editor.


In the other condition, the message

s-nail: IMAP write error: error::lib(0):func(0):reason(0)

appears only when I leave the editor, and I don't know what event causes 
it.  That's the circumstance in which the editor temporary file doesn't 
get read back into the message buffer, and the temporary file remains in 
place until the message is sent or abandoned, at which point it is 
deleted.


What chain of events can lead to an IMAP write error?

Stephen Isard


Re: [S-mailx] Lost edit

2021-09-01 Thread Stephen Isard

Steffen,

With the latest master branch, I've had the error message

s-nail: TLS socket read error, retrying: Resource temporarily 
unavailable

s-nail: IMAP: error::lib(0):func(0):reason(0)

while in the editor, and when I saved and quit, the edited version DID
appear in the message.  Hooray.

Stephen Isard


Re: [S-mailx] Lost edit

2021-09-01 Thread Stephen Isard

But why do you expect the test series to work once you applied
a debug patch that was ment for a very specific test of yours?


Because I don't know what the tests are testing.  I'm just blindly 
following instructions.



But maybe the alarm(2) should be cleared when we start a child and
the alarm is still set.  So i did that.
Thanks for the report.


So should I pull in a new copy of the master branch to get that latest 
change, or test with what I've got?


Stephen Isard


Re: [S-mailx] Lost edit

2021-08-30 Thread Stephen Isard

Hello Steffen,

Here is a complete session where I

1. Began a message with the word "Before"
2. Entered ed as an external editor and added the line "During"
3. Waited a long time
4. Did a date stamp from within the editor, then saved and exited
5. Got an IMAP write error
6. Did ~p to see that the message only contained the "Before" line
7. Still within the message, did an external shell command to see that
there was a file /tmp/s-nailblahblah with the same date stamp as
when I left the editor.
8. Still within the message, did an external cat command to see that the
file in /tmp contained  the "Before" and "During" lines.
9. Abandoned the message with `x
10. Tried to repeat the cat command on the /tmp file and found that
it had been removed.

So I am not accusing you of leaving files lying around in /tmp.  But it 
appears that they aren't immediately deleted on return to the s-nail 
command line after an IMAP write error, when the content of the /tmp 
file hasn't been read back into the message buffer.  Finishing the 
message appears to get the file cleaned away.


#-#
& m 
Subject: test
Before
~e
7
a
During
.
!date
Mon 30 Aug 16:12:24 BST 2021
!
wq
14
s-nail: IMAP write error: error::lib(0):func(0):reason(0)
(continue)
ERROR# ~p
---
Message contains:
From: 
To: 
Subject: test

Before
~!ls -gG /tmp/s-nail*
-rw--- 1 14 Aug 30 16:12 /tmp/s-nail-edbaseUjFRoCne
!
(continue)
~!cat /tmp/s-nail-edbaseUjFRoCne
Before
During
!
(continue)
~x
s-nail: IMAP write error: Bad file descriptor
ERROR# & !cat /tmp/s-nail-edbaseUjFRoCne
cat: /tmp/s-nail-edbaseUjFRoCne: No such file or directory
#-#

Stephen Isard


[S-mailx] Lost edit

2021-08-28 Thread Stephen Isard

Hello Steffen,

I have been trying out the patched latest v.14.9.22 for a couple of 
days, but I didn't catch the server disconnecting until today.  Sadly,


##
& m 
Subject: test
Before
~e
7
a
During
.
s-nail: IMAP write error: error::lib(0):func(0):reason(0)
wq
14
(continue)
s-nail: There are new messages in the error message ring (denoted by 
ERROR),

s-nail:   which can be managed with the `errors' command
ERROR# ~p
---
Message contains:
From: 
To: 
Subject: test

Before
#---#

No "During". The edit is not incorporated after I save and leave the 
editor.  I have found the temporary editor file in /tmp, and the edit 
appears there.


Stephen Isard


Re: [S-mailx] imap disconnection

2021-08-26 Thread Stephen Isard




Yeah, let's do it like this.
"Fixes" pushed to the master and stable branch when you read this.

Thanks for reporting the problem and insisting, Stephen!


Well, thank YOU for solving it!  Can you give me the git command that I 
need to issue to clone the current stable 14.9 version?


Stephen Isard


Re: [S-mailx] imap disconnection

2021-08-26 Thread Stephen Isard

Hello Steffen,

Here is a log from a session where I used ed as the external editor so 
as to be able to capture the entire session on one screen


#--#
& mail 
Subject: test
Before editor
~e
14
a
In editor
Waiting
.
1,$p
Before editor
In editor
Waiting
wq
32
s-nail: IMAP write error: error::lib(0):func(0):reason(0)
(continue)
s-nail: There are new messages in the error message ring (denoted by ERROR),
s-nail:   which can be managed with the `errors' command
ERROR# ~p
---
Message contains:
From: 
To: 
Subject: test

Before editor
~p
---
Message contains:
From: 
To: 
Subject: test

Before editor
##

The time between writing 'Waiting' and exiting with 'wq' was about an 
hour in this case.  You can see that the material entered in the editor 
was lost following the IMAP write error.  Since the error message that I 
get is different from the one that you get by sending alarm signals, I 
suggest that this error may not be the result of an alarm signal, but 
something else.  I can speculate that the message is generated by the 
lines 766-767 in the file s-nail-14.9.22/src/mx/net-socket.c from the 
14.9.22 tarball,


766   snprintf(o, sizeof o, "%s write error",
767  (sop->s_desc ? sop->s_desc : "socket"));

but, even if that is correct, I don't know what chain of events could 
get you to those lines.


Stephen Isard




Re: [S-mailx] imap disconnection

2021-08-25 Thread Stephen Isard




On Wed, 25 Aug 2021, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


 s-nail: IMAP error: Server shutting down.
 (continue)
 s-nail: There are messages in the error ring, manageable via `errors' command


Ok, that's a different error message from the one we get, which is

s-nail: IMAP write error: error::lib(0):func(0):reason(0)

Again, I ask what process are you sending the kill -ALRM signal to?  The 
s-nail process?  When I do that it has no effect at all.  I can quit the 
editor and get no IMAP error.  I only get "my" IMAP error by waiting for 
a sufficiently long time, where "sufficiently long" varies.


Stephen Isard


Re: [S-mailx] imap disconnection

2021-08-25 Thread Stephen Isard

On Wed, 25 Aug 2021, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


Stephen Isard wrote in
<23078-1629848900-410...@sneakemail.com>:
|That is what I was hoping you could explain.  Why does losing the IMAP
|connection stop s-nail from reading the temp file back into its buffer
|when editing is done?

I have problems to parse this Stephen.  What is going on?
What is "reading back the temp file"?


1)  You start writing a message in s-nail
2)  You call '~v' to bring up an emacs window with the content of the
message so far
3) You edit the message in emacs, save, and quit.
4) Case 1: The imap connection has not dropped while you were in emacs
   You are returned to the normal s-nail prompt and '~p' shows
   the message that you saved from emacs
   Case 2: The imap connection was dropped while you were in emacs
   You see an ERROR prompt and '~p' shows the message as it was
   before you called emacs

My understanding is that when you do '~v' to use an external editor on a 
message you are writing, s-nail creates a temporary file and calls the 
external editor on that file.  Then when you quit the external editor, 
s-nail normally reads the content of the temporary file back into an 
internal buffer, where you can see it with '~p'.  However, if there has 
been an imap disconnection while you are working in the external editor, 
'~p' just shows the message as it was before the editor was called. 
Any work done in the editor is lost.  So s-nail has not read the content 
of the temporary file back into the internal buffer.


Stephen Isard


Re: [S-mailx] imap disconnection

2021-08-24 Thread Stephen Isard

But .. what has editing to do with IMAP?


That is what I was hoping you could explain.  Why does losing the IMAP 
connection stop s-nail from reading the temp file back into its buffer 
when editing is done?



Your friend should be able to simply force `disconnect' and then
`connect' again to get back into IMAP.


He did try 'disconnect' after the error, but s-nail says it isn't 
connected.  But supposing he manages to get back into IMAP somehow, will 
that rescue his lost edit?  He isn't so much bothered by having to 
reconnect as losing the work that he did in the editor.



 *folder* is just too special in my opinion.


Could you expand on that remark a little?  The 'folder' command, the 
'folder' variable?  Special how?


Stephen Isard





Re: [S-mailx] imap disconnection

2021-08-24 Thread Stephen Isard

Pardon?  You were `mailing or replying and got stuck in the editor
and in the meantime the connection broke?


Yes, the connection breaks while he is in the editor.  He isn't stuck, 
in the sense that the editor carries on normally.  He saves back to 
/tmp/s-nail, leaves the editor, and only then gets the imap 
error message and finds that his work in the editor has been lost.



The network thing uses alarm(2) to drive this mechanism ...  At
least until v15, when there will be a non-blocking loop with
select(2) or poll(3).  If i ever get there.  Then this is
a detached loop that runs like a daemon would.


Ok, I need to read some man pages to follow that.

Stephen Isard


Re: [S-mailx] imap disconnection

2021-08-23 Thread Stephen Isard

The best you can do is using IMAP cache, as you do.
You can then `disconnect' / `connect' as you will, and it usually
"pampers over" the problem.

Other than that setting "set imap-keepalive=X" to install an alarm
based trigger every X seconds often helps, too.
Maybe 300 or even 120 for super picky wifi i have seen (if it
helps at all).


But why does the imap disconnection interfere with reading the temp file 
saved by the external editor?  S-nail hasn't crashed.  It is still 
running and able to respond to commands.


Stephen Isard


[S-mailx] imap disconnection

2021-08-23 Thread Stephen Isard

Hello Steffen,

What does s-nail do when an imap server breaks connection?

I am asking on behalf of a friend in another country who has been 
finding that when he writes a long message in an external editor, he 
often gets an error message

s-nail: IMAP write error: error::lib(0):func(0):reason(0)
on leaving the external editor, and his edits are lost.  He is on a 
somewhat flaky imap server, and I am guessing that the error message 
means that the server has dropped the connection, but I don't see why 
that should prevent s-nail from reading the externally edited temp file 
back into its buffer.


Stephen Isard


Re: [S-mailx] Intermittent smtp auth failures

2021-08-18 Thread Stephen Isard

|But the continuation doesn't cause a problem for s-nail.  That's the
|server which succeeds.  It's apparently something else that causes
|failures with 8.15.2.

Well i yet have not yet seen a single log that makes sense or
describes what you say.  The only full log i have seen was

 s-nail: >>> AUTH GSSAPI
 ...
 s-nail: >>> SERVER: 334
 ...
 s-nail: GSSAPI error: gss_init_sec_context / An invalid name was
 supplied
 s-nail: GSSAPI error: gss_init_sec_context / Success


That is what I get from the problem server with verbose=2 set.  I have 
never seen a success from that server with verbose=2 set, so I can't 
show you a log of it succeeding.  I do sometimes succeed _without_ 
verbose=2, but then there is no log.  That was why I referred to the 
uncertainty principle - trying to observe the phenomenon appears 
to change it.



and that is a totally different error than what we now seem to
have to deal with, no?


No.  You say that having two SERVER: 334 lines violates rfcs, but I only 
see them in cases where the message goes through.  So even if they 
are a technical violation, they don't appear to be a problem for s-nail.



|Correct.  Alpine does not fail.  I have just tried it in debug mode with
|the 8.15.2 server and I see the same thing as with s-nail on the
|(successful) 8.14.7 server:
|
|IMAP DEBUG 19:31:15 8/17: 334 
|IMAP DEBUG 19:31:15 8/17:
|IMAP DEBUG 19:31:15 8/17: 334 

Just like that

 s-nail: >>> SERVER: 334 
 s-nail: >>>
 s-nail: >>> SERVER: 334 


Yes. the Alpine log for the problem server is the same as the s-nail log 
for the good server.



you have shown last, which is different to the initial thing.


Sorry, I don't know what you mean here.  Which initial thing?


You show the error in the first, but not in the
second, and the second is different to the first.  No???


Again, I am getting lost.  I started this thread saying that I could 
sometimes, but not always, send through the problem server.  You made 
the sensible request that I send you a log from a success and a log 
from a failure so that you could try to figure out what was going wrong.
I tried to do that, but I couldn't, because there is never a success 
with that server when logging is turned on.


I did manage a success from a different server with logging turned on 
and showed you the log, but you don't like it because it has two 334 
lines.  Nevertheless, it is what got printed during a successful send 
from s-nail.


I can't think of anything else to say about the problem, so I suggest we 
drop it unless/until one of us has a new idea.  I am sure other list 
subscribers will be glad.


Stephen Isard


Re: [S-mailx] Intermittent smtp auth failures

2021-08-17 Thread Stephen Isard

|If I telnet to the (successful) server, it responds with
|Sendmail 8.14.7/8.14.7.  The problem server says Sendmail 8.15.2.

Thanks.  Well ... to me this looks like a server error for now.
In the meantime i have had a short glance at RFC 4954, and it
seems to me 334 is not even continuable, not to talk about doing
"334 " twice, it then really should be "334-" plus "334 ".


But the continuation doesn't cause a problem for s-nail.  That's the 
server which succeeds.  It's apparently something else that causes 
failures with 8.15.2.



 noone else ever
encountered that?


Does seem strange.  Maybe the combination of s-nail, gssapi and 8.15.2 
isn't all that common.



Well tomorrow i could look into Alpine, if you say that this does
NOT fail?  Just wondering...


Correct.  Alpine does not fail.  I have just tried it in debug mode with 
the 8.15.2 server and I see the same thing as with s-nail on the 
(successful) 8.14.7 server:


IMAP DEBUG 19:31:15 8/17: 334 
IMAP DEBUG 19:31:15 8/17:
IMAP DEBUG 19:31:15 8/17: 334 

Stephen Isard


Re: [S-mailx] Intermittent smtp auth failures

2021-08-17 Thread Stephen Isard

On Tue, 17 Aug 2021, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


|I tried setting verbose=2 for the successful server and saw that the
|server's reply to AUTH GSSAPI was broken over two lines.  That is, I see
|
|s-nail: >>> SERVER: 334 
|s-nail: >>>
|s-nail: >>> SERVER: 334 
|
|On the unsuccessful server, the error message comes right after the
|first SERVER: 334 line.  I am not absolutely certain, but it looks to me
|as if the first lines of characters are the same length in the two
|cases.
|
|Does this give you anything to go on?

Hm well, there is a notion on such things with SMTP
authentication, IR (immediate response) for example.
The above however .. i have to look around to give an answer,
i have not looked in these RFCs for a long time.
My gut says the above is not right, especially with the repeated
status.  Normally server uses 334-TEXT but for the last line,
which then would be "334 TEXT", _if_ splitting _this_ very
response is allowed.  But two times "334 TEXT" is definetely
wrong.


Ok, but what I'm seeing comes from s-nail's verbose mode, not directly 
from the server, so perhaps it's s-nail leaving out the '-' ?



May i ask what software this is?


If I telnet to the (successful) server, it responds with
Sendmail 8.14.7/8.14.7.  The problem server says Sendmail 8.15.2.

Stephen Isard


Re: [S-mailx] Intermittent smtp auth failures

2021-08-17 Thread Stephen Isard

On Tue, 17 Aug 2021, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


I will spin up a VM this evening and try again.  I cannot remember
ever seeing such a problem.
You are using 14.9.21?


I've tried several versions, but the tests I just reported were with 
the 14.9.22 rpm (s-nail-14.9.22-3.el7.x86_64) on Scientific Linux 7 
(clone of Centos 7, clone of RHEL 7).  To try with the patch you 
supplied, I compiled from the 14.9.22 tarball on SL 7.


The smtp server responds with ESMTP, but I don't know what program it is 
running.


The problem is in the authentication, not the message transmission 
itself.  If I set up an ssh tunnel to port 25 on the same server (my 
kerberos ticket allows me to do that) and then set 
mta=smtp://localhost:, mail goes through.  My problem with 
that solution is that the tunnel doesn't last very long and I have to 
keep reconnecting.


Stephen Isard


Re: [S-mailx] Intermittent smtp auth failures

2021-08-16 Thread Stephen Isard

On Mon, 16 Aug 2021, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


Uh. ! Thanks, yes, take care for the GSSAPI content ..
I don't know enough of GSSAPI, but to be all safe i personally
would now kdestroy and kinit again.


Done that, although I thought that it wouldn't be much use without 
knowing the server.  The tickets were due to expire soon anyway.



Yes i am sorry, i should have been more clear.
What would be interesting would be a possible difference in
between the two tries of which only one succeeds.


That's what I understood you to mean.  But setting verbose seems to 
guarantee failure.  I wasn't expecting that, but...



Now that is very strange, then.  Verbosity should not change
a thing, possibly except we would talk about a race condition,
where the I/O delay due to the verbose log changes some timing.


The whole business is very strange.


I bet that

|s-nail: GSSAPI error: gss_init_sec_context / An invalid name was
|supplied
|s-nail: GSSAPI error: gss_init_sec_context / Success

one of those is from the failed attempt, the other not.


No.  I get both lines before having any success.


Hmm.  Well and you are sure that nothing in the URL you use
changes in between the calls?  This is the only thing that
actually comes from the MUA here.


Well, the URL is smtp.blah.blah and I suppose there could be several 
machines taking turns using that alias.



I could give you a patch for .. whatever version you now use, one
that debug outputs those things, and you could tell whether
something has changed or not.  You had to compile it anew of
course.  Basically it would be adding

 fprintf(stderr,
   "HOST: l=%lu s<%s>\nCRED: USER: l=%lu s<%s>\n",
   urlp->url_host.l, urlp->url_host.s,
   credp->cc_user.l, credp->cc_user.s);

right at the beginning of ... ie, search for "smtp@", and place it
right in the next line, src/mx/net-gssapi.h is the file.


Ok, added that in v. 14.9.22 and I can get both success and failure. 
But in both cases I see the exact same printout


HOST: l= s
CRED: USER: l= s

On failure, the error message

s-nail: SMTP server: 535 5.7.0 authentication failed

follows, and on success, I just get a prompt.

With verbose=2 set, I still haven't seen a success, but sometimes the 
server responds to the AUTH GSSAPI from s-nail with a big string of 
characters of its own, as in the previous message, and then s-nail adds


s-nail: GSSAPI error: gss_init_sec_context / An invalid name was 
supplied

s-nail: GSSAPI error: gss_init_sec_context / Success

and sometimes the server responds to the AUTH GSSAPI with just


SERVER: 535 5.7.0 authentication failed


Stephen Isard




Re: [S-mailx] Intermittent smtp auth failures

2021-08-16 Thread Stephen Isard

On Mon, 16 Aug 2021, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:

Mysterious, i have not seen this once i tested with dovecot.
And there should be no persistent data -- i assume you mean this
happens from within the same instance, not two adjacent ones.


Yes, correct.  Same session. Get s-nail prompt, send message, get s-nail 
prompt, send second message.



What happens if you increase debug aka look at what the actual
communication says (set verbose=2)?


The uncertainty principle kicks in.  If I set verbose=2, I get (with 
names redacted to protect the innocent)


s-nail: Credentials: host smtp.:587, user , pass ''
s-nail: Forking child with spawn control: 'exec handled by caller'
s-nail: Resolving host smtp.:587 ... done
s-nail: Connecting to :587 ... connected.
s-nail: >>> SERVER: 220  ESMTP
s-nail: >>> EHLO localhost
s-nail: >>> SERVER: 250- Hello  [ip addr], pleased to meet 
you

s-nail: >>> SERVER: 250-ENHANCEDSTATUSCODES
s-nail: >>> SERVER: 250-PIPELINING
s-nail: >>> SERVER: 250-8BITMIME
s-nail: >>> SERVER: 250-SIZE 31457280
s-nail: >>> SERVER: 250-DSN
s-nail: >>> SERVER: 250-AUTH GSSAPI
s-nail: >>> SERVER: 250-STARTTLS
s-nail: >>> SERVER: 250-DELIVERBY
s-nail: >>> SERVER: 250 HELP
s-nail: >>> AUTH GSSAPI 
YIICbQYJKoZIhvcSAQICAQBuggJcMIICWKADAgEFoQMCAQ6iBwMFACCjggFvYYIBazCCAWegAwIBBaELGwlVUEVOTi5FRFWiJzAloAMCAQOhHjAcGwRzbXRwGxRob3VuZC5zZWFzLnVwZW5uLmVkdaOCASgwggEkoAMCARKhAwIBAqKCARYEggESppnzBR2t3R8iEwZGxDpiCl3e7fkZFgRUALTUpnqJeButm4YmFXEuCfjVnETvMdf6gqLIoSr8ObvwODT8uFkt6q+MIYDf6k/OQZv1BKfYQ+NU7wxGq8s4f8J6FxDOjZ0pnYhv+KRKx7ACwq5IB9cdxe975MtUTMQ885HrooX+khlqiZU2u+zjCdte6IMtDeEVVHPMfhRi/GIf3WJe2f0AUe4sChvjSwH1di0w1b3LjAH0bqBXUmUpoRmhq01VFIcrBtVfuwALIi/OyUkXkBN/0KJJ3BC0PjOst4vV2ol7AWZ0xncuz/EPaS8+2gnPPKnra7V6LTUt2Z6GpB+f0117bzgrZtKfJnWvLoGsxFvX0Fo0baSBzzCBzKADAgESooHEBIHB8KycLWqioCyd7fyYDBPMyE9T7akcB8tep4Br/ydSwh2RJ92NqVThPbyrnceBsVZnJ3rCjJmfnHFcVWtR1tquVSGJOZkEBWcDZ3ro0mHmFqJQ7GKEESMxENIeHQUiEIbxK1tN9y41kRNHUjcFyAk8F8BVF4WKN4uUAg+N4b3or7rWnrW6fwsAP3UpfDh0jtktoCq5Wp/qSzYY9oLrny++aCLOTjzb05AZqb4eac48m0uR3kLuUAZ08KKTrpRSViLB5A==
s-nail: >>> SERVER: 334 
YIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvbFOxOKr7BOd/xePbajWDN72zKtHHVM+NYeHA/535+q6SGtX4blMBAos67FfoO/rGiNCHmW2hZlCyzV1+FxJRbWcaaVXue7mfc97QN56G2l9KTEDxRu9YHreTuhj9WPR3idMAmSxpHI7ycwHfYGYJ
s-nail: GSSAPI error: gss_init_sec_context / An invalid name was 
supplied

s-nail: GSSAPI error: gss_init_sec_context / Success

But if I then unset verbose, the message gets sent (one time).

Stephen Isard





[S-mailx] Intermittent smtp auth failures

2021-08-16 Thread Stephen Isard
I start up s-nail on a mailbox and send myself a test message.  Fine. 
It arrives.  Then, without doing anything in between, I try to send 
exactly the same test message again and I get


s-nail: SMTP server: 535 5.7.0 authentication failed

I have the settings

mta=myname@smtp.theirdomain:587
smtp-auth=gssapi
from=myname@theirdomain

and I have a kerberos ticket.

The smtp server is some sort of linux machine, no involvement of 
Microsoft or Gmail.


Evidently something changes between the first test message and the 
second, but I don't know what it could be.


Sending through the same smtp server with the alpine mail program, there 
is no such problem.


Stephen Isard


Re: [S-mailx] ERROR prompt

2021-06-03 Thread Stephen Isard

On Thu, 3 Jun 2021, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


So the problem with Microsoft seems to be that they really want
(even though it is documented nowhere) u...@outlook.com as the
user


And USER%40outlook.com won't do?


Well i never used anything Microsoftish since 1999


I have managed to avoid it too, up to now.

I have another question, nothing to do with Microsoft.  Is there a way 
to get the line editor to wrap, rather than shifting the beginning of 
the line off the screen to the left?  Some termcap setting perhaps?


Stephen Isard


Re: [S-mailx] ERROR prompt

2021-06-03 Thread Stephen Isard

On Thu, 3 Jun 2021, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


|But I don't want my prompt messed with when something is added to the
|log.  It's not that big a deal.

Ok i removed it.
Let's also no longer mutilate to US-ASCII, just pass through all
bytes that come in (likely a problem only for filenames though).
Will be in v14.10, with credit to you.


Great.  Thank you.


People are outsourcing email like grazy it seems, just wondering
that GMail was not chosen.


Maybe they thought that if they were going to do something stupid, they 
should go all the way and be _really_ stupid.



|Well, the "problem", such as it is, is that I am getting the error
|marker, but there is no entry in the error log.  That should be a "can't
|happen" - the error marker is only supposed to appear when something is
|added to the log.  But it appears to be happening.

Well, that problem is solved.


Yes.  Thanks again.  And Ralph, that was a good suggestion, but this 
makes further investigation unnecessary.



 commit 6b394c7204
 AuthorDate: 2014-03-01 15:08:37 +0100

 Obsolete *autoinc* (keep only *newmail*)


Apologies, I misinterpreted this as meaning "no more autoinc, now you 
have to use the newmail command".


Stephen Isard


Re: [S-mailx] ERROR prompt

2021-06-02 Thread Stephen Isard

On Wed, 2 Jun 2021, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


I do not understand your problem really.  This string can only be
seen if an entry was added to the error log.  In a newer version
you could "set errors-limit=0" and that should be it.


I like the idea of an error log that I can consult if I feel I need to. 
But I don't want my prompt messed with when something is added to the 
log.  It's not that big a deal.



I am frustrated and out of ideas.  All i know is that our login
procedure is correct, it surely is for the development version.
Am out really now, very late, want to drive some bicycle.


Yes, the login procedure is correct, and I am able to log in.  Of 
course I have no idea why you are not able to log in to your account. 
I didn't set up this account myself.  It was forced on me when people 
who ought to know better outsourced their email system to Microsoft. And 
I'm going for a bike ride too.



| The initial error report isn't a serious problem, it's just messy.

I do not understand the problem.  I cannot login.  The error
marker only happens if there were errors.


Well, the "problem", such as it is, is that I am getting the error 
marker, but there is no entry in the error log.  That should be a "can't 
happen" - the error marker is only supposed to appear when something is 
added to the log.  But it appears to be happening.


By the way, separate issue entirely, there used to be an 'autoinc' 
setting that automatically checked for new mail every so often, rather 
than making you do 'newmail' by hand.  Any chance of getting it back?


Stephen Isard


Re: [S-mailx] ERROR prompt

2021-06-01 Thread Stephen Isard

On Tue, 1 Jun 2021, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


|S-nail v14.9.15 under Ubuntu 20.04.2 LTS

Pretty old and buggy.


Sorry, it's the most recent available in the repository for this 
distribution.



So i just completed my registration for a free account there at
outlook.office365.com, but whatever i do i cannot get in via this
little MUA .. even with the current development version.  (I was
short before saying "set imap-auth=oauthbearer", which actually is
XOAUTH2, but that does not seem to help.)
Yes, all i get is

 s-nail: >>> SERVER: T4 NO AUTHENTICATE failed.

for IMAP


It's bad enough that I am being forced to use Outlook, I don't really 
want to subject you to it as well.  If you could just tell me how to 
stop that screaming ERROR# from appearing in my prompt, that would be 
great.


For the record, though, I should have mentioned that I am prompted for a 
password after giving the s-nail command.  And when I run with -vv, I 
see


s-nail: TLS BLAKE2s256 fingerprint: separated by colons>

s-nail: TLS connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
s-nail: P(seudo)R(andom)N(umber)G(enerator): *TLS RAND_*
s-nail: >>> SERVER: * OK The Microsoft Exchange IMAP4 service is ready. 
[]

s-nail: >>> T1 CAPABILITY
s-nail: >>> SERVER: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 
SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+

s-nail: >>> SERVER: T1 OK CAPABILITY completed.
s-nail: >>> T2 LOGIN "" ""
s-nail: >>> SERVER: T2 OK LOGIN completed.
s-nail: >>> T3 SELECT "INBOX"
and so on

There is also a bunch of stuff about certificates of depths 2,1,0, but 
any certificates present came with the Ubuntu distribution and are 
nothing that I have done personally for this Outlook account.



That reminds me.  Your Alpine just "can"?


Yes, Alpine connects to it, and if it hits the same error as S-nail, it 
doesn't tell me about it.  An Android app called K-9 Mail (a Mutt 
lookalike) also manages to connect.  And, as I said, S-nail connects 
too.  The initial error report isn't a serious problem, it's just messy.


Stephen Isard


[S-mailx] ERROR prompt

2021-06-01 Thread Stephen Isard

Guten Tag,

S-nail v14.9.15 under Ubuntu 20.04.2 LTS

When I connect to the mail spool file on the local machine, everything 
is fine.  When I connect to an Outlook account with

s-nail -f imaps://some_acco...@office365.outlook.com,
I get connected and the contents of my mailbox is displayed correctly, 
but I am told


There are new messages in the error message ring (denoted by ERROR),
s-nail:   which can be managed with the `errors' command

and the prompt is preceded by ERROR# .

If I give the command

errors show

all I get is

1/1There are new messages in the error message ring (denoted by ERROR),
2/1 which can be managed with the `errors' command

The prompt then goes back to normal.

So is there actually an error, and, if so, how do I find out what it is?
Is there a way of turning off the behavior that sticks ERROR# in front 
of the prompt?  I don't think I want it even if an error has occurred.


Thanks,

Stephen Isard


Re: [S-nail] [ANN]ounce of S-nail v14.8.13 («Cyrustrupidae»)

2016-10-21 Thread Stephen Isard
On Fri, 21 Oct 2016, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:
> Disclaimer: i never used IMAP as an employee or whatever,
> i installed a local dovecot and went ahead, only with S-nail and
> Heirloom mailx, so i have _no idea_ what other MUAs do to hide (or
> don't hide) the IMAP standard "INBOX".  My test account now has
>
>   set folder=imap://user1@localhost/Mail
>   set inbox=+
>
> And that ends up in INBOX, i think this is right?

That doesn't work for me.  I get
IMAP error: Mailbox doesn't exist: Mail/INBOX

The reason, I think, is that on the server I have had problems with, 
there is no INBOX file in the Mail subdirectory.  The server is a 
general purpose linux machine running openSUSE 42.1, with lots of users. 
Each user has a Mail subdirectory containing their mbox, trash, etc. 
folders, but their inbox, the place where mail is initially delivered, 
is in some system spool directory, like /var/spool/mail/username.  (A 
curious by-product of this arrangement is that users have huge mail 
quotas, larger than their file quotas.)  I have never configured dovecot 
myself, but from what you say, it sounds as if you have set it up to 
make your inbox be a file called INBOX in your own Mail directory.  The 
administrators of the server I am using have done it differently.

That's all ok in 14.8.14, because I can specify
set inbox=imaps://username@servername/INBOX
to identify my inbox, wherever they have put it.  So just keep it this 
way and you won't hear from me on the subject again, which will 
undoubtedly be a relief to the other readers of this list.

Stephen Isard

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
__
S-nail-users@lists.sourceforge.net


Re: [S-nail] [ANN] of S-nail v14.8.12 («Bubas»)

2016-10-06 Thread Stephen Isard
On Thu, 6 Oct 2016, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:
>
> Yes, that special treatment of *folder* for IMAP has to go, if you
> have set it to a Maildir or directory with MBOXes then this
> doesn't override $MAIL and "automatically `cd's to *folder*", too.
> Stephen's idea was that of introducing a new *inbox* variable,
> which overrides $MAIL if set, and which it is that will be opened
> upon startup / `account' switch.  I think we will go that route.

I keep coming back to the fact that mailx has been working just fine 
with this imap account for the past ten years or so.  I agree that 
having to replace Mail/ (or whatever trails the servername) with INBOX 
in the code looks hacky (and I don't know how Gunnar discovered that it 
was the solution).  But couldn't s-nail do what mailx does just for the 
sake of backward compatibility, as well as implementing the new more 
rational scheme?

Stephen Isard

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
__
S-nail-users@lists.sourceforge.net


Re: [S-nail] [ANN] of S-nail v14.8.12 («Bubas»)

2016-10-05 Thread Stephen Isard

On Wed, 5 Oct 2016, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:


hereby i announce S-nail v14.8.12, the «Bubas».

...

 788aad0 url_parse(): better take better care for path parts (Stephen Isard)..


Sorry to report that it still doesn't work for my problem imap server.
This is a linux machine where the inbox is at /var/spool/mail/username 
and the mail folders are in the user's own file space at ~/Mail.

The account definition includes the line:
set folder=imaps://username@servername/Mail/
Mailx copes with this by making username@servername/Mail the folder 
directory, and replacing the trailing Mail/ by INBOX for the inbox. 
s-nail-14.8.12 is failing to strip off Mail/ and I am getting the error 
message

IMAP error: Mailbox doesn't exist: Mail/INBOX

Stephen Isard--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot__
S-nail-users@lists.sourceforge.net

Re: [S-nail] Possible bug in s-nail on timestamp of Dec 31

2016-09-14 Thread Stephen Isard
On Wed, 14 Sep 2016, Donald Mugnai donaldmugnai-at-gmail.com |s-nail| wrote:

> How do you "configure the way the headline is displayed with the variable
> of the same name[1]" In the s-nail.rc file? All I want to get is a correct
> timestamp for my messages instead of Dec 31.  Is this a configuration
> issue? If so, what do you configure? What is name[1]? Thanks

Try putting the line
set datefield
in your .mailrc file.

Stephen Isard

--
__
S-nail-users@lists.sourceforge.net


Re: [S-nail] Possible bug in s-nail on timestamp of Dec 31

2016-09-13 Thread Stephen Isard
On Tue, 13 Sep 2016, Donald Mugnai donaldmugnai-at-gmail.com |s-nail| wrote:

...
> "/home/don/Maildir": 3 messages 1 new
> O  1 DonWed Dec 31 19:00   14/450   test
> O  2 DonWed Dec 31 19:00   15/501   NewTest
>> N  3 DonWed Dec 31 19:00   14/469   test with donmail
...

What does the command
grep "^From " /home/don/Maildir
give you?

Stephen Isard

--
__
S-nail-users@lists.sourceforge.net


[S-nail] imap account problem

2016-09-13 Thread Stephen Isard
Hello,

I have an imap account to which I can connect with mailx but not s-nail.
In the account definition in my .mailrc, I have
account XX {
set folder=imaps://username@servername/Mail
blah
}
Running s-nail with -vv I see that I am logging in successfully with 
gssapi, but then
T2 OK Logged in
>>> T3 SELECT "Mail/"
T3 NO [CANNOT] Invalid mailbox name

With mailx I get
T2 OK Logged in
>>> T3 SELECT "INBOX"
and everything is ok.

The Mail subdirectory in my home directory on that machine contains 
several mail folders (spam, etc.), but not my INBOX.  I don't know where 
the INBOX is stored.  Perhaps in the machine's /var/spool/mail, but I 
don't have the right permissions to look there.  The imap server 
announces itself as dovecot.

Anyway, mailx is doing the right thing for that imap server, but s-nail 
is not.

Stephen Isard


--
__
S-nail-users@lists.sourceforge.net


Re: [S-nail] Format of ~/dead.letter isn't mbox.

2016-08-27 Thread Stephen Isard
On Sat, 27 Aug 2016, Ralph Corderoy ralph-at-inputplus.co.uk |s-nail| wrote:

> The ~/dead.letter created by s-nail's mail(1) isn't mbox format.  It's
> just a catenation of email bodies over time.
(snip)...
I've checked sendmail/deliver.c's mailfile()and it writes mbox
(snip)...
> So I guess I'm asking if anyone knows the history of this discrepancy?

The s-nail behaviour is the same as that of current mailx and I'm pretty 
sure of all versions of Gunner Ritter's nail, from which mailx descends. 
My memory could be faulty, but I think I remember the mail program of 
the unix from Bell Labs on a pdp11-40 behaving the same way in 1975. 
That predates sendmail; mail could only go to other users of the same 
machine.

I think the intention was that you could read the text back into a new 
message that you were composing. See the ~d command.  Having headers in 
the file would make that messy.

I don't personally care one way or the other, but you asked for 
history...

Stephen Isard

--
__
S-nail-users@lists.sourceforge.net


Re: [S-nail] Temporary restrictions with new builtin line editor on [next]

2016-04-06 Thread Stephen Isard
On Wed, 6 Apr 2016, Ralph Corderoy ralph-at-inputplus.co.uk |s-nail| wrote:

> Hi,
>
> Martin wrote:
>> What I (and a colleague of mine) never understood:  what's the point
>> of the s-nail line-editor?
>
> Being new to the list, I've been wondering that too.  ~e and ~v are
> available.  ~h lets one cursor through the field.  And if it is wanted,
> aren't there's BSD-compatible libraries that provide GNU readline-like
> behaviour?

My recollection is that it started with people wanting file completion 
for attachments and directory name completion for changing folders.
I still think that wrapping rlwrap around the s-nail command is good 
enough and including readline code in s-nail itself isn't necessary.

Stephen Isard

--
__
S-nail-users@lists.sourceforge.net