Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

rjbs (4671)

rjbs
  (email not shown publicly)
http://rjbs.manxome.org/
AOL IM: RicardoJBSignes (Add Buddy, Send Message)
Yahoo! ID: RicardoSignes (Add User, Send Message)

I'm a Perl coder living in Bethlehem, PA and working Philadelphia. I'm a philosopher and theologan by training, but I was shocked to learn upon my graduation that these skills don't have many associated careers. Now I write code.

Journal of rjbs (4671)

Tuesday March 06, 2007
11:38 PM

mutt, procmail, and the apple address book

[ #32596 ]

It seems like everyone I know is using Thunderbird or Apple Mail, these days. Sometimes, I feel a little left behind. I still run mutt. Then again, every time I try to use a GUI mail application, I feel stifled. It just isn't smart enough.

Still, it's really nice to put things in one place and have them show up everywhere you need them. Apple Mail's integration with Address Book is nice -- although really, I just want it to look up email addresses for me. The whole iChat integration I can live without.

A few years ago I wrote a script that would dump my Address Book into a file containing mutt alias entries to be sourced into my muttrc, and that got me a good bit of what I wanted.

Meanwhile, I also use procmail to sort my mail. Sure, I should use Email::Filter or something, but I've got a lot of intertia and a lot of built-up rules. I've been getting annoyed that my friends.rc, which sorts mail from friends and family into folders, has grown out of date, and I kept wanting to tie it to Address Book.

Today, I rewrote my abook script to do that, and to be more generally extensible and awesome as time goes on. (I also ended up reorganizing a lot of my mail-config files and writing a Makefile. I feel exceptionally nerdy.)

I will eventually release abook as a dist on the CPAN, but even now it's pretty useful. It can dump two files: one is a set of procmail recipes, the other a set of mutt config lines. Right now, it just helps sort mail, creates aliases, and can enable custom signatures. In the future, I'll probably also have it dump SpamAssassin whitelists, make use of Address Book groups, and maybe even update Pobox whitelists.

I also updated my mutt configuration to better cope with some OS X stupidity. OS X's DHCP client doesn't seem to have a "do not change my hostname" option. I had some mutt configuration loaded conditionally based on current hostname, which broke when I'd get on the office or cellular network. Now I've updated it to check things like the ethernet address of the current computer. I added offlineimap configuration for my work IMAP account, and hopefully tomorrow I'll make it easy to access both personal and work email from one mutt instance no matter where I am, with the same folder names and key bindings.

Of course, whatever procmail-replacing script I write will have to have pieces built by abook! I'm not sure if anyone else out there is using this set of tools: mutt, procmail, and Apple Address book. If so, maybe abook will be useful for you, too.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Then again, every time I try to use a GUI mail application, I feel stifled. It just isn't smart enough.
    Could you elaborate on this? I've heard people say things like this in the past, but I've never used a command-line mail client, so I don't know what they're trying to do.
    • Currenlty I am using Thunderbird on MS Windows (for work, need to use IE), with an IMAP account; haven't tried Agent yet. Otherwise, I /much/ prefer to use mutt. Most of the problems listed below (of Thunderbird) are due to intrinsic differences (inherent features) rather than due to GUI|CLI differences, I think.

      1. (GUI Problem) There is no way to fix sort options. At least once a day, I occasionally hit some column label in message index while selecting a message to read, resulting in re-selection of the
      --
      - parv
    • More than you wanted to know: http://use.perl.org/~rjbs/journal/32742 [perl.org]
      --
      rjbs
  • To keep the hostname from changing, edit /etc/hostconfig, and set HOSTNAME="MyHostName".

    Hope that helps.