﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27210	smtp EmailBackend doesn't honor fail_silently=True when receiving a socket level connection error	Tom Hendrikx	Vesteinn Snaebjarnarson	"The Python SMTPlib does not wrap connection errors that occur on socket level while setting up a connection. That means that Django needs to catch socket errors too (@here: https://github.com/django/django/blob/master/django/core/mail/backends/smtp.py#L73) when `fail_silently` is enabled and the connection fails with a `socket.error` (f.i.: Connection refused) or `socket.timeout` (f.i. Connection timed out).

I tested this by setting up a django 1.10 with following settings:
{{{
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 10587  # nothing is listening here!
}}}

Then I copied the core admincommand `sendtestemail.py` to one of my apps, and modified https://github.com/django/django/blob/master/django/core/management/commands/sendtestemail.py#L34 to set `fail_silently=True`. This should yield no error, but it ends in a Traceback.

Original problem of this issue for me was the `utils.log.AdminEmailHandler` that uses this feature. I can try to create some test cases for this issue when the issue is deemed valid."	Bug	closed	Core (Mail)	dev	Normal	fixed			Accepted	1	0	0	1	0	0
