亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: 如何禁止postfix的smtp而只是用esmtp [打印本頁]

作者: minmig    時(shí)間: 2009-09-06 00:44
標(biāo)題: 如何禁止postfix的smtp而只是用esmtp
正在弄一個(gè)postfix的mailserver 看了marion 的文檔,編譯安裝。裝完測(cè)試發(fā)現(xiàn)一些問題,foxmail不管是否勾選通過smtp認(rèn)證都可以發(fā)出郵件,看日志然后telnet感覺esmtp是有的,但是smtp沒有禁止。不知如何禁止。下面是日志,希望碰到過同類問題的朋友們幫忙

不勾選認(rèn)證的日志
Sep  5 23:58:39 ****** postfix/smtpd[16767]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Sep  5 23:58:39 ****** postfix/smtpd[16767]: warning: 58.33.157.147: address not listed for hostname 147.157.33.58.broad.xw.sh.dynamic.163data.com.cn
Sep  5 23:58:39 ****** postfix/smtpd[16767]: connect from unknown[58.33.157.147]
Sep  5 23:58:39 ****** postfix/trivial-rewrite[16770]: warning: do not list domain test.com in BOTH mydestination and virtual_mailbox_domains
Sep  5 23:58:39 ****** postfix/smtpd[16767]: NOQUEUE: reject: RCPT from unknown[58.33.157.147]: 504 5.5.2 <PC-200908251556>: Helo command rejected: need fully-qualified hostname; from=<test@test.com> to=<test@gmail.com> proto=SMTP helo=<PC-200908251556>
Sep  5 23:58:39 ****** postfix/smtpd[16767]: lost connection after RCPT from unknown[58.33.157.147]
Sep  5 23:58:39 ****** postfix/smtpd[16767]: disconnect from unknown[58.33.157.147]
Sep  5 23:58:39 ****** postfix/smtpd[16767]: warning: 58.33.157.147: address not listed for hostname 147.157.33.58.broad.xw.sh.dynamic.163data.com.cn
Sep  5 23:58:39 ****** postfix/smtpd[16767]: connect from unknown[58.33.157.147]
Sep  5 23:58:39 ****** postfix/smtpd[16767]: 9FA60F270032: client=unknown[58.33.157.147], sasl_method=LOGIN, [email=sasl_username=test@test.com]sasl_username=test@test.com[/email]
Sep  5 23:58:39 ****** postfix/cleanup[16774]: 9FA60F270032: message-id=<>
Sep  5 23:58:39 ****** postfix/qmgr[16776]: 9FA60F270032: from=<test@test.com>, size=643, nrcpt=1 (queue active)
Sep  5 23:58:39 ****** postfix/smtpd[16767]: disconnect from unknown[58.33.157.147]
Sep  5 23:58:44 ****** postfix/smtp[16777]: 9FA60F270032: to=<test@gmail.com>, relay=gmail-smtp-in.l.google.com[209.85.222.46]:25, delay=5, delays=0.1/0/2.5/2.5, dsn=2.0.0, status=sent (250 2.0.0 OK 1252166324 12si7091801pzk.74)
Sep  5 23:58:44 ****** postfix/qmgr[16776]: 9FA60F270032: removed



勾選后的日志

Sep  6 00:16:16 ****** postfix/smtpd[16822]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Sep  6 00:16:16 ****** postfix/smtpd[16822]: warning: 58.33.157.147: address not listed for hostname 147.157.33.58.broad.xw.sh.dynamic.163data.com.cn
Sep  6 00:16:16 ****** postfix/smtpd[16822]: connect from unknown[58.33.157.147]
Sep  6 00:16:17 ****** postfix/trivial-rewrite[16826]: warning: do not list domain test.com in BOTH mydestination and virtual_mailbox_domains
Sep  6 00:16:17 ****** postfix/smtpd[16822]: 070C7F270032: client=unknown[58.33.157.147], sasl_method=LOGIN, [email=sasl_username=test@test.com]sasl_username=test@test.com[/email]
Sep  6 00:16:17 ****** postfix/cleanup[16829]: 070C7F270032: message-id=<>
Sep  6 00:16:17 ****** postfix/qmgr[16776]: 070C7F270032: from=<test@test.com>, size=643, nrcpt=1 (queue active)
Sep  6 00:16:17 ****** postfix/smtpd[16822]: disconnect from unknown[58.33.157.147]
Sep  6 00:16:21 ****** postfix/smtp[16831]: 070C7F270032: to=<test@gmail.com>, relay=gmail-smtp-in.l.google.com[209.85.222.46]:25, delay=4.4, delays=0.1/0/1.7/2.6, dsn=2.0.0, status=sent (250 2.0.0 OK 1252167381 12si7096839pzk.6)
Sep  6 00:16:21 ****** postfix/qmgr[16776]: 070C7F270032: removed

