Mail server temporary lookup failure

Discussion in 'ISPConfig 3 Priority Support' started by azuritetechs, Oct 5, 2020.

  1. azuritetechs

    azuritetechs New Member HowtoForge Supporter

    Hello,

    I need help with a problem relative the mail service.

    Today this error appeared when sending emails.
    "An error occurred while sending mail. The mail server responded:
    451 4.3.0 <[email protected]>: Temporary lookup failure.
    Please check the message recipient "[email protected]" and try again"


    DONE STEPS:
    - I checked the forum for a solution and I get this thread. Seems that is a similar error.
    https://www.howtoforge.com/community/threads/mailing-temporary-lookup-failure.66286/


    - I checked the amavis status and thisis the result:
    ● amavis.service - LSB: Starts amavisd-new mailfilter
    Loaded: loaded (/etc/init.d/amavis; generated)
    Active: active (running) since Mon 2020-10-05 15:02:42 UTC; 1h 19min ago
    Docs: man:systemd-sysv-generator(8)
    Tasks: 3 (limit: 4915)
    CGroup: /system.slice/amavis.service
    ├─2674 /usr/sbin/amavisd-new (master)
    ├─2781 /usr/sbin/amavisd-new (ch4-avail)
    └─2782 /usr/sbin/amavisd-new (ch4-avail)

    oct 05 15:37:42 server1.azuritetechs.com amavis[2782]: (02782-03) (!!)TROUBLE in check_mail: check_init2 FAILED: Could not open /etc/resolv.conf: No such file or directory at /usr/sbin/amavisd-new line
    oct 05 15:37:42 server1.azuritetechs.com amavis[2782]: (02782-03) (!)PRESERVING EVIDENCE in /var/lib/amavis/tmp/amavis-20201005T153742-02782-4C0jTt6J
    oct 05 15:37:42 server1.azuritetechs.com amavis[2781]: (02781-03) (!!)TROUBLE in check_mail: check_init2 FAILED: Could not open /etc/resolv.conf: No such file or directory at /usr/sbin/amavisd-new line
    oct 05 15:37:42 server1.azuritetechs.com amavis[2781]: (02781-03) (!)PRESERVING EVIDENCE in /var/lib/amavis/tmp/amavis-20201005T153742-02781-uT0WiW5H
    oct 05 16:17:42 server1.azuritetechs.com amavis[2781]: (02781-04) Negative SMTP response to data-dot (<[email protected]>): 451 4.3.0 Error: queue file write error, dt: 0.5 ms
    oct 05 16:17:42 server1.azuritetechs.com amavis[2781]: (02781-04) (!)YUYdy-kvbfzj FWD from <[email protected]> -> <[email protected]>, BODY=7BIT 451 4.3.0 from MTA(smtp:[127.0.0.1]:10025): 451 4.3.0
    oct 05 16:17:42 server1.azuritetechs.com amavis[2781]: (02781-04) Blocked MTA-BLOCKED {TempFailedInbound}, [127.0.0.1] <[email protected]> -> <[email protected]>, Message-ID: <62ee7841f3ae0f0187adf1
    oct 05 16:17:42 server1.azuritetechs.com amavis[2782]: (02782-04) Negative SMTP response to data-dot (<[email protected]>): 451 4.3.0 Error: queue file write error, dt: 0.4 ms
    oct 05 16:17:42 server1.azuritetechs.com amavis[2782]: (02782-04) (!)v3eZoSrabSmu FWD from <[email protected]> -> <[email protected]>, BODY=7BIT 451 4.3.0 from MTA(smtp:[127.0.0.1]:
    oct 05 16:17:42 server1.azuritetechs.com amavis[2782]: (02782-04) Blocked MTA-BLOCKED {TempFailedInbound}, [127.0.0.1] <[email protected]> -> <[email protected]>, Message-ID: <KfTjK


    - Then I checked the /etc/resolv.conf and this file seems that is linked to the /run/systemd/resolve/stub-resolv.conf. I cheked the status of the /run/systemd/resolve/stub-resolv.conf but the /run/systemd/resolve didn't exist.

    - Then I started the systemd-resolved.service service and the /run/systemd/resolve appeared with the /run/systemd/resolve/stub-resolv.conf and /run/systemd/resolve/stub-resolv.conf and the /run/systemd/resolve/resolv.conf inside but status of the amavis is the same.



    How I can resolve this problem? I use ISPConfig Version: 3.1.15p3 on Ubuntu Server 18.04.4 LTS.


    Thanks
     
    Last edited: Oct 5, 2020
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. azuritetechs

    azuritetechs New Member HowtoForge Supporter

    Hello till,

    Thanks for your quick reply. I use Ubuntu Server 18.04.4 LTS.

    This is the content of /etc/resolv.conf
    "# This file is managed by man:systemd-resolved(8). Do not edit.
    #
    # This is a dynamic resolv.conf file for connecting local clients to the
    # internal DNS stub resolver of systemd-resolved. This file lists all
    # configured search domains.
    #
    # Run "systemd-resolve --status" to see details about the uplink DNS servers
    # currently in use.
    #
    # Third party programs must not access this file directly, but only through the
    # symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
    # replace this symlink by a static file or a different symlink.
    #
    # See man:systemd-resolved.service(8) for details about the supported modes of
    # operation for /etc/resolv.conf.

    nameserver 127.0.0.53
    options edns0
    search home"


    Thanks
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so ta least systemd genarated a file, What does:

    systemd-resolve --status

    show. And Try to restart amavis again with the command:

    systemctl restart amavis

    and check the mail.log again, amavis should not complain about a missing resolv.conf anymore.
     
  5. azuritetechs

    azuritetechs New Member HowtoForge Supporter

    This is the output text of the "systemd-resolve --status" command:
    "Global
    DNSSEC NTA: 10.in-addr.arpa
    DNSSEC NTA: 10.in-addr.arpa
    16.172.in-addr.arpa
    168.192.in-addr.arpa
    17.172.in-addr.arpa
    18.172.in-addr.arpa
    19.172.in-addr.arpa
    20.172.in-addr.arpa
    21.172.in-addr.arpa
    22.172.in-addr.arpa
    23.172.in-addr.arpa
    24.172.in-addr.arpa
    25.172.in-addr.arpa
    26.172.in-addr.arpa
    27.172.in-addr.arpa
    28.172.in-addr.arpa
    29.172.in-addr.arpa
    30.172.in-addr.arpa
    31.172.in-addr.arpa
    corp
    d.f.ip6.arpa
    home
    internal
    intranet
    lan
    local
    private
    test

    Link 15 (vethaccff4c)
    Current Scopes: none
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no

    Link 13 (veth1400f0a)
    Current Scopes: none
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no

    Link 9 (veth615938f)
    Current Scopes: none
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no

    Link 7 (veth41f9e16)
    Current Scopes: none
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no

    Link 5 (docker0)
    Current Scopes: none
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no

    Link 4 (br-81e6348a8ecb)
    Current Scopes: none
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no

    Link 3 (eno2)
    Current Scopes: none
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no

    Link 2 (eno1)
    Current Scopes: DNS
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no
    DNS Servers: 192.168.1.1
    DNS Domain: home"



    This is the output text after restart amavis, seems that the error doesn't appear:
    "● amavis.service - LSB: Starts amavisd-new mailfilter
    Loaded: loaded (/etc/init.d/amavis; generated)
    Active: active (running) since Mon 2020-10-05 19:02:42 UTC; 10s ago
    Docs: man:systemd-sysv-generator(8)
    Process: 4005 ExecStop=/etc/init.d/amavis stop (code=exited, status=0/SUCCESS)
    Process: 4020 ExecStart=/etc/init.d/amavis start (code=exited, status=0/SUCCESS)
    Tasks: 3 (limit: 4915)
    CGroup: /system.slice/amavis.service
    ├─4062 /usr/sbin/amavisd-new (master)
    ├─4072 /usr/sbin/amavisd-new (virgin child)
    └─4073 /usr/sbin/amavisd-new (virgin child)

    oct 05 19:02:42 server1.azuritetechs.com amavis[4062]: No decoder for .lrz
    oct 05 19:02:42 server1.azuritetechs.com amavis[4062]: No decoder for .lz4
    oct 05 19:02:42 server1.azuritetechs.com amavis[4062]: No decoder for .rar
    oct 05 19:02:42 server1.azuritetechs.com amavis[4062]: No decoder for .rpm
    oct 05 19:02:42 server1.azuritetechs.com amavis[4062]: No decoder for .swf
    oct 05 19:02:42 server1.azuritetechs.com amavis[4062]: No decoder for .zoo
    oct 05 19:02:42 server1.azuritetechs.com amavis[4062]: Using primary internal av scanner code for ClamAV-clamd
    oct 05 19:02:42 server1.azuritetechs.com amavis[4020]: Starting amavisd: amavisd-new.
    oct 05 19:02:42 server1.azuritetechs.com amavis[4062]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
    oct 05 19:02:42 server1.azuritetechs.com systemd[1]: Started LSB: Starts amavisd-new mailfilter."


    If a try to send a email I get the initial error
    "An error occurred while sending mail. The mail server responded:
    451 4.3.0 <[email protected]>: Temporary lookup failure.
    Please check the message recipient "[email protected]" and try again"


    This is the /var/log/mail.log
    https://sharedfolder.chloroplastgames.com/index.php/s/iAR1IVXliV9NFVZ
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Please try this, it's not a really good solution, it basically overrides what systemd did there with a working config file. Run the commands:

    mv /etc/resolv.conf /etc/resolv.conf_bak
    nano /etc/resolv.conf

    and enter this into the file:

    Code:
    nameserver 8.8.8.8
    nameserver 8.8.4.4
    Then save the file, restart amavisd:

    systemctl restart amavis

    and try to send an email to see if it work now.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Btw. restarting postfix might be necessary too.
     
  8. azuritetechs

    azuritetechs New Member HowtoForge Supporter

    I followed your instructions but when i try to send a mail I get the same error:
    "An error occurred while sending mail. The mail server responded:
    451 4.3.0 <[email protected]>: Temporary lookup failure.
    Please check the message recipient "[email protected]" and try again"
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Do dns lookups on your server work in general, try e.g.:

    ping -c1 google.com

    on the shell of the server. And please post the errors that you get in the mail.log file when you send the email that produces this error.

    Are you able to send emails to another email address that's on a different domain?
    Are you able to send yourself an email (send an email to the same address that you are logged in to the mail server with your email client, it should show up in inbox after a few seconds).
     
  10. azuritetechs

    azuritetechs New Member HowtoForge Supporter

    This is the result of the ping to google.com
    PING google.com (172.217.17.14) 56(84) bytes of data.
    64 bytes from mad07s09-in-f14.1e100.net (172.217.17.14): icmp_seq=1 ttl=114 time=12.3 ms

    --- google.com ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 12.363/12.363/12.363/0.000 ms

    This is the result of the ping to chloroplastgames.com, this is the domain of one of the sender address emails what are failing.
    PING chloroplastgames.com (85.50.124.107) 56(84) bytes of data.
    64 bytes from 107.pool85-50-124.static.orange.es (85.50.124.107): icmp_seq=1 ttl=64 time=0.550 ms

    --- chloroplastgames.com ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 0.550/0.550/0.550/0.000 ms



    This is the /var/log/mail.log after I tried to send a email (In the line 26 you can see the send attempt):
    https://sharedfolder.chloroplastgames.com/index.php/s/iAR1IVXliV9NFVZ



    I get hte same error when I try to send a email to my self, other address with the same domain of the sender or other address with other domain.
     
  11. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Lots of errors in that mail.log. Why do you not worry about them at all?
    Try to find out where those errors come from, then the issue you are trying to solve probably goes away.
    Is this a freshly installed system or did it work previously? Start with this: https://www.howtoforge.com/community/threads/please-read-before-posting.58408/
    Are all services running?
    Code:
    systemctl --state=failed
    Check for error messages in other log files.
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Regarding ping, that#s good, so name resolution is working again now.

    Regarding mail.log, seems as if at least the postfix-mysql package is missing. Which tutorial did you use to install your server?
     
  13. azuritetechs

    azuritetechs New Member HowtoForge Supporter

    I did not know these errors existed, sorry about that. I don't know how to fix them, that's why I'm asking for an expertise help.

    This is an old installation, previously it worked fine.


    These are the services that are failing:
    UNIT LOAD ACTIVE SUB DESCRIPTION
    ● apparmor.service loaded failed failed AppArmor initialization
    ● certbot.service loaded failed failed Certbot
    ● gitlab-runsvdir.service loaded failed failed GitLab Runit supervision process
    ● quotaon.service loaded failed failed Enable File System Quotas

    LOAD = Reflects whether the unit definition was properly loaded.
    ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
    SUB = The low-level unit activation state, values depend on unit type.

    4 loaded units listed. Pass --all to see loaded but inactive units, too.
    To show all installed unit files use 'systemctl list-unit-files'.


    In what log file I must check for errors?


    I checked the this post https://www.howtoforge.com/community/threads/please-read-before-posting.58408/
    - This is the htf_report.txt file
    https://sharedfolder.chloroplastgames.com/index.php/s/zuwBF7Evp7k3yc2

    - Do you use dovecot or courier as imap and pop3 server?
    I think that I used dovecot for imap and pop3 server. To install the IPCconfig I followed the The Perfect Server - Ubuntu 18.04 (Bionic Beaver) with Apache, PHP, MySQL, PureFTPD, BIND, Postfix, Dovecot and ISPConfig 3.1 tutorial.

    - Are you able to send and receive emails with webmail?
    I use roundcube for the webmail, normally I manage the mails with Thunderbird.
    I can't receive or send mails with webmail. When I try to send a mail I get this error, the same error when I sent a mail to an address with the same domain of the sender or to the same address.
    "SMTP Error (451): Failed to add recipient "[email protected]" (4.3.5 <localhost[127.0.0.1]>: Client host rejected: Server configuration error)."

    This is the mail.log after send an email from webmail:
    https://sharedfolder.chloroplastgames.com/index.php/s/iAR1IVXliV9NFVZ


    Thanks
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    No problem at all, we are here to help you fix the issues.

    Please run this command as root user:

    apt-get -y install postfix postfix-mysql postfix-doc mariadb-client mariadb-server openssl getmail4 rkhunter binutils dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd sudo

    and then run:

    service postfix restart

    and try to send email again.
     
  15. azuritetechs

    azuritetechs New Member HowtoForge Supporter

    Hello Till,

    I followed your instructions and then I can send and receive mails. Many thanks for the help!!!

    Now the problem is solved?

    Thanks
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    If mail sending works, then the issue should be solved.
     
  17. azuritetechs

    azuritetechs New Member HowtoForge Supporter

    Ok, then many thanks for all!
     

Share This Page