Email: Implement TLS / SSL #3680

Closed
opened 2025-12-29 18:30:34 +01:00 by adam · 2 comments
Owner

Originally created by @minitriga on GitHub (May 12, 2020).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Python version: Not Required
  • NetBox version: 2.8.4?

Proposed Functionality

To add more of the Django email settings that are listed in docs.

I specifically need EMAIL_USE_TLS and EMAIL_USE_SSL.

Use Case

This will allow a user to send an email to a service that uses TLS or SSL. Currently this is not supported and when using a provider like Gmail SMTP you have to manually add EMAIL_USE_SSL=1 to settings.py.

Database Changes

None.

External Dependencies

Originally created by @minitriga on GitHub (May 12, 2020). Originally assigned to: @jeremystretch on GitHub. <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/forum/#!forum/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: Not Required * NetBox version: 2.8.4? <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality To add more of the Django email settings that are listed in [docs](https://docs.djangoproject.com/en/3.0/ref/settings/#email). I specifically need `EMAIL_USE_TLS` and `EMAIL_USE_SSL`. <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case This will allow a user to send an email to a service that uses TLS or SSL. Currently this is not supported and when using a provider like Gmail SMTP you have to manually add `EMAIL_USE_SSL=1` to `settings.py`. <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes None. <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies
adam added the status: acceptedtype: feature labels 2025-12-29 18:30:34 +01:00
adam closed this issue 2025-12-29 18:30:34 +01:00
Author
Owner

@minitriga commented on GitHub (May 12, 2020):

This might look something like:

configuration.py

EMAIL = {
    'SERVER': 'smtp.gmail.com',
    'PORT': 465,
    'USERNAME': 'username',
    'PASSWORD': 'pass',
    'TIMEOUT': 10,  # seconds
    'FROM_EMAIL': 'test@netbox.com',
    'SSL': True
}

settings.py

EMAIL_USE_SSL = EMAIL.get('SSL', None)
EMAIL_USE_TLS = EMAIL.get('TLS', None)

Not sure about the None bit.

@minitriga commented on GitHub (May 12, 2020): This might look something like: `configuration.py` ``` EMAIL = { 'SERVER': 'smtp.gmail.com', 'PORT': 465, 'USERNAME': 'username', 'PASSWORD': 'pass', 'TIMEOUT': 10, # seconds 'FROM_EMAIL': 'test@netbox.com', 'SSL': True } ``` `settings.py` ``` EMAIL_USE_SSL = EMAIL.get('SSL', None) EMAIL_USE_TLS = EMAIL.get('TLS', None) ``` Not sure about the None bit.
Author
Owner

@jeremystretch commented on GitHub (May 13, 2020):

EMAIL_USE_SSL isn't a valid setting as far as I can tell; Django supports only EMAIL_USE_TLS. Disregard; it's supported but missing from the list of Email settings.

We'll also add support for EMAIL_SSL_CERTFILE and EMAIL_SSL_KEYFILE

@jeremystretch commented on GitHub (May 13, 2020): ~`EMAIL_USE_SSL` isn't a valid setting as far as I can tell; Django supports only `EMAIL_USE_TLS`.~ Disregard; it's supported but missing from the list of [Email settings](https://docs.djangoproject.com/en/3.0/ref/settings/#email). We'll also add support for `EMAIL_SSL_CERTFILE` and `EMAIL_SSL_KEYFILE`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3680