我有一个 Postfix(和 Dovecot)服务器在运行,它使用 MySQL 来定义域名、用户和别名。这一切都运行良好,但现在我想向我已经定义了一些用户的域添加一个包罗万象的功能。我在 virtual_users 表中添加了用户,虽然我可以连接到它并用它发送电子邮件,但所有发送给它的电子邮件都被捕获。有没有办法解决这个问题?
相关配置文件及详情:
/etc/postfix/main.cf:
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
local_recipient_maps = $virtual_mailbox_maps
Run Code Online (Sandbox Code Playgroud)
mysql虚拟用户表:
+----+-----------+--------------+------------------------+
| id | domain_id | password | email |
+----+-----------+--------------+------------------------+
| 2 | 1 | passwordhash | postmaster@example.com |
+----+-----------+--------------+------------------------+
Run Code Online (Sandbox Code Playgroud)
mysql 虚拟别名表:
+----+-----------+------------------------+-------------------------------+
| id | domain_id | source | destination |
+----+-----------+------------------------+-------------------------------+
| 2 | 1 | @example.com | catch-all@other.example.net |
+----+-----------+------------------------+-------------------------------+
Run Code Online (Sandbox Code Playgroud)