Re: Firefox mailto: links not working correctly

2011-11-28 Thread Chris Green
On Sun, Nov 27, 2011 at 07:13:55PM +0100, Marco Giusti wrote:
 On Fri, Nov 25, 2011 at 04:29:06PM +, Chris Green wrote:
  On Thu, Nov 24, 2011 at 02:02:11PM -0500, Patrice Levesque wrote:
   
attached a simple script that is use. set it executable and call this
from firefox, not mutt directly
   
   I believe there's no need for pyrotechnics :)
   
   As mutt supports mailto: URLs natively, this suffices:
   
   #!/bin/sh
   exec xterm -e mutt $@
   
  What I actually ended up with was:-
  
  xfce4-terminal -e mutt -F /home/chris/.mutt/muttrc $@
 
 a bit off topic but I think that the -F option is superflous (may not
 be). from the manual:
 
   Mutt will next look for a file named .muttrc in your home directory.
   If this file does not exist and your home directory has a
   subdirectory named .mutt, Mutt tries to load a file named
   .mutt/muttrc

Yes, but does Firefox run things with your full environment in place? 
Actually the -F got left there from an earlier attempt which didn't work
so you may well be right!  :-)

-- 
Chris Green


Re: Firefox mailto: links not working correctly

2011-11-27 Thread Marco Giusti
On Fri, Nov 25, 2011 at 04:29:06PM +, Chris Green wrote:
 On Thu, Nov 24, 2011 at 02:02:11PM -0500, Patrice Levesque wrote:
  
   attached a simple script that is use. set it executable and call this
   from firefox, not mutt directly
  
  I believe there's no need for pyrotechnics :)
  
  As mutt supports mailto: URLs natively, this suffices:
  
  #!/bin/sh
  exec xterm -e mutt $@
  
 What I actually ended up with was:-
 
 xfce4-terminal -e mutt -F /home/chris/.mutt/muttrc $@

a bit off topic but I think that the -F option is superflous (may not
be). from the manual:

Mutt will next look for a file named .muttrc in your home directory.
If this file does not exist and your home directory has a
subdirectory named .mutt, Mutt tries to load a file named
.mutt/muttrc


Re: Firefox mailto: links not working correctly

2011-11-26 Thread Chris Green
On Thu, Nov 24, 2011 at 02:02:11PM -0500, Patrice Levesque wrote:
 
  attached a simple script that is use. set it executable and call this
  from firefox, not mutt directly
 
 I believe there's no need for pyrotechnics :)
 
 As mutt supports mailto: URLs natively, this suffices:
 
 #!/bin/sh
 exec xterm -e mutt $@
 
What I actually ended up with was:-

xfce4-terminal -e mutt -F /home/chris/.mutt/muttrc $@

(xfce4-terminal is brain-dead and needs the whole thing quoted otherwise
*it* eats the mutt parameters)

-- 
Chris Green


Re: Firefox mailto: links not working correctly

2011-11-25 Thread Christian Ebert
* Marcelo Luiz de Laia on Thursday, November 24, 2011 at 20:15:10 -0200
 I already have been tryied mailtomutt [1] and mailto-mutt [2] and nor
 did what your nice script do!
 
 1. http://sourceforge.net/projects/mailtomutt/files/MailtoMutt/

MailtoMutt is specifically for MacOS X and works quite well on
that platform - although it could use an overhaul.

c
-- 
theatre - books - texts - movies
Black Trash Productions at home: http://www.blacktrash.org
Black Trash Productions on Facebook:
http://www.facebook.com/blacktrashproductions


Firefox mailto: links not working correctly

2011-11-24 Thread Chris Green
I have a pretty standard Firefox 3.6.24 running in xubuntu.

I have mutt set as my default E-Mail application in Preferred
Applications and in Firefox's preferences.  However it's not working
properly, when I click on a mailto: link an empty E-Mail gets sent.

It looks to me as if this is something to do with mutt needing a
terminal window to run in but all the menus seem to know about mutt
already as if they should know this.

Can anyone suggest what might be wrong?

-- 
Chris Green


Re: Firefox mailto: links not working correctly

2011-11-24 Thread Marco Giusti
On Thu, Nov 24, 2011 at 01:44:03PM +, Chris Green wrote:
 I have a pretty standard Firefox 3.6.24 running in xubuntu.
 
 I have mutt set as my default E-Mail application in Preferred
 Applications and in Firefox's preferences.  However it's not working
 properly, when I click on a mailto: link an empty E-Mail gets sent.
 
 It looks to me as if this is something to do with mutt needing a
 terminal window to run in but all the menus seem to know about mutt
 already as if they should know this.
 
 Can anyone suggest what might be wrong?