在上面的日志里也沒看到用esmtp協(xié)議的樣子,只有更sasl_method的login認(rèn)證
自己也剛接觸postfix,覺得如果客戶端勾選esmtp認(rèn)證的話在日志里應(yīng)該會(huì)出現(xiàn)相應(yīng)的字符才對(duì)。就像不是用出現(xiàn)smtp一樣。

自己配的main.cf
broken_sasl_auth_clients = yes
command_directory = /usr/local/postfix/sbin
config_directory = /etc/postfix
daemon_directory = /usr/local/postfix/libexec
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = /var/www/postfix_html
inet_interfaces = all
mail_owner = vmail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/postfix/man
message_size_limit = 14336000
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = test.com
myhostname = mail.test.com
mynetworks = 127.0.0.1
newaliases_path = /usr/bin/newaliases
queue_directory = /home/spool/postfix
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_banner = Welcome to our $myhostname ESMTP,Warning: Version not Available!
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
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:1000
virtual_mailbox_base = /home/domains
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 20971520
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_transport = virtual
virtual_uid_maps = static:1000


不知道問題出在哪里。
作者: scyzxp    時(shí)間: 2009-09-06 22:00
原帖由 minmig 于 2009-9-6 00:44 發(fā)表
正在弄一個(gè)postfix的mailserver 看了marion 的文檔,編譯安裝。裝完測(cè)試發(fā)現(xiàn)一些問題,foxmail不管是否勾選通過smtp認(rèn)證都可以發(fā)出郵件,看日志然后telnet感覺esmtp是有的,但是smtp沒有禁止。不知如何禁止。下 ...


別用foxmail測(cè)試,太智能了。
作者: minmig    時(shí)間: 2009-09-07 10:59
多謝樓上回復(fù)



現(xiàn)在換用outlook explore測(cè)試

果然需要通過選中需要身份驗(yàn)證才能發(fā)件

看了一下日志和error信息。



不選身份驗(yàn)證如下:

outlook error信息是
  1. Helo command rejected: need fully-qualified hostname
復(fù)制代碼
postfix日志是:
  1. Sep  7 10:09:03 ****** postfix/smtpd[4972]: connect from unknown[*.*.*.*]
  2. Sep  7 10:09:03 ****** postfix/trivial-rewrite[4975]: warning: do not list domain test.com in BOTH mydestination and virtual_mailbox_domains
  3. Sep  7 10:09:03 ****** postfix/smtpd[4972]: NOQUEUE: reject: RCPT from unknown[*.*.*.*]: 504 5.5.2 <PC200908251556>: Helo command rejected: need fully-qualified hostname; from=<test@test.com> to=<minmig@gmail.com> proto=SMTP helo=<PC200908251556>
  4. Sep  7 10:09:03 ****** postfix/smtpd[4972]: NOQUEUE: reject: RCPT from unknown[*.*.*.*]: 504 5.5.2 <PC200908251556>: Helo command rejected: need fully-qualified hostname; from=<test@test.com> to=<minmig@gmail.com> proto=SMTP helo=<PC200908251556>
  5. Sep  7 10:09:03 ****** postfix/smtpd[4972]: disconnect from unknown[*.*.*.*]
復(fù)制代碼
根據(jù)以上日志感覺是 沒有點(diǎn)認(rèn)證時(shí),沒有獲取fqdn,從而在無法再mysql數(shù)據(jù)庫找到相應(yīng)記錄所以檢測(cè)不過。而不是因?yàn)镋SMTP認(rèn)證不過造成的。

自己感覺,希望樓上指正。



