[Django] #24575: Add an option to smtp.EmailBackend for DKIM signing

13 views
Skip to first unread message

Django

unread,
Apr 3, 2015, 10:58:02 AM4/3/15
to django-...@googlegroups.com
#24575: Add an option to smtp.EmailBackend for DKIM signing
-------------------------------+--------------------
Reporter: gannetson | Owner: nobody
Type: Uncategorized | Status: new
Component: Core (Mail) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
DKIM signing of emails is sensible to avoid being regarded as spam.
Here's a example of an `EmailBackend` that does the signing, although I
think it makes sense to add it as an option to
`core.mail.backends.smtp.EmailBackend`.

{{{
class DKIMBackend(EmailBackend):
def _send(self, email_message):
"""A helper method that does the actual sending + DKIM signing."""
if not email_message.recipients():
return False
try:
message_string = email_message.message().as_string()
signature = dkim.sign(message_string,
settings.DKIM_SELECTOR,
settings.DKIM_DOMAIN,
settings.DKIM_PRIVATE_KEY)
self.connection.sendmail(email_message.from_email,
email_message.recipients(), signature+message_string)
except:
if not self.fail_silently:
raise
return False
return True
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24575>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 3, 2015, 11:17:02 AM4/3/15
to django-...@googlegroups.com
#24575: Add an option to smtp.EmailBackend for DKIM signing
-------------------------------+--------------------------------------

Reporter: gannetson | Owner: nobody
Type: Uncategorized | Status: new
Component: Core (Mail) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

It could be useful. On the other hand, it adds more settings and a
dependency on another library. I don't have a sense if enough people will
use it that it makes sense to include it in core as opposed to making it
an external app. Could you raise the idea on the DevelopersMailingList?

--
Ticket URL: <https://code.djangoproject.com/ticket/24575#comment:1>

Django

unread,
Apr 4, 2015, 8:05:45 PM4/4/15
to django-...@googlegroups.com
#24575: Add an option to smtp.EmailBackend for DKIM signing
-------------------------------+--------------------------------------
Reporter: gannetson | Owner: nobody
Type: Uncategorized | Status: closed

Component: Core (Mail) | Version: master
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by timgraham):

* status: new => closed
* resolution: => wontfix


Comment:

The [https://groups.google.com/d/topic/django-developers/65zjxSYR-
HY/discussion mailing list thread] seemed to conclude that DKIM is the
responsibility of an MTA, not Django, so this wouldn't be a good candidate
for inclusion in core.

--
Ticket URL: <https://code.djangoproject.com/ticket/24575#comment:2>

Reply all
Reply to author
Forward
0 new messages