NeoMutt  2025-12-11-276-g10b23b
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Mailbox API

The Mailbox API. More...

+ Collaboration diagram for Mailbox API:

Topics

 ac_owns_path()
 Check whether an Account owns a Mailbox path.
 
 ac_add()
 Add a Mailbox to an Account.
 
 mbox_open()
 Open a Mailbox.
 
 mbox_open_append()
 Open a Mailbox for appending.
 
 mbox_check()
 Check for new mail.
 
 mbox_check_stats()
 Check the Mailbox statistics.
 
 mbox_sync()
 Save changes to the Mailbox.
 
 mbox_close()
 Close a Mailbox.
 
 msg_open()
 Open an email message in a Mailbox.
 
 msg_open_new()
 Open a new message in a Mailbox.
 
 msg_commit()
 Save changes to an email.
 
 msg_close()
 Close an email.
 
 msg_padding_size()
 Bytes of padding between messages.
 
 msg_save_hcache()
 Save message to the header cache.
 
 tags_edit()
 Prompt and validate new messages tags.
 
 tags_commit()
 Save the tags to a message.
 
 path_probe()
 Does this Mailbox type recognise this path?
 
 path_canon()
 Canonicalise a Mailbox path.
 
 path_is_empty()
 Is the Mailbox empty?
 

Variables

const struct MxOps MxCompOps
 Compressed Mailbox - Implements MxOps -.
 
const struct MxOps MxImapOps
 IMAP Mailbox - Implements MxOps -.
 
const struct MxOps MxMaildirOps
 Maildir Mailbox - Implements MxOps -.
 
const struct MxOps MxMboxOps
 Mbox Mailbox - Implements MxOps -.
 
const struct MxOps MxMmdfOps
 MMDF Mailbox - Implements MxOps -.
 
const struct MxOps MxMhOps
 MH Mailbox - Implements MxOps -.
 
const struct MxOps MxNntpOps
 NNTP Mailbox - Implements MxOps -.
 
const struct MxOps MxNotmuchOps
 Notmuch Mailbox - Implements MxOps -.
 
const struct MxOps MxPopOps
 POP Mailbox - Implements MxOps -.
 

Detailed Description

The Mailbox API.

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

Variable Documentation

◆ MxCompOps

const struct MxOps MxCompOps
Initial value:
= {
.type = MUTT_COMPRESSED,
.name = "compressed",
.is_local = true,
.ac_owns_path = comp_ac_owns_path,
.ac_add = comp_ac_add,
.mbox_open = comp_mbox_open,
.mbox_open_append = comp_mbox_open_append,
.mbox_check = comp_mbox_check,
.mbox_check_stats = NULL,
.mbox_sync = comp_mbox_sync,
.mbox_close = comp_mbox_close,
.msg_open = comp_msg_open,
.msg_open_new = comp_msg_open_new,
.msg_commit = comp_msg_commit,
.msg_close = comp_msg_close,
.msg_padding_size = comp_msg_padding_size,
.msg_save_hcache = comp_msg_save_hcache,
.tags_edit = comp_tags_edit,
.tags_commit = comp_tags_commit,
.path_probe = comp_path_probe,
.path_canon = comp_path_canon,
.path_is_empty = NULL,
}
@ MUTT_COMPRESSED
Compressed file Mailbox type.
Definition mailbox.h:52
static bool comp_ac_add(struct Account *a, struct Mailbox *m)
Add a Mailbox to an Account - Implements MxOps::ac_add() -.
Definition compress.c:402
static bool comp_ac_owns_path(struct Account *a, const char *path)
Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.
Definition compress.c:394
static enum MxStatus comp_mbox_check(struct Mailbox *m)
Check for new mail - Implements MxOps::mbox_check() -.
Definition compress.c:550
static enum MxStatus comp_mbox_close(struct Mailbox *m)
Close a Mailbox - Implements MxOps::mbox_close() -.
Definition compress.c:637
static bool comp_mbox_open_append(struct Mailbox *m, OpenMailboxFlags flags)
Open a Mailbox for appending - Implements MxOps::mbox_open_append() -.
Definition compress.c:470
static enum MxOpenReturns comp_mbox_open(struct Mailbox *m)
Open a Mailbox - Implements MxOps::mbox_open() -.
Definition compress.c:415
static enum MxStatus comp_mbox_sync(struct Mailbox *m)
Save changes to the Mailbox - Implements MxOps::mbox_sync() -.
Definition compress.c:586
static int comp_msg_close(struct Mailbox *m, struct Message *msg)
Close an email - Implements MxOps::msg_close() -.
Definition compress.c:774
static int comp_msg_commit(struct Mailbox *m, struct Message *msg)
Save changes to an email - Implements MxOps::msg_commit() -.
Definition compress.c:756
static bool comp_msg_open_new(struct Mailbox *m, struct Message *msg, const struct Email *e)
Open a new message in a Mailbox - Implements MxOps::msg_open_new() -.
Definition compress.c:738
static bool comp_msg_open(struct Mailbox *m, struct Message *msg, struct Email *e)
Open an email message in a Mailbox - Implements MxOps::msg_open() -.
Definition compress.c:720
static int comp_msg_padding_size(struct Mailbox *m)
Bytes of padding between messages - Implements MxOps::msg_padding_size() -.
Definition compress.c:792
static int comp_msg_save_hcache(struct Mailbox *m, struct Email *e)
Save message to the header cache - Implements MxOps::msg_save_hcache() -.
Definition compress.c:809
static int comp_path_canon(struct Buffer *path)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition compress.c:874
static enum MailboxType comp_path_probe(const char *path, const struct stat *st)
Is this a compressed Mailbox?
Definition compress.c:860
static int comp_tags_commit(struct Mailbox *m, struct Email *e, const char *buf)
Save the tags to a message - Implements MxOps::tags_commit() -.
Definition compress.c:843
static int comp_tags_edit(struct Mailbox *m, const char *tags, struct Buffer *buf)
Prompt and validate new messages tags - Implements MxOps::tags_edit() -.
Definition compress.c:826

