【发布时间】:2023-02-01 12:43:58
【问题描述】:
我有一个创建临时目录的 bash 脚本,将文件添加到 tmpDir,将其压缩到一个新目录中,然后使用 amazon SES 发送该 zip
我可以下载 zip 文件并在我的设备上查看附件文件,但它们在 gmail 或 Windows 设备上不可见...
这是亚马逊 SES 配置或使用 tmpDirectory 的问题吗?
tmpSizeDir=`mktemp -d`/
trap "rm -rf $tmpSizeDir" EXIT
#copying files into tmpSizeDir
zip folder.zip "${tmpSizeDir}"/*
echo '{"Data": "From: '${MAIL_ACCOUNT}'\nTo: '${recipient}'\nSubject: '${MAIL_SUBJECT}'\nMIME-Version: 1.0\nContent-type: Multipart/Mixed; boundary=\"NextPart\"\n\n--NextPart\nContent-Type: text/plain\n\n'${MAIL_BODY}'\n\n--NextPart\nContent-Type: application/zip;\nContent-Disposition: attachment;\nContent-Transfer-Encoding: base64; filename=\"folder.zip\"\n\n'$(base64 folder.zip)'\n--NextPart--"}' > message.json
aws ses send-raw-email --raw-message file://message.json
【问题讨论】:
-
您的 zip 文件中有什么内容,是否包含 gmail 可能阻止的文件? support.google.com/mail/answer/6590?hl=en
-
@RobertLove 嗯,它有一个 zip 中的一个 zip,这似乎是 gmail 不允许的,谢谢你的提示
标签: bash amazon-web-services amazon-ses