Hello.

Steffen Nurpmeso wrote in
 <20220112001217.mq8xe%[email protected]>:
 |Steffen Nurpmeso wrote in
 | <20220111145923.vuz7r%[email protected]>:
 | ...
 ||| |I send you this message because I'm unable to send emails from
 ||| |Microsoft Exchange Server and s-nail v14.9.23 on Void Linux. It
 | ....
 ||| | s-nail: TLS socket read error, retrying: Interrupted system call
 ||| |
 ||| |Once this warning, s-nail is also unable to access the mailbox
 ||| |using IMAP. I have this message :
 ||| |
 ||| | s-nail: IMAP write error: Bad file descriptor

So from having a short glance into this it seems to me that we
misinterpret a response of the Microsoft server.  Looking at the
IMAP standard RFC 3501 i think what Microsoft does is false, hmm.

    s-nail: >>> T7 APPEND "Inbox" "12-Jan-2022 23:48:39 +0100" {447}
    s-nail: >>> SERVER: + Ready for additional command text.

  Google for example says OK or gives another status, no additional
  arguments are standardized for "APPEND", and .. i have not looked
  into the MULTIAPPEND extension yet, but .. we do not use it.

    s-nail: >>> SERVER: * NO Keywords are not supported!

  That NO is what we do not like, this response should not happen
  here, it seems false to me.  But who am i.

    s-nail: >>> SERVER: * 2 RECENT
    s-nail: >>> SERVER: * 6 EXISTS
    s-nail: >>> SERVER: T7 OK [APPENDUID 14 33] APPEND completed.

  What actually happens is that we interpret the NO above as
  a statement from the server that the mailbox does not exist, and
  so we try to CREATE it .. which increments the TAG so that our
  current tag is 8 not 7.  When then Microsoft says "T7 OK" this
  code fails to get that because "we are at 8", not 7.  Well.
  The code is too simple minded anyhow, RFC 3501 says

    If the destination mailbox does not exist, a server MUST return an
    error, and MUST NOT automatically create the mailbox.  Unless it
    is certain that the destination mailbox can not be created, the
    server MUST send the response code "[TRYCREATE]" as the prefix of
    the text of the tagged NO response.  This gives a hint to the
    client that it can attempt a CREATE command and retry the APPEND
    if the CREATE is successful.

  So the according [TRYCREATE] check has always been commented out
  ever since IMAP support was added in nail 11.00, 2004-07-30.  Wow.

  Now i have to tell you that i already had thrown away the IMAP
  code, it was brought back because of broad (for the community
  using this software, anyhow) user request.  I never looked that
  much into it, added some stuff yes (internationalized names for
  example, new user credential code), but that basically was it,
  because it _will_ temporarily vanish whenever i find time to do
  the major rewrite of the MIME and I/O layer i, eh, announce ever
  since i took the maintainership.

  Now especially the IMAP test code is super minimal because of the
  above reasoning .., and with my local test bed (dovecot etc)
  i cannot reproduce the issue anyhow, also not with Google, it
  seems Microsoft is it, only.  Anyhow.  Hm.  This code is a mess :)

I will try to find a way out without breaking other code flow
cases, which hopefully works.  But note i will not make a new
release for this Microsoft problem, we could ask Leah to patch the
Void Linux version though?  IMAP ok, it gets a new standard
revision even despite the advent of JMAP, but it is obsoleted in
S-nail because the network code is terrible, it will vanish in
v15, at least temporarily.  It took years until all bugs were
found that i had introduced when removing the code, developing the
rest further, and reintroducing the code again by popular demand,
it seems people use it only very rarely.  I personally do not use
it at all but for testing, i only ever use SMTP.  (Having said
that, i would maybe use it if there were several IMAP upstreams to
sync, but then again mbsync was what i recommended once i removed
the IMAP code.  You know, i really want a software which is
capable to gracefully deal with errors all along the way, and that
is what you will not get.)

Dear Madou, thanks for reporting this issue!
I am looking into this, sorry that it takes so long, i am buried
in household aka supply work.

Ciao!

--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)

Reply via email to