Compressed Mailbox - Implements MxOps -.

Compress only uses open, close and check. The message functions are delegated to mbox.

Definition at line 886 of file compress.c.

886 {
887 // clang-format off
888 .type = MUTT_COMPRESSED,
889 .name = "compressed",
890 .is_local = true,
891 .ac_owns_path = comp_ac_owns_path,
892 .ac_add = comp_ac_add,
893 .mbox_open = comp_mbox_open,
894 .mbox_open_append = comp_mbox_open_append,
895 .mbox_check = comp_mbox_check,
896 .mbox_check_stats = NULL,
897 .mbox_sync = comp_mbox_sync,
898 .mbox_close = comp_mbox_close,
899 .msg_open = comp_msg_open,
900 .msg_open_new = comp_msg_open_new,
901 .msg_commit = comp_msg_commit,
902 .msg_close = comp_msg_close,
903 .msg_padding_size = comp_msg_padding_size,
904 .msg_save_hcache = comp_msg_save_hcache,
905 .tags_edit = comp_tags_edit,
906 .tags_commit = comp_tags_commit,
907 .path_probe = comp_path_probe,
908 .path_canon = comp_path_canon,
909 .path_is_empty = NULL,
910 // clang-format on
911};

◆ MxImapOps

const struct MxOps MxImapOps
Initial value:
= {
.type = MUTT_IMAP,
.name = "imap",
.is_local = false,
.ac_owns_path = imap_ac_owns_path,
.ac_add = imap_ac_add,
.mbox_open = imap_mbox_open,
.mbox_open_append = imap_mbox_open_append,
.mbox_check = imap_mbox_check,
.mbox_check_stats = imap_mbox_check_stats,
.mbox_sync = NULL,
.mbox_close = imap_mbox_close,
.msg_open = imap_msg_open,
.msg_open_new = imap_msg_open_new,
.msg_commit = imap_msg_commit,
.msg_close = imap_msg_close,
.msg_padding_size = NULL,
.msg_save_hcache = imap_msg_save_hcache,
.tags_edit = imap_tags_edit,
.tags_commit = imap_tags_commit,
.path_probe = imap_path_probe,
.path_canon = imap_path_canon,
.path_is_empty = imap_path_is_empty,
}
@ MUTT_IMAP
'IMAP' Mailbox type
Definition mailbox.h:49
static bool imap_ac_add(struct Account *a, struct Mailbox *m)
Add a Mailbox to an Account - Implements MxOps::ac_add() -.
Definition imap.c:1880
static bool imap_ac_owns_path(struct Account *a, const char *path)
Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.
Definition imap.c:1862
static enum MxStatus imap_mbox_check_stats(struct Mailbox *m, uint8_t flags)
Check the Mailbox statistics - Implements MxOps::mbox_check_stats() -.
Definition imap.c:1337
static enum MxStatus imap_mbox_check(struct Mailbox *m)
Check for new mail - Implements MxOps::mbox_check() -.
Definition imap.c:2305
static enum MxStatus imap_mbox_close(struct Mailbox *m)
Close a Mailbox - Implements MxOps::mbox_close() -.
Definition imap.c:2319
static bool imap_mbox_open_append(struct Mailbox *m, OpenMailboxFlags flags)
Open a Mailbox for appending - Implements MxOps::mbox_open_append() -.
Definition imap.c:2268
static enum MxOpenReturns imap_mbox_open(struct Mailbox *m)
Open a mailbox - Implements MxOps::mbox_open() -.
Definition imap.c:2059
int imap_msg_close(struct Mailbox *m, struct Message *msg)
Close an email - Implements MxOps::msg_close() -.
Definition message.c:2203
int imap_msg_commit(struct Mailbox *m, struct Message *msg)
Save changes to an email - Implements MxOps::msg_commit() -.
Definition message.c:2189
static bool imap_msg_open_new(struct Mailbox *m, struct Message *msg, const struct Email *e)
Open a new message in a Mailbox - Implements MxOps::msg_open_new() -.
Definition imap.c:2361
bool imap_msg_open(struct Mailbox *m, struct Message *msg, struct Email *e)
Open an email message in a Mailbox - Implements MxOps::msg_open() -.
Definition message.c:1996
int imap_msg_save_hcache(struct Mailbox *m, struct Email *e)
Save message to the header cache - Implements MxOps::msg_save_hcache() -.
Definition message.c:2211
int imap_path_canon(struct Buffer *path)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition imap.c:2557
static int imap_path_is_empty(struct Buffer *path)
Is the mailbox empty - Implements MxOps::path_is_empty() -.
Definition imap.c:2588
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox?
Definition imap.c:2543
static int imap_tags_commit(struct Mailbox *m, struct Email *e, const char *buf)
Save the tags to a message - Implements MxOps::tags_commit() -.
Definition imap.c:2473
static int imap_tags_edit(struct Mailbox *m, const char *tags, struct Buffer *buf)
Prompt and validate new messages tags - Implements MxOps::tags_edit() -.
Definition imap.c:2386

