1
Vote

Bad RegEx match when matching folders with List()

description

The RegEx used didn't match the folders on my IMAP-server. I changed the RegEx to:
const string PARSE_FOLDER = @"[^(](\(?<children>[^)]+))\s\""(?<seperator>[^\""])\""\s(?<folder>[^\""]*)";
to remedy it.

Could you post folder listings from your IMAP, maby mine or your have implemented the RFC wrong or in a different way. I'm using hMailServer.

comments

kelthar wrote Jun 11, 2009 at 7:39 PM

And by the way, love the work. Really good library. Keep it up! I've found another "bug" in a RegEx when parsing body parts. Will post it when I've found a solution for it. I'm really interested why it works over on your side and not on mine.

Once again, good work.

newbish wrote Jun 19, 2009 at 4:02 PM

Yea I have been using Dovecot for all my testing in the last couple versions. Here is sample output of my server using telnet.
  • OK Dovecot ready.
    kw0001 CAPABILITY
  • CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS STARTTLS AUTH=PLAIN AUTH=LOGIN
    kw0001 OK Capability completed.
    kw0002 login email@skurd.com password
    kw0002 OK Logged in.
    kw0003 LIST "" *
  • LIST (\HasNoChildren) "." "Sent"
  • LIST (\HasChildren) "." "blah"
  • LIST (\HasNoChildren) "." "info"
  • LIST (\HasNoChildren) "." "INBOX"
  • LIST (\HasNoChildren) "." "blah.testing"
  • LIST (\HasNoChildren) "." "blah.test"
  • LIST (\HasNoChildren) "." "BLAH.test"
    kw0003 OK List completed.
    kw0004 LOGOUT
  • BYE Logging out
    kw0004 OK Logout completed.
    Connection closed by foreign host.

newbish wrote Jun 19, 2009 at 4:06 PM

If im reading your regexp correctly you don't have spaces around your folder name and that's the difference.