Commit 249db410 authored by bertagaz's avatar bertagaz

Warn if the claws-mail persistence is enabled when starting icedove.

Refs: #10458
parent baa10dbf
#!/bin/sh
set -e
set -u
. gettext.sh
TEXTDOMAIN="tails"
export TEXTDOMAIN
CLAWSMAIL_DIR="${HOME}/.claws-mail"
PROFILE="${HOME}/.icedove/profile.default"
claws_mail_config_is_persistent() {
[ "$(findmnt --noheadings --output SOURCE --target "${CLAWSMAIL_DIR}")" = "/dev/mapper/TailsData_unlocked[/claws-mail]" ]
}
warn_about_claws_mail_persistence() {
local dialog_msg="<b><big>`gettext \"The <b>Claws Mail</b> persistence feature is activated.\"`</big></b>
`gettext \"If you have emails saved in <b>Claws Mail</b>, you should <a href='https://tails.boum.org/doc/anonymous_internet/claws_mail_to_icedove'>migrate your data</a> before starting <b>Icedove</b>.\"`"
local launch="`gettext \"_Launch\"`"
local exit="`gettext \"_Exit\"`"
# Since zenity can't set the default button to cancel, we switch the
# labels and interpret the return value as its negation.
if zenity --question --title "" --ok-label "${exit}" \
--cancel-label "${launch}" --text "${dialog_msg}"; then
return 1
fi
}
start_icedove() {
# Give Icedove its own temp directory, similar rationale to a1fd1f0f & #9558.
TMPDIR="${PROFILE}/tmp"
......@@ -21,4 +45,8 @@ start_icedove() {
/usr/bin/icedove --class "Icedove" -profile "${PROFILE}" "${@}"
}
if claws_mail_config_is_persistent; then
warn_about_claws_mail_persistence || exit 0
fi
start_icedove "${@}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment