'Decrypts a password from ClawsMail.'

def pass_decrypt(self, p, key, mode=DES.MODE_CFB):

    if (p[0] == '!'):
        buf = b64decode(p[1:])
        "\n DCTB  DCTB  DCTB If    mode    is    ECB    or    CBC    and    the    length    of    the    data    is    wrong,    do    nothing\n DCTB  DCTB  DCTB as    would    the    libc    algorithms    (as    they    fail    early). DCTB Yes,    this    means    the\n DCTB  DCTB  DCTB password    wasn't    actually    encrypted    but    only    base64-ed.\n DCTB  DCTB  DCTB "
        if ((mode in (DES.MODE_ECB, DES.MODE_CBC)) and (((len(buf) % 8) != 0) or (len(buf) > 8192))):
            return buf
        c = DES.new(key, mode=mode, IV=('\x00' * 8))
        return c.decrypt(buf)
    else:
        return p
