歡迎您光臨本站 註冊首頁

postfix2.4.6 open relay的問題

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

postfix2.4.6 open relay的問題

postfix的主配置文件

# cat /etc/postfix/main.cf
#=====================BASE=========================
myhostname = mail.test.hk
mydomain = test.hk
myorigin = $mydomain
mydestination = $myhostname localhost localhost.$mydomain
mynetworks = 127.0.0.0/8
inet_interfaces = all
#relay_domains = $mydestination

#=====================Vritual Mailbox settings=========================
virtual_mailbox_base = /home/domains
virtual_mailbox_maps = ldap:/etc/postfix/ldap/ldap_virtual_mailbox_maps.cf
virtual_mailbox_domains = ldap:/etc/postfix/ldap/ldap_virtual_domains_maps.cf
virtual_alias_domains =
virtual_alias_maps = ldap:/etc/postfix/ldap/ldap_virtual_alias_maps.cf
virtual_uid_maps = static:501
virtual_gid_maps = static:502
virtual_transport = virtual
maildrop_destination_recipient_limit = 1
maildrop_destination_concurrency_limit = 1

#====================QUOTA========================
message_size_limit = 5242880
mailbox_size_limit = 209715200
virtual_mailbox_limit = 209715200
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = ldap:/etc/postfix/ldap/ldap_virtual_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

#====================SASL========================
smtpd_sasl_type = dovecot
smtpd_sasl_path = /var/run/dovecot/auth-client
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks,
                                permit_sasl_authenticated,
                                reject_invalid_hostname,
                                reject_non_fqdn_hostname,
                                reject_unknown_sender_domain,
                                reject_non_fqdn_sender,
                                reject_non_fqdn_recipient,
                                reject_unknown_recipient_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"

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



我在10.10.119.250的主機(WinXP)上測試

220 mail.test.hk ESMTP "Version not Available"
helo mail.test.hk
250 mail.test.hk
mail from:tes1@test.hk
250 2.1.0 Ok
rcpt to:test2@test.hk
250 2.1.5 Ok
data
354 Please start mail input.
ttt
.
250 Mail queued for delivery.



tes1@test.hk在本域內是不存在的
test2@test.hk是本地用戶

這樣的測試結果是不是說明我的postfix打開了open relay

如果是
怎麼禁止掉?
《解決方案》

這個怎麼一直沒有人來說說呢
《解決方案》

用一台XP的客戶端telnet上去的信息
《解決方案》

我的似乎也有此問題,這個應該不能算作是open relay

# telnet mail.lingping.cn 25
Trying 121.10.2.153...
Connected to mail.lingping.cn .
Escape character is '^]'.
220 Welcome to our mail.lingping.cn ESMTP,Warning:Version not Available!
ehlo mail.lingping.cn
250-mail.lingping.local
250-PIPELINING
250-SIZE 14336000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:test@lingping.cn
250 2.1.0 Ok
rcpt to:lpzeng@lingping.cn
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
test
.
250 2.0.0 Ok: queued as 8A72C4F8055
quit
221 2.0.0 Bye
Connection closed by foreign host.
《解決方案》

open relay怎麼來測試和判斷???
《解決方案》

當一個客戶端連接postfix來發送郵件,如果該客戶端既沒有提供帳號密碼,又不是mynetwork裡面的ip,而且rcpt to地址不是「postfix上的郵件地址」(local 或者 vitual  或者 relay domain),postfix把這個郵件接收了

那麼postfix就是open relay
《解決方案》

回復 #6 sosogh 的帖子

斑竹正解。應該說在控制範圍內的open relay,本身沒有任何問題。我這邊就是exchange2000 + Postfix的。Postfix就是一個單純的MTA。
《解決方案》

看看這個命令的輸出:

# postconf smtpd_reject_unlisted_recipient
《解決方案》

# postconf smtpd_reject_unlisted_recipient
smtpd_reject_unlisted_recipient = yes
《解決方案》

原帖由 sosogh 於 2008-7-28 20:45 發表 http://bbs.chinaunix.net/images/common/back.gif
當一個客戶端連接postfix來發送郵件,如果該客戶端既沒有提供帳號密碼,又不是mynetwork裡面的ip,而且rcpt to地址不是「postfix上的郵件地址」(local 或者 vitual  或者 relay domain),postfix把這個郵件接 ...



謝謝
剛從mynetwork裡面去掉了XP客戶端的ip段,telnet是下面的這個樣子
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:rrrrrwerer@bad.com
250 2.1.0 Ok
rcpt to:rewrwrewr@bad.com
504 5.5.2 <mail>: Helo command rejected: need fully-qualified hostname

[火星人 ] postfix2.4.6 open relay的問題已經有458次圍觀

http://coctec.com/docs/service/show-post-28601.html