Postfix 服务器拒绝发件人地址

Postfix 服务器拒绝发件人地址

我在我的 Debian Wheezy 系统上安装了邮件服务器(postfix / dovecot),但无法发送邮件。

由于我只想管理邮件服务器,还没有域名,所以我正在使用服务器的外部 IP 地址。根据文档,这应该可行。

编辑我:该用户存在,我可以验证 IMAP 和 SMTP。

编辑二:MySQL 用户发送方映射(如评论中所述)返回user@ip

日志文件显示错误消息

NOQUEUE: reject: RCPT from [...]: 553 5.7.1 <user@ip>: Sender address rejected: not owned by user user@ip; from=<user@ip> to=<user@ip> proto=ESMTP helo=<[192.168.24.10]>

发件人地址等于(SASL)登录用户名,因此错误消息对我来说似乎没有什么意义。

我可能要在这里提一下,我搜索了整个网络,但没有找到解决方案。我没有对配置进行太多编辑,只master.cf在 中启用了 smtps 和主机、IP 地址和 mysql 映射main.cf。其余部分未受影响。

我这里可能存在什么问题?

这里有一些配置文件:

main.cf

myhostname = mail.fictional-domain.local
resolve_numeric_domain = yes
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = ip, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

# Authentification
smtpd_sasl_type=dovecot
smtpd_sasl_path=private/auth_dovecot
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
broken_sasl_auth_clients = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_ma$
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql_sender_login_maps.cf
smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch
        reject_unknown_sender_domain
        reject_unverified_sender
smtpd_recipient_restrictions = permit_sasl_authenticated
        permit_mynetworks
        reject_unauth_destination
        reject_unknown_reverse_client_hostname
# Virtual mailboxes
#local_transport = virtual
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_base = /var/vmail/
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 104
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

master.cf

# [removed commented lines]
dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}

smtp      inet  n       -       -       -       -       smtpd
# [removed commented lines]
smtps     inet  n       -       -       -       -       smtpd
# [removed commented lines]
  -o smtpd_tls_wrappermode=yes
# [removed commented lines]
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# [removed commented lines]
# [removed commented lines]
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
# [removed commented lines]
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
# [removed commented lines]
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
# [removed commented lines]
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
# [removed commented lines]
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
# [removed commented lines]
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -   n   n   -   2   pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

mysql_sender_login_maps.cf

hosts = 127.0.0.1
user = postfix
password = postfixmysqldatabase
dbname = postfixDB
query = SELECT username AS allowedUser FROM mailbox WHERE username="%s" AND active = 1 UNION SELECT goto FROM alias WHERE address="%s" AND active = 1

答案1

我遇到了这个错误,问题出在我的

smtpd_sender_login_maps =ldap:/etc/postfix/ldap-query-file.cf

由于我的调整,它传递了虚假的价值。

希望这会有所帮助

相关内容