Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to filter messages by date #64

Merged
merged 1 commit into from
Mar 3, 2024

Conversation

patrykgruszka
Copy link
Contributor

This PR adds the ability to retrieve only messages within a given date range by passing arguments:

  • --start-date START_DATE: Start date for filtering messages (YYYY-MM-DD)
  • --end-date END_DATE: End date for filtering messages (YYYY-MM-DD)

@ansemjo
Copy link
Owner

ansemjo commented Feb 29, 2024

Thank you very much Patryk!

Could you give an example of a possible use-case to restrict fetching to a specific timeframe? Do you just want to avoid downloading very old messages or do you use these flags to create batches per timeframe (daily, weekly, ...) by specifying start and end times with a script? I'm trying to understand if these options might be better placed in the configuration file.

@patrykgruszka
Copy link
Contributor Author

In my case it's a mailbox that contains huge amounts of logs. Downloading the whole mailbox would take hours and I only need the most recent. That's the reason for the date filter. Moving the filter to the configuration gives even more flexibility than the arguments. Looks good to me.

@ansemjo
Copy link
Owner

ansemjo commented Mar 3, 2024

I've been thinking about this some more and I think that adding end-date to a config file wouldn't really make sense. Either it's a date in the past, then you'll never archive any new mails because normally old mails don't just pop up on your server. Or it's a date in the future, but then you can just stop archiving there.

Either way, I've chosen to just accept your change as-is. Thanks again!

@ansemjo ansemjo merged commit 37259d3 into ansemjo:main Mar 3, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants