- 论坛徽章:
- 0
|
小弟本来为Linux新手,得益于anthonyfeng大哥的——
《原创:在RHEL 4 上配置全功能的Postfix 服务器》一文,
http://bbs.chinaunix.net/viewthread.php?tid=672644
同时参考了Fandy的——
《RedHat Postfix + MySQL + Cyrus-sasl + Dovecot 用RPM方式实现》
http://www.gd-linux.com/bbs/show ... 269728ac&t=3413
根据文中设置,我的邮件系统目前已经基本完成了内网收发、SMTP验证、向外网发送邮件、防病毒、MailScanner 、Webmail等主要功能,实在感激anthonyfeng与Fandy两位共享如此宝贵的经验!目前还有最后一个问题实在无法解决,外网(163等邮箱)发来的邮件无法收取。
先说一下我的网络环境:
RHEL4 (邮件服务器)<---> ADSL Modem<--->花生壳动态DNS映射
1. 服务器上的防火墙已经打开25端口,内网Telnet 25、110端口都没有问题;
[root@www ~]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 www.mailtest.com ESMTP "Version not Available"
quit
221 Bye
Connection closed by foreign host.
[root@www ~]# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK dovecot ready.
quit
+OK Logging out
Connection closed by foreign host.
[root@www ~]#
2. ADSL Modem上面也做好了端口映射,因为从外网连接的时候看到了TCP连接;同时从外网TELNET到110端口都是正常的;
问题在于从内网TELnet的时候通过 netstat -t可以看到进入了Established的状态;
而从外网Telnet的时候虽然建立了TCP连接,但是 netstat -t看到的一直处于 syn_recv 的状态,曾经考虑过是否MTU不匹配的原因,结果排除;于是回到Postfix验证的问题上面来。
我希望能够提供更多的日志信息,但是maillog里面没有任何的记录:反而是在messages日志里面反复有这么一句:
Apr 13 11:16:22 www postfix/smtpd[16263]: sql_select option missing
Apr 13 11:16:22 www postfix/smtpd[16263]: auxpropfunc error no mechanism available
不知道是否这个原因造成的?
然而觉得奇怪的就是如果我在内网使用公共域名(telnet www.mailtest.com 25) 的话,同样是成功的:
Apr 13 11:16:22 www postfix/smtpd[16263]: connect from unknown[220.169.4.17]
Apr 13 11:17:13 www postfix/smtpd[16263]: disconnect from unknown[220.169.4.17]
但直接通过另外一条线路拨号上网就出现无法打开25端口的
3. 花生壳动态MX解析应该也是成功的,从其他邮箱发出来的邮件显示没有马上被退回,至少过了12小时(应该是超时了);另外通过使用NSlookup命令也已经能够做出顺利的解析!
目前处于的情况就在于从外网无法Telnet到25端口上面!!应该是这个原因导致外网发来的邮件无法投递到本地邮箱上面,实在郁闷!以下是我的postfix配置,基本与上述两文的一致,烦请各位高手指点一二,不胜感激。
#=====================Base=====================#
myhostname = www.mailtest.com
mydomain = mailtest.com
myorigin = $mydomain
mydestination = $myhostname localhost localhost.$mydomain
mynetworks = 192.168.2.0/24 127.0.0.0/8
mynetworks_style = subnet
inet_interfaces = all
header_checks = regexp:/etc/postfix/header_checks
#=====================Base=====================#
#=====================Vritual Mailbox settings=========================#
virtual_mailbox_base = /www/mailbox
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_minimum_uid = 89
virtual_uid_maps = static:89
virtual_gid_maps = static:89
virtual_transport = virtual
maildrop_destination_recipient_limit = 1
maildrop_destination_concurrency_limit = 1
#=====================Vritual Mailbox settings=========================#
#====================QUOTA========================#
message_size_limit = 14336000
virtual_mailbox_limit = 20971520
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.
virtual_overquota_bounce = yes
#====================QUOTA========================#
#====================SASL========================#
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_invalid_hostname,reject_non_f
qdn_hostname,reject_unknown_sender_domain,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recip
ient_domain,reject_unauth_pipelining,reject_unauth_destination,permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_sasl_application_name = smtpd
smtpd_banner=$myhostname ESMTP "Version not Available"
#====================SASL========================#
#====================OTHER========================#
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
html_directory = no
setgid_group = postdrop
command_directory = /usr/sbin
manpage_directory = /usr/local/man
daemon_directory = /usr/libexec/postfix
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
queue_directory = /var/spool/postfix
mail_owner = postfix
#====================OTHER========================#
#====================Misc========================#
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
#====================Misc========================# |
|