offlineimap icon indicating copy to clipboard operation
offlineimap copied to clipboard

Include exit code of pre/post sync hooks when exiting?

Open learmj opened this issue 7 years ago • 2 comments

General informations

  • system/distribution (with version): Red Hat Enterprise Linux Server release 7.4 (Maipo)
  • offlineimap version (offlineimap -V): offlineimap v7.1.4, imaplib2 v2.57 (bundled), Python v2.7.5, OpenSSL 1.0.1e-fips 11 Feb 2013
  • Python version: Python 2.7.5
  • server name or domain:
  • CLI options: timeout --foreground --signal=QUIT 4m
    /path/to/offlineimap.git/offlineimap.py
    -c /path/to/offlineimaprc

Steps to reproduce the error

No error as such, but I was wondering if there was some way for offlineimap to allow the exit code of presynchook or postsynchook to be returned by offlineimap itself? For example, I use a postsynchook which I've just noticed in my syslog is misbehaving, and exiting with error 127. However, offlineimap exists with zero indicating that everything is ok. Am I able to somehow make offlineimap include the exit value of the postsynchook when generating it's exit code upon exit? Or does the exit code of the pre/postsync hooks need to be managed separately (eg send result to a file for testing after offlineimap has exited)? Thanks! Matt (happy offlineimap user for many years)

learmj avatar Jan 15 '18 19:01 learmj

Great point. When the presynchook or postsynchook returns an error code, offlineimap should also return this error code to the caller, as this error is probably something needing fixing.

chris001 avatar Jan 15 '18 19:01 chris001

+1

elshize avatar Aug 22 '21 19:08 elshize