postfix+postfixadmin+dovecot 不能发信!
本帖最后由 akazhuk 于 2015-09-17 15:55 编辑maillog:
Sep 17 15:29:22 ebs-37463 postfix/smtpd: warning: database /etc/aliases.db is older than source file /etc/aliases
Sep 17 15:29:22 ebs-37463 postfix/smtpd: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Sep 17 15:29:22 ebs-37463 postfix/smtpd: warning: smtpd_sasl_auth_enable is true, but SASL support is not compiled in
Sep 17 15:29:22 ebs-37463 postfix/smtpd: connect from unknown
Sep 17 15:29:22 ebs-37463 postfix/smtpd: NOQUEUE: reject: RCPT from unknown: 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: disconnect from unknown 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_destinationdovecot.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 ###这里对应 postfixsmtpd_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
Sep 17 15:29:22 ebs-37463 postfix/smtpd: NOQUEUE: reject: RCPT from unknown: 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
大神们求助!!! 加QQ1474804934, 我帮你 很正常,没玩过 来人!求助啊!!:dizzy: 本帖最后由 woxizishen 于 2015-09-18 13:45 编辑
太简单了转发问题,不过你发邮件竟然把外网ip权限单独开通,我也是佩服你啊。在外部发有限都是通过SASL来验证的。DOVECOT一般也会结合SASL来验证。你前面只开通SMTP转发权限,并没有开通登陆POP3服务器收取邮件权限。SMTP和POP3是2个服务器,不要搞混淆。 回复 5# woxizishen
不好意思,我是新手。我也是按照一些配置文章来弄的。。 回复 5# woxizishen
我本来也是想经过服务器ip来发信和收信,前段时间配置过一个postfix+pop3+sasl 的邮件服务器可以!但用户都是要从ubuntu里添加用户,所以想弄个类似mysql那样的!就找到了postfixadmin!但配置下来发现挺多问题,也看了很久的maillog,解决到这里就无解了 :dizzy: 一个一个的解决,先解决sasl的支持没有添加的问题。
页:
[1]