From 72a8fbb2a1ce6b05ac10660de98efff4606cb305 Mon Sep 17 00:00:00 2001 From: Antonio Radici Date: Sat, 1 Jan 2011 13:05:13 +0000 Subject: [PATCH] debian/extra/lib/mailto-mutt: replaced by a wrapper, added the reason to NEWS.Debian (Closes: 576313) --- debian/NEWS | 7 +++ debian/changelog | 2 + debian/extra/lib/mailto-mutt | 118 ++--------------------------------- 3 files changed, 13 insertions(+), 114 deletions(-) diff --git a/debian/NEWS b/debian/NEWS index 6e2aaac..631c227 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,3 +1,10 @@ +mutt (1.5.21-2) experimental; urgency=low + mailto-mutt has been replaced by a wrapper as per #576313, because mutt is now + able to handle the mailto: urls; additionally it will also do some checks on + attachments and it will allow us to be as close to upstream as possible + + -- Antonio Radici Sat, 01 Jan 2011 12:56:29 +0000 + mutt (1.5.20-6) unstable; urgency=low The behavior of the write_bcc option has changed, now write_bcc is only used to decide if an Fcc message should have its Bcc header written; diff --git a/debian/changelog b/debian/changelog index 5d15fb7..3cf5f2e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ mutt (1.5.21-2) UNRELEASED; urgency=low * debian/patches: + upstream/578087-header-strchr.patch: prevent from segfaulting on malformed messages (Closes: 578087, 578583) + * debian/extra/lib/mailto-mutt: replaced by a wrapper, added the reason to + NEWS.Debian (Closes: 576313) -- Antonio Radici Sat, 01 Jan 2011 12:56:29 +0000 diff --git a/debian/extra/lib/mailto-mutt b/debian/extra/lib/mailto-mutt index 730c021..2626317 100755 --- a/debian/extra/lib/mailto-mutt +++ b/debian/extra/lib/mailto-mutt @@ -1,118 +1,8 @@ #!/bin/sh # -# mailto-mutt -- wrapper to be able to use mutt as mailto handler from firefox +# mailto-mutt -- wrapper to use mutt as mailto handler from Iceweasel # -# To use, surf to Firefox's about:config page and configure the following -# three values: -# network.protocol-handler.external.mailto boolean true -# network.protocol-handler.app.mailto string '/path/to/handler' -# network.protocol-handler.warn-external.mailto boolean false -# -# Copyright © martin f. krafft -# Released under the terms of the Artistic Licence 2.0 -# -# Revision: $Id: mailto-mutt 498 2007-05-12 12:02:10Z madduck $ -# -set -eu - -case "${1:-}" in - -d) debug=1; shift;; - '') exit 0;; - *) :;; -esac - -url_unescape() -{ - perl -e 'use URI::Escape; while(<>) { print uri_unescape($_); }' -} - -MAILTO="${@%%\?*}" -ARGS="${@#*\?}" -[ "$ARGS" = "$MAILTO" ] && unset ARGS -MAILTO="$(echo "${MAILTO#mailto:}" | url_unescape)" - -subject= -cc= -bcc= -body= -mutt_commands= - -IFS_store="$IFS" -IFS='&' - -for arg in ${ARGS:-}; do - value="$(echo "${arg#*=}" | url_unescape | sed -e "s,',\',")" - - case "${arg%%=*}" in - subject|Subject|SUBJECT) subject="$value";; - cc|Cc|CC) cc="$value";; - bcc|Bcc|BCC) bcc="$value";; - body|Body|BODY) body="$value";; - *) - mutt_commands="${mutt_commands:+${mutt_commands} - }-e\"my_hdr ${arg%%=*}: $value\"" - ;; - esac -done - -IFS="$IFS_store" - -break_at_commas() -{ - local atom - for i; do - atom="${atom:+$atom }$i" - case "${atom:-}" in - *,) echo "${atom%,}"; unset atom;; - esac - done - [ -n "${atom:-}" ] && echo "${atom%,}" -} - -get_addr_args() -{ - local type - case "$1" in - -*) type="$1"; shift;; - *) unset type;; - esac - - break_at_commas "$@" | while read addr; do - echo -n "${type:-}\"$addr\" " - done -} - -if [ -n "$mutt_commands" ]; then - mutt_args="${mutt_args:+$mutt_args }$mutt_commands" -fi - -if [ -n "$subject" ]; then - mutt_args="${mutt_args:+$mutt_args }-s\"$subject\"" -fi - -mutt_args="${mutt_args:+$mutt_args }$(get_addr_args -c $cc)" -mutt_args="${mutt_args:+$mutt_args }$(get_addr_args -b $bcc)" -mutt_args="${mutt_args:+$mutt_args }-- $(get_addr_args $MAILTO)" - -run() -{ - if [ ${debug:-0} -eq 1 ]; then - echo "$@" - [ -t 0 ] && [ -t 1 ] && [ -t 2 ] && $SHELL - else - eval "$@" - fi -} +# If you want Iceweasel 3.x to use this wrapper for mailto URLs, go to Edit > +# Preferences > Applications, and set "mailto" to "/usr/lib/mutt/mailto-mutt". -if [ -n "$body" ]; then - TMPFILE="$(tempfile -p mailto -d /tmp)" - trap "rm -f $TMPFILE" 0 1 2 3 4 5 6 7 8 10 11 12 13 14 15 - echo "$body" > $TMPFILE - run x-terminal-emulator -e mutt -i $TMPFILE${mutt_args:+ $mutt_args} - ret=$? - rm -f $TMPFILE - trap - 0 1 2 3 4 5 6 7 8 10 11 12 13 14 15 - exit $ret -else - run exec x-terminal-emulator -e mutt${mutt_args:+ $mutt_args} -fi +exec x-terminal-emulator -e mutt "$@" -- 2.43.0