메라크 웹 메일에서 다음(daum.net)으로 메일 발송시,
첨부 파일에 한글 등의 문자가 있는 경우에 다음 웹메일을 확인하면 정상적으로 디코딩되지
않고 인코딩한 상태 그대로를 보여주는 경우가 있습니다.
이 문제는 다음 메일 서버 프로그램이 첨부파일 이름에 대한 디코딩을 정확히 처리하지
못해서 발생합니다.
실제 이 문제를 해결하려면 다음측과 연락하여 수정하게 하면 되지만, 현실적으로는 불가능하기
때문에 메라크 웹 메일의 소스 일부를 수정하여 이 문제를 해결하는 방편을 제공합니다.
메라크 설치 폴더 / html / mail / send.html 파일을 편집기로 엽니다.
빨간 색으로 표시된 부분을 삭제하면 됩니다. 백업은 필수 ^^; 입니다.
if ($anywriteattach)
{
require_once('inc/function.view.php');
$oAttach = new upAttachment($usessid);
if ($oAttach->validateusession($usessid)){
$aAtt_array = $oAttach->getAttachments();
foreach ($aAtt_array as $aAtt) {
if (!in_array($aAtt['id'],$attbox)) continue;
$message .= "\r\n--" . $boundary . "\r\nContent-Type: " . $aAtt['type'] . '; name="' . putheader($aAtt['name'],$sendcharset) . "\"\r\n";
if (strtolower($aAtt['type'])=='message/rfc822') {
$message .= "Content-Transfer-Encoding: 7bit\r\nContent-Disposition: inline;\r\n filename=\"".putheader($aAtt['name'],$sendcharset)."\"\r\n\r\n";
if (@$file = fopen($aAtt['path'], "rb")) {
$msgbody = trim(fread($file, filesize($aAtt['path'])));
if(ereg("[0-9]",$msgbody[0])) $msgbody = substr($msgbody,strpos($msgbody,"\r\n")+2);
// If not IMAP then check <dot> at the end and remove it
if ($aAtt['ext'] == imapmessageext && strlen($msgbody) > 0 && $msgbody[strlen($msgbody)-1] == ".")
$msgbody = substr($msgbody, 0, -1);
$message .= $msgbody;
unset($msgbody);
fclose($file);
}
}
else {
$message .= "Content-Transfer-Encoding: base64\r\n\r\n";
$message .= imap_binary(file_get_contents($aAtt['path']));
}
}
//$oAttach->removeSession();
//unset($oAttach);
}
$message .= "\r\n--" . $boundary . "--";
}
이러한 변경작업 후,
첨부파일 이름을 인코딩하지 않고 직접보냅니다. 따라서, 안티 스팸 엔진 등이 이러한 이유로
인해(RFC 822) 스팸으로 분류할 가능성이 높아집니다.
그럼.
첨부 파일에 한글 등의 문자가 있는 경우에 다음 웹메일을 확인하면 정상적으로 디코딩되지
않고 인코딩한 상태 그대로를 보여주는 경우가 있습니다.
이 문제는 다음 메일 서버 프로그램이 첨부파일 이름에 대한 디코딩을 정확히 처리하지
못해서 발생합니다.
실제 이 문제를 해결하려면 다음측과 연락하여 수정하게 하면 되지만, 현실적으로는 불가능하기
때문에 메라크 웹 메일의 소스 일부를 수정하여 이 문제를 해결하는 방편을 제공합니다.
메라크 설치 폴더 / html / mail / send.html 파일을 편집기로 엽니다.
빨간 색으로 표시된 부분을 삭제하면 됩니다. 백업은 필수 ^^; 입니다.
if ($anywriteattach)
{
require_once('inc/function.view.php');
$oAttach = new upAttachment($usessid);
if ($oAttach->validateusession($usessid)){
$aAtt_array = $oAttach->getAttachments();
foreach ($aAtt_array as $aAtt) {
if (!in_array($aAtt['id'],$attbox)) continue;
$message .= "\r\n--" . $boundary . "\r\nContent-Type: " . $aAtt['type'] . '; name="' . putheader($aAtt['name'],$sendcharset) . "\"\r\n";
if (strtolower($aAtt['type'])=='message/rfc822') {
$message .= "Content-Transfer-Encoding: 7bit\r\nContent-Disposition: inline;\r\n filename=\"".putheader($aAtt['name'],$sendcharset)."\"\r\n\r\n";
if (@$file = fopen($aAtt['path'], "rb")) {
$msgbody = trim(fread($file, filesize($aAtt['path'])));
if(ereg("[0-9]",$msgbody[0])) $msgbody = substr($msgbody,strpos($msgbody,"\r\n")+2);
// If not IMAP then check <dot> at the end and remove it
if ($aAtt['ext'] == imapmessageext && strlen($msgbody) > 0 && $msgbody[strlen($msgbody)-1] == ".")
$msgbody = substr($msgbody, 0, -1);
$message .= $msgbody;
unset($msgbody);
fclose($file);
}
}
else {
$message .= "Content-Transfer-Encoding: base64\r\n\r\n";
$message .= imap_binary(file_get_contents($aAtt['path']));
}
}
//$oAttach->removeSession();
//unset($oAttach);
}
$message .= "\r\n--" . $boundary . "--";
}
이러한 변경작업 후,
첨부파일 이름을 인코딩하지 않고 직접보냅니다. 따라서, 안티 스팸 엔진 등이 이러한 이유로
인해(RFC 822) 스팸으로 분류할 가능성이 높아집니다.
그럼.