| Line 149... |
Line 149... |
| 149 |
*
|
149 |
*
|
| 150 |
* Verified working 2026-08-31: MAIL FROM:<noreply@smartdukaan.com> returns 250
|
150 |
* Verified working 2026-08-31: MAIL FROM:<noreply@smartdukaan.com> returns 250
|
| 151 |
* over IPv4. It does not authenticate -- Workspace authorises it by allowlisted
|
151 |
* over IPv4. It does not authenticate -- Workspace authorises it by allowlisted
|
| 152 |
* source IP -- so it may legitimately send as noreply@.
|
152 |
* source IP -- so it may legitimately send as noreply@.
|
| 153 |
*
|
153 |
*
|
| 154 |
* googleMailSender is NOT the default: its app password is currently rejected
|
154 |
* googleMailSender is the alternative and its credentials are valid -- verified
|
| 155 |
* with "535 5.7.8 Username and Password not accepted". Point the default back at
|
155 |
* 2026-08-31, AUTH OK on both 465 and 587. Use it by qualifier where a message
|
| 156 |
* it once a valid app password is issued for sdtech@smartdukaan.com.
|
156 |
* must come from the authenticated identity rather than noreply@.
|
| 157 |
*
|
157 |
*
|
| 158 |
* The allowlist covers the IPv4 address only. Over IPv6 the same command is
|
158 |
* SMTP on this host works over IPv4 only, and that is not specific to the relay:
|
| 159 |
* refused with "550 5.7.1 Invalid credentials for relay", so anything that
|
159 |
* over IPv6 the relay answers "550 5.7.1 Invalid credentials for relay" and
|
| - |
|
160 |
* smtp.gmail.com rejects a valid app password with "535 5.7.8 Username and
|
| - |
|
161 |
* Password not accepted". The JVM prefers IPv4, which is the only reason mail
|
| 160 |
* prefers IPv6 will fail here.
|
162 |
* leaves this box at all. Anything that prefers IPv6 will fail on both paths.
|
| 161 |
*/
|
163 |
*/
|
| 162 |
@Bean(name = {"gmailRelaySender", "mailSender"})
|
164 |
@Bean(name = {"gmailRelaySender", "mailSender"})
|
| 163 |
@Primary
|
165 |
@Primary
|
| 164 |
public JavaMailSender getGmailRelaySender() {
|
166 |
public JavaMailSender getGmailRelaySender() {
|
| 165 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
167 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|