fix extension

This commit is contained in:
Antonio J. Delgado 2025-03-29 08:10:06 +02:00
parent f165882786
commit 9675962c17

View file

@ -159,8 +159,7 @@ class BackupImap:
subject = f"{original_subject}_{counter}" subject = f"{original_subject}_{counter}"
message_path = os.path.join( message_path = os.path.join(
mailbox_path, mailbox_path,
subject, f"{subject}.eml"
'.eml'
) )
counter += 1 counter += 1
try: try:
@ -177,8 +176,7 @@ class BackupImap:
if error.errno == 36: # File name too long if error.errno == 36: # File name too long
message_path = os.path.join( message_path = os.path.join(
mailbox_path, mailbox_path,
f"message_uid_{message_uid.decode()}", f"message_uid_{message_uid.decode()}.eml"
'.eml'
) )
with open(message_path, 'wb') as file_pointer: with open(message_path, 'wb') as file_pointer:
file_pointer.write(data) file_pointer.write(data)