imap-download: chown maildir to fetchmail

This commit is contained in:
Starbeamrainbowlabs 2021-05-26 22:20:22 +01:00
parent 43f0bc8026
commit 05b3936940
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 3 additions and 1 deletions

View File

@ -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.