Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

During IMAP reconnection neomutt sends LIST but not SELECT #1248

Closed
EdwardBetts opened this issue Jun 6, 2018 · 2 comments
Closed

During IMAP reconnection neomutt sends LIST but not SELECT #1248

EdwardBetts opened this issue Jun 6, 2018 · 2 comments
Labels

Comments

@EdwardBetts
Copy link
Contributor

If the connection to the IMAP server is lost neomutt will reconnect, but the reconnection is incomplete. When first opening a connection mutt sends the LIST and SELECT commands, during the reconnection it only sends the LIST command.

After a reconnect the neomutt status bar says ---NeoMutt: (no mailbox) [Msgs:0]. This happens every time.

Expected behaviour is for neomutt to reconnect and display the current mailbox.

This is the muttrc config file I used for testing.

set folder=imap://username:password@localhost/

set mail_check=2
set timeout=2
unset help
unset ssl_starttls

To reproduce run test_imap.py (included below), then use neomutt to connect with these parameters:

neomutt -F muttrc -f imap://user:password@localhost:1143/

Neomutt will connect to the IMAP server and show one message, after 3 seconds the test server will drop the connection, neomutt will attempt to reconnect but the reconnection is incomplete.

The cmd_handle_fatal function is responsible for handling the disconnection, it displays the "Mailbox closed" error, then calls imap_conn_find to reconnect.

static void cmd_handle_fatal(struct ImapData *idata)
{
  idata->status = IMAP_FATAL;

  if ((idata->state >= IMAP_SELECTED) && (idata->reopen & IMAP_REOPEN_ALLOW))
  {
    mx_fastclose_mailbox(idata->ctx);
    mutt_socket_close(idata->conn);
    mutt_error(_("Mailbox %s@%s closed"), idata->conn->account.login,
               idata->conn->account.host);
    idata->state = IMAP_DISCONNECTED;
  }

  imap_close_connection(idata);
  if (!idata->recovering)
  {
    idata->recovering = true;
    if (imap_conn_find(&idata->conn->account, 0))
      mutt_clear_error();
    idata->recovering = false;
  }
}

It isn't clear who is responsible for sending the SELECT command to the IMAP server, maybe it should be in imap_conn_find or cmd_handle_fatal. The following is the relevant part of imap_conn_find.

  if (new && idata->state == IMAP_AUTHENTICATED)
  {
    /* capabilities may have changed */
    imap_exec(idata, "CAPABILITY", IMAP_CMD_QUEUE);
    /* enable RFC6855, if the server supports that */
    if (mutt_bit_isset(idata->capabilities, ENABLE))
      imap_exec(idata, "ENABLE UTF8=ACCEPT", IMAP_CMD_QUEUE);
    /* get root delimiter, '/' as default */
    idata->delim = '/';
    imap_exec(idata, "LIST \"\" \"\"", IMAP_CMD_QUEUE);
    /* we may need the root delimiter before we open a mailbox */
    imap_exec(idata, NULL, IMAP_CMD_FAIL_OK);
}

imap_test.py

#!/usr/bin/python3

import socketserver
from time import sleep
from threading import Thread


verbose = True

headers = '''To: edward@4angle.com
Subject: sample message
From: John Smith <johnsmith@example.com>
Content-Type: text/plain
Message-Id: <E1cedx9-0002JX-Oe@example.com>
Date: Fri, 01 Jan 2000 10:00:00 +0000
'''

msg = headers + '\nThis is an email'

def delay_shutdown(request, delay=3):
    sleep(delay)
    request.finish()
    request.connection.close()
    request.server.shutdown()

class MyServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
    allow_reuse_address = True

class SimpleIMAPHandler(socketserver.StreamRequestHandler):
    # timeout = 1
    continuation = None
    capabilities = 'LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SPECIAL-USE0'
    capabilities = ''

    def setup(self):
        super().setup()
        self.server.logged = None

    def _send(self, message):
        if verbose:
            print(f'SENT: {message.decode("utf-8").strip()}')
        self.wfile.write(message)

    def _send_line(self, message):
        self._send(message + b'\r\n')

    def _send_textline(self, message):
        self._send_line(message.encode('ASCII'))

    def _send_tagged(self, tag, code, message):
        self._send_textline(' '.join((tag, code, message)))

    def handle(self):
        # Send a welcome message.
        self._send_textline('* OK IMAP4rev1')
        if self.server.first_run:
            timer = Thread(target=delay_shutdown, args=(self,))
            timer.start()
        while 1:
            # Gather up input until we receive a line terminator or we timeout.
            # Accumulate read(1) because it's simpler to handle the differences
            # between naked sockets and SSL sockets.
            line = b''
            while 1:
                try:
                    try:
                        part = self.rfile.read(1)
                    except ValueError:
                        return
                    if part == b'':
                        # Naked sockets return empty strings..
                        return
                    line += part
                except OSError:
                    # ..but SSLSockets raise exceptions.
                    return
                if line.endswith(b'\r\n'):
                    break

            if verbose:
                print(f' GOT: {line.decode("utf-8").strip()}')
            if self.continuation:
                try:
                    self.continuation.send(line)
                except StopIteration:
                    self.continuation = None
                continue
            splitline = line.decode('ASCII').split()
            tag = splitline[0]
            cmd = splitline[1]
            args = splitline[2:]

            if hasattr(self, 'cmd_' + cmd):
                try:
                    continuation = getattr(self, 'cmd_' + cmd)(tag, args)
                except OSError:
                    return
                if continuation:
                    self.continuation = continuation
                    next(continuation)
            else:
                self._send_tagged(tag, 'BAD', cmd + ' unknown')

    def cmd_CAPABILITY(self, tag, args):
        caps = ('IMAP4rev1 ' + self.capabilities
                if self.capabilities
                else 'IMAP4rev1')
        self._send_textline('* CAPABILITY ' + caps)
        self._send_tagged(tag, 'OK', 'CAPABILITY completed')

    def cmd_ENABLE(self, tag, args):
        self._send_tagged(tag, 'OK', 'Enabled')

    def cmd_LOGOUT(self, tag, args):
        self.server.logged = None
        self._send_textline('* BYE IMAP4ref1 Server logging out')
        self._send_tagged(tag, 'OK', 'LOGOUT completed')

    def cmd_LOGIN(self, tag, args):
        self.server.logged = args[0]
        self._send_tagged(tag, 'OK', 'LOGIN completed')

    def cmd_LIST(self, tag, args):
        self._send_textline('* LIST (\\Noselect) "/" ""')
        self._send_tagged(tag, 'OK', 'LIST completed')

    def cmd_SELECT(self, tag, args):
        self._send_textline('* FLAGS (\Answered \Flagged \Deleted \Seen \Draft Old $Forwarded)')
        self._send_textline('* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft Old $Forwarded \*)] Flags permitted')
        self._send_textline('* 1 EXISTS')
        self._send_textline('* 0 RECENT')
        # self._send_textline(r'* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)')
        # self._send_textline(r'* OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited')
        self._send_tagged(tag, 'OK', '[READ-WRITE] SELECT completed')

    def cmd_NOOP(self, tag, args):
        self._send_tagged(tag, 'OK', 'NOOP completed')

    def cmd_CLOSE(self, tag, args):
        self._send_tagged(tag, 'OK', 'CLOSE completed')

    def cmd_UID(self, tag, args):
        print('UID', tag, args)

        msg_len = (50 * 500) + len(headers) + 1
        self._send_textline('* 1 FETCH (UID 10 BODY[] {{{}}}'.format(msg_len))
        self._send_textline(headers)
        self._send_textline('')
        try:
            for i in range(50):
                self._send_textline('#' * 498)
                sleep(0.1)
        except ConnectionResetError:
            return
        self._send_textline(')')
        self._send_tagged(tag, 'OK', 'Fetch completed')

    def cmd_FETCH(self, tag, args):

        self._send_textline('* 1 FETCH (UID 10 FLAGS () INTERNALDATE "01-Jan-2000 10:00:00 +0000" BODY[HEADER.FIELDS (DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL X-KEYWORDS X-MOZILLA-KEYS KEYWORDS X-ORIGINAL-TO)] {{{}}}'.format(len(headers)))
        self._send_textline(headers)
        self._send_textline(')')
        self._send_tagged(tag, 'OK', 'Fetch completed')

    def cmd_bad_SELECT(self, tag, args):
        sleep(10)
        self._send_textline('* 172 EXISTS')
        self._send_textline('* 1 RECENT')
        self._send_textline('* OK [UNSEEN 12] Message 12 is first unseen')
        self._send_textline('* OK [UIDVALIDITY 3857529045] UIDs valid')
        self._send_textline('* OK [UIDNEXT 4392] Predicted next UID')
        self._send_textline(r'* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)')
        self._send_textline(r'* OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited')
        self._send_tagged(tag, 'OK', '[READ-WRITE] SELECT completed')

