Postfix using virtual.db file instead of mysql table

5,120

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.

Share:
5,120

Related videos on Youtube

asmisha
Author by

asmisha

Updated on September 18, 2022

Comments

  • asmisha
    asmisha over 1 year

    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
    
    • Dan
      Dan about 9 years
      You did postfix reload, right?
    • Tim Stoop
      Tim Stoop about 9 years
      Do you get virtual.db anywhere when you run 'postconf'?
    • asmisha
      asmisha about 9 years
      @dan, yes, of cource
    • asmisha
      asmisha about 9 years
      @tim-stoop no, I don't
    • Dan
      Dan about 9 years
      You sure postconf | grep /etc/postfix/virtual doesn't show the hashmap being referenced?
    • asmisha
      asmisha about 9 years
      @dan, yes, I've checked it with grep several times trying to find anything unusual. postconf | grep /etc/postfix/virtual returns nothing
  • masegaloeh
    masegaloeh about 9 years
    Would you like to accept this answer so this question wasn't left in unanswered state?