NeoMutt  2021-02-05-89-gabe350
Teaching an old dog new tricks
DOXYGEN
MxOps Struct Reference

The Mailbox API. More...

#include "mx.h"

Data Fields

enum MailboxType type
 Mailbox type, e.g. MUTT_IMAP. More...
 
const char * name
 Mailbox name, e.g. "imap". More...
 
bool is_local
 True, if Mailbox type has local files/dirs. More...
 
bool(* ac_owns_path )(struct Account *a, const char *path)
 Check whether an Account owns a Mailbox path. More...
 
bool(* ac_add )(struct Account *a, struct Mailbox *m)
 Add a Mailbox to an Account. More...
 
enum MxOpenReturns(* mbox_open )(struct Mailbox *m)
 Open a Mailbox. More...
 
bool(* mbox_open_append )(struct Mailbox *m, OpenMailboxFlags flags)
 Open a Mailbox for appending. More...
 
enum MxStatus(* mbox_check )(struct Mailbox *m)
 Check for new mail. More...
 
enum MxStatus(* mbox_check_stats )(struct Mailbox *m, uint8_t flags)
 Check the Mailbox statistics. More...
 
enum MxStatus(* mbox_sync )(struct Mailbox *m)
 Save changes to the Mailbox. More...
 
enum MxStatus(* mbox_close )(struct Mailbox *m)
 Close a Mailbox. More...
 
bool(* msg_open )(struct Mailbox *m, struct Message *msg, int msgno)
 Open an email message in a Mailbox. More...
 
bool(* msg_open_new )(struct Mailbox *m, struct Message *msg, const struct Email *e)
 Open a new message in a Mailbox. More...
 
int(* msg_commit )(struct Mailbox *m, struct Message *msg)
 Save changes to an email. More...
 
int(* msg_close )(struct Mailbox *m, struct Message *msg)
 Close an email. More...
 
int(* msg_padding_size )(struct Mailbox *m)
 Bytes of padding between messages. More...
 
int(* msg_save_hcache )(struct Mailbox *m, struct Email *e)
 Save message to the header cache. More...
 
int(* tags_edit )(struct Mailbox *m, const char *tags, char *buf, size_t buflen)
 Prompt and validate new messages tags. More...
 
int(* tags_commit )(struct Mailbox *m, struct Email *e, char *buf)
 Save the tags to a message. More...
 
enum MailboxType(* path_probe )(const char *path, const struct stat *st)
 Does this Mailbox type recognise this path? More...
 
int(* path_canon )(char *buf, size_t buflen)
 Canonicalise a Mailbox path. More...
 
int(* path_pretty )(char *buf, size_t buflen, const char *folder)
 Abbreviate a Mailbox path. More...
 
int(* path_parent )(char *buf, size_t buflen)
 Find the parent of a Mailbox path. More...
 
int(* path_is_empty )(const char *path)
 Is the Mailbox empty? More...
 

Detailed Description

The Mailbox API.

Each backend provides a set of functions through which the Mailbox, messages, tags and paths are manipulated.

Definition at line 116 of file mx.h.

Field Documentation

◆ type

enum MailboxType MxOps::type

Mailbox type, e.g. MUTT_IMAP.

Definition at line 118 of file mx.h.

◆ name

const char* MxOps::name

Mailbox name, e.g. "imap".

Definition at line 119 of file mx.h.

◆ is_local

bool MxOps::is_local

True, if Mailbox type has local files/dirs.

Definition at line 120 of file mx.h.

◆ ac_owns_path

bool(* MxOps::ac_owns_path) (struct Account *a, const char *path)

Check whether an Account owns a Mailbox path.

Parameters
aAccount
pathMailbox Path
Return values
trueAccount handles path
falseAccount does not handle path

Contract

  • a is not NULL
  • path is not NULL

Definition at line 133 of file mx.h.

◆ ac_add

bool(* MxOps::ac_add) (struct Account *a, struct Mailbox *m)

Add a Mailbox to an Account.

Parameters
aAccount to add to
mMailbox to add
Return values
trueSuccess
falseError

Contract

  • a is not NULL
  • m is not NULL

Definition at line 146 of file mx.h.

◆ mbox_open

enum MxOpenReturns(* MxOps::mbox_open) (struct Mailbox *m)

Open a Mailbox.

Parameters
mMailbox to open
Return values
enumMxOpenReturns

Contract

  • m is not NULL

Definition at line 156 of file mx.h.

◆ mbox_open_append

bool(* MxOps::mbox_open_append) (struct Mailbox *m, OpenMailboxFlags flags)

Open a Mailbox for appending.

Parameters
mMailbox to open
flagsFlags, see OpenMailboxFlags
Return values
trueSuccess
falseFailure

Contract

  • m is not NULL

Definition at line 168 of file mx.h.

◆ mbox_check

enum MxStatus(* MxOps::mbox_check) (struct Mailbox *m)

Check for new mail.

Parameters
mMailbox
Return values
enumMxStatus

Contract

  • m is not NULL

Definition at line 178 of file mx.h.

◆ mbox_check_stats

enum MxStatus(* MxOps::mbox_check_stats) (struct Mailbox *m, uint8_t flags)

Check the Mailbox statistics.

Parameters
mMailbox to check
flagsFunction flags
Return values
enumMxStatus

Contract

  • m is not NULL

Definition at line 189 of file mx.h.

◆ mbox_sync

enum MxStatus(* MxOps::mbox_sync) (struct Mailbox *m)

Save changes to the Mailbox.

Parameters
mMailbox to sync
Return values
enumMxStatus

Contract

  • m is not NULL

Definition at line 199 of file mx.h.

◆ mbox_close

enum MxStatus(* MxOps::mbox_close) (struct Mailbox *m)

Close a Mailbox.

Parameters
mMailbox to close
Return values
enumMxStatus

Contract

  • m is not NULL

Definition at line 209 of file mx.h.

◆ msg_open

bool(* MxOps::msg_open) (struct Mailbox *m, struct Message *msg, int msgno)

Open an email message in a Mailbox.

Parameters
mMailbox
msgMessage to open
msgnoIndex of message to open
Return values
trueSuccess
falseError

Contract

  • m is not NULL
  • msg is not NULL
  • 0 <= msgno < msg->msg_count

Definition at line 224 of file mx.h.

◆ msg_open_new

bool(* MxOps::msg_open_new) (struct Mailbox *m, struct Message *msg, const struct Email *e)

Open a new message in a Mailbox.

Parameters
mMailbox
msgMessage to open
eEmail
Return values
trueSuccess
falseFailure

Contract

  • m is not NULL
  • msg is not NULL

Definition at line 238 of file mx.h.

◆ msg_commit

int(* MxOps::msg_commit) (struct Mailbox *m, struct Message *msg)

Save changes to an email.

Parameters
mMailbox
msgMessage to commit
Return values
0Success
-1Failure

Contract

  • m is not NULL
  • msg is not NULL

Definition at line 251 of file mx.h.

◆ msg_close

int(* MxOps::msg_close) (struct Mailbox *m, struct Message *msg)

Close an email.

Parameters
mMailbox
msgMessage to close
Return values
0Success
-1Failure

Contract

  • m is not NULL
  • msg is not NULL

Definition at line 264 of file mx.h.

◆ msg_padding_size

int(* MxOps::msg_padding_size) (struct Mailbox *m)

Bytes of padding between messages.

Parameters
mMailbox
Return values
numBytes of padding

Contract

  • m is not NULL

Definition at line 274 of file mx.h.

◆ msg_save_hcache

int(* MxOps::msg_save_hcache) (struct Mailbox *m, struct Email *e)

Save message to the header cache.

Parameters
mMailbox
eEmail
Return values
0Success
-1Failure

Contract

  • m is not NULL
  • e is not NULL

Definition at line 287 of file mx.h.

◆ tags_edit

int(* MxOps::tags_edit) (struct Mailbox *m, const char *tags, char *buf, size_t buflen)

Prompt and validate new messages tags.

Parameters
mMailbox
tagsExisting tags
bufBuffer to store the tags
buflenLength of buffer
Return values
-1Error
0No valid user input
1Buf set

Contract

  • m is not NULL
  • buf is not NULL

Definition at line 303 of file mx.h.

◆ tags_commit

int(* MxOps::tags_commit) (struct Mailbox *m, struct Email *e, char *buf)

Save the tags to a message.

Parameters
mMailbox
eEmail
bufBuffer containing tags
Return values
0Success
-1Failure

Contract

  • m is not NULL
  • e is not NULL
  • buf is not NULL

Definition at line 318 of file mx.h.

◆ path_probe

enum MailboxType(* MxOps::path_probe) (const char *path, const struct stat *st)

Does this Mailbox type recognise this path?

Parameters
pathPath to examine
ststat buffer (for local filesystems)
Return values
numType, e.g. MUTT_IMAP

Contract

  • path is not NULL

Definition at line 329 of file mx.h.

◆ path_canon

int(* MxOps::path_canon) (char *buf, size_t buflen)

Canonicalise a Mailbox path.

Parameters
bufPath to modify
buflenLength of buffer
Return values
0Success
-1Failure

Contract

  • buf is not NULL

Definition at line 341 of file mx.h.

◆ path_pretty

int(* MxOps::path_pretty) (char *buf, size_t buflen, const char *folder)

Abbreviate a Mailbox path.

Parameters
bufPath to modify
buflenLength of buffer
folderBase path for '=' substitution
Return values
0Success
-1Failure

Contract

  • buf is not NULL

Definition at line 354 of file mx.h.

◆ path_parent

int(* MxOps::path_parent) (char *buf, size_t buflen)

Find the parent of a Mailbox path.

Parameters
bufPath to modify
buflenLength of buffer
Return values
0Success
-1Failure

Contract

  • buf is not NULL

Definition at line 366 of file mx.h.

◆ path_is_empty

int(* MxOps::path_is_empty) (const char *path)

Is the Mailbox empty?

Parameters
pathMailbox to check
Return values
1Mailbox is empty
0Mailbox contains mail
-1Error

Contract

  • path is not NULL and not empty

Definition at line 378 of file mx.h.


The documentation for this struct was generated from the following file: