jamesridgway / attachment-downloader

Simple tool for downloading email attachments for all emails in a given folder using an IMAP client
MIT License
85 stars 39 forks source link

ERROR - 'Struct' object has no attribute 'date' #27

Closed Truciolo99 closed 2 years ago

Truciolo99 commented 2 years ago

2021-12-30 17:14:14,603 - INFO - Processing message 'b'27982'' subject 'Watchguard' 2021-12-30 17:14:14,626 - INFO - Downloaded and parsed mail 'Watchguard' with 0 attachments 2021-12-30 17:14:14,627 - INFO - Processing message 'b'27983'' subject 'Watchguard' 2021-12-30 17:14:14,649 - INFO - Downloaded and parsed mail 'Watchguard' with 0 attachments 2021-12-30 17:14:14,650 - INFO - Processing message 'b'27984'' subject 'Watchguard' 2021-12-30 17:14:14,673 - INFO - Downloaded and parsed mail 'American School: 192.168.200.246 - System Alarm' with 0 attachments 2021-12-30 17:14:14,673 - ERROR - 'Struct' object has no attribute 'date' Traceback (most recent call last): File "/usr/local/bin/attachment-downloader", line 146, in parsed_message_date = dateparser.parse(message.date) AttributeError: 'Struct' object has no attribute 'date' Traceback (most recent call last): File "/usr/local/bin/attachment-downloader", line 146, in parsed_message_date = dateparser.parse(message.date) AttributeError: 'Struct' object has no attribute 'date'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/attachment-downloader", line 149, in logging.error("Skipping message '%s' subject '%s' because date can not be parsed '%s'", uid, subject, message.date) AttributeError: 'Struct' object has no attribute 'date'

jamesridgway commented 2 years ago

In 1.1.7 I have added some better handling for messages without dates