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.