Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Show changed files | Details | Compare with Previous | Blame | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
37478 37 d 6 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/mail/ mail: MailOutboxService implements MailQueue

Adds the single entry point, queue(MailRequest). The twenty-odd queueMail*
overloads remain as delegates because ~112 call sites use them, but they now
funnel through one path rather than each building their own argument list.

Selecting the transport moves here too: MailSenderType.GOOGLE maps to the
authenticated sender, anything else to the relay.
 
37473 37 d 7 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/mail/ mail: retire the SENDGRID sender label

SendGrid was never actually used by the outbox -- resolveSender() already fell
through to the Workspace relay for it, which is why outbox mail kept working
while direct JavaMailSender injections failed.

Two senders remain, each named for what it is:
GOOGLE - authenticates as sdtech@smartdukaan.com; AuthenticatedIdentityMailSender
rewrites every From to that identity, because Workspace binds an
authenticated session to one address and rejects any other with
'535 Authorization failed: Authenticated user is not authorized to send mail'
RELAY - Workspace relay, no auth, authorised by source IP, may send as noreply@

Default convenience methods now route to RELAY explicitly rather than through a
label that named a provider we do not use.
 
37361 49 d 3 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Mail outbox: one transaction per mail, retry once more, stable Message-ID

processPendingMails ran the whole batch in a single REQUIRES_NEW transaction, so a
crash mid-batch rolled back the status of every mail already delivered in that cycle
and the next run re-sent them.

- Split into selectPendingIds (read-only) plus sendOne per mail, each REQUIRES_NEW via
a @Lazy self-reference so the proxy actually applies. Outcome is committed as soon
as it is known; a crash now loses at most the mail in flight.
- MailOutbox.selectPending retries FAILED rows once more (retryCount < 2).
- Stable per-row Message-ID so a retry arrives as the same message and the receiving
server can collapse it instead of showing a duplicate.
 
36399 163 d 9 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Replace mailSender (SendGrid) with gmailRelaySender - SendGrid API key expired/revoked  
36250 178 d 16 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Sender-type-aware mail cleanup: 6 months for SendGrid/Relay, 1 month for Google SMTP  
36249 178 d 16 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/mail/ Route all SendGrid mail through Google Workspace Relay  
36245 178 d 16 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/mail/ Add Google Workspace SMTP Relay as third mail sender (RELAY) alongside SendGrid and Google  
36067 195 d 11 h aman /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Fix:Duplicate Mail Sending issue and bug fixing  
36059 196 d 5 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Fix mail outbox: load by ID instead of selectPending filter to prevent cascade failure  
35960 214 d 11 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/mail/ MailOutboxService: dev recipient guard (no mail to real users in non-prod), fix self-invocation for @Async/@Transactional via @Lazy self-proxy  
35956 214 d 11 h amit /trunk/profitmandi-dao/src/main/ Mail outbox pattern: persist mail in transaction, send async after commit. Fixes lock contention between /cancelOrder and /om/addBillingDetailsForGrouppedOrders caused by SMTP calls inside transactions holding DB locks.