Crystalbyte.Equinox.Imap.ImapClient.LSub C# (CSharp) Method

LSub() public method

The LSUB command returns a subset of names from the set of names that the user has declared as being "active" or "subscribed". http://tools.ietf.org/html/rfc3501#section-6.3.9
public LSub ( string referenceName, string wildcardedMailboxName ) : Crystalbyte.Equinox.Imap.Responses.ListImapResponse
referenceName string The reference name.
wildcardedMailboxName string The mailbox name with possible wildcards.
return Crystalbyte.Equinox.Imap.Responses.ListImapResponse
        public ListImapResponse LSub(string referenceName, string wildcardedMailboxName)
        {
            // we need to convert non ASCII names according to IMAP specs.
            // http://tools.ietf.org/html/rfc2060#section-5.1.3
            referenceName = MailboxNameEncoder.Encode(referenceName);
            wildcardedMailboxName = MailboxNameEncoder.Encode(wildcardedMailboxName);

            var text = string.Format("LSUB \"{0}\" \"{1}\"", referenceName, wildcardedMailboxName);
            var command = new ImapCommand(text);
            var reader = SendAndReceive(command);

            var response = new ListImapResponse();
            response.Parse(reader);
            return response;
        }