Postfix name service error for name

I followed these instructions in order to send mail and here's the Postfix log: Sep 26 00:46:24 tshepang postfix/smtpd[5728]: 8EE2464931: client=localhost[127.0.0.1] Sep 26 00:47:44 tshepang postfix/

I followed these instructions in order to send mail and here’s the Postfix log:

Sep 26 00:46:24 tshepang postfix/smtpd[5728]: 8EE2464931: client=localhost[127.0.0.1]
Sep 26 00:47:44 tshepang postfix/cleanup[5810]: 8EE2464931: message-id=<20110925224624.8EE2464931@tshepang>
Sep 26 00:47:44 tshepang postfix/qmgr[5772]: 8EE2464931: from=<tshepang@gmail.com>, size=350, nrcpt=1 (queue active)
Sep 26 00:48:04 tshepang postfix/smtp[5859]: 8EE2464931: to=<tshepang.test@gmail.com>, relay=none, delay=127, delays=107/0.01/20/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=gmail.com type=MX: Host not found, try again)
Sep 26 00:48:39 tshepang postfix/smtpd[5728]: disconnect from localhost[127.0.0.1]

Also, this may be relevant (from «/etc/postfix/main.cf«):

myhostname = tshepang
mydestination = tshepang, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
inet_interfaces = all
inet_protocols = all

I am running this on Debian 6.

asked Sep 25, 2011 at 22:59

tshepang's user avatar

tshepangtshepang

63.2k85 gold badges220 silver badges286 bronze badges

8

I used to have the same problem:

root@medusa:~# postqueue -p
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
079AC700080B      357 Wed Apr  3 13:47:47  root@medusa.yyyy.cz
(Host or domain name not found. Name service error for name=xxxx.cz type=MX: Host not found, try again)
                                         hmls@xxxx.cz

..

root@medusa:~# host -t MX xxxx.cz
xxxx.cz mail is handled by 10 e2sgw01.xxxx.cz.
xxxx.cz mail is handled by 10 e2sgw02.xxxx.cz.

..

root@medusa:~# telnet e2sgw01.xxxx.cz. 25
Trying 217.77.161.168...
Connected to e2sgw01.xxxx.cz.
Escape character is '^]'.
220 e2sgw01.xxxx.cz ESMTP Postfix

The problem was in /var/spool/postfix/etc/resolv.conf file (the chrooted one).
Have a look at it.

tshepang's user avatar

tshepang

63.2k85 gold badges220 silver badges286 bronze badges

answered Apr 7, 2013 at 20:34

tloudev's user avatar

tloudevtloudev

711 silver badge2 bronze badges

0

Boosting a couple questions mentioned in comments that might help figure out what’s going on:

  • Can you add your /etc/resolv.conf to the question? The output you describe from host gmail.com is a bit suspicious and could indicate an issue with your nameserver.

  • What, if any, response do you get from the command host -t mx gmail.com ?

  • Have you successfully sent mail to other systems from this computer?

  • Does your ISP have some kind of explicit policy that requires you to use their server as mail relay? If they do, a firewall blocking MX lookup requests might explain the weird behavior of host gmail.com timing out after getting a partial correct result.

answered Oct 25, 2011 at 7:06

Shadur's user avatar

ShadurShadur

30k11 gold badges57 silver badges67 bronze badges

1

Try to disable the chroot property so that its not changerooted the /etc/postfix/master.cf as documented here

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd

to

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd

answered May 3, 2016 at 8:07

Philippe Gachoud's user avatar

It look like you are behind a proxy : gmail.com address is resolved, but the ping command does not succeed.
You can try to connect directly gmail’s SMTP with :

nc -w 1 gmail.com 25 ; echo $?

if it echoes «1», you can’t connect, probably cause of security filtering.

answered Jun 27, 2012 at 14:06

Arcadien's user avatar

ArcadienArcadien

1,5451 gold badge9 silver badges6 bronze badges

As @Shadur pointed out, this issue could be due to your ISP (or the network where your server is installed). If there is a security restrictions on the SMTP port (port number 25), MX servers cannot by reached via this port.

You could try to use the SMTP over SSL port (ssmtp, port number 465) instead. To do this, edit the /etc/postfix/master.cf file, comment the smtp line and add a ssmtp line instead :

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
#smtp      inet  n       -       -       -       -       smtpd
ssmtp      inet  n       -       -       -       -       smtpd

To check that this post is recognized with this name on your machine, you can do :

$>cat /etc/services | grep smtp
smtp        25/tcp      mail
ssmtp       465/tcp     smtps       # SMTP over SSL

answered Oct 26, 2015 at 13:37

Fabien Quatravaux's user avatar

I able to resolve it by telling to Postfix to use Google DNS , right after Installing postfix:

echo 'nameserver 8.8.8.8' >> /var/spool/postfix/etc/resolv.conf

answered Apr 7, 2021 at 20:37

ADV-IT's user avatar

ADV-ITADV-IT

1691 silver badge3 bronze badges

In my case postfix starts up before the system has finished network initialization. So the /var/spool/postfix/etc/resolv.conf is empty.

When I restart postfix, it is no longer empty.

sudo systemctl restart postfix

After that the mail queue slowly drains.

answered Sep 3, 2022 at 10:21

Jan Evert van Grootheest's user avatar

I’m stuck with a Postfix MX related problem.

I’ve just migrated a very old Centos 5 server to v7 so I’m using postfix-2.10.1-7.el7.x86_64. I’ve upgraded the legacy postfix configuration (maybe the cause of this hell) and other supplementary stuff which seems to work:

  • postfix-perl-scripts-2.10.1-7.el7.x86_64
  • postgrey-1.34-12.el7.noarch
  • amavisd-new-2.11.1-1.el7.noarch
  • spamassassin-3.4.0-4.el7_5.x86_64
  • perl-Mail-SPF-2.8.0-4.el7.noarch
  • perl-Mail-DKIM-0.39-8.el7.noarch
  • dovecot-2.2.36-3.el7.x86_64

After many tribulations I think I got most of the system running except the annoying MX related problems, as (from /var/log/maillog):

Mar 28 14:26:48 tormento postfix/smtpd[1021]: warning: Unable to look up MX host for spmailtechn.com: Host not found, try again
Mar 28 14:26:51 tormento postfix/smtpd[1052]: warning: Unable to look up MX host for inlumine.ual.es: Host not found, try again
Mar 28 14:31:38 tormento postfix/smtpd[1442]: warning: Unable to look up MX host for aol.com: Host not found, try again
Mar 28 13:07:53 tormento postfix/smtpd[26556]: warning: Unable to look up MX host for hotmail.com: Host not found, try again
Mar 28 13:12:06 tormento postfix/smtpd[26650]: warning: Unable to look up MX host for facebookmail.com: Host not found, try again
Mar 28 13:12:31 tormento postfix/smtpd[26650]: warning: Unable to look up MX host for joker.com: Host not found, try again
Mar 28 13:13:02 tormento postfix/smtpd[26650]: warning: Unable to look up MX host for bounce.linkedin.com: Host not found, try again

and:

Mar 28 14:50:36 tormento postfix/smtp[1700]: 7B6C69C6A2: to=<ismael.olea@gmail.com>, orig_to=<ismael@olea.org>, relay=none, delay=1142, delays=1142/0.07/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=gmail.com type=MX: Host not found, try again)
Mar 28 14:32:05 tormento postfix/smtp[1383]: 721A19C688: to=<XXXXX@yahoo.com>, orig_to=<XXXX@olea.org>, relay=none, delay=4742, delays=4742/0/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=yahoo.com type=MX: Host not found, try again)

as examples.

The first suspect is DNS resolution but this is working both using Hetztner DNS servers (where machine is host) or 8.8.8.8 or 9.9.9.9.

