Mail Module Reference
New in version 0.0.4.
Control the macOS Mail application using JXA-like syntax.
Classes:
| 
 | A class for managing and interacting with accounts in Mail.app. | 
| 
 | A wrapper around lists of mail accounts that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with Mail.app. | 
| 
 | A class for managing and interacting with message attachments in Mail.app. | 
| 
 | A wrapper around lists of attachments that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with BCC recipients in Mail.app. | 
| 
 | A wrapper around lists of mail Bcc recipients that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with CC recipients in Mail.app. | 
| 
 | A wrapper around lists of mail Cc recipients that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with containers in Mail.app. | 
| 
 | A wrapper around lists of mail headers that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with Mail documents. | 
| 
 | A wrapper around lists of mail documents that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with message headers in Mail.app. | 
| 
 | A wrapper around lists of mail headers that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with iCloud accounts in Mail.app. | 
| 
 | A wrapper around lists of iCloud accounts that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with IMAP accounts in Mail.app. | 
| 
 | A wrapper around lists of mail documents that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with messages in Mail.app. | 
| 
 | A wrapper around lists of messages that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with the message viewer window in Mail.app. | 
| 
 | A wrapper around lists of mail signatures that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with outgoing messages in Mail.app. | 
| 
 | A wrapper around lists of outgoing messages that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with POP accounts in Mail.app. | 
| 
 | A wrapper around lists of mail documents that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with recipients in Mail.app. | 
| 
 | A wrapper around lists of mail recipients that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with rules in Mail.app. | 
| 
 | A class for managing and interacting with rule conditions in Mail.app. | 
| 
 | A wrapper around lists of rule conditions that employs fast enumeration techniques. | 
| 
 | A wrapper around lists of rules that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with SMTP servers in Mail.app. | 
| 
 | A wrapper around lists of SMTP servers that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with email signatures in Mail.app. | 
| 
 | A wrapper around lists of mail signatures that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with the primary (to) recipients in Mail.app. | 
| 
 | A wrapper around lists of mail primary (to) recipients that employs fast enumeration techniques. | 
| 
 | A class for managing and interacting with Mail documents. | 
| 
 | A class for managing and interacting with mailboxes in Mail.app. | 
| 
 | A wrapper around lists of mailboxes that employs fast enumeration techniques. | 
- class PyXA.apps.Mail.XAMailAccount(properties)[source]
- Bases: - XAObject- A class for managing and interacting with accounts in Mail.app. - New in version 0.0.4. - Attributes: - The directory where the account stores items on the disk. - The type of the account, either: "pop", "smtp", "imap", or "iCloud". - he preferred authentication scheme for the account, either: "password", "apop", "kerberos 5", "ntlm", "md5", "external", "Apple token", or "none". - The delivery account use when sending messages from the account. - The list of email addresses associated with the account. - Number of days before junk messages are deleted (0 = delete on quit, -1 = never delete). - Whether messages marked as junk are deleted upon quitting Mail.app. - Number of days before messages in the trash are deleted (0 = delete on quit, -1 = never delete). - Whether messages in the trash are permanently deleted upon quitting Mail.app. - Whether the account is enabled. - The user's full name associated with the account. - The unique identifier for the account. - Whether messages are moved to the trash mailbox upon deletion. - The name of the account. - The password for the account. - The port used to connect to the account. - The host name used to connect to the account. - The user name used to connect to the account. - Whether SSL is enabled for this receiving account. - Methods: - mailboxes([filter])- Returns a list of mail accounts matching the filter. - property account_directory: str
- The directory where the account stores items on the disk. 
 - property account_type: AccountType
- The type of the account, either: “pop”, “smtp”, “imap”, or “iCloud”. 
 - property authentication: AuthenticationMethod
- he preferred authentication scheme for the account, either: “password”, “apop”, “kerberos 5”, “ntlm”, “md5”, “external”, “Apple token”, or “none”. 
 - property delivery_account: XAMailSMTPServer
- The delivery account use when sending messages from the account. 
 - property email_addresses: list[str]
- The list of email addresses associated with the account. 
 - property empty_junk_messages_frequency: int
- Number of days before junk messages are deleted (0 = delete on quit, -1 = never delete). 
 - property empty_junk_messages_on_quit: bool
- Whether messages marked as junk are deleted upon quitting Mail.app. 
 - property empty_trash_frequency: int
- Number of days before messages in the trash are deleted (0 = delete on quit, -1 = never delete). 
 - property empty_trash_on_quit: bool
- Whether messages in the trash are permanently deleted upon quitting Mail.app. 
 - property enabled: bool
- Whether the account is enabled. 
 - property full_name: str
- The user’s full name associated with the account. 
 - property id: str
- The unique identifier for the account. 
 - mailboxes(filter: dict | None = None) XAMailboxList[source]
- Returns a list of mail accounts matching the filter. - New in version 0.0.4. 
 - property move_deleted_messages_to_trash: bool
- Whether messages are moved to the trash mailbox upon deletion. 
 - property name: str
- The name of the account. 
 - property password: None
- The password for the account. 
 - property port: int
- The port used to connect to the account. 
 - property server_name: str
- The host name used to connect to the account. 
 - property user_name: str
- The user name used to connect to the account. 
 - property uses_ssl: bool
- Whether SSL is enabled for this receiving account. 
 
- class PyXA.apps.Mail.XAMailAccountList(properties: dict, filter: dict | None = None, object_class=None)[source]
- Bases: - XAList- A wrapper around lists of mail accounts that employs fast enumeration techniques. - All properties of accounts can be called as methods on the wrapped list, returning a list containing each account’s value for the property. - New in version 0.0.4. - Methods: - by_account_directory(account_directory)- by_account_type(account_type)- by_authentication(authentication)- by_delivery_account(delivery_account)- by_email_addresses(email_addresses)- by_empty_trash_frequency(empty_trash_frequency)- by_empty_trash_on_quit(empty_trash_on_quit)- by_enabled(enabled)- by_full_name(full_name)- by_id(id)- by_name(name)- by_port(port)- by_server_name(server_name)- by_user_name(user_name)- by_uses_ssl(uses_ssl)- enabled()- id()- name()- port()- uses_ssl()- account_type() list[AccountType][source]
 - authentication() list[AuthenticationMethod][source]
 - by_account_directory(account_directory: str) XAMailAccount | None[source]
 - by_account_type(account_type: AccountType) XAMailAccount | None[source]
 - by_authentication(authentication: AuthenticationMethod) XAMailAccount | None[source]
 - by_delivery_account(delivery_account: XAMailSMTPServer) XAMailAccount | None[source]
 - by_email_addresses(email_addresses: list[str]) XAMailAccount | None[source]
 - by_empty_junk_messages_frequency(empty_junk_messages_frequency: int) XAMailAccount | None[source]
 - by_empty_junk_messages_on_quit(empty_junk_messages_on_quit: bool) XAMailAccount | None[source]
 - by_empty_trash_frequency(empty_trash_frequency: int) XAMailAccount | None[source]
 - by_empty_trash_on_quit(empty_trash_on_quit: bool) XAMailAccount | None[source]
 - by_enabled(enabled: bool) XAMailAccount | None[source]
 - by_full_name(full_name: str) XAMailAccount | None[source]
 - by_id(id: str) XAMailAccount | None[source]
 - by_move_deleted_messages_to_trash(move_deleted_messages_to_trash: bool) XAMailAccount | None[source]
 - by_name(name: str) XAMailAccount | None[source]
 - by_port(port: int) XAMailAccount | None[source]
 - by_server_name(server_name: str) XAMailAccount | None[source]
 - by_user_name(user_name: str) XAMailAccount | None[source]
 - by_uses_ssl(uses_ssl: bool) XAMailAccount | None[source]
 - delivery_account() XAMailSMTPServerList[source]
 
