Offlineimap doesn't get mails when running from cron

Thomas Kahle tomka at
Mon Jul 28 13:55:33 BST 2014


On 23/07/14 10:07, Niels Kobschaetzki wrote:
> On 23/07, Niels Kobschaetzki wrote:
>> Hi,
>> I googled a lot but I just cannot get offlineimap to run from a cronjob.
>> Looking into the logs and exits without an error which doesn't mean
>> anything to me. And of course it doesn't get any mails.
>> */5 * * * * /usr/bin/offlineimap -q -f INBOX -u TTYUI >
>> /home/user/mycommand.log
>> */20 * * * * /usr/bin/offlineimap -u quiet > /home/user/mycommand.log
>> I want to write into the mycommand.log right now just for
>> debugging-reasons but the file stays empty
>> The output in syslog shows the following:
>> Jul 23 06:08:01 venus CRON[19935]: (nik) CMD (/usr/bin/offlineimap -q -f
>> INBOX -u TTYUI >/home/nik/mycommand.log)
>> Jul 23 06:08:02 venus CRON[19934]: (CRON) info (No MTA installed,
>> discarding output)
>> Of course I tried basic and quiet as UIs as well.
>> Any ideas?
> It works now. 1) It didn't want to work with gnome-keyring and the fixes
> I found in
> the net, didn't work out for me
> 2) "offlineimap" works from a cronjob while "offlineimap -f INBOX" or
> "offlineimap -q -f INBOX" doesn't work. Logging into the account is no
> problem apparently but offlineimap doesn't get any mails.

Quite generally, if a command works from the commandline, but not
from cron, then it can have to do with the shell environment.
Reaching gnome-keyring via dbus is one example of a thing that
needs special setup to work from cron.


Thomas Kahle

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

More information about the OfflineIMAP-project mailing list