mirror of https://github.com/fail2ban/fail2ban
- Fixed bug #1286222
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@197 a942ae1a-1317-0410-a47c-b1dcaea8d6050.5
parent
11d887c603
commit
0d4302c912
|
@ -27,6 +27,7 @@ __license__ = "GPL"
|
||||||
import logging, smtplib
|
import logging, smtplib
|
||||||
|
|
||||||
from utils.strings import replaceTag
|
from utils.strings import replaceTag
|
||||||
|
from time import strftime, gmtime
|
||||||
|
|
||||||
# Gets the instance of the logger.
|
# Gets the instance of the logger.
|
||||||
logSys = logging.getLogger("fail2ban")
|
logSys = logging.getLogger("fail2ban")
|
||||||
|
@ -55,8 +56,10 @@ class Mail:
|
||||||
subj = replaceTag(subject, aInfo)
|
subj = replaceTag(subject, aInfo)
|
||||||
msg = replaceTag(message, aInfo)
|
msg = replaceTag(message, aInfo)
|
||||||
|
|
||||||
mail = ("From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" %
|
mail = ("From: %s\r\nTo: %s\r\nDate: %s\r\nSubject: %s\r\n\r\n" %
|
||||||
(self.fromAddr, ", ".join(self.toAddr), subj)) + msg
|
(self.fromAddr, ", ".join(self.toAddr),
|
||||||
|
strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()),
|
||||||
|
subj)) + msg
|
||||||
|
|
||||||
try:
|
try:
|
||||||
server = smtplib.SMTP(self.host, self.port)
|
server = smtplib.SMTP(self.host, self.port)
|
||||||
|
|
Loading…
Reference in New Issue