Postfix 将电子邮件地址更改为

Postfix 将电子邮件地址更改为

我跟着本指南一个是使用 postfix、dovecot 和 mysql 使用 vhosts 设置电子邮件。当我向邮件服务器发送电子邮件时,它会被退回,我收到以下消息/var/log/mail.info

11 月 27 日 14:39:21 myserver postfix/lmtp[21637]: B999E1E86A: to=<[电子邮件保护]>,orig_to=,relay=example.com[private/dovecot-lmtp],delay=0.14,delays=0.12/0/0.01/0.01,dsn=5.1.1,status=bounced(主机 example.com[private/dovecot-lmtp] 说:550 5.1.1 <[电子邮件保护]> 用户不存在:[电子邮件保护] (回复 RCPT TO 命令)

出于某种原因,我看到它正在转发[电子邮件保护][电子邮件保护]

我不是这方面的专家,不知道它应该如何工作,但我认为这存在两个问题。

  1. 用户名将被数字 1 替换
  2. 主机名被添加到域名的前面(不确定这是设计使然还是错误)

是什么导致了我的问题?我该如何解决它?

完整错误

根据评论,这是我的全部错误:

Nov 28 17:55:56 myserver dovecot: master: Warning: Killed with signal 15 (by pid=21680 uid=0 code=kill)
Nov 28 17:55:56 myserver dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 28 17:55:56 myserver dovecot: master: Dovecot v2.2.27 (c0f36b0) starting up for imap, pop3, lmtp (core dumps disabled)
Nov 28 17:56:12 myserver postfix/smtpd[21693]: connect from sonic312-22.consmr.mail.ne1.yahoo.com[66.163.191.203]
Nov 28 17:56:12 myserver postfix/smtpd[21693]: B3B801EB8C: client=sonic312-22.consmr.mail.ne1.yahoo.com[66.163.191.203]
Nov 28 17:56:12 myserver postfix/cleanup[21697]: B3B801EB8C: message-id=<[email protected]>
Nov 28 17:56:12 myserver postfix/qmgr[8196]: B3B801EB8C: from=<[email protected]>, size=3187, nrcpt=1 (queue active)
Nov 28 17:56:12 myserver dovecot: lmtp(21699): Connect from local
Nov 28 17:56:12 myserver postfix/lmtp[21698]: B3B801EB8C: to=<[email protected]>, orig_to=<[email protected]>, relay=example.com[private/dovecot-lmtp], delay=0.16, delays=0.12/0.01/0.01/0.02, dsn=5.1.1, status=bounced (host example.com[private/dovecot-lmtp] said: 550 5.1.1 <[email protected]> User doesn't exist: [email protected] (in reply to RCPT TO command))
Nov 28 17:56:12 myserver dovecot: lmtp(21699): Disconnect from local: Successful quit
Nov 28 17:56:12 myserver postfix/cleanup[21697]: CF9BA1EBA8: message-id=<[email protected]>
Nov 28 17:56:12 myserver postfix/qmgr[8196]: CF9BA1EBA8: from=<>, size=5485, nrcpt=1 (queue active)
Nov 28 17:56:12 myserver postfix/bounce[21703]: B3B801EB8C: sender non-delivery notification: CF9BA1EBA8
Nov 28 17:56:12 myserver postfix/qmgr[8196]: B3B801EB8C: removed
Nov 28 17:56:12 myserver postfix/smtpd[21693]: disconnect from sonic312-22.consmr.mail.ne1.yahoo.com[66.163.191.203] ehlo=2 starttls=1 mail=1 rcpt=1 data=1 quit=1 commands=7
Nov 28 17:56:14 myserver postfix/smtp[21705]: CF9BA1EBA8: to=<[email protected]>, relay=mta5.am0.yahoodns.net[67.195.229.58]:25, delay=1.6, delays=0/0.01/0.3/1.3, dsn=2.0.0, status=sent (250 ok dirdel)
Nov 28 17:56:14 myserver postfix/qmgr[8196]: CF9BA1EBA8: removed

答案1

问题实际上出在/etc/postfix/mysql-virtual-email2email.cf。该文件应该是这样的:

user = mailuser
password = mailuserpass
hosts = 127.0.0.1
dbname = mailserver
query = SELECT email FROM virtual_users WHERE email='%s'

但是,我的文件中的最后一行如下所示:

query = SELECT 1 FROM virtual_users WHERE email='%s'

由于两个文件都有一个查询,因此在复制mysql-virtual-mailbox-domains.cf或文件时出现了错误。mysql-virtual-mailbox-maps.cfSELECT 1 FROM ...

相关内容