attached a simple script that is use. set it executable and call this
from firefox, not mutt directly
#!/usr/bin/env python

from __future__ import with_statement
import os
import sys
import cgi
import urlparse
import subprocess
import tempfile
import contextlib

tmpfile = None


@contextlib.contextmanager
def fdopen(fd, mode='r', bufsize=-1):
yield os.fdopen(fd, mode, bufsize)


def simpleParam(hname):
def _(hvalue):
return hname, hvalue
return _


def bodyParam(hvalue):
global tmpfile

fd, filename = tempfile.mkstemp()
tmpfile = filename
with fdopen(fd, 'w') as fp:
fp.write(hvalue)
return '-i', filename


ARGS = {
'subject': simpleParam('-s'),
'bcc': simpleParam('-b'),
'cc': simpleParam('-c'),
'body': bodyParam,
}


def filterParams(name):
return name in ARGS


def parsequery(query):
args = []
parts = urlparse.urlparse(query, scheme='mailto')
to = parts[2]
if to.find('?')  0:
to, params = to.split('?', 1)
params = cgi.parse_qs(params)
for name in filter(filterParams, params):
hvalue = ','.join(params[name])
args += ARGS[name](hvalue)

args += ['--', to]
return args


if len(sys.argv) == 1:
print  sys.stderr, 'Usage: %s address' % sys.argv[0]
sys.exit(1)

args = ['xterm', '-e', 'mutt'] + parsequery(sys.argv[1])
retcode = subprocess.call(args)
if tmpfile and os.path.exists(tmpfile):
os.unlink(tmpfile)

sys.exit(retcode)


Re: Firefox mailto: links not working correctly

2011-11-24 Thread Patrice Levesque

 attached a simple script that is use. set it executable and call this
 from firefox, not mutt directly

I believe there's no need for pyrotechnics :)

As mutt supports mailto: URLs natively, this suffices:

#!/bin/sh
exec xterm -e mutt $@



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: Firefox mailto: links not working correctly

2011-11-24 Thread Marco Giusti
On Thu, Nov 24, 2011 at 02:02:11PM -0500, Patrice Levesque wrote:
 
  attached a simple script that is use. set it executable and call this
  from firefox, not mutt directly
 
 I believe there's no need for pyrotechnics :)
 
 As mutt supports mailto: URLs natively, this suffices:
 
 #!/bin/sh
 exec xterm -e mutt $@

I wrote that script some time ago when, I don't remember exactly what,
some field did not worked as expected.


Re: Firefox mailto: links not working correctly

2011-11-24 Thread Patrick Shanahan
* Marco Giusti marco.giu...@gmail.com [11-24-11 14:49]:
 On Thu, Nov 24, 2011 at 02:02:11PM -0500, Patrice Levesque wrote:
  As mutt supports mailto: URLs natively, this suffices:
  
  #!/bin/sh
  exec xterm -e mutt $@
 
 I wrote that script some time ago when, I don't remember exactly what,
 some field did not worked as expected.

I just tested it on openSUSE 12.1 and it worked fine.
-- 
(paka)Patrick Shanahan   Plainfield, Indiana, USA  HOG # US1244711
http://wahoo.no-ip.orgPhoto Album: http://wahoo.no-ip.org/gallery2
http://en.opensuse.org   openSUSE Community Member
Registered Linux User #207535@ http://linuxcounter.net


Re: Firefox mailto: links not working correctly

2011-11-24 Thread Marco Giusti
On Thu, Nov 24, 2011 at 02:55:16PM -0500, Patrick Shanahan wrote:
 * Marco Giusti marco.giu...@gmail.com [11-24-11 14:49]:
  On Thu, Nov 24, 2011 at 02:02:11PM -0500, Patrice Levesque wrote:
   As mutt supports mailto: URLs natively, this suffices:
   
   #!/bin/sh
   exec xterm -e mutt $@
  
  I wrote that script some time ago when, I don't remember exactly what,
  some field did not worked as expected.
 
 I just tested it on openSUSE 12.1 and it worked fine.

I think it was for mutt 1.5.[18-20] but I agree that now, after Patrice
pointed out to me, is completely useless.


