sendmail error: "java.lang​.RuntimeEx​ception: Could not generate DH keypair"

Hi,
I'm running Matlab R2012b and have been using the sendmail command for years using the same server and email settings. Suddenly, out of the blue, sendmail gives me the error: "java.lang.RuntimeException: Could not generate DH keypair". Even the simplest command:
sendmail('myemail@emailadress.com','test')
produces this error. I have not changed the Java version (1.6.0_22-b04). What can be the problem?

Answers (1)

3 Comments

Thanks. Tried the BouncyCastle's JCE provider (had to put it as security.provider.2 in the java.security file since Matlab did not start with it as security.provider.1) and at least I got passed the original runtime exception error. Now when I try sendmail, it times out waiting for port 25:
Error using sendmail (line 164)
Could not connect to SMTP host: send.mysmtphost.com, port: 25;
Connection timed out: connect
even though I have specified the SMTP host to connect through port 465 (as I always have done prior to the Java issue). It is as if
props.setProperty('mail.smtp.socketFactory.port','465')
has no effect before calling sendmail now.
Sorry, I do not know the answer to that.
Installing Java 7 resolves the sendmail problem (I went back to the original security providers) but of course introduces other issues with for instance some GUI components since R2012b is shipped with Java 6 (v1.6.0_17 to be precise). Stuck in the gap between old and new. Still in total surprise why sendmail suddenly became impaired to send emails. Actually, we have 60 customers using our deployed software that have lost some vital functionality with this. Mathworks say they can't really help me because this is a Java issue. Well yes but if they have based their function on Java, it should also be a Matlab issue.

Sign in to comment.

Products

Asked:

on 31 Jan 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!