Shared constants/structs that are private to IMAP. More...
#include "config.h"#include <stdbool.h>#include <stdint.h>#include <stdio.h>#include "config/lib.h"Go to the source code of this file.
Data Structures | |
| struct | ImapList |
| Items in an IMAP browser. More... | |
| struct | ImapCommand |
| IMAP command structure. More... | |
| struct | SeqsetIterator |
| UID Sequence Set Iterator. More... | |
Macros | |
| #define | IMAP_PORT 143 |
| Default port for IMAP. | |
| #define | IMAP_SSL_PORT 993 |
| Port for IMAP over SSL/TLS. | |
| #define | IMAP_LOG_CMD 2 |
| Log commands only. | |
| #define | IMAP_LOG_LTRL 3 |
| Log literal values. | |
| #define | IMAP_LOG_PASS 5 |
| Log passwords (dangerous!). | |
| #define | IMAP_RES_NO (-2) |
| <tag> NO ... | |
| #define | IMAP_RES_BAD (-1) |
| <tag> BAD ... | |
| #define | IMAP_RES_OK 0 |
| <tag> OK ... | |
| #define | IMAP_RES_CONTINUE 1 |
| * ... | |
| #define | IMAP_RES_RESPOND 2 |
| + | |
| #define | IMAP_RES_NEW 3 |
| ImapCommand.state additions. | |
| #define | SEQ_LEN 16 |
| Length of IMAP sequence buffer. | |
| #define | IMAP_DATELEN 27 |
| Length of IMAP date string "DD-MMM-YYYY HH:MM:SS +ZZzz" plus NUL. | |
| #define | IMAP_CAP_ALL ((1 << 21) - 1) |
Typedefs | |
| typedef uint8_t | ImapOpenFlags |
| typedef uint8_t | ImapCmdFlags |
| typedef uint32_t | ImapCapFlags |
Functions | |
| int | imap_create_mailbox (struct ImapAccountData *adata, const char *mailbox) |
| Create a new mailbox. | |
| int | imap_rename_mailbox (struct ImapAccountData *adata, char *oldname, const char *newname) |
| Rename a mailbox. | |
| int | imap_open_connection (struct ImapAccountData *adata) |
| Open an IMAP connection. | |
| void | imap_close_connection (struct ImapAccountData *adata) |
| Close an IMAP connection. | |
| int | imap_read_literal (FILE *fp, struct ImapAccountData *adata, unsigned long bytes, struct Progress *progress) |
| Read bytes bytes from server into file. | |
| void | imap_expunge_mailbox (struct Mailbox *m, bool resort) |
| Purge messages from the server. | |
| int | imap_login (struct ImapAccountData *adata) |
| Open an IMAP connection. | |
| int | imap_sync_message_for_copy (struct Mailbox *m, struct Email *e, struct Buffer *cmd, enum QuadOption *err_continue) |
| Update server to reflect the flags of a single message. | |
| bool | imap_has_flag (struct ListHead *flag_list, const char *flag) |
| Does the flag exist in the list. | |
| int | imap_adata_find (const char *path, struct ImapAccountData **adata, struct ImapMboxData **mdata) |
| Find the Account data for this path. | |
| int | imap_reopen_mailbox (struct ImapAccountData *adata) |
| Re-SELECT the current mailbox after reconnecting. | |
| int | imap_authenticate (struct ImapAccountData *adata) |
| Authenticate to an IMAP server. | |
| int | imap_cmd_start (struct ImapAccountData *adata, const char *cmdstr) |
| Given an IMAP command, send it to the server. | |
| int | imap_cmd_step (struct ImapAccountData *adata) |
| Reads server responses from an IMAP command. | |
| void | imap_cmd_finish (struct ImapAccountData *adata) |
| Attempt to perform cleanup. | |
| bool | imap_code (const char *s) |
| Was the command successful. | |
| const char * | imap_cmd_trailer (struct ImapAccountData *adata) |
| Extra information after tagged command response if any. | |
| int | imap_exec (struct ImapAccountData *adata, const char *cmdstr, ImapCmdFlags flags) |
| Execute a command and wait for the response from the server. | |
| int | imap_cmd_idle (struct ImapAccountData *adata) |
| Enter the IDLE state. | |
| int | imap_read_headers (struct Mailbox *m, unsigned int msn_begin, unsigned int msn_end, bool initial_download) |
| Read headers from the server. | |
| char * | imap_set_flags (struct Mailbox *m, struct Email *e, char *s, bool *server_changes) |
| Fill the message header according to the server flags. | |
| int | imap_cache_del (struct Mailbox *m, struct Email *e) |
| Delete an email from the body cache. | |
| int | imap_cache_clean (struct Mailbox *m) |
| Delete all the entries in the message cache. | |
| int | imap_append_message (struct Mailbox *m, struct Message *msg) |
| Write an email back to the server. | |
| bool | imap_msg_open (struct Mailbox *m, struct Message *msg, struct Email *e) |
| Open an email message in a Mailbox - Implements MxOps::msg_open() -. | |
| int | imap_msg_close (struct Mailbox *m, struct Message *msg) |
| Close an email - Implements MxOps::msg_close() -. | |
| int | imap_msg_commit (struct Mailbox *m, struct Message *msg) |
| Save changes to an email - Implements MxOps::msg_commit() -. | |
| int | imap_msg_save_hcache (struct Mailbox *m, struct Email *e) |
| Save message to the header cache - Implements MxOps::msg_save_hcache() -. | |
| void | imap_hcache_open (struct ImapAccountData *adata, struct ImapMboxData *mdata, bool create) |
| Open a header cache. | |
| void | imap_hcache_close (struct ImapMboxData *mdata) |
| Close the header cache. | |
| struct Email * | imap_hcache_get (struct ImapMboxData *mdata, unsigned int uid) |
| Get a header cache entry by its UID. | |
| int | imap_hcache_put (struct ImapMboxData *mdata, struct Email *e) |
| Add an entry to the header cache. | |
| int | imap_hcache_del (struct ImapMboxData *mdata, unsigned int uid) |
| Delete an item from the header cache. | |
| int | imap_hcache_store_uid_seqset (struct ImapMboxData *mdata) |
| Store a UID Sequence Set in the header cache. | |
| int | imap_hcache_clear_uid_seqset (struct ImapMboxData *mdata) |
| Delete a UID Sequence Set from the header cache. | |
| char * | imap_hcache_get_uid_seqset (struct ImapMboxData *mdata) |
| Get a UID Sequence Set from the header cache. | |
| enum QuadOption | imap_continue (const char *msg, const char *resp) |
| Display a message and ask the user if they want to go on. | |
| void | imap_error (const char *where, const char *msg) |
| Show an error and abort. | |
| void | imap_mdata_cache_reset (struct ImapMboxData *mdata) |
| Release and clear cache data of ImapMboxData structure. | |
| char * | imap_fix_path (const char *mailbox, char *path, size_t plen) |
| Fix up the imap path. | |
| char * | imap_fix_path_with_delim (char delim, const char *mailbox, char *path, size_t plen) |
| Fix up the imap path. | |
| void | imap_cachepath (char delim, const char *mailbox, struct Buffer *dest) |
| Generate a cache path for a mailbox. | |
| int | imap_get_literal_count (char *buf, unsigned int *bytes) |
| Write number of bytes in an IMAP literal into bytes. | |
| char * | imap_get_qualifier (char *buf) |
| Get the qualifier from a tagged response. | |
| char * | imap_next_word (char *s) |
| Find where the next IMAP word begins. | |
| void | imap_qualify_path (char *buf, size_t buflen, struct ConnAccount *conn_account, char *path) |
| Make an absolute IMAP folder target. | |
| void | imap_buf_qualify_path (struct Buffer *buf, struct ConnAccount *conn_account, char *path) |
| Make an absolute IMAP folder target to a buffer. | |
| void | imap_quote_string (char *dest, size_t dlen, const char *src, bool quote_backtick) |
| Quote string according to IMAP rules. | |
| void | imap_unquote_string (char *s) |
| Equally stupid unquoting routine. | |
| void | imap_munge_mbox_name (bool unicode, char *dest, size_t dlen, const char *src) |
| Quote awkward characters in a mailbox name. | |
| void | imap_unmunge_mbox_name (bool unicode, char *s) |
| Remove quoting from a mailbox name. | |
| struct SeqsetIterator * | mutt_seqset_iterator_new (const char *seqset) |
| Create a new Sequence Set Iterator. | |
| int | mutt_seqset_iterator_next (struct SeqsetIterator *iter, unsigned int *next) |
| Get the next UID from a Sequence Set. | |
| void | mutt_seqset_iterator_free (struct SeqsetIterator **ptr) |
| Free a Sequence Set Iterator. | |
| bool | imap_account_match (const struct ConnAccount *a1, const struct ConnAccount *a2) |
| Compare two Accounts. | |
| void | imap_get_parent (const char *mbox, char delim, char *buf, size_t buflen) |
| Get an IMAP folder's parent. | |
| bool | mutt_account_match (const struct ConnAccount *a1, const struct ConnAccount *a2) |
| void | imap_utf_encode (bool unicode, char **s) |
| Encode email from local charset to UTF-8. | |
| void | imap_utf_decode (bool unicode, char **s) |
| Decode email from UTF-8 to local charset. | |
| void | imap_allow_reopen (struct Mailbox *m) |
| Allow re-opening a folder upon expunge. | |
| void | imap_disallow_reopen (struct Mailbox *m) |
| Disallow re-opening a folder upon expunge. | |
| void | cmd_parse_search (struct ImapAccountData *adata, const char *s) |
| Store SEARCH response for later use. | |
Shared constants/structs that are private to IMAP.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file private.h.
| #define IMAP_RES_NEW 3 |
ImapCommand.state additions.
| #define IMAP_DATELEN 27 |
| typedef uint8_t ImapOpenFlags |
| typedef uint8_t ImapCmdFlags |
| typedef uint32_t ImapCapFlags |
| enum ImapOpenFlag |
State flags for IMAP mailbox reopen and sync handling.
Definition at line 65 of file private.h.
| enum ImapCmdFlag |
Flags for imap_exec(), e.g.
| Enumerator | |
|---|---|
| IMAP_CMD_NONE | No flags are set. |
| IMAP_CMD_PASS | Command contains a password. Suppress logging. |
| IMAP_CMD_QUEUE | Queue a command, do not execute. |
| IMAP_CMD_POLL | Poll the tcp connection before running the imap command. |
| IMAP_CMD_SINGLE | Run a single command. |
Definition at line 80 of file private.h.
| enum ImapExecResult |
Imap_exec return code.
| Enumerator | |
|---|---|
| IMAP_EXEC_SUCCESS | Imap command executed or queued successfully. |
| IMAP_EXEC_ERROR | Imap command failure. |
| IMAP_EXEC_FATAL | Imap connection failure. |
Definition at line 93 of file private.h.
| enum ImapFlags |
IMAP server responses.
| Enumerator | |
|---|---|
| IMAP_FATAL | Unrecoverable error occurred. |
| IMAP_BYE | Logged out from server. |
| enum ImapState |
IMAP connection state.
| Enumerator | |
|---|---|
| IMAP_DISCONNECTED | Disconnected from server. |
| IMAP_CONNECTED | Connected to server. |
| IMAP_AUTHENTICATED | Connection is authenticated. |
| IMAP_SELECTED | Mailbox is selected. |
| IMAP_IDLE | Connection is idle. |
Definition at line 115 of file private.h.
| enum ImapCapFlag |
Capabilities we are interested in.
| Enumerator | |
|---|---|
| IMAP_CAP_NONE | No flags are set. |
| IMAP_CAP_IMAP4 | Server supports IMAP4. |
| IMAP_CAP_IMAP4REV1 | Server supports IMAP4rev1. |
| IMAP_CAP_STATUS | Server supports STATUS command. |
| IMAP_CAP_ACL | RFC2086: IMAP4 ACL extension. |
| IMAP_CAP_NAMESPACE | RFC2342: IMAP4 Namespace. |
| IMAP_CAP_AUTH_CRAM_MD5 | RFC2195: CRAM-MD5 authentication. |
| IMAP_CAP_AUTH_GSSAPI | RFC1731: GSSAPI authentication. |
| IMAP_CAP_AUTH_ANONYMOUS | AUTH=ANONYMOUS. |
| IMAP_CAP_AUTH_OAUTHBEARER | RFC7628: AUTH=OAUTHBEARER. |
| IMAP_CAP_AUTH_XOAUTH2 | AUTH=XOAUTH2, deprecated but used by OWA. |
| IMAP_CAP_STARTTLS | RFC2595: STARTTLS. |
| IMAP_CAP_LOGINDISABLED | RFC2595: LOGINDISABLED. |
| IMAP_CAP_IDLE | RFC2177: IDLE. |
| IMAP_CAP_SASL_IR | SASL initial response draft. |
| IMAP_CAP_ENABLE | RFC5161. |
| IMAP_CAP_CONDSTORE | RFC7162. |
| IMAP_CAP_QRESYNC | RFC7162. |
| IMAP_CAP_LIST_EXTENDED | RFC5258: IMAP4 LIST Command Extensions. |
| IMAP_CAP_COMPRESS | RFC4978: COMPRESS=DEFLATE. |
| IMAP_CAP_X_GM_EXT_1 | |
| IMAP_CAP_ID | RFC2971: IMAP4 ID extension. |
Definition at line 132 of file private.h.
| int imap_create_mailbox | ( | struct ImapAccountData * | adata, |
| const char * | mailbox ) |
Create a new mailbox.
| 0 | Success |
| -1 | Failure |
Definition at line 542 of file imap.c.
| int imap_rename_mailbox | ( | struct ImapAccountData * | adata, |
| char * | oldname, | ||
| const char * | newname ) |
Rename a mailbox.
| adata | Imap Account data |
| oldname | Existing mailbox |
| newname | New name for mailbox |
| 0 | Success |
| -1 | Failure |
Definition at line 584 of file imap.c.
| int imap_open_connection | ( | struct ImapAccountData * | adata | ) |
Open an IMAP connection.
| adata | Imap Account data |
| 0 | Success |
| -1 | Failure |
Definition at line 921 of file imap.c.
| void imap_close_connection | ( | struct ImapAccountData * | adata | ) |
Close an IMAP connection.
| adata | Imap Account data |
Definition at line 1029 of file imap.c.
| int imap_read_literal | ( | FILE * | fp, |
| struct ImapAccountData * | adata, | ||
| unsigned long | bytes, | ||
| struct Progress * | progress ) |
Read bytes bytes from server into file.
| fp | File handle for email file |
| adata | Imap Account data |
| bytes | Number of bytes to read |
| progress | Progress bar |
| 0 | Success |
| -1 | Failure |
Not explicitly buffered, relies on FILE buffering.
Definition at line 704 of file imap.c.
| void imap_expunge_mailbox | ( | struct Mailbox * | m, |
| bool | resort ) |
Purge messages from the server.
| m | Mailbox |
| resort | Trigger a resort? |
Purge IMAP portion of expunged messages from the context. Must not be done while something has a handle on any headers (eg inside pager or editor). That is, check IMAP_REOPEN_ALLOW.
Definition at line 849 of file imap.c.
| int imap_login | ( | struct ImapAccountData * | adata | ) |
Open an IMAP connection.
| adata | Imap Account data |
| 0 | Success |
| -1 | Failure |
Ensure ImapAccountData is connected and logged into the imap server.
Definition at line 2013 of file imap.c.
| int imap_sync_message_for_copy | ( | struct Mailbox * | m, |
| struct Email * | e, | ||
| struct Buffer * | cmd, | ||
| enum QuadOption * | err_continue ) |
Update server to reflect the flags of a single message.
| [in] | m | Mailbox |
| [in] | e | |
| [in] | cmd | Buffer for the command string |
| [out] | err_continue | Did the user force a continue? |
| 0 | Success |
| -1 | Failure |
Update the IMAP server to reflect the flags for a single message before performing a "UID COPY".
Definition at line 1114 of file imap.c.
| bool imap_has_flag | ( | struct ListHead * | flag_list, |
| const char * | flag ) |
Does the flag exist in the list.
| flag_list | List of server flags |
| flag | Flag to find |
| true | Flag exists |
Do a caseless comparison of the flag against a flag list, return true if found or flag list has '*'. Note that "flag" might contain additional whitespace at the end, so we really need to compare up to the length of each element in "flag_list".
Definition at line 1054 of file imap.c.
| int imap_adata_find | ( | const char * | path, |
| struct ImapAccountData ** | adata, | ||
| struct ImapMboxData ** | mdata ) |
Find the Account data for this path.
| 0 | Success |
| -1 | Failure |
Definition at line 73 of file util.c.
| int imap_reopen_mailbox | ( | struct ImapAccountData * | adata | ) |
Re-SELECT the current mailbox after reconnecting.
| adata | Imap Account data (must be in IMAP_AUTHENTICATED state) |
| 0 | Success |
| -1 | Failure |
After a connection drop and successful reconnect, re-SELECT the previously open mailbox, clear stale message state, and re-fetch all headers so the index is repopulated. This avoids the destructive mx_fastclose_mailbox() path that used to leave the user with an empty screen.
Definition at line 2263 of file imap.c.
| int imap_authenticate | ( | struct ImapAccountData * | adata | ) |
Authenticate to an IMAP server.
| adata | Imap Account data |
| enum | ImapAuthRes, e.g. IMAP_AUTH_SUCCESS |
Attempt to authenticate using either user-specified authentication method if specified, or any.
Definition at line 116 of file auth.c.
| int imap_cmd_start | ( | struct ImapAccountData * | adata, |
| const char * | cmdstr ) |
Given an IMAP command, send it to the server.
| 0 | Success |
| <0 | Failure, e.g. IMAP_RES_BAD |
If cmdstr is NULL, sends queued commands.
Definition at line 1216 of file command.c.
| int imap_cmd_step | ( | struct ImapAccountData * | adata | ) |
Reads server responses from an IMAP command.
| adata | Imap Account data |
| 0 | Success |
| <0 | Failure, e.g. IMAP_RES_BAD |
detects tagged completion response, handles untagged messages, can read arbitrarily large strings (using malloc, so don't make it too large!).
Definition at line 1230 of file command.c.
| void imap_cmd_finish | ( | struct ImapAccountData * | adata | ) |
Attempt to perform cleanup.
| adata | Imap Account data |
If a reopen is allowed, it attempts to perform cleanup (eg fetch new mail if detected, do expunge). Called automatically by imap_cmd_step(), but may be called at any time.
mdata->check_status is set and will be used later by imap_check_mailbox().
Definition at line 1511 of file command.c.
| bool imap_code | ( | const char * | s | ) |
| const char * imap_cmd_trailer | ( | struct ImapAccountData * | adata | ) |
Extra information after tagged command response if any.
| adata | Imap Account data |
| ptr | Extra command information (pointer into adata->buf) |
| "" | Error (static string) |
Definition at line 1383 of file command.c.
| int imap_exec | ( | struct ImapAccountData * | adata, |
| const char * | cmdstr, | ||
| ImapCmdFlags | flags ) |
Execute a command and wait for the response from the server.
| adata | Imap Account data |
| cmdstr | Command to execute |
| flags | Flags, see ImapCmdFlags |
| IMAP_EXEC_SUCCESS | Command successful or queued |
| IMAP_EXEC_ERROR | Command returned an error |
| IMAP_EXEC_FATAL | Imap connection failure |
Also, handle untagged responses.
Definition at line 1420 of file command.c.
| int imap_cmd_idle | ( | struct ImapAccountData * | adata | ) |
Enter the IDLE state.
| adata | Imap Account data |
| 0 | Success |
| <0 | Failure, e.g. IMAP_RES_BAD |
Definition at line 1586 of file command.c.
| int imap_read_headers | ( | struct Mailbox * | m, |
| unsigned int | msn_begin, | ||
| unsigned int | msn_end, | ||
| bool | initial_download ) |
Read headers from the server.
| m | Imap Selected Mailbox |
| msn_begin | First Message Sequence Number |
| msn_end | Last Message Sequence Number |
| initial_download | true, if this is the first opening of the mailbox |
| num | Last MSN |
| -1 | Failure |
Changed to read many headers instead of just one. It will return the msn of the last message read. It will return a value other than msn_end if mail comes in while downloading headers (in theory).
Definition at line 1370 of file message.c.
Fill the message header according to the server flags.
| [in] | m | Imap Selected Mailbox |
| [in] | e | |
| [in] | s | Command string |
| [out] | server_changes | Set to true if the flags have changed |
| ptr | The end of flags string |
| NULL | Failure |
Expects a flags line of the form "FLAGS (flag flag ...)"
imap_set_flags: fill out the message header according to the flags from the server. Expects a flags line of the form "FLAGS (flag flag ...)"
Sets server_changes to 1 if a change to a flag is made, or in the case of e->changed, if a change to a flag would have been made.
Definition at line 1958 of file message.c.
Delete an email from the body cache.
| 0 | Success |
| -1 | Failure |
Definition at line 1907 of file message.c.
| int imap_cache_clean | ( | struct Mailbox * | m | ) |
Delete all the entries in the message cache.
| m | SelectedImap Mailbox |
| 0 | Always |
Definition at line 1926 of file message.c.
Write an email back to the server.
| 0 | Success |
| -1 | Failure |
Definition at line 1559 of file message.c.
| void imap_hcache_open | ( | struct ImapAccountData * | adata, |
| struct ImapMboxData * | mdata, | ||
| bool | create ) |
Open a header cache.
| adata | Imap Account data |
| mdata | Imap Mailbox data |
| create | Create a new header cache if missing? |
Definition at line 310 of file util.c.
| void imap_hcache_close | ( | struct ImapMboxData * | mdata | ) |
Close the header cache.
| mdata | Imap Mailbox data |
Definition at line 351 of file util.c.
| struct Email * imap_hcache_get | ( | struct ImapMboxData * | mdata, |
| unsigned int | uid ) |
Get a header cache entry by its UID.
| mdata | Imap Mailbox data |
| uid | UID to find |
| ptr | |
| NULL | Failure |
Definition at line 366 of file util.c.
| int imap_hcache_put | ( | struct ImapMboxData * | mdata, |
| struct Email * | e ) |
Add an entry to the header cache.
| 0 | Success |
| -1 | Failure |
Definition at line 391 of file util.c.
| int imap_hcache_del | ( | struct ImapMboxData * | mdata, |
| unsigned int | uid ) |
Delete an item from the header cache.
| mdata | Imap Mailbox data |
| uid | UID of entry to delete |
| 0 | Success |
| -1 | Failure |
Definition at line 409 of file util.c.
| int imap_hcache_store_uid_seqset | ( | struct ImapMboxData * | mdata | ) |
Store a UID Sequence Set in the header cache.
| mdata | Imap Mailbox data |
| 0 | Success |
| -1 | Error |
Definition at line 426 of file util.c.
| int imap_hcache_clear_uid_seqset | ( | struct ImapMboxData * | mdata | ) |
| char * imap_hcache_get_uid_seqset | ( | struct ImapMboxData * | mdata | ) |
Get a UID Sequence Set from the header cache.
| mdata | Imap Mailbox data |
| ptr | UID Sequence Set |
| NULL | Error |
Definition at line 461 of file util.c.
| enum QuadOption imap_continue | ( | const char * | msg, |
| const char * | resp ) |
Display a message and ask the user if they want to go on.
| msg | Location of the error |
| resp | Message for user |
| QuadOption | Result, e.g. MUTT_NO |
Definition at line 657 of file util.c.
| void imap_error | ( | const char * | where, |
| const char * | msg ) |
| void imap_mdata_cache_reset | ( | struct ImapMboxData * | mdata | ) |
Release and clear cache data of ImapMboxData structure.
| mdata | Imap Mailbox data |
Definition at line 111 of file util.c.
| char * imap_fix_path | ( | const char * | mailbox, |
| char * | path, | ||
| size_t | plen ) |
Fix up the imap path.
| ptr | Fixed-up path |
This is necessary because the rest of neomutt assumes a hierarchy delimiter of '/', which is not necessarily true in IMAP. Additionally, the filesystem converts multiple hierarchy delimiters into a single one, ie "///" is equal to "/". IMAP servers are not required to do this. Moreover, IMAP servers may dislike the path ending with the delimiter.
Definition at line 689 of file util.c.
| char * imap_fix_path_with_delim | ( | const char | delim, |
| const char * | mailbox, | ||
| char * | path, | ||
| size_t | plen ) |
Fix up the imap path.
| delim | Delimiter specified by the server |
| mailbox | Mailbox path |
| path | Buffer for the result |
| plen | Length of buffer |
| ptr | Fixed-up path |
Definition at line 720 of file util.c.
| void imap_cachepath | ( | char | delim, |
| const char * | mailbox, | ||
| struct Buffer * | dest ) |
Generate a cache path for a mailbox.
Definition at line 756 of file util.c.
| int imap_get_literal_count | ( | char * | buf, |
| unsigned int * | bytes ) |
Write number of bytes in an IMAP literal into bytes.
| [in] | buf | Number as a string |
| [out] | bytes | Resulting number |
| 0 | Success |
| -1 | Failure |
Definition at line 787 of file util.c.
| char * imap_get_qualifier | ( | char * | buf | ) |
Get the qualifier from a tagged response.
| buf | Command string to process |
| ptr | Start of the qualifier |
In a tagged response, skip tag and status for the qualifier message. Used by imap_copy_message for TRYCREATE
Definition at line 814 of file util.c.
| char * imap_next_word | ( | char * | s | ) |
Find where the next IMAP word begins.
| s | Command string to process |
| ptr | Next IMAP word |
Definition at line 831 of file util.c.
| void imap_qualify_path | ( | char * | buf, |
| size_t | buflen, | ||
| struct ConnAccount * | cac, | ||
| char * | path ) |
Make an absolute IMAP folder target.
| buf | Buffer for the result |
| buflen | Length of buffer |
| cac | ConnAccount of the account |
| path | Path relative to the mailbox |
Definition at line 862 of file util.c.
| void imap_buf_qualify_path | ( | struct Buffer * | buf, |
| struct ConnAccount * | cac, | ||
| char * | path ) |
Make an absolute IMAP folder target to a buffer.
| buf | Buffer for the result |
| cac | ConnAccount of the account |
| path | Path relative to the mailbox |
Definition at line 876 of file util.c.
| void imap_quote_string | ( | char * | dest, |
| size_t | dlen, | ||
| const char * | src, | ||
| bool | quote_backtick ) |
Quote string according to IMAP rules.
| dest | Buffer for the result |
| dlen | Length of the buffer |
| src | String to be quoted |
| quote_backtick | If true, quote backticks too |
Surround string with quotes, escape " and \ with backslash
Definition at line 893 of file util.c.
| void imap_unquote_string | ( | char * | s | ) |
Equally stupid unquoting routine.
| s | String to be unquoted |
Definition at line 936 of file util.c.
| void imap_munge_mbox_name | ( | bool | unicode, |
| char * | dest, | ||
| size_t | dlen, | ||
| const char * | src ) |
Quote awkward characters in a mailbox name.
| unicode | true if Unicode is allowed |
| dest | Buffer to store safe mailbox name |
| dlen | Length of buffer |
| src | Mailbox name |
Definition at line 973 of file util.c.
| void imap_unmunge_mbox_name | ( | bool | unicode, |
| char * | s ) |
Remove quoting from a mailbox name.
| unicode | true if Unicode is allowed |
| s | Mailbox name |
The string will be altered in-place.
Definition at line 990 of file util.c.
| struct SeqsetIterator * mutt_seqset_iterator_new | ( | const char * | seqset | ) |
Create a new Sequence Set Iterator.
| seqset | Source Sequence Set |
| ptr | Newly allocated Sequence Set Iterator |
Definition at line 1140 of file util.c.
| int mutt_seqset_iterator_next | ( | struct SeqsetIterator * | iter, |
| unsigned int * | next ) |
Get the next UID from a Sequence Set.
| [in] | iter | Sequence Set Iterator |
| [out] | next | Next UID in set |
| 0 | Next sequence is generated |
| 1 | Iterator is finished |
| -1 | error |
Definition at line 1161 of file util.c.
| void mutt_seqset_iterator_free | ( | struct SeqsetIterator ** | ptr | ) |
| bool imap_account_match | ( | const struct ConnAccount * | a1, |
| const struct ConnAccount * | a2 ) |
Compare two Accounts.
| a1 | First ConnAccount |
| a2 | Second ConnAccount |
| true | Accounts match |
Definition at line 1108 of file util.c.
| void imap_get_parent | ( | const char * | mbox, |
| char | delim, | ||
| char * | buf, | ||
| size_t | buflen ) |
Get an IMAP folder's parent.
| mbox | Mailbox whose parent is to be determined |
| delim | Path delimiter |
| buf | Buffer for the result |
| buflen | Length of the buffer |
Definition at line 127 of file util.c.
| bool mutt_account_match | ( | const struct ConnAccount * | a1, |
| const struct ConnAccount * | a2 ) |
| void imap_utf_encode | ( | bool | unicode, |
| char ** | s ) |
Encode email from local charset to UTF-8.
| [in] | unicode | true if Unicode is allowed |
| [out] | s | Email to convert |
Definition at line 401 of file utf7.c.
| void imap_utf_decode | ( | bool | unicode, |
| char ** | s ) |
Decode email from UTF-8 to local charset.
| [in] | unicode | true if Unicode is allowed |
| [out] | s | Email to convert |
Definition at line 434 of file utf7.c.
| void imap_allow_reopen | ( | struct Mailbox * | m | ) |
| void imap_disallow_reopen | ( | struct Mailbox * | m | ) |
| void cmd_parse_search | ( | struct ImapAccountData * | adata, |
| const char * | s ) |
Store SEARCH response for later use.
Definition at line 262 of file search.c.