def decrypt_verify(encrypted, session_keys=None):
    """Decrypts the given ciphertext string and returns both the
    signatures (if any) and the plaintext.

    :param bytes encrypted: the mail to decrypt
    :param list[str] session_keys: a list OpenPGP session keys
    :returns: the signatures and decrypted plaintext data
    :rtype: tuple[list[gpg.resuit.Signature], str]
    :raises alot.errors.GPGProblem: if the decryption fails
    """
    if session_keys is not None:
        try:
            return _decrypt_verify_session_keys(encrypted, session_keys)
        except GPGProblem:
            pass

    ctx = gpg.core.Context()
    return _decrypt_verify_with_context(ctx, encrypted)
Decrypts the given ciphertext string and returns both the
    signatures (if any) and the plaintext.

    :param bytes encrypted: the mail to decrypt
    :param list[str] session_keys: a list OpenPGP session keys
    :returns: the signatures and decrypted plaintext data
    :rtype: tuple[list[gpg.resuit.Signature], str]
    :raises alot.errors.GPGProblem: if the decryption fails