9 | | {{{#!diff |
10 | | diff --git a/trac/notification/mail.py b/trac/notification/mail.py |
11 | | index 2bccf87..ea24022 100644 |
12 | | --- a/trac/notification/mail.py |
13 | | +++ b/trac/notification/mail.py |
14 | | @@ -432,6 +432,8 @@ class SmtpEmailSender(Component): |
15 | | use_tls = BoolOption('notification', 'use_tls', 'false', |
16 | | """Use SSL/TLS to send notifications over SMTP.""") |
17 | | |
18 | | + local_hostname = 'localhost' |
19 | | + |
20 | | def send(self, from_addr, recipients, message): |
21 | | # Ensure the message complies with RFC2822: use CRLF line endings |
22 | | message = fix_eol(message, CRLF) |
23 | | @@ -439,7 +441,9 @@ class SmtpEmailSender(Component): |
24 | | self.log.info("Sending notification through SMTP at %s:%d to %s", |
25 | | self.smtp_server, self.smtp_port, recipients) |
26 | | try: |
27 | | - server = smtplib.SMTP(self.smtp_server, self.smtp_port, 'localhost') |
28 | | + server = smtplib.SMTP(self.smtp_server, self.smtp_port, |
29 | | + self.local_hostname) |
30 | | + self.local_hostname = server.local_hostname |
31 | | except smtplib.socket.error as e: |
32 | | raise ConfigurationError( |
33 | | tag_("SMTP server connection error (%(error)s). Please " |
34 | | }}} |
| 9 | (scratch that...) |