• Kevin J. McCarthy's avatar
    Disable message security if the backend is not available. · 561e106c
    Kevin J. McCarthy authored
    Gitlab issue #3 exposed an awkward corner case: if mutt is configured
    without PGP or S/MIME, and with GPGME, but $crypt_use_gpgme is unset.
    In this case, no backend will be available, but WithCrypto will be set
    with both APPLICATION_PGP and APPLICATION_SMIME bits.
    
    That will allow various config vars to enable encryption or signing,
    even though there will be no backend available to perform them.  The
    message security flag might then be set, but when the user hits send,
    will end up back at the compose menu due to the error.
    
    The pgp or smime menu might not even be available to clear the
    security setting!
    
    Add a check in send.c before the compose menu is invoked, and give a
    warning message for the menu ops inside the compose menu.
    
    I believe this should prevent the issue.  However this is a corner
    case combined with user misconfiguration, so I don't believe is worth
    a large effort to completely eradicate.
    561e106c
mutt_crypt.h 9.72 KB