Compare commits

..

1 Commits

Author SHA1 Message Date
missytake
9e7adaf6a2 nginx: move config to own directory 2023-11-04 11:55:37 +01:00

View File

@@ -82,6 +82,7 @@ def lookup_passdb(db, user, cleartext_password):
def handle_dovecot_request(msg, db, mail_domain):
print(f"received msg: {msg!r}", file=sys.stderr)
short_command = msg[0]
if short_command == "L": # LOOKUP
parts = msg[1:].split("\t")
@@ -104,6 +105,7 @@ def handle_dovecot_request(msg, db, mail_domain):
reply_command = "O"
else:
reply_command = "N"
print(f"res: {res!r}", file=sys.stderr)
json_res = json.dumps(res) if res else ""
return f"{reply_command}{json_res}\n"
return None
@@ -128,6 +130,7 @@ def main():
break
res = handle_dovecot_request(msg, db, mail_domain)
if res:
print(f"sending result: {res!r}", file=sys.stderr)
self.wfile.write(res.encode("ascii"))
self.wfile.flush()