fix CLI
This commit is contained in:
@@ -109,12 +109,17 @@ def list_quarantines(quarantines, args):
|
|||||||
else:
|
else:
|
||||||
whitelist_type = "NONE"
|
whitelist_type = "NONE"
|
||||||
|
|
||||||
|
if "milter_action" in cfg:
|
||||||
|
milter_action = cfg["milter_action"]
|
||||||
|
else:
|
||||||
|
milter_action = "NONE"
|
||||||
|
|
||||||
qlist.append({
|
qlist.append({
|
||||||
"name": q["name"],
|
"name": q["name"],
|
||||||
"storage": storage_type,
|
"storage": storage_type,
|
||||||
"notification": notification_type,
|
"notification": notification_type,
|
||||||
"whitelist": whitelist_type,
|
"whitelist": whitelist_type,
|
||||||
"action": q["args"]["milter_action"]})
|
"action": milter_action})
|
||||||
|
|
||||||
print_table(
|
print_table(
|
||||||
[("Name", "name"),
|
[("Name", "name"),
|
||||||
|
|||||||
@@ -206,6 +206,11 @@ class FileMailStorage(BaseMailStorage):
|
|||||||
data = milter.fp.read
|
data = milter.fp.read
|
||||||
mailfrom = milter.mailfrom
|
mailfrom = milter.mailfrom
|
||||||
recipients = list(milter.rcpts)
|
recipients = list(milter.rcpts)
|
||||||
|
# getting the subject is the only operation that needs any
|
||||||
|
# parsing of the message, catch all exceptions here
|
||||||
|
try:
|
||||||
|
subject = milter.msg["subject"] or ""
|
||||||
|
except Exception as e:
|
||||||
subject = ""
|
subject = ""
|
||||||
else:
|
else:
|
||||||
data = milter.msg.as_bytes
|
data = milter.msg.as_bytes
|
||||||
|
|||||||
Reference in New Issue
Block a user