免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3748 | 回复: 7
打印 上一主题 下一主题

[Mail] postfix+postfixadmin+dovecot 不能发信! [复制链接]

论坛徽章:
1
IT运维版块每日发帖之星
日期:2015-09-21 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-09-17 15:45 |只看该作者 |倒序浏览
本帖最后由 akazhuk 于 2015-09-17 15:55 编辑

maillog:
Sep 17 15:29:22 ebs-37463 postfix/smtpd[32266]: warning: database /etc/aliases.db is older than source file /etc/aliases
Sep 17 15:29:22 ebs-37463 postfix/smtpd[32266]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Sep 17 15:29:22 ebs-37463 postfix/smtpd[32266]: warning: smtpd_sasl_auth_enable is true, but SASL support is not compiled in
Sep 17 15:29:22 ebs-37463 postfix/smtpd[32266]: connect from unknown[116.5.xx.xxx]
Sep 17 15:29:22 ebs-37463 postfix/smtpd[32266]: NOQUEUE: reject: RCPT from unknown[116.5.xx.xxx]: 454 4.7.1 <511xxxxxx@qq.com>: Relay access denied; from=<tang@xxx.com> to=<511xxxxxx@qq.com> proto=ESMTP helo=<JK-PC>
Sep 17 15:29:22 ebs-37463 postfix/smtpd[32266]: disconnect from unknown[116.5.xx.xx] ehlo=1 mail=1 rcpt=0/1 quit=1 commands=3/4

main.cf:
  1. command_directory = /usr/sbin
  2. config_directory = /etc/postfix
  3. daemon_directory = /usr/libexec/postfix
  4. data_directory = /var/lib/postfix
  5. debug_peer_level = 2
  6. html_directory = no
  7. mail_owner = postfix
  8. mailq_path = /usr/bin/mailq
  9. manpage_directory = /usr/local/man
  10. newaliases_path = /usr/bin/newaliases
  11. queue_directory = /var/spool/postfix
  12. readme_directory = no
  13. sample_directory = /etc/postfix
  14. sendmail_path = /usr/sbin/sendmail
  15. setgid_group = postdrop
  16. unknown_local_recipient_reject_code = 550
  17. ################################################################################

  18. myhostname = mail.xxx.com
  19. mydomain = xxx.com
  20. myorigin = $mydomain
  21. mydestination =

  22. mynetworks = 127.0.0.0/8
  23. relay_domains = $mydestination
  24. inet_interfaces = all
  25. home_mailbox = Maildir/
  26. ############################################################################
  27. virtual_alias_maps = mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf
  28. virtual_gid_maps = static:33
  29. virtual_mailbox_base = /var/vmail             ###虚拟用户目录
  30. virtual_mailbox_domains = mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf
  31. virtual_mailbox_maps = mysql:/etc/postfix/mysql/mysql_virtual_mailbox_maps.cf
  32. virtual_minimum_uid = 33                          ### 给 apache 权限。
  33. virtual_transport = virtual
  34. virtual_uid_maps = static:33
  35. #################################################################################
  36. message_size_limit = 52428800
  37. mailbox_size_limit = 209715200
  38. virtual_mailbox_limit = 209715200
  39. virtual_create_maildirsize = yes
  40. virtual_mailbox_extended = yes
  41. virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql/mysql_virtual_mailbox_limit_maps.cf
  42. virtual_mailbox_limit_override = yes
  43. virtual_overquota_bounce = yes
  44. #################################################################################
  45. smtpd_sasl_auth_enable = yes
  46. smtpd_sasl_type = dovecot               ###定义安装方式  dovecot
  47. smtpd_sasl_path = private/auth-client    #####  路径要与 dovecot 一样,一会要讲到
  48. broken_sasl_auth_clients = yes

  49. #smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

  50. smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated,

  51. smtpd_recipient_restrictions = permit_mynetworks,
  52.                                 permit_sasl_authenticated,
  53.                                 reject_invalid_hostname,
  54.                                 reject_non_fqdn_hostname,
  55.                                 reject_unknown_sender_domain,
  56.                                 reject_non_fqdn_sender,
  57.                                 reject_non_fqdn_recipient,
  58.                                 reject_unknown_recipient_domain,
  59.                                 reject_unauth_pipelining,
  60.                                 reject_unauth_destination
复制代码
dovecot.conf:
  1. base_dir = /var/run/dovecot/
  2. protocols = pop3 pop3s
  3. listen = *
  4. disable_plaintext_auth = no
  5. log_path = /var/log/dovecot.log
  6. info_log_path = /var/log/dovecot.info
  7. log_timestamp = "%Y-%m-%d %H:%M:%S "
  8. ssl_disable = yes
  9. mail_location = maildir:/var/vmail/%u
  10. mail_privileged_group = mail
  11. first_valid_uid = 33
  12. protocol imap {
  13. }
  14. protocol pop3 {
  15.       pop3_uidl_format = %08Xu%08Xv
  16. }
  17. protocol managesieve {
  18.      sieve=~/.dovecot.sieve
  19.      sieve_storage=~/sieve
  20. }

  21. auth default {
  22.     mechanisms = plain login
  23.    passdb pam {
  24.   }
  25.   passdb sql {
  26.     args = /etc/dovecot/dovecot-sql.conf
  27.   }
  28.   userdb passwd {
  29.   }

  30.   userdb sql {
  31.     args = /etc/dovecot/dovecot-sql.conf
  32.   }

  33.   user = root
  34.   socket listen {
  35.     client {
  36.       path = /var/spool/postfix/private/auth-client               ###这里对应 postfix  smtpd_sasl_path  
  37.       mode = 0660
  38.         user = postfix
  39.         group = postfix
  40.     }
  41.   }
  42. }


  43. dict {
  44. }

  45. plugin {

  46. }
