免费注册 查看新帖 |

Chinaunix

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

[Mail] postfix+dovecot 系統無法收信 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-08-07 16:07 |只看该作者 |倒序浏览
各位好
我的郵件主機收不了信
跟版內同學一樣也是權限問題,但是我就是搞不懂,系統到哪要我的UID跟GID,明明都指定vmail(UID 2000:GID 2000)了
是哪邊有了缺漏嗎?
  1. root@iredmail01:/etc# dovecot -n
  2. # 2.2.9: /etc/dovecot/dovecot.conf
  3. # OS: Linux 3.13.0-24-generic x86_64 Ubuntu 14.04 LTS
  4. auth_master_user_separator = *
  5. auth_mechanisms = PLAIN LOGIN
  6. dict {
  7.   acl = PH_DOVECOT_SHARE_FOLDER_SQLTYPE:PH_DOVECOT_SHARE_FOLDER_CONF
  8.   quotadict = pgsql:/etc/dovecot/dovecot-used-quota.conf
  9. }
  10. first_valid_uid = 2000
  11. last_valid_uid = 2000
  12. listen = *
  13. log_path = /var/log/dovecot.log
  14. mail_gid = 2000
  15. mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/:UTF-8
  16. mail_plugins = quota
  17. mail_uid = 2000
  18. managesieve_notify_capability = mailto
  19. managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
  20. namespace {
  21.   inbox = yes
  22.   location =
  23.   mailbox Drafts {
  24.     auto = subscribe
  25.     special_use = \Drafts
  26.   }
  27.   mailbox Junk {
  28.     auto = subscribe
  29.     special_use = \Junk
  30.   }
  31.   mailbox Sent {
  32.     auto = subscribe
  33.     special_use = \Sent
  34.   }
  35.   mailbox "Sent Messages" {
  36.     auto = no
  37.     special_use = \Sent
  38.   }
  39.   mailbox Spam {
  40.     auto = no
  41.     special_use = \Junk
  42.   }
  43.   mailbox Trash {
  44.     auto = subscribe
  45.     special_use = \Trash
  46.   }
  47.   prefix =
  48.   separator = /
  49.   type = private
  50. }
  51. namespace {
  52.   list = children
  53.   location = maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
  54.   prefix = Shared/%%u/
  55.   separator = /
  56.   subscriptions = yes
  57.   type = shared
  58. }
  59. passdb {
  60.   args = /etc/dovecot/dovecot-pgsql.conf
  61.   driver = sql
  62. }
  63. passdb {
  64.   args = /etc/dovecot/dovecot-master-users-password
  65.   driver = passwd-file
  66.   master = yes
  67. }
  68. plugin {
  69.   acl = vfile
  70.   acl_shared_dict = proxy::acl
  71.   auth_socket_path = /var/run/dovecot/auth-master
  72.   quota = dict:user::proxy::quotadict
  73.   quota_rule = *:storage=1G
  74.   quota_warning = storage=85%% quota-warning 85 %u
  75.   quota_warning2 = storage=90%% quota-warning 90 %u
  76.   quota_warning3 = storage=95%% quota-warning 95 %u
  77.   sieve = /%Lh/sieve/dovecot.sieve
  78.   sieve_default = /var/vmail/sieve/dovecot.sieve
  79.   sieve_dir = /%Lh/sieve
  80.   sieve_global_dir = /var/vmail/sieve
  81. }
  82. protocols = imap sieve lmtp
  83. service auth {
  84.   unix_listener /var/spool/postfix/private/dovecot-auth {
  85.     group = postfix
  86.     mode = 0666
  87.     user = postfix
  88.   }
  89.   unix_listener auth-master {
  90.     group = vmail
  91.     mode = 0666
  92.     user = vmail
  93.   }
  94.   unix_listener auth-userdb {
  95.     group = vmail
  96.     mode = 0660
  97.     user = vmail
  98.   }
  99. }
  100. service dict {
  101.   unix_listener dict {
  102.     group = vmail
  103.     mode = 0660
  104.     user = vmail
  105.   }
  106. }
  107. service imap-login {
  108.   process_limit = 500
  109.   service_count = 1
  110. }
  111. service lmtp {
  112.   executable = lmtp -L
  113.   inet_listener lmtp {
  114.     port = 24
  115.   }
  116.   process_min_avail = 5
  117.   unix_listener /var/spool/postfix/private/dovecot-lmtp {
  118.     group = postfix
  119.     mode = 0600
  120.     user = postfix
  121.   }
  122.   user = vmail
  123. }
  124. service pop3-login {
  125.   service_count = 1
  126. }
  127. service quota-warning {
  128.   executable = script /usr/local/bin/dovecot-quota-warning.sh
  129.   unix_listener quota-warning {
  130.     group = vmail
  131.     mode = 0660
  132.     user = vmail
  133.   }
  134. }
  135. ssl = no
  136. ssl_cert = </etc/ssl/certs/iRedMail_CA.pem
  137. ssl_key = </etc/ssl/private/iRedMail.key
  138. userdb {
  139.   args = /etc/dovecot/dovecot-pgsql.conf
  140.   driver = sql
  141. }
  142. protocol lda {
  143.   auth_socket_path = /var/run/dovecot/auth-master
  144.   lda_mailbox_autocreate = yes
  145.   log_path = /var/log/dovecot-sieve.log
  146.   mail_plugins = quota sieve
  147.   postmaster_address = root
  148. }
  149. protocol lmtp {
  150.   info_log_path = /var/log/dovecot-lmtp.log
  151.   lmtp_save_to_detail_mailbox = yes
  152.   mail_plugins = quota sieve
  153.   postmaster_address = postmaster
  154.   recipient_delimiter = +
  155. }
  156. protocol imap {
  157.   imap_client_workarounds = tb-extra-mailbox-sep
  158.   mail_plugins = quota imap_quota
  159. }
  160. protocol pop3 {
  161.   mail_plugins = quota
  162.   pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  163.   pop3_uidl_format = %08Xu%08Xv
  164. }