下面是勾選了smtp認(rèn)證的日志
  1. Sep  7 10:27:34 ****** postfix/smtpd[5024]: connect from unknown[*.*.*.*]
  2. Sep  7 10:27:34 ****** authdaemond: received auth request, service=smtp, authtype=login
  3. Sep  7 10:27:34 ****** authdaemond: authmysql: trying this module
  4. Sep  7 10:27:34 ****** authdaemond: authmysqllib: connected. Versions: header 50045, client 50045, server 50045
  5. Sep  7 10:27:34 ****** authdaemond: SQL query: SELECT username, password, "", '1000', '1000', concat('/home/domains/',maildir), concat('/home/domains/',maildir), "", name, "" FROM mailbox WHERE username = 'test@test.com'
  6. Sep  7 10:27:34 ****** authdaemond: password matches successfully
  7. Sep  7 10:27:34 ****** authdaemond: authmysql: sysusername=<null>, sysuserid=1000, sysgroupid=1000, homedir=/home/domains/test.com/test/Maildir/, address=test@test.com, fullname=test, maildir=/home/domains/test.com/test/Maildir/, quota=<null>, options=<null>
  8. Sep  7 10:27:34 ****** authdaemond: authmysql: clearpasswd=<null>, passwd=$1$Xb14kEH9$lpc6pMVcskOs0ZEGri/We0
  9. Sep  7 10:27:34 ****** authdaemond: Authenticated: sysusername=<null>, sysuserid=1000, sysgroupid=1000, homedir=/home/domains/test.com/test/Maildir/, address=test@test.com, fullname=test, maildir=/home/domains/test.com/test/Maildir/, quota=<null>, options=<null>
  10. Sep  7 10:27:34 ****** authdaemond: Authenticated: clearpasswd=test, passwd=********
  11. Sep  7 10:27:34 ****** postfix/trivial-rewrite[5028]: warning: do not list domain test.com in BOTH mydestination and virtual_mailbox_domains
  12. Sep  7 10:27:34 ****** postfix/smtpd[5024]: 1B8CCF270034: client=unknown[*.*.*.*], sasl_method=LOGIN, sasl_username=test@test.com
  13. Sep  7 10:27:34 ****** postfix/cleanup[5031]: 1B8CCF270034: message-id=<5D4AEE77B429461FAE6BBE79F869C90E@PC200908251556>
  14. Sep  7 10:27:34 ****** postfix/qmgr[6055]: 1B8CCF270034: from=<test@test.com>, size=1401, nrcpt=1 (queue active)
  15. Sep  7 10:27:34 ****** postfix/smtpd[5024]: 2E4CCF270035: client=unknown[*.*.*.*], sasl_method=LOGIN, sasl_username=test@test.com
  16. Sep  7 10:27:34 ****** postfix/cleanup[5031]: 2E4CCF270035: message-id=<0B8F6BBFDBA048B2870B6BF359D2E35B@PC200908251556>
  17. Sep  7 10:27:34 ****** postfix/qmgr[6055]: 2E4CCF270035: from=<test@test.com>, size=2179, nrcpt=1 (queue active)
  18. Sep  7 10:27:34 ****** postfix/smtpd[5024]: 3970FF270036: client=unknown[*.*.*.*], sasl_method=LOGIN, sasl_username=test@test.com
  19. Sep  7 10:27:34 ****** postfix/cleanup[5031]: 3970FF270036: message-id=<562C77B577B04EA484DE796B76BDFA52@PC200908251556>
  20. Sep  7 10:27:34 ****** postfix/qmgr[6055]: 3970FF270036: from=<test@test.com>, size=2179, nrcpt=1 (queue active)
  21. Sep  7 10:27:34 ****** postfix/smtpd[5024]: disconnect from unknown[*.*.*.*]
  22. Sep  7 10:27:36 ****** postfix/smtp[5035]: 3970FF270036: to=<minmig@gmail.com>, relay=gmail-smtp-in.l.google.com[209.85.222.15]:25, delay=2.8, delays=0.04/0/1.6/1.1, dsn=2.0.0, status=sent (250 2.0.0 OK 1252290456 15si14450451pzk.92)
  23. Sep  7 10:27:36 ****** postfix/qmgr[6055]: 3970FF270036: removed
  24. Sep  7 10:27:37 ****** postfix/smtp[5034]: 2E4CCF270035: to=<minmig@gmail.com>, relay=gmail-smtp-in.l.google.com[209.85.222.15]:25, delay=3.7, delays=0.03/0/2.6/1, dsn=2.0.0, status=sent (250 2.0.0 OK 1252290457 15si14651865pzk.58)
  25. Sep  7 10:27:37 ****** postfix/qmgr[6055]: 2E4CCF270035: removed
  26. Sep  7 10:27:37 ****** postfix/smtp[5033]: 1B8CCF270034: to=<minmig@gmail.com>, relay=gmail-smtp-in.l.google.com[209.85.222.15]:25, delay=3.8, delays=0.08/0/1.9/1.8, dsn=2.0.0, status=sent (250 2.0.0 OK 1252290457 15si14651774pzk.58)
  27. Sep  7 10:27:37 ****** postfix/qmgr[6055]: 1B8CCF270034: removed
