NeoMutt  2020-08-07-1-gab41a1
Teaching an old dog new tricks
DOXYGEN
lib.h
Go to the documentation of this file.
1 
50 #ifndef MUTT_IMAP_LIB_H
51 #define MUTT_IMAP_LIB_H
52 
53 #include "config.h"
54 #include <stddef.h>
55 #include <stdbool.h>
56 #include <sys/types.h>
57 #include "core/lib.h"
58 #include "mx.h"
59 
60 struct BrowserState;
61 struct Buffer;
62 struct ConfigSet;
63 struct ConnAccount;
64 struct EmailList;
65 struct PatternList;
66 struct stat;
67 
68 // These Config Variables are used outside of libimap
69 extern short C_ImapKeepalive;
70 extern bool C_ImapListSubscribed;
71 extern bool C_ImapPassive;
72 extern bool C_ImapPeek;
73 
74 /* imap.c */
75 int imap_access(const char *path);
76 int imap_check_mailbox(struct Mailbox *m, bool force);
77 int imap_delete_mailbox(struct Mailbox *m, char *path);
78 int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close);
79 int imap_path_status(const char *path, bool queue);
80 int imap_mailbox_status(struct Mailbox *m, bool queue);
81 int imap_subscribe(char *path, bool subscribe);
82 int imap_complete(char *buf, size_t buflen, const char *path);
83 int imap_fast_trash(struct Mailbox *m, char *dest);
84 enum MailboxType imap_path_probe(const char *path, const struct stat *st);
85 int imap_path_canon(char *buf, size_t buflen);
86 void imap_notify_delete_email(struct Mailbox *m, struct Email *e);
87 
88 extern struct MxOps MxImapOps;
89 
90 /* browse.c */
91 int imap_browse(const char *path, struct BrowserState *state);
92 int imap_mailbox_create(const char *folder);
93 int imap_mailbox_rename(const char *path);
94 
95 /* message.c */
96 int imap_copy_messages(struct Mailbox *m, struct EmailList *el, const char *dest, bool delete_original);
97 
98 /* socket.c */
99 void imap_logout_all(void);
100 
101 /* util.c */
102 int imap_expand_path(struct Buffer *buf);
103 int imap_parse_path(const char *path, struct ConnAccount *cac, char *mailbox, size_t mailboxlen);
104 void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder);
105 int imap_mxcmp(const char *mx1, const char *mx2);
106 
107 int imap_wait_keepalive(pid_t pid);
108 void imap_keepalive(void);
109 
110 void imap_get_parent_path(const char *path, char *buf, size_t buflen);
111 void imap_clean_path(char *path, size_t plen);
112 
113 /* search.c */
114 bool imap_search(struct Mailbox *m, const struct PatternList *pat);
115 
116 #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:228
Container for lots of config items.
Definition: set.h:227
bool C_ImapPeek
Config: (imap) Don&#39;t mark messages as read when fetching them from the server.
Definition: config.c:52
The envelope/body of an email.
Definition: email.h:37
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:618
void imap_keepalive(void)
poll the current folder to keep the connection alive
Definition: util.c:1079
static size_t plen
Length of cached packet.
Definition: pgppacket.c:39
State of the file/mailbox browser.
Definition: browser.h:91
bool C_ImapListSubscribed
Config: (imap) When browsing a mailbox, only display subscribed folders.
Definition: config.c:47
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:725
int imap_subscribe(char *path, bool subscribe)
Subscribe to a mailbox.
Definition: imap.c:1257
int imap_fast_trash(struct Mailbox *m, char *dest)
Use server COPY command to copy deleted messages to trash.
Definition: imap.c:1390
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe()
Definition: imap.c:2378
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
Definition: browse.c:185
int imap_expand_path(struct Buffer *buf)
Buffer wrapper around imap_path_canon()
Definition: imap.c:2424
void imap_notify_delete_email(struct Mailbox *m, struct Email *e)
Inform IMAP that an Email has been deleted.
Definition: imap.c:628
API for mailboxes.
void imap_get_parent_path(const char *path, char *buf, size_t buflen)
Get the path of the parent folder.
Definition: util.c:300
Convenience wrapper for the core headers.
int imap_check_mailbox(struct Mailbox *m, bool force)
use the NOOP or IDLE command to poll for new mail
Definition: imap.c:1087
int imap_mailbox_create(const char *folder)
Create a new IMAP mailbox.
Definition: browse.c:385
int imap_mxcmp(const char *mx1, const char *mx2)
Compare mailbox names, giving priority to INBOX.
Definition: util.c:689
void imap_logout_all(void)
close all open connections
Definition: imap.c:537
int imap_path_status(const char *path, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1207
int imap_mailbox_status(struct Mailbox *m, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1241
short C_ImapKeepalive
Config: (imap) Time to wait before polling an open IMAP connection.
Definition: config.c:46
int imap_access(const char *path)
Check permissions on an IMAP mailbox with a new connection.
Definition: imap.c:450
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:1502
bool C_ImapPassive
Config: (imap) Reuse an existing IMAP connection to check for new mail.
Definition: config.c:51
int imap_copy_messages(struct Mailbox *m, struct EmailList *el, const char *dest, bool delete_original)
Server COPY messages to another folder.
Definition: message.c:1601
A mailbox.
Definition: mailbox.h:81
int imap_path_canon(char *buf, size_t buflen)
Canonicalise a Mailbox path - Implements MxOps::path_canon()
Definition: imap.c:2395
int imap_wait_keepalive(pid_t pid)
Wait for a process to change state.
Definition: util.c:1102
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:327
struct MxOps MxImapOps
IMAP Mailbox - Implements MxOps.
Definition: imap.c:2458
int imap_complete(char *buf, size_t buflen, const char *path)
Try to complete an IMAP folder path.
Definition: imap.c:1312
The Mailbox API.
Definition: mx.h:105
int imap_delete_mailbox(struct Mailbox *m, char *path)
Delete a mailbox.
Definition: imap.c:492