-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6f94fd
commit 6f192d2
Showing
17 changed files
with
237 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from sage_imap.exceptions import IMAPMailboxSelectionError as IMAPMailboxSelectionError | ||
|
||
def mailbox_selection_required(func): ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
from _typeshed import Incomplete | ||
from enum import StrEnum | ||
|
||
logger: Incomplete | ||
|
||
class Flag(StrEnum): | ||
SEEN: str | ||
ANSWERED: str | ||
FLAGGED: str | ||
DELETED: str | ||
DRAFT: str | ||
RECENT: str | ||
|
||
class FlagCommand(StrEnum): | ||
ADD: str | ||
REMOVE: str | ||
|
||
class Priority(StrEnum): | ||
HIGH: str | ||
NORMAL: str | ||
LOW: str | ||
|
||
class SpamResult(StrEnum): | ||
DEFAULT: str | ||
SPAM: str | ||
NOT_SPAM: str | ||
|
||
class AutoResponseSuppress(StrEnum): | ||
ALL: str | ||
DR: str | ||
NDN: str | ||
RN: str | ||
NRN: str | ||
OOF: str | ||
AutoReply: str | ||
|
||
class ContentType(StrEnum): | ||
PLAIN: str | ||
HTML: str | ||
MULTIPART: str | ||
|
||
class ContentTransferEncoding(StrEnum): | ||
SEVEN_BIT: str | ||
BASE64: str | ||
QUOTED_PRINTABLE: str | ||
|
||
class DefaultMailboxes(StrEnum): | ||
INBOX: str | ||
SENT: str | ||
DRAFTS: str | ||
TRASH: str | ||
SPAM: str | ||
ARCHIVE: str | ||
|
||
class MailboxStatusItems(StrEnum): | ||
MESSAGES: str | ||
RECENT: str | ||
UIDNEXT: str | ||
UIDVALIDITY: str | ||
UNSEEN: str | ||
|
||
class MessagePart(StrEnum): | ||
RFC822: str | ||
BODY: str | ||
BODY_TEXT: str | ||
BODY_HEADER: str | ||
BODY_HEADER_FIELDS: str | ||
FLAGS: str | ||
MODSEQ: str | ||
BODY_STRUCTURE: str | ||
BODY_PEEK: str | ||
BODY_PEEK_TEXT: str | ||
BODY_PEEK_HEADER: str | ||
BODY_PEEK_HEADER_FIELDS: str | ||
BODY_PEEK_ATTACHMENT: str | ||
|
||
class ThreadingAlgorithm(StrEnum): | ||
REFERENCES: str | ||
ORDEREDSUBJECT: str | ||
THREAD: str | ||
SEQUENCE: str |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
from _typeshed import Incomplete | ||
|
||
MessageId = str | int | ||
MessageIDList = list[MessageId] | ||
MessageSetType = str | MessageIDList | ||
EmailDate: Incomplete | ||
EmailHeaders = dict[str, str] | ||
EmailAddress: Incomplete | ||
RawEmail: Incomplete | ||
Mailbox: Incomplete |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import email | ||
from _typeshed import Incomplete | ||
from dataclasses import dataclass | ||
from sage_imap.helpers.enums import Flag as Flag | ||
from sage_imap.helpers.typings import EmailAddress as EmailAddress, EmailDate as EmailDate | ||
from typing import Any, Callable | ||
|
||
logger: Incomplete | ||
|
||
@dataclass | ||
class Attachment: | ||
filename: str | ||
content_type: str | ||
payload: bytes = ... | ||
id: str | None = ... | ||
content_id: str | None = ... | ||
content_transfer_encoding: str | None = ... | ||
def __init__(self, filename, content_type, payload, id=..., content_id=..., content_transfer_encoding=...) -> None: ... | ||
|
||
@dataclass | ||
class EmailMessage: | ||
message_id: str = ... | ||
subject: str = ... | ||
from_address: EmailAddress | None = ... | ||
to_address: list[EmailAddress] = ... | ||
cc_address: list[EmailAddress] = ... | ||
bcc_address: list[EmailAddress] = ... | ||
date: EmailDate | None = ... | ||
raw: bytes | None = ... | ||
plain_body: str = ... | ||
html_body: str = ... | ||
attachments: list[Attachment] = ... | ||
flags: list[Flag] = ... | ||
headers: dict[str, Any] = ... | ||
size: int = ... | ||
sequence_number: int | None = ... | ||
uid: int | None = ... | ||
def __post_init__(self) -> None: ... | ||
@classmethod | ||
def read_from_eml_file(cls, file_path: str) -> EmailMessage: ... | ||
@classmethod | ||
def read_from_eml_bytes(cls, eml_bytes: bytes) -> EmailMessage: ... | ||
def parse_eml_content(self) -> None: ... | ||
def sanitize_message_id(self, message_id: str) -> str | None: ... | ||
def parse_date(self, date_str: str | None) -> EmailDate | None: ... | ||
def extract_body(self, message: email.message.EmailMessage) -> tuple[str, str]: ... | ||
def extract_attachments(self, message: email.message.EmailMessage) -> list[Attachment]: ... | ||
@staticmethod | ||
def extract_flags(flag_data: bytes) -> list[Flag]: ... | ||
def decode_payload(self, part: email.message.EmailMessage) -> str: ... | ||
def has_attachments(self) -> bool: ... | ||
def get_attachment_filenames(self) -> list[str]: ... | ||
def write_to_eml_file(self, file_path: str) -> None: ... | ||
def __init__(self, message_id, subject=..., from_address=..., to_address=..., cc_address=..., bcc_address=..., date=..., raw=..., plain_body=..., html_body=..., attachments=..., flags=..., headers=..., size=..., sequence_number=..., uid=...) -> None: ... | ||
|
||
class EmailIterator: | ||
def __init__(self, email_list: list[EmailMessage]) -> None: ... | ||
def __iter__(self) -> EmailIterator: ... | ||
def __next__(self) -> EmailMessage: ... | ||
def __getitem__(self, index: int | slice) -> EmailMessage | EmailIterator: ... | ||
def __len__(self) -> int: ... | ||
def reset(self) -> None: ... | ||
def current_position(self) -> int: ... | ||
def __reversed__(self) -> EmailIterator: ... | ||
def __contains__(self, item: EmailMessage) -> bool: ... | ||
def count(self, condition: Callable[[EmailMessage], bool]) -> int: ... | ||
def filter(self, criteria: Callable[[EmailMessage], bool]) -> EmailIterator: ... | ||
def filter_by_header(self, key: str) -> EmailIterator: ... | ||
def filter_by_subject_part(self, part: str) -> EmailIterator: ... | ||
def find_by_message_id(self, message_id: str) -> EmailMessage | None: ... | ||
def filter_by_attachment(self) -> EmailIterator: ... | ||
def get_total_size(self) -> int: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from dataclasses import dataclass | ||
from enum import StrEnum as StrEnum | ||
from sage_imap.helpers.typings import MessageSetType as MessageSetType | ||
|
||
@dataclass | ||
class MessageSet: | ||
msg_ids: MessageSetType = ... | ||
def __post_init__(self) -> None: ... | ||
def __init__(self, msg_ids=...) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from .client import IMAPClient as IMAPClient | ||
from .flag import IMAPFlagService as IMAPFlagService | ||
from .folder import IMAPFolderService as IMAPFolderService | ||
from .mailbox import IMAPMailboxService as IMAPMailboxService | ||
from .mailbox import IMAPMailboxService as IMAPMailboxService, IMAPMailboxUIDService as IMAPMailboxUIDService |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
from _typeshed import Incomplete | ||
from sage_imap.exceptions import IMAPFlagOperationError as IMAPFlagOperationError | ||
from sage_imap.helpers.flags import FlagCommand as FlagCommand, Flags as Flags | ||
from sage_imap.helpers.enums import Flag as Flag, FlagCommand as FlagCommand | ||
from sage_imap.models.message import MessageSet as MessageSet | ||
|
||
logger: Incomplete | ||
|
||
class IMAPFlagService: | ||
mailbox: Incomplete | ||
def __init__(self, mailbox: IMAPMailboxService) -> None: ... | ||
def add_flag(self, msg_ids: MessageSet, flag: Flags) -> None: ... | ||
def remove_flag(self, msg_ids: MessageSet, flag: Flags) -> None: ... | ||
def add_flag(self, msg_ids: MessageSet, flag: Flag) -> None: ... | ||
def remove_flag(self, msg_ids: MessageSet, flag: Flag) -> None: ... |
Oops, something went wrong.