mailio icon indicating copy to clipboard operation
mailio copied to clipboard

when using the imap to received the mails but failed

Open lofonder opened this issue 8 months ago • 1 comments

Ive used the imap to recieving the mails from the server.but failed when i used the method of the list_folders. ` std::string t_init = "";

imap::mailbox_folder_t t_inboxes = m_conn->list_folders(t_init);

std::liststd::string t_inboxe_names;

get_folders(0,t_inboxes,t_inboxe_names);

` the server response likes this:

LIST (\Noselect) "/" ""

and the errors ocurred for on the code of the method named parse_response void imap::parse_response(const string& response) `

        case QUOTED_ATOM:

        {

            if (atom_state_ == atom_state_t::NONE)

            {

                cur_token = make_shared<response_token_t>();

                cur_token->token_type = response_token_t::token_type_t::ATOM;

                token_list = optional_part_state_ ? find_last_token_list(optional_part_) : find_last_token_list(mandatory_part_);

                token_list->push_back(cur_token);

                atom_state_ = atom_state_t::QUOTED;

            }

            else if (atom_state_ == atom_state_t::QUOTED)

            {
                // The backslash and a double quote within an atom is the double quote only.

                if (token_list->back()->atom.back() != codec::BACKSLASH_CHAR) /////// here's the bug line

                    atom_state_ = atom_state_t::NONE;
                else
                    token_list->back()->atom.back() = ch;
            }

        }

        break;

the code throws the exception which likes cannot seek string iterator before begin `

lofonder avatar Jun 15 '25 13:06 lofonder

I've fixed the bug .I change the line into if (!token_list->back()->atom.empty() && token_list->back()->atom.back() != codec::BACKSLASH_CHAR) /////// here's the bug line but after I get the list of the mail inboxes.anther problem occured.

I met the same problem the the topic mentioned https://github.com/karastojko/mailio/issues/132 A nd I founded that the unrecognized partion of the text seemed not encoded by the utf7 codec . could u just give me a little tips to solve this problem?

lofonder avatar Jun 16 '25 08:06 lofonder

Without an input which shows the problem I cannot reason about this bug. Closing it until I get more information.

karastojko avatar Aug 31 '25 08:08 karastojko