• Posts
  • RSS
  • ◂◂RSS
  • Contact

  • Text only email stuff

    August 14th, 2009
    email, programming, statmbx  [html]
    For a few years I've checked email with a program I wrote called statmbx. It reads my mailboxes and gives me a summary of what is marked as 'new'. I like it a lot. The code is about as efficient as any code that reads all the mailboxes can be. The only way to make it more efficient would be indexing, and that would be a lot of work. It is a little slow on loaded machines, though. How to make it faster? I realized I use it for two things:
    • Listing the contents of my mailboxes when I have a lot of mail and want to see what needs dealing with
    • Checking if I have anything new to deal with since I last ran it.
    This second case can be much faster if every time we get a new message we write summary information to a file. Which procmail does. I have procmail create ~/procmail/pmlog which looks like:
            From email_bounce_handler@bounce.convio.net  Fri Aug 14 15:42:23 2009
             Subject: EFFector 22.23: Locational Privacy -- Who Knows Where You Are, And Wh
              Folder: /var/mail/jeff
            From nfbvdqanlkuv@c-24-20-39-38.hsd1.wa.comcast.net  Fri Aug 14 15:50:36 2009
             Subject: Medications that you need.
              Folder: probably-spam                                                    2012
            From john.smith@example.com  Fri Aug 14 16:12:01 2009
             Subject: sorry I missed you.
              Folder: /var/mail/jeff                                                   1498
            From bootsk@lovesaju.com  Fri Aug 14 16:29:24 2009
             Subject: If you want to change your style, start with a watch.
              Folder: probably-spam                                                    2906
            From actionlad@bellsouth.net  Fri Aug 14 16:29:44 2009
             Subject: Save some funk for Sunday
              Folder: probably-spam                                                    1510
            
    All I need to do is pretty this up, strip out the probably-spam entires, and display it as it comes in. So a little python program, clean_pmlog.py, and a tail -f and we're set:
            email_bounce_handler@ ... EFFector 22.23: Locational Privacy -- Who Knows Where You Are, And Wh
            john.smith@example.com    sorry I missed you.
            
    I alias wmail to 'tail -f ~/procmail/pmlog | python ~/clean_pmlog.py' and leave it running. Now I hope I can get away from compulsively running my statmbx program to see if I've gotten new mail. Update: After starting to use this, I've realized that the from address it has is the envelope sender. Which is usually the same as the sender, unless there's a mailing list involved. So this is less useful for mailing lists than it could be, especially when there's lots of traffic on one list and it all has the same subject. But I run statmbx a lot less now.

    Comment via: facebook

    Recent posts on blogs I like:

    Best Practices Civil Service

    I propose that transportation agencies hire people whose job is to keep abreast of global developments in the field and report on best practices. Which agencies should do it? Ideally, all urban ones. Very small ones should piggyback on large ones, or part…

    via Pedestrian Observations June 14, 2021

    Collections: The Queen’s Latin or Who Were the Romans? Part I: Beginnings and Legends

    Who were the Romans? How did they understand themselves as a people and ‘Roman’ as an identity? And what were the implications of that understanding – and perhaps more importantly the underlying reality – for Roman society and the success of the Roman Emp…

    via A Collection of Unmitigated Pedantry June 11, 2021

    It's ok to feed stray cats

    Before we had kids, Jeff and I fostered a couple of cats. One had feline AIDS and was very skinny. Despite our frugal grocery budget of the time, I put olive oil on her food, determined to get her healthier. I knew that stray cats were not a top global pr…

    via Giving Gladly May 15, 2021

    more     (via openring)


  • Posts
  • RSS
  • ◂◂RSS
  • Contact