| Line 179... |
Line 179... |
| 179 |
* "535 Authorization failed: Authenticated user is not authorized to send mail".
|
179 |
* "535 Authorization failed: Authenticated user is not authorized to send mail".
|
| 180 |
*
|
180 |
*
|
| 181 |
* Also answers to "mailSender" so the many unqualified JavaMailSender
|
181 |
* Also answers to "mailSender" so the many unqualified JavaMailSender
|
| 182 |
* injections resolve here rather than needing to be touched.
|
182 |
* injections resolve here rather than needing to be touched.
|
| 183 |
*/
|
183 |
*/
|
| 184 |
@Bean(name = {"googleMailSender", "mailSender"})
|
184 |
@Bean(name = "googleMailSender")
|
| 185 |
@Primary
|
- |
|
| 186 |
public JavaMailSender googleMailSender() {
|
185 |
public JavaMailSender googleMailSender() {
|
| 187 |
JavaMailSenderImpl mailSender = new AuthenticatedIdentityMailSender();
|
186 |
JavaMailSenderImpl mailSender = new AuthenticatedIdentityMailSender();
|
| 188 |
mailSender.setHost("smtp.gmail.com");
|
187 |
mailSender.setHost("smtp.gmail.com");
|
| 189 |
mailSender.setPort(465);
|
188 |
mailSender.setPort(465);
|
| 190 |
mailSender.setUsername("sdtech@smartdukaan.com");
|
189 |
mailSender.setUsername("sdtech@smartdukaan.com");
|
| Line 201... |
Line 200... |
| 201 |
props.put("mail.smtp.writetimeout", "120000");
|
200 |
props.put("mail.smtp.writetimeout", "120000");
|
| 202 |
|
201 |
|
| 203 |
return mailSender;
|
202 |
return mailSender;
|
| 204 |
}
|
203 |
}
|
| 205 |
|
204 |
|
| - |
|
205 |
/**
|
| - |
|
206 |
* The default sender.
|
| - |
|
207 |
*
|
| - |
|
208 |
* Verified working 2026-08-31: MAIL FROM:<noreply@smartdukaan.com> returns 250
|
| - |
|
209 |
* over IPv4. It does not authenticate -- Workspace authorises it by allowlisted
|
| - |
|
210 |
* source IP -- so it may legitimately send as noreply@.
|
| - |
|
211 |
*
|
| - |
|
212 |
* googleMailSender is NOT the default: its app password is currently rejected
|
| - |
|
213 |
* with "535 5.7.8 Username and Password not accepted". Point the default back at
|
| - |
|
214 |
* it once a valid app password is issued for sdtech@smartdukaan.com.
|
| - |
|
215 |
*
|
| - |
|
216 |
* The allowlist covers the IPv4 address only. Over IPv6 the same command is
|
| - |
|
217 |
* refused with "550 5.7.1 Invalid credentials for relay", so anything that
|
| - |
|
218 |
* prefers IPv6 will fail here.
|
| - |
|
219 |
*/
|
| 206 |
@Bean(name = "gmailRelaySender")
|
220 |
@Bean(name = {"gmailRelaySender", "mailSender"})
|
| - |
|
221 |
@Primary
|
| 207 |
public JavaMailSender getGmailRelaySender() {
|
222 |
public JavaMailSender getGmailRelaySender() {
|
| 208 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
223 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
| 209 |
mailSender.setHost("smtp-relay.gmail.com");
|
224 |
mailSender.setHost("smtp-relay.gmail.com");
|
| 210 |
mailSender.setPort(587);
|
225 |
mailSender.setPort(587);
|
| 211 |
|
226 |
|
| Line 588... |
Line 603... |
| 588 |
|
603 |
|
| 589 |
if (args.containsOption("checkItelImeiActivationNew")) {
|
604 |
if (args.containsOption("checkItelImeiActivationNew")) {
|
| 590 |
scheduledTasks.checkItelImeiActivationNew(LocalDate.now(), 15);
|
605 |
scheduledTasks.checkItelImeiActivationNew(LocalDate.now(), 15);
|
| 591 |
System.exit(0);
|
606 |
System.exit(0);
|
| 592 |
}
|
607 |
}
|
| - |
|
608 |
// One tick's worth (50 imeis), not a full pass -- the backlog is cleared by the
|
| - |
|
609 |
// scheduled 5-minute ticks. Useful for checking the endpoint by hand.
|
| - |
|
610 |
if (args.containsOption("checkCarlcareImeiActivation")) {
|
| - |
|
611 |
scheduledTasks.checkCarlcareImeiActivation();
|
| - |
|
612 |
System.exit(0);
|
| - |
|
613 |
}
|
| 593 |
if (args.containsOption("once")) {
|
614 |
if (args.containsOption("once")) {
|
| 594 |
|
615 |
|
| 595 |
if (args.containsOption("autoClosePurchaseOrders")) {
|
616 |
if (args.containsOption("autoClosePurchaseOrders")) {
|
| 596 |
poScheduler.autoClosePurchaseOrders();
|
617 |
poScheduler.autoClosePurchaseOrders();
|
| 597 |
}
|
618 |
}
|