bbottema/simple-java-mail

Enhancement: Simple Java Mail should throw an exception when trying to utilize S/MIME with smime-module on the classpath

JacekMazovia opened this issue · 3 comments

Hey,
I was trying to configure SMIME signing of mail. Finally succedded. But had problem that I used functions signWithSmime(). But saw no effect. Maybe it would be nice to add some note in documentation in the section "Signing / encrypting emails with S/MIME".

Maybe something like:

!! If you don't have class (...) from ..jar the signing won't work but print no error.

Later I found in source code fragment:

MimeMessageProducer : 
if (ModuleLoader.smimeModuleAvailable()) {
    message = ModuleLoader.loadSmimeModule().signAndOrEncryptEmail(session, (MimeMessage)message, email);
}

Well, it is pretty clearly stressed in the documentation that it requires the smime-module.

image

But I do agree that it might be better to log a warning, if it's not there already.

Nevertheless. Thanks for great library.

I've clarified the documentation a bit further and Simple Java Mail will now fail with an exception when trying to use S/MIME without the smime-module loaded. Just like how it works for the other modules.

Released in 7.8.2. Thank you for reporting!