Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pfouque committed May 24, 2024
1 parent bb924f1 commit 7337d31
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
9 changes: 8 additions & 1 deletion django_mailbox/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,16 @@ def reply(self, message):
to retrieve that information through normal channels, so we must
pre-set it.
For conveninence, you can use django.core.mail.EmailMessage to build a Message instance::
from django.core.mail import EmailMessage
message.reply(
EmailMessage(subject="pong", body="pongpong")
)
"""
if not isinstance(message, EmailMessage):
raise ValueError('Message must be an instance of EmailMessage')
raise ValueError('Message must be an instance of email.Message')

if not message.from_email:
if self.mailbox.from_email:
Expand Down
29 changes: 15 additions & 14 deletions docs/topics/mailbox_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ POP3 and IMAP as well as local file-based mailboxes.

.. table:: 'Protocol' Options

============ ================ ====================================================================================================================================================================
Mailbox Type 'Protocol':// Notes
============ ================ ====================================================================================================================================================================
POP3 ``pop3://`` Can also specify SSL with ``pop3+ssl://``
IMAP ``imap://`` Can also specify SSL with ``imap+ssl://`` or STARTTLS with ``imap+tls``; additional configuration is also possible: see :ref:`pop3-and-imap-mailboxes` for details.
Gmail IMAP ``gmail+ssl://`` Uses OAuth authentication for Gmail's IMAP transport. See :ref:`gmail-oauth` for details.
Office365 API``office365://`` Uses OAuth authentication for Office365 API transport. See :ref:`office365-oauth` for details.
Maildir ``maildir://``
Mbox ``mbox://``
Babyl ``babyl://``
MH ``mh://``
MMDF ``mmdf://``
Piped Mail *empty* See :ref:`receiving-mail-from-exim4-or-postfix`
============ ================ ====================================================================================================================================================================
================ ================ ====================================================================================================================================================================
Mailbox Type 'Protocol':// Notes
================ ================ ====================================================================================================================================================================
POP3 ``pop3://`` Can also specify SSL with ``pop3+ssl://``
IMAP ``imap://`` Can also specify SSL with ``imap+ssl://`` or STARTTLS with ``imap+tls``; additional configuration is also possible: see :ref:`pop3-and-imap-mailboxes` for details.
Gmail IMAP ``gmail+ssl://`` Uses OAuth authentication for Gmail's IMAP transport. See :ref:`gmail-oauth` for details.
Office365 API ``office365://`` Uses OAuth authentication for Office365 API transport. See :ref:`office365-oauth` for details.
Maildir ``maildir://`` *empty*
Mbox ``mbox://`` *empty*
Babyl ``babyl://`` *empty*
MH ``mh://`` *empty*
MMDF ``mmdf://`` *empty*
Piped Mail *empty* See :ref:`receiving-mail-from-exim4-or-postfix`
================ ================ ====================================================================================================================================================================


.. warning::
Expand Down Expand Up @@ -117,6 +117,7 @@ Build your URI accordingly::


.. _office365-oauth:

Office 365 API
-------------------------------------

Expand Down

0 comments on commit 7337d31

Please sign in to comment.