Code

Ticket #6989: mail-local-hostname.diff

File mail-local-hostname.diff, 465 bytes (added by Franklin, 6 years ago)
Line 
1Index: django/core/mail.py
2===================================================================
3--- django/core/mail.py (revision 7409)
4+++ django/core/mail.py (working copy)
5@@ -33,6 +33,8 @@
6         return self.get_fqdn()
7 
8     def get_fqdn(self):
9+        if hasattr(settings, 'EMAIL_LOCAL_HOSTNAME'):
10+            return settings.EMAIL_LOCAL_HOSTNAME
11         if not hasattr(self, '_fqdn'):
12             self._fqdn = socket.getfqdn()
13         return self._fqdn