I have worked a bit with an email attachment issue, and can now send attachments through email, through a script.
When the email comes in, I double-click the attachment, and Excel 2016 opens, with a dialog reading: We found a problem with some content in 'attachment.xlsx'. Do you want use to try to recover as much as we can? If you trust the source of this workbook, click Yes. I click Yes, it works. If I open the original file from the same server through Samba, it works fine. Only after it's gone through email does it appear to not be perfect.
What can I do to get rid of this dialog, so the recipient does not see it constantly? I plan on running the script weekly, with a new Excel file each week.
The command that runs:
(uuencode /path/to/file.xlsx file.xlsx; echo $BODY) | mail -r firstname.lastname@example.org -s "Subject Line" email@example.com
The file size is increased by 1 byte after being emailed. In this case, it's now 18738 bytes after being emailed. The SHA256 hashes are different between the two files.