1. Home
  2. Python
  3. E-mails sent from Django appear as webmaster@host.domain.tld

E-mails sent from Django appear as webmaster@host.domain.tld

Overview

E-mails sent from a Django application may use “webmaster@host.domain.tld” or another erroneous address as the From field.

Cause

ServerAdmin values are not set in Apache configuration for virtual hosts to prevent unintentional information leakage.

Solution

Set DEFAULT_FROM_EMAIL and SERVER_EMAIL in your Django settings file. An example configuration follows:

EMAIL_HOST='localhost'
EMAIL_PORT='587'
EMAIL_HOST_USER='myadmin@mydomain.com'
EMAIL_PASSWORD='mysmtppassword'
DEFAULT_FROM_EMAIL=EMAIL_HOST_USER
SERVER_EMAIL=EMAIL_HOST_USER

Replace EMAIL_HOST_USER and EMAIL_PASSWORD values with your correct e-mail credentials.

See also

Updated on July 8, 2019

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help! If you get an error, visit https://lithiumhosting.com/support instead.
Contact Support