#2897 closed enhancement (fixed)
[patch] Support TLS for django mail
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Mail) | Version: | |
Severity: | normal | Keywords: | |
Cc: | jesse.lovelace@… | Triage Stage: | Design decision needed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This patch enables a new settings variable EMAIL_TLS, which if present and evaluates to non-zero, will make Django send emails using TLS (SSL). I don't have a local SMTP server set up on my laptop, so with this I can do development on the laptop and send emails via our office SMTP server which (sanely so) requires an encrypted connection.
Attachments (3)
Change History (12)
by , 18 years ago
Attachment: | django-mail-tls-patch.txt added |
---|
by , 18 years ago
Attachment: | django-mail-tls-patch.2.txt added |
---|
New version w/ default config variable global_settings
comment:1 by , 18 years ago
Summary: | Support TLS for django mail → [patch] Support TLS for django mail |
---|
Adding the [patch]
prefix to the Summary (and at the same time testing if the whitelisting of IP adddresses in Akismet works :)
comment:2 by , 18 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This is outside the scope of Django's (very simple) mail-sending framework. The mail-sending framework intentionally does not do many things; for more intensive applications, you can just use Python's smtplib.
comment:3 by , 18 years ago
Component: | Core framework → django.core.mail |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
This is a problem if your host requires all SMTP connections to be via SSL. Since Django itself relies on this (very-simple) framework to send out broken link and 500 emails, it would be nice if it were equipped to handle this particular setup rather than choke on an smtplib error that my own app can't easily work around.
comment:4 by , 18 years ago
The patch in #3560 gives support for gmail specificially, the patch in this issue does not.
I am with James on this. Plus, for my own domain I am using googles hosted email service, so I have no longer any access to a non-encrypted SMTP server. Considering google is making this service free this will only be more common in the future I predict.
comment:5 by , 18 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
by , 18 years ago
Attachment: | django-mail-tls-patch.3.txt added |
---|
modified and updated patch against rev 4815, works here with a hosted Google account
comment:6 by , 18 years ago
Cc: | added |
---|
comment:7 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
follow-up: 9 comment:8 by , 16 years ago
My settings: EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = 'test@…' EMAIL_HOST_PASSWORD = 'test' EMAIL_PORT = 587 EMAIL_USE_TLS = True
my view:
email = EmailMessage(subject, t.render(c), to = [settings.CONTACT_FORM_TO],from_email='pippo@pluto')
In my gmail I receive the emails from my google identity, not the from I set.
Is there any solution?
comment:9 by , 16 years ago
Replying to aronchi:
You'd be better off posting your question on django-users. Very few people are going to notice a question posted in a closed ticket. Personally I'd guess the Google SMTP server does not allow you to lie about the from field, but you're more likely to find someone who knows for sure on the mailing list than here.
Patch to enable TLS support for django.core.mail.send*mail