imap-download: fix munpack pathing

This commit is contained in:
Starbeamrainbowlabs 2021-05-26 22:46:10 +01:00
parent d65701051f
commit d7c9b06b6e
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 4 additions and 2 deletions

View File

@ -95,10 +95,12 @@ do_attachments() {
# Move the email to a temporary directory for processing
mv "${filename}" "${temp_dir}";
filepath_temp="${temp_dir}/$(basename "${filename}")"
# Unpack the attachments
munpack -C "${temp_dir}" "${filename}";
munpack -C "${temp_dir}" "${filepath_temp}";
# Delete the original email file and any description files
rm "${temp_dir}/$(basename "${filename}")";
rm "${filepath_temp}";
find "${temp_dir}" -iname '*.desc' -delete;
# Move the attachment files to the output directory