mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
Compare commits
1 Commits
ci-alxndr4
...
link2xt/au
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c9e8d40b4 |
@@ -82,7 +82,6 @@ def lookup_passdb(db, user, cleartext_password):
|
|||||||
|
|
||||||
|
|
||||||
def handle_dovecot_request(msg, db, mail_domain):
|
def handle_dovecot_request(msg, db, mail_domain):
|
||||||
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")
|
||||||
@@ -105,7 +104,6 @@ def handle_dovecot_request(msg, db, mail_domain):
|
|||||||
reply_command = "O"
|
reply_command = "O"
|
||||||
else:
|
else:
|
||||||
reply_command = "N"
|
reply_command = "N"
|
||||||
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
|
||||||
@@ -130,7 +128,6 @@ def main():
|
|||||||
break
|
break
|
||||||
res = handle_dovecot_request(msg, db, mail_domain)
|
res = handle_dovecot_request(msg, db, mail_domain)
|
||||||
if res:
|
if res:
|
||||||
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