NeoMutt  2024-10-02-37-gfa9146
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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 <stdbool.h>
60#include <stddef.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 EmailArray;
70struct PatternList;
71struct stat;
72
73/* imap.c */
74void imap_init(void);
75int imap_access(const char *path);
76enum MxStatus imap_check_mailbox(struct Mailbox *m, bool force);
77int imap_delete_mailbox(struct Mailbox *m, char *path);
78enum MxStatus 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(const char *path, bool subscribe);
82int imap_complete(struct Buffer *buf, 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(struct Buffer *buf);
86void imap_notify_delete_email(struct Mailbox *m, struct Email *e);
87
88extern const 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 EmailArray *ea, const char *dest, enum MessageSaveOpt save_opt);
97
98/* socket.c */
99void imap_logout_all(void);
100
101/* util.c */
102int imap_parse_path(const char *path, struct ConnAccount *cac, char *mailbox, size_t mailboxlen);
103void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder);
104int imap_mxcmp(const char *mx1, const char *mx2);
105
106int imap_wait_keep_alive(pid_t pid);
107void imap_keep_alive(void);
108
109void imap_get_parent_path(const char *path, char *buf, size_t buflen);
110void imap_clean_path(char *path, size_t plen);
111
112/* search.c */
113bool imap_search(struct Mailbox *m, const struct PatternList *pat);
114
115#endif /* MUTT_IMAP_LIB_H */
Convenience wrapper for the core headers.
MailboxType
Supported mailbox formats.
Definition: mailbox.h:41
Manage where the email is piped to external commands.
MessageSaveOpt
Message save option.
Definition: external.h:51
const struct MxOps MxImapOps
IMAP Mailbox - Implements MxOps -.
Definition: imap.c:2403
int imap_path_canon(struct Buffer *buf)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition: imap.c:2359
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe() -.
Definition: imap.c:2345
int imap_mailbox_status(struct Mailbox *m, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1207
int imap_path_status(const char *path, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1172
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:478
void imap_notify_delete_email(struct Mailbox *m, struct Email *e)
Inform IMAP that an Email has been deleted.
Definition: imap.c:648
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
Definition: browse.c:197
int imap_complete(struct Buffer *buf, const char *path)
Try to complete an IMAP folder path.
Definition: imap.c:1275
int imap_subscribe(const char *path, bool subscribe)
Subscribe to a mailbox.
Definition: imap.c:1223
int imap_wait_keep_alive(pid_t pid)
Wait for a process to change state.
Definition: util.c:1019
void imap_get_parent_path(const char *path, char *buf, size_t buflen)
Get the path of the parent folder.
Definition: util.c:165
void imap_clean_path(char *path, size_t plen)
Cleans an IMAP path using imap_fix_path.
Definition: util.c:192
int imap_delete_mailbox(struct Mailbox *m, char *path)
Delete a mailbox.
Definition: imap.c:505
int imap_mxcmp(const char *mx1, const char *mx2)
Compare mailbox names, giving priority to INBOX.
Definition: util.c:549
void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder)
Prettify an IMAP mailbox name.
Definition: util.c:585
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:1687
int imap_fast_trash(struct Mailbox *m, const char *dest)
Use server COPY command to copy deleted messages to trash.
Definition: imap.c:1356
bool imap_search(struct Mailbox *m, const struct PatternList *pat)
Find messages in mailbox matching a pattern.
Definition: search.c:227
enum MxStatus imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close)
Sync all the changes to the server.
Definition: imap.c:1471
int imap_access(const char *path)
Check permissions on an IMAP mailbox with a new connection.
Definition: imap.c:463
void imap_keep_alive(void)
Poll the current folder to keep the connection alive.
Definition: util.c:995
void imap_logout_all(void)
Close all open connections.
Definition: imap.c:554
enum MxStatus imap_check_mailbox(struct Mailbox *m, bool force)
Use the NOOP or IDLE command to poll for new mail.
Definition: imap.c:1032
int imap_mailbox_create(const char *folder)
Create a new IMAP mailbox.
Definition: browse.c:394
int imap_mailbox_rename(const char *path)
Rename a mailbox.
Definition: browse.c:449
void imap_init(void)
Setup feature commands.
Definition: imap.c:96
MxStatus
Return values from mbox_check(), mbox_check_stats(), mbox_sync(), and mbox_close()
Definition: mxapi.h:63
State of the file/mailbox browser.
Definition: lib.h:143
String manipulation buffer.
Definition: buffer.h:36
Login details for a remote server.
Definition: connaccount.h:53
The envelope/body of an email.
Definition: email.h:39
A mailbox.
Definition: mailbox.h:79
Definition: mxapi.h:91