'Shutdown connection to server.
(typ, [data]) = <instance>.logout()
Returns server \'BYE\' response.'

def logout(self):

    self.state = 'LOGOUT'
    try:
        (typ, dat) = self._simple_command('LOGOUT')
    except:
        (typ, dat) = ('NO', [('%s:    %s' % sys.exc_info()[:2])])
    self.shutdown()
    if ('BYE' in self.untagged_responses):
        return ('BYE', self.untagged_responses['BYE'])
    return (typ, dat)