- class PyXA.apps.Mail.XAMailApplication(properties)[source]
- Bases: - XASBApplication- A class for managing and interacting with Mail.app. - New in version 0.0.4. - Classes: - AccountType(value)- Options for Mail account types. - AuthenticationMethod(value)- Options for Mail account authentication methods. - CachingPolicy(value)- An enumeration. - Format(value)- Options for file and message formats. - HighlightColor(value)- Options for colors to use when highlighting text. - QuotingColor(value)- Options for colors to use when quoting text. - RuleQualifier(value)- Options for how Mail rules are qualified. - RuleType(value)- Types of rules in Mail.app. - ViewerColumn(value)- Columns in message viewer windows. - Methods: - accounts([filter])- Returns a list of mail accounts matching the filter. - check_for_new_mail(account)- imap_accounts([filter])- Returns a list of mail accounts matching the filter. - import_mailbox(file_path)- mailboxes([filter])- Returns a list of mail accounts matching the filter. - message_viewers([filter])- Returns a list of mail accounts matching the filter. - outgoing_messages([filter])- Returns a list of mail accounts matching the filter. - pop_accounts([filter])- Returns a list of mail accounts matching the filter. - rules([filter])- Returns a list of mail accounts matching the filter. - signatures([filter])- Returns a list of mail accounts matching the filter. - smtp_servers([filter])- Returns a list of mail accounts matching the filter. - synchronize(account)- Attributes: - Whether the user's email address will be included in the Bcc: field of composed messages. - Whether the user's email address will be included in the Cc: field of composed messages. - The build number of Mail.app. - The number of background activities currently running in Mail. - Whether spelling is checked automatically while composing messages. - Whether the user can choose a signature directly in a new compose window. - Whether quoted text should be colored. - The default format for messages being composed. - Whether images and attachments in HTML messages should be downloaded and displayed. - The top-level drafts mailbox. - Whether group addresses should be expanded when entered into the address fields of a new message. - The number of minutes between automatic fetches for new mail (-1 = use automatically determined interval). - Whether mail will automatically be fetched at a specific interval. - The name of the font used for plain text messages. - The font size for plain text messages. - Whether Mail is the active application. - Whether messages in conversations should be highlighted in the Mail viewer window when not grouped. - The top-level inbox. - Whether all text of the original message will be quoted or only text the user selects. - The top-level junk mailbox. - Color for quoted text with one level of indentation. - Color for quoted text with three levels of indentation. - Color for quoted text with two levels of indentation. - The name of the font for messages. - The font size for messages. - The name of the font for the message list. - The font size for the message list. - The name of the application. - The name of the sound that plays when new mail is received, or "None". - The top-level outbox. - The user's primary email address. - Whether the text of the original message should be included in replies. - Whether replies will be in the same text format as the message to which the user is replying. - The name of the currently selected signature (or "randomly", "sequentially", or "none"). - The list of messages currently selected by the user. - The top-level sent mailbox. - Whether sounds will be played for actions and events other than receiving email. - The top-level trash mailbox. - Whether a fixed-width font should be used for plain text messages. - The version number of Mail.app. - class AccountType(value)[source]
- Bases: - Enum- Options for Mail account types. - Attributes: - ICLOUD = 1702127988
 - IMAP = 1702127981
 - POP = 1702129775
 - SMTP = 1702130541
 - UNKNOWN = 1702131054
 
 - class AuthenticationMethod(value)[source]
- Bases: - Enum- Options for Mail account authentication methods. - Attributes: - APOP - Apple token - External authentication (TLS client certificate) - Kerberos V5 (GSSAPI) - CRAM-MD5 - None - NTLM - Clear text password - APOP = 1633775727
- APOP 
 - APPLE_TOKEN = 1635020651
- Apple token 
 - EXTERNAL = 1634039924
- External authentication (TLS client certificate) 
 - KERBEROS5 = 1635281717
- Kerberos V5 (GSSAPI) 
 - MD5 = 1635282276
- CRAM-MD5 
 - NONE = 1667460719
- None 
 - NTLM = 1635282548
- NTLM 
 - PASSWORD = 1635279732
- Clear text password 
 
 - class CachingPolicy(value)[source]
- Bases: - Enum- An enumeration. - Attributes: - All messages and their attachments - All messages but omit attachments - Do not use this option (deprecated). - Do not use this option (deprecated). - ALL_MESSAGES_AND_THEIR_ATTACHMENTS = 2017026412
- All messages and their attachments 
 - ALL_MESSAGES_BUT_OMIT_ATTACHMENTS = 2017026671
- All messages but omit attachments 
 - DO_NOT_KEEP_COPIES_OF_ANY_MESSAGES = 2017029743
- Do not use this option (deprecated). If you do, Mail will use the ‘all messages but omit attachments’ policy 
 - ONLY_MESSAGES_I_HAVE_READ = 2017032050
- Do not use this option (deprecated). If you do, Mail will use the ‘all messages but omit attachments’ policy 
 
 - class Format(value)[source]
- Bases: - Enum- Options for file and message formats. - Attributes: - NATIVE = 1769235821
 - PLAIN_MESSAGE = 1684893812
 - RICH_MESSAGE = 1684894324
 
 - class HighlightColor(value)[source]
- Bases: - Enum- Options for colors to use when highlighting text. - Attributes: - BLUE = 1667457644
 - GRAY = 1667458937
 - GREEN = 1667458930
 - NONE = 1667460719
 - ORANGE = 1667460978
 - OTHER = 1667460980
 - PURPLE = 1667461237
 - RED = 1667461733
 - YELLOW = 1667463525
 
 - class QuotingColor(value)[source]
- Bases: - Enum- Options for colors to use when quoting text. - Attributes: - BLUE = 1667457644
 - GREEN = 1667458930
 - ORANGE = 1667460978
 - OTHER = 1667460980
 - PURPLE = 1667461237
 - RED = 1667461733
 - YELLOW = 1667463525
 
 - class RuleQualifier(value)[source]
- Bases: - Enum- Options for how Mail rules are qualified. - Attributes: - Indicates no qualifier is applicable - BEGINS_WITH_VALUE = 1920033399
 - DOES_CONTAIN_VALUE = 1920033647
 - DOES_NOT_CONTAIN_VALUE = 1920033902
 - ENDS_WITH_VALUE = 1920034167
 - EQUAL_TO_VALUE = 1920035173
 - GREATER_THAN_VALUE = 1920034676
 - LESS_THAN_VALUE = 1920035956
 - NONE = 1920036463
- Indicates no qualifier is applicable 
 
 - class RuleType(value)[source]
