diff --git a/mail/js/app.js b/mail/js/app.js
index 22b616d46a..6daa5d0066 100644
--- a/mail/js/app.js
+++ b/mail/js/app.js
@@ -4316,8 +4316,18 @@ app.classes.mail = AppJS.extend(
*/
edit_vacation: function(_action, _senders)
{
- var acc_id = parseInt(_senders[0].id);
- this.egw.open_link('mail.mail_sieve.editVacation&acc_id='+acc_id,'_blank','700x560');
+ let acc_id;
+ if (!Array.isArray(_senders))
+ {
+ // Coming from "on vacation" in nm header
+ acc_id = parseInt(this.et2.getWidgetById('nm[foldertree]').value);
+ }
+ else
+ {
+ // Coming from tree
+ acc_id = parseInt(_senders[0].id);
+ }
+ this.egw.open_link('mail.mail_sieve.editVacation&acc_id=' + acc_id, '_blank', '700x560');
},
subscription_refresh: function(_data)
diff --git a/mail/templates/default/index.xet b/mail/templates/default/index.xet
index 3276de3ae2..ce15232f2f 100644
--- a/mail/templates/default/index.xet
+++ b/mail/templates/default/index.xet
@@ -125,7 +125,8 @@