邮件不能发送
- oneleaf
- 论坛管理员
- 帖子: 10441
- 注册时间: 2005-03-27 0:06
- 系统: Ubuntu 12.04
-
- 帖子: 7
- 注册时间: 2008-02-26 9:52
谢谢。 我的机器装成服务器,本地用户间的邮件通讯及本地向外部如hotmail的邮件不通。
telnet 测试好像正常:
$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 ccitv-web ESMTP Sendmail 8.14.1/8.14.1/Debian-8ubuntu1; Mon, 25 Feb 2008 22:30:47 -0800; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
ehlo localhost
250-ccitv-web Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
错误信息: /var/log/mail.err
Feb 25 13:20:42 cc-web sendmail[19093]: unable to qualify my own domain name (cc-web) -- using short name
Feb 25 13:21:01 cc-web sm-msp-queue[19109]: unable to qualify my own domain name (cc-web) -- using short name
Feb 25 13:40:01 cc-web sm-msp-queue[19169]: My unqualified host name (cc-web) unknown; sleeping for retry
Feb 25 15:27:59 cc-web postfix/postfix-script[21123]: fatal: usage: postfix start (or stop, reload, abort, flush, check, set-permissions, upgrade-configuration)
Feb 25 15:28:31 cc-web postfix/postfix-script[21128]: fatal: the Postfix mail system is not running
Feb 25 15:28:38 cc-web postfix/master[21201]: fatal: bind 127.0.0.1 port 25: Address already in use
好像端口25被别的占用了。
telnet 测试好像正常:
$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 ccitv-web ESMTP Sendmail 8.14.1/8.14.1/Debian-8ubuntu1; Mon, 25 Feb 2008 22:30:47 -0800; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
ehlo localhost
250-ccitv-web Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
错误信息: /var/log/mail.err
Feb 25 13:20:42 cc-web sendmail[19093]: unable to qualify my own domain name (cc-web) -- using short name
Feb 25 13:21:01 cc-web sm-msp-queue[19109]: unable to qualify my own domain name (cc-web) -- using short name
Feb 25 13:40:01 cc-web sm-msp-queue[19169]: My unqualified host name (cc-web) unknown; sleeping for retry
Feb 25 15:27:59 cc-web postfix/postfix-script[21123]: fatal: usage: postfix start (or stop, reload, abort, flush, check, set-permissions, upgrade-configuration)
Feb 25 15:28:31 cc-web postfix/postfix-script[21128]: fatal: the Postfix mail system is not running
Feb 25 15:28:38 cc-web postfix/master[21201]: fatal: bind 127.0.0.1 port 25: Address already in use
好像端口25被别的占用了。
-
- 帖子: 7
- 注册时间: 2008-02-26 9:52
-
- 帖子: 458
- 注册时间: 2006-11-27 12:25
-
- 帖子: 7
- 注册时间: 2008-02-26 9:52
-
- 帖子: 7
- 注册时间: 2008-02-26 9:52
邮件发送失败及相关的配置信息
Sendmail 启动及 发送邮件 到 tony_gy@hotmail.com 的 log 片段:
tail /var/log/mail.log: ***********************************************************************************
...
Mar 1 12:48:07 ccitv-web sm-mta[5717]: starting daemon (8.14.1): SMTP+queueing@00:10:00
Mar 1 12:48:09 ccitv-web dovecot: Dovecot v1.0.5 starting up
Mar 1 12:50:27 ccitv-web sendmail[6355]: m21Kns0t006355: from=ccitv, size=50, class=0, nrcpts=1, msgid=<200803012049.m21Kns0t006355@ccitv-web.org>, relay=ccitv@localhost
Mar 1 12:50:27 ccitv-web sm-mta[6356]: m21KoRWH006356: from=<ccitv@ccitv-web.org>, size=356, class=0, nrcpts=1, msgid=<200803012049.m21Kns0t006355@ccitv-web.org>, proto=ESMTP, daemon=MSP-v4, relay=localhost [127.0.0.1]
Mar 1 12:50:27 ccitv-web sendmail[6355]: m21Kns0t006355: to=tony_gy@hotmail.com, ctladdr=ccitv (1000/1000), delay=00:00:33, xdelay=00:00:00, mailer=relay, pri=30050, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (m21KoRWH006356 Message accepted for delivery)
Mar 1 12:50:53 ccitv-web sm-mta[6361]: m21Koe1p006361: ccitv-web.org [192.168.8.101] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA-v4
服务器配置:
ifconfig :********************************************************
eth0 链路封装:以太网 硬件地址 00:1A:92:CB:7E:F4
inet 地址:192.168.8.101 广播:192.168.8.255 掩码:255.255.255.0
inet6 地址: fe80::21a:92ff:fecb:7ef4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:1003 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:1009 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:1025341 (1001.3 KB) 发送字节:177598 (173.4 KB)
中断:22 基本地址:0xc000
lo 链路封装:本地环回
inet 地址:127.0.0.1 掩码:255.0.0.0
inet6 地址: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 跃点数:1
接收数据包:188 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:188 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:0
接收字节:24955 (24.3 KB) 发送字节:24955 (24.3 KB)
$ cat /etc/hosts ***********************************************************
127.0.0.1 localhost
192.168.8.101 ccitv-web.org ccitv.ccitv-web.org ccitv-web ccitv cc-web
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
~$ cat /etc/host.conf ****************************************************
# The "order" line is only used by old versions of the C library.
order hosts,bind
multi on
$ ls /etc/bind/named.conf **********************************************************
/etc/bind/named.conf
ccitv@ccitv-web:~$ cat /etc/bind/named.conf
include "/etc/bind/named.conf.options";
// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/etc/bind/db.root";
};
zone "localhost" {
type master;
file "/etc/bind/db.local";
};
zone "ccitv-web" {
type master;
notify no;
allow-query { any; };
file "/etc/bind/db.127";
};
zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};
include "/etc/bind/named.conf.local";
$cat /etc/networks *****************************************************
# symbolic names for networks, see networks(5) for more information
link-local 169.254.0.0
localhost 192.168.8.101
lo 127.0.0.1
~$ cat /etc/network/interfaces **********************************
auto eth0
iface lo inet loopback
iface eth0 inet static
address 192.168.8.101
netmask 255.255.255.0
network 192.168.8.0
broadcast 192.168.8.255
gateway 192.168.8.1
$ sudo cat /etc/mail/access
localhost RELAY
192.168 RELAY
127.0.0.1 RELAY
hotmail.com RELAY
yahoo.com RELAY
gmail.com RELAY
yahoo.ca RELAY
GreetPause:localhost 0
ClientRate:localhost 0
ClientConn:localhost 0
Connect:127 RELAY
GreetPause:127 0
ClientRate:127 0
ClientConn:127 0
Connect:[IPv6:::1] RELAY
GreetPause:[IPv6:::1] 0
ClientRate:[IPv6:::1] 0
ClientConn:[IPv6:::1] 0
#Connect:192.168 RELAY
#GreetPause:192.168 0
#ClientRate:192.168 0
#ClientConn:192.168 0
# Defaults
GreetPause: 5000
ClientRate: 10
ClientConn: 10
Spam:postmaster@ FRIEND
Spam:abuse@ FRIEND
Spam:spam@ FRIEND
reject@ REJECT
# Block invalid IPs
Connect:0 REJECT
Connect:169.254 REJECT
Connect:192.0.2 REJECT
Connect:224 REJECT
Connect:255 REJECT
~$ sudo cat /etc/mail/sendmail.mc
divert(-1)dnl
#-----------------------------------------------------------------------------
divert(0)dnl
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc, v 8.14.1-8ubuntu1 2007-08-01 05:06:30 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-mta')dnl
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
undefine(`confHOST_STATUS_DIRECTORY')dnl #DAEMON_HOSTSTATS=
FEATURE(`no_default_msa')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=0.0.0.0')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission')dnl
dnl # Stop connections that overflow our concurrent and time connection rates
FEATURE(`conncontrol', `nodelay', `terminate')dnl
FEATURE(`ratecontrol', `nodelay', `terminate')dnl
dnl # Dialup/LAN connection overrides
dnl #
include(`/etc/mail/m4/dialup.m4')dnl
include(`/etc/mail/m4/provider.m4')dnl
dnl #
dnl # Default Mailer setup
MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl
tail /var/log/mail.log: ***********************************************************************************
...
Mar 1 12:48:07 ccitv-web sm-mta[5717]: starting daemon (8.14.1): SMTP+queueing@00:10:00
Mar 1 12:48:09 ccitv-web dovecot: Dovecot v1.0.5 starting up
Mar 1 12:50:27 ccitv-web sendmail[6355]: m21Kns0t006355: from=ccitv, size=50, class=0, nrcpts=1, msgid=<200803012049.m21Kns0t006355@ccitv-web.org>, relay=ccitv@localhost
Mar 1 12:50:27 ccitv-web sm-mta[6356]: m21KoRWH006356: from=<ccitv@ccitv-web.org>, size=356, class=0, nrcpts=1, msgid=<200803012049.m21Kns0t006355@ccitv-web.org>, proto=ESMTP, daemon=MSP-v4, relay=localhost [127.0.0.1]
Mar 1 12:50:27 ccitv-web sendmail[6355]: m21Kns0t006355: to=tony_gy@hotmail.com, ctladdr=ccitv (1000/1000), delay=00:00:33, xdelay=00:00:00, mailer=relay, pri=30050, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (m21KoRWH006356 Message accepted for delivery)
Mar 1 12:50:53 ccitv-web sm-mta[6361]: m21Koe1p006361: ccitv-web.org [192.168.8.101] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA-v4
服务器配置:
ifconfig :********************************************************
eth0 链路封装:以太网 硬件地址 00:1A:92:CB:7E:F4
inet 地址:192.168.8.101 广播:192.168.8.255 掩码:255.255.255.0
inet6 地址: fe80::21a:92ff:fecb:7ef4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:1003 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:1009 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:1025341 (1001.3 KB) 发送字节:177598 (173.4 KB)
中断:22 基本地址:0xc000
lo 链路封装:本地环回
inet 地址:127.0.0.1 掩码:255.0.0.0
inet6 地址: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 跃点数:1
接收数据包:188 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:188 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:0
接收字节:24955 (24.3 KB) 发送字节:24955 (24.3 KB)
$ cat /etc/hosts ***********************************************************
127.0.0.1 localhost
192.168.8.101 ccitv-web.org ccitv.ccitv-web.org ccitv-web ccitv cc-web
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
~$ cat /etc/host.conf ****************************************************
# The "order" line is only used by old versions of the C library.
order hosts,bind
multi on
$ ls /etc/bind/named.conf **********************************************************
/etc/bind/named.conf
ccitv@ccitv-web:~$ cat /etc/bind/named.conf
include "/etc/bind/named.conf.options";
// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/etc/bind/db.root";
};
zone "localhost" {
type master;
file "/etc/bind/db.local";
};
zone "ccitv-web" {
type master;
notify no;
allow-query { any; };
file "/etc/bind/db.127";
};
zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};
include "/etc/bind/named.conf.local";
$cat /etc/networks *****************************************************
# symbolic names for networks, see networks(5) for more information
link-local 169.254.0.0
localhost 192.168.8.101
lo 127.0.0.1
~$ cat /etc/network/interfaces **********************************
auto eth0
iface lo inet loopback
iface eth0 inet static
address 192.168.8.101
netmask 255.255.255.0
network 192.168.8.0
broadcast 192.168.8.255
gateway 192.168.8.1
$ sudo cat /etc/mail/access
localhost RELAY
192.168 RELAY
127.0.0.1 RELAY
hotmail.com RELAY
yahoo.com RELAY
gmail.com RELAY
yahoo.ca RELAY
GreetPause:localhost 0
ClientRate:localhost 0
ClientConn:localhost 0
Connect:127 RELAY
GreetPause:127 0
ClientRate:127 0
ClientConn:127 0
Connect:[IPv6:::1] RELAY
GreetPause:[IPv6:::1] 0
ClientRate:[IPv6:::1] 0
ClientConn:[IPv6:::1] 0
#Connect:192.168 RELAY
#GreetPause:192.168 0
#ClientRate:192.168 0
#ClientConn:192.168 0
# Defaults
GreetPause: 5000
ClientRate: 10
ClientConn: 10
Spam:postmaster@ FRIEND
Spam:abuse@ FRIEND
Spam:spam@ FRIEND
reject@ REJECT
# Block invalid IPs
Connect:0 REJECT
Connect:169.254 REJECT
Connect:192.0.2 REJECT
Connect:224 REJECT
Connect:255 REJECT
~$ sudo cat /etc/mail/sendmail.mc
divert(-1)dnl
#-----------------------------------------------------------------------------
divert(0)dnl
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc, v 8.14.1-8ubuntu1 2007-08-01 05:06:30 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-mta')dnl
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
undefine(`confHOST_STATUS_DIRECTORY')dnl #DAEMON_HOSTSTATS=
FEATURE(`no_default_msa')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=0.0.0.0')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission')dnl
dnl # Stop connections that overflow our concurrent and time connection rates
FEATURE(`conncontrol', `nodelay', `terminate')dnl
FEATURE(`ratecontrol', `nodelay', `terminate')dnl
dnl # Dialup/LAN connection overrides
dnl #
include(`/etc/mail/m4/dialup.m4')dnl
include(`/etc/mail/m4/provider.m4')dnl
dnl #
dnl # Default Mailer setup
MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl