- edited description
Only import older mails than <date>
So, I have been tasked to implement another customization for my employer, and as usual I'd be happy about any form of hints/input I can get about the task. Of course I'll share my work here too, if you want to use my code.
This time it is about the following:
- Add a command -B <YYYYMMDD> to pilerimport, which only imports mails older than the set date.
I'm already on it, and have choosen the following way to work:
-
Run a "SEARCH BEFORE [...]"-query on the IMAP-Server before the contents of folders are fetched.
-
Don't fetch the whole folder contents from 0 to <message>, but rather only grab the mails by UIDs returned by the previous query.
Any ideas or objections about my solution are welcome.
Comments (7)
-
reporter -
reporter - edited description
-
reporter On a small sidenote: I think I found a mistake in pilerimport.c
In the "static struct long_options[]" option "recursive" is flagged as "required_argument". I think it should be "no_argument" at that point.
-
It will be good to have option in pilerimport to set filter for: import email newer than <YYYYMMDD>
-
repo owner I’ve fixed the argument option on the master branch.
-
repo owner In the meantime I added the imapfetch.py utility. It’s a python based tool to download emails from an imap account, and then pilerimport can process them. Check it out at https://bitbucket.org/jsuto/piler/src/master/util/imapfetch.py
I found that it’s much more difficult to implement the imap protocol in C, instead of using a python library for this purpose.
-
repo owner - changed status to closed
I hope it solves your issue, otherwise reopen this ticket.
- Log in to comment