def print_address(server):
    print('imap server running on {}:{}'.format(*server.server_address))


server = MyServer(('localhost', 1143), SimpleIMAPHandler)
print_address(server)
server.first_run = True
server.serve_forever()
server.server_close()

print('\nrestarting server\n')
server = MyServer(('localhost', 1143), SimpleIMAPHandler)
print_address(server)
server.first_run = False
server.serve_forever()

NeoMutt log

[2018-06-06 13:19:02] NeoMutt-20180512 debugging at level 5
[2018-06-06 13:19:02]<M> log_file_open() Debugging at level 5 to file '/home/edward/scratch/debug_mutt/log0'
[2018-06-06 13:19:02]<2> mutt_window_reflow() entering
[2018-06-06 13:19:02]<2> mutt_window_reflow() entering
[2018-06-06 13:19:02]<2> mutt_window_reflow() entering
[2018-06-06 13:19:02]<2> mutt_window_reflow() entering
[2018-06-06 13:19:02]<2> mutt_window_reflow() entering
[2018-06-06 13:19:02]<2> mutt_window_reflow() entering
[2018-06-06 13:19:02]<2> source_rc() Reading configuration file '/etc/neomuttrc'.
[2018-06-06 13:19:02]<5> parse_attach_list() added */.* [9]
[2018-06-06 13:19:02]<5> parse_attach_list() added text/x-vcard [7]
[2018-06-06 13:19:02]<5> parse_attach_list() added application/pgp.* [2]
[2018-06-06 13:19:02]<5> parse_attach_list() added application/x-pkcs7-.* [2]
[2018-06-06 13:19:02]<5> parse_attach_list() added text/plain [7]
[2018-06-06 13:19:02]<5> parse_attach_list() added message/external-body [4]
[2018-06-06 13:19:02]<5> parse_attach_list() added message/external-body [4]
[2018-06-06 13:19:02]<2> source_rc() Reading configuration file '/usr/lib/neomutt/source-neomuttrc.d|'.
[2018-06-06 13:19:02]<2> source_rc() Reading configuration file '/etc/neomuttrc.d/charset.rc'.
[2018-06-06 13:19:02]<2> source_rc() Reading configuration file '/etc/neomuttrc.d/colors.rc'.
[2018-06-06 13:19:02]<3> mutt_alloc_color() Color pairs used so far: 1
[2018-06-06 13:19:02]<3> mutt_alloc_color() Color pairs used so far: 2
[2018-06-06 13:19:02]<3> mutt_alloc_color() Color pairs used so far: 3
[2018-06-06 13:19:02]<3> mutt_alloc_color() Color pairs used so far: 4
[2018-06-06 13:19:02]<3> mutt_alloc_color() Color pairs used so far: 5
[2018-06-06 13:19:02]<3> mutt_alloc_color() Color pairs used so far: 6
[2018-06-06 13:19:02]<3> mutt_alloc_color() Color pairs used so far: 7
[2018-06-06 13:19:02]<3> mutt_alloc_color() Color pairs used so far: 8
[2018-06-06 13:19:02]<2> source_rc() Reading configuration file '/etc/neomuttrc.d/compressed-folders.rc'.
[2018-06-06 13:19:02]<2> source_rc() Reading configuration file '/etc/neomuttrc.d/gpg.rc'.
[2018-06-06 13:19:02]<2> source_rc() Reading configuration file '/etc/neomuttrc.d/smime.rc'.
[2018-06-06 13:19:02]<2> source_rc() Reading configuration file '/home/edward/scratch/debug_mutt/muttrc'.
[2018-06-06 13:19:02]<3> imap_parse_path() Using default IMAP port 143
[2018-06-06 13:19:02]<3> imap_parse_path() Using default IMAPS port 993
[2018-06-06 13:19:02]<2> mutt_window_reflow() entering
[2018-06-06 13:19:02]<M> mx_open_mailbox() Reading imap://user:password@localhost:1143/...
[2018-06-06 13:19:02]<M> raw_socket_open() Looking up localhost...
[2018-06-06 13:19:02]<M> raw_socket_open() Connecting to localhost...
[2018-06-06 13:19:02]<2> socket_connect() Connection failed. errno: 111...
[2018-06-06 13:19:02]<2> mutt_socket_open() Connected to localhost:1143 on fd=4
[2018-06-06 13:19:02]<3> imap_cmd_step() grew buffer to 512 bytes
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< * OK IMAP4rev1
[2018-06-06 13:19:02]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:02]<2> mutt_socket_write_d() 4> a0000 CAPABILITY
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< * CAPABILITY IMAP4rev1
[2018-06-06 13:19:02]<3> cmd_parse_capability() Handling CAPABILITY
[2018-06-06 13:19:02]<4> cmd_parse_capability()  Found capability "IMAP4rev1": 1
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< a0000 OK CAPABILITY completed
[2018-06-06 13:19:02]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:02]<2> imap_authenticate() Trying pre-defined imap_authenticators.
[2018-06-06 13:19:02]<M> imap_auth_plain() Logging in...
[2018-06-06 13:19:02]<2> mutt_socket_write_d() 4> a0001 AUTHENTICATE PLAIN dXNlcgB1c2VyAHBhc3N3b3Jk
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< a0001 BAD AUTHENTICATE unknown
[2018-06-06 13:19:02]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:02]<2> mutt_sasl_client_new() SASL local ip: 127.0.0.1;34958, remote ip:127.0.0.1;1143
[2018-06-06 13:19:02]<2> mutt_sasl_client_new() External authentication name: user
[2018-06-06 13:19:02]<2> mutt_sasl_cb_log() SASL: No worthy mechs found
[2018-06-06 13:19:02]<2> imap_auth_sasl() IMAP4rev1 unavailable
[2018-06-06 13:19:02]<5> mutt_socket_write_d() 4> a0002 LOGIN "user" "password"
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< a0002 OK LOGIN completed
[2018-06-06 13:19:02]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:02]<2> mutt_socket_write_d() 4> a0003 CAPABILITY
a0004 LIST "" ""
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< * CAPABILITY IMAP4rev1
[2018-06-06 13:19:02]<3> cmd_parse_capability() Handling CAPABILITY
[2018-06-06 13:19:02]<4> cmd_parse_capability()  Found capability "IMAP4rev1": 1
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< a0003 OK CAPABILITY completed
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< * LIST (\Noselect) "/" ""
[2018-06-06 13:19:02]<3> cmd_parse_list() Root delimiter: /
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< a0004 OK LIST completed
[2018-06-06 13:19:02]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:02]<M> imap_open_mailbox() Selecting INBOX...
[2018-06-06 13:19:02]<2> mutt_socket_write_d() 4> a0005 SELECT "INBOX"
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< * FLAGS (\Answered \Flagged \Deleted \Seen \Draft Old $Forwarded)
[2018-06-06 13:19:02]<3> imap_open_mailbox() Getting mailbox FLAGS
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft Old $Forwarded \*)] Flags permitted
[2018-06-06 13:19:02]<3> imap_open_mailbox() Getting mailbox PERMANENTFLAGS
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< * 1 EXISTS
[2018-06-06 13:19:02]<2> cmd_handle_untagged() Handling EXISTS
[2018-06-06 13:19:02]<2> cmd_handle_untagged() New mail in INBOX - 1 messages total.
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< * 0 RECENT
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< a0005 OK [READ-WRITE] SELECT completed
[2018-06-06 13:19:02]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:02]<3> imap_open_mailbox() Mailbox flags: [\Answered] [\Flagged] [\Deleted] [\Seen] [\Draft] [Old] [$Forwarded] [\*] 
[2018-06-06 13:19:02]<3> mutt_mktemp_full() ../imap/message.c:654: mutt_mktemp returns "/tmp/neomutt-x1-1000-32563-16989865347655702446".
[2018-06-06 13:19:02]<5> mutt_progress_update() updating progress: 0
[2018-06-06 13:19:02]<2> mutt_socket_write_d() 4> a0006 FETCH 1:1 (UID FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS (DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL X-ORIGINAL-TO)])
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< * 1 FETCH (UID 10 FLAGS () INTERNALDATE "01-Jan-2000 10:00:00 +0000" BODY[HEADER.FIELDS (DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL X-KEYWORDS X-MOZILLA-KEYS KEYWORDS X-ORIGINAL-TO)] {194}
[2018-06-06 13:19:02]<3> cmd_parse_fetch() Handling FETCH
[2018-06-06 13:19:02]<3> cmd_parse_fetch() #1 FETCH response ignored for this message
[2018-06-06 13:19:02]<2> imap_read_literal() reading 194 bytes
[2018-06-06 13:19:02]<4> imap_read_literal() 
To: edward@4angle.com
Subject: sample message
From: John Smith <johnsmith@example.com>
Content-Type: text/plain
Message-Id: <E1cedx9-0002JX-Oe@example.com>
Date: Fri, 01 Jan 2000 10:00:00 +0000
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< 
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< )
[2018-06-06 13:19:02]<2> mutt_socket_readln_d() 4< a0006 OK Fetch completed
[2018-06-06 13:19:02]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:02]<2> imap_read_headers() Overriding UIDNEXT: 0 -> 11
[2018-06-06 13:19:02]<2> imap_open_mailbox() msgcount is 1
[2018-06-06 13:19:02]<M> mutt_sort_headers() Sorting mailbox...
[2018-06-06 13:19:02]<2> mutt_window_reflow() entering
[2018-06-06 13:19:02]<5> mutt_addr_is_user() no, all failed.
[2018-06-06 13:19:02]<5> mutt_addr_is_user() #5 yes, edward@4angle.com = edward@4angle.com
[2018-06-06 13:19:02]<5> mutt_addr_is_user() no, all failed.
[2018-06-06 13:19:04]<4> mutt_index_menu() [1031]: Got op -2
[2018-06-06 13:19:04]<2> mutt_socket_write_d() 4> a0007 NOOP
[2018-06-06 13:19:04]<2> mutt_socket_readln_d() 4< a0007 OK NOOP completed
[2018-06-06 13:19:04]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:06]<4> mutt_index_menu() [1031]: Got op -2
[2018-06-06 13:19:06]<2> mutt_socket_write_d() 4> a0008 NOOP
[2018-06-06 13:19:06]<E> mutt_socket_readchar() Connection to localhost closed
[2018-06-06 13:19:06]<1> imap_cmd_step() Error reading server response.
[2018-06-06 13:19:06]<1> mutt_socket_close() Attempt to close closed connection.
[2018-06-06 13:19:06]<E> cmd_handle_fatal() Mailbox @localhost closed
[2018-06-06 13:19:06]<M> raw_socket_open() Looking up localhost...
[2018-06-06 13:19:07]<M> raw_socket_open() Connecting to localhost...
[2018-06-06 13:19:07]<2> socket_connect() Connection failed. errno: 111...
[2018-06-06 13:19:07]<2> mutt_socket_open() Connected to localhost:1143 on fd=4
[2018-06-06 13:19:07]<2> mutt_socket_readln_d() 4< * OK IMAP4rev1
[2018-06-06 13:19:07]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:07]<2> mutt_socket_write_d() 4> a0000 CAPABILITY
[2018-06-06 13:19:07]<2> mutt_socket_readln_d() 4< * CAPABILITY IMAP4rev1
[2018-06-06 13:19:07]<3> cmd_parse_capability() Handling CAPABILITY
[2018-06-06 13:19:07]<4> cmd_parse_capability()  Found capability "IMAP4rev1": 1
[2018-06-06 13:19:07]<2> mutt_socket_readln_d() 4< a0000 OK CAPABILITY completed
[2018-06-06 13:19:07]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:07]<2> imap_authenticate() Trying pre-defined imap_authenticators.
[2018-06-06 13:19:07]<M> imap_auth_plain() Logging in...
[2018-06-06 13:19:07]<2> mutt_socket_write_d() 4> a0001 AUTHENTICATE PLAIN dXNlcgB1c2VyAHBhc3N3b3Jk
[2018-06-06 13:19:07]<2> mutt_socket_readln_d() 4< a0001 BAD AUTHENTICATE unknown
[2018-06-06 13:19:07]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:07]<2> mutt_sasl_client_new() SASL local ip: 127.0.0.1;34962, remote ip:127.0.0.1;1143
[2018-06-06 13:19:07]<2> mutt_sasl_client_new() External authentication name: user
[2018-06-06 13:19:07]<2> mutt_sasl_cb_log() SASL: No worthy mechs found
[2018-06-06 13:19:07]<2> imap_auth_sasl() IMAP4rev1 unavailable
[2018-06-06 13:19:07]<5> mutt_socket_write_d() 4> a0002 LOGIN "user" "password"
[2018-06-06 13:19:07]<2> mutt_socket_readln_d() 4< a0002 OK LOGIN completed
[2018-06-06 13:19:07]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:07]<2> mutt_socket_write_d() 4> a0003 CAPABILITY
a0004 LIST "" ""
[2018-06-06 13:19:07]<2> mutt_socket_readln_d() 4< * CAPABILITY IMAP4rev1
[2018-06-06 13:19:07]<3> cmd_parse_capability() Handling CAPABILITY
[2018-06-06 13:19:07]<4> cmd_parse_capability()  Found capability "IMAP4rev1": 1
[2018-06-06 13:19:07]<2> mutt_socket_readln_d() 4< a0003 OK CAPABILITY completed
[2018-06-06 13:19:07]<2> mutt_socket_readln_d() 4< * LIST (\Noselect) "/" ""
[2018-06-06 13:19:07]<3> cmd_parse_list() Root delimiter: /
[2018-06-06 13:19:07]<2> mutt_socket_readln_d() 4< a0004 OK LIST completed
[2018-06-06 13:19:07]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:07]<1> imap_exec() command failed: a0004 OK LIST completed
[2018-06-06 13:19:07]<2> mutt_window_reflow() entering
[2018-06-06 13:19:09]<4> mutt_index_menu() [1031]: Got op -2
[2018-06-06 13:19:11]<4> mutt_index_menu() [1031]: Got op -2
[2018-06-06 13:19:13]<4> mutt_index_menu() [1031]: Got op -2
[2018-06-06 13:19:15]<4> mutt_index_menu() [1031]: Got op -2
[2018-06-06 13:19:17]<4> mutt_index_menu() [1031]: Got op -2
[2018-06-06 13:19:19]<4> mutt_index_menu() [1031]: Got op -2
[2018-06-06 13:19:21]<4> mutt_index_menu() [1031]: Got op -2
[2018-06-06 13:19:22]<4> mutt_index_menu() [1031]: Got op 99
[2018-06-06 13:19:22]<M> imap_logout_all() Closing connection to localhost...
[2018-06-06 13:19:22]<2> mutt_socket_write_d() 4> a0005 LOGOUT
[2018-06-06 13:19:22]<2> mutt_socket_readln_d() 4< * BYE IMAP4ref1 Server logging out
[2018-06-06 13:19:22]<2> cmd_handle_untagged() Handling BYE
[2018-06-06 13:19:22]<2> mutt_socket_readln_d() 4< a0005 OK LOGOUT completed
[2018-06-06 13:19:22]<3> imap_cmd_step() IMAP queue drained
[2018-06-06 13:19:22] Closing log.