$ cat /etc/resolv.conf
; generated by /usr/sbin/dhclient-script
nameserver 213.133.100.100
nameserver 213.133.98.98
nameserver 213.133.99.99

and /etc/hosts:

195.201.24.84 tormento tormento.olea.org
127.0.0.1 localhost.localdomain localhost
127.0.0.1 localhost4.localdomain4 localhost4

# The following lines are desirable for IPv6 capable hosts
::1 tormento tormento.olea.org
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

I fear I’m missing something really obvious but I’ve been googling for two days doing any amount of tests and now I don’t know what much to do.

Since Serverfault rejected my original question as spam I’ve put the log and configuration details at my personal blog: http://olea.org/diario/2019/03/28/Postfix_MX_not_found.html

Thanks in advance.



Modified on: Thu, 23 Jan, 2020 at 12:18 PM


Business Automation

Business Automation:5.5

Business Automation:5.x

Symptoms

On attempt to send an email to the domain example.com it is bounced with the following message:

This is the mail system at host mail.yourdomain.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                  The mail system

<user@example.com>: Host or domain name not found. Name service error for
    name=example.com type=AAAA: Host found but no data record of requested
    type

where yourdomain.com is sender’s domain.

In the /usr/local/psa/var/log/maillog the following messages can be found:

Sep 12 07:35:43 mail postfix/smtpd[11757]: BFAF01B00085: client=yourdomain.com[192.168.0.1], sasl_method=LOGIN, sasl_username=sender@yourdomain.com
Sep 12 07:35:43 mail postfix/cleanup[11759]: BFAF01B00085: message-id=<20150911213543.Horde._QvV-QEOl66-QSoNrNmVsA1@webmail.yourdomain.com>
Sep 12 07:35:43 mail postfix/qmgr[6072]: BFAF01B00085: from=<sender@yourdomain.com>, size=805, nrcpt=1 (queue active)
Sep 12 07:35:43 mail postfix/smtp[11578]: BFAF01B00085: to=<user@example.com>, relay=none, delay=0.07, delays=0.06/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=example.com type=AAAA: Host found but no data record of requested type)
Sep 12 07:35:43 mail postfix/bounce[11761]: BFAF01B00085: sender non-delivery notification: D24591B0008F
Sep 12 07:35:43 mail postfix/qmgr[6072]: BFAF01B00085: removed

Cause

Neither MX nor A record for the domain example.com can be resolved from the mail server:

[root@mail]# dig mx example.com +short
[root@mail]# dig a example.com +short

the command above show empty output. But when trying to query MX records for the domain using public DNS server they are resolved correctly:

[root@mail]# dig mx example.com @8.8.8.8 +short
10 smtp1.provider.tld.
20 smtp2.provider.tld.

Note: when MTA is trying to deliver an email, first it is looking for MX records. If MX records cannot be found, MTA is trying to resolve A record. If MTA cannot find A record too, the email is bounced and the error below is returned:

Name service error for name=example.com type=A: Host found but no data record of requested type

If IPv6 is enabled in Postfix main.cf file, the error become as follows:

Name service error for name=example.com type=AAA: Host found but no data record of requested type

Resolution

Specify correct DNS servers in the /etc/resolv.conf on the mail server.

Internal content


Did you find it helpful?
Yes

No

Send feedback

Sorry we couldn’t be helpful. Help us improve this article with your feedback.