复制代码
测试postfix:
  1. root@ebs-37463:~# telnet mail.xxx.com 25
  2. Trying 211.xxx.xxx.xxx...
  3. Connected to mail.xxx.com.
  4. Escape character is '^]'.
  5. 220 mail.xxx.com ESMTP Postfix
  6. ehlo mail.xxx.com
  7. 250-mail.xxx.com
  8. 250-PIPELINING
  9. 250-SIZE 52428800
  10. 250-VRFY
  11. 250-ETRN
  12. 250-ENHANCEDSTATUSCODES
  13. 250-8BITMIME
  14. 250 DSN
复制代码
测试dovecot:
  1. root@ebs-37463:~# telnet mail.xxx.com 110
  2. Trying 211.xxx.xxx.xxx...
  3. Connected to mail.xxx.com.
  4. Escape character is '^]'.
  5. +OK Dovecot (Ubuntu) ready.
复制代码
不知道是不是这里的问题:connect from unknown[116.5.xx.xxx]
Sep 17 15:29:22 ebs-37463 postfix/smtpd[32266]: NOQUEUE: reject: RCPT from unknown[116.5.xx.xxx]: 454 4.7.1 <511xxxxxx@qq.com>: Relay access denied; from=<tang@xxx.com> to=<511xxxxxx@qq.com> proto=ESMTP helo=<JK-PC>

这里的116.5.xx.xxx并不是服务器的IP,好像是公司的外网IP,服务器IP是这个:211.xxx.xxx.xxx,我的mail.xxx.com这个域名明明是指向了服务器的IP,不知道为什么发信的时候会变了116.5.xx.xxx这个IP。。
如果将mynetworks = 127.0.0.0/8 改成 mynetworks = 127.0.0.0/8, 116.5.xx.x/24  邮件客户端可以发信,但依然不能收信,估计是域名指向的是211.xxx.xxx.xxx这个IP,而不是116.5.xx.x
大神们求助!!!

论坛徽章:
4
IT运维版块每日发帖之星
日期:2015-09-01 06:20:00IT运维版块每日发帖之星
日期:2015-10-09 06:20:00操作系统版块每日发帖之星
日期:2015-10-20 06:20:00IT运维版块每日发帖之星
日期:2015-11-03 06:20:00
2 [报告]
发表于 2015-09-17 19:12 |只看该作者
加QQ1474804934, 我帮你

论坛徽章:
154
2022北京冬奥会纪念版徽章
日期:2015-08-07 17:10:5720周年集字徽章-年
日期:2022-10-26 16:44:2015-16赛季CBA联赛之深圳
日期:2022-11-02 14:02:4515-16赛季CBA联赛之八一
日期:2022-11-28 12:07:4820周年集字徽章-20	
日期:2023-07-19 08:49:4515-16赛季CBA联赛之八一
日期:2023-11-04 19:23:5115-16赛季CBA联赛之广夏
日期:2023-12-13 18:09:34
3 [报告]
发表于 2015-09-17 20:44 来自手机 |只看该作者
很正常,没玩过

论坛徽章:
1
IT运维版块每日发帖之星
日期:2015-09-21 06:20:00
4 [报告]
发表于 2015-09-18 08:15 |只看该作者
来人!求助啊!!

论坛徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT运维版块每日发帖之星
日期:2015-11-26 06:20:00操作系统版块每月发帖之星
日期:2015-12-02 14:57:54IT运维版块每月发帖之星
日期:2016-01-07 23:01:56IT运维版块每周发帖之星
日期:2016-01-07 23:04:2615-16赛季CBA联赛之青岛
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16赛季CBA联赛之北控
日期:2016-03-23 14:20:06IT运维版块每日发帖之星
日期:2016-04-01 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-28 13:51:54IT运维版块每日发帖之星
日期:2016-07-01 06:20:00IT运维版块每日发帖之星
日期:2015-11-23 06:20:00
5 [报告]
发表于 2015-09-18 13:45 |只看该作者
本帖最后由 woxizishen 于 2015-09-18 13:45 编辑

太简单了转发问题,不过你发邮件竟然把外网ip权限单独开通,我也是佩服你啊。在外部发有限都是通过SASL来验证的。DOVECOT一般也会结合SASL来验证。你前面只开通SMTP转发权限,并没有开通登陆POP3服务器收取邮件权限。SMTP和POP3是2个服务器,不要搞混淆。

论坛徽章:
1
IT运维版块每日发帖之星
日期:2015-09-21 06:20:00
6 [报告]
发表于 2015-09-18 13:54 |只看该作者
回复 5# woxizishen


    不好意思,我是新手。我也是按照一些配置文章来弄的。。

论坛徽章:
1
IT运维版块每日发帖之星
日期:2015-09-21 06:20:00
7 [报告]
发表于 2015-09-18 14:01 |只看该作者
回复 5# woxizishen


    我本来也是想经过服务器ip来发信和收信,前段时间配置过一个postfix+pop3+sasl 的邮件服务器可以!但用户都是要从ubuntu里添加用户,所以想弄个类似mysql那样的!就找到了postfixadmin!但配置下来发现挺多问题,也看了很久的maillog,解决到这里就无解了

论坛徽章:
1
IT运维版块每日发帖之星
日期:2015-09-29 06:20:00
8 [报告]
发表于 2015-09-26 20:28 |只看该作者
一个一个的解决,先解决sasl的支持没有添加的问题。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP