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

View file

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