复制代码
  1. root@iredmail01:/etc/postfix# more main.cf
  2. # See /usr/share/postfix/main.cf.dist for a commented, more complete version


  3. # Debian specific:  Specifying a file name will cause the first
  4. # line of that file to be used as the name.  The Debian default
  5. # is /etc/mailname.
  6. #myorigin = /etc/mailname

  7. smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
  8. biff = no

  9. # appending .domain is the MUA's job.
  10. append_dot_mydomain = no

  11. # Uncomment the next line to generate "delayed mail" warnings
  12. #delay_warning_time = 4h

  13. readme_directory = no

  14. # TLS parameters
  15. smtpd_tls_cert_file = /etc/ssl/certs/iRedMail_CA.pem
  16. smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
  17. smtpd_use_tls=yes
  18. smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
  19. smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

  20. # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
  21. # information on enabling SSL in the smtp client.

  22. smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
  23. myhostname = iredmail01.example.com
  24. alias_maps = hash:/etc/postfix/aliases
  25. alias_database = hash:/etc/postfix/aliases
  26. myorigin = iredmail01.example.com
  27. mydestination = $myhostname, localhost.$mydomain, localhost, iredmail.$mydomain
  28. relayhost = 192.168.111.1
  29. mynetworks = 127.0.0.1 192.168.111.0/24 192.168.11.0/24 192.168.1.0/24
  30. mailbox_size_limit = 0
  31. recipient_delimiter =
  32. inet_interfaces = all
  33. inet_protocols = ipv4
  34. virtual_alias_domains =
  35. allow_percent_hack = no
  36. swap_bangpath = no
  37. mydomain = example.com
  38. mynetworks_style = subnet
  39. smtpd_data_restrictions = reject_unauth_pipelining
  40. smtpd_reject_unlisted_recipient = yes
  41. smtpd_reject_unlisted_sender = yes
  42. smtp_tls_security_level = may
  43. smtp_tls_CAfile = $smtpd_tls_CAfile
  44. smtp_tls_loglevel = 0
  45. smtp_tls_note_starttls_offer = yes
  46. smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
  47. delay_warning_time = 0h
  48. maximal_queue_lifetime = 4h
  49. bounce_queue_lifetime = 4h
  50. proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonic
  51. al_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_
  52. maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions
  53. smtp_data_init_timeout = 240s
  54. smtp_data_xfer_timeout = 600s
  55. smtpd_helo_required = yes
  56. smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_h
  57. elo_access pcre:/etc/postfix/helo_access.pcre
  58. queue_run_delay = 300s
  59. minimal_backoff_time = 300s
  60. maximal_backoff_time = 4000s
  61. enable_original_recipient = no
  62. disable_vrfy_command = yes
  63. home_mailbox = Maildir/
  64. allow_min_user = no
  65. message_size_limit = 15728640
  66. virtual_minimum_uid = 2000
  67. virtual_uid_maps = static:2000
  68. virtual_gid_maps = static:2000
  69. virtual_mailbox_base = /var/vmail
  70. transport_maps = regexp:/etc/postfix/transport, proxy:pgsql:/etc/postfix/pgsql/transport_maps_user.cf, proxy:pgsql:/etc/postfix/pgsql/transp
  71. ort_maps_domain.cf
  72. virtual_mailbox_domains = proxy:pgsql:/etc/postfix/pgsql/virtual_mailbox_domains.cf
  73. virtual_mailbox_maps = proxy:pgsql:/etc/postfix/pgsql/virtual_mailbox_maps.cf
  74. virtual_alias_maps = proxy:pgsql:/etc/postfix/pgsql/virtual_alias_maps.cf, proxy:pgsql:/etc/postfix/pgsql/domain_alias_maps.cf, proxy:pgsql:
  75. /etc/postfix/pgsql/catchall_maps.cf, proxy:pgsql:/etc/postfix/pgsql/domain_alias_catchall_maps.cf
  76. sender_bcc_maps = proxy:pgsql:/etc/postfix/pgsql/sender_bcc_maps_user.cf, proxy:pgsql:/etc/postfix/pgsql/sender_bcc_maps_domain.cf
  77. recipient_bcc_maps = proxy:pgsql:/etc/postfix/pgsql/recipient_bcc_maps_user.cf, proxy:pgsql:/etc/postfix/pgsql/recipient_bcc_maps_domain.cf
  78. relay_domains = $mydestination, proxy:pgsql:/etc/postfix/pgsql/relay_domains.cf
  79. smtpd_sender_login_maps = proxy:pgsql:/etc/postfix/pgsql/sender_login_maps.cf
  80. smtpd_sasl_auth_enable = no
  81. smtpd_sasl_local_domain =
  82. broken_sasl_auth_clients = no
  83. smtpd_sasl_security_options = noanonymous
  84. smtpd_tls_auth_only = yes
  85. smtpd_recipient_restrictions =  permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
  86. smtpd_tls_security_level = may
  87. smtpd_tls_loglevel = 0
  88. smtpd_tls_CAfile = /etc/ssl/certs/iRedMail_CA.pem
  89. tls_random_source = dev:/dev/urandom
  90. mailbox_command = /usr/lib/dovecot/deliver
  91. virtual_transport = dovecot
  92. dovecot_destination_recipient_limit = 1
  93. smtpd_sasl_type = dovecot
  94. smtpd_sasl_path = private/dovecot-auth
