mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-25 02:47:04 +00:00
Ignore bad encoding in email addresses when parsing maillog files (#2017)
local/domain parts of email address should be standard ASCII or UTF-8. Some email addresses contain extended ASCII, leading to decode failure by the UTF-8 codec (and thus failure of the Usage-Report script) This change allows maillog parsing to continue over lines containing such addresses
This commit is contained in:
parent
21ad26e452
commit
daad122236
@ -586,7 +586,7 @@ def scan_postfix_submission_line(date, log, collector):
|
|||||||
def readline(filename):
|
def readline(filename):
|
||||||
""" A generator that returns the lines of a file
|
""" A generator that returns the lines of a file
|
||||||
"""
|
"""
|
||||||
with open(filename) as file:
|
with open(filename, errors='replace') as file:
|
||||||
while True:
|
while True:
|
||||||
line = file.readline()
|
line = file.readline()
|
||||||
if not line:
|
if not line:
|
||||||
|
Loading…
Reference in New Issue
Block a user