- 论坛徽章:
- 1
|
本帖最后由 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:- command_directory = /usr/sbin
- config_directory = /etc/postfix
- daemon_directory = /usr/libexec/postfix
- data_directory = /var/lib/postfix
- debug_peer_level = 2
- html_directory = no
- mail_owner = postfix
- mailq_path = /usr/bin/mailq
- manpage_directory = /usr/local/man
- newaliases_path = /usr/bin/newaliases
- queue_directory = /var/spool/postfix
- readme_directory = no
- sample_directory = /etc/postfix
- sendmail_path = /usr/sbin/sendmail
- setgid_group = postdrop
- unknown_local_recipient_reject_code = 550
- ################################################################################
- myhostname = mail.xxx.com
- mydomain = xxx.com
- myorigin = $mydomain
- mydestination =
- mynetworks = 127.0.0.0/8
- relay_domains = $mydestination
- inet_interfaces = all
- home_mailbox = Maildir/
- ############################################################################
- virtual_alias_maps = mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf
- virtual_gid_maps = static:33
- virtual_mailbox_base = /var/vmail ###虚拟用户目录
- virtual_mailbox_domains = mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf
- virtual_mailbox_maps = mysql:/etc/postfix/mysql/mysql_virtual_mailbox_maps.cf
- virtual_minimum_uid = 33 ### 给 apache 权限。
- virtual_transport = virtual
- virtual_uid_maps = static:33
- #################################################################################
- message_size_limit = 52428800
- mailbox_size_limit = 209715200
- virtual_mailbox_limit = 209715200
- virtual_create_maildirsize = yes
- virtual_mailbox_extended = yes
- virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql/mysql_virtual_mailbox_limit_maps.cf
- virtual_mailbox_limit_override = yes
- virtual_overquota_bounce = yes
- #################################################################################
- smtpd_sasl_auth_enable = yes
- smtpd_sasl_type = dovecot ###定义安装方式 dovecot
- smtpd_sasl_path = private/auth-client ##### 路径要与 dovecot 一样,一会要讲到
- broken_sasl_auth_clients = yes
- #smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
- smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated,
- 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
复制代码 dovecot.conf:- base_dir = /var/run/dovecot/
- protocols = pop3 pop3s
- listen = *
- disable_plaintext_auth = no
- log_path = /var/log/dovecot.log
- info_log_path = /var/log/dovecot.info
- log_timestamp = "%Y-%m-%d %H:%M:%S "
- ssl_disable = yes
- mail_location = maildir:/var/vmail/%u
- mail_privileged_group = mail
- first_valid_uid = 33
- protocol imap {
- }
- protocol pop3 {
- pop3_uidl_format = %08Xu%08Xv
- }
- protocol managesieve {
- sieve=~/.dovecot.sieve
- sieve_storage=~/sieve
- }
-
- auth default {
- mechanisms = plain login
- passdb pam {
- }
- passdb sql {
- args = /etc/dovecot/dovecot-sql.conf
- }
- userdb passwd {
- }
-
- userdb sql {
- args = /etc/dovecot/dovecot-sql.conf
- }
-
- user = root
- socket listen {
- client {
- path = /var/spool/postfix/private/auth-client ###这里对应 postfix smtpd_sasl_path
- mode = 0660
- user = postfix
- group = postfix
- }
- }
- }
-
- dict {
- }
-
- plugin {
-
- }
复制代码 测试postfix:- root@ebs-37463:~# telnet mail.xxx.com 25
- Trying 211.xxx.xxx.xxx...
- Connected to mail.xxx.com.
- Escape character is '^]'.
- 220 mail.xxx.com ESMTP Postfix
- ehlo mail.xxx.com
- 250-mail.xxx.com
- 250-PIPELINING
- 250-SIZE 52428800
- 250-VRFY
- 250-ETRN
- 250-ENHANCEDSTATUSCODES
- 250-8BITMIME
- 250 DSN
复制代码 测试dovecot:- root@ebs-37463:~# telnet mail.xxx.com 110
- Trying 211.xxx.xxx.xxx...
- Connected to mail.xxx.com.
- Escape character is '^]'.
- +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
大神们求助!!! |
|