Re: how to set up iceweasel 3.5 to use mutt as mailer for "link sendto"
Elimar Riesebieter wrote:
I've tried settings -> apps -> mailto -> shellscript
Shellscript:
#!/bin/sh
exec xterm -e mutt "$@"
I'm guessing mutt can't parse the mailto: line given out by iceweasel.
Here's a very quick and very dirty bit of perl I knocked up; I'm not
suggesting it's right, but it'll hopefully give you a starting point:
#!/usr/bin/perl
sub escape {
$result=$_[0];
$result=~s{(["\$])}{\\$1}g;
return "\"$result\"";
}
($dummy, $params)=split /:/, $ARGV[0], 2;
($address, $params)=split /\?/, $params, 2;
print "$params\n";
for $x(split /&/, $params) {
($key, $val)=split /=/, $x, 2;
print "$key: $val\n";
$paramhash{$key}=$val;
}
$cmd="mutt";
$cmd.=" -s ".escape($paramhash{"subject"}) if($paramhash{"subject"});
$cmd.=" -c ".escape($paramhash{"cc"}) if($paramhash{"cc"});
$cmd.=" -b ".escape($paramhash{"bcc"}) if($paramhash{"bcc"});
$cmd.=" $address";
print "$cmd\n";
exec "$cmd";
--
Chris Jackson
Shadowcat Systems Ltd.
Reply to: