Postfix: unable to send emails - probably MariaDB (MySQL)

Discussion in 'ISPConfig 3 Priority Support' started by 30uke, Aug 2, 2020.

  1. 30uke

    30uke Active Member HowtoForge Supporter

    Debian 10.5; ISPConfig 3.1.15p3
    Hello,
    I am struggling with the following messages from the file "/var/log/mail.warn".
    Code:
    Aug  2 22:26:47 s2 postfix/smtpd[2333]: warning: connect to mysql server 127.0.0.1: Host '127.0.0.1' is not allowed to connect to this MariaDB server
    Aug  2 22:26:47 s2 postfix/smtpd[2333]: warning: mysql:/etc/postfix/mysql-virtual_client.cf lookup error for "localhost"
    Aug  2 22:26:54 s2 postfix/trivial-rewrite[2336]: warning: virtual_mailbox_domains: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf: table lookup problem
    Aug  2 22:26:54 s2 postfix/trivial-rewrite[2336]: warning: virtual_mailbox_domains lookup failure
    Aug  2 22:26:54 s2 postfix/trivial-rewrite[2336]: warning: virtual_mailbox_domains: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf: table lookup problem
    Aug  2 22:26:54 s2 postfix/trivial-rewrite[2336]: warning: virtual_mailbox_domains lookup failure
    Aug  2 22:26:54 s2 postfix/smtpd[2333]: warning: mysql:/etc/postfix/mysql-virtual_client.cf lookup error for "mx-out-01b.sjc3.discourse.cloud"
    I suspect it's related to MariaDB (MySQL):
    Code:
    Aug  2 22:18:16 s2 postfix/proxymap[1212]: warning: connect to mysql server 127.0.0.1: Host '127.0.0.1' is not allowed to connect to this MariaDB server
    I did run an upgrade today and it did upgrade MariaDB and Postfix
    Code:
    Start-Date: 2020-08-02  15:48:33
    Commandline: apt upgrade
    Requested-By: main (1000)
    Install: linux-image-4.19.0-10-amd64:amd64 (4.19.132-1, automatic)
    Upgrade: libpython3.7-minimal:amd64 (3.7.3-2+deb10u1, 3.7.3-2+deb10u2), perl-base:amd64 (5.28.1-6, 5.28.1-6+deb10u1), postfix:amd64 (3.4.10-0+deb10u1, 3.4.14-0+deb10u1), libdbus-1-3:amd64 (1.12.16-1, 1.12.20-0+deb10u1), linux-libc-dev:amd64 (4.19.118-2+deb10u1, 4.19.132-1), postfix-mysql:amd64 (3.4.10-0+deb10u1, 3.4.14-0+deb10u1), grub-common:amd64 (2.02+dfsg1-20, 2.02+dfsg1-20+deb10u2), dbus:amd64 (1.12.16-1, 1.12.20-0+deb10u1), mariadb-common:amd64 (1:10.3.22-0+deb10u1, 1:10.3.23-0+deb10u1), speedtest-cli:amd64 (2.0.2-1, 2.0.2-1+deb10u1), perl-modules-5.28:amd64 (5.28.1-6, 5.28.1-6+deb10u1), mariadb-server-core-10.3:amd64 (1:10.3.22-0+deb10u1, 1:10.3.23-0+deb10u1), libpython3.7:amd64 (3.7.3-2+deb10u1, 3.7.3-2+deb10u2), python3.7:amd64 (3.7.3-2+deb10u1, 3.7.3-2+deb10u2), grub2-common:amd64 (2.02+dfsg1-20, 2.02+dfsg1-20+deb10u2), grub-pc:amd64 (2.02+dfsg1-20, 2.02+dfsg1-20+deb10u2), libpython3.7-stdlib:amd64 (3.7.3-2+deb10u1, 3.7.3-2+deb10u2), postfix-doc:amd64 (3.4.10-0+deb10u1, 3.4.14-0+deb10u1), python3.7-minimal:amd64 (3.7.3-2+deb10u1, 3.7.3-2+deb10u2), mariadb-server-10.3:amd64 (1:10.3.22-0+deb10u1, 1:10.3.23-0+deb10u1), libperl5.28:amd64 (5.28.1-6, 5.28.1-6+deb10u1), grub-pc-bin:amd64 (2.02+dfsg1-20, 2.02+dfsg1-20+deb10u2), clamav-docs:amd64 (0.102.3+dfsg-0+deb10u1, 0.102.4+dfsg-0+deb10u1), linux-image-amd64:amd64 (4.19+105+deb10u4, 4.19+105+deb10u5), clamav:amd64 (0.102.3+dfsg-0+deb10u1, 0.102.4+dfsg-0+deb10u1), clamav-daemon:amd64 (0.102.3+dfsg-0+deb10u1, 0.102.4+dfsg-0+deb10u1), clamdscan:amd64 (0.102.3+dfsg-0+deb10u1, 0.102.4+dfsg-0+deb10u1), clamav-freshclam:amd64 (0.102.3+dfsg-0+deb10u1, 0.102.4+dfsg-0+deb10u1), mariadb-client-10.3:amd64 (1:10.3.22-0+deb10u1, 1:10.3.23-0+deb10u1), mariadb-server:amd64 (1:10.3.22-0+deb10u1, 1:10.3.23-0+deb10u1), libunwind8:amd64 (1.2.1-9, 1.2.1-10~deb10u1), mariadb-client-core-10.3:amd64 (1:10.3.22-0+deb10u1, 1:10.3.23-0+deb10u1), mariadb-client:amd64 (1:10.3.22-0+deb10u1, 1:10.3.23-0+deb10u1), libmariadb3:amd64 (1:10.3.22-0+deb10u1, 1:10.3.23-0+deb10u1), libgnutls30:amd64 (3.6.7-4+deb10u4, 3.6.7-4+deb10u5), perl:amd64 (5.28.1-6, 5.28.1-6+deb10u1), clamav-base:amd64 (0.102.3+dfsg-0+deb10u1, 0.102.4+dfsg-0+deb10u1), libclamav9:amd64 (0.102.3+dfsg-0+deb10u1, 0.102.4+dfsg-0+deb10u1), base-files:amd64 (10.3+deb10u4, 10.3+deb10u5)
    End-Date: 2020-08-02  16:03:34
    I am able to connect to the database
    Code:
    root@s2:/# mysql dbispconfig -uispconfig -p
    Enter password:
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 350
    Server version: 10.3.23-MariaDB-0+deb10u1-log Debian 10
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [dbispconfig]> show tables;
    +--------------------------+
    | Tables_in_dbispconfig    |
    +--------------------------+
    | aps_instances            |
    | aps_instances_settings   |
    
    [...SNIP...]
    I am able to receive e-mails. This works in an IMAP client (tested with Firefox) and with Roundcube.
    But sending an e-mail gives me the following error:
    Code:
    SMTP-fout (451): Ontvanger "********@gmail.com" kan niet toegevoegd worden (4.3.5 <localhost[::1]>: Client host rejected: Server configuration error).
    Note: I did mask the receiver (ontvanger) with asterisks.
    I did try quite some things but I can't find a solution. Some help would be very much appreciated. Thanks.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Check your mariaDB config to ensure that you did not disable networking for the database. Access over the network must be possible. Your database connection test did not test that, if you want to test it, use:

    mysql -h 127.0.0.1 -u ispconfig -p dbispconfig
     
    30uke likes this.
  3. 30uke

    30uke Active Member HowtoForge Supporter

    Yes, I see the error. I will check the config.
    Code:
    root@s2:/# mysql -h 127.0.0.1 -u ispconfig -p dbispconfig
    Enter password:
    ERROR 1130 (HY000): Host '127.0.0.1' is not allowed to connect to this MariaDB server
     
  4. 30uke

    30uke Active Member HowtoForge Supporter

    I might have found it. I commented out the line "skip-name-resolve" in the file "50-server.cnf". The file is located in the folder "/etc/mysql/mariadb.conf.d". Next I did restart MariaDB ("service mysql restart") and connected successfully to 127.0.0.1 as instructed by Till.

    [EDIT]
    Confirmed: this works for me. Hopefully this is helpful for anyone running into this after installing updates for Debian 10.
    Thanks Till for you help.
    [/EDIT]
     
    Last edited: Aug 3, 2020

Share This Page