Develop
2018.04.05 08:09

How to Test SMTP AUTH using Telnet

Views 1330 Votes 0 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

Below are instructions on how to test SMTP AUTH against a mail server using Telnet and entering the commands by hand.

The first thing you need to do is get a base64 encoding of your username and password. There are a couple ways to do this, the example below uses Perl:

perl -MMIME::Base64 -e 'print encode_base64("username");' perl -MMIME::Base64 -e 'print encode_base64("password");'


What will be returned from each command is a base64 encoding of the username and password; save these as you will need them later. Now connect to the mail server using Telnet:

telnet mailserver.com 25


Greet the mail server:

EHLO mailserver.com


Tell the server you want to authenticate with it:

AUTH LOGIN


The server should have returned 334 VXNlcm5hbWU6; this is a base64 encoded string asking you for your username, paste the base64 encoded username you created earlier, example:

dXNlcm5hbWUuY29t


Now the server should have returned 334 UGFzc3dvcmQ6;. Again this is a base64 encoded string now asking for your password, paste the base64 encoded password you created, example:

bXlwYXNzd29yZA==


Now you should have received a message telling you that you successfully authenticated. If it failed your user/pass may have been wrong or your mailserver is broken.

Below is a log of a real successful SMTP AUTH connection over Telnet:

user@localhost [~]# telnet exampledomain.com 25 Trying 1.1.1.1... Connected to exampledomain.com (1.1.1.1). Escape character is '^]'. 220-server1.exampledomain.com ESMTP Exim 4.66 #1 Wed, 09 May 2007 23:55:12 +0200 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. EHLO exampledomain.com 250-server1.exampledomain.com Hello [1.1.1.2] 250-SIZE 52428800 250-PIPELINING 250-AUTH PLAIN LOGIN 250-STARTTLS 250 HELP AUTH LOGIN 334 VXNlcm5hbWU6 dXNlcm5hbWUuY29t 334 UGFzc3dvcmQ6 bXlwYXNzd29yZA== 235 Authentication succeeded



[출처] https://www.ndchost.com/wiki/mail/test-smtp-auth-telnet



?

List of Articles
No. Category Subject Author Date Views
1093 Develop [ios] Thread Loop 내에서 UI 업데이트 방법 hooni 2015.01.03 845
1092 Develop [ios] URL 랜딩 속도(OpenURL 10초 정지되는) 이슈 hooni 2015.02.09 847
1091 Develop [ios] 문자열로 함수 실행하기 (eval 함수처럼) hooni 2015.02.10 849
1090 Develop [android] AlertDialog 메시지 창 띄우기 hooni 2015.07.09 849
1089 Develop XE Core 1.8.18 본문 작성시 태그(html) 사라지는 버그 file hooni 2016.04.21 862
1088 Develop [android] N-Puzzle 게임 file hooni 2015.07.09 863
1087 Develop [ios] iOS 앱 아이콘을 만드는 유틸 file hooni 2015.01.03 867
1086 Develop [ios] ViewController Push할 때 애니메이션 효과 hooni 2015.10.23 868
1085 Develop [git] 쉬운 버전관리 Git 설명 hooni 2015.08.18 870
1084 PPT [ppt] Information Security 발표 자료 (@Team Study 2012.11.15) file hooni 2015.07.22 876
1083 System/OS [mac] OS X 엘 캐피탄에서 Soudflower 사용하기 2 file hooni 2016.10.03 876
1082 Develop [c] RSA 암호화 구현(gmp 라이브러리 활용) file hooni 2016.10.03 878
1081 System/OS [mac] How to uninstall MySQL on Mac OS. hooni 2017.11.08 882
1080 Develop [js] AngularJS 란? file hooni 2015.11.26 883
1079 Develop [ios] APNS에 사용할 인증서 만들기 (KeyChain에 있는 인증서 Export) file hooni 2015.01.03 888
1078 System/OS 맥에서 포트 확인하고 닫기 (mac) hooni 2022.03.22 888
Board Pagination Prev 1 4 5 6 7 8 ... 74 Next
/ 74