Linux   « Send EMAIL from command line | HOME | Nkf - Change Japanese encording »

 ■ TEST for SMTP Auth

If you want to test whether SMTP server and SMTP Auth are working,

# telnet server.com 25

input below.
EHLO localhost

Then system returns msg like below.

250-server.com
250-AUTH LOGIN CRAM-MD5 PLAIN
250-AUTH=LOGIN CRAM-MD5 PLAIN

250-PIPELINING
250 8BITMIME

From here, some authorisation methods are installed already.
Then input quit to log off from telnet.


Check SMTP Auth manually
Before telnet, convert email ID and password to BASE64 format with perl.

# perl -MMIME::Base64 -e 'print encode_base64("username\0username\0password");'
cmFiYml0AHJhYmJpdABob2dlaG9nZWhvZ2U=

Copy this encorded password and use it later.

# telnet server.com 25
EHLO localhost
250-server.com
250-AUTH LOGIN CRAM-MD5 PLAIN
250-AUTH=LOGIN CRAM-MD5 PLAIN
250-PIPELINING
250 8BITMIME
AUTH PLAIN cmFiYml0AHJhYmJpdABob2dlaG9nZWhvZ2U= <<<=== Paste it.

If it is successful you will get below msg.
235 Authentication successful

if failed,
535 authorization failed

Then, input quit to log off from telnet.


Send email via telnet
Also you can have a test for sending email from telnet.

# telnet server.com 25
MAIL FROM:<mail@mail.com>
250 Ok
RCPT TO:<test@test.com>
250 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
email body

. <<<=== Put period to finish email body.
250 Ok: queued as AB3E2B45D
QUIT

投稿者 tomopugh : 2007年07月25日 11:33

Comment

Please comment !




Save the info?


  (Please don't click on "post" twice. It takes time a bit to change to the next screen!!)