Related Articles

    Amazon When I got a Ubuntu 14.04.1 server with DigitalOcean I had many troubles when setting up the system to be able to send emails reliably. I was trying to migrate from Amazon EC2 to DigitalOcean, and I wanted to keep using Amazon SES for delivering emails reliably. SES was working great on my EC2 instance, but was not working on my droplet.

    A droplet is a server instance of DigitalOcean. DigitalOcean is a cloud hosting service.

    I followed to the letter http://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html to integrate SES with the Postfix SMTP server on my droplet, But I got the following error in /var/log/mail.log when I sent an email with PHP:

    postfix/smtp[3475]: 2D3A41253CA: to=<some@email.com>, relay=none, delay=5.6, delays=5.6/0.02/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=email-smtp.us-east-1.amazonaws.com type=MX: Host not found, try again)

    postfix/smtp[19241]: A89AB1252C7: to=<some@email.com>, relay=none, delay=218788, delays=218788/0.04/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=email-smtp.us-east-1.amazonaws.com type=MX: Host not found, try again)

    These two entries represent the same error. For some reason Postfix was not able to find the host of the relay according to the configurations I did. What was I supposed to do? I had the identical Postfix settings between my Amazon EC2 instance and my DigitalOcean droplet.

    I specifically set the following in /etc/postfix/main.cf on my droplet:

    relayhost = [email-smtp.us-east-1.amazonaws.com]:25

    How come the Postfix log says «relay=none»?

    Solution

    Here is what I did to fix this error.

    1. Run this command:

    $ sudo apt-get install dnsmasq

    2. Add the following lines to /etc/dnsmasq.conf:

    nameserver 172.16.0.23

    This is the name server used by my EC2 instance which I found out by running «cat /etc/resolv.conf» on it.

    3. Run this command:

    $ sudo service dnsmasq restart

    4. Run this command:

    $ sudo apt-get install network-manager

    5. Run this command:

    $ sudo service network-manager restart

    6. I checked /var/log/syslog and verified that dnsmasq was using the nameservers I specified:

    dnsmasq[1653]: using nameserver 172.16.0.23#53

    7. Try to send the email again. When it works, you should see this message in /var/log/mail.log:

    postfix/pickup[2134]: AF8BB1208CD: uid=0 from=

    postfix/cleanup[2173]: AF8BB1208CD: message-id=<20150505100023.AF8BB1208CD@some.localdomain>
    postfix/qmgr[2136]: AF8BB1208CD: from=, size=8338, nrcpt=1 (queue active)
    postfix/smtp[2143]: AF8BB1208CD: to=, relay=email-smtp.us-east-1.amazonaws.com[1.2.3.4]:25, delay=3.6, delays=0.01/0/2.2/1.4, dsn=2.0.0, status=sent (250 Ok 0000014d238550de-5580ebbd-f2d2-4749-807b-2df67e511ae7-000000)
    postfix/qmgr[2136]: AF8BB1208CD: removed

    8. When you have verified that email is sent successfully, change /etc/dnsmasq.conf back to the following:

    server=8.8.8.8
    server=8.8.4.4

    This is because these two name servers were listed in the original /etc/resolv.conf on my droplet. You should use your own original name servers. Follow the same steps above to make this setting take effect. Step 8 is optional. You don’t have to do it unless you run into trouble later.

    In my case, once I got email to work, I stopped the service dnsmasq and network-manager, and tried sending an email again, and it still worked! I am not sure what’s happening, but I am glad this issue has been fixed.

    This is by far one of the hardest bugs to fix I have ever encountered. Before I wrote this article, nobody on Google knew. Now Google knows.

    If you have any questions let me know and I will do my best to help you!

    I tried to post this in Serverfault but I couldn’t since it’s blocked by their spam detector.

    Here is the full text of my question:


    Hi:

    I’m stuck with a Postfix MX related problem.

    I’ve just migrated a very old Centos 5 server to v7 so I’m using postfix-2.10.1-7.el7.x86_64. I’ve upgraded the legacy postfix configuration (maybe the cause of this hell) and other supplementary stuff which seems to work:

    • postfix-perl-scripts-2.10.1-7.el7.x86_64
    • postgrey-1.34-12.el7.noarch
    • amavisd-new-2.11.1-1.el7.noarch
    • spamassassin-3.4.0-4.el7_5.x86_64
    • perl-Mail-SPF-2.8.0-4.el7.noarch
    • perl-Mail-DKIM-0.39-8.el7.noarch
    • dovecot-2.2.36-3.el7.x86_64

    After many tribulations I think I got most of the system running except the annoying MX related problems, as (from /var/log/maillog):

    Mar 28 14:26:48 tormento postfix/smtpd[1021]: warning: Unable to look up MX host for spmailtechn.com: Host not found, try again
    Mar 28 14:26:51 tormento postfix/smtpd[1052]: warning: Unable to look up MX host for inlumine.ual.es: Host not found, try again
    Mar 28 14:31:38 tormento postfix/smtpd[1442]: warning: Unable to look up MX host for aol.com: Host not found, try again
    Mar 28 13:07:53 tormento postfix/smtpd[26556]: warning: Unable to look up MX host for hotmail.com: Host not found, try again
    Mar 28 13:12:06 tormento postfix/smtpd[26650]: warning: Unable to look up MX host for facebookmail.com: Host not found, try again
    Mar 28 13:12:31 tormento postfix/smtpd[26650]: warning: Unable to look up MX host for joker.com: Host not found, try again
    Mar 28 13:13:02 tormento postfix/smtpd[26650]: warning: Unable to look up MX host for bounce.linkedin.com: Host not found, try again
    

    and:

    Mar 28 14:50:36 tormento postfix/smtp[1700]: 7B6C69C6A2: to=<ismael.olea@gmail.com>, orig_to=<ismael@olea.org>, relay=none, delay=1142, delays=1142/0.07/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=gmail.com type=MX: Host not found, try again)
    Mar 28 14:32:05 tormento postfix/smtp[1383]: 721A19C688: to=<XXXXX@yahoo.com>, orig_to=<XXXX@olea.org>, relay=none, delay=4742, delays=4742/0/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=yahoo.com type=MX: Host not found, try again)
    

    as examples.

    The first suspect is DNS resolution but this is working both using Hetztner DNS servers (where machine is host) or 8.8.8.8 or 9.9.9.9:

    $ dig mx gmail.com
    
    ; <<>> DiG 9.9.4-RedHat-9.9.4-73.el7_6 <<>> mx gmail.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20330
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;gmail.com.			IN	MX
    
    ;; ANSWER SECTION:
    gmail.com.		3014	IN	MX	10 alt1.gmail-smtp-in.l.google.com.
    gmail.com.		3014	IN	MX	5 gmail-smtp-in.l.google.com.
    gmail.com.		3014	IN	MX	40 alt4.gmail-smtp-in.l.google.com.
    gmail.com.		3014	IN	MX	20 alt2.gmail-smtp-in.l.google.com.
    gmail.com.		3014	IN	MX	30 alt3.gmail-smtp-in.l.google.com.
    
    ;; Query time: 1 msec
    ;; SERVER: 213.133.100.100#53(213.133.100.100)
    ;; WHEN: jue mar 28 14:56:00 CET 2019
    ;; MSG SIZE  rcvd: 161
    
    

    or:

    
    dig mx  inlumine.ual.es
    
    ; <<>> DiG 9.9.4-RedHat-9.9.4-73.el7_6 <<>> mx inlumine.ual.es
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38239
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 2, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;inlumine.ual.es.		IN	MX
    
    ;; ANSWER SECTION:
    inlumine.ual.es.	172800	IN	MX	1 ASPMX.L.GOOGLE.COM.
    inlumine.ual.es.	172800	IN	MX	10 ASPMX3.GOOGLEMAIL.COM.
    inlumine.ual.es.	172800	IN	MX	10 ASPMX2.GOOGLEMAIL.COM.
    inlumine.ual.es.	172800	IN	MX	5 ALT1.ASPMX.L.GOOGLE.COM.
    inlumine.ual.es.	172800	IN	MX	5 ALT2.ASPMX.L.GOOGLE.COM.
    
    ;; AUTHORITY SECTION:
    inlumine.ual.es.	172800	IN	NS	dns.ual.es.
    inlumine.ual.es.	172800	IN	NS	alboran.ual.es.
    
    ;; Query time: 113 msec
    ;; SERVER: 213.133.100.100#53(213.133.100.100)
    ;; WHEN: jue mar 28 14:56:51 CET 2019
    ;; MSG SIZE  rcvd: 217
    
    

    my main.cf:

    $ postconf -n
    address_verify_sender = postmaster@olea.org
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    body_checks = regexp:/etc/postfix/body_checks.regexp
    broken_sasl_auth_clients = yes
    canonical_maps = hash:/etc/postfix/canonical
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    content_filter = smtp-amavis:[127.0.0.1]:10024
    daemon_directory = /usr/libexec/postfix
    data_directory = /var/lib/postfix
    debug_peer_level = 2
    debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
    header_checks = pcre:/etc/postfix/header_checks.pcre
    home_mailbox = Maildir/
    html_directory = no
    inet_interfaces = all
    inet_protocols = ipv4
    local_recipient_maps = proxy:unix:passwd.byname $alias_maps
    mail_owner = postfix
    mailbox_command = /usr/bin/procmail -a "$EXTENSION"
    mailbox_size_limit = 200000000
    mailq_path = /usr/bin/mailq.postfix
    manpage_directory = /usr/share/man
    message_size_limit = 30000000
    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, tormento.olea.org, /etc/postfix/localdomains
    myhostname = tormento.olea.org
    newaliases_path = /usr/bin/newaliases.postfix
    policy_time_limit = 3600
    queue_directory = /var/spool/postfix
    readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
    recipient_delimiter = +
    sample_directory = /usr/share/doc/postfix-2.10.1/samples
    sendmail_path = /usr/sbin/sendmail.postfix
    setgid_group = postdrop
    smtp_tls_cert_file = /etc/pki/tls/certs/tormento.olea.org.crt.pem
    smtp_tls_key_file = /etc/pki/tls/private/tormento.olea.org.key.pem
    smtp_tls_mandatory_protocols = !SSLv2,!SSLv3
    smtp_tls_note_starttls_offer = yes
    smtp_tls_security_level = may
    smtpd_helo_required = yes
    smtpd_recipient_restrictions = permit_mynetworks check_client_access hash:/etc/postfix/access permit_sasl_authenticated reject_non_fqdn_recipient reject_non_fqdn_sender reject_rbl_client cbl.abuseat.org reject_rbl_client dnsbl-1.uceprotect.net reject_rbl_client zen.spamhaus.org reject_unauth_destination check_recipient_access hash:/etc/postfix/roleaccount_exceptions reject_multi_recipient_bounce check_helo_access pcre:/etc/postfix/helo_checks.pcre reject_non_fqdn_hostname reject_invalid_hostname check_sender_mx_access cidr:/etc/postfix/bogus_mx.cidr check_sender_access hash:/etc/postfix/rhsbl_sender_exceptions check_policy_service unix:postgrey/socket permit
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_local_domain = $myhostname, olea.org, cacharreo.club
    smtpd_sasl_path = private/auth
    smtpd_sasl_security_options = noanonymous
    smtpd_sasl_type = dovecot
    smtpd_tls_auth_only = no
    smtpd_tls_cert_file = /etc/pki/tls/certs/tormento.olea.org.crt.pem
    smtpd_tls_key_file = /etc/pki/tls/private/tormento.olea.org.key.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_mandatory_protocols = TLSv1
    smtpd_tls_received_header = yes
    smtpd_tls_security_level = may
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    transport_maps = hash:/etc/postfix/transport
    unknown_local_recipient_reject_code = 550
    virtual_maps = hash:/etc/postfix/virtual
    
    

    and my master.cf:

    $ postconf -M
    smtp       inet  n       -       n       -       -       smtpd
    submission inet  n       -       n       -       -       smtpd -o smtpd_tls_security_level=may -o smtpd_sasl_auth_enable=yes -o cleanup_service_name=cleanup_submission -o content_filter=smtp-amavis:[127.0.0.1]:10023
    smtps      inet  n       -       n       -       -       smtpd -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
    pickup     unix  n       -       n       60      1       pickup
    cleanup    unix  n       -       n       -       0       cleanup
    qmgr       unix  n       -       n       300     1       qmgr
    tlsmgr     unix  -       -       n       1000?   1       tlsmgr
    rewrite    unix  -       -       n       -       -       trivial-rewrite
    bounce     unix  -       -       n       -       0       bounce
    defer      unix  -       -       n       -       0       bounce
    trace      unix  -       -       n       -       0       bounce
    verify     unix  -       -       n       -       1       verify
    flush      unix  n       -       n       1000?   0       flush
    proxymap   unix  -       -       n       -       -       proxymap
    proxywrite unix  -       -       n       -       1       proxymap
    smtp       unix  -       -       n       -       -       smtp
    relay      unix  -       -       n       -       -       smtp -o fallback_relay=
    showq      unix  n       -       n       -       -       showq
    error      unix  -       -       n       -       -       error
    retry      unix  -       -       n       -       -       error
    discard    unix  -       -       n       -       -       discard
    local      unix  -       n       n       -       -       local
    virtual    unix  -       n       n       -       -       virtual
    lmtp       unix  -       -       n       -       -       lmtp
    anvil      unix  -       -       n       -       1       anvil
    scache     unix  -       -       n       -       1       scache
    smtp-amavis unix -       -       n       -       2       smtp -o smtp_data_done_timeout=1200 -o smtp_send_xforward_command=yes -o disable_dns_lookups=yes -o max_use=20
    127.0.0.1:10025 inet n   -       n       -       -       smtpd -o content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -o smtpd_delay_reject=no -o smtpd_client_restrictions=permit_mynetworks,reject -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o mynetworks_style=host -o mynetworks=127.0.0.0/8 -o strict_rfc821_envelopes=yes -o smtpd_error_sleep_time=0 -o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000 -o smtpd_client_connection_count_limit=0 -o smtpd_client_connection_rate_limit=0 -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks
    policy     unix  -       n       n       -       2       spawn user=nobody argv=/usr/bin/perl /usr/share/postfix/policyd-spf-perl
    
    

    I fear I’m missing something really obvious but I’ve been googling for two days doing any amount of tests and now I don’t know what much to do.

    Thanks in advance.


    Post data:

    Well, this is embarrassing. As I predicted my problem was caused by the most obvious and trivial reason: lack of read access to /etc/resolv.conf for the postfix user o_0

    As you probably know the postfix subproceses (smtp, smtpd, qmgr, etc) runs with the postfix user. All the comments and suggestion I’ve received has been related with problems accessing to DNS resolving data and the usual suspects has been SELinux or a chrooted postfix. You all were right in the final reason. Following an advice and tried:

    # sudo -u postfix -H cat /etc/resolv.conf
    cat: /etc/resolv.conf: Permission denied
    

    So… What??

    # ls -l /etc/resolv.conf
    -rw-r-----. 1 root named 118 mar 28 20:34 /etc/resolv.conf
    
    

    OMG!… then after a chmod o+r and restarting Postfix all the email on hold can be processed and sent and new mail is processed as expected.

    I doubt I’ve changed the resolv.conf reading permissions but I can’t be 100% sure. So finally the problem is fixed and I’m very sorry for stole the attention of all of you for this ridiculous reason.

    Thanks you all.

    Понравилась статья? Поделить с друзьями:
  • Php syntax error unexpected t encapsed and whitespace
  • Post запрос ошибка 500
  • Play market что то пошло не так ошибка
  • Play market устройство не поддерживается как исправить
  • Port is already allocated docker как исправить