NeoMutt  2023-03-22-27-g3cb248
Teaching an old dog new tricks
DOXYGEN
lib.h
Go to the documentation of this file.
1
55#ifndef MUTT_IMAP_LIB_H
56#define MUTT_IMAP_LIB_H
57
58#include "config.h"
59#include <stddef.h>
60#include <stdbool.h>
61#include <sys/types.h>
62#include "core/lib.h"
63#include "external.h"
64
65struct BrowserState;
66struct Buffer;
67struct ConnAccount;
68struct Email;
69struct EmailList;
70struct PatternList;
71struct stat;
72
73/* imap.c */
74void imap_init(void);
75int imap_access(const char *path);
76int imap_check_mailbox(struct Mailbox *m, bool force);
77int imap_delete_mailbox(struct Mailbox *m, char *path);
78int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close);
79int imap_path_status(const char *path, bool queue);
80int imap_mailbox_status(struct Mailbox *m, bool queue);
81int imap_subscribe(char *path, bool subscribe);
82int imap_complete(char *buf, size_t buflen, const char *path);
83int imap_fast_trash(struct Mailbox *m, const char *dest);
84enum MailboxType imap_path_probe(const char *path, const struct stat *st);
85int imap_path_canon(char *buf, size_t buflen);
86void imap_notify_delete_email(struct Mailbox *m, struct Email *e);
87
88extern struct MxOps MxImapOps;
89
90/* browse.c */
91int imap_browse(const char *path, struct BrowserState *state);
92int imap_mailbox_create(const char *folder);
93int imap_mailbox_rename(const char *path);
94
95/* message.c */
96int imap_copy_messages(struct Mailbox *m, struct EmailList *el, const char *dest, enum MessageSaveOpt save_opt);
97
98/* socket.c */
99void imap_logout_all(void);
100
101/* util.c */
102int imap_expand_path(struct Buffer *buf);
103int imap_parse_path(const char *path, struct ConnAccount *cac, char *mailbox, size_t mailboxlen);
104void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder);
105int imap_mxcmp(const char *mx1, const char *mx2);
106
107int imap_wait_keepalive(pid_t pid);
108void imap_keepalive(void);
109
110void imap_get_parent_path(const char *path, char *buf, size_t buflen);
111void imap_clean_path(char *path, size_t plen);
112
113/* search.c */
114bool imap_search(struct Mailbox *m, const struct PatternList *pat);
115
116#endif /* MUTT_IMAP_LIB_H */
Convenience wrapper for the core headers.
Manage where the email is piped to external commands.
MessageSaveOpt
Message save option.
Definition: external.h:49
struct MxOps MxImapOps
IMAP Mailbox - Implements MxOps -.
Definition: imap.c:2511
int imap_path_canon(char *buf, size_t buflen)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition: imap.c:2439
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe() -.
Definition: imap.c:2425
int imap_mailbox_status(struct Mailbox *m, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1284
int imap_path_status(const char *path, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1249
int imap_parse_path(const char *path, struct ConnAccount *cac, char *mailbox, size_t mailboxlen)
Parse an IMAP mailbox name into ConnAccount, name.
Definition: util.c:474
void imap_notify_delete_email(struct Mailbox *m, struct Email *e)
Inform IMAP that an Email has been deleted.
Definition: imap.c:662
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
Definition: browse.c:182
int imap_subscribe(char *path, bool subscribe)
Subscribe to a mailbox.
Definition: imap.c:1300
int imap_check_mailbox(struct Mailbox *m, bool force)
Use the NOOP or IDLE command to poll for new mail.
Definition: imap.c:1118
int imap_wait_keepalive(pid_t pid)
Wait for a process to change state.
Definition: util.c:965
int imap_copy_messages(struct Mailbox *m, struct EmailList *el, const char *dest, enum MessageSaveOpt save_opt)
Server COPY messages to another folder.
Definition: message.c:1660
int imap_complete(char *buf, size_t buflen, const char *path)
Try to complete an IMAP folder path.
Definition: imap.c:1356
void imap_get_parent_path(const char *path, char *buf, size_t buflen)
Get the path of the parent folder.
Definition: util.c:160
void imap_clean_path(char *path, size_t plen)
Cleans an IMAP path using imap_fix_path.
Definition: util.c:187
int imap_delete_mailbox(struct Mailbox *m, char *path)
Delete a mailbox.
Definition: imap.c:521
int imap_mxcmp(const char *mx1, const char *mx2)
Compare mailbox names, giving priority to INBOX.
Definition: util.c:545
void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder)
Prettify an IMAP mailbox name.
Definition: util.c:581
void imap_keepalive(void)
Poll the current folder to keep the connection alive.
Definition: util.c:941
int imap_fast_trash(struct Mailbox *m, const char *dest)
Use server COPY command to copy deleted messages to trash.
Definition: imap.c:1435
int imap_expand_path(struct Buffer *buf)
Buffer wrapper around imap_path_canon()
Definition: imap.c:2465
bool imap_search(struct Mailbox *m, const struct PatternList *pat)
Find messages in mailbox matching a pattern.
Definition: search.c:229
int imap_access(const char *path)
Check permissions on an IMAP mailbox with a new connection.
Definition: imap.c:479
void imap_logout_all(void)
Close all open connections.
Definition: imap.c:568
int imap_mailbox_create(const char *folder)
Create a new IMAP mailbox.
Definition: browse.c:382
int imap_mailbox_rename(const char *path)
Rename a mailbox.
Definition: browse.c:436
int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close)
Sync all the changes to the server.
Definition: imap.c:1545
void imap_init(void)
Setup feature commands.
Definition: imap.c:86
MailboxType
Supported mailbox formats.
Definition: mailbox.h:41
static size_t plen
Length of cached packet.
Definition: pgppacket.c:39
State of the file/mailbox browser.
Definition: lib.h:111
String manipulation buffer.
Definition: buffer.h:34
Login details for a remote server.
Definition: connaccount.h:53
The envelope/body of an email.
Definition: email.h:37
A mailbox.
Definition: mailbox.h:79
Definition: mxapi.h:112