1. sudo apt-get update
2. sudo apt install -y mailutils
여기까지만 하면 일단 설치는 완료
이후에
3. Postfix configuration 화면에서 internet site 선택 후에 도메인명 입력
4. sudo nano /etc/postfix/main.cf
inet_interfaces = all 부분을
inet_interfaces = loopback-only 로 수정
5. do systemctl restart postfix
일단 여기까지 처리하면 발신은 가능함
php로 테스트
<?php
$to = 'choi5781@nate.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@icdn.ml' . "rn" .
'Reply-To: webmaster@icdn.ml' . "rn" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
6. 수신 관련해서는 아래 사이트 참조해서 작업해볼것