mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	Fixes the logging of an email message to be something useful (#6901)
This commit is contained in:
		@@ -9,6 +9,7 @@ from datetime import date
 | 
				
			|||||||
from datetime import timedelta
 | 
					from datetime import timedelta
 | 
				
			||||||
from fnmatch import fnmatch
 | 
					from fnmatch import fnmatch
 | 
				
			||||||
from pathlib import Path
 | 
					from pathlib import Path
 | 
				
			||||||
 | 
					from typing import TYPE_CHECKING
 | 
				
			||||||
from typing import Optional
 | 
					from typing import Optional
 | 
				
			||||||
from typing import Union
 | 
					from typing import Union
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -584,12 +585,17 @@ class MailAccountHandler(LoggingMixin):
 | 
				
			|||||||
        total_processed_files = 0
 | 
					        total_processed_files = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for message in messages:
 | 
					        for message in messages:
 | 
				
			||||||
 | 
					            if TYPE_CHECKING:
 | 
				
			||||||
 | 
					                assert isinstance(message, MailMessage)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if ProcessedMail.objects.filter(
 | 
					            if ProcessedMail.objects.filter(
 | 
				
			||||||
                rule=rule,
 | 
					                rule=rule,
 | 
				
			||||||
                uid=message.uid,
 | 
					                uid=message.uid,
 | 
				
			||||||
                folder=rule.folder,
 | 
					                folder=rule.folder,
 | 
				
			||||||
            ).exists():
 | 
					            ).exists():
 | 
				
			||||||
                self.log.debug(f"Skipping mail {message}, already processed.")
 | 
					                self.log.debug(
 | 
				
			||||||
 | 
					                    f"Skipping mail '{message.uid}' subject '{message.subject}' from '{message.from_}', already processed.",
 | 
				
			||||||
 | 
					                )
 | 
				
			||||||
                continue
 | 
					                continue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            try:
 | 
					            try:
 | 
				
			||||||
@@ -659,7 +665,7 @@ class MailAccountHandler(LoggingMixin):
 | 
				
			|||||||
    ):
 | 
					    ):
 | 
				
			||||||
        processed_attachments = 0
 | 
					        processed_attachments = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        consume_tasks = list()
 | 
					        consume_tasks = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for att in message.attachments:
 | 
					        for att in message.attachments:
 | 
				
			||||||
            if (
 | 
					            if (
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user