Skip to content

Commit ff25414

Browse files
gh-149962: Clarify IMAP4.append() argument handling
1 parent acefff9 commit ff25414

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Doc/library/imaplib.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,18 @@ An :class:`IMAP4` instance has the following methods:
197197

198198
.. method:: IMAP4.append(mailbox, flags, date_time, message)
199199

200-
Append *message* to named mailbox.
200+
Append *message* to named mailbox. *message* must be a
201+
:term:`bytes-like object` and is passed as an IMAP4 literal. If *mailbox*
202+
is ``None`` or empty, ``'INBOX'`` is used.
201203

202204
*flags* may be ``None`` or a string of IMAP flag tokens. Multiple
203205
flags are separated by spaces, for example ``r'\Seen \Answered'``.
204206
If *flags* is not already enclosed in parentheses, parentheses are
205207
added automatically.
206208

209+
*date_time* may be ``None`` to omit the ``INTERNALDATE`` argument.
210+
Otherwise, *date_time* is converted with :func:`Time2Internaldate`.
211+
207212

208213
.. method:: IMAP4.authenticate(mechanism, authobject)
209214

@@ -729,4 +734,3 @@ retrieves and prints all messages::
729734
print('Message %s\n%s\n' % (num, data[0][1]))
730735
M.close()
731736
M.logout()
732-

0 commit comments

Comments
 (0)