Module imap

Source
Expand description

Β§IMAP handling module.

uses async-email/async-imap to implement connect, fetch, delete functionality with standard IMAP servers.

ModulesΒ§

capabilities πŸ”’
IMAP capabilities
client πŸ”’
idle πŸ”’
scan_folders
select_folder
IMAP folder selection module.
session πŸ”’

StructsΒ§

Imap πŸ”’
OAuth2 πŸ”’
ServerMetadata πŸ”’
UidGrouper πŸ”’
UidRange πŸ”’

EnumsΒ§

FolderMeaning

ConstantsΒ§

BODY_FULL πŸ”’
BODY_PARTIAL πŸ”’
GENERATED_PREFIX πŸ”’
RFC724MID_UID πŸ”’

FunctionsΒ§

add_all_recipients_as_contacts πŸ”’
build_sequence_sets πŸ”’
Builds a list of sequence/uid sets. The returned sets have each no more than around 1000 characters because according to https://tools.ietf.org/html/rfc2683#section-3.2.1.5 command lines should not be much more than 1000 chars (servers should allow at least 8000 chars)
create_message_id πŸ”’
format_setmetadata πŸ”’
get_config_last_seen_uid
Deprecated, use get_uid_next() and get_uidvalidity()
get_fetch_headers πŸ”’
Parses the headers from the FETCH result.
get_folder_meaning πŸ”’
get_folder_meaning_by_attrs πŸ”’
get_folder_meaning_by_name πŸ”’
Try to get the folder meaning by the name of the folder only used if the server does not support XLIST.
get_imap_self_sent_search_command πŸ”’
Compute the imap search expression for all self-sent mails (for all self addresses)
get_modseq πŸ”’
get_uid_next πŸ”’
uid_next is the next unique identifier value from the last time we fetched a folder See https://tools.ietf.org/html/rfc3501#section-2.3.1.1 This method returns the uid_next from the last time we fetched messages. We can compare this to the current uid_next to find out whether there are new messages and fetch from this value on to get all new messages.
get_uidvalidity πŸ”’
is_dup_msg πŸ”’
Returns whether a message is a duplicate (resent message).
mark_seen_by_uid πŸ”’
Marks messages in msgs table as seen, searching for them by UID.
markseen_on_imap_table πŸ”’
Schedule marking the message as Seen on IMAP by adding all known IMAP messages corresponding to the given Message-ID to imap_markseen table.
needs_move_to_mvbox πŸ”’
prefetch_get_chat πŸ”’
Returns chat by prefetched headers.
prefetch_get_message_id πŸ”’
prefetch_should_download πŸ”’
Determines whether the message should be downloaded based on prefetched headers.
set_modseq πŸ”’
set_uid_next πŸ”’
uid_next is the next unique identifier value from the last time we fetched a folder See https://tools.ietf.org/html/rfc3501#section-2.3.1.1 This function is used to update our uid_next after fetching messages.
set_uidvalidity πŸ”’
should_ignore_folder πŸ”’
Whether to ignore fetching messages from a folder.
should_move_out_of_spam πŸ”’
spam_target_folder_cfg πŸ”’
Returns target folder for a message found in the Spam folder. If this returns None, the message will not be moved out of the Spam folder, and as fetch_new_messages() doesn’t download messages from the Spam folder, the message will be ignored.
target_folder
target_folder_cfg
Returns ConfiguredInboxFolder, ConfiguredMvboxFolder or ConfiguredSentboxFolder if the message needs to be moved from folder. Otherwise returns None.