This is fine for a simple/first-draft, no complaints.  One suggestion:  I've seen some customer's ``messages`` files grow HUGE, the size can be totally unpredictable.  Consider maybe using a ``f.seek(-1024, os.SEEK_END)`` call after opening the file to only check (for example) the last 1k in the file.