Coder Social home page Coder Social logo

dovecotauth's Issues

Handle CONT better.

The current mechanism is a hack, but ought to work. The problem is, I don't know when it'll be triggered.

Tests!

There are currently no tests. In fact, I haven't even run the thing yet, just dashed it off.

Doesn't work with Python 3.7

You have marked it as work with Python 3, but i got some errors with Python 3.7:

  • by default unix socket file is read-only
  • dict hasn't iteritems()
  • base64... requires bytes

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,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.