From 05b39369407c447c36f8929411aa4bd03c7f3854 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Wed, 26 May 2021 22:20:22 +0100 Subject: [PATCH] imap-download: chown maildir to fetchmail --- images/imap-download/run.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/images/imap-download/run.sh b/images/imap-download/run.sh index c1587d3..673a722 100755 --- a/images/imap-download/run.sh +++ b/images/imap-download/run.sh @@ -13,7 +13,8 @@ if [[ "${EUID}" -ne 0 ]]; then exit 1; fi -dir_newmail="/tmp/maildir/Mail/new"; +dir_mail_root="/tmp/maildir"; +dir_newmail="${dir_mail_root}/Mail/new"; target_dir="/mnt/output"; fetchmail_uid="$(id -u "fetchmail")"; @@ -70,6 +71,7 @@ log_msg() { mkdir -p "${dir_newmail}"; +chown -R "${fetchmail_uid}:${fetchmail_gid}" "${dir_mail_root}"; # Moves an attachment to the output directory as the target uid/gid. # chowns the file before moving.