<<< Date Index >>>     <<< Thread Index >>>

setting firefox about:config to invoke or start mutt when clicking a mailto: link



To setup firefox to invoke mutt when clicking a "mailto:"; link: 

#1 - goto the "about:config:" page in firefox by placing
     about:config in the address bar.

#2 - right click anywhere on the page and select "new" and 
     then "string"

#3 - enter the string :
              network.protocol-handler.app.mailto 
     into the new string field and click OK.

#4 - paste the string 
              network.protocol-handler.app.mailto
     into the "filter" field (at the top) 

#5 - when that single entry appears right click on the value
     entry for it and select "modify"  

#6 - enter the pathname of the script you created to run mutt in
     some kind of xterm window.  "/usr/bin/mutt" won't cut it.

     Mine is "/usr/local/bin/mailtomutt"  which is based on a
     script I found on the web somewhere (sorry I have forgotten
     who made it but I give that person credit whoever they are.)

The script is a little slow. It has 14 or so spawned processes
which could be replaced by internal Bash parameter
expansions.  Here is script I found on the web; modified to 
invoke mutt under the KDE konsole terminal app:

#!/bin/bash
MAILTO_URL="$1"

#Strip off the protocol
MAIL_DATA=$(echo "$MAILTO_URL" | /bin/sed -s 's/^mailto://')

#Get Recipient and strip it off
RECIPIENT=$(echo "$MAIL_DATA" | cut -d? -f1 -)
MAIL_DATA=$(echo "$MAIL_DATA" | /bin/sed -s s/^$RECIPIENT//)

#Get Subject,BCC, and CC
SUBJECT=$(echo "$MAIL_DATA" | /bin/sed -s 's/.*?subject=//' \
| /bin/sed -s 's/?.*//')
BCC=$(echo "$MAIL_DATA" | /bin/sed -s 's/.*?bcc=//' | /bin/sed -s 's/?.*//')
CC=$(echo "$MAIL_DATA" | /bin/sed -s 's/.*?cc=//' | /bin/sed -s 's/?.*//')

# Call mutt in a term
/usr/bin/konsole -e /usr/bin/mutt "$RECIPIENT" -b "$BCC" -c "$CC" -s "$SUBJECT"

################## END ####################################

It's very slow to pop up the mutt window, so I'm sure I'll eventually
upgrade those $( echo blah | sed ) transforms to PE expressions, unless
I come across a better solution in the meantime.

The first goal was just to get "something" working so I could
respond to ads on craigslist with a single click... :) 

Jeff Kinz.


-- 
A: Yes.
>Q: Are you sure?
>>A: Because it reverses the logical flow of conversation.
>>>Q: Why is top posting frowned upon?

"Best claim by a government" signatures series: (posted to a public list)
IMPORTANT: This email remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of section 70 of the CRIMES
ACT 1914.  If you have received this email in error, you are requested to
contact the sender and delete the email.