LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1135|回复: 5

求助:postfix smtp sasl认证的问题

[复制链接]
发表于 2004-12-21 19:58:02 | 显示全部楼层 |阅读模式
已有信息:
  1.局域网内部邮件收发均正常,也能向外网发送邮件,但是无法接收外网邮件(如来自126.com的)
  2.邮件服务器拥有合法域名,且DNS MX已经确认没有错误。
  3.端口25,110正常开放。
  4.用126.com的邮箱向本邮件服务器发送邮件,稍后可以在syslog发现如下记录:

  1. Dec 21 19:54:15 master kernel: Inbound IN=eth1 OUT=
  2. MAC=00:50:ba:d1:c6:23:00:07:ec:5d:6c:09:08:00
  3. SRC=202.108.45.73 DST=220.110.183.152 LEN=60 TOS=0x00
  4. PREC=0x00 TTL=49 ID=50333 DF PROTO=TCP SPT=41964 DPT=25
  5. WINDOW=5840 RES=0x00 SYN URGP=0
复制代码

   SRC IP 是126.com的,其中DPT=25是不是意味着126.com已经把邮件回复到本地25端口?
该log记录是否意味着126.com已经完成往本地发送邮件的全部过程?那么我无法收到外网邮件是否是我postfix配置仍存在问题所致? :ask

    请哪位大大不吝赐教,感激!
 楼主| 发表于 2004-12-21 21:25:06 | 显示全部楼层
还是靠自己解决了,上面的分析没有错,邮件确实已经送抵本地,不过不知为什么没有投递到信箱。
估计是配置文件没有完全生效(奇怪,重启了postfix和xinetd都没用),于是重新启动计算机,一登录就
收到了126.com的邮件。

现在已经实现内外网邮件发送。
准备smtp认证及spam处理。

各位有什么好的建议谢谢告诉我!
 楼主| 发表于 2004-12-21 21:40:10 | 显示全部楼层
http://www.gentoo.org.tw/got-doc/postfix.xml
  1. # nano -w /etc/make.conf
  2. USE=" " 參數當中至少要有 sasl mbox 或者 maildir
  3. mbox 跟 maildir 是郵件儲存格式 這兩種最大的不同是
  4. Maildir 是單封郵件儲存成為一個獨立的檔案
  5. Mbox 是所有郵件儲存成為一個檔案
  6. 所以我們不能在 USE 參數當中同時出現這兩個參數,就是這個道理
  7. (依照使用者習慣選擇適當的格式)
  8. # emerge postfix
  9. # nano -w /etc/postfix/main.cf
  10. 然後編輯 Postfix的設定檔案
  11. alias_database = hash:/etc/mail/aliases
  12. alias_maps = hash:/etc/mail/aliases
  13. command_directory = /usr/sbin
  14. config_directory = /etc/postfix
  15. daemon_directory = /usr/lib/postfix
  16. debug_peer_level = 2
  17. default_destination_concurrency_limit = 2
  18. inet_interfaces = all
  19. local_destination_concurrency_limit = 2
  20. mail_owner = postfix
  21. mail_spool_directory = /var/spool/mail
  22. 設定信箱存取路?
  23. mailbox_size_limit = 52428800
  24. 信箱大小筆者這邊設定50MB
  25. mailq_path = /usr/bin/mailq
  26. manpage_directory = /usr/share/man
  27. message_size_limit = 10485760
  28. 單封郵件限制筆者這邊設定10MB
  29. mydestination = $myhostname, localhost.$mydomain $mydomain
  30. 接收者的網域或者主機名稱
  31. mydomain = focuses.org
  32. 設定網域名稱
  33. myhostname = mail.focuses.org
  34. 設定 MAIL 主機名稱,這邊必須與 BIND 所設定的 MX 名稱互相對應
  35. mynetworks_style = subnet
  36. myorigin = $myhostname
  37. newaliases_path = /usr/bin/newaliases
  38. queue_directory = /var/spool/postfix
  39. readme_directory = /usr/share/doc/postfix-2.0.16-r1/readme
  40. relay_domains = focuses.org
  41. 接受 Relay 的網域主機
  42. sample_directory = /usr/share/doc/postfix-2.0.16-r1/sample
  43. sendmail_path = /usr/sbin/sendmail
  44. setgid_group = postdrop
  45. unknown_local_recipient_reject_code = 450
  46. smtpd_client_restrictions = permit_sasl_authenticated
  47. Client 端的限制規則 限制未經信任的 Client 登入就要啟動 sasl
  48. 機制
  49. smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
  50. SMTPD 收件的限制規則
  51. permit_mynetworks:在 mynetworks 這個項目設定的網域 IP 都可以被允許收信
  52. permit_authenticated:允許使用者經過 SASL 的認證方式寄信
  53. reject_unauth_destination:測試過後的主機可以進行 relay ,跟上面設定的
  54. relay_domains 有關連
  55. 告訴 SMTP 客戶,該 SMTP 服務器需要進行用戶認證
  56. smtpd_sasl_local_domain =
  57. 確認已經經過認證的網域,目前預設是上述設定之 $myhostname
  58. 不需要經過認證
  59. smtpd_sasl_security_options = noanonymous
  60. 控制本地SMTP認證所採用的機制,這裡是取消匿名認證方法。
  61. 存檔離開
  62. # /etc/init.d/postfix restart
复制代码
 楼主| 发表于 2004-12-21 22:22:07 | 显示全部楼层
在/etc/postfix/main.cf中加入以下语句
  1. smtpd_sasl_auth_enable = yes
  2. smtpd_delay_reject= yes
  3. smtpd_client_restrictions = permit_sasl_authenticated
  4. smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
  5. smtpd_sasl_local_domain = $mydomain
  6. smtpd_sasl_security_options = noanonymous
复制代码


结果telnet localhost 25无法连接(没有响应的那种)
查询/var/log/mail/errors,有如下信息
  1. Dec 21 22:25:23 master postfix/smtpd[9544]: fatal: no SASL authentication mechanisms
复制代码
 楼主| 发表于 2004-12-22 08:03:42 | 显示全部楼层
 楼主| 发表于 2004-12-22 11:02:40 | 显示全部楼层
Post by 爱左看右
在/etc/postfix/main.cf中加入以下语句
  1. smtpd_sasl_auth_enable = yes
  2. smtpd_delay_reject= yes
  3. smtpd_client_restrictions = permit_sasl_authenticated
  4. smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
  5. smtpd_sasl_local_domain = $mydomain
  6. smtpd_sasl_security_options = noanonymous
复制代码


结果telnet localhost 25无法连接(没有响应的那种)
查询/var/log/mail/errors,有如下信息
  1. Dec 21 22:25:23 master postfix/smtpd[9544]: fatal: no SASL authentication mechanisms
复制代码


没办法了,这个问题解决不了。
考虑放弃sasl
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表