Commit 7804f064 by Kim Gyeongeun

#52593 【市川市】eモニ アンケートメール送信結果について

parent 424827ea
...@@ -18,6 +18,11 @@ import javax.mail.Store; ...@@ -18,6 +18,11 @@ import javax.mail.Store;
import javax.mail.internet.InternetAddress; import javax.mail.internet.InternetAddress;
import javax.transaction.UserTransaction; import javax.transaction.UserTransaction;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.seasar.framework.container.annotation.tiger.Component;
import org.seasar.framework.container.annotation.tiger.InstanceType;
import jp.agentec.sinaburocast.common.util.PropertyUtil; import jp.agentec.sinaburocast.common.util.PropertyUtil;
import jp.agentec.sinaburocast.common.util.SinaburoUtil; import jp.agentec.sinaburocast.common.util.SinaburoUtil;
import jp.agentec.sinaburocast.entity.EnqueteMail; import jp.agentec.sinaburocast.entity.EnqueteMail;
...@@ -30,11 +35,6 @@ import jp.agentec.sinaburocast.service.EnqueteMailSendResultService; ...@@ -30,11 +35,6 @@ import jp.agentec.sinaburocast.service.EnqueteMailSendResultService;
import jp.agentec.sinaburocast.service.EnqueteMailService; import jp.agentec.sinaburocast.service.EnqueteMailService;
import jp.agentec.sinaburocast.service.NotifyMailSendResultService; import jp.agentec.sinaburocast.service.NotifyMailSendResultService;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.seasar.framework.container.annotation.tiger.Component;
import org.seasar.framework.container.annotation.tiger.InstanceType;
@Component(instance=InstanceType.PROTOTYPE) @Component(instance=InstanceType.PROTOTYPE)
public class ErrorMailCheckBatchLogic { public class ErrorMailCheckBatchLogic {
private final Logger logger = Logger.getLogger(getClass()); private final Logger logger = Logger.getLogger(getClass());
...@@ -101,6 +101,7 @@ public class ErrorMailCheckBatchLogic { ...@@ -101,6 +101,7 @@ public class ErrorMailCheckBatchLogic {
for (int indexPart = 0; indexPart < multiPart.getCount(); indexPart++) { for (int indexPart = 0; indexPart < multiPart.getCount(); indexPart++) {
final Part part = multiPart.getBodyPart(indexPart); final Part part = multiPart.getBodyPart(indexPart);
final String disposition = part.getDisposition(); final String disposition = part.getDisposition();
if (!Part.ATTACHMENT.equals(disposition) && !Part.INLINE.equals(disposition)) { if (!Part.ATTACHMENT.equals(disposition) && !Part.INLINE.equals(disposition)) {
InputStreamReader reader = null; InputStreamReader reader = null;
...@@ -125,6 +126,9 @@ public class ErrorMailCheckBatchLogic { ...@@ -125,6 +126,9 @@ public class ErrorMailCheckBatchLogic {
Matcher matcher = pattern.matcher(builder.toString()); Matcher matcher = pattern.matcher(builder.toString());
if (matcher.find()) { if (matcher.find()) {
messageId = matcher.group(1).trim(); messageId = matcher.group(1).trim();
} else {
logger.warn("No messageId:" + messageId);
logger.warn("builder.toString():" + builder.toString());
} }
pattern = Pattern.compile("^Status:(.*)$", Pattern.MULTILINE); pattern = Pattern.compile("^Status:(.*)$", Pattern.MULTILINE);
...@@ -137,8 +141,12 @@ public class ErrorMailCheckBatchLogic { ...@@ -137,8 +141,12 @@ public class ErrorMailCheckBatchLogic {
if (smtpErrorType.getCode() == SmtpErrorType.ERR_999.getCode()) { if (smtpErrorType.getCode() == SmtpErrorType.ERR_999.getCode()) {
smtpErrorType = ErrorMailStatus.SmtpErrorType.toEnum(builder.toString()); smtpErrorType = ErrorMailStatus.SmtpErrorType.toEnum(builder.toString());
} }
} else {
logger.warn("No disposition:" + disposition);
} }
} }
} else {
logger.warn("No objContent:" + objContent.getClass());
} }
if (!StringUtils.isBlank(messageId)) { if (!StringUtils.isBlank(messageId)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment