[neomutt-devel] Account Development

Richard Russon rich at flatcap.org
Fri Oct 26 12:13:22 CEST 2018


I've just pushed over 30 commits to `master`.
They introduce an Account object into each of the backends.

This diagram shows an example of all seven backends in action:
  https://flatcap.org/mutt/account5.svg

The commits also standardise the naming of a lot of functions and
variables that are common to the backends.

The code works, but is NOT STABLE.  Crashes are likely.

## Layout

NeoMutt keeps a list of Accounts.  Each Account can hold many Mailboxes.

An Account has a type and a pointer for backend-private data.
The Account contains everything that's common to ALL Mailboxes, e.g.
connection info.

A Mailbox has a type and many members common to all mailboxes (paths,
message counts, etc).  It also has a pointer for backend-private data.

## How it Works

NeoMutt parses your config.  When it finds a `mailboxes` command, it:

1. Creates a dummy Mailbox using the path
  - Expand any abbreviations, e.g. ~ + ^ (Using HomeDir, Folder, etc)
  - Create the canonical path
  - Identify the type of the Mailbox

Many of these actions are delegated to the backend.
They're performed on a Mailbox so that they only need to happen once.

2. For each Account (already known)
  - Ask Account: Do you understand this path?
    - Yes: Ask Account to add the Mailbox
    - Already exists: Drop the dummy Mailbox, return a real Mailbox

3. Create a new Account with the type of the Mailbox
  - Ask Account to add the Mailbox

## Problems / To do

- Connections
  - Currently, they're stored in a separate list.  This isn't
    particularly useful since they're not shared between Accounts.
  - Plan: split up find-or-open function and move the Connection to the
    private Account object
  - Result: Connections list dies

- Sidebar
  - Currently, this uses the AllMailboxes list, which can lead to some
    strange sorting and indentation.
  - Plan: Refactor the sidebar to use the AllAccounts list
  - Result: AllMailboxes list dies

Questions are welcomed.

Cheers,
    Rich / FlatCap
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mailman.neomutt.org/pipermail/neomutt-devel-neomutt.org/attachments/20181026/ae39a50b/attachment.sig>


More information about the neomutt-devel mailing list