rgladwell/imap-upload

folder create on each email upload

mdidomenico4 opened this issue · 4 comments

it looks like based on this snippet of code and confirmed by my server logs, that on each email upload it tries to create the dest folder (either INBOX or --box) i presume. Can the code be modified to check for the existence of the folder first and if it doesn't exit then create it

383         try:
384             self.open()
385             self.imap.create(box)
386             return self.imap.append(box, [], delivery_time, message)

That would be a good idea, unfortunately I just don't have the time to work on this. If you could create a PR that would really help me out.

I think you could just improve the code by having a list of created directories.
That way you can ignore creating the directory again if it has been already created.

Then you can think on adding the code for checking if the directory already exists the first time you ever try to create it (original request of this issue).

I think you could just improve the code by having a list of created directories. That way you can ignore creating the directory again if it has been already created.

Then you can think on adding the code for checking if the directory already exists the first time you ever try to create it (original request of this issue).

My latest pull request ( Google takeout fixes v1 - #36 ) implements the idea that explained here.

Thanks! Closing in favour of #36.