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

Re: send link address in konqueror



On 2004-10-11, Matthias Kirschner <matze@xxxxxxx> wrote:
> Hi everybody,
> I have a problem using mutt with konqueror. 
> under kcontrol / Component Chooser / Email Client / use a different
> email client i set:
> 
> mutt "%t" -s "%s" -c "%c" -b "%b" 
> 
> but I have no idea how to add the body (%B) and the attachment (%A).
> 
> -a "%A" didn't do the job for the attachment and I have absolutely now
> idea how to integrate the body...
> 
> I am thankful for every hint.

Sorry for the long delay in replying.  I've been on vacation.

I'm no expert on this, and I don't use konqueror, but I do use mozex
with mozilla and I used it to make mutt my mozilla e-mail client
shortly before leaving on vacation.  The recipe for using mutt given
on the mozex site didn't work for me, so I wrote a script to handle
the interface between mozex and mutt.  The problem I had was that
mutt didn't like having empty arguments to its options.

You can include the body using the -i mutt option.

I'll show you my solution, but it is probably more complicated than
you need because I run mozilla on a Linux machine but mutt on an
HP-UX machine.  Both machines access the same HOME directory via
NFS, but the rest of their file systems are different, including
/tmp, so I had to copy any files saved by mozex in /tmp (only the
body in my case) to a temporary directory under HOME.

Here is my mozex Mailer command (one line):

    /home/garyjohn/bin/Linux/mutt_for_mozex -s "%s" -c "%c" -i "%b" %a

and here are the scripts:

--------------- /home/garyjohn/bin/Linux/mutt_for_mozex ----------------

#!/usr/bin/sh
#
# mutt_for_mozex - interface script to allow mozex on Linux to invoke
#                  mutt on HP-UX in an xterm window -- Linux side

# Remove any options with empty arguments.
#
args=''
while [ $# -gt 0 ]
do
    case $1 in
        -s|-c)
            if [ "$2" != "\"\"" ]
            then
                args="$args $1 \"$2\""
            fi
            shift 2
            ;;
        -i) if [ "$2" != "\"\"" ]
            then
                file=~/.mutt/tmp/$(basename $2)
                mv $1 "$file"
                args="$args -i \"$file\""
            fi
            shift 2
            ;;
        *) args="$args $1"; shift;;
    esac
done

remsh davinci /home/garyjohn/bin/HP-UX/xterm-color -display $DISPLAY -e 
/home/garyjohn/bin/HP-UX/mutt_for_mozex $args &

--------------- /home/garyjohn/bin/HP-UX/mutt_for_mozex ----------------

#!/usr/bin/sh
#
# mutt_for_mozex - interface script to allow mozex on Linux to invoke
#                  mutt on HP-UX in an xterm window -- HP-UX side

# Critical environment settings missing from xterm's execution environment.
#
export TERMINFO=/home/garyjohn/lib/xterm-terminfo
                                        # Without this, slang fails to
                                        # initialize and causes mutt to
                                        # exit.
PATH=.:$HOME/bin/HP-UX:$HOME/bin:$PATH  # Without this, mutt uses
                                        # /usr/bin/vi which, for some
                                        # unknown reason, does not
                                        # respond to Esc, ^C, or
                                        # anything else and must be
                                        # killed from another process.

mutt "$@"

if [ $? -ne 0 ]
then
    echo "Mutt returned a non-zero exit status.  Hit Enter to close window."
    read x
fi

------------------------------------------------------------------------

The second script is bascially 'mutt "$@"' with some other stuff
needed for the idiosyncracies of my environment.  For your purposes,
you could probably do with just the first script with the following
modifications:

    1.  Replace 'remsh davinci ... &' with 'mutt $args'.
    2.  Delete the '-i)' case and process all your argument using
        the '-s|-c)' case.

I would give you a simpler script, but I would have no way of
testing it and I don't like posting scripts I haven't tested.

One final caveat:  I tweaked this mess until it worked, then left it
alone, so I don't claim that it's pretty or even very good.

HTH,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA