diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/email/EmailServiceManager.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/email/EmailServiceManager.java index 47b58bdd..58a6fdfc 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/email/EmailServiceManager.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/email/EmailServiceManager.java @@ -115,7 +115,12 @@ public class EmailServiceManager { properties.put("mail.store.protocol", "imap"); properties.put("mail.imap.host", email.getEmailServerAddress()); properties.put("mail.imap.port",email.getPort()); - properties.put("mail.imap.ssl.enable", "true"); + if (email.getIsQiye() == 1) { + properties.put("mail.imap.ssl.enable", "true"); + } else { + properties.put("mail.imap.ssl.enable", "false"); + } + //获取邮件回话 final Session session = Session.getDefaultInstance(properties); diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/AutoProcessManager.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/AutoProcessManager.java index 88ec7dac..9d9eaeac 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/AutoProcessManager.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/AutoProcessManager.java @@ -80,7 +80,7 @@ public class AutoProcessManager{ if(next.isDelFlag()){ if(emailExecThreadMap.containsKey(next.getId())){ EmailParsingActuator actuator = emailExecThreadMap.get(next.getId()); - actuator.interrupt(); + actuator.setStop(true); emailExecThreadMap.remove(next.getId()); } iterator.remove(); diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/EmailParsingActuator.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/EmailParsingActuator.java index 2d1da3f0..2d2c0ca5 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/EmailParsingActuator.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/EmailParsingActuator.java @@ -1,5 +1,6 @@ package org.jeecg.modules; +import lombok.Setter; import org.apache.commons.lang3.ArrayUtils; import org.jeecg.common.email.EmailLogManager; import org.jeecg.common.email.EmailServiceManager; @@ -26,6 +27,8 @@ public class EmailParsingActuator extends Thread{ private SpectrumServiceQuotes spectrumServiceQuotes; private EmailCounter emailCounter; private Date systemStartupTime; + @Setter + private boolean isStop; public void init(EmailProperties emailProperties,SpectrumServiceQuotes spectrumServiceQuotes, EmailCounter emailCounter,Date systemStartupTime){ @@ -50,10 +53,11 @@ public class EmailParsingActuator extends Thread{ @Override public void run() { - if (this.isInterrupted()) { - return; - } for(;;){ + if (isStop) { + System.out.println("EmailParsingActuator is Stop!"); + return; + } long start = System.currentTimeMillis(); final EmailServiceManager emailServiceManager = EmailServiceManager.getInstance(); emailServiceManager.init(this.emailProperties,this.taskProperties.getReceiveNum(),this.taskProperties.getTemporaryStoragePath(),this.systemStartupTime, spectrumServiceQuotes.getSpectrumPathProperties());