- Bases: - Enum- Types of rules in Mail.app. - Attributes: - Account - Any recipient - Attachment Type - Cc header - From header - An arbitrary header key - Every message - Message content - Message is junk mail - Sender is in my contacts - Sender is in my previous recipients - Sender is member of group - Sender is not in my contacts - sender is not in my previous recipients - Sender is not member of group - Sender is VIP - Subject header - To header - To or Cc header - ACCOUNT = 1952539491
- Account 
 - ANY_RECIPIENT = 1952542322
- Any recipient 
 - ATTACHMENT_TYPE = 1952543860
- Attachment Type 
 - CC_HEADER = 1952670563
- Cc header 
 - FROM_HEADER = 1952871023
- From header 
 - HEADER_KEY = 1952998507
- An arbitrary header key 
 - MATCHES_EVERY_MESSAGE = 1952806509
- Every message 
 - MESSAGE_CONTENT = 1953326435
- Message content 
 - MESSAGE_IS_JUNK_MAIL = 1953327466
- Message is junk mail 
 - SENDER_IS_IN_MY_CONTACTS = 1953720681
- Sender is in my contacts 
 - SENDER_IS_IN_MY_PREVIOUS_RECIPIENTS = 1953718632
- Sender is in my previous recipients 
 - SENDER_IS_MEMBER_OF_GROUP = 1953720685
- Sender is member of group 
 - SENDER_IS_NOT_IN_MY_CONTACTS = 1953720686
- Sender is not in my contacts 
 - SENDER_IS_NOT_IN_MY_PREVIOUS_RECIPIENTS = 1953390952
- sender is not in my previous recipients 
 - SENDER_IS_NOT_MEMBER_OF_GROUP = 1953720679
- Sender is not member of group 
 - SENDER_IS_VIP = 1953720679
- Sender is VIP 
 - SUBJECT_HEADER = 1953723746
- Subject header 
 - TO_HEADER = 1953787759
- To header 
 - TO_OR_CC_HEADER = 1953787747
- To or Cc header 
 
 - class ViewerColumn(value)[source]
- Bases: - Enum- Columns in message viewer windows. - Attributes: - Column containing the number of attachments a message contains - Column containing the date a draft message was saved - Column containing the date a message was received - Column containing the date a message was sent - Column containing the flags of a message - Column containing the sender's name - Column containing the name of the mailbox or account a message is in - Used to indicate sorting should be done by color - Column indicating a messages status (read, unread, replied to, forwarded, etc) - Column containing the number of a message in a mailbox - Column containing the recipients of a message - Column containing the size of a message - Column containing the subject of a message - ATTACHMENTS = 1701011828
- Column containing the number of attachments a message contains 
 - DATE_LAST_SAVED = 1701014643
- Column containing the date a draft message was saved 
 - DATE_RECEIVED = 1701012594
- Column containing the date a message was received 
 - DATE_SENT = 1701012595
- Column containing the date a message was sent 
 - FLAGS = 1701013100
- Column containing the flags of a message 
 - FROM = 1701013106
- Column containing the sender’s name 
 - MAILBOX = 1701014882
- Column containing the name of the mailbox or account a message is in 
 - MESSAGE_COLOR = 1701012332
- Used to indicate sorting should be done by color 
 - MESSAGE_STATUS = 1701014899
- Column indicating a messages status (read, unread, replied to, forwarded, etc) 
 - NUMBER = 1701015149
- Column containing the number of a message in a mailbox 
 - RECIPIENTS = 1701016687
- Column containing the recipients of a message 
 - SIZE = 1701016442
- Column containing the size of a message 
 - SUBJECT = 1701016437
- Column containing the subject of a message 
 
 - accounts(filter: dict | None = None) XAMailAccountList[source]
- Returns a list of mail accounts matching the filter. - New in version 0.0.4. 
 - property always_bcc_myself: bool
- Whether the user’s email address will be included in the Bcc: field of composed messages. 
 - property always_cc_myself: bool
- Whether the user’s email address will be included in the Cc: field of composed messages. 
 - property application_version: str
- The build number of Mail.app. 
 - property background_activity_count: int
- The number of background activities currently running in Mail. 
 - check_for_new_mail(account: XAMailAccount) XAMailApplication[source]
 - property check_spelling_while_typing: bool
- Whether spelling is checked automatically while composing messages. 
 - property choose_signature_when_composing: bool
- Whether the user can choose a signature directly in a new compose window. 
 - property color_quoted_text: bool
- Whether quoted text should be colored. 
 - property download_html_attachments: bool
- Whether images and attachments in HTML messages should be downloaded and displayed. 
 - property expand_group_addresses: bool
- Whether group addresses should be expanded when entered into the address fields of a new message. 
 - property fetch_interval: int
- The number of minutes between automatic fetches for new mail (-1 = use automatically determined interval). 
 - property fetches_automatically: bool
- Whether mail will automatically be fetched at a specific interval. 
 - property fixed_width_font: str
- The name of the font used for plain text messages. 
 - property fixed_width_font_size: int
- The font size for plain text messages. 
 - property frontmost: bool
- Whether Mail is the active application. 
 - property highlight_selected_conversation: bool
- Whether messages in conversations should be highlighted in the Mail viewer window when not grouped. 
 - imap_accounts(filter: dict | None = None) XAMailAccountList[source]
- Returns a list of mail accounts matching the filter. - New in version 0.0.4. 
 - import_mailbox(file_path: str | NSURL) XAMailApplication[source]
 - property include_all_original_message_text: bool
- Whether all text of the original message will be quoted or only text the user selects. 
 - property level_one_quoting_color: QuotingColor
- Color for quoted text with one level of indentation. 
 - property level_three_quoting_color: QuotingColor
- Color for quoted text with three levels of indentation. 
 - property level_two_quoting_color: QuotingColor
- Color for quoted text with two levels of indentation. 
 - mailboxes(filter: dict | None = None) XAMailboxList[source]
- Returns a list of mail accounts matching the filter. - New in version 0.0.4. 
 - property message_font: str
- The name of the font for messages. 
 - property message_font_size: float
- The font size for messages. 
 - property message_list_font: str
- The name of the font for the message list. 
 - property message_list_font_size: float
- The font size for the message list. 
 - message_viewers(filter: dict | None = None) XAMailMessageViewerList[source]
- Returns a list of mail accounts matching the filter. - New in version 0.0.4. 
 - property name: str
- The name of the application. 
 - property new_mail_sound: str
- The name of the sound that plays when new mail is received, or “None”. 
 - outgoing_messages(filter: dict | None = None) XAMailAccountList[source]
- Returns a list of mail accounts matching the filter. - New in version 0.0.4. 
 - pop_accounts(filter: dict | None = None) XAMailAccountList[source]
- Returns a list of mail accounts matching the filter. - New in version 0.0.4. 
 - property primary_email: str
- The user’s primary email address. 
 - property quote_original_message: bool
- Whether the text of the original message should be included in replies. 
 - rules(filter: dict | None = None) XAMailRuleList[source]
- Returns a list of mail accounts matching the filter. - New in version 0.0.4. 
 - property same_reply_format: bool
- Whether replies will be in the same text format as the message to which the user is replying. 
 - property selected_signature: str
- The name of the currently selected signature (or “randomly”, “sequentially”, or “none”). 
 - property selection: XAMailMessageList
- The list of messages currently selected by the user. 
 - property should_play_other_mail_sounds: bool
- Whether sounds will be played for actions and events other than receiving email. 
 - signatures(filter: dict | None = None) XAMailSignatureList[source]
- Returns a list of mail accounts matching the filter. - New in version 0.0.4. 
 - smtp_servers(filter: dict | None = None) XAMailAccountList[source]
- Returns a list of mail accounts matching the filter. - New in version 0.0.4. 
 - synchronize(account: XAMailAccount) XAMailApplication[source]
 - property use_fixed_width_font: bool
- Whether a fixed-width font should be used for plain text messages. 
 - property version: str
- The version number of Mail.app. 
 
- class PyXA.apps.Mail.XAMailAttachment(properties)[source]
- Bases: - XAObject- A class for managing and interacting with message attachments in Mail.app. - New in version 0.0.4. - Methods: - delete()- Permanently deletes the attachment. - Attributes: - Whether the attachment has been downloaded. - The approximate size of the attachment in bytes. - The unique identifier for the attachment. - The MIME type of the attachment, e.g. text/plain. - The name of the attachment. - property downloaded: bool
- Whether the attachment has been downloaded. 
 - property file_size: int
- The approximate size of the attachment in bytes. 
 - property id: str
- The unique identifier for the attachment. 
 - property mime_type: str
- The MIME type of the attachment, e.g. text/plain. 
 - property name: str
- The name of the attachment. 
 
- class PyXA.apps.Mail.XAMailAttachmentList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAList- A wrapper around lists of attachments that employs fast enumeration techniques. - All properties of attachments can be called as methods on the wrapped list, returning a list containing each attachment’s value for the property. - New in version 0.0.4. - Methods: - by_downloaded(downloaded)- by_file_size(file_size)- by_id(id)- by_mime_type(mime_type)- by_name(name)- id()- name()- by_downloaded(downloaded: bool) XAMailAttachment[source]
 - by_file_size(file_size: int) XAMailAttachment[source]
 - by_id(id: str) XAMailAttachment[source]
 - by_mime_type(mime_type: str) XAMailAttachment[source]
 - by_name(name: str) XAMailAttachment[source]
 
- class PyXA.apps.Mail.XAMailBccRecipient(properties)[source]
- Bases: - XAMailRecipient- A class for managing and interacting with BCC recipients in Mail.app. - New in version 0.0.4. 
- class PyXA.apps.Mail.XAMailBccRecipientList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAMailRecipientList- A wrapper around lists of mail Bcc recipients that employs fast enumeration techniques. - All properties of Bcc recipients can be called as methods on the wrapped list, returning a list containing each recipients’s value for the property. - New in version 0.0.4. 
- class PyXA.apps.Mail.XAMailCcRecipient(properties)[source]
- Bases: - XAMailRecipient- A class for managing and interacting with CC recipients in Mail.app. - New in version 0.0.4. 
- class PyXA.apps.Mail.XAMailCcRecipientList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAMailRecipientList- A wrapper around lists of mail Cc recipients that employs fast enumeration techniques. - All properties of Cc recipients can be called as methods on the wrapped list, returning a list containing each recipients’s value for the property. - New in version 0.0.4. 
- class PyXA.apps.Mail.XAMailContainer(properties)[source]
- Bases: - XAMailbox- A class for managing and interacting with containers in Mail.app. Containers are mailboxes that contain other mailboxes. - New in version 0.0.4. 
- class PyXA.apps.Mail.XAMailContainerList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAMailboxList- A wrapper around lists of mail headers that employs fast enumeration techniques. - All properties of headers can be called as methods on the wrapped list, returning a list containing each header’s value for the property. - New in version 0.0.4. 
- class PyXA.apps.Mail.XAMailDocument(properties)[source]
- Bases: - XAObject- A class for managing and interacting with Mail documents. - New in version 0.0.4. - Methods: - delete()- Permanently deletes the document. - Attributes: - The location of the document on the disk, if one exists. - Whether the document has been modified since the last save. - The name of the document. - property file: str
- The location of the document on the disk, if one exists. 
 - property modified: bool
- Whether the document has been modified since the last save. 
 - property name: str
- The name of the document. 
 
- class PyXA.apps.Mail.XAMailDocumentList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAList- A wrapper around lists of mail documents that employs fast enumeration techniques. - All properties of documents can be called as methods on the wrapped list, returning a list containing each document’s value for the property. - New in version 0.0.4. - Methods: - by_file(file)- by_modified(modified)- by_name(name)- file()- modified()- name()- by_file(file: str) XAMailDocument[source]
 - by_modified(modified: bool) XAMailDocument[source]
 - by_name(name: str) XAMailDocument[source]
 
- class PyXA.apps.Mail.XAMailHeader(properties)[source]
- Bases: - XAObject- A class for managing and interacting with message headers in Mail.app. - New in version 0.0.4. - Attributes: - The contents of the header. - The name of the header value. - property content: str
- The contents of the header. 
 - property name: str
- The name of the header value. 
 
- class PyXA.apps.Mail.XAMailHeaderList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAList- A wrapper around lists of mail headers that employs fast enumeration techniques. - All properties of headers can be called as methods on the wrapped list, returning a list containing each header’s value for the property. - New in version 0.0.4. - Methods: - by_content(content)- by_name(name)- content()- name()- by_content(content: str) XAMailHeader[source]
 - by_name(name: str) XAMailHeader[source]
 
- class PyXA.apps.Mail.XAMailICloudAccount(properties)[source]
- Bases: - XAMailAccount- A class for managing and interacting with iCloud accounts in Mail.app. - New in version 0.0.4. 
- class PyXA.apps.Mail.XAMailICloudAccountList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAMailAccountList- A wrapper around lists of iCloud accounts that employs fast enumeration techniques. - All properties of iCloud accounts can be called as methods on the wrapped list, returning a list containing each accounts’s value for the property. - New in version 0.0.4. 
- class PyXA.apps.Mail.XAMailIMAPAccount(properties)[source]
- Bases: - XAMailAccount- A class for managing and interacting with IMAP accounts in Mail.app. - New in version 0.0.4. - Attributes: - Whether an IMAP mailbox is automatically compacted when the user quits Mail.app or switches to another mailbox. - The message caching setting for the account. - Whether deleted messages will be stored on the IMAP server. - Whether draft messages will be stored on the IMAP server. - Whether junk mail will be stored on the IMAP server. - Whether sent messages will be stored on the IMAP server. - property compact_mailboxes_when_closing: bool
- Whether an IMAP mailbox is automatically compacted when the user quits Mail.app or switches to another mailbox. 
 - property message_caching: CachingPolicy
- The message caching setting for the account. 
 - property store_deleted_messages_on_server: bool
- Whether deleted messages will be stored on the IMAP server. 
 - property store_drafts_on_server: bool
- Whether draft messages will be stored on the IMAP server. 
 - property store_junk_mail_on_server: bool
- Whether junk mail will be stored on the IMAP server. 
 - property store_sent_messages_on_server: bool
- Whether sent messages will be stored on the IMAP server. 
 
- class PyXA.apps.Mail.XAMailIMAPAccountList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAMailAccountList- A wrapper around lists of mail documents that employs fast enumeration techniques. - All properties of documents can be called as methods on the wrapped list, returning a list containing each document’s value for the property. - New in version 0.0.4. - Methods: - by_message_caching(message_caching)- by_store_drafts_on_server(store_drafts_on_server)- by_compact_mailboxes_when_closing(compact_mailboxes_when_closing: bool) XAMailPOPAccount[source]
 - by_message_caching(message_caching: CachingPolicy) XAMailPOPAccount[source]
 - by_store_deleted_messages_on_server(store_deleted_messages_on_server: bool) XAMailPOPAccount[source]
 - by_store_drafts_on_server(store_drafts_on_server: bool) XAMailPOPAccount[source]
 - by_store_junk_mail_on_server(store_junk_mail_on_server: bool) XAMailPOPAccount[source]
 - by_store_sent_messages_on_server(store_sent_messages_on_server: bool) XAMailPOPAccount[source]
 - message_caching() list[CachingPolicy][source]
 
- class PyXA.apps.Mail.XAMailMessage(properties)[source]
- Bases: - XAObject- A class for managing and interacting with messages in Mail.app. - New in version 0.0.4. - Attributes: - The headers of the message. - The background color of the message. - The contents of the message. - The date and time that the message was received. - The date and time that the message was sent. - Whether the message is deleted. - The flag on the message, or -1 if the message is not flagged. - Whether the message is flagged. - The unique identifier for the message. - Whether the message is marked as junk. - The mailbox in which the message is located. - The unique message ID string. - The size of the message in bytes. - Whether the message has been read. - The address that replies should be sent to. - The address of the sender of the message. - The raw source of the message. - The subject string of the message. - Whether the message was forwarded. - Whether the message was redirected. - Whether the message was replied to. - Methods: - bcc_recipients([filter])- Returns a list of Bcc recipients matching the filter. - cc_recpients([filter])- Returns a list of Cc recipients matching the filter. - delete()- Permanently deletes the message. - forward([open_window])- headers([filter])- Returns a list of message headers matching the filter. - mail_attachments([filter])- Returns a list of message attachments matching the filter. - open()- Opens the message in a separate window. - recipients([filter])- Returns a list of mail recipients matching the filter. - redirect([open_window])- reply([open_window, reply_all])- to_recipients([filter])- Returns a list of primary recipients matching the filter. - property all_headers: str
- The headers of the message. 
 - property background_color: HighlightColor
- The background color of the message. 
 - bcc_recipients(filter: dict | None = None) XAMailBccRecipientList[source]
- Returns a list of Bcc recipients matching the filter. - New in version 0.0.4. 
 - cc_recpients(filter: dict | None = None) XAMailCcRecipientList[source]
- Returns a list of Cc recipients matching the filter. - New in version 0.0.4. 
 - property date_received: datetime
- The date and time that the message was received. 
 - property date_sent: datetime
- The date and time that the message was sent. 
 - property deleted_status: bool
- Whether the message is deleted. 
 - property flag_index: int
- The flag on the message, or -1 if the message is not flagged. 
 - property flagged_status: bool
- Whether the message is flagged. 
 - forward(open_window: bool = True) XAMailOutgoingMessage[source]
 - headers(filter: dict | None = None) XAMailHeaderList[source]
- Returns a list of message headers matching the filter. - New in version 0.0.4. 
 - property id: int
- The unique identifier for the message. 
 - property junk_mail_status: bool
- Whether the message is marked as junk. 
 - mail_attachments(filter: dict | None = None) XAMailAttachmentList[source]
- Returns a list of message attachments matching the filter. - New in version 0.0.4. 
 - property message_id: int
- The unique message ID string. 
 - property message_size: int
- The size of the message in bytes. 
 - open() XAMailMessage[source]
- Opens the message in a separate window. - Returns:
- A reference to the message object. 
- Return type:
 - New in version 0.0.4. 
 - property read_status: bool
- Whether the message has been read. 
 - recipients(filter: dict | None = None) XAMailRecipientList[source]
- Returns a list of mail recipients matching the filter. - New in version 0.0.4. 
 - redirect(open_window: bool = True) XAMailOutgoingMessage[source]
 - reply(open_window: bool = True, reply_all: bool = False) XAMailOutgoingMessage[source]
 - property reply_to: str
- The address that replies should be sent to. 
 - property sender: str
- The address of the sender of the message. 
 - property source: str
- The raw source of the message. 
 - property subject: str
- The subject string of the message. 
 - to_recipients(filter: dict | None = None) XAMailToRecipientList[source]
- Returns a list of primary recipients matching the filter. - New in version 0.0.4. 
 - property was_forward: bool
- Whether the message was forwarded. 
 - property was_redirected: bool
- Whether the message was redirected. 
 - property was_replied_to: bool
- Whether the message was replied to. 
 
- class PyXA.apps.Mail.XAMailMessageList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAList- A wrapper around lists of messages that employs fast enumeration techniques. - All properties of messages can be called as methods on the wrapped list, returning a list containing each message’s value for the property. - New in version 0.0.4. - Methods: - by_all_headers(all_headers)- by_background_color(background_color)- by_content(content)- by_date_received(date_received)- by_date_sent(date_sent)- by_deleted_status(deleted_status)- by_flag_index(flag_index)- by_flagged_status(flagged_status)- by_id(id)- by_junk_mail_status(junk_mail_status)- by_mailbox(mailbox)- by_message_id(message_id)- by_message_size(message_size)- by_read_status(read_status)- by_reply_to(reply_to)- by_sender(sender)- by_source(source)- by_subject(subject)- by_was_forwarded(was_forwarded)- by_was_redirected(was_redirected)- by_was_replied_to(was_replied_to)- content()- id()- mailbox()- reply_to()- sender()- source()- subject()- background_color() list[HighlightColor][source]
 - by_all_headers(all_headers: str) XAMailMessage[source]
 - by_background_color(background_color: HighlightColor) XAMailMessage[source]
 - by_content(content: XAText) XAMailMessage[source]
 - by_date_received(date_received: datetime) XAMailMessage[source]
 - by_date_sent(date_sent: datetime) XAMailMessage[source]
 - by_deleted_status(deleted_status: bool) XAMailMessage[source]
 - by_flag_index(flag_index: int) XAMailMessage[source]
 - by_flagged_status(flagged_status: bool) XAMailMessage[source]
 - by_id(id: int) XAMailMessage[source]
 - by_junk_mail_status(junk_mail_status: bool) XAMailMessage[source]
 - by_mailbox(mailbox: XAMailbox) XAMailMessage[source]
 - by_message_id(message_id: str) XAMailMessage[source]
 - by_message_size(message_size: int) XAMailMessage[source]
 - by_read_status(read_status: bool) XAMailMessage[source]
 - by_reply_to(reply_to: str) XAMailMessage[source]
 - by_sender(sender: str) XAMailMessage[source]
 - by_source(source: str) XAMailMessage[source]
 - by_subject(subject: str) XAMailMessage[source]
 - by_was_forwarded(was_forwarded: bool) XAMailMessage[source]
 - by_was_redirected(was_redirected: bool) XAMailMessage[source]
 - by_was_replied_to(was_replied_to: bool) XAMailMessage[source]
 - mailbox() XAMailboxList[source]
 
- class PyXA.apps.Mail.XAMailMessageViewer(properties)[source]
- Bases: - XAObject- A class for managing and interacting with the message viewer window in Mail.app. - New in version 0.0.4. - Attributes: - The top-level Drafts mailbox. - The unique identifier of the message viewer. - The top-level Inbox mailbox. - The top-level Junk mailbox. - Controls whether the list of mailboxes is visible or not. - The top-level Out mailbox. - Controls whether the preview pane of the message viewer window is visible or not. - List of mailboxes currently selected in the list of mailboxes. - List of messages currently selected. - The top-level Sent mailbox. - Whether the viewer is sorted ascending or not. - The column that is currently sorted in the viewer. - The top-level Trash mailbox. - List of columns that are visible. - List of messages currently being displayed in the viewer. - The window for the message viewer. - Methods: - messages([filter])- Returns a list of messages matching the filter. - property id: int
- The unique identifier of the message viewer. 
 - property mailbox_list_visible: bool
- Controls whether the list of mailboxes is visible or not. 
 - messages(filter: dict | None = None) XAMailMessageList[source]
- Returns a list of messages matching the filter. - New in version 0.0.4. 
 - property preview_pane_is_visible: bool
- Controls whether the preview pane of the message viewer window is visible or not. 
 - property selected_mailboxes: XAMailboxList
- List of mailboxes currently selected in the list of mailboxes. 
 - property selected_messages: XAMailMessageList
- List of messages currently selected. 
 - property sort_ascending: bool
- Whether the viewer is sorted ascending or not. 
 - property sort_column: ViewerColumn
- The column that is currently sorted in the viewer. 
 - property visible_columns: list[str]
- List of columns that are visible. The subject column and the message status column will always be visible. 
 - property visible_messages: XAMailMessageList
- List of messages currently being displayed in the viewer. 
 - property window: XAMailWindow
- The window for the message viewer. 
 
- class PyXA.apps.Mail.XAMailMessageViewerList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAList- A wrapper around lists of mail signatures that employs fast enumeration techniques. - All properties of signatures can be called as methods on the wrapped list, returning a list containing each signature’s value for the property. - New in version 0.0.4. - Methods: - by_drafts_mailbox(drafts_mailbox)- by_id(id)- by_inbox(inbox)- by_junk_mailbox(junk_mailbox)- by_mailbox_list_visible(mailbox_list_visible)- by_outbox(outbox)- by_selected_mailboxes(selected_mailboxes)- by_selected_messages(selected_messages)- by_sent_mailbox(sent_mailbox)- by_sort_column(sort_column)- by_sorted_ascending(sorted_ascending)- by_trash_mailbox(trash_mailbox)- by_visible_columns(visible_columns)- by_visible_messages(visible_messages)- by_window(window)- id()- inbox()- outbox()- window()- by_drafts_mailbox(drafts_mailbox: XAMailbox) XAMailMessageViewer | None[source]
 - by_id(id: int) XAMailMessageViewer | None[source]
 - by_inbox(inbox: XAMailbox) XAMailMessageViewer | None[source]
 - by_junk_mailbox(junk_mailbox: XAMailbox) XAMailMessageViewer | None[source]
 - by_mailbox_list_visible(mailbox_list_visible: bool) XAMailMessageViewer | None[source]
 - by_outbox(outbox: XAMailbox) XAMailMessageViewer | None[source]
 - by_preview_pane_is_visible(preview_pane_is_visible: bool) XAMailMessageViewer | None[source]
 - by_selected_mailboxes(selected_mailboxes: XAMailboxList) XAMailMessageViewer | None[source]
 - by_selected_messages(selected_messages: XAMailMessageList) XAMailMessageViewer | None[source]
 - by_sent_mailbox(sent_mailbox: XAMailbox) XAMailMessageViewer | None[source]
 - by_sort_column(sort_column: ViewerColumn) XAMailMessageViewer | None[source]
 - by_sorted_ascending(sorted_ascending: bool) XAMailMessageViewer | None[source]
 - by_trash_mailbox(trash_mailbox: XAMailbox) XAMailMessageViewer | None[source]
 - by_visible_columns(visible_columns: list[str]) XAMailMessageViewer | None[source]
 - by_visible_messages(visible_messages: XAMailMessageList) XAMailMessageViewer | None[source]
 - by_window(window: XAMailWindow) XAMailMessageViewer | None[source]
 - drafts_mailbox() XAMailboxList[source]
 - inbox() XAMailboxList[source]
 - junk_mailbox() XAMailboxList[source]
 - outbox() XAMailboxList[source]
 - selected_mailboxes() list[XAMailboxList][source]
 - selected_messages() list[XAMailMessageList][source]
 - sent_mailbox() XAMailboxList[source]
 - sort_column() list[ViewerColumn][source]
 - trash_mailbox() XAMailboxList[source]
 - visible_messages() list[XAMailMessageList][source]
 - window() XASBWindowList[source]
 
- class PyXA.apps.Mail.XAMailOutgoingMessage(properties)[source]
- Bases: - XAObject- A class for managing and interacting with outgoing messages in Mail.app. - New in version 0.0.4. - Methods: - close([save])- delete()- Permanently deletes the outgoing message. - save()- send()- Attributes: - The contents of the message. - The unique identifier for the message. - The signature of the message. - The address of the message sender. - The subject string of the message. - Whether the message window is shown on screen. - close(save: SaveOption = SaveOption.YES)[source]
 - property id: int
- The unique identifier for the message. 
 - property message_signature: XAMailSignature
- The signature of the message. 
 - property sender: str
- The address of the message sender. 
 - property subject: str
- The subject string of the message. 
 - property visible: bool
- Whether the message window is shown on screen. 
 
- class PyXA.apps.Mail.XAMailOutgoingMessageList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAList- A wrapper around lists of outgoing messages that employs fast enumeration techniques. - All properties of outgoing messages can be called as methods on the wrapped list, returning a list containing each messages’s value for the property. - New in version 0.0.4. - Methods: - by_content(content)- by_id(id)- by_message_signature(message_signature)- by_sender(sender)- by_subject(subject)- by_visible(visible)- content()- id()- sender()- subject()- visible()- by_content(content: XAText) XAMailOutgoingMessage[source]
 - by_id(id: int) XAMailOutgoingMessage[source]
 - by_message_signature(message_signature: XAMailSignature) XAMailOutgoingMessage[source]
 - by_sender(sender: str) XAMailOutgoingMessage[source]
 - by_subject(subject: str) XAMailOutgoingMessage[source]
 - by_visible(visible: bool) XAMailOutgoingMessage[source]
 - content() XATextList[source]
 - message_signature() XAMailSignatureList[source]
 
- class PyXA.apps.Mail.XAMailPOPAccount(properties)[source]
- Bases: - XAMailAccount- A class for managing and interacting with POP accounts in Mail.app. - New in version 0.0.4. - Attributes: - The max amount of bytes a message can be before Mail will prompt the user before downloading the message (-1 = do not prompt). - The number of days before messages that have been downloaded will be deleted from the server (0 = delete immediately after downloading). - Whether the POP account deletes messages on the server after downloading. - Whether messages will be deleted from the server when moved from the POP inbox. - property big_message_warning_size: int
- The max amount of bytes a message can be before Mail will prompt the user before downloading the message (-1 = do not prompt). 
 - property delayed_message_deletion_interval: int
- The number of days before messages that have been downloaded will be deleted from the server (0 = delete immediately after downloading). 
 - property delete_mail_on_server: bool
- Whether the POP account deletes messages on the server after downloading. 
 - property delete_messages_when_moved_from_inbox: bool
- Whether messages will be deleted from the server when moved from the POP inbox. 
 
- class PyXA.apps.Mail.XAMailPOPAccountList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAMailAccountList- A wrapper around lists of mail documents that employs fast enumeration techniques. - All properties of documents can be called as methods on the wrapped list, returning a list containing each document’s value for the property. - New in version 0.0.4. - Methods: - by_delete_mail_on_server(delete_mail_on_server)- by_big_message_warning_size(big_message_warning_size: int) XAMailPOPAccount[source]
 - by_delayed_message_deletion_interval(delayed_message_deletion_interval: int) XAMailPOPAccount[source]
 - by_delete_mail_on_server(delete_mail_on_server: bool) XAMailPOPAccount[source]
 - by_delete_messages_when_moved_from_inbox(delete_messages_when_moved_from_inbox: bool) XAMailPOPAccount[source]
 
- class PyXA.apps.Mail.XAMailRecipient(properties)[source]
- Bases: - XAObject- A class for managing and interacting with recipients in Mail.app. - New in version 0.0.4. - Attributes: - The recipient's email address. - The name used for display. - property address: str
- The recipient’s email address. 
 - property name: str
- The name used for display. 
 
- class PyXA.apps.Mail.XAMailRecipientList(properties: dict, filter: dict | None = None, object_class=None)[source]
- Bases: - XAList- A wrapper around lists of mail recipients that employs fast enumeration techniques. - All properties of recipients can be called as methods on the wrapped list, returning a list containing each recipients’s value for the property. - New in version 0.0.4. - Methods: - address()- by_address(address)- by_name(name)- name()- by_address(address: str) XAMailRecipient[source]
 - by_name(name: str) XAMailRecipient[source]
 
- class PyXA.apps.Mail.XAMailRule(properties)[source]
- Bases: - XAObject- A class for managing and interacting with rules in Mail.app. - New in version 0.0.4. - Attributes: - Whether all conditions must be met for the rule to execute. - If the rule matches, apply this color. - If the rule matches, copy the message to the specified mailbox. - If the rule matches, delete the message. - Whether the rule is enabled. - If the rule matches, forward the message to the specified addresses, separated by commas. - If the rule matches, prepend the provided text to the forwarded message. - Whether the color will be used to highlight the text of background of a message. - If the rule matches, mark the message with the specified flag (-1 = disabled). - If the rule matches, mark the message as flagged. - If the rule matches, mark the message as read. - If the rule matches, move the message to the specified mailbox. - The name of the rule. - If the rule matches, play the sound specified by name or path. - If the rule matches, redirect the message to the supplied addresses, separated by commas. - If the rule matches, reply to the message and prepend the provided text. - If the rule matches, run the supplied AppleScript file. - Whether the rule has a copy action. - Whether the rule has a move action. - If the rule matches, stop rule evaluation for the message - If the rule matches, stop rule evaluation for the message - Methods: - delete()- Permanently deletes the rule. - rule_conditions([filter])- Returns a list of rule conditions matching the filter. - property all_conditions_must_be_met: bool
- Whether all conditions must be met for the rule to execute. 
 - property color_message: HighlightColor
- If the rule matches, apply this color. 
 - property delete_message: bool
- If the rule matches, delete the message. 
 - property enabled: bool
- Whether the rule is enabled. 
 - property forward_message: str
- If the rule matches, forward the message to the specified addresses, separated by commas. 
 - property forward_text: str
- If the rule matches, prepend the provided text to the forwarded message. 
 - property highlight_text_using_color: bool
- Whether the color will be used to highlight the text of background of a message. 
 - property mark_flag_index: int
- If the rule matches, mark the message with the specified flag (-1 = disabled). 
 - property mark_flagged: bool
- If the rule matches, mark the message as flagged. 
 - property mark_read: bool
- If the rule matches, mark the message as read. 
 - property name: str
- The name of the rule. 
 - property play_sound: str
- If the rule matches, play the sound specified by name or path. 
 - property redirect_message: str
- If the rule matches, redirect the message to the supplied addresses, separated by commas. 
 - property reply_text: str
- If the rule matches, reply to the message and prepend the provided text. 
 - rule_conditions(filter: dict | None = None) XAMailRuleConditionList[source]
- Returns a list of rule conditions matching the filter. - New in version 0.0.4. 
 - property run_script: str
- If the rule matches, run the supplied AppleScript file. 
 - property should_copy_message: bool
- Whether the rule has a copy action. 
 - property should_move_message: bool
- Whether the rule has a move action. 
 - property stop_evaluating_rule: bool
- If the rule matches, stop rule evaluation for the message 
 - property stop_evaluating_rules: bool
- If the rule matches, stop rule evaluation for the message 
 
- class PyXA.apps.Mail.XAMailRuleCondition(properties)[source]
- Bases: - XAObject- A class for managing and interacting with rule conditions in Mail.app. - New in version 0.0.4. - Methods: - delete()- Permanently deletes the rule condition. - Attributes: - The rule expression field. - The rule header key. - The qualifier for the rule. - The type of the rule. - property expression: str
- The rule expression field. 
 - property header: str
- The rule header key. 
 - property qualifier: RuleQualifier
- The qualifier for the rule. 
 
- class PyXA.apps.Mail.XAMailRuleConditionList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAList- A wrapper around lists of rule conditions that employs fast enumeration techniques. - All properties of rule conditions can be called as methods on the wrapped list, returning a list containing each rule conditions’s value for the property. - New in version 0.0.4. - Methods: - by_expression(expression)- by_header(header)- by_qualifier(qualifier)- by_rule_type(rule_type)- header()- by_expression(expression: str) XAMailRuleCondition | None[source]
 - by_header(header: str) XAMailRuleCondition | None[source]
 - by_qualifier(qualifier: RuleQualifier) XAMailRuleCondition | None[source]
 - by_rule_type(rule_type: RuleType) XAMailRuleCondition | None[source]
 - qualifier() list[RuleQualifier][source]
 
- class PyXA.apps.Mail.XAMailRuleList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAList- A wrapper around lists of rules that employs fast enumeration techniques. - All properties of rules can be called as methods on the wrapped list, returning a list containing each rule’s value for the property. - New in version 0.0.4. - Methods: - by_color_message(color_message)- by_copy_message(copy_message)- by_delete_message(deleteMessage)- by_enabled(enabled)- by_forward_message(forward_message)- by_forward_text(forward_text)- by_mark_flag_index(mark_flag_index)- by_mark_flagged(mark_flagged)- by_mark_read(mark_read)- by_move_message(move_message)- by_name(name)- by_play_sound(play_sound)- by_redirect_message(redirect_message)- by_reply_text(reply_text)- by_run_script(run_script)- by_should_copy_message(should_copy_message)- by_should_move_message(should_move_message)- by_stop_evaluating_rules(stop_evaluating_rules)- enabled()- name()- by_all_conditions_must_be_met(all_conditions_must_be_met: bool) XAMailRule[source]
 - by_color_message(color_message: HighlightColor) XAMailRule[source]
 - by_copy_message(copy_message: XAMailbox) XAMailRule[source]
 - by_delete_message(deleteMessage: bool) XAMailRule[source]
 - by_enabled(enabled: bool) XAMailRule[source]
 - by_forward_message(forward_message: str) XAMailRule[source]
 - by_forward_text(forward_text: str) XAMailRule[source]
 - by_highlight_text_using_color(highlight_text_using_color: bool) XAMailRule[source]
 - by_mark_flag_index(mark_flag_index: int) XAMailRule[source]
 - by_mark_flagged(mark_flagged: bool) XAMailRule[source]
 - by_mark_read(mark_read: bool) XAMailRule[source]
 - by_move_message(move_message: XAMailbox) XAMailRule[source]
 - by_name(name: str) XAMailRule[source]
 - by_play_sound(play_sound: str) XAMailRule[source]
 - by_redirect_message(redirect_message: str) XAMailRule[source]
 - by_reply_text(reply_text: str) XAMailRule[source]
 - by_run_script(run_script: str) XAMailRule[source]
 - by_should_copy_message(should_copy_message: bool) XAMailRule[source]
 - by_should_move_message(should_move_message: bool) XAMailRule[source]
 - by_stop_evaluating_rules(stop_evaluating_rules: bool) XAMailRule[source]
 - color_message() list[HighlightColor][source]
 - copy_message() XAMailboxList[source]
 - move_message() XAMailboxList[source]
 
- class PyXA.apps.Mail.XAMailSMTPServer(properties)[source]
- Bases: - XAObject- A class for managing and interacting with SMTP servers in Mail.app. - New in version 0.0.4. - Attributes: - The type of the account, either: "pop", "smtp", "imap", or "iCloud". - The preferred authentication scheme for the account, either: "password", "apop", "kerberos 5", "ntlm", "md5", "external", "Apple token", or "none". - Whether the account is enabled. - The name of the account. - The password for the account. - The port used to connect to the account. - The host name used to connect to the account. - The user name used to connect to the account. - Whether SSL is enabled for this receiving account. - property account_type: AccountType
- The type of the account, either: “pop”, “smtp”, “imap”, or “iCloud”. 
 - property authentication: AuthenticationMethod
- The preferred authentication scheme for the account, either: “password”, “apop”, “kerberos 5”, “ntlm”, “md5”, “external”, “Apple token”, or “none”. 
 - property enabled: bool
- Whether the account is enabled. 
 - property name: str
- The name of the account. 
 - property password: None
- The password for the account. 
 - property port: int
- The port used to connect to the account. 
 - property server_name: str
- The host name used to connect to the account. 
 - property user_name: str
- The user name used to connect to the account. 
 - property uses_ssl: bool
- Whether SSL is enabled for this receiving account. 
 
- class PyXA.apps.Mail.XAMailSMTPServerList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAList- A wrapper around lists of SMTP servers that employs fast enumeration techniques. - All properties of SMTP servers can be called as methods on the wrapped list, returning a list containing each SMTP server’s value for the property. - New in version 0.0.4. - Methods: - by_account_type(account_type)- by_authentication(authentication)- by_enabled(enabled)- by_name(name)- by_port(port)- by_server_name(server_name)- by_user_name(user_name)- by_uses_ssl(uses_ssl)- enabled()- name()- port()- uses_ssl()- account_type() list[AccountType][source]
 - authentication() list[AuthenticationMethod][source]
 - by_account_type(account_type: AccountType) XAMailAccount[source]
 - by_authentication(authentication: AuthenticationMethod) XAMailAccount[source]
 - by_enabled(enabled: bool) XAMailAccount[source]
 - by_name(name: str) XAMailAccount[source]
 - by_port(port: int) XAMailAccount[source]
 - by_server_name(server_name: str) XAMailAccount[source]
 - by_user_name(user_name: str) XAMailAccount[source]
 - by_uses_ssl(uses_ssl: bool) XAMailAccount[source]
 
- class PyXA.apps.Mail.XAMailSignature(properties)[source]
- Bases: - XAObject- A class for managing and interacting with email signatures in Mail.app. - New in version 0.0.4. - Attributes: - The content of the email signature. - The name of the signature. - Methods: - delete()- Permanently deletes the signature. - property name: str
- The name of the signature. 
 
- class PyXA.apps.Mail.XAMailSignatureList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAList- A wrapper around lists of mail signatures that employs fast enumeration techniques. - All properties of signatures can be called as methods on the wrapped list, returning a list containing each signature’s value for the property. - New in version 0.0.4. - Methods: - by_content(content)- by_name(name)- content()- name()- by_content(content: XAText) XAMailSignature | None[source]
 - by_name(name: str) XAMailSignature | None[source]
 
- class PyXA.apps.Mail.XAMailToRecipient(properties)[source]
- Bases: - XAMailRecipient- A class for managing and interacting with the primary (to) recipients in Mail.app. - New in version 0.0.4. 
- class PyXA.apps.Mail.XAMailToRecipientList(properties: dict, filter: dict | None = None)[source]
- Bases: - XAMailRecipientList- A wrapper around lists of mail primary (to) recipients that employs fast enumeration techniques. - All properties of primary recipients can be called as methods on the wrapped list, returning a list containing each recipients’s value for the property. - New in version 0.0.4. 
- class PyXA.apps.Mail.XAMailWindow(properties)[source]
- Bases: - XASBWindow- A class for managing and interacting with Mail documents. - New in version 0.0.4. - Attributes: - The current document. - property document: XAMailDocument
- The current document. 
 
- class PyXA.apps.Mail.XAMailbox(properties)[source]
- Bases: - XAObject- A class for managing and interacting with mailboxes in Mail.app. - New in version 0.0.4. - Attributes: - The parent account of the mailbox. - The parent mailbox of the mailbox. - The name of the mailbox. - The number of unread messages in the mailbox. - Methods: - delete()- Permanently deletes the mailboxs. - mailboxes([filter])- Returns a list of mailboxes matching the filter. - messages([filter])- Returns a list of messages matching the filter. - property account: XAMailAccount
- The parent account of the mailbox. 
 - mailboxes(filter: dict | None = None) XAMailboxList[source]
- Returns a list of mailboxes matching the filter. - New in version 0.1.0. 
 - messages(filter: dict | None = None) XAMailMessageList[source]
- Returns a list of messages matching the filter. - New in version 0.1.0. 
 - property name: str
- The name of the mailbox. 
 - property unread_count: int
- The number of unread messages in the mailbox. 
 
- class PyXA.apps.Mail.XAMailboxList(properties: dict, filter: dict | None = None, obj_class=None)[source]
- Bases: - XAList- A wrapper around lists of mailboxes that employs fast enumeration techniques. - All properties of mailboxes can be called as methods on the wrapped list, returning a list containing each mailbox’s value for the property. - New in version 0.0.4. - Methods: - account()- by_account(account)- by_container(container)- by_name(name)- by_unread_count(unread_count)- messages()- name()- account() XAMailAccountList[source]
 - by_account(account: XAMailAccount) XAMailbox[source]
 - by_container(container: XAMailContainer) XAMailbox[source]
 - container() XAMailContainerList[source]