We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 942b94b commit cfa8603Copy full SHA for cfa8603
maillogger/parser.py
@@ -4,7 +4,7 @@
4
from typing import Dict, Optional
5
6
7
-REGEX = r'(?P<month>[A-Z][a-z]{2}) (?P<day>[0-9]{,2}) ' \
+REGEX = r'(?P<month>[A-Z][a-z]{2}) +(?P<day>[0-9]{,2}) ' \
8
+ r'(?P<time>[0-9]{2}:[0-9]{2}:[0-9]{2}) (?P<hostname>[A-Za-z0-9-]+) postfix/[a-z/]+\[[0-9]+\]: ' \
9
+ r'(?P<mail_id>[A-Z0-9]+): to=<(?P<to_address>.*@.*)>, ' \
10
+ r'relay=(?P<relay>.*), delay=(?P<delay>[0-9.]+), ' \
@@ -74,5 +74,6 @@ def to_dict(self) -> ParseResultType:
74
75
@staticmethod
76
def convert2dateime(month: str, day: str, time: str) -> str:
77
+ day = day.rjust(2, '0')
78
tmp = datetime.strptime(f'{month}{day}{time}', '%b%d%H:%M:%S')
79
return tmp.replace(year=datetime.now().year).strftime('%Y%m%d%H%M%S')
0 commit comments