OfflineIMAP / offlineimap

Read/sync your IMAP mailboxes (python2) [LEGACY: move to offlineimap3]
http://www.offlineimap.org
Other
1.78k stars 361 forks source link

post- and presync hooks for quick and full syncs #702

Open dopefishh opened 3 years ago

dopefishh commented 3 years ago

The postsynchook and presynchook are configuration options to execute a process before of after synchronisation.

In my case it would be useful to discriminate between quick syncs and full syncs in regards to post- and presynchooks. My postsynchook is quite CPU intensive and I would like to only run it on full syncs and skip it on quick syncs.

To keep it backwards compatible I propose to add four new configuration options so that there are a total of six synchooks:

I'm fine with implementing this but I wanted to poll enthusiasm first.

nicolas33 commented 3 years ago

I'd merge patches. You might like to contribute to offlineimap3, though.

nicolas33 commented 3 years ago

BTW, I think the best way to implement this is not to introduce yet another configuration option. I'd rather add a new "context" argument object when calling the user function.