Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Unix permission on dkim #1100

Merged
merged 3 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions data/hooks/backup/22-conf_mail
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#!/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"
mkdir -p "$YNH_CWD"
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"
8 changes: 6 additions & 2 deletions data/hooks/restore/22-conf_mail
Original file line number Diff line number Diff line change
@@ -1,5 +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