Feature #71

pre/post sync hooks

Added by Sylvain FORET 140 days ago. Updated 8 days ago.

Status :Closed Start :05/24/2008
Priority :Normal Due date :
Assigned to :- % Done :

100%

Category :Other
Target version :-
Resolution :


Description

It would be great if offlineimap could run arbitrary commands before and after sync.
For example, I'm using a pre-sync hook to run 'imapfilter'.
One could also use a post-sync hook to run a spam detector.

Anyway, here is a patch that implements it.
Let me know if you would suggest any improvements.
If this patch was accepted the doc would need to be updated accordingly.

Cheers -- SF

offlineimap_hooks.diff - This is a git diff of my code implementing the feature (3 KB) Sylvain FORET, 05/24/2008 09:04 AM

offlineimap_hooks.diff (3.7 KB) Sias Mey, 10/01/2008 11:12 AM

Associated revisions

Revision 936fe1f43e9ded5ae66b59cb39e6c8d188e637a4
Added by John Goerzen 10 days ago

Added docs for hooks

Patch from Sias Mey

fixes #71

Revision ab43d7454962e3fae5264b19402bbd7ef75464dc
Added by John Goerzen 10 days ago

Applied pre/post sync hooks

Patch from Sylvain FORET in refs #71

History

10/01/2008 08:51 AM - Sias Mey

Thank you,

This is an awesome addition. and it seems to be working quite well for me.

Even without the docs I managed to figure it out easily enough, Please implement this officially ASAP as I think the whole offlineimap + imapfilter combo is fairly common but rather more anoying to set up in a cron.

This also assures that imapfilter doesent mess with mailboxes while offlineimap is busy syncing.

I suppose the postsync hook could also be used to send sync summaries if the offlineimap process is mainly headless.

10/01/2008 09:00 AM - John Goerzen

Would you be willing to send me a documentation patch? It should, at minimum, be documented via comments and examples in the sample offlineimap.conf.

I really don't like applying patches that don't update the documentation as well. It forces me to spend quite a bit of time merging them, which I don't have as a general rule. If one of you could supply the docs, I'd be happy to look at this ASAP.

10/01/2008 11:12 AM - Sias Mey

OK ... there you go. Some basic documentation and the patch provided by SF

I added the explanation in the Account section just under the quick and autorefresh configs.

Hope that help with an awesome App.

10/01/2008 01:23 PM - John Goerzen

  • % Done changed from 0 to 100
  • Status changed from New to Closed

10/01/2008 01:23 PM - John Goerzen

Thanks much to both of you. Both patches now in git.

10/03/2008 06:22 AM - Sylvain FORET

Sorry that I could not help more, I was away for the whole week and did not see any of this happen until I came back just a couple of hours ago.

Anyway, many thanks Sias for the patch, and John for applying it!

Also available in: Atom PDF