mirror of
https://github.com/chatmail/relay.git
synced 2026-05-19 12:28:06 +00:00
dictproxy: log to stderr
This commit is contained in:
@@ -54,7 +54,7 @@ def lookup_passdb(db, user, password):
|
|||||||
|
|
||||||
|
|
||||||
def handle_dovecot_request(msg, db):
|
def handle_dovecot_request(msg, db):
|
||||||
print(f"received msg: {msg!r}")
|
print(f"received msg: {msg!r}", file=sys.stderr)
|
||||||
short_command = msg[0]
|
short_command = msg[0]
|
||||||
if short_command == "L": # LOOKUP
|
if short_command == "L": # LOOKUP
|
||||||
parts = msg[1:].split("\t")
|
parts = msg[1:].split("\t")
|
||||||
@@ -75,7 +75,7 @@ def handle_dovecot_request(msg, db):
|
|||||||
reply_command = "O"
|
reply_command = "O"
|
||||||
else:
|
else:
|
||||||
reply_command = "N"
|
reply_command = "N"
|
||||||
print(f"res: {res!r}")
|
print(f"res: {res!r}", file=sys.stderr)
|
||||||
json_res = json.dumps(res) if res else ""
|
json_res = json.dumps(res) if res else ""
|
||||||
return f"{reply_command}{json_res}\n"
|
return f"{reply_command}{json_res}\n"
|
||||||
return None
|
return None
|
||||||
@@ -98,7 +98,7 @@ def main():
|
|||||||
continue
|
continue
|
||||||
res = handle_dovecot_request(msg, db)
|
res = handle_dovecot_request(msg, db)
|
||||||
if res:
|
if res:
|
||||||
print(f"sending result: {res!r}")
|
print(f"sending result: {res!r}", file=sys.stderr)
|
||||||
self.wfile.write(res.encode("ascii"))
|
self.wfile.write(res.encode("ascii"))
|
||||||
self.wfile.flush()
|
self.wfile.flush()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user