Getting alpine on the Mac to open attachments in Firefox

I’ve been fighting this for a while: alpine can open links just fine in Firefox, but when it’s an attachment I want to open (like the HTML part of a message), it fails saying that Firefox is already running and it can’t run another instance.

First, I enabled the Prefer Plain Text option. The results are typically nicer than the rendered HTML. It’s easy to see the internally rendered HTML anyway, just use the A key in the message viewer.

Now, when an HTML attachment is being opened, the confusing thing is that is automagically associated with the text/html mime type. On a real Unix system, /etc/mailcap will be the config file that sets this up, but this doesn’t exist on the Mac — no idea how this works really. Fortunately, alpine allows me to configure my own mailcap path, which I set to ~/.mailcap. Then I created that file with this line inside:

text/html; /usr/bin/open %s

And voila — suddenly everything works just fine. Final hint: in the attachment list for a message, the A key can be used to show info about an attachment, including the command used to view it. This should show /usr/bin/open if everything is set up correctly.

Leave a Comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s