Categories:
-
3d 96 articles
-
animations 16 articles
-
architecture 47 articles
-
blender 98 articles
-
bédé 20 articles
-
techdrawing 24 articles
-
freecad 153 articles
-
gaming 1 articles
-
idsampa 8 articles
-
inthepress 8 articles
-
linux 56 articles
-
music 1 articles
-
opensource 227 articles
-
orange 4 articles
-
photo 16 articles
-
projects 35 articles
-
receitas 175 articles
-
saopaulo 18 articles
-
sketches 161 articles
-
talks 22 articles
-
techdrawing 24 articles
-
textes 6 articles
-
trilhas 3 articles
-
urbanoids 7 articles
-
video 44 articles
-
webdesign 7 articles
-
works 151 articles
Archives:
A very simple email checker (works with imap accounts). Run it by setting it in your crontab to run hourly or something.
A very simple email checker (works with imap accounts). Run it by setting it in your crontab to run hourly or something.
passwords are bz2-encrypted (not very good security, but better than nothing. Anyway debian machines are highly secured ). Place the string generated by bz2.compress("password") instead of "encryptedpassword" below.
#!/usr/bin/pythonimport imaplib, pynotify, bz2check1 = Falsecheck2=Falsei1=imaplib.IMAP4_SSL("imap.myserver.net")i1.login("me@myserver.net",bz2.decompress("encryptedpassword1"))s1 = i1.status("INBOX","(UNSEEN)")n1 = s1[1][0].split()[-1].split(")")[0]i2=imaplib.IMAP4_SSL("imap.gmail.com")i2.login("me@gmail.com",bz2.decompress("encryptedpassword2"))s2 = i2.status("INBOX","(UNSEEN)")n2 = s2[1][0].split()[-1].split(")")[0]if (n1 != "0") or (n2 != "0"): pynotify.init("mail") t = "Unread mail" m = "" if n1 != "0": m += n1 + " messages on myserver/n" # change with a backslash if n2 != "0":
m += n2 + " messages on gmail/n" # change with a backslash n=pynotify.Notification(t,m) n.show()