IMAP Mailbox - Implements MxOps -.

Definition at line 2601 of file imap.c.

2601 {
2602 // clang-format off
2603 .type = MUTT_IMAP,
2604 .name = "imap",
2605 .is_local = false,
2606 .ac_owns_path = imap_ac_owns_path,
2607 .ac_add = imap_ac_add,
2608 .mbox_open = imap_mbox_open,
2609 .mbox_open_append = imap_mbox_open_append,
2610 .mbox_check = imap_mbox_check,
2611 .mbox_check_stats = imap_mbox_check_stats,
2612 .mbox_sync = NULL, /* imap syncing is handled by imap_sync_mailbox */
2613 .mbox_close = imap_mbox_close,
2614 .msg_open = imap_msg_open,
2615 .msg_open_new = imap_msg_open_new,
2616 .msg_commit = imap_msg_commit,
2617 .msg_close = imap_msg_close,
2618 .msg_padding_size = NULL,
2619 .msg_save_hcache = imap_msg_save_hcache,
2620 .tags_edit = imap_tags_edit,
2621 .tags_commit = imap_tags_commit,
2622 .path_probe = imap_path_probe,
2623 .path_canon = imap_path_canon,
2624 .path_is_empty = imap_path_is_empty,
2625 // clang-format on
2626};

◆ MxMaildirOps

const struct MxOps MxMaildirOps
Initial value:
= {
.type = MUTT_MAILDIR,
.name = "maildir",
.is_local = true,
.ac_owns_path = maildir_ac_owns_path,
.ac_add = maildir_ac_add,
.mbox_open = maildir_mbox_open,
.mbox_open_append = maildir_mbox_open_append,
.mbox_check = maildir_mbox_check,
.mbox_check_stats = maildir_mbox_check_stats,
.mbox_sync = maildir_mbox_sync,
.mbox_close = maildir_mbox_close,
.msg_open = maildir_msg_open,
.msg_open_new = maildir_msg_open_new,
.msg_commit = maildir_msg_commit,
.msg_close = maildir_msg_close,
.msg_padding_size = NULL,
.msg_save_hcache = maildir_msg_save_hcache,
.tags_edit = NULL,
.tags_commit = NULL,
.path_probe = maildir_path_probe,
.path_canon = maildir_path_canon,
.path_is_empty = maildir_path_is_empty,
}
@ MUTT_MAILDIR
'Maildir' Mailbox type
Definition mailbox.h:47
bool maildir_ac_add(struct Account *a, struct Mailbox *m)
Add a Mailbox to an Account - Implements MxOps::ac_add() -.
Definition account.c:37
bool maildir_ac_owns_path(struct Account *a, const char *path)
Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.
Definition account.c:45
enum MxStatus maildir_mbox_check_stats(struct Mailbox *m, uint8_t flags)
Check the Mailbox statistics - Implements MxOps::mbox_check_stats() -.
Definition mailbox.c:814
enum MxStatus maildir_mbox_check(struct Mailbox *m)
Check for new mail - Implements MxOps::mbox_check() -.
Definition mailbox.c:806
enum MxStatus maildir_mbox_close(struct Mailbox *m)
Close a Mailbox - Implements MxOps::mbox_close() -.
Definition mailbox.c:903
bool maildir_mbox_open_append(struct Mailbox *m, OpenMailboxFlags flags)
Open a Mailbox for appending - Implements MxOps::mbox_open_append() -.
Definition mailbox.c:752
enum MxOpenReturns maildir_mbox_open(struct Mailbox *m)
Open a Mailbox - Implements MxOps::mbox_open() -.
Definition mailbox.c:741
enum MxStatus maildir_mbox_sync(struct Mailbox *m)
Save changes to the Mailbox - Implements MxOps::mbox_sync() -.
Definition mailbox.c:843
int maildir_msg_close(struct Mailbox *m, struct Message *msg)
Close an email - Implements MxOps::msg_close() -.
Definition message.c:612
int maildir_msg_commit(struct Mailbox *m, struct Message *msg)
Save changes to an email - Implements MxOps::msg_commit() -.
Definition message.c:602
bool maildir_msg_open_new(struct Mailbox *m, struct Message *msg, const struct Email *e)
Open a new message in a Mailbox - Implements MxOps::msg_open_new() -.
Definition message.c:530
bool maildir_msg_open(struct Mailbox *m, struct Message *msg, struct Email *e)
Open an email message in a Mailbox - Implements MxOps::msg_open() -.
Definition message.c:503
int maildir_msg_save_hcache(struct Mailbox *m, struct Email *e)
Save message to the header cache - Implements MxOps::msg_save_hcache() -.
Definition message.c:620
int maildir_path_canon(struct Buffer *path)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition path.c:44
enum MailboxType maildir_path_probe(const char *path, const struct stat *st)
Is this a Maildir Mailbox?
Definition path.c:94
int maildir_path_is_empty(struct Buffer *path)
Is the mailbox empty.
Definition path.c:57

