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 downloading pdf #22

Closed suportebestbox closed 2 years ago

suportebestbox commented 3 years ago

Hi, when I try to run the attachment-downloader I get the error bellow:

2021-08-10 12:02:35,616 - WARNING - Overwriting file: '/COLABORADORES/1111/202105-2181993041.pdf' 2021-08-10 12:02:35,622 - INFO - Downloaded and parsed mail 'Recibo de pagamento tipo Recibo Mensal ref. 07/2021' with 1 attachments 2021-08-10 12:02:35,622 - 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

This is difficult to diagnose without more detail around the email which it is failing to access, but I suspect there is an issue or missing Date attribute for the email

jamesridgway commented 2 years ago

The latest version has better tolerances for mail servers that don't prvide a standard date header