复制代码
tail -f /var/log/mail.log
Aug  7 15:33:45 iredmail01 postfix/qmgr[8374]: 1694C480DF9: from=<kec@hqdc041.example.com>, size=825, nrcpt=1 (queue active)
Aug  7 15:33:45 iredmail01 postfix/qmgr[8374]: 46C5848854A: from=<kec@hqdc041.example.com>, size=834, nrcpt=1 (queue active)
Aug  7 15:33:45 iredmail01 postfix/local[8696]: 46C5848854A: to=<grosse@iredmail.example.com>, relay=local, delay=2205, delays=2205/0.02/0/0.05, dsn=4.3.0, status=deferred (temporary failure)
Aug  7 15:33:45 iredmail01 postfix/local[8694]: 1694C480DF9: to=<kec@iredmail.example.com>, relay=local, delay=1180, delays=1179/0.08/0/0.07, dsn=4.3.0, status=deferred (temporary failure)

tail -f /var/log/dovecot-sieve.log
Aug 07 15:33:45 lda(kec): Fatal: setgid(2000(vmail) from mail_gid setting) failed with euid=60011(kec), gid=50500(em), egid=50500(em): Operation not permitted (This binary should probably be called with process group set to 2000(vmail) instead of 50500(em))
Aug 07 15:33:45 lda(grosse): Fatal: setgid(2000(vmail) from mail_gid setting) failed with euid=519(grosse), gid=50500(em), egid=50500(em): Operation not permitted (This binary should probably be called with process group set to 2000(vmail) instead of 50500(em))
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP