In terms of mail service, we can use the TELNET service for configuration and remote monitoring. Then we need to configure telnet pop. Now let's take a look at how to use TELNET to manually operate SMTP/POP to send and receive emails.
Note: manual input is represented in a blue font, and # is followed by a comment, which cannot be entered.
- ========= Calculate the BASE64 encoded username and password first, and use ============
- [Crazywill @ localhost crazywill] $ perl-MMIME: Base64-e 'print encode_base64 ("crazywill ");'
- Y3Jhenl3aWxs
- [Crazywill @ localhost crazywill] $ perl-MMIME: Base64-e 'print encode_base64 ("mypassword ");'
- BXlwYXNzd29yZA =
- ================================== Start the SMTP mail sending operation ================== ================
- [Crazywill @ localhost crazywill] $ telnet smtp.163.com 25 # telnet to port 25
- Trying 202.108.5.81...
- Connected to smtp.163.com.
- Escape character is '^]'.
- 220 163.com Coremail SMTP (Anti Spam) System
- EHLO smtp.163.com # handshake :)
- 250-mail
- 250-PIPELINING
- 250-AUTH LOGIN PLAIN
- 250-AUTH = LOGIN PLAIN
- 250 8 BITMIME
- Auth login # Start authentication telnet pop LOGIN
- 334 dXNlcm5hbWU6
- Crazywill
- 334 UGFzc3dvcmQ6
- Mypassword
- 535 Error: authentication failed # login failure due to direct user name and password
- AUTH LOGIN
- 334 dXNlcm5hbWU6
- Y3Jhenl3aWxs
- 334 UGFzc3dvcmQ6
- BXlwYXNzd29yZA =
- 235 Authentication successful # log on successfully using Base64 encoding
- Mail from: <test@163.com> # MAIL sender
- 553 You are not authorized to send mail, authentication is required # mail cannot be forged
- Mail from: <crazywill@163.com> # MAIL sender
- 250 Mail OK
- Rcpt to: <crazywill@163.com>
- # Recipient of the email. If multiple recipients exist, repeat this statement multiple times.
- 250 Mail OK
- DATA # body content
- 354 Please start mail input.
- TO: crazywill@163.com
- # Here, the TO, FROM, and other content can be fake at Will :) you can lie, but you can't lie TO anyone who knows how TO view the mail source code.
- FROM: cccc@163.com
- SUBJECT: test by telnet/smtp
-
- Test, just a test. # The Body of the email, which is written with a blank line from the Header.
- . # After the email is completed, enter the result with a period.
- 250 Mail OK queued as smtp10, wKjADQ2ApxRnnqBE0CWaEw =. 38326S3 # If 250 is returned, the message is sent successfully.
- NOOP # empty statement, which does not execute any operation. It is generally used to maintain connection with the server and do not drop the line
- 250 OK
- QUIT # exit
- 221 Closing connection. Good bye.
- Connection closed by foreign host.
- [Crazywill @ localhost crazywill] $