fix: 발신 주소 설정 필수화 - #134
Merged
Merged
Conversation
The SMTP username fallback only held while that username was itself an address. With a hosted sending service it is a credential, so the fallback is guaranteed to produce a From that is not an address: notifications would retry three times and park FAILED, and account mails, which have no retry, would be lost outright. The value is now validated when the bean is built, so a bad one fails the context refresh and the deploy script's readiness gate rolls back instead. Strict parsing accepts a bare local part with no domain, which is exactly the shape a credential has, so validate() is what actually rejects it. The configured string is kept and parsed by MimeMessageHelper rather than pre-parsed here, because the helper re-encodes the display name in its own charset and a pre-parsed address would carry raw bytes into the header. Also sets connection, read and write timeouts on the mail session. JavaMail waits forever by default, and the notification dispatcher sends on a single thread, so one stalled handshake holds every queued mail and the mail health indicator with it.
The guard's javadoc claimed nothing carries the value, and that was false: the chained AddressException quotes the string it rejected, that cause is what the journal renders, and the log masking is key=value shaped so it does not catch a quoted bare token. In the one misconfiguration this guard exists for, that token is a credential. The cause is dropped; the message already names the required shape. Two tests now pin which branch rejected rather than only the exception type, one of them asserting the value does not appear in the message. Also corrects the timeout comment. The notification dispatcher does drain its batch serially, but account mail runs on a pool of two, and the comment as written read as though mail were single-threaded system-wide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 작업내용
pickle.mail.from의${spring.mail.username}폴백 제거,PICKLE_MAIL_FROM필수화FAILED, 재시도 없는 계정 메일은 유실strict파싱이 도메인 없는 로컬 파트를 통과시키므로validate()추가MimeMessageHelper에 위임해 표시 이름 charset 재인코딩 유지AddressException연결 해제, 그 원인 메시지가 거부한 문자열을 인용README.md의PICKLE_MAIL_FROM행을 필수, 기본값 없음으로 정정_HOST,_USERNAME,_PASSWORD행은 미실측이라 무수정⭐️ 검증
SmtpMailSenderTest7건: 빈 값 거부, 도메인 없는 토큰 거부, 주소 둘 거부, 표시 이름 RFC 2047 인코딩💬 리뷰 포인트
InternetAddress의 갈림