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: [email protected]"
echo "To: [email protected]"
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
파일을 압축 해제 할 기계에'/ loc /'디렉토리가 있습니까? 행운을 빕니다. – shellter
파일을 바탕 화면에 저장하고 압축을 풉니 다. – Manu
나는 '디렉토리 무시'를 지정하는 zip arg을 사용하지 않는 한 zip이 파일을 찾은 동일한 디렉토리에 파일을 넣으려고한다고 추측합니다. 7z에서는'-e' 옵션을 사용하거나 컴퓨터에서'/ loc /'디렉토리를 만들 수 있습니다. 행운을 빕니다. – shellter