SMTP authenticatie

AUTH PLAIN

$ perl -MMIME::Base64 -e 'print encode_base64("\000username\000password");'
AHVzZXJuYW1lAHBhc3N3b3Jk
$ telnet smtphost 25
Trying 18.67.13.317
Connected to smtphost.
Escape character is "^]".
220 Domain.com SMTP Server
HELO mailserver
250 smtp.domain.com
AUTH PLAIN AHVzZXJuYW1lAHBhc3N3b3Jk
235 Authentication successful

AUTH LOGIN

$ perl -MMIME::Base64 -e 'print encode_base64("username");'
dXNlcm5hbWU=
$ perl -MMIME::Base64 -e 'print encode_base64("password");'
cGFzc3dvcmQ=
$ telnet smtphost 25
Trying 18.67.13.317
Connected to smtphost.
Escape character is "^]".
220 Domain.com SMTP Server
HELO mailserver
250 smtp.domain.com
AUTH LOGIN
334 VXNlcm5hbWU6
dXNlcm5hbWU=
334 UGFzc3dvcmQ6
cGFzc3dvcmQ=
235 Authentication successful

Let op: Gebruik geen echo in plaats van printf; echo stuurt n !

IMAP authenticatie

LOGIN

$ telnet imaphost 143
Trying 18.67.13.317...
Connected to imaphost.
Escape character is "^]".
* OK
01 LOGIN username password
01 OK Logged in.

AUTHENTICATE PLAIN

$ perl -MMIME::Base64 -e 'print encode_base64("\000username\000password");'
AHVzZXJuYW1lAHBhc3N3b3Jk
$ telnet imaphost 143
Trying 18.67.13.317...
Connected to imaphost .
Escape character is '^]'.
* OK
01 AUTHENTICATE PLAIN
+
AHVzZXJuYW1lAHBhc3N3b3Jk
01 OK Logged in.