Postfix verwendet virtual.db-Datei anstelle einer MySQL-Tabelle

Postfix verwendet virtual.db-Datei anstelle einer MySQL-Tabelle

Ich habe angegeben virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf, aber ich habe immer noch Fehler wie

Warnung: Hash:/etc/postfix/virtual ist nicht verfügbar. Öffnen Sie die Datenbank /etc/postfix/virtual.db: Keine solche Datei oder kein solches Verzeichnis

Wenn ich die Dateien „virtual“ und „virtual.db“ erstelle, funktioniert alles einwandfrei, aber ich möchte, dass mein virtuelles Benutzerkonto in der Datenbank und nicht als Datei gespeichert wird.

Warum verwendet Postfix die Datei virtual.db anstelle einer DB-Tabelle?

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

Eigentlich habe ich /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

Antwort1

Das Problem war die Zeile -o smtpd_sender_login_maps=hash:/etc/postfix/virtualin master.cf. Ich habe vergessen, dort nachzuschauen, weil genau diese Konfiguration auf einem anderen meiner Server monatelang problemlos lief.

Antwort2

Ich habe das gelöst, indem ich die Zeile geändert habe etc/postfix/main.cf :

virtual_alias_maps = hash:/etc/postfix/virtual

Zu

virtual_alias_maps = hash:/etc/aliases

(oder alternativ einfach die etc/postfix/virtualDatei mit Inhalt erstellen):

your_linux_username:  [email protected]

dann Postfix neu starten: sudo systemctl restart postfixund dann wurden E-Mails versendet.

verwandte Informationen