Maildir Mailbox - Implements MxOps -.

Definition at line 44 of file maildir.c.

44 {
45 // clang-format off
46 .type = MUTT_MAILDIR,
47 .name = "maildir",
48 .is_local = true,
49 .ac_owns_path = maildir_ac_owns_path,
50 .ac_add = maildir_ac_add,
51 .mbox_open = maildir_mbox_open,
52 .mbox_open_append = maildir_mbox_open_append,
53 .mbox_check = maildir_mbox_check,
54 .mbox_check_stats = maildir_mbox_check_stats,
55 .mbox_sync = maildir_mbox_sync,
56 .mbox_close = maildir_mbox_close,
57 .msg_open = maildir_msg_open,
58 .msg_open_new = maildir_msg_open_new,
59 .msg_commit = maildir_msg_commit,
60 .msg_close = maildir_msg_close,
61 .msg_padding_size = NULL,
62 .msg_save_hcache = maildir_msg_save_hcache,
63 .tags_edit = NULL,
64 .tags_commit = NULL,
65 .path_probe = maildir_path_probe,
66 .path_canon = maildir_path_canon,
67 .path_is_empty = maildir_path_is_empty,
68 // clang-format on
69};

◆ MxMboxOps

const struct MxOps MxMboxOps
Initial value:
= {
.type = MUTT_MBOX,
.name = "mbox",
.is_local = true,
.ac_owns_path = mbox_ac_owns_path,
.ac_add = mbox_ac_add,
.mbox_open = mbox_mbox_open,
.mbox_open_append = mbox_mbox_open_append,
.mbox_check = mbox_mbox_check,
.mbox_check_stats = mbox_mbox_check_stats,
.mbox_sync = mbox_mbox_sync,
.mbox_close = mbox_mbox_close,
.msg_open = mbox_msg_open,
.msg_open_new = mbox_msg_open_new,
.msg_commit = mbox_msg_commit,
.msg_close = mbox_msg_close,
.msg_padding_size = mbox_msg_padding_size,
.msg_save_hcache = NULL,
.tags_edit = NULL,
.tags_commit = NULL,
.path_probe = mbox_path_probe,
.path_canon = mbox_path_canon,
.path_is_empty = mbox_path_is_empty,
}
@ MUTT_MBOX
'mbox' Mailbox type
Definition mailbox.h:44
static bool mbox_ac_add(struct Account *a, struct Mailbox *m)
Add a Mailbox to an Account - Implements MxOps::ac_add() -.
Definition mbox.c:787
static bool mbox_ac_owns_path(struct Account *a, const char *path)
Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.
Definition mbox.c:772
static enum MxStatus mbox_mbox_check_stats(struct Mailbox *m, uint8_t flags)
Check the Mailbox statistics - Implements MxOps::mbox_check_stats() -.
Definition mbox.c:1647
static enum MxStatus mbox_mbox_check(struct Mailbox *m)
Check for new mail - Implements MxOps::mbox_check() -.
Definition mbox.c:926
static enum MxStatus mbox_mbox_close(struct Mailbox *m)
Close a Mailbox - Implements MxOps::mbox_close() -.
Definition mbox.c:1430
static bool mbox_mbox_open_append(struct Mailbox *m, OpenMailboxFlags flags)
Open a Mailbox for appending - Implements MxOps::mbox_open_append() -.
Definition mbox.c:874
static enum MxOpenReturns mbox_mbox_open(struct Mailbox *m)
Open a Mailbox - Implements MxOps::mbox_open() -.
Definition mbox.c:825
static enum MxStatus mbox_mbox_sync(struct Mailbox *m)
Save changes to the Mailbox - Implements MxOps::mbox_sync() -.
Definition mbox.c:1060
static int mbox_msg_close(struct Mailbox *m, struct Message *msg)
Close an email - Implements MxOps::msg_close() -.
Definition mbox.c:1516
static int mbox_msg_commit(struct Mailbox *m, struct Message *msg)
Save changes to an email - Implements MxOps::msg_commit() -.
Definition mbox.c:1499
static bool mbox_msg_open_new(struct Mailbox *m, struct Message *msg, const struct Email *e)
Open a new message in a Mailbox - Implements MxOps::msg_open_new() -.
Definition mbox.c:1486
static bool mbox_msg_open(struct Mailbox *m, struct Message *msg, struct Email *e)
Open an email message in a Mailbox - Implements MxOps::msg_open() -.
Definition mbox.c:1470
static int mbox_msg_padding_size(struct Mailbox *m)
Bytes of padding between messages - Implements MxOps::msg_padding_size() -.
Definition mbox.c:1531
static int mbox_path_canon(struct Buffer *path)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition mbox.c:1603
static int mbox_path_is_empty(struct Buffer *path)
Is the mailbox empty - Implements MxOps::path_is_empty() -.
Definition mbox.c:1612
enum MailboxType mbox_path_probe(const char *path, const struct stat *st)
Is this an mbox Mailbox?
Definition mbox.c:1539