復(fù)制代碼
弄了那么就對(duì)postfix的ESMTP認(rèn)真模塊的流程還是有點(diǎn)模糊



感覺是  outlook -->  smtpd --> sasl2 --> authlib --> mysql 。不知道對(duì)不對(duì),Esmtp在哪里來獲得支持,是smtpd還是sasl2還是authlib。感覺是在sasl上面做的,但是又不知道在哪里設(shè)置。

還有一點(diǎn)是當(dāng)初在編譯postfix的時(shí)候就直接支持mysql ,為什么還需要用通過authlib來連接mysql呢?

希望大;蚺龅竭^相關(guān)問題的朋友幫忙。

[ 本帖最后由 minmig 于 2009-9-7 11:03 編輯 ]
作者: ruochen    時(shí)間: 2009-09-07 12:17
原帖由 minmig 于 2009-9-7 10:59 發(fā)表
多謝樓上回復(fù)



現(xiàn)在換用outlook explore測(cè)試

果然需要通過選中需要身份驗(yàn)證才能發(fā)件

看了一下日志和error信息。



不選身份驗(yàn)證如下:

outlook error信息是Helo command rejected: need fu ...




如果你的mynetworks參數(shù)包括你的網(wǎng)段,勾不勾選需要認(rèn)證都可以發(fā)信收信的

還有一點(diǎn)是當(dāng)初在編譯postfix的時(shí)候就直接支持mysql ,為什么還需要用通過authlib來連接mysql呢?
-------這個(gè)是起橋梁作用吧,postfix編譯支持mysql只是支持這個(gè)backend而已
作者: minmig    時(shí)間: 2009-09-07 12:53
原帖由 ruochen 于 2009-9-7 12:17 發(fā)表




如果你的mynetworks參數(shù)包括你的網(wǎng)段,勾不勾選需要認(rèn)證都可以發(fā)信收信的

還有一點(diǎn)是當(dāng)初在編譯postfix的時(shí)候就直接支持mysql ,為什么還需要用通過authlib來連接mysql呢?
-------這個(gè)是起橋梁作用 ...



服務(wù)器是放在機(jī)房要加強(qiáng)安全,所以準(zhǔn)備加ESMTP認(rèn)證。要不要那個(gè)機(jī)器中毒了亂發(fā)郵件。雖然如果帳號(hào)泄密也會(huì)亂發(fā)郵件,如果用ESMTP在事后查起來能相對(duì)好一點(diǎn)。還有看到網(wǎng)上一些人利用mynetworks 的漏洞吧自己ip偽造成127.0.0.X 或 192.168.0.X吧服務(wù)器當(dāng)成open relay。不知道是真是假。
第二個(gè)問題多謝版主。
作者: scyzxp    時(shí)間: 2009-09-07 13:53
還有一點(diǎn)是當(dāng)初在編譯postfix的時(shí)候就直接支持mysql ,為什么還需要用通過authlib來連接mysql呢?


這個(gè)理解不太對(duì)。你的postfix是通過sasl認(rèn)證的吧。sasl是調(diào)用的authlib來做認(rèn)證的吧。那就是authlib讀Mysql來認(rèn)證的
作者: minmig    時(shí)間: 2009-09-07 14:20
原帖由 scyzxp 于 2009-9-7 13:53 發(fā)表


這個(gè)理解不太對(duì)。你的postfix是通過sasl認(rèn)證的吧。sasl是調(diào)用的authlib來做認(rèn)證的吧。那就是authlib讀Mysql來認(rèn)證的


那就是說在編譯postfix時(shí)不用加入mysql的目錄在日后也能通過authlib來用mysql認(rèn)證?
還有那個(gè)sals如何強(qiáng)制esmtp的問題...
作者: scyzxp    時(shí)間: 2009-09-07 14:41
原帖由 minmig 于 2009-9-7 14:20 發(fā)表


那就是說在編譯postfix時(shí)不用加入mysql的目錄在日后也能通過authlib來用mysql認(rèn)證?
還有那個(gè)sals如何強(qiáng)制esmtp的問題...



postfix+mysql與驗(yàn)證沒有任何關(guān)系。
作者: minmig    時(shí)間: 2009-09-07 14:50
原帖由 scyzxp 于 2009-9-7 14:41 發(fā)表



postfix+mysql與驗(yàn)證沒有任何關(guān)系。


這個(gè)是另外一個(gè)問題,我有點(diǎn)疑問隨口問的。
認(rèn)證的問題還是要看sasl哪里配,讓他體現(xiàn)出來。




歡迎光臨 Chinaunix (http://www.72891.cn/) Powered by Discuz! X3.2