Michal Čihař - Blog Archives for IMAP

IMAP utils are completely clean of adware

I never knew, that someone would certify few lines of Python code, but Softpedia did so:

   Your product "IMAP utils 0.2" has been tested by the Softpedia labs and
   found to be completely clean of adware/spyware components.

   We are impressed with the quality of your product and encourage you to
   keep this high standards in the future.

   To assure our visitors that "IMAP utils 0.2" is clean, we have granted
   it with the "100% FREE" Softpedia award. Moreover, to let your users
   know about this certification, you may display this award on your
   website, on software boxes or inside your product.

I still wonder why simplest "product" I ever released is getting so much publicity…

IMAP utils 0.1

For long time I use few Python scripts to manage mails on IMAP account. On Tuesday I decided to put them under version control and improve them a bit, because I didn't want to have login information hardcoded in every script.

I made several improvements, added support for distutils and then I decided that I could also release this to public. I've named them IMAP utils, I made announcement to freshmeat.net and Python Cheese Shop (thanks to ./setup.py register) and now I wonder that these simple scripts have over hundred downloads and eight subscribers. Maybe it is not that useless as I thought :-).

Přehled složek v IMAPu

Už opět nastala situace, že mi napsání vlastního skriptu připadalo jednodušší než hledání hotového nástroje :-). Pokud se tedy někdo potřebuje podívat na stav složek na IMAPu, může použít následující skriptík.

import sys
import imaplib

m = imaplib.IMAP4('SERVER')
res = m.login('USERNAME', 'PASSWORD')
if res[0] != 'OK':
    sys.stderr.write("login: %s\n" % str(res))

typ, list = m.list()
if typ != 'OK':

for item in list:
    vals = item.split()
    name = vals[2][1:][:-1]
    typ, val = m.status(name, '(UNSEEN RECENT)')
    if typ != 'OK':
    print val[0]