How to Test SMTP AUTH using Telnet
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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
805 | Develop | [android] ListView+ArrayAdapter 테스트 | hooni | 2013.04.23 | 43899 |
804 | Develop | [android] N-Puzzle 게임 | hooni | 2015.07.09 | 865 |
803 | Develop | [android] SQLiteOpenHelper를 이용한 DBManager | hooni | 2017.06.14 | 2065 |
802 | Develop | [android] SurfaceView를 이용한 애니메이션 ㅎㅎ | hooni | 2013.04.23 | 57704 |
801 | Develop | [android] [번역] 안드로이드 Android Cloud to Device Messaging(C2DM) | hooni | 2013.04.23 | 20421 |
800 | Develop | [android] 가속도 센서를 이용한 흔듦(Shake) 감지 | hooni | 2014.11.04 | 1898 |
799 | Develop | [android] 간단한 SQLIite 예제 | hooni | 2017.06.14 | 1325 |
798 | Develop | [android] 개발 환경 세팅 따라하기 ㅋㅋ | hooni | 2013.04.23 | 40398 |
797 | Develop | [android] 단일 Thread 환경의 안드로이드에서 Handler를 사용 | hooni | 2013.04.23 | 26493 |
796 | Develop | [android] 디바이스(시뮬레이터) hosts 파일 수정하기 | hooni | 2013.04.23 | 31071 |
795 | Develop | [android] 딜레이를 구현하기 위한 꼼수 | hooni | 2016.11.24 | 936 |
794 | Develop | [android] 레이아웃 사이즈 변경 (동적; programmatically) | hooni | 2016.11.07 | 1480 |