Conky IMAPS Configuration with Stunell on Debian

Conky is a free, light-weight system monitor for X, that displays information on your desktop.

Stunnel is a program designed to work as SSL encryption wrapper, thus can be used to add SSL functionality to Conky’s built-in IMAP feature. 


We assume you already have Conky installed and configured. However, if not, install it:

# apt-get update && apt-get install conky

Install Stunell:

# apt-get install stunnel4


Create /etc/stunnel/stunnel.conf file with appropriate IMAPS settings:

# cat > /etc/stunnel/stunnel.conf <<EOF
client = yes
accept = 993
connect =
sslVersion = TLSv1

Open /etc/default/stunnel4 and change ENABLED field value from “0” to “1” to have the tunnels start up automatically on system boot. File then should look something as below:

# cat /etc/default/stunnel4

Restart the daemon:

# /etc/init.d/stunnel4 restart

Check with netstat to make sure Stunnel is listening on IMAPS port 993:

# netstat -nltp | grep 993
tcp  0   0*   LISTEN   21974/stunnel4

IMAP settings look as below in our /etc/conky/conky.conf file:

# grep imap /etc/conky/conky.conf
imap localhost [email protected] * -i 300 -p 993 -r 3
${color lightblue}Inbox: ${color white}${imap_unseen}/${imap_messages}

Parameters explained:

  1. localhost: use localhost as a mail server to connect to
  2. [email protected]: our mailbox username
  3. “*”: our mailbox password (see below)
  4. -i:  interval (in seconds) to check for new mail
  5. -p: port to use for connection
  6. -r: retries

According to, the default port is 143, the default folder is “INBOX”, the default interval is 5 minutes, and the default number of retries before giving up is 5. If the password is supplied as “*”, you will be prompted to enter the password when Conky starts.

Once done, restart conky. Below is the image representing my conky’s display (note “Inbox” field for IMAPS mailbox messages).

Leave a Reply

Your e-mail address will not be published. Required fields are marked *