2013年8月1日木曜日

[linux][postfix] telnetでメール送信テスト

telnetでsmtpのメール送信ができているかのテスト

$ telnet localhost 25
Trying ::1…
telnet: connect to address ::1: Connection refused
Trying fe80::1…
telnet: connect to address fe80::1: Connection refused
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
220 hokamura-mac.local ESMTP Postfix

mail from: hoge@gmail.com
250 2.1.0 Ok

rcpt to: hoge@gmail.com
250 2.1.5 Ok

data
#文字を書き終えたら enter . enter してねってこと
354 End data with <CR><LF>.<CR><LF>
testtest
.
250 2.0.0 Ok: queued as 80E3787A757

quit
221 2.0.0 Bye
Connection closed by foreign host.
tail /var/log/mail.log | grep postfix
これでfailedしてたら、その箇所をみる。