NeoMutt
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
lib.h
Go to the documentation of this file.
1
56#ifndef MUTT_IMAP_LIB_H
57#define MUTT_IMAP_LIB_H
58
59#include "config.h"
60#include <stddef.h>
61#include <stdbool.h>
62#include <sys/types.h>
63#include "core/lib.h"
64#include "external.h"
65
66struct BrowserState;
67struct Buffer;
68struct ConnAccount;
69struct Email;
70struct EmailArray;
71struct PatternList;
72struct stat;
73
74/* imap.c */
75void imap_init(void);
76int imap_access(const char *path);
77enum MxStatus imap_check_mailbox(struct Mailbox *m, bool force);
78int imap_delete_mailbox(struct Mailbox *m, char *path);
79enum MxStatus imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close);
80int imap_path_status(const char *path, bool queue);
81int imap_mailbox_status(struct Mailbox *m, bool queue);
82int imap_subscribe(char *path, bool subscribe);
83int imap_complete(struct Buffer *buf, const char *path);
84int imap_fast_trash(struct Mailbox *m, const char *dest);
85enum MailboxType imap_path_probe(const char *path, const struct stat *st);
86int imap_path_canon(struct Buffer *buf);
87void imap_notify_delete_email(struct Mailbox *m, struct Email *e);
88
89extern const struct MxOps MxImapOps;
90
91/* browse.c */
92int imap_browse(const char *path, struct BrowserState *state);
93int imap_mailbox_create(const char *folder);
94int imap_mailbox_rename(const char *path);
95
96/* message.c */
97int imap_copy_messages(struct Mailbox *m, struct EmailArray *ea, const char *dest, enum MessageSaveOpt save_opt);
98
99/* socket.c */
100void imap_logout_all(void);
101
102/* util.c */
103int imap_expand_path(struct Buffer *buf);
104int imap_parse_path(const char *path, struct ConnAccount *cac, char *mailbox, size_t mailboxlen);
105void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder);
106int imap_mxcmp(const char *mx1, const char *mx2);
107
108int imap_wait_keep_alive(pid_t pid);
109void imap_keep_alive(void);
110
111void imap_get_parent_path(const char *path, char *buf, size_t buflen);
112void imap_clean_path(char *path, size_t plen);
113
114/* search.c */
115bool imap_search(struct Mailbox *m, const struct PatternList *pat);
116
117#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
const struct MxOps MxImapOps
IMAP Mailbox - Implements MxOps -.
Definition: imap.c:2415
int imap_path_canon(struct Buffer *buf)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition: imap.c:2343
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe() -.
Definition: imap.c:2329
int imap_mailbox_status(struct Mailbox *m, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1192
int imap_path_status(const char *path, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1157
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:471
void imap_notify_delete_email(struct Mailbox *m, struct Email *e)
Inform IMAP that an Email has been deleted.
Definition: imap.c:640
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
Definition: browse.c:192
int imap_subscribe(char *path, bool subscribe)
Subscribe to a mailbox.
Definition: imap.c:1208
int imap_complete(struct Buffer *buf, const char *path)
Try to complete an IMAP folder path.
Definition: imap.c:1263
int imap_wait_keep_alive(pid_t pid)
Wait for a process to change state.
Definition: util.c:976
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:497
int imap_mxcmp(const char *mx1, const char *mx2)
Compare mailbox names, giving priority to INBOX.
Definition: util.c:542
void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder)
Prettify an IMAP mailbox name.
Definition: util.c:578
int imap_copy_messages(struct Mailbox *m, struct EmailArray *ea, const char *dest, enum MessageSaveOpt save_opt)
Server COPY messages to another folder.
Definition: message.c:1668
int imap_fast_trash(struct Mailbox *m, const char *dest)
Use server COPY command to copy deleted messages to trash.
Definition: imap.c:1344
int imap_expand_path(struct Buffer *buf)
Buffer wrapper around imap_path_canon()
Definition: imap.c:2369
bool imap_search(struct Mailbox *m, const struct PatternList *pat)
Find messages in mailbox matching a pattern.
Definition: search.c:229
enum MxStatus imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close)
Sync all the changes to the server.
Definition: imap.c:1459
int imap_access(const char *path)
Check permissions on an IMAP mailbox with a new connection.
Definition: imap.c:455
void imap_keep_alive(void)
Poll the current folder to keep the connection alive.
Definition: util.c:952
void imap_logout_all(void)
Close all open connections.
Definition: imap.c:546
enum MxStatus imap_check_mailbox(struct Mailbox *m, bool force)
Use the NOOP or IDLE command to poll for new mail.
Definition: imap.c:1019
int imap_mailbox_create(const char *folder)
Create a new IMAP mailbox.
Definition: browse.c:392
int imap_mailbox_rename(const char *path)
Rename a mailbox.
Definition: browse.c:447
void imap_init(void)
Setup feature commands.
Definition: imap.c:88
MailboxType
Supported mailbox formats.
Definition: mailbox.h:41
MxStatus
Return values from mbox_check(), mbox_check_stats(), mbox_snc(), and mbox_close()
Definition: mxapi.h:63
State of the file/mailbox browser.
Definition: lib.h:118
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:91