NeoMutt  2022-04-29-247-gc6aae8
Teaching an old dog new tricks
DOXYGEN
lib.h
Go to the documentation of this file.
1
54#ifndef MUTT_IMAP_LIB_H
55#define MUTT_IMAP_LIB_H
56
57#include "config.h"
58#include <stddef.h>
59#include <stdbool.h>
60#include <sys/types.h>
61#include "core/lib.h"
62#include "commands.h"
63
64struct BrowserState;
65struct Buffer;
66struct ConnAccount;
67struct Email;
68struct EmailList;
69struct PatternList;
70struct stat;
71
72/* imap.c */
73void imap_init(void);
74int imap_access(const char *path);
75int imap_check_mailbox(struct Mailbox *m, bool force);
76int imap_delete_mailbox(struct Mailbox *m, char *path);
77int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close);
78int imap_path_status(const char *path, bool queue);
79int imap_mailbox_status(struct Mailbox *m, bool queue);
80int imap_subscribe(char *path, bool subscribe);
81int imap_complete(char *buf, size_t buflen, const char *path);
82int imap_fast_trash(struct Mailbox *m, const char *dest);
83enum MailboxType imap_path_probe(const char *path, const struct stat *st);
84int imap_path_canon(char *buf, size_t buflen);
85void imap_notify_delete_email(struct Mailbox *m, struct Email *e);
86
87extern struct MxOps MxImapOps;
88
89/* browse.c */
90int imap_browse(const char *path, struct BrowserState *state);
91int imap_mailbox_create(const char *folder);
92int imap_mailbox_rename(const char *path);
93
94/* message.c */
95int imap_copy_messages(struct Mailbox *m, struct EmailList *el, const char *dest, enum MessageSaveOpt save_opt);
96
97/* socket.c */
98void imap_logout_all(void);
99
100/* util.c */
101int imap_expand_path(struct Buffer *buf);
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_keepalive(pid_t pid);
107void imap_keepalive(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 */
Manage where the email is piped to external commands.
MessageSaveOpt
Message save option.
Definition: commands.h:49
Convenience wrapper for the core headers.
struct MxOps MxImapOps
IMAP Mailbox - Implements MxOps -.
Definition: imap.c:2486
int imap_path_canon(char *buf, size_t buflen)
Canonicalise a Mailbox path - Implements MxOps::path_canon() -.
Definition: imap.c:2414
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe() -.
Definition: imap.c:2400
int imap_mailbox_status(struct Mailbox *m, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1273
int imap_path_status(const char *path, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1238
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:482
void imap_notify_delete_email(struct Mailbox *m, struct Email *e)
Inform IMAP that an Email has been deleted.
Definition: imap.c:654
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
Definition: browse.c:182
int imap_subscribe(char *path, bool subscribe)
Subscribe to a mailbox.
Definition: imap.c:1289
int imap_check_mailbox(struct Mailbox *m, bool force)
Use the NOOP or IDLE command to poll for new mail.
Definition: imap.c:1106
int imap_wait_keepalive(pid_t pid)
Wait for a process to change state.
Definition: util.c:969
int imap_copy_messages(struct Mailbox *m, struct EmailList *el, const char *dest, enum MessageSaveOpt save_opt)
Server COPY messages to another folder.
Definition: message.c:1683
int imap_complete(char *buf, size_t buflen, const char *path)
Try to complete an IMAP folder path.
Definition: imap.c:1345
void imap_get_parent_path(const char *path, char *buf, size_t buflen)
Get the path of the parent folder.
Definition: util.c:161
void imap_clean_path(char *path, size_t plen)
Cleans an IMAP path using imap_fix_path.
Definition: util.c:188
int imap_delete_mailbox(struct Mailbox *m, char *path)
Delete a mailbox.
Definition: imap.c:515
int imap_mxcmp(const char *mx1, const char *mx2)
Compare mailbox names, giving priority to INBOX.
Definition: util.c:553
void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder)
Prettify an IMAP mailbox name.
Definition: util.c:589
void imap_keepalive(void)
Poll the current folder to keep the connection alive.
Definition: util.c:945
int imap_fast_trash(struct Mailbox *m, const char *dest)
Use server COPY command to copy deleted messages to trash.
Definition: imap.c:1424
int imap_expand_path(struct Buffer *buf)
Buffer wrapper around imap_path_canon()
Definition: imap.c:2440
bool imap_search(struct Mailbox *m, const struct PatternList *pat)
Find messages in mailbox matching a pattern.
Definition: search.c:229
int imap_access(const char *path)
Check permissions on an IMAP mailbox with a new connection.
Definition: imap.c:473
void imap_logout_all(void)
Close all open connections.
Definition: imap.c:562
int imap_mailbox_create(const char *folder)
Create a new IMAP mailbox.
Definition: browse.c:382
int imap_mailbox_rename(const char *path)
Rename a mailbox.
Definition: browse.c:436
int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close)
Sync all the changes to the server.
Definition: imap.c:1534
void imap_init(void)
Setup feature commands.
Definition: imap.c:84
MailboxType
Supported mailbox formats.
Definition: mailbox.h:41
static size_t plen
Length of cached packet.
Definition: pgppacket.c:39
State of the file/mailbox browser.
Definition: lib.h:111
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:112