为何可以用telnet发送邮件,无法用mail或mailx发送邮件?
发表于 : 2015-08-19 11:25
1 # vi /etc/mail.rc
2 set from=[email protected]
3 set smtp=smtp.qq.com
4 set smtp-auth-user=123456
5 set smtp-auth-password=sbsbsbsb
6 set smtp-auth=login
安装完postfix后:
root@pengsir:/home/debian8# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 pengsir.hfi ESMTP Postfix (Debian/GNU)
ehlo mail
250-pengsir.hfi
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:<root>
250 2.1.0 Ok
rcpt to:<debian8>
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
this is a test mail send from root
.
250 2.0.0 Ok: queued as CA53CF82C3
quit
221 2.0.0 Bye
Connection closed by foreign host.
邮件发送成功了,我们进入debian8t帐号,看看。
root@pengsir:/home/debian8# su debian8
debian8@pengsir:~$ mail
Mail version 8.1.2 01/15/2001. Type ? for help.
"/var/mail/debian8": 1 messages 1 new 1 unread
N 1 [email protected] Wed Aug 19 10:10 13/441
& 1
Message 1:
From [email protected] Wed Aug 19 10:10:56 2015
X-Original-To: debian8
Date: Wed, 19 Aug 2015 10:10:23 +0800 (HKT)
From: [email protected]
this is a test mail send from root
& quit
使用mail或mailx发送邮件出现问题:
mail -s 'test_for_postfix' [email protected]
mailx -s 'test_for_postfix' [email protected]
鼠标似乎永远停留在屏幕上,没有错误输出,请问,这是什么问题?
2 set from=[email protected]
3 set smtp=smtp.qq.com
4 set smtp-auth-user=123456
5 set smtp-auth-password=sbsbsbsb
6 set smtp-auth=login
安装完postfix后:
root@pengsir:/home/debian8# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 pengsir.hfi ESMTP Postfix (Debian/GNU)
ehlo mail
250-pengsir.hfi
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:<root>
250 2.1.0 Ok
rcpt to:<debian8>
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
this is a test mail send from root
.
250 2.0.0 Ok: queued as CA53CF82C3
quit
221 2.0.0 Bye
Connection closed by foreign host.
邮件发送成功了,我们进入debian8t帐号,看看。
root@pengsir:/home/debian8# su debian8
debian8@pengsir:~$ mail
Mail version 8.1.2 01/15/2001. Type ? for help.
"/var/mail/debian8": 1 messages 1 new 1 unread
N 1 [email protected] Wed Aug 19 10:10 13/441
& 1
Message 1:
From [email protected] Wed Aug 19 10:10:56 2015
X-Original-To: debian8
Date: Wed, 19 Aug 2015 10:10:23 +0800 (HKT)
From: [email protected]
this is a test mail send from root
& quit
使用mail或mailx发送邮件出现问题:
mail -s 'test_for_postfix' [email protected]
mailx -s 'test_for_postfix' [email protected]
鼠标似乎永远停留在屏幕上,没有错误输出,请问,这是什么问题?