munir131/attachment-downloader

Feature Request: filename/filetype filter

Opened this issue · 0 comments

Use case: I only want to save pdfs. Right now, I'm running cd files && rm -- ^*.pdf in zsh after running this script, in order to remove the unwanted files.

This could instead be filtered during the query using filename:pdf as per the docs.

There is, however, one problem with only modifying the query: if an email has more than one attachment, both will still get downloaded. To make this function as expected, there would also need to be logic in function fetchAndSaveAttachment() to filter out unwanted files.