NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
lib.h
Go to the documentation of this file.
1
23
55
56#ifndef MUTT_IMAP_LIB_H
57#define MUTT_IMAP_LIB_H
58
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 ParseContext;
71struct ParseError;
72struct PatternList;
73struct stat;
74
75/* imap.c */
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(const 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);
88enum CommandResult parse_subscribe_to(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe);
89enum CommandResult parse_unsubscribe_from(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe);
90
91extern const struct MxOps MxImapOps;
92
93/* browse.c */
94int imap_browse(const char *path, struct BrowserState *state);
95int imap_mailbox_create(const char *folder);
96int imap_mailbox_rename(const char *path);
97
98/* message.c */
99int imap_copy_messages(struct Mailbox *m, struct EmailArray *ea, const char *dest, enum MessageSaveOpt save_opt);
100
101/* socket.c */
102void imap_logout_all(void);
103
104/* util.c */
105int imap_parse_path(const char *path, struct ConnAccount *cac, char *mailbox, size_t mailboxlen);
106void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder);
107int imap_mxcmp(const char *mx1, const char *mx2);
108
109int imap_wait_keep_alive(pid_t pid);
110void imap_keep_alive(void);
111
112void imap_get_parent_path(const char *path, char *buf, size_t buflen);
113void imap_clean_path(char *path, size_t plen);
114
115/* search.c */
116bool imap_search(struct Mailbox *m, const struct PatternList *pat);
117
118#endif /* MUTT_IMAP_LIB_H */
CommandResult
Error codes for command_t parse functions.
Definition command.h:37
Convenience wrapper for the core headers.
MailboxType
Supported mailbox formats.
Definition mailbox.h:40
Manage where the email is piped to external commands.
MessageSaveOpt
Message save option.
Definition external.h:52
enum CommandResult parse_subscribe_to(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'subscribe-to' command - Implements Command::parse() -.
Definition imap.c:93
enum CommandResult parse_unsubscribe_from(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'unsubscribe-from' command - Implements Command::parse() -.
Definition imap.c:143
const struct MxOps MxImapOps
IMAP Mailbox - Implements MxOps -.
Definition imap.c:2604
int imap_path_canon(struct Buffer *buf)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition imap.c:2560
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox?
Definition imap.c:2546
int imap_mailbox_status(struct Mailbox *m, bool queue)
Refresh the number of total and new messages.
Definition imap.c:1389
int imap_path_status(const char *path, bool queue)
Refresh the number of total and new messages.
Definition imap.c:1354
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:479
void imap_notify_delete_email(struct Mailbox *m, struct Email *e)
Inform IMAP that an Email has been deleted.
Definition imap.c:828
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
Definition browse.c:196
int imap_complete(struct Buffer *buf, const char *path)
Try to complete an IMAP folder path.
Definition imap.c:1462
int imap_subscribe(const char *path, bool subscribe)
Subscribe to a mailbox.
Definition imap.c:1405
int imap_wait_keep_alive(pid_t pid)
Wait for a process to change state.
Definition util.c:1028
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:611
int imap_mxcmp(const char *mx1, const char *mx2)
Compare mailbox names, giving priority to INBOX.
Definition util.c:550
void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder)
Prettify an IMAP mailbox name.
Definition util.c:586
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:1712
int imap_fast_trash(struct Mailbox *m, const char *dest)
Use server COPY command to copy deleted messages to trash.
Definition imap.c:1543
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:1661
int imap_access(const char *path)
Check permissions on an IMAP mailbox with a new connection.
Definition imap.c:569
void imap_keep_alive(void)
Poll the current folder to keep the connection alive.
Definition util.c:1002
void imap_logout_all(void)
Close all open connections.
Definition imap.c:667
enum MxStatus imap_check_mailbox(struct Mailbox *m, bool force)
Use the NOOP or IDLE command to poll for new mail.
Definition imap.c:1212
int imap_mailbox_create(const char *folder)
Create a new IMAP mailbox.
Definition browse.c:393
int imap_mailbox_rename(const char *path)
Rename a mailbox.
Definition browse.c:448
MxStatus
Return values from mbox_check(), mbox_check_stats(), mbox_sync(), and mbox_close()
Definition mxapi.h:59
State of the file/mailbox browser.
Definition lib.h:145
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:78
Definition mxapi.h:87
Context for config parsing (history/backtrace)
Definition pcontext.h:34
Detailed error information from config parsing.
Definition perror.h:34