Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 25 lines (22 sloc) 590 Bytes
# sync offlineimap if you have connection to the internet
# and you can ping your imap server successfully.
imapserver=$(cat ~/.offlineimaprc | grep remotehost | awk '{print $3}')
imapactive=$(ps -ef | grep '[o]fflineimap' | wc -l)
netactive=$(ping -c3 $imapserver >/dev/null 2>&1 && echo up || echo down)
mailsync="/usr/bin/offlineimap -u quiet -q"
# kill offlineimap if active, sometimes it hangs
case $imapactive in
killall offlineimap && sleep 5
# Check that you can access the SMTP server
case $netactive in
You can’t perform that action at this time.