From a2ab3bd375f60ce9618e7ba12b6bc7a998ffc80f Mon Sep 17 00:00:00 2001 From: Rajendra1308 Date: Tue, 26 Dec 2023 21:28:30 -0500 Subject: [PATCH 1/5] imaplib-append method documented --- Doc/library/imaplib.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index 1f774e64b0eae3..3e05730dfa667c 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -204,7 +204,15 @@ An :class:`IMAP4` instance has the following methods: .. method:: IMAP4.append(mailbox, flags, date_time, message) - Append *message* to named mailbox. + Append *message* to a specified mailbox. + + *mailbox* ( ``string``): name of the mailbox where the message should be appended + + *flags* (list of ``string`` ): The flags parameter is a sequence of flags associated with the message. Flags are used to mark messages with certain attributes or states. Common flags include ``\\Seen`` (marks the message as read), ``\\FlagName`` (custom flags), as (``flags = ["\\Seen", "\\FlagName]``) etc. + + *date_time* (``string``): date and time associated with the message. Often of the format *"DD-Mon-YYYY HH:MM:SS" (e.g., "01-Jan-2023 12:00:00")* + + *message* (``string``): This parameter is the actual message that you want to append to the specified mailbox. This should be a string representing the entire email message, including headers and body. .. method:: IMAP4.authenticate(mechanism, authobject) From 15f2bdd744bde6269d5393e8a8bce7e933cb1f51 Mon Sep 17 00:00:00 2001 From: Rajendra Brahmbhatt <87101211+Rajendra1308@users.noreply.github.com> Date: Wed, 27 Dec 2023 11:17:45 -0500 Subject: [PATCH 2/5] Apply suggestions from code review Co-authored-by: Hugo van Kemenade --- Doc/library/imaplib.rst | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index 3e05730dfa667c..2789fb64e5ca77 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -204,15 +204,26 @@ An :class:`IMAP4` instance has the following methods: .. method:: IMAP4.append(mailbox, flags, date_time, message) - Append *message* to a specified mailbox. + Append *message* to a named *mailbox*. - *mailbox* ( ``string``): name of the mailbox where the message should be appended - - *flags* (list of ``string`` ): The flags parameter is a sequence of flags associated with the message. Flags are used to mark messages with certain attributes or states. Common flags include ``\\Seen`` (marks the message as read), ``\\FlagName`` (custom flags), as (``flags = ["\\Seen", "\\FlagName]``) etc. + *flags* is a space-separated string containing IMAP flags tokens. + Must start with ``\``. - *date_time* (``string``): date and time associated with the message. Often of the format *"DD-Mon-YYYY HH:MM:SS" (e.g., "01-Jan-2023 12:00:00")* - - *message* (``string``): This parameter is the actual message that you want to append to the specified mailbox. This should be a string representing the entire email message, including headers and body. + System flags defined in :rfc:`3501` are: + + * ``\Seen`` - Message has been read. + * ``\Answered`` - Message has been answered. + * ``\Flagged`` - Message is "flagged" for urgent/special attention. + * ``\Deleted`` - Message is "deleted" for removal by later ``EXPUNGE``. + * ``\Draft`` - Message has not completed composition (marked as a draft). + * ``\Recent`` - Message is "recently" arrived in this mailbox. + + + *date_time* is the date and time associated with the message. + Often of the format *"DD-Mon-YYYY HH:MM:SS" (e.g., "01-Jan-2023 12:00:00")*. + + *message* is a string representing the entire email message, including + headers and body. .. method:: IMAP4.authenticate(mechanism, authobject) From 64a0fc9d9a74ba2b61a2a5ba642d89634d248fba Mon Sep 17 00:00:00 2001 From: Rajendra1308 Date: Wed, 27 Dec 2023 11:26:18 -0500 Subject: [PATCH 3/5] formatted-changes --- Doc/library/imaplib.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index 2789fb64e5ca77..65596ac6472161 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -207,8 +207,6 @@ An :class:`IMAP4` instance has the following methods: Append *message* to a named *mailbox*. *flags* is a space-separated string containing IMAP flags tokens. - Must start with ``\``. - System flags defined in :rfc:`3501` are: * ``\Seen`` - Message has been read. @@ -220,8 +218,7 @@ An :class:`IMAP4` instance has the following methods: *date_time* is the date and time associated with the message. - Often of the format *"DD-Mon-YYYY HH:MM:SS" (e.g., "01-Jan-2023 12:00:00")*. - + *message* is a string representing the entire email message, including headers and body. From c3b76a3a3a80e6ac674ffc2edcda26104335552c Mon Sep 17 00:00:00 2001 From: Rajendra1308 Date: Wed, 27 Dec 2023 11:33:27 -0500 Subject: [PATCH 4/5] white-spaces-removed --- Doc/library/imaplib.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index 65596ac6472161..87509918cd5158 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -205,20 +205,20 @@ An :class:`IMAP4` instance has the following methods: .. method:: IMAP4.append(mailbox, flags, date_time, message) Append *message* to a named *mailbox*. - + *flags* is a space-separated string containing IMAP flags tokens. System flags defined in :rfc:`3501` are: - * ``\Seen`` - Message has been read. - * ``\Answered`` - Message has been answered. - * ``\Flagged`` - Message is "flagged" for urgent/special attention. - * ``\Deleted`` - Message is "deleted" for removal by later ``EXPUNGE``. - * ``\Draft`` - Message has not completed composition (marked as a draft). - * ``\Recent`` - Message is "recently" arrived in this mailbox. + ``\Seen`` - Message has been read. + ``\Answered`` - Message has been answered. + ``\Flagged`` - Message is "flagged" for urgent/special attention. + ``\Deleted`` - Message is "deleted" for removal by later ``EXPUNGE``. + ``\Draft`` - Message has not completed composition (marked as a draft). + ``\Recent`` - Message is "recently" arrived in this mailbox. *date_time* is the date and time associated with the message. - + *message* is a string representing the entire email message, including headers and body. From 3359ffdf8e27352eb46d855fbc70516ed6a315b7 Mon Sep 17 00:00:00 2001 From: Rajendra Brahmbhatt <87101211+Rajendra1308@users.noreply.github.com> Date: Thu, 28 Dec 2023 10:37:36 -0500 Subject: [PATCH 5/5] Apply suggestions from code review Co-authored-by: Hugo van Kemenade --- Doc/library/imaplib.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index 87509918cd5158..dfba09e7d17615 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -207,15 +207,15 @@ An :class:`IMAP4` instance has the following methods: Append *message* to a named *mailbox*. *flags* is a space-separated string containing IMAP flags tokens. - System flags defined in :rfc:`3501` are: - ``\Seen`` - Message has been read. - ``\Answered`` - Message has been answered. - ``\Flagged`` - Message is "flagged" for urgent/special attention. - ``\Deleted`` - Message is "deleted" for removal by later ``EXPUNGE``. - ``\Draft`` - Message has not completed composition (marked as a draft). - ``\Recent`` - Message is "recently" arrived in this mailbox. + System flags defined in :rfc:`RFC 3501 <3501#section-2.3.2>` are: + * ``\Seen`` - Message has been read. + * ``\Answered`` - Message has been answered. + * ``\Flagged`` - Message is "flagged" for urgent/special attention. + * ``\Deleted`` - Message is "deleted" for removal by later ``EXPUNGE``. + * ``\Draft`` - Message has not completed composition (marked as a draft). + * ``\Recent`` - Message is "recently" arrived in this mailbox. *date_time* is the date and time associated with the message.