Compare commits
2 Commits
207f857796
...
7fe395b36d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fe395b36d | ||
|
|
cfbb812a87 |
@@ -33,8 +33,8 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
implementation 'javax.mail:javax.mail-api:1.6.2'
|
// implementation 'javax.mail:javax.mail-api:1.6.2'
|
||||||
implementation 'com.sun.mail:javax.mail:1.6.2'
|
implementation 'com.sun.mail:jakarta.mail:2.0.1'
|
||||||
|
|
||||||
implementation 'org.springframework.cloud:spring-cloud-starter'
|
implementation 'org.springframework.cloud:spring-cloud-starter'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import java.util.Properties;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import jakarta.mail.*;
|
||||||
import org.json.simple.JSONArray;
|
import org.json.simple.JSONArray;
|
||||||
import org.json.simple.JSONObject;
|
import org.json.simple.JSONObject;
|
||||||
import org.json.simple.parser.JSONParser;
|
import org.json.simple.parser.JSONParser;
|
||||||
@@ -27,11 +28,6 @@ import com.wb.domainserver.util.dataaccess.DataMap;
|
|||||||
|
|
||||||
import jakarta.activation.CommandMap;
|
import jakarta.activation.CommandMap;
|
||||||
import jakarta.activation.MailcapCommandMap;
|
import jakarta.activation.MailcapCommandMap;
|
||||||
import jakarta.mail.Message;
|
|
||||||
import jakarta.mail.MessagingException;
|
|
||||||
import jakarta.mail.Multipart;
|
|
||||||
import jakarta.mail.Session;
|
|
||||||
import jakarta.mail.Transport;
|
|
||||||
import jakarta.mail.internet.InternetAddress;
|
import jakarta.mail.internet.InternetAddress;
|
||||||
import jakarta.mail.internet.MimeBodyPart;
|
import jakarta.mail.internet.MimeBodyPart;
|
||||||
import jakarta.mail.internet.MimeMessage;
|
import jakarta.mail.internet.MimeMessage;
|
||||||
@@ -69,6 +65,17 @@ public class BOEmailService {
|
|||||||
private String host;
|
private String host;
|
||||||
@Value("${mail.port}")
|
@Value("${mail.port}")
|
||||||
private String port;
|
private String port;
|
||||||
|
@Value("${mail.username}")
|
||||||
|
private String username;
|
||||||
|
@Value("${mail.password}")
|
||||||
|
private String password;
|
||||||
|
@Value("${mail.connectiontimeout}")
|
||||||
|
private String connectiontimeout;
|
||||||
|
@Value("${mail.timeout}")
|
||||||
|
private String timeout;
|
||||||
|
@Value("${mail.writetimeout}")
|
||||||
|
private String writetimeout;
|
||||||
|
|
||||||
|
|
||||||
/* ####################################
|
/* ####################################
|
||||||
이메일 발송 서비스 시작
|
이메일 발송 서비스 시작
|
||||||
@@ -202,12 +209,7 @@ public class BOEmailService {
|
|||||||
SopmalNm = mapper.selectBOEmailSopmalNm(ListOne);
|
SopmalNm = mapper.selectBOEmailSopmalNm(ListOne);
|
||||||
}
|
}
|
||||||
|
|
||||||
Properties props = System.getProperties();
|
Session session = this.getMailSession();
|
||||||
props.put("mail.smtp.host", host);
|
|
||||||
props.put("mail.smtp.port", port);
|
|
||||||
log.info("이메일 발송 SMTP 메소드 진입 확인 => {}", host+":"+port);
|
|
||||||
|
|
||||||
Session session = Session.getInstance(props, null);
|
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(BOEmailVO vo : voList) {
|
for(BOEmailVO vo : voList) {
|
||||||
@@ -337,12 +339,7 @@ public class BOEmailService {
|
|||||||
SopmalNm = mapper.selectBOEmailSopmalNm(ListOne);
|
SopmalNm = mapper.selectBOEmailSopmalNm(ListOne);
|
||||||
}
|
}
|
||||||
|
|
||||||
Properties props = System.getProperties();
|
Session session = this.getMailSession();
|
||||||
props.put("mail.smtp.host", host);
|
|
||||||
props.put("mail.smtp.port", port);
|
|
||||||
log.info("이메일 발송 SMTP 메소드 진입 확인 => {}", host+":"+port);
|
|
||||||
|
|
||||||
Session session = Session.getInstance(props, null);
|
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(BOEmailVO vo : voList) {
|
for(BOEmailVO vo : voList) {
|
||||||
@@ -464,10 +461,8 @@ public class BOEmailService {
|
|||||||
/**
|
/**
|
||||||
* 메시지 내 치환코드에 따라 변경 처리
|
* 메시지 내 치환코드에 따라 변경 처리
|
||||||
* @param cn
|
* @param cn
|
||||||
* @param param
|
|
||||||
* @param replaceMap
|
* @param replaceMap
|
||||||
* @param caseNm
|
* @return String
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public String mssageConvert(String cn, DataMap replaceMap) {
|
public String mssageConvert(String cn, DataMap replaceMap) {
|
||||||
//필요에 따라 db 갈수 도 있으나 현재는 없다고 판단함
|
//필요에 따라 db 갈수 도 있으나 현재는 없다고 판단함
|
||||||
@@ -503,4 +498,37 @@ public class BOEmailService {
|
|||||||
return output;
|
return output;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Session getMailSession(){
|
||||||
|
Properties props = System.getProperties();
|
||||||
|
props.put("mail.smtp.host", host);
|
||||||
|
props.put("mail.smtp.port", port);
|
||||||
|
props.put("mail.smtp.auth", "true");
|
||||||
|
props.put("mail.smtp.starttls.enable", "true");
|
||||||
|
props.put("mail.smtp.starttls.required", "true");
|
||||||
|
|
||||||
|
props.put("mail.smtp.connectiontimeout", connectiontimeout);
|
||||||
|
props.put("mail.smtp.timeout", timeout);
|
||||||
|
props.put("mail.smtp.writetimeout", writetimeout);
|
||||||
|
|
||||||
|
props.put("mail.debug", "true");
|
||||||
|
|
||||||
|
log.info("이메일 발송 SMTP 메소드 진입 확인 => {}", host+":"+port);
|
||||||
|
Session session = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
Authenticator auth = new Authenticator() {
|
||||||
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
|
return new PasswordAuthentication(username, password);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
session = Session.getInstance(props, auth);
|
||||||
|
}catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return session;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -477,7 +477,7 @@ public class BbsmngrController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Policy(AuthPolicy.RESTRICTED)
|
@Policy(AuthPolicy.RESTRICTED)
|
||||||
@RequestMapping(value="/selectBbsIdDplctCnfirm", method = RequestMethod.GET)
|
@RequestMapping(value="/selectBbsIdDplctCnfirm", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResponseEntity<WnbtResponse> selectBbsIdDplctCnfirm(BOBbsVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
public ResponseEntity<WnbtResponse> selectBbsIdDplctCnfirm(BOBbsVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd){
|
||||||
|
|
||||||
List<Map<String, String>> errorList = new ArrayList<>();
|
List<Map<String, String>> errorList = new ArrayList<>();
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import static org.springframework.beans.factory.config.BeanDefinition.ROLE_INFRASTRUCTURE;
|
import static org.springframework.beans.factory.config.BeanDefinition.ROLE_INFRASTRUCTURE;
|
||||||
|
|
||||||
@EnableWebSecurity(debug = true)
|
@EnableWebSecurity(debug = false)
|
||||||
@Configuration
|
@Configuration
|
||||||
//@EnableMethodSecurity
|
//@EnableMethodSecurity
|
||||||
public class ResourceServerConfig {
|
public class ResourceServerConfig {
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
package com.wb.domainserver.util.file.service;
|
package com.wb.domainserver.util.file.service;
|
||||||
|
|
||||||
import com.wb.domainserver.util.file.vo.EmailProperties;
|
import com.wb.domainserver.util.file.vo.EmailProperties;
|
||||||
|
import jakarta.activation.DataHandler;
|
||||||
|
import jakarta.activation.FileDataSource;
|
||||||
|
import jakarta.mail.*;
|
||||||
|
import jakarta.mail.internet.InternetAddress;
|
||||||
|
import jakarta.mail.internet.MimeBodyPart;
|
||||||
|
import jakarta.mail.internet.MimeMessage;
|
||||||
|
import jakarta.mail.internet.MimeMultipart;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -8,13 +15,6 @@ import org.springframework.scheduling.annotation.Async;
|
|||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.activation.DataHandler;
|
|
||||||
import javax.activation.FileDataSource;
|
|
||||||
import javax.mail.*;
|
|
||||||
import javax.mail.internet.InternetAddress;
|
|
||||||
import javax.mail.internet.MimeBodyPart;
|
|
||||||
import javax.mail.internet.MimeMessage;
|
|
||||||
import javax.mail.internet.MimeMultipart;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|||||||
@@ -378,9 +378,13 @@ naverpay:
|
|||||||
real-url: https://pay.naver.com
|
real-url: https://pay.naver.com
|
||||||
|
|
||||||
mail:
|
mail:
|
||||||
host: 127.0.0.1
|
host: mail.soju1sake1.com
|
||||||
port: 25
|
port: 587
|
||||||
username: celebpay@inssoft.kr
|
username: custom@soju1sake1.com
|
||||||
|
password: mail13@$
|
||||||
|
connectiontimeout: 10000
|
||||||
|
timeout: 10000
|
||||||
|
writetimeout: 10000
|
||||||
|
|
||||||
|
|
||||||
#이지웰페이 정보
|
#이지웰페이 정보
|
||||||
|
|||||||
@@ -378,9 +378,13 @@ naverpay:
|
|||||||
real-url: https://pay.naver.com
|
real-url: https://pay.naver.com
|
||||||
|
|
||||||
mail:
|
mail:
|
||||||
host: 127.0.0.1
|
host: mail.soju1sake1.com
|
||||||
port: 25
|
port: 587
|
||||||
username: celebpay@inssoft.kr
|
username: custom@soju1sake1.com
|
||||||
|
password: mail13@$
|
||||||
|
connectiontimeout: 10000
|
||||||
|
timeout: 10000
|
||||||
|
writetimeout: 10000
|
||||||
|
|
||||||
|
|
||||||
#이지웰페이 정보
|
#이지웰페이 정보
|
||||||
|
|||||||
@@ -378,9 +378,13 @@ naverpay:
|
|||||||
real-url: https://pay.naver.com
|
real-url: https://pay.naver.com
|
||||||
|
|
||||||
mail:
|
mail:
|
||||||
host: 127.0.0.1
|
host: mail.soju1sake1.com
|
||||||
port: 25
|
port: 587
|
||||||
username: celebpay@inssoft.kr
|
username: custom@soju1sake1.com
|
||||||
|
password: mail13@$
|
||||||
|
connectiontimeout: 10000
|
||||||
|
timeout: 10000
|
||||||
|
writetimeout: 10000
|
||||||
|
|
||||||
|
|
||||||
#이지웰페이 정보
|
#이지웰페이 정보
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||||
<%@ page import="java.util.Date" %>
|
<%@ page import="java.util.Date" %>
|
||||||
|
<spring:eval expression="@environment.getProperty('mail.username')" var="sndrEmail"/>
|
||||||
<%--
|
<%--
|
||||||
Class Name : EmailPassivSndngC.jsp
|
Class Name : EmailPassivSndngC.jsp
|
||||||
Description : 이메일 수동 발송 폼
|
Description : 이메일 수동 발송 폼
|
||||||
@@ -73,8 +74,8 @@
|
|||||||
<th>보내는 사람</th>
|
<th>보내는 사람</th>
|
||||||
<td>
|
<td>
|
||||||
<div class="td-inner">
|
<div class="td-inner">
|
||||||
<input class="input-text xl" type="text" title="해당 인풋에 대한 설명" name="sndrEmail" id="sndrEmail"
|
<input class="input-text xl" type="text" title="해당 인풋에 대한 설명" name="sndrEmail" id="sndrEmail" value='<c:out value="${sndrEmail}"/>'
|
||||||
placeholder="메일 주소 입력">
|
placeholder="메일 주소 입력" readonly>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -98,7 +99,7 @@
|
|||||||
<th>받는 사람 (직접 입력)</th>
|
<th>받는 사람 (직접 입력)</th>
|
||||||
<td>
|
<td>
|
||||||
<div class="td-inner">
|
<div class="td-inner">
|
||||||
<input class="input-text xl" type="text" title="해당 인풋에 대한 설명" name="recpntEmail" id="recpntEmail"
|
<input class="input-text xl" type="text" title="해당 인풋에 대한 설명" name="recpntEmail" id="recpntEmail"/>'
|
||||||
placeholder="메일 주소는 ,(콤마)로 구분하여 입력">
|
placeholder="메일 주소는 ,(콤마)로 구분하여 입력">
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user