NeoMutt  2018-07-16 +2481-68dcde
Teaching an old dog new tricks
DOXYGEN
imap.h
Go to the documentation of this file.
1 
48 #ifndef MUTT_IMAP_IMAP_H
49 #define MUTT_IMAP_IMAP_H
50 
51 #include <stddef.h>
52 #include <stdbool.h>
53 #include <sys/types.h>
54 #include "core/lib.h"
55 #include "mx.h"
56 
57 struct BrowserState;
58 struct Buffer;
59 struct ConnAccount;
60 struct EmailList;
61 struct PatternList;
62 struct stat;
63 
64 /* These Config Variables are only used in imap/auth.c */
65 extern struct Slist *C_ImapAuthenticators;
66 
67 /* These Config Variables are only used in imap/imap.c */
68 extern bool C_ImapIdle;
69 extern bool C_ImapRfc5161;
70 
71 /* These Config Variables are only used in imap/message.c */
72 extern char *C_ImapHeaders;
73 extern long C_ImapFetchChunkSize;
74 
75 /* These Config Variables are only used in imap/command.c */
76 extern bool C_ImapServernoise;
77 
78 /* These Config Variables are only used in imap/util.c */
79 extern char *C_ImapDelimChars;
80 extern short C_ImapPipelineDepth;
81 
82 /* imap.c */
83 int imap_access(const char *path);
84 int imap_check_mailbox(struct Mailbox *m, bool force);
85 int imap_delete_mailbox(struct Mailbox *m, char *path);
86 int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close);
87 int imap_path_status(const char *path, bool queue);
88 int imap_mailbox_status(struct Mailbox *m, bool queue);
89 int imap_search(struct Mailbox *m, const struct PatternList *pat);
90 int imap_subscribe(char *path, bool subscribe);
91 int imap_complete(char *buf, size_t buflen, char *path);
92 int imap_fast_trash(struct Mailbox *m, char *dest);
93 enum MailboxType imap_path_probe(const char *path, const struct stat *st);
94 int imap_path_canon(char *buf, size_t buflen);
95 
96 extern struct MxOps MxImapOps;
97 
98 /* browse.c */
99 int imap_browse(const char *path, struct BrowserState *state);
100 int imap_mailbox_create(const char *folder);
101 int imap_mailbox_rename(const char *path);
102 
103 /* message.c */
104 int imap_copy_messages(struct Mailbox *m, struct EmailList *el, const char *dest, bool delete_original);
105 
106 /* socket.c */
107 void imap_logout_all(void);
108 
109 /* util.c */
110 int imap_expand_path(struct Buffer *buf);
111 int imap_parse_path(const char *path, struct ConnAccount *account, char *mailbox, size_t mailboxlen);
112 void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder);
113 
114 int imap_wait_keepalive(pid_t pid);
115 void imap_keepalive(void);
116 
117 void imap_get_parent_path(const char *path, char *buf, size_t buflen);
118 void imap_clean_path(char *path, size_t plen);
119 
120 #endif /* MUTT_IMAP_IMAP_H */
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe()
Definition: imap.c:2425
int imap_mailbox_create(const char *folder)
Create a new IMAP mailbox.
Definition: browse.c:383
int imap_delete_mailbox(struct Mailbox *m, char *path)
Delete a mailbox.
Definition: imap.c:642
short C_ImapPipelineDepth
Config: (imap) Number of IMAP commands that may be queued up.
Definition: util.c:62
int imap_check_mailbox(struct Mailbox *m, bool force)
use the NOOP or IDLE command to poll for new mail
Definition: imap.c:1186
static size_t plen
Length of cached packet.
Definition: pgppacket.c:38
State of the file/mailbox browser.
Definition: browser.h:95
String manipulation buffer.
Definition: buffer.h:33
int imap_subscribe(char *path, bool subscribe)
Subscribe to a mailbox.
Definition: imap.c:1384
int imap_search(struct Mailbox *m, const struct PatternList *pat)
Find a matching mailbox.
Definition: imap.c:1350
String list.
Definition: slist.h:43
char * C_ImapDelimChars
Config: (imap) Characters that denote separators in IMAP folders.
Definition: util.c:61
void imap_logout_all(void)
close all open connections
Definition: imap.c:687
int imap_expand_path(struct Buffer *buf)
Buffer wrapper around imap_path_canon()
Definition: imap.c:2471
API for mailboxes.
Convenience wrapper for the core headers.
void imap_get_parent_path(const char *path, char *buf, size_t buflen)
Get the path of the parent folder.
Definition: util.c:299
int imap_parse_path(const char *path, struct ConnAccount *account, char *mailbox, size_t mailboxlen)
Parse an IMAP mailbox name into ConnAccount, name.
Definition: util.c:586
bool C_ImapIdle
Config: (imap) Use the IMAP IDLE extension to check for new mail.
Definition: imap.c:65
A mailbox.
Definition: mailbox.h:92
struct MxOps MxImapOps
IMAP Mailbox - Implements MxOps.
Definition: imap.c:2505
int imap_path_canon(char *buf, size_t buflen)
Canonicalise a Mailbox path - Implements MxOps::path_canon()
Definition: imap.c:2442
int imap_copy_messages(struct Mailbox *m, struct EmailList *el, const char *dest, bool delete_original)
Server COPY messages to another folder.
Definition: message.c:1576
bool C_ImapRfc5161
Config: (imap) Use the IMAP ENABLE extension to select capabilities.
Definition: imap.c:69
Login details for a remote server.
Definition: connaccount.h:31
bool C_ImapServernoise
Config: (imap) Display server warnings as error messages.
Definition: command.c:56
MailboxType
Supported mailbox formats.
Definition: mailbox.h:42
char * C_ImapHeaders
Config: (imap) Additional email headers to download when getting index.
Definition: message.c:63
struct Slist * C_ImapAuthenticators
Config: (imap) List of allowed IMAP authentication methods.
Definition: auth.c:37
long C_ImapFetchChunkSize
Config: (imap) Download headers in blocks of this size.
Definition: message.c:67
int imap_complete(char *buf, size_t buflen, char *path)
Try to complete an IMAP folder path.
Definition: imap.c:1441
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
Definition: browse.c:185
int imap_path_status(const char *path, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1309
int imap_fast_trash(struct Mailbox *m, char *dest)
Use server COPY command to copy deleted messages to trash.
Definition: imap.c:1519
int imap_mailbox_status(struct Mailbox *m, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1334
void imap_keepalive(void)
poll the current folder to keep the connection alive
Definition: util.c:1053
int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close)
Sync all the changes to the server.
Definition: imap.c:1625
int imap_mailbox_rename(const char *path)
Rename a mailbox.
Definition: browse.c:435
int imap_access(const char *path)
Check permissions on an IMAP mailbox with a new connection.
Definition: imap.c:599
void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder)
Prettify an IMAP mailbox name.
Definition: util.c:688
The Mailbox API.
Definition: mx.h:103
int imap_wait_keepalive(pid_t pid)
Wait for a process to change state.
Definition: util.c:1076
void imap_clean_path(char *path, size_t plen)
Cleans an IMAP path using imap_fix_path.
Definition: util.c:326