From 12edd05d8835b542d4e43405cb6af54a65aeb4b1 Mon Sep 17 00:00:00 2001 From: Peter Linss Date: Sat, 21 Apr 2018 19:00:11 -0700 Subject: [PATCH] added sieve starttls type for managesieve protocol --- README.rst | 2 +- acmebot | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index a086120..96387e4 100644 --- a/README.rst +++ b/README.rst @@ -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. diff --git a/acmebot b/acmebot index 729d52a..7058d43 100755 --- a/acmebot +++ b/acmebot @@ -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, @@ -2664,6 +2664,15 @@ class AcmeManager(object): self._detail('XMPP: ', sock.recv(4096), '\n') sock.send(b'') 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()