mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-20 15:18:20 +00:00
Include proper Date header in email notifications.
This commit is contained in:
parent
bb0746c3e8
commit
42e1e2fd20
@ -38,6 +38,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import smtplib
|
import smtplib
|
||||||
|
from datetime import datetime
|
||||||
from twisted.internet import defer, threads
|
from twisted.internet import defer, threads
|
||||||
from deluge import component
|
from deluge import component
|
||||||
from deluge.event import known_events
|
from deluge.event import known_events
|
||||||
@ -118,11 +119,13 @@ class CoreNotifications(CustomNotifications):
|
|||||||
From: %(smtp_from)s
|
From: %(smtp_from)s
|
||||||
To: %(smtp_recipients)s
|
To: %(smtp_recipients)s
|
||||||
Subject: %(subject)s
|
Subject: %(subject)s
|
||||||
|
Date: %(date)s
|
||||||
|
|
||||||
|
|
||||||
""" % {'smtp_from': self.config['smtp_from'],
|
""" % {'smtp_from': self.config['smtp_from'],
|
||||||
'subject': subject,
|
'subject': subject,
|
||||||
'smtp_recipients': to_addrs}
|
'smtp_recipients': to_addrs,
|
||||||
|
'date': datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S +0000').strip()}
|
||||||
|
|
||||||
message = '\r\n'.join((headers + message).splitlines())
|
message = '\r\n'.join((headers + message).splitlines())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user