feat(notify): 이메일 출입증 발송(EmailPassNotifier) 추가

- spring-boot-starter-mail 기반 EmailPassNotifier: acs.sms.provider=email일 때 활성.
  발신=acs.mail.from(기본 dept_itcm000@bok.or.kr), 수신=방문자 email,
  QR PNG를 첨부하고 공개 출입증 링크를 본문에 포함. 발송 실패는 log(승인 롤백 없음).
- provider 스위치에 email 추가(dev/hanbank/email). prod는 spring.mail.* 를 ACS_MAIL_*
  env로 주입(인증 선택), .env.example·docker-compose 반영.
- 테스트: EmailPassNotifierTest(발신/수신/제목/QR 첨부 구성, 이메일 없으면 미발송).

검증: 전체 5개 테스트 통과. 로컬 SMTP(aiosmtpd:1025)로 실발송 e2e 확인 —
MAIL FROM=dept_itcm000@bok.or.kr, RCPT=visitor, 제목/본문/pass-qr.png 첨부 수신 확인.

주의: 발신자가 bok.or.kr이면 SPF/DMARC상 실제 사내 SMTP 릴레이를 거쳐야 하며,
ACS_MAIL_HOST/PORT(및 필요 시 인증) 확보 후 실환경 발송 배선 필요.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
unknown
2026-07-03 15:19:34 +09:00
parent 2a6d3a620b
commit 6946bf15bb
7 changed files with 224 additions and 10 deletions

View File

@@ -8,11 +8,23 @@ POSTGRES_DB=acs
# Web (nginx) published port
WEB_PORT=80
# ===== Pass delivery (SMS/LMS) =====
# ===== Pass delivery =====
# dev : no network — logs the message + writes the QR image to the outbox
# hanbank : sends an LMS with the public pass link via the in-house DMZ API
# email : emails the pass (QR attached) via the SMTP relay below
ACS_SMS_PROVIDER=dev
ACS_SMS_API_URL=http://210.104.132.59:8000
# ===== Email pass delivery (only used when ACS_SMS_PROVIDER=email) =====
# Sender = shared departmental mailbox; relay = corporate SMTP server.
ACS_MAIL_FROM=dept_itcm000@bok.or.kr
ACS_MAIL_HOST=
ACS_MAIL_PORT=25
# Set only if the relay requires SMTP AUTH (internal relays often do not):
ACS_MAIL_USERNAME=
ACS_MAIL_PASSWORD=
ACS_MAIL_SMTP_AUTH=false
ACS_MAIL_STARTTLS=false
# URL the SMS link points to — MUST be reachable from the visitor's phone
# (the server's real address/domain, not localhost). e.g. https://acs.example.co.kr
ACS_PUBLIC_BASE_URL=http://localhost