Skip to content

Conversation

asutherland
Copy link
Contributor

Without the fix portion of this patch, the test results in the following failure:

  1) browserbox unit tests #listMailboxes should not die on NIL separators:
     TypeError: 'null' is not an object (evaluating 'item.attributes[1].value')
      at file:///home/visbrero/rev_control/fgit/browserbox/test/lib/browserbox.js:648
      at file:///home/visbrero/rev_control/fgit/browserbox/test/unit/unit.js:29

Per the RFC 3501 grammar, nil is okay here:

mailbox-list    = "(" [mbx-list-flags] ")" SP
                   (DQUOTE QUOTED-CHAR DQUOTE / nil) SP mailbox

The patch herein defaults to a '/' delimiter for the inbox, but that's probably not the right thing to do either. I would guess one would want to fall back to what NAMESPACE has to say, except in this case, the server I'm dealing with doesn't support NAMESPACE and generally seems to be less than great.

Here's an aggregated trace for your edification / shock and horror at this implementation :)

* OK [CAPABILITY IMAP4rev1 LITERAL+] IMAP4rev1 SEINE IMAP server ready (0.17.131210.01)
A1 CAPABILITY
* CAPABILITY SEINE IMAP server IMAP4rev1 LITERAL+
A1 OK CAPABILITY completed
A2 LIST "" "*"
* LIST (\NoInferiors) NIL "INBOX"
* LIST (\NoInferiors \UnMarked) "/" "&sLSsjMT0ulTHfNVo-"
* LIST (\NoInferiors \UnMarked) "/" "Sent Messages"
* LIST (\NoInferiors \UnMarked) "/" "Drafts"
* LIST (\NoInferiors \UnMarked) "/" "Deleted Messages"
* LIST (\NoInferiors \UnMarked) "/" "&yBXQbA- &ulTHfA-"
* LIST (\NoInferiors \UnMarked) "/" "&wfzVUdVo-"
* LIST (\NoInferiors \UnMarked) "/" "SNS&1Wg-"
* LIST (\NoInferiors \UnMarked) "/" "&vPSwvA- &07jJwNVo-"
A2 OK LIST completed
A3 LSUB "" "*"
* LSUB (\NoInferiors) NIL "INBOX"
* LSUB () "/" "&sLSsjMT0ulTHfNVo-"
* LSUB () "/" "Sent Messages"
* LSUB () "/" "Drafts"
* LSUB () "/" "Deleted Messages"
* LSUB () "/" "&yBXQbA- &ulTHfA-"
* LSUB () "/" "&wfzVUdVo-"
* LSUB () "/" "SNS&1Wg-"
* LSUB () "/" "&vPSwvA- &07jJwNVo-"
A3 OK LSUB completed

andris9 added a commit that referenced this pull request Sep 23, 2014
@andris9 andris9 merged commit eba46bd into emailjs:master Sep 23, 2014
@andris9
Copy link
Member

andris9 commented Sep 23, 2014

Thats pretty crazy – both that showing NIL instead of the delimiter is legal and that there are some servers that actually use it like this

@asutherland asutherland deleted the nil-folder-delim branch September 23, 2014 13:58
asutherland added a commit to asutherland/gaia-email-libs-and-more that referenced this pull request Nov 20, 2014
This is primarily a move to the upgrade startTLS functionality.  This included
a fix to the SMTP implementation where a server could avoid TLS-initiation by
not implementing EHLO.  (emailjs/emailjs-smtp-client#20).
This goal was bug 1060558.

An additional fix we had made locally but not upstreamed (but have now
upstreamed) and that has improved test coverage on our end (see test_mine) is
a problem relating to newlines.  See
emailjs/emailjs-imap-client#35.

Other (new) fixes folded in here:
- Namespace NIL delimiter: emailjs/emailjs-imap-client#36
- trailing whitespace in bodystructure list:
  emailjs/emailjs-imap-handler#8

Fixes we had made locally and upstreamed but not taken via the release process:
- NIL delimiters for LIST emailjs/emailjs-imap-client#27 and
  LSUB emailjs/emailjs-imap-client#29 (discovered while
  investigating bug 1091295 and bug 1084216)
asutherland added a commit to asutherland/gaia-email-libs-and-more that referenced this pull request Nov 27, 2014
This is primarily a move to the upgrade startTLS functionality.  This included
a fix to the SMTP implementation where a server could avoid TLS-initiation by
not implementing EHLO.  (emailjs/emailjs-smtp-client#20).
This goal was bug 1060558.

An additional fix we had made locally but not upstreamed (but have now
upstreamed) and that has improved test coverage on our end (see test_mine) is
a problem relating to newlines.  See
emailjs/emailjs-imap-client#35.

Other (new) fixes folded in here:
- Namespace NIL delimiter: emailjs/emailjs-imap-client#36
- trailing whitespace in bodystructure list:
  emailjs/emailjs-imap-handler#8

Fixes we had made locally and upstreamed but not taken via the release process:
- NIL delimiters for LIST emailjs/emailjs-imap-client#27 and
  LSUB emailjs/emailjs-imap-client#29 (discovered while
  investigating bug 1091295 and bug 1084216)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants