SMTP
Envío de Correo
user@host:~# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.example.net ESMTP
helo testing
250 mail.example.net
mail from: user@example.net
250 2.1.0 Ok
rcpt to: local@example.net
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
from: user@example.net
to: local@example.net
Subject: test 1908
Test 1908
.
250 2.0.0 Ok: queued as 2BA152A005D
quit
221 2.0.0 Bye
Connection closed by foreign host.
Envío de Correo con SSL
user@host:~# openssl s_client -starttls smtp -crlf -connect 127.0.0.1:25
<output of the certificate verification .. >
---
250 DSN
ehlo testing
250-mail.example.net
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: user@example.net
250 2.1.0 Ok
rcpt to: local@example.net
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
From: user@example.net
To: local@example.net
Subject: test 1908
Test 1908
.
250 2.0.0 Ok: queued as 12C842A005D
quit
Autenticación SMTP (SASL)
Primero se debe general un hash en base64 del nombre de usuario y la contraseña:
user@host:~# perl -MMIME::Base64 -e 'print encode_base64("\000local\000JZY+0t6dF$278%")'
AGxvY2FsAEpaWSswdDZkRiU=
Luego realizamos la prueba
user@host:~# openssl s_client -starttls smtp -crlf -connect 127.0.0.1:25
ehlo testing
250-mail.example.net
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH PLAIN AGxvY2FsAEpaWSswdDZkRiU=
235 2.7.0 Authentication successful
POP3
Texto Plano
user@host:~# telnet localhost 110
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
+OK Hello there.
user local@example.net
+OK Password required.
pass JZY+0t6dF$278%
+OK logged in.
stat
+OK 47 13458471
quit
Con SSL
user@host:~# openssl s_client -connect 127.0.0.1:995
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
+OK Hello there.
user local@example.net
+OK Password required.
pass JZY+0t6dF$278%
+OK logged in.
stat
+OK 47 13458471
quit
0 Comentarios