Mbox Mailbox - Implements MxOps -.

Definition at line 1709 of file mbox.c.

1709 {
1710 // clang-format off
1711 .type = MUTT_MBOX,
1712 .name = "mbox",
1713 .is_local = true,
1714 .ac_owns_path = mbox_ac_owns_path,
1715 .ac_add = mbox_ac_add,
1716 .mbox_open = mbox_mbox_open,
1717 .mbox_open_append = mbox_mbox_open_append,
1718 .mbox_check = mbox_mbox_check,
1719 .mbox_check_stats = mbox_mbox_check_stats,
1720 .mbox_sync = mbox_mbox_sync,
1721 .mbox_close = mbox_mbox_close,
1722 .msg_open = mbox_msg_open,
1723 .msg_open_new = mbox_msg_open_new,
1724 .msg_commit = mbox_msg_commit,
1725 .msg_close = mbox_msg_close,
1726 .msg_padding_size = mbox_msg_padding_size,
1727 .msg_save_hcache = NULL,
1728 .tags_edit = NULL,
1729 .tags_commit = NULL,
1730 .path_probe = mbox_path_probe,
1731 .path_canon = mbox_path_canon,
1732 .path_is_empty = mbox_path_is_empty,
1733 // clang-format on
1734};

◆ MxMmdfOps

const struct MxOps MxMmdfOps
Initial value:
= {
.type = MUTT_MMDF,
.name = "mmdf",
.is_local = true,
.ac_owns_path = mbox_ac_owns_path,
.ac_add = mbox_ac_add,
.mbox_open = mbox_mbox_open,
.mbox_open_append = mbox_mbox_open_append,
.mbox_check = mbox_mbox_check,
.mbox_check_stats = mbox_mbox_check_stats,
.mbox_sync = mbox_mbox_sync,
.mbox_close = mbox_mbox_close,
.msg_open = mbox_msg_open,
.msg_open_new = mbox_msg_open_new,
.msg_commit = mmdf_msg_commit,
.msg_close = mbox_msg_close,
.msg_padding_size = mmdf_msg_padding_size,
.msg_save_hcache = NULL,
.tags_edit = NULL,
.tags_commit = NULL,
.path_probe = mbox_path_probe,
.path_canon = mbox_path_canon,
.path_is_empty = mbox_path_is_empty,
}
@ MUTT_MMDF
'mmdf' Mailbox type
Definition mailbox.h:45
static int mmdf_msg_commit(struct Mailbox *m, struct Message *msg)
Save changes to an email - Implements MxOps::msg_commit() -.
Definition mbox.c:1620
static int mmdf_msg_padding_size(struct Mailbox *m)
Bytes of padding between messages - Implements MxOps::msg_padding_size() -.
Definition mbox.c:1639

MMDF Mailbox - Implements MxOps -.

Definition at line 1739 of file mbox.c.

1739 {
1740 // clang-format off
1741 .type = MUTT_MMDF,
1742 .name = "mmdf",
1743 .is_local = true,
1744 .ac_owns_path = mbox_ac_owns_path,
1745 .ac_add = mbox_ac_add,
1746 .mbox_open = mbox_mbox_open,
1747 .mbox_open_append = mbox_mbox_open_append,
1748 .mbox_check = mbox_mbox_check,
1749 .mbox_check_stats = mbox_mbox_check_stats,
1750 .mbox_sync = mbox_mbox_sync,
1751 .mbox_close = mbox_mbox_close,
1752 .msg_open = mbox_msg_open,
1753 .msg_open_new = mbox_msg_open_new,
1754 .msg_commit = mmdf_msg_commit,
1755 .msg_close = mbox_msg_close,
1756 .msg_padding_size = mmdf_msg_padding_size,
1757 .msg_save_hcache = NULL,
1758 .tags_edit = NULL,
1759 .tags_commit = NULL,
1760 .path_probe = mbox_path_probe,
1761 .path_canon = mbox_path_canon,
1762 .path_is_empty = mbox_path_is_empty,
1763 // clang-format on
1764};

◆ MxMhOps

