Sendmail 설치 및 설정
apt-get update -y && apt-get upgrade -y
apt-get install -y openssl sendmail sasl2-bin
sendmail 설정 변경
vi /etc/mail/sendmail.mc
============================================================
dnl DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl
아래로 변경
DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=0.0.0.0')dnl
-> smtp 25 tcp port 이용
dnl DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1')dnl
아래로 변경
DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=0.0.0.0')dnl
-> submission 587 tcp port 이용
============================================================
DNS 관련 부분 선언
vi /etc/mail/local-host-names
============================================================
localhost
호스트네임
93it-serverengineer.co.kr
mail.93it-serverengineer.co.kr
============================================================
sendmail 관련 설정 cf설정
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
sendmail 재시작 및 시작프로그램 등록
systemctl restart sendmail
systemctl enable sendmail
테스트 메일 계정 생성
useradd ID
passwd ID
telnet 메일 테스트
# telnet localhost 25
============================================================
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 recure177-197439 ESMTP Sendmail 8.15.2/8.15.2/Debian-18; Thu, 16 Mar 2023 23:47:19 GMT; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
============================================================
helo 도메인 // ex) 93it-serverengineer.co.kr
250 recure177-197439 Hello localhost [127.0.0.1], pleased to meet you
============================================================
mail from:kol493@93it-serverengineer.co.kr ex) ID@93it-serverengineer.co.kr
250 2.1.0 kol493@93it-serverengineer.co.kr... Sender ok
============================================================
rcpt to:aaa@naver.com ex)
250 2.1.5 aaa@naver.com... Recipient ok
============================================================
data
354 Enter mail, end with "." on a line by itself
subject: 12345
12345
1234
123
12
12
============================================================
.
250 2.0.0 32GNlJxg058765 Message accepted for delivery
============================================================
quit
221 2.0.0 recure177-197439 closing connection
Connection closed by foreign host.
============================================================
'Mail > Sendmail' 카테고리의 다른 글
Sendmail 속도 최적화 (0) | 2023.03.10 |
---|---|
Sendmail 설정 tip (0) | 2023.03.10 |
Sendmail 설치 설정 (0) | 2023.03.10 |
댓글