NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
lib.h
Go to the documentation of this file.
1 
54 #ifndef MUTT_IMAP_LIB_H
55 #define MUTT_IMAP_LIB_H
56 
57 #include "config.h"
58 #include <stddef.h>
59 #include <stdbool.h>
60 #include <sys/types.h>
61 #include "core/lib.h"
62 #include "commands.h"
63 
64 struct BrowserState;
65 struct Buffer;
66 struct ConnAccount;
67 struct Email;
68 struct EmailList;
69 struct PatternList;
70 struct stat;
71 
72 /* imap.c */
73 void imap_init(void);
74 int imap_access(const char *path);
75 int imap_check_mailbox(struct Mailbox *m, bool force);
76 int imap_delete_mailbox(struct Mailbox *m, char *path);
77 int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close);
78 int imap_path_status(const char *path, bool queue);
79 int imap_mailbox_status(struct Mailbox *m, bool queue);
80 int imap_subscribe(char *path, bool subscribe);
81 int imap_complete(char *buf, size_t buflen, const char *path);
82 int imap_fast_trash(struct Mailbox *m, const char *dest);
83 enum MailboxType imap_path_probe(const char *path, const struct stat *st);
84 int imap_path_canon(char *buf, size_t buflen);
85 void imap_notify_delete_email(struct Mailbox *m, struct Email *e);
86 
87 extern struct MxOps MxImapOps;
88 
89 /* browse.c */
90 int imap_browse(const char *path, struct BrowserState *state);
91 int imap_mailbox_create(const char *folder);
92 int imap_mailbox_rename(const char *path);
93 
94 /* message.c */
95 int imap_copy_messages(struct Mailbox *m, struct EmailList *el, const char *dest, enum MessageSaveOpt save_opt);
96 
97 /* socket.c */
98 void imap_logout_all(void);
99 
100 /* util.c */
101 int imap_expand_path(struct Buffer *buf);
102 int imap_parse_path(const char *path, struct ConnAccount *cac, char *mailbox, size_t mailboxlen);
103 void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder);
104 int imap_mxcmp(const char *mx1, const char *mx2);
105 
106 int imap_wait_keepalive(pid_t pid);
107 void imap_keepalive(void);
108 
109 void imap_get_parent_path(const char *path, char *buf, size_t buflen);
110 void imap_clean_path(char *path, size_t plen);
111 
112 /* search.c */
113 bool imap_search(struct Mailbox *m, const struct PatternList *pat);
114 
115 #endif /* MUTT_IMAP_LIB_H */
bool imap_search(struct Mailbox *m, const struct PatternList *pat)
Find messages in mailbox matching a pattern.
Definition: search.c:229
The envelope/body of an email.
Definition: email.h:37
void imap_init(void)
Setup feature commands.
Definition: imap.c:83
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:483
void imap_keepalive(void)
poll the current folder to keep the connection alive
Definition: util.c:948
static size_t plen
Length of cached packet.
Definition: pgppacket.c:39
State of the file/mailbox browser.
Definition: browser.h:91
String manipulation buffer.
Definition: buffer.h:33
void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder)
Prettify an IMAP mailbox name.
Definition: util.c:590
int imap_subscribe(char *path, bool subscribe)
Subscribe to a mailbox.
Definition: imap.c:1286
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:1643
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
Definition: browse.c:182
int imap_expand_path(struct Buffer *buf)
Buffer wrapper around imap_path_canon()
Definition: imap.c:2442
void imap_notify_delete_email(struct Mailbox *m, struct Email *e)
Inform IMAP that an Email has been deleted.
Definition: imap.c:656
void imap_get_parent_path(const char *path, char *buf, size_t buflen)
Get the path of the parent folder.
Definition: util.c:161
Convenience wrapper for the core headers.
int imap_fast_trash(struct Mailbox *m, const char *dest)
Use server COPY command to copy deleted messages to trash.
Definition: imap.c:1423
struct MxOps MxImapOps
IMAP Mailbox - Implements MxOps -.
Definition: imap.c:2489
int imap_check_mailbox(struct Mailbox *m, bool force)
use the NOOP or IDLE command to poll for new mail
Definition: imap.c:1103
int imap_mailbox_create(const char *folder)
Create a new IMAP mailbox.
Definition: browse.c:384
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe() -.
Definition: imap.c:2402
int imap_mxcmp(const char *mx1, const char *mx2)
Compare mailbox names, giving priority to INBOX.
Definition: util.c:554
void imap_logout_all(void)
close all open connections
Definition: imap.c:564
int imap_path_canon(char *buf, size_t buflen)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition: imap.c:2416
int imap_path_status(const char *path, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1235
int imap_mailbox_status(struct Mailbox *m, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1270
int imap_access(const char *path)
Check permissions on an IMAP mailbox with a new connection.
Definition: imap.c:474
int imap_mailbox_rename(const char *path)
Rename a mailbox.
Definition: browse.c:437
int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close)
Sync all the changes to the server.
Definition: imap.c:1534
A mailbox.
Definition: mailbox.h:81
Manage where the email is piped to external commands.
int imap_wait_keepalive(pid_t pid)
Wait for a process to change state.
Definition: util.c:973
Login details for a remote server.
Definition: connaccount.h:51
MailboxType
Supported mailbox formats.
Definition: mailbox.h:43
void imap_clean_path(char *path, size_t plen)
Cleans an IMAP path using imap_fix_path.
Definition: util.c:188
int imap_complete(char *buf, size_t buflen, const char *path)
Try to complete an IMAP folder path.
Definition: imap.c:1343
MessageSaveOpt
Message save option.
Definition: commands.h:49
Definition: mxapi.h:103
int imap_delete_mailbox(struct Mailbox *m, char *path)
Delete a mailbox.
Definition: imap.c:516