Installed Fedora.

# cat /etc/redhat_release | awk ' { print F "> " $0; print ""; }'
Fedora release 14 (Laughlin)

Installed offlineimap from yum, cuz I'm lazy these days.

# yum info offlineimap | awk ' { print F "> " $0; print ""; }'
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
Installed Packages

Name        : offlineimap
Arch        : noarch
Version     : 6.2.0
Release     : 2.fc14
Size        : 611 k
Repo        : installed
From repo   : fedora
Summary     : Powerful IMAP/Maildir synchronization and reader support
URL         : http://software.complete.org/offlineimap/
License     : GPLv2+
Description : OfflineIMAP is a tool to simplify your e-mail reading. With
            : OfflineIMAP, you can read the same mailbox from multiple
            : computers.  You get a current copy of your messages on each
            : computer, and changes you make one place will be visible on all
            : other systems. For instance, you can delete a message on your home
            : computer, and it will appear deleted on your work computer as
            : well. OfflineIMAP is also useful if you want to use a mail reader
            : that does not have IMAP support, has poor IMAP support, or does
            : not provide disconnected operation.

And, lo and behold, every time I run offlineimap and try to redirect output in a crontab, it does not work. Below is my .offlineimaprc.

accounts = Personal, Work
maxsyncaccounts = 3

[Account Personal]
localrepository = Local.Personal
remoterepository = Remote.Personal

[Account Work]
localrepository = Local.Work
remoterepository = Remote.Work

[Repository Local.Personal]
type = Maildir
localfolders = ~/mail/gmail

[Repository Local.Work]
type = Maildir
localfolders = ~/mail/companymail

[Repository Remote.Personal]
type = IMAP
remotehost = imap.gmail.com
remoteuser = username@gmail.com
remotepass = password
ssl = yes
maxconnections = 4 

# Otherwise "deleting" a message will just remove any labels and 
# retain the message in the All Mail folder.
realdelete = no

[Repository Remote.Work]
type = IMAP
remotehost = server.company.tld
remoteuser = username
remotepass = password
ssl = yes
maxconnections = 4 

I have tried TTY.TTYUI, NonInteractive.Quiet and NonInteractive.Basic with different variations. With or without redirection, the crontab entries I try cause problems.

$ crontab -l | awk ' { print F "> " $0; print ""; }'
*/5 * * * * offlineimap >> ~/mail/logs/offlineimap.log 2>&1
*/5 * * * * offlineimap

I always get the same damn error ERROR: No UIs were found usable!. What am I doing wrong!?

  • Oh, and I forgot to add that running just offlineimap from the gnome-terminal it will run fine. Nothing I try in crontab seems to work, yet a lot of sites seem to suggest they got it working. What the hell, man! – songei2f May 18 '11 at 13:35

specify the correct UI with the -u switch

offlineimap -u Noninteractive.Quiet # right
offlineimap -u NonInteractive.Quiet # WRONG!
  • This seems like a pretty easy answer, man. I will check before I mark down out of annoyance. The .offlineimaprc file already specifies the UI. I have tried each one in that conf file, yours included, it still throws the same error. Still, it might be that I need to specify it in the command in the crontab (-u specifically forces the UI you did not specify in the rc file for ease of use). I will be honest though, if it could not read that setting out of the rc file, it would not be able to effectively pull email in the first place because all the account settings are in it as well. – songei2f May 18 '11 at 18:35
  • Just tried it. And apparently my formatting sucks to boot. offlineimap -u NonInteractive.Basic > test ERROR: No UIs were found usable! – songei2f May 19 '11 at 5:04
  • that worked for me on centos... try compiling your own version of offlineimap as an alternative – jamespo May 19 '11 at 10:30
  • 2
    So I wanted to redeem myself after getting pissy with you. You were right, and I was wrong and a big dick about it after fussing for a long time. It turns out certain versions of offlineimap did not ignore case in the UI parameter, and the version in the docs themselves was wrong. I am sorry for being that guy. I am trying to upvote you but it is locked for a period. Sorry. – songei2f May 19 '11 at 13:49
  • So I changed it to an upvote now that the block is up. Again, sorry for not reading you properly and then lecturing. I hate when people do that to me here. – songei2f May 20 '11 at 10:51

If you use 6.3+ version of offlineimap, specify:

offlineimap -u quiet

I know the OP specified version 6.2, however someone searching ServerFault and encountering the above answer might not be aware the ui flags have changed.

  • 1
    Good to know, Jeff. Thanks. I was using a compiled older version in the Fedora RPM, hence this and other oddities I encountered. – songei2f Aug 4 '11 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.