我現在有一臺Mail Server ,可以正常收發郵件,沒有問題.是用Linux 9.0 + Postfix做的
而我還要建立一臺Mail Server專門作為發送郵件的服務器,是用CentOS + Postfix,
目前用CentOS這臺發送郵件時總是發送不出去,揭示"unkown user"
錯誤日志如下:
Dec 22 07:14:03 smtp postfix/smtpd[9652]: NOQUEUE: reject: RCPT from unknown[172.16.86.60]: 550 <mis@gd.um.com>: Recipient address rejected: User unknown in local recipient table; from=<wht@gd.um.com> to=<mis@gd.um.com> proto=SMTP helo=<T1112>
Dec 22 07:14:03 smtp postfix/smtpd[9652]: disconnect from unknown[172.16.86.60]
以下兩臺server的設定檔.
Linux 9.0+Postfix
[root@mail named]# more /etc/named.conf
// generated by named-bootconf.pl
options {
directory "/var/named";
forwarders{
10.0.0.1;202.96.128.68;
};
//forward-only;
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
zone "86.16.172.IN-ADDR.ARPA"{
type master;
file "172.16.86";
allow-transfer { 172.16.86.5; };
notify yes;
};
zone "0.0.10.in-addr.arpa"{
type master;
file "10.0.0";
};
zone "gd.um.com"{
type master;
file "gd.um.com";
allow-transfer { 172.16.86.5; };
};
include "/etc/rndc.key";
[root@mail named]# more gd.um.com
@ IN SOA mail hostmaster.mail.gd.um.com (
2003122500 ; serial
3600 ; refresh
900 ; retry
1209600 ; expire
43200 ; default_ttl
)
@ IN MX 5 mail
@ IN MX 10 smtp.gd.um.com.
@ IN NS gd.um.com.
@ IN NS smtp.gd.um.com.
gd.um.com. IN A 172.16.86.1
mail.gd.um.com. IN A 172.16.86.1
smtp.gd.um.com. IN A 172.16.86.5
[root@mail named]# more 172.16.86
@ IN SOA mail hostmaster.mail.gd.um.com. (
2003122500 ; serial
3600 ; refresh
900 ; retry
1209600 ; expire
43200 ; default_ttl
)
@ IN NS gd.um.com.
@ IN NS smtp.gd.um.com.
1 IN PTR gd.um.com.
1 IN PTR mail.gd.um.com.
5 IN PTR smtp.gd.um.com.
[root@mail named]# postconf -n
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
bounce_notice_recipient = postfix
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
default_destination_concurrency_limit = 15
header_checks = regexp:/etc/postfix/header_checks
ignore_mx_lookup_error = yes
inet_interfaces = all
mail_spool_directory = /var/spool/mail
mailbox_command = /usr/bin/procmail
mailbox_size_limit = 300000000
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 6000000
mydestination = $myhostname, localhost.$mydomain, $mydomain, smtp.$mydomain
mydomain = gd.um.com
myhostname = mail.gd.um.com
mynetworks = 172.16.86.0/24, 127.0.0.0/8, 10.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-1.1.11/README_FILES
relay_domains = $mydestination $mynetworks
relayhost = mail.um.com
sample_directory = /usr/share/doc/postfix-1.1.11/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_banner = $myhostname ESMTP $mail_name
後來增加的CentOS SMTP Server Postfix設定檔如下:
它的dns為原Linux+Postfix 的slave DNS
[root@smtp sbin]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
default_transport = mail
html_directory = no
ignore_mx_lookup_error = yes
mail_spool_directory = /var/spool/mail
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, $mydomain, mail.$mydomain
mydomain = gd.um.com
myhostname = smtp.gd.um.com
mynetworks = 172.16.86.0/24, 172.16.2.0/24, 10.0.0.0/8, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.2.10/README_FILES
relay_domains = $mydestination $mynetworks
relayhost = mail.um.com
sample_directory = /usr/share/doc/postfix-2.2.10/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_banner = $myhostname ESMTP unknow
smtpd_recipient_restrictions = permit_mynetworks
unknown_local_recipient_reject_code = 550