Michal Čihař - Blog Archives for IMAP

IMAP utils 0.5

I've just released new version of imap-utils. Main reason for new release was change on PyPI which now needs files to be hosted there.

However the new release also comes with other changes:

  • Changed license to GPL3+.
  • Various coding style fixes.

Also this is first release done from Git repository hosted on GitHub.

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.

 #!/usr/bin/python
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))
    sys.exit(1)

typ, list = m.list()
if typ != 'OK':
    sys.stderr.write("list:")
    sys.exit(2)

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