Return code of offlineimap

Ng Oon-Ee ngoonee at
Thu Jan 7 09:33:31 GMT 2010

On Thu, 2010-01-07 at 08:39 +0100, Tassilo Horn wrote:
> Hi all,
> first of all, let me mention that offlineimap is an incredible, central
> part of my email setup.  So thanks a lot!
> I use a simple shell script for getting mail.  It's basically
>   offlineimap -o && notmuch new && write_some_log_entry
> and a cronjob runs it every 10 minutes.  But sometimes, I'm impatient,
> and call it from the cmd line.  Sometimes, I run it without knowing that
> offlineimap is already running.  Then I get a message, that another
> instance is already running on that metadata dir, and it finishes.  But
> still, notmuch (a mail indexer) is run in that case.
> So it seems, offlineimap returns a zero exit code when it cannot run.
> Could that be changed to return non-zero exit codes when it couldn't run
> properly, like 1 for already running, 2 for a network problem, 3 for a
> crash?
> This would make it easier to write shell scripts using offlineimap.
> Bye,
> Tassilo

I simply check using pidof /usr/bin/offlineimap

More information about the OfflineIMAP-project mailing list