Re: Firefox mailto: links not working correctly

2011-11-24 Thread Patrick Shanahan
* Marco Giusti marco.giu...@gmail.com [11-24-11 15:24]:
 On Thu, Nov 24, 2011 at 02:55:16PM -0500, Patrick Shanahan wrote:
  * Marco Giusti marco.giu...@gmail.com [11-24-11 14:49]:
   On Thu, Nov 24, 2011 at 02:02:11PM -0500, Patrice Levesque wrote:
As mutt supports mailto: URLs natively, this suffices:

#!/bin/sh
exec xterm -e mutt $@
   
   I wrote that script some time ago when, I don't remember exactly what,
   some field did not worked as expected.
  
  I just tested it on openSUSE 12.1 and it worked fine.
 
 I think it was for mutt 1.5.[18-20] but I agree that now, after Patrice
 pointed out to me, is completely useless.

I don't understand useless.  It works as intended and I have mutt-1.5.21

-- 
(paka)Patrick Shanahan   Plainfield, Indiana, USA  HOG # US1244711
http://wahoo.no-ip.orgPhoto Album: http://wahoo.no-ip.org/gallery2
http://en.opensuse.org   openSUSE Community Member
Registered Linux User #207535@ http://linuxcounter.net


Re: Firefox mailto: links not working correctly

2011-11-24 Thread Marco Giusti
On Thu, Nov 24, 2011 at 03:37:59PM -0500, Patrick Shanahan wrote:
 * Marco Giusti marco.giu...@gmail.com [11-24-11 15:24]:
  On Thu, Nov 24, 2011 at 02:55:16PM -0500, Patrick Shanahan wrote:
   * Marco Giusti marco.giu...@gmail.com [11-24-11 14:49]:
On Thu, Nov 24, 2011 at 02:02:11PM -0500, Patrice Levesque wrote:
 As mutt supports mailto: URLs natively, this suffices:
 
 #!/bin/sh
 exec xterm -e mutt $@

I wrote that script some time ago when, I don't remember exactly what,
some field did not worked as expected.
   
   I just tested it on openSUSE 12.1 and it worked fine.
  
  I think it was for mutt 1.5.[18-20] but I agree that now, after Patrice
  pointed out to me, is completely useless.
 
 I don't understand useless.  It works as intended and I have mutt-1.5.21

my script, i wrote it to handle complex mailto links, but now mutt can
do it well without any external help so I think it is pretty useless
now.



Re: Firefox mailto: links not working correctly

2011-11-24 Thread Patrick Shanahan
* Marco Giusti marco.giu...@gmail.com [11-24-11 15:57]:
 On Thu, Nov 24, 2011 at 03:37:59PM -0500, Patrick Shanahan wrote:
  * Marco Giusti marco.giu...@gmail.com [11-24-11 15:24]:
   
   I think it was for mutt 1.5.[18-20] but I agree that now, after Patrice
   pointed out to me, is completely useless.
  
  I don't understand useless.  It works as intended and I have mutt-1.5.21
 
 my script, i wrote it to handle complex mailto links, but now mutt can
 do it well without any external help so I think it is pretty useless
 now.

Not useless for me.  On my system providing /usr/bin/mutt as the default
mail client for mailto doesn't appear to do anything.  No entries in
/var/log/mail, no reject msgs, but the script works fine.

-- 
(paka)Patrick Shanahan   Plainfield, Indiana, USA  HOG # US1244711
http://wahoo.no-ip.orgPhoto Album: http://wahoo.no-ip.org/gallery2
http://en.opensuse.org   openSUSE Community Member
Registered Linux User #207535@ http://linuxcounter.net


Re: Firefox mailto: links not working correctly

2011-11-24 Thread Marcelo Luiz de Laia
On Thu, 24 Nov 2011, Patrice Levesque wrote:
 
 As mutt supports mailto: URLs natively, this suffices:
 
 #!/bin/sh
 exec xterm -e mutt $@

Thank you very much!

I already have been tryied mailtomutt [1] and mailto-mutt [2] and nor
did what your nice script do!

1. http://sourceforge.net/projects/mailtomutt/files/MailtoMutt/

2. 
http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=18;filename=mailto-mutt;att=1;bug=406850

-- 
  O___   - Marcelo Luiz de Laia
 c/  /'_ - Diamantina
(*)  \(*)- Minas Gerais
~- Brazil
^- Linux user number 487797