kgaughan / dovecotauth Goto Github PK
View Code? Open in Web Editor NEWDovecot Authentication Protocol client library.
License: MIT License
Dovecot Authentication Protocol client library.
License: MIT License
The current mechanism is a hack, but ought to work. The problem is, I don't know when it'll be triggered.
There are currently no tests. In fact, I haven't even run the thing yet, just dashed it off.
You have marked it as work with Python 3, but i got some errors with Python 3.7:
I got it working with these changes:
--- dovecotauth.py.bak 2019-01-27 17:45:18.996892541 +0100
+++ dovecotauth.py 2019-01-27 17:47:42.084990114 +0100
@@ -62,7 +62,7 @@
if inet:
sock = socket.create_connection(inet)
try:
- yield Protocol(service, sock.makefile())
+ yield Protocol(service, sock.makefile("rw"))
finally:
sock.shutdown(socket.SHUT_RDWR)
sock.close()
@@ -193,7 +193,7 @@
del kwargs[prohibited]
args = ["{}={}".format(key, value)
- for key, value in kwargs.iteritems()]
+ for key, value in kwargs.items()]
for flag, name in ((secured, 'secured'),
(valid_client_cert, 'valid-client-cert'),
@@ -201,8 +201,8 @@
if flag:
args.append(name)
- resp = self._SUPPORTED[mechanism](uname, pwd)
- args.append('resp=' + base64.b64encode(resp))
+ resp = _SUPPORTED[mechanism](uname, pwd)
+ args.append('resp=' + base64.b64encode(resp.encode()).decode())
self.fh.write("AUTH\t{}\t{}\tservice={}\t{}\n".format(self.req_id,
mechanism,
I think it probably should. If so, it'll need a class variable and a lock, which is nothing onerous, but something that I'd prefer not to do if possible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.