Skip to content

Commit

Permalink
added sieve starttls type for managesieve protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
plinss committed Apr 22, 2018
1 parent 70c1b2e commit 12edd05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ When using an object, the avaialable fields are:
* ``port`` specifies the port number to connect to.
Required.
* ``starttls`` specifies the STARTTLS mechanism that should be used to initiate a TLS session.
Allowed values are: ``null``, ``smtp``, ``pop3``, ``imap``, ``ftp``, and ``xmpp``.
Allowed values are: ``null``, ``smtp``, ``pop3``, ``imap``, ``sieve``, ``ftp``, and ``xmpp``.
The default value is ``null``.
* ``protocol`` specifies the protocol used to obtain additional information to verify.
Currently this can retrieve Public-Key-Pins http headers to ensure that they are properly set.
Expand Down
11 changes: 10 additions & 1 deletion acmebot
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class AcmeManager(object):
def __init__(self):
self.script_dir = os.path.dirname(os.path.realpath(__file__))
self.script_name = os.path.basename(__file__)
self.script_version = '2.1.1'
self.script_version = '2.2.0'

self._color_codes = {
'black': 30,
Expand Down Expand Up @@ -2664,6 +2664,15 @@ class AcmeManager(object):
self._detail('XMPP: ', sock.recv(4096), '\n')
sock.send(b'<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>')
self._detail('XMPP: ', sock.recv(4096), '\n')
elif ('sieve' == type):
buffer = sock.recv(4096)
self._detail('SIEVE: ', buffer)
if (b'"STARTTLS"' not in buffer):
sock.shutdown()
sock.close()
raise Exception('STARTTLS not supported on server')
sock.send(b'StartTls\r\n')
self._detail('SIEVE: ', sock.recv(4096))
else:
sock.shutdown()
sock.close()
Expand Down

0 comments on commit 12edd05

Please sign in to comment.