File tree Expand file tree Collapse file tree 4 files changed +9
-3
lines changed
backend/src/workers/email-signature
micro-services/emails-fetcher Expand file tree Collapse file tree 4 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -129,11 +129,14 @@ export class EmailSignatureProcessor {
129129 body : string ,
130130 messageDate : string
131131 ) : Promise < void > {
132- const signature = this . extractSignature ( body ) ;
132+ const signature =
133+ this . extractSignature ( body ) ??
134+ body . trim ( ) . split ( '\n' ) . slice ( - 10 ) . join ( '\n' ) ;
133135
134136 if ( ! signature || ! isUsefulSignatureContent ( signature ) ) {
135137 this . logging . info ( 'No signature found; skipping cache' , {
136138 email,
139+ body : signature ,
137140 miningId
138141 } ) ;
139142 return ;
Original file line number Diff line number Diff line change @@ -48,4 +48,5 @@ IMAP_MAX_CONNECTIONS = 10 # ( REQUIRED ) Maximum simultaneous IMAP
4848# ==============| API - FETCHING CONFIGURATION |============= #
4949FETCHING_BATCH_SIZE_TO_SEND = 200 # Number of messages per sending batch
5050FETCHING_CHUNK_SIZE_PER_CONNECTION = 2000 # Number of messages fetched per IMAP connection chunk
51- FETCHING_MAX_CONNECTIONS_PER_FOLDER = 10 # Maximum concurrent connections per IMAP folder
51+ FETCHING_MAX_CONNECTIONS_PER_FOLDER = 10 # Maximum concurrent connections per IMAP folder
52+ FETCHING_MAX_BODY_TEXT_PLAIN_SIZE = 10500 # Maximum concurrent connections per IMAP folder
Original file line number Diff line number Diff line change @@ -569,7 +569,7 @@ export default class ImapEmailsFetcher {
569569 continue ;
570570
571571 const text = decodeQuotedPrintable (
572- msg . bodyParts ?. get ( partId ) ?. toLocaleString ( ) ?? '' ,
572+ msg . bodyParts ?. get ( partId ) ?. toString ( ) ?? '' ,
573573 'utf-8'
574574 ) ;
575575
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ npm run dev:backend-api &
22npm run dev:micro-services-emails-fetcher &
33npm run dev:backend-worker &
44npm run dev:backend-email-worker &
5+ npm run dev:backend-email-signature-worker &
56npm run dev:backend-mock-external-services &
7+ npm run dev:micro-services-emails-fetcher &
68npm run dev:supabase-functions &
79npm run dev:frontend &
810wait
You can’t perform that action at this time.
0 commit comments