NeoMutt Version

NeoMutt 20180512
Copyright (C) 1996-2016 Michael R. Elkins and others.
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.

System: Linux 4.15.0-2-amd64 (x86_64)
ncurses: ncurses 6.1.20180210 (compiled with 6.1.20180210)
libidn: 1.33 (compiled with 1.33)
hcache backends: tokyocabinet

Compiler:
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 7.3.0-19' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Debian 7.3.0-19)

Configure options: --build=x86_64-linux-gnu --prefix=/usr {--includedir=${prefix}/include} {--mandir=${prefix}/share/man} {--infodir=${prefix}/share/info} --sysconfdir=/etc --localstatedir=/var --disable-silent-rules {--libdir=${prefix}/lib/x86_64-linux-gnu} {--libexecdir=${prefix}/lib/x86_64-linux-gnu} --disable-maintainer-mode --disable-dependency-tracking --mandir=/usr/share/man --libexecdir=/usr/lib --with-mailpath=/var/mail --gpgme --lua --notmuch --with-ui --gnutls --gss --idn --mixmaster --sasl --tokyocabinet

Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/neomutt-lNxelW/neomutt-20180512+dfsg.1=. -fstack-protector-strong -Wformat -Werror=format-security -std=c99 -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -I/usr/include -I/usr/include/lua5.3 -DNCURSES_WIDECHAR -isystem /usr/include/mit-krb5

Default options:
+attach_headers_color +compose_to_sender +compress +cond_date +debug
+encrypt_to_self +forgotten_attachments +forwref +ifdef +imap +index_color
+initials +limit_current_thread +multiple_fcc +nested_if +new_mail +nntp +pop
+progress +quasi_delete +regcomp +reply_with_xorig +sensible_browser +sidebar
+skip_quoted +smtp +status_color +timeout +tls_sni +trash

Compile options:
+bkgdset +color +curs_set +fcntl -flock -fmemopen +futimens +getaddrinfo
+gnutls +gpgme +gss +hcache -homespool +idn -locales_hack +lua +meta
+mixmaster +nls +notmuch -openssl +pgp +sasl +smime +start_color
+sun_attachment +typeahead
MAILPATH="/var/mail"
MIXMASTER="mixmaster"
PKGDATADIR="/usr/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/etc"

@EdwardBetts EdwardBetts added the topic:imap IMAP label Jun 6, 2018
@gahr
Copy link
Member

gahr commented Jun 6, 2018

Thanks, this is very valuable info!

EdwardBetts added a commit to EdwardBetts/neomutt that referenced this issue Jun 6, 2018
This is an attempt to do something about bug neomutt#1248

New imap_select_mailbox function split out of imap_open_mailbox to be
called during reconnect.

There is a bug in this implementation, it crashes during the
reconnection stage with this error:

terminated by signal SIGSEGV (Address boundary error)

Somebody with a better grasp of C might figure out why it is failing.
EdwardBetts added a commit to EdwardBetts/neomutt that referenced this issue Nov 19, 2018
EdwardBetts added a commit to EdwardBetts/neomutt that referenced this issue Nov 19, 2018
@l29ah
Copy link
Contributor

l29ah commented Dec 10, 2019

fixed by e1271d5

@l29ah l29ah closed this as completed Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants