diff --git a/data/hooks/backup/22-conf_mail b/data/hooks/backup/22-conf_mail
index 018a345d9..9db39e0c2 100644
--- a/data/hooks/backup/22-conf_mail
+++ b/data/hooks/backup/22-conf_mail
@@ -1,13 +1,8 @@
 #!/bin/bash
 
-# Exit hook on subcommand error or unset variable
-set -eu
-
-# Source YNH helpers
 source /usr/share/yunohost/helpers
+ynh_abort_if_errors
+YNH_CWD="${YNH_BACKUP_DIR%/}/conf/dkim"
+cd "$YNH_CWD"
 
-# Backup destination
-backup_dir="${1}/etc/dkim"
-
-# Backup the configuration
-ynh_backup "/etc/dkim" "$backup_dir"
+ynh_backup --src_path="/etc/dkim"
diff --git a/data/hooks/restore/22-conf_mail b/data/hooks/restore/22-conf_mail
index 312b3f61b..77e0a4d42 100644
--- a/data/hooks/restore/22-conf_mail
+++ b/data/hooks/restore/22-conf_mail
@@ -1,11 +1,9 @@
 #!/bin/bash
 
-backup_dir="$1/etc/dkim"
+backup_dir="$1/conf/dkim"
 
-cp -a $backup_dir/. /etc/dkim
+cp -a $backup_dir/etc/dkim/. /etc/dkim
 
 chown -R root:root /etc/dkim
 chown _rspamd:root /etc/dkim
 chown _rspamd:root /etc/dkim/*.mail.key
-chmod 600 /etc/dkim/*.mail.txt
-chmod 400 /etc/dkim/*.mail.key