본문 바로가기

서버/리눅스

telnet smtp test (+ tcpdump)

1. 메일 테스트

#telnet localhost 25

Trying 127.0.0.1...

Connected to localhost

Escape character is '^]'.

220 localhost ESMTP Sendmail 8.14.4/8.14.4; Tue, 11 May 2021 10:18:21 +0900

helo localhost 

250 localhost Hello localhost [127.0.01], pleased to meet you

mail from : test@test.com  #보내는 사람

250 2.1.0 test@test.com... Sender ok

rcpt to : test@test.com #받는 사람

250 2.1.5 test@test.com... Recipient ok (will queue)

data

354 Enter mail, end with "." on a line by itselt

subject: test mail

test

test

.

250 2.0.0 14B1TLMh017987 Message accepted for delivery

quit

 

 

2. tcpdump 로 통신과정 확인하기

어느부분에서 메일이 안가는지 알고 싶을 때

#tcpdump -D 

덤프 뜰 수 있는 인터페이스 리스트 출력

#tcpdump -i eth0(메일보내는 인터페이스) port 25

덤프 내용 확면 출력

#tcpdump -i eth0 port 25 -w tcpdump.pcap

파일로 저장

#tcpdump  host 8.8.8.8

8.8.8.8 로 통신하는 모든 패킷 덤프

#tcpdump - i eth0 dst 8.8.8.8

해당 인터페이스에서 dst ip로 모든 패킷 덤프

 

 

+ 한번의 두개의 덤프를 뜰 수 있는가

putty 세션 두개 키고 가능? -> 됨

 

 

 

 

 

'서버 > 리눅스' 카테고리의 다른 글

tee logging  (0) 2021.12.14
snap 은 무엇인가  (0) 2021.04.12
2021-12 Centos 8 지원 종료/ 2024-07 Centos7 지원 종료 와 대응책  (1) 2021.01.20
scouter 사용법  (0) 2021.01.10
실수로 /usr/lib/python2.* 지웠을때..  (0) 2020.06.29