const struct MxOps MxMhOps
Initial value:
= {
.type = MUTT_MH,
.name = "mh",
.is_local = true,
.ac_owns_path = mh_ac_owns_path,
.ac_add = mh_ac_add,
.mbox_open = mh_mbox_open,
.mbox_open_append = mh_mbox_open_append,
.mbox_check = mh_mbox_check,
.mbox_check_stats = mh_mbox_check_stats,
.mbox_sync = mh_mbox_sync,
.mbox_close = mh_mbox_close,
.msg_open = mh_msg_open,
.msg_open_new = mh_msg_open_new,
.msg_commit = mh_msg_commit,
.msg_close = mh_msg_close,
.msg_padding_size = NULL,
.msg_save_hcache = mh_msg_save_hcache,
.tags_edit = NULL,
.tags_commit = NULL,
.path_probe = mh_path_probe,
.path_canon = mh_path_canon,
.path_is_empty = mh_check_empty,
}
@ MUTT_MH
'MH' Mailbox type
Definition mailbox.h:46
static bool mh_ac_add(struct Account *a, struct Mailbox *m)
Add a Mailbox to an Account - Implements MxOps::ac_add() -.
Definition mh.c:806
static bool mh_ac_owns_path(struct Account *a, const char *path)
Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.
Definition mh.c:798
static enum MxStatus mh_mbox_check_stats(struct Mailbox *m, uint8_t flags)
Check the Mailbox statistics - Implements MxOps::mbox_check_stats() -.
Definition mh.c:140
static enum MxStatus mh_mbox_check(struct Mailbox *m)
Check for new mail - Implements MxOps::mbox_check() -.
Definition mh.c:1048
static enum MxStatus mh_mbox_close(struct Mailbox *m)
Close a Mailbox - Implements MxOps::mbox_close() -.
Definition mh.c:1132
static bool mh_mbox_open_append(struct Mailbox *m, OpenMailboxFlags flags)
Open a Mailbox for appending - Implements MxOps::mbox_open_append() -.
Definition mh.c:822
static enum MxOpenReturns mh_mbox_open(struct Mailbox *m)
Open a Mailbox - Implements MxOps::mbox_open() -.
Definition mh.c:814
static enum MxStatus mh_mbox_sync(struct Mailbox *m)
Save changes to the Mailbox - Implements MxOps::mbox_sync() -.
Definition mh.c:1062
static int mh_msg_close(struct Mailbox *m, struct Message *msg)
Close an email - Implements MxOps::msg_close() -.
Definition mh.c:1179
static int mh_msg_commit(struct Mailbox *m, struct Message *msg)
Save changes to an email - Implements MxOps::msg_commit() -.
Definition mh.c:1169
static bool mh_msg_open_new(struct Mailbox *m, struct Message *msg, const struct Email *e)
Open a new message in a Mailbox - Implements MxOps::msg_open_new() -.
Definition mh.c:1161
static bool mh_msg_open(struct Mailbox *m, struct Message *msg, struct Email *e)
Open an email message in a Mailbox - Implements MxOps::msg_open() -.
Definition mh.c:1140
static int mh_msg_save_hcache(struct Mailbox *m, struct Email *e)
Save message to the header cache - Implements MxOps::msg_save_hcache() -.
Definition mh.c:783
static int mh_path_canon(struct Buffer *path)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition mh.c:1187
static enum MailboxType mh_path_probe(const char *path, const struct stat *st)
Is this an mh Mailbox?
Definition mh.c:1196
int mh_check_empty(struct Buffer *path)
Is mailbox empty.
Definition mh.c:116

MH Mailbox - Implements MxOps -.

Definition at line 1236 of file mh.c.

1236 {
1237 // clang-format off
1238 .type = MUTT_MH,
1239 .name = "mh",
1240 .is_local = true,
1241 .ac_owns_path = mh_ac_owns_path,
1242 .ac_add = mh_ac_add,
1243 .mbox_open = mh_mbox_open,
1244 .mbox_open_append = mh_mbox_open_append,
1245 .mbox_check = mh_mbox_check,
1246 .mbox_check_stats = mh_mbox_check_stats,
1247 .mbox_sync = mh_mbox_sync,
1248 .mbox_close = mh_mbox_close,
1249 .msg_open = mh_msg_open,
1250 .msg_open_new = mh_msg_open_new,
1251 .msg_commit = mh_msg_commit,
1252 .msg_close = mh_msg_close,
1253 .msg_padding_size = NULL,
1254 .msg_save_hcache = mh_msg_save_hcache,
1255 .tags_edit = NULL,
1256 .tags_commit = NULL,
1257 .path_probe = mh_path_probe,
1258 .path_canon = mh_path_canon,
1259 .path_is_empty = mh_check_empty,
1260 // clang-format on
1261};

◆ MxNntpOps

const struct MxOps MxNntpOps
Initial value:
= {
.type = MUTT_NNTP,
.name = "nntp",
.is_local = false,
.ac_owns_path = nntp_ac_owns_path,
.ac_add = nntp_ac_add,
.mbox_open = nntp_mbox_open,
.mbox_open_append = NULL,
.mbox_check = nntp_mbox_check,
.mbox_check_stats = NULL,
.mbox_sync = nntp_mbox_sync,
.mbox_close = nntp_mbox_close,
.msg_open = nntp_msg_open,
.msg_open_new = NULL,
.msg_commit = NULL,
.msg_close = nntp_msg_close,
.msg_padding_size = NULL,
.msg_save_hcache = NULL,
.tags_edit = NULL,
.tags_commit = NULL,
.path_probe = nntp_path_probe,
.path_canon = nntp_path_canon,
}
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
Definition mailbox.h:48
static bool nntp_ac_add(struct Account *a, struct Mailbox *m)
Add a Mailbox to an Account - Implements MxOps::ac_add() -.
Definition nntp.c:2372
static bool nntp_ac_owns_path(struct Account *a, const char *path)
Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.
Definition nntp.c:2364
static enum MxStatus nntp_mbox_check(struct Mailbox *m)
Check for new mail - Implements MxOps::mbox_check() -.
Definition nntp.c:2544
static enum MxStatus nntp_mbox_close(struct Mailbox *m)
Close a Mailbox - Implements MxOps::mbox_close() -.
Definition nntp.c:2621
static enum MxOpenReturns nntp_mbox_open(struct Mailbox *m)
Open a Mailbox - Implements MxOps::mbox_open() -.
Definition nntp.c:2380
static enum MxStatus nntp_mbox_sync(struct Mailbox *m)
Save changes to the Mailbox - Implements MxOps::mbox_sync() -.
Definition nntp.c:2561
static int nntp_msg_close(struct Mailbox *m, struct Message *msg)
Close an email - Implements MxOps::msg_close() -.
Definition nntp.c:2775
static bool nntp_msg_open(struct Mailbox *m, struct Message *msg, struct Email *e)
Open an email message in a Mailbox - Implements MxOps::msg_open() -.
Definition nntp.c:2643
static int nntp_path_canon(struct Buffer *path)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition nntp.c:2797
enum MailboxType nntp_path_probe(const char *path, const struct stat *st)
Is this an NNTP Mailbox?
Definition nntp.c:2783

NNTP Mailbox - Implements MxOps -.

Definition at line 2805 of file nntp.c.

2805 {
2806 // clang-format off
2807 .type = MUTT_NNTP,
2808 .name = "nntp",
2809 .is_local = false,
2810 .ac_owns_path = nntp_ac_owns_path,
2811 .ac_add = nntp_ac_add,
2812 .mbox_open = nntp_mbox_open,
2813 .mbox_open_append = NULL,
2814 .mbox_check = nntp_mbox_check,
2815 .mbox_check_stats = NULL,
2816 .mbox_sync = nntp_mbox_sync,
2817 .mbox_close = nntp_mbox_close,
2818 .msg_open = nntp_msg_open,
2819 .msg_open_new = NULL,
2820 .msg_commit = NULL,
2821 .msg_close = nntp_msg_close,
2822 .msg_padding_size = NULL,
2823 .msg_save_hcache = NULL,
2824 .tags_edit = NULL,
2825 .tags_commit = NULL,
2826 .path_probe = nntp_path_probe,
2827 .path_canon = nntp_path_canon,
2828 // clang-format on
2829};

◆ MxNotmuchOps

const struct MxOps MxNotmuchOps
Initial value:
= {
.type = MUTT_NOTMUCH,
.name = "notmuch",
.is_local = false,
.ac_owns_path = nm_ac_owns_path,
.ac_add = nm_ac_add,
.mbox_open = nm_mbox_open,
.mbox_open_append = NULL,
.mbox_check = nm_mbox_check,
.mbox_check_stats = nm_mbox_check_stats,
.mbox_sync = nm_mbox_sync,
.mbox_close = nm_mbox_close,
.msg_open = nm_msg_open,
.msg_open_new = maildir_msg_open_new,
.msg_commit = nm_msg_commit,
.msg_close = nm_msg_close,
.msg_padding_size = NULL,
.msg_save_hcache = NULL,
.tags_edit = nm_tags_edit,
.tags_commit = nm_tags_commit,
.path_probe = nm_path_probe,
.path_canon = nm_path_canon,
.path_is_empty = NULL,
}
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Definition mailbox.h:50
static bool nm_ac_add(struct Account *a, struct Mailbox *m)
Add a Mailbox to an Account - Implements MxOps::ac_add() -.
Definition notmuch.c:2045
static bool nm_ac_owns_path(struct Account *a, const char *path)
Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.
Definition notmuch.c:2037
static enum MxStatus nm_mbox_check_stats(struct Mailbox *m, uint8_t flags)
Check the Mailbox statistics - Implements MxOps::mbox_check_stats() -.
Definition notmuch.c:1802
static enum MxStatus nm_mbox_check(struct Mailbox *m)
Check for new mail - Implements MxOps::mbox_check() -.
Definition notmuch.c:2110
static enum MxStatus nm_mbox_close(struct Mailbox *m)
Close a Mailbox - Implements MxOps::mbox_close() -.
Definition notmuch.c:2372
static enum MxOpenReturns nm_mbox_open(struct Mailbox *m)
Open a Mailbox - Implements MxOps::mbox_open() -.
Definition notmuch.c:2060
static enum MxStatus nm_mbox_sync(struct Mailbox *m)
Save changes to the Mailbox - Implements MxOps::mbox_sync() -.
Definition notmuch.c:2245
static int nm_msg_close(struct Mailbox *m, struct Message *msg)
Close an email - Implements MxOps::msg_close() -.
Definition notmuch.c:2409
static int nm_msg_commit(struct Mailbox *m, struct Message *msg)
Save changes to an email - Implements MxOps::msg_commit() -.
Definition notmuch.c:2400
static bool nm_msg_open(struct Mailbox *m, struct Message *msg, struct Email *e)
Open an email message in a Mailbox - Implements MxOps::msg_open() -.
Definition notmuch.c:2380
static int nm_path_canon(struct Buffer *path)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition notmuch.c:2482
enum MailboxType nm_path_probe(const char *path, const struct stat *st)
Is this a Notmuch Mailbox?
Definition notmuch.c:2471
static int nm_tags_commit(struct Mailbox *m, struct Email *e, const char *buf)
Save the tags to a message - Implements MxOps::tags_commit() -.
Definition notmuch.c:2432
static int nm_tags_edit(struct Mailbox *m, const char *tags, struct Buffer *buf)
Prompt and validate new messages tags - Implements MxOps::tags_edit() -.
Definition notmuch.c:2418

