NeoMutt  2024-02-01-25-ga71e95
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 <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 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(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_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_keep_alive(pid_t pid);
108void imap_keep_alive(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.
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:2404
int imap_path_canon(struct Buffer *buf)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition: imap.c:2356
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe() -.
Definition: imap.c:2342
int imap_mailbox_status(struct Mailbox *m, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1206
int imap_path_status(const char *path, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1171
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:649
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
Definition: browse.c:197
int imap_subscribe(char *path, bool subscribe)
Subscribe to a mailbox.
Definition: imap.c:1222
int imap_complete(struct Buffer *buf, const char *path)
Try to complete an IMAP folder path.
Definition: imap.c:1274
int imap_wait_keep_alive(pid_t pid)
Wait for a process to change state.
Definition: util.c:979
void imap_get_parent_path(const char *path, char *buf, size_t buflen)
Get the path of the parent folder.
Definition: util.c:162
void imap_clean_path(char *path, size_t plen)
Cleans an IMAP path using imap_fix_path.
Definition: util.c:189
int imap_delete_mailbox(struct Mailbox *m, char *path)
Delete a mailbox.
Definition: imap.c:506
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
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:1685
int imap_fast_trash(struct Mailbox *m, const char *dest)
Use server COPY command to copy deleted messages to trash.
Definition: imap.c:1355
int imap_expand_path(struct Buffer *buf)
Buffer wrapper around imap_path_canon()
Definition: imap.c:2382
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:1470
int imap_access(const char *path)
Check permissions on an IMAP mailbox with a new connection.
Definition: imap.c:464
void imap_keep_alive(void)
Poll the current folder to keep the connection alive.
Definition: util.c:955
void imap_logout_all(void)
Close all open connections.
Definition: imap.c:555
enum MxStatus imap_check_mailbox(struct Mailbox *m, bool force)
Use the NOOP or IDLE command to poll for new mail.
Definition: imap.c:1031
int imap_mailbox_create(const char *folder)
Create a new IMAP mailbox.
Definition: browse.c:397
int imap_mailbox_rename(const char *path)
Rename a mailbox.
Definition: browse.c:452
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:114
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