大网数据广告活动
服务器运维问答

Postfix using virtual.db file instead of mysql table

· 52CE 我爱测

I have specified virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf , but still I got errors like warning: hash:/etc/postfix/virtual is unavailable. open database /etc/postfix/virtual.db: No such file or director…

问题原文

原帖链接 · asmisha · CC BY-SA 3.0

I have specified virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf, but still I got errors like

warning: hash:/etc/postfix/virtual is unavailable. open database /etc/postfix/virtual.db: No such file or directory

If I create the virtual and virtual.db files, everything works fine, but I want my virtual user account to be stored in DB, not if a file.

Why does postfix use the virtual.db file instead of db table?

postconf -n:

alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
dovecot_destination_recipient_limit = 1
inet_interfaces = all
inet_protocols = ipv4
milter_default_action = accept
milter_protocol = 2
mydestination = localhost
non_smtpd_milters = unix:/var/run/opendkim/opendkim.sock
smtp_tls_note_starttls_offer = yes
smtpd_milters = unix:/var/run/opendkim/opendkim.sock
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = example.tst
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/dovecot/dovecot.pem
smtpd_tls_key_file = /etc/dovecot/private/dovecot.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = dovecot

Actually I have /etc/postfix/virtual in master.cf:

submission inet n - - - - smtpd
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_sasl_type=dovecot
  -o smtpd_sasl_path=private/auth
  -o smtpd_sasl_security_options=noanonymous
  -o smtpd_sasl_local_domain=$myhostname
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o smtpd_sender_login_maps=hash:/etc/postfix/virtual
  -o smtpd_sender_restrictions=reject_sender_login_mismatch
  -o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject

已采纳解答

原帖链接 · asmisha · CC BY-SA 3.0

The problem was the line -o smtpd_sender_login_maps=hash:/etc/postfix/virtual in master.cf. I forgot to look there, because this exact configuration was running fine for months on another my server.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-02-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。