puflogh300X74.gif

Polarwave's OpenBSD
Tips and Tricks for Newbies

| Firefox & External Mailto Links |

| Home | Tips and Tricks | Links | News Feeds | Fun | Contact | Blog (Opens in New Page) |


Using External Mailto Links in Firefox

It's a fairly simple issue to setup Firefox with your MUA in Microsoft Windows, be
it Outlook Express, Outlook, Thunderbird, whatever. But, with older text type email
programs in BSD and Linux, it's a bit harder.

I got tired of forgetting not to click mailto links in Firefox. You always get the same
old message about no program being associated with mailto. I don't have any fancy
X-Windows email programs. Just mutt on one box and pine on the really old box. In
both cases I'm very satisfied with what they can do along with a little extra I always
manage to milk out of them, tinkering and tweaking. I had put off for a long, long time,
figuring out how to fix Firefox and the mailto links thing, but I finally managed to stop
goofing off long enough to come up with a solution.

Script to call pine to send mail to mailto links in Firefox. Name it whatever you want.
I named mine ffpine.sh.

#!/bin/sh
xterm -e pine ${1:+-url "$1"}
Script to call mutt to send mail to mailto links in Firefox. I named mine ffmutt.sh.
#!/bin/sh
xterm -e mutt -F $HOME/.ffmuttrc "$1"
Remember to do chmod +x scriptname or, if you want to make sure it's only executable
by yourself, chmod 0700 scriptname.

I had to copy .muttrc to a new name so I wouldn't be calling my usual mail script which
uses a different signature routine calling fortune to plug in a random fortune file. So, I
just copied .muttrc to .ffmuttrc (ff=Firefox), .signature to .ffsignature, and, in .ffmuttrc,
set the signature like so:
set signature="~/.ffsignature" # file which contains my signature
In both instances, with mutt and pine, I made the same changes in Firefox. In the URL
bar, type about:config. When the page opens, type in mailto. Set your settings like so:
Preference Name                                         Status    Type    Value
network.protocol-handler.app.mailto                    user set  string   path_to_script
network.protocol-handler.expose.maito                  user set  boolean  false
network.protocol-handler.external.mailto               default   boolean  true
network.protocol-handler-handler.warn-external.mailto  user set  boolean  true
On the one box, I had to create the 'network.protocol-handler.app.mailto' line. I guess
it varies from one install to another. Don't know. I just know the above settings work
perfectly with the scripts. So, good luck with it. Drop a line on the contact page and
let me know how it works out for you.

Back to Tips and Tricks
Home

Delicious Bookmark this on Delicious

No affiliation between this site and the OpenBSD project exists or is implied.

valid-html401.png