Parse if there have been new mails synched to the local dir.

Profpatsch mail at profpatsch.de
Tue Jan 29 22:15:00 UTC 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi offlineimap team,

I’m setting up offlineimap with mutt atm and want to write a small
script that pipes a “New Mail” to my i3status when there is any.

I studied oi’s output but I haven’t found any indication that I could
parse to see if there are new mails.

The script I’ve come up with so far is doing a
`find $MAIL -printf %t | md5sum`
which creates a hash over the last modified times of the whole maildir.
Then it checks with the hash from the last run and if they differ, the
statusbar shows “Mail changed” until the next run (which is a cron job
done every ~5 minutes).

But it can only see when there are changes to the maildir (and it
somehow deleted my whole maildir once—lucky me has backups).

Any ideas?

~Profpatsch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRCEnjAAoJEMXP0IsiJHzfdtIP/RpX4dChBYmp/NC6tANUyYoY
dkT1fzK8bLyZ3orjD0BNm4sHcmnfyQKtb4WAId3bAh3nMeK5Qy7RuI62gWVGvHdW
rOOySHSyGDi4MVkqwvIuDQJSZojmKnmPUb/wcjZGWyjOYWJ0181KrBCOHHGm75tE
TME87gTj8apPD+51I+CW4Kimz63ifqkM4ngzKRHrtPKKhQMwTAO0/CIAtTMj5iFN
W9kbJpefQ+YdBTWPXl6tIzLsVr2J/QjIb99Uzl6M7QQXHzEtHVlInlPwPBNBX9k3
acTFbljnVwn1lWfBJcTS1YzbVKvjOwTyMIrP6OHBPFT8hLBUK0utQjXbRRrjRA2a
uv7M/iWW5r0wwun+0/0Ln2aSBBNpdB7wEAkY3vpe64IE/f8tJ6O2dwWDouikj2ut
at6l8PojjThIqPfcRt4HjXGOR1L32/rR1s+YF+Wd5OUfzJkbieIAlFAXs3a6sAcx
4McSvyD4YGgn9py/kUHcFriS2QUoraMbgk5glOjy71YNOUa6kMT96z24Lj5+wi68
ICtfxslRxUkgpneUtWxmf4UQLodr16fLkgSYdyzT7+/8UThN4wED6NHi7mV8wwYi
a0NJdWU4ZkJ7mSwDdwYypDOh4Rr32MQAcKLyWXB/IjgCQam8+nggRiAHZ0k2N1nq
Z+6iCAasKlKvsuzA4lrO
=P/wo
-----END PGP SIGNATURE-----



More information about the OfflineIMAP-project mailing list