Postfix: Lookup error/problem & temp lookup failure

Discussion in 'Tips/Tricks/Mods' started by paka, Feb 8, 2016.

  1. paka

    paka Member

    Used "The Perfect Server - Debian Wheezy (Apache2, BIND, Dovecot, ISPConfig 3)" a couple years ago for original install on the machine in question.

    Had uninstalled mailman (apt-get purge mailmain) which is when problems began. Have spend the better part of yesterday researching and troubleshooting. No mail is going either outbound or coming inbound.

    Here's some log entries. Any thoughts for further investigation are most welcome.

    Code:
    Feb 8 10:54:52 bobby postfix/smtpd[3807]: error: open database proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf.db: No such file or directory
    Feb 8 10:59:49 bobby postfix/cleanup[4563]: error: open database proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf.db: No such file or directory
    Feb 8 11:09:03 bobby postfix/submission/smtpd[6289]: error: open database proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf.db: No such file or directory
    Feb 8 11:14:48 bobby postfix/smtpd[7102]: error: open database proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf.db: No such file or directory
    
    Code:
    Feb 8 01:55:01 bobby postfix/cleanup[16784]: warning: 379A3672D2: virtual_alias_maps map lookup problem for [email protected] -- deferring delivery
    Feb 8 01:55:01 bobby amavis[14419]: (14419-09-24) (!)FWD from <[email protected]> -> <[email protected]>,BODY=7BIT 451 4.3.0 from MTA(smtp:[127.0.0.1]:10025): 451 4.3.0 Error: queue file write error
    Feb 8 01:55:01 bobby postfix/smtpd[16686]: disconnect from localhost[127.0.0.1]
    Feb 8 01:55:01 bobby amavis[14419]: (14419-09-24) Blocked MTA-BLOCKED {TempFailedOutbound}, <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: ntRLQXg1fyMa, Hits: -1.901, size: 407, 127 ms
    Feb 8 01:55:01 bobby postfix/smtp[16727]: E060E6458F: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, conn_use=24, delay=23030, delays=23014/16/0/0.13, dsn=4.3.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.3.0 id=14419-09-24 - Temporary MTA failure on relaying, from MTA(smtp:[127.0.0.1]:10025): 451 4.3.0 Error: queue file write error (in reply to end of DATA command))
    Feb 8 01:55:01 bobby postfix/smtpd[16686]: connect from localhost[127.0.0.1]
    Feb 8 01:55:01 bobby postfix/smtpd[16686]: 3FC52672D5: client=localhost[127.0.0.1]
    Feb 8 01:55:01 bobby postfix/cleanup[16784]: warning: hash:proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf is unavailable. open database proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf.db: No such file or directory
    Feb 8 01:55:01 bobby postfix/cleanup[16784]: warning: hash:proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf lookup error for "[email protected]"
    Feb 8 01:55:01 bobby postfix/cleanup[16784]: warning: 3FC52672D5: virtual_alias_maps map lookup problem for [email protected] -- deferring delivery
    Feb 8 01:55:01 bobby amavis[14418]: (14418-11-51) Negative SMTP response to data-dot (<[email protected]>): 451 4.3.0 Error: queue file write error
    Feb 8 01:55:01 bobby postsrsd[16785]: srs_forward: <[email protected]> rewritten as <[email protected]>
     
    Last edited: Feb 8, 2016
  2. paka

    paka Member

    Result from postconf -n

    Code:
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    append_dot_mydomain = no
    biff = no
    body_checks = regexp:/etc/postfix/body_checks
    broken_sasl_auth_clients = yes
    config_directory = /etc/postfix
    content_filter = amavis:[127.0.0.1]:10024
    dovecot_destination_recipient_limit = 1
    header_checks = regexp:/etc/postfix/header_checks
    html_directory = /usr/share/doc/postfix/html
    inet_interfaces = all
    inet_protocols = all
    mailbox_size_limit = 0
    maildrop_destination_concurrency_limit = 1
    maildrop_destination_recipient_limit = 1
    message_size_limit = 0
    mime_header_checks = regexp:/etc/postfix/mime_header_checks
    mydestination = bobby.spgb.org, localhost, localhost.localdomain
    myhostname = bobby.spgb.org
    mynetworks = 127.0.0.0/8 [::1]/128
    myorigin = /etc/mailname
    nested_header_checks = regexp:/etc/postfix/nested_header_checks
    owner_request_special = no
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
    readme_directory = /usr/share/doc/postfix
    receive_override_options = no_address_mappings
    recipient_canonical_classes = envelope_recipient
    recipient_canonical_maps = tcp:127.0.0.1:10002
    recipient_delimiter = +
    relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
    relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
    relayhost =
    sender_canonical_classes = envelope_sender
    sender_canonical_maps = tcp:127.0.0.1:10001
    smtp_tls_protocols = !SSLv2,!SSLv3
    smtp_tls_security_level = may
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    smtpd_client_message_rate_limit = 100
    smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
    smtpd_data_restrictions = reject_unauth_pipelining
    smtpd_delay_reject = yes
    smtpd_helo_required = yes
    smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net, check_policy_service inet:127.0.0.1:60000
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_sasl_path = private/auth
    smtpd_sasl_type = dovecot
    smtpd_sender_restrictions = check_sender_access regexp:/etc/postfix/tag_as_originating.re, permit_mynetworks, permit_sasl_authenticated, check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf, check_sender_access regexp:/etc/postfix/tag_as_foreign.re
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
    smtpd_tls_protocols = !SSLv2,!SSLv3
    smtpd_tls_security_level = may
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtpd_use_tls = yes
    strict_rfc821_envelopes = yes
    transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_alias_domains =
    virtual_alias_maps = hash:proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_gid_maps = static:5000
    virtual_mailbox_base = /var/vmail
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_transport = dovecot
    virtual_uid_maps = static:5000
    
     
  3. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Remove "hash:" in that line and reload postfix.
     
    paka likes this.
  4. paka

    paka Member

    Brilliant. Thank you Jessee. Resolved that part of overall issue. :)

    I'm at a loss as the the cause of the following errors:
    Code:
    Feb 9 00:59:44 bobby postfix/smtpd[8385]: connect from localhost[127.0.0.1]
    Feb 9 00:59:44 bobby postfix/smtpd[8385]: NOQUEUE: filter: RCPT from localhost[127.0.0.1]: <[email protected]>: Sender address triggers FILTER amavis:[127.0.0.1]:10026; from=<[email protected]> to=<[email protected]> proto=SMTP helo=<bobby.spgb.net>
    Feb 9 00:59:44 bobby postfix/smtpd[8385]: warning: hash:proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf is unavailable. open database proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf.db: No such file or directory
    Feb 9 00:59:44 bobby postfix/smtpd[8385]: warning: hash:proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf lookup error for "[email protected]"
    Feb 9 00:59:44 bobby postfix/smtpd[8385]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <[email protected]>: Temporary lookup failure; from=<[email protected]> to=<[email protected]> proto=SMTP helo=<bobby.spgb.net>
    The referenced files are there but it's not seeing them?
    Code:
    [..]
    -rw-r-----   1 root postfix   232 Feb  8 22:30 mysql-virtual_client.cf
    -rw-r-----   1 root postfix   231 Nov 22  2014 mysql-virtual_client.cf~
    -rw-r-----   1 root postfix   222 Feb  8 22:30 mysql-virtual_domains.cf
    -rw-r-----   1 root postfix   221 Nov 22  2014 mysql-virtual_domains.cf~
    -rw-r-----   1 root postfix   219 Feb  8 22:30 mysql-virtual_email2email.cf
    -rw-r-----   1 root postfix   218 Nov 22  2014 mysql-virtual_email2email.cf~
    -rw-r--r--   1 root root        0 Feb  8 23:06 mysql-virtual_forwardings
    -rw-r-----   1 root postfix   318 Feb  8 23:57 mysql-virtual_forwardings.cf
    -rw-r-----   1 root postfix   317 Nov 22  2014 mysql-virtual_forwardings.cf~
    -rw-r--r--   1 root root    12288 Feb  8 23:06 mysql-virtual_forwardings.db
    -rw-r-----   1 root postfix   288 Feb  8 22:31 mysql-virtual_mailboxes.cf
    -rw-r-----   1 root postfix   288 Nov 22  2014 mysql-virtual_mailboxes.cf~
    -rw-r-----   1 root postfix   253 Feb  8 22:32 mysql-virtual_recipient.cf
    -rw-r-----   1 root postfix   252 Nov 22  2014 mysql-virtual_recipient.cf~
    -rw-r-----   1 root postfix   225 Feb  8 22:32 mysql-virtual_relaydomains.cf
    -rw-r-----   1 root postfix   224 Nov 22  2014 mysql-virtual_relaydomains.cf~
    -rw-r-----   1 root postfix   231 Feb  8 22:32 mysql-virtual_relayrecipientmaps.cf
    -rw-r-----   1 root postfix   230 Nov 22  2014 mysql-virtual_relayrecipientmaps.cf~
    -rw-r-----   1 root postfix   250 Feb  8 22:33 mysql-virtual_sender.cf
    -rw-r-----   1 root postfix   249 Nov 22  2014 mysql-virtual_sender.cf~
    -rw-r-----   1 root postfix   228 Feb  8 22:33 mysql-virtual_transports.cf
    -rw-r-----   1 root postfix   227 Nov 22  2014 mysql-virtual_transports.cf~
    -rw-r--r--   1 root root        0 Nov 22  2014 nested_header_checks
    [..]
    root@bobby:/etc/postfix#
    
    This also started after removing Mailman:
    Code:
    Feb 9 00:59:44 bobby postfix/smtpd[8385]: connect from localhost[127.0.0.1]
    Feb 9 00:59:44 bobby postfix/smtpd[8385]: NOQUEUE: filter: RCPT from localhost[127.0.0.1]: <[email protected]>: Sender address triggers FILTER amavis:[127.0.0.1]:10026; from=<[email protected]> to=<[email protected]> proto=SMTP helo=<bobby.spgb.net>
    Feb 9 00:59:44 bobby postfix/smtpd[8385]: warning: hash:proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf is unavailable. open database proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf.db: No such file or directory
    Feb 9 00:59:44 bobby postfix/smtpd[8385]: warning: hash:proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf lookup error for "[email protected]"
    Feb 9 00:59:44 bobby postfix/smtpd[8385]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <[email protected]>: Temporary lookup failure; from=<[email protected]> to=<[email protected]> proto=SMTP helo=<bobby.spgb.net>
     
    Last edited: Feb 9, 2016
  5. florian030

    florian030 Well-Known Member HowtoForge Supporter

    use
    Code:
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf, hash:/var/lib/mailman/data/virtual-mailman
    in main.cf
     
    paka likes this.
  6. paka

    paka Member

    Thank you very much indeed! Solved the error.
    You and everyone here on HowToForge are outstanding. A real life safer! To be honest the most pratical tips and responses are from this site. I recommend it to anyone.

    Cheers!
     
    Last edited: Feb 9, 2016
  7. florian030

    florian030 Well-Known Member HowtoForge Supporter

    Can you post your master.cf?
     
  8. paka

    paka Member

    Thanks Florian. You are just too fast! I was editing my post and when I completed you'd already replied.

    Was going through master.cf line by line and found the error:
    Code:
    # 127.0.0.1:10025 inet n - n - - smtpd
    How and why the '#' ended up there commenting out that rather important line is a mystery. OK, not a mystery. Clearly it had to me be! Embarrassing, really. How I manage to get anything done sometimes seems to be dumb luck.

    My sincere apologies for wasting your time on the last question. Thank you once again!
     

Share This Page