#!/bin/sh

set -e

MOZ_APP_NAME=thunderbird

if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-remove" ]; then
  update-alternatives --install /usr/bin/gnome-www-browser \
  gnome-www-browser /usr/bin/$MOZ_APP_NAME 40
  update-alternatives --install /usr/bin/x-www-browser \
  x-www-browser /usr/bin/$MOZ_APP_NAME 40
  if [ -x /etc/gconf/gconf.xml.defaults ]; then
    gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults \
    -s "/desktop/gnome/url-handlers/mailto/command" --type string "thunderbird --compose %s"
  fi
fi