Notmuch Mailbox - Implements MxOps -.

Definition at line 2490 of file notmuch.c.

2490 {
2491 // clang-format off
2492 .type = MUTT_NOTMUCH,
2493 .name = "notmuch",
2494 .is_local = false,
2495 .ac_owns_path = nm_ac_owns_path,
2496 .ac_add = nm_ac_add,
2497 .mbox_open = nm_mbox_open,
2498 .mbox_open_append = NULL,
2499 .mbox_check = nm_mbox_check,
2500 .mbox_check_stats = nm_mbox_check_stats,
2501 .mbox_sync = nm_mbox_sync,
2502 .mbox_close = nm_mbox_close,
2503 .msg_open = nm_msg_open,
2504 .msg_open_new = maildir_msg_open_new,
2505 .msg_commit = nm_msg_commit,
2506 .msg_close = nm_msg_close,
2507 .msg_padding_size = NULL,
2508 .msg_save_hcache = NULL,
2509 .tags_edit = nm_tags_edit,
2510 .tags_commit = nm_tags_commit,
2511 .path_probe = nm_path_probe,
2512 .path_canon = nm_path_canon,
2513 .path_is_empty = NULL,
2514 // clang-format on
2515};

◆ MxPopOps

const struct MxOps MxPopOps
Initial value:
= {
.type = MUTT_POP,
.name = "pop",
.is_local = false,
.ac_owns_path = pop_ac_owns_path,
.ac_add = pop_ac_add,
.mbox_open = pop_mbox_open,
.mbox_open_append = NULL,
.mbox_check = pop_mbox_check,
.mbox_check_stats = NULL,
.mbox_sync = pop_mbox_sync,
.mbox_close = pop_mbox_close,
.msg_open = pop_msg_open,
.msg_open_new = NULL,
.msg_commit = NULL,
.msg_close = pop_msg_close,
.msg_padding_size = NULL,
.msg_save_hcache = pop_msg_save_hcache,
.tags_edit = NULL,
.tags_commit = NULL,
.path_probe = pop_path_probe,
.path_canon = pop_path_canon,
.path_is_empty = NULL,
}
@ MUTT_POP
'POP3' Mailbox type
Definition mailbox.h:51
static bool pop_ac_add(struct Account *a, struct Mailbox *m)
Add a Mailbox to an Account - Implements MxOps::ac_add() -.
Definition pop.c:709
static bool pop_ac_owns_path(struct Account *a, const char *path)
Check whether an Account owns a Mailbox path - Implements MxOps::ac_owns_path() -.
Definition pop.c:691
static enum MxStatus pop_mbox_check(struct Mailbox *m)
Check for new mail - Implements MxOps::mbox_check() -.
Definition pop.c:816
static enum MxStatus pop_mbox_close(struct Mailbox *m)
Close a Mailbox - Implements MxOps::mbox_close() -.
Definition pop.c:948
static enum MxOpenReturns pop_mbox_open(struct Mailbox *m)
Open a Mailbox - Implements MxOps::mbox_open() -.
Definition pop.c:739
static enum MxStatus pop_mbox_sync(struct Mailbox *m)
Save changes to the Mailbox - Implements MxOps::mbox_sync() -.
Definition pop.c:858
static int pop_msg_close(struct Mailbox *m, struct Message *msg)
Close an email - Implements MxOps::msg_close() -.
Definition pop.c:1130
static bool pop_msg_open(struct Mailbox *m, struct Message *msg, struct Email *e)
Open an email message in a Mailbox - Implements MxOps::msg_open() -.
Definition pop.c:974
static int pop_msg_save_hcache(struct Mailbox *m, struct Email *e)
Save message to the header cache - Implements MxOps::msg_save_hcache() -.
Definition pop.c:1138
static int pop_path_canon(struct Buffer *path)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition pop.c:1169
enum MailboxType pop_path_probe(const char *path, const struct stat *st)
Is this a POP Mailbox?
Definition pop.c:1155

POP Mailbox - Implements MxOps -.

Definition at line 1177 of file pop.c.

1177 {
1178 // clang-format off
1179 .type = MUTT_POP,
1180 .name = "pop",
1181 .is_local = false,
1182 .ac_owns_path = pop_ac_owns_path,
1183 .ac_add = pop_ac_add,
1184 .mbox_open = pop_mbox_open,
1185 .mbox_open_append = NULL,
1186 .mbox_check = pop_mbox_check,
1187 .mbox_check_stats = NULL,
1188 .mbox_sync = pop_mbox_sync,
1189 .mbox_close = pop_mbox_close,
1190 .msg_open = pop_msg_open,
1191 .msg_open_new = NULL,
1192 .msg_commit = NULL,
1193 .msg_close = pop_msg_close,
1194 .msg_padding_size = NULL,
1195 .msg_save_hcache = pop_msg_save_hcache,
1196 .tags_edit = NULL,
1197 .tags_commit = NULL,
1198 .path_probe = pop_path_probe,
1199 .path_canon = pop_path_canon,
1200 .path_is_empty = NULL,
1201 // clang-format on
1202};