질문&답변
클라우드/리눅스에 관한 질문과 답변을 주고 받는 곳입니다.
리눅스 분류

리눅스 메일관련 에러

작성자 정보

  • 아리랑 작성
  • 작성일

컨텐츠 정보

본문

    <?
class mime
{
 var $mime_version = "1.0"; // mime version
 var $mime_content_type = "text/plain";
 var $mime_charset = "ks_c_5601-1987";
 var $mime_encoding = "base64";
 var $mime_boundary = null;
 var $mime_xmailer = null;

 function set_content_type($content_type = null)
 {
  $this->mime_content_type = $content_type != null ? $content_type : "text/html";
 }

 function set_charset($charset = null)
 {
  $this->mime_charset = $charset != null ? $charset : "euc_kr";
 }

 function set_boundary($boundary = null)
 {
  $this->mime_boundary = $boundary ? $boundary : null;
 }

 function set_encoding($encoding = null)
 {
  $this->mime_encoding = $encoding != null ? $encoding : "base64";
 }

 function set_xmailer($xmailer = null)
 {
  $this->mime_xmailer = $xmailer != null ? $xmailer : $_SERVER['HTTP_USER_AGENT'];
 }

}

class sendmail extends mime
{
 var $smtp_server = "localhost";
 var $smtp_port = 25;
 var $smtp_timeout = 30;
 var $smtp_socketopen = 0;
 var $smtp_status = false;
 var $smtp_CRLF = " ";
 var $smtp_attachfile_name = null;
 var $smtp_attachfile_size = 0;
 var $smtp_attachfile_type = null;
 var $smtp_cmd_status = array();
 var $from_name = null;
 var $from = null;
 var $to_name = null;
 var $to = null;
 var $mail_from = null;
 var $mail_to = null;
 var $mail_subject = null;
 var $mail_priority = 3;
 var $mail_notification = 0;
 var $mail_body = null;


 function encoding($str)
 {
  // =?ks_c_5601-1987?B? : 네이버 ks => euc-kr , 구글 ks => utf8
  return "=?ks_c_5601-1987?B?" . base64_encode($str) . "?=";
 }

 function _mail_env ($to_name, $to, $from_name, $from, $subject, $body, $priority = 3, $notification = 0)      
 {
  $this->mail_from = $from_name."<".$from.">";
  $this->mail_to = $to_name."<".$to.">";
  $this->mail_subject = $subject;
  $this->mail_body = $body;
  $this->mail_priority = $priority;
  $this->mail_notification = $notification;  
 }

 function _smtp_base_header()
 {
  $this->_smtp_cmd("From: $this->mail_from");
  $this->_smtp_cmd("To: $this->mail_to");
  $this->_smtp_cmd("Subject: $this->mail_subject");
  $this->_smtp_cmd("MIME-Version: $this->mime_version");
  $this->_smtp_cmd("X-Priority: $this->mail_priority");
  $this->_smtp_cmd("X-Mailer: $this->mime_xmailer");
 }

 function _smtp_base_content()
 {
  $this->_smtp_cmd("Content-Type: $this->mime_content_type; charset="$this->mime_charset"");
  $this->_smtp_cmd("Content-Transfer-Encoding: $this->mime_encoding");
 }


 function _smtp_multipart_content($attach = false)
 {
  if($attach)
  {
   $this->_smtp_cmd("Content-Type: multipart/mixed; boundary="$this->mime_boundary"");
  } else {
   $this->_smtp_cmd("Content-Type: multipart/alternative; boundary="$this->mime_boundary"");
  }
  $this->_smtp_cmd("$this->smtp_CRLF");
  $this->_smtp_cmd("This is a multi-part message in MIME format.");
 }

 function _smtp_attachfile_content()
 {
  $this->_smtp_cmd("Content-Type: $this->smtp_attachfile_type");
  $this->_smtp_cmd("Content-Transfer-Encoding: $this->mime_encoding");
  $this->_smtp_cmd("Content-Disposition: attachment; filename="$this->smtp_attachfile_name"");
 }

 function _smtp_start_boundary()
 {
  $this->_smtp_cmd("$this->smtp_CRLF");
  $this->_smtp_cmd("--$this->mime_boundary");
 }

 function _smtp_end_boundary()
 {
  $this->_smtp_cmd("--$this->mime_boundary--");
 }

 function open()
 {
  $this->smtp_socketopen = @fsockopen($this->smtp_server, $this->smtp_port, $errno, $errstr, $this->smtp_timeout);  
  if($this->_smtp_code($this->_receive()) != 220)
  {
   $this -> historyBack("메일서버에 접속할 수 없습니다.");
  }
  else
  {
   $this->smtp_status = true;
  }

  return $this->smtp_status;
 }

 function _smtp_helo()
 {  
  $this->_smtp_cmd("HELO ".$this->smtp_server);
  $CODE[0] = $this->_smtp_code($this->_receive());
  if( $CODE[0] == 250 ): return true; endif;  
  return false;
 }

 function _smtp_mailfrom($from)
 { 
  $this->_smtp_cmd("MAIL FROM: ".$this->mail_from);
  $CODE[1] = $thi

 

위소스는  웹홈페이지자체에서 메일을 보내고 받는 소스인데

얼마전에 누가 서버 퍼미션을 루트부터 755로 해놔가지고 메일서버에 접속이 안되는것 같은데요.

mysql.sock 이부분도 755로 되어있어가지고 원래 퍼미션으로 조정을 해놨습니다.

근데도 "메일서버에 접속을 할수 없습니다" 계속 이런메세지가 나오는데

원인은 일단 퍼미션이 모두 755로 되어있다는 것인데요. 위 소스를 볼때 소켓관련해서 어떤 파일 퍼미션을

조정해야 할까요? 어떤파일을 통해서 접속을 하는것 같은데 그게 몽땅 755로 되어있으니

어디를 손봐야 할지 모르겠습니다.

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,034 명
  • 현재 강좌수 :  35,787 개
  • 현재 접속자 :  229 명