Python functions in offlineimap config

Valentin Heidelberger heidelberger at
Wed Mar 23 10:22:34 GMT 2016

@Nicolas Sorry, forgot to put the list as CC.

Got it working with a shell script as postsynchook. Works like charm!

Am 22.03.2016 um 16:20 schrieb Nicolas Sebrecht:
> On Tue, Mar 22, 2016 at 02:42:02PM +0100, Valentin Heidelberger wrote:
>> Hey folks,
>> I was wondering whether it is also possible to call a python function
>> when executing offlineimap. I have read in the documentation that one
>> can call functions from the configuration to assign their output to
>> variables and wondered if its also possible to call a function, that
>> moves some files for example, and hand it variables like remoteuser.
> Function support depends on the options. It's not a feature working for
> every option.
>> That would be very nice for a migration I want to do.
> I'd like to know more about your use case because I never heard this
> need before.
>>                                                       If there is
>> another way to execute some python after one mailbox has been migrated,
>> feel free to let me know.
> OfflineIMAP provide the presynchook and postsynchook configuration
> options.
> You might also like to start with something like
>   `offlineimap && start_script`

Valentin Heidelberger
IT Systems Integrator Apprentice

Univention GmbH
be open.
28359 Bremen
Tel. : +49 421 22232-96
Fax : +49 421 22232-99

heidelberger at

Geschäftsführer: Peter H. Ganten
HRB 20755 Amtsgericht Bremen
Steuer-Nr.: 71-597-02876

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the OfflineIMAP-project mailing list