Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1483916 closed Bugs (fixed)

No inbox when new mailaccount

Reported by: lhadata Owned by:
Priority: 5 Milestone: 0.1-beta2
Component: IMAP connection Version: 0.1-beta
Severity: major Keywords:
Cc:

Description

Theres is no inbox created or shown in the mailboxlist when i login with a brand new mailaccount (no mails sent or recieved).

Change History (4)

comment:1 Changed 7 years ago by lhadata

  • Resolution set to fixed
  • Status changed from new to closed

comment:2 Changed 7 years ago by lhadata

In rcube_imap.inc i forced roundcube to get Inbox in the folder array if it wasn't there.

Search for:
write mailboxlist to cache
$this->update_cache('mailboxes', $a_folders);

After this add:
if (!in_array("INBOX", $a_folders))

array_unshift($a_folders, "INBOX");

Then the INBOX should be present in the mailboxlist no matter what.

comment:3 Changed 7 years ago by lhadata

Sorry i mentioned wrong file above i changed in roundcube/program/include/main.inc

comment:4 Changed 7 years ago by lhadata

Sorry for the above post, it wasn't working as expected.

This one is working: roundcube/program/include/rcube_imap.inc

Search for: function _list_mailboxes

Replace with the whole function this:

  function _list_mailboxes($root='', $filter='*')
    {
    $a_defaults = $a_out = array();
    
    // get cached folder list    
    $a_mboxes = $this->get_cache('mailboxes');
    if (is_array($a_mboxes))
      return $a_mboxes;

    // retrieve list of folders from IMAP server
    $a_folders = iil_C_ListSubscribed($this->conn, $this->_mod_mailbox($root), $filter);
    
    if (!is_array($a_folders) || !sizeof($a_folders))
      $a_folders = array();

    // create Default folders if they do not exist
    global $CONFIG;

    $this->create_mailbox("INBOX", TRUE);
    $this->subscribe("INBOX");

    foreach ($CONFIG['default_imap_folders'] as $folder)
      {
      if (!in_array_nocase($folder, $a_folders))
        {
        $this->create_mailbox($folder, TRUE);
        $this->subscribe($folder);
        }
      }

    $a_folders = iil_C_ListSubscribed($this->conn, $this->_mod_mailbox($root), $filter);
    $a_mailbox_cache = array();

    if (!in_array("INBOX", $a_folders)){
       array_unshift($a_folders, "INBOX");
	$this->subscribe("INBOX");
    }

    // write mailboxlist to cache
    $this->update_cache('mailboxes', $a_folders);
    
    return $a_folders;
    }
Note: See TracTickets for help on using tickets.