我正在使用 sendmail 将压缩文件作为附件邮寄到我的 ID。当我尝试从我的邮件中解压缩这个压缩文件时,它显示 INVALID ARCHIEVE DIRECTORY。请帮帮我。
#!/bin/bash
BOUNDARY="=== This is the boundary between parts of the message. ==="
ZIPFILE="textfile.tar.gz"
ZIPFILENAME="/loc/textfile.tar.gz"
export BODY="/loc/1.html"
{
echo "From: b@b.com"
echo "To: a@a.com"
echo "Subject:" $SUBJECT
echo "MIME-Version: 1.0"
echo "Content-Type: MULTIPART/MIXED; "
echo " BOUNDARY="\"q1w2e3r4t5\"
echo
echo "This message is in MIME format. But if you can see this,"
echo "you aren't using a MIME aware mail program. You shouldn't "
echo "have too many problems because this message is entirely in"
echo "ASCII and is designed to be somewhat readable with old "
echo "mail software."
echo "--q1w2e3r4t5"
echo "Content-Type: TEXT/HTML; charset=US-ASCII"
echo '---q1w2e3r4t5'
echo "Content-Type: text/html"
echo "Content-Disposition: inline"
cat $BODY
echo "This email comes with multiple attachments."
echo "--q1w2e3r4t5"
echo "Content-Type: application/zip; charset=US-ASCII; name="${ZIPFILE}
echo "Content-Disposition: attachment; filename="`basename ${ZIPFILE}`
echo
uuencode $ZIPFILE $ZIPFILE
echo "--q1w2e3r4t5--"
} | /usr/lib/sendmail -t