Need help getting Postfix to work

Discussion in 'Server Operation' started by omega13a, Oct 20, 2019.

  1. omega13a

    omega13a New Member

    I have a Fedora 29 webserver. Everything was working fine until a couple weeks ago when there was a one hour blackout and even though I have surge protection, somehow, the primary hard drive got fried prompting me to get a new hard drive and re-install everything. While I was able to find backups of the websites on the server that are relatively recent (few months old), I couldn't find any recent backups of the /etc directory (the most recent I could find after tearing my house apart was from years before I even had Fedora 29 installed and is too old to work with the current versions of software). I had to reconfigure everything by memory and so far everything appears to be working except for Postfix. The problem is that it is unable to send email. My ISP requires that all outgoing email be sent through their SMTP server. For some reason Postfix is refusing to use it as a relayhost as shown in this excerpt from /var/log/maillog:
    Code:
    Oct 19 19:45:20 peeves postfix[17908]: Postfix is running with backwards-compatible default settings
    Oct 19 19:45:20 peeves postfix[17908]: See http://www.postfix.org/COMPATIBILITY_README.html for details
    Oct 19 19:45:20 peeves postfix[17908]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
    Oct 19 19:45:20 peeves postfix/postfix-script[17915]: stopping the Postfix mail system
    Oct 19 19:45:20 peeves postfix/master[12649]: terminating on signal 15
    Oct 19 19:45:20 peeves postfix[17924]: Postfix is running with backwards-compatible default settings
    Oct 19 19:45:20 peeves postfix[17924]: See http://www.postfix.org/COMPATIBILITY_README.html for details
    Oct 19 19:45:20 peeves postfix[17924]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
    Oct 19 19:45:20 peeves postfix/postfix-script[17989]: starting the Postfix mail system
    Oct 19 19:45:21 peeves postfix/master[17991]: daemon started -- version 3.3.3, configuration /etc/postfix
    Oct 19 19:45:22 peeves postfix/pickup[17992]: B96211A60A07: uid=0 from=<[email protected]>
    Oct 19 19:45:22 peeves postfix/cleanup[18004]: B96211A60A07: message-id=<[email protected]>
    Oct 19 19:45:22 peeves postfix/qmgr[17993]: B96211A60A07: from=<[email protected]>, size=58814, nrcpt=1 (queue active)
    Oct 19 19:45:22 peeves postfix/pickup[17992]: C91101A60A03: uid=0 from=<[email protected]>
    Oct 19 19:45:22 peeves postfix/cleanup[18004]: C91101A60A03: message-id=<[email protected]>
    Oct 19 19:45:22 peeves postfix/smtp[18011]: warning: smtp_tls_per_site ignored when smtp_tls_policy_maps is not empty.
    Oct 19 19:45:22 peeves postfix/qmgr[17993]: C91101A60A03: from=<[email protected]>, size=1374, nrcpt=1 (queue active)
    Oct 19 19:45:22 peeves postfix/pickup[17992]: E76101A60A06: uid=0 from=<[email protected]>
    Oct 19 19:45:22 peeves postfix/cleanup[18004]: E76101A60A06: message-id=<[email protected]>
    Oct 19 19:45:22 peeves postfix/smtp[18016]: warning: smtp_tls_per_site ignored when smtp_tls_policy_maps is not empty.
    Oct 19 19:45:22 peeves postfix/smtp[18011]: B96211A60A07: to=<[email protected]>, relay=none, delay=0.31, delays=0.24/0.08/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=smtp.mail.att.net type=A: Host not found, try again)
    Oct 19 19:45:23 peeves postfix/smtp[18016]: C91101A60A03: to=<[email protected]>, relay=none, delay=0.31, delays=0.3/0.02/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=smtp.mail.att.net type=A: Host not found, try again)
    
    I know smtp.mail.att.net is the correct address because I am able to ping it:
    Code:
    [[email protected] postfix]#ping smtp.mail.att.net
    PING smtp.att.mail.fy4.b.yahoo.com (98.136.96.82) 56(84) bytes of data.
    64 bytes from smtp.att.mail.vip.ne1.yahoo.com (98.136.96.82): icmp_seq=1 ttl=49 time=56.4 ms
    64 bytes from smtp.att.mail.vip.ne1.yahoo.com (98.136.96.82): icmp_seq=2 ttl=49 time=56.2 ms
    64 bytes from smtp.att.mail.vip.ne1.yahoo.com (98.136.96.82): icmp_seq=3 ttl=49 time=56.10 ms
    ^C
    --- smtp.att.mail.fy4.b.yahoo.com ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 5ms
    rtt min/avg/max/mdev = 56.211/56.522/56.952/0.369 ms
    If it helps, here's my /etc/postfix/main.cf: http://fedtrek.com/staff/omega13a/main.cf.txt
    And my /etc/postfix/master.cf: http://fedtrek.com/staff/omega13a/master.cf.txt
    Any help will be greatly appreciated because I'm loosing my mind trying to solve this problem...
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    It may be the correct address, but what is it? I mean, what is that host sopposed to do? It does not look like it is your fedora host, is it smart host of your ISP?
    Do the mails you try to send end up in mail queue? What shows command
    Code:
    mailq
    What show commands
    Code:
    hostname
    hostname -f
    I ask the above since you do not set myhostname in main.cf.
     
  3. omega13a

    omega13a New Member

    Its my ISP's smtp server.

    Not full output but enough to give you the idea:
    Code:
    [[email protected] postfix]# mailq
    -Queue ID-  --Size-- ----Arrival Time---- -Sender/Recipient-------
    4B0921A609CA      940 Thu Oct 17 23:35:43  [email protected]
    (Host or domain name not found. Name service error for name=smtp.mail.att.net type=A: Host not found, try again)
                                             [email protected]
                                             [email protected]
    
    4F57C1A608A3     1966 Thu Oct 17 18:30:53  [email protected]
    (Host or domain name not found. Name service error for name=smtp.mail.att.net type=A: Host not found, try again)
                                             [email protected]
    
    45A961A60902    58814 Thu Oct 17 00:35:33  [email protected]
    (Host or domain name not found. Name service error for name=smtp.mail.att.net type=A: Host not found, try again)
                                             [email protected]
    
    ... 
    
    5FBB41A608D0     4774 Thu Oct 17 20:21:47  [email protected]
    (Host or domain name not found. Name service error for name=smtp.mail.att.net type=A: Host not found, try again)
                                             [email protected]
    
    573851A60A0B      424 Sat Oct 19 19:45:23  [email protected]
    (Host or domain name not found. Name service error for name=smtp.mail.att.net type=A: Host not found, try again)
                                             [email protected]
    
    -- 3221 Kbytes in 323 Requests.
    Code:
    [[email protected] postfix]# hostname
    peeves.fedtrek.com
    [[email protected] postfix]# hostname -f
    peeves.fedtrek.com
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I think hostname should return only peeves.
    Does the name service you use find the name smtp.mail.att.net? What is in file /etc/resolv.conf? What shows command
    Code:
    host smtp.mail.att.net
     
  5. omega13a

    omega13a New Member

    Code:
    [[email protected] postfix]# service named status
    Redirecting to /bin/systemctl status named.service
    ● named.service - Berkeley Internet Name Domain (DNS)
       Loaded: loaded (/usr/lib/systemd/system/named.service; enabled; vendor preset: disabled)
       Active: active (running) since Thu 2019-10-17 21:27:06 PDT; 2 days ago
      Process: 15520 ExecStop=/bin/sh -c /usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID (code=exited, status=0/SUCCESS)
      Process: 13083 ExecReload=/bin/sh -c if /usr/sbin/rndc null > /dev/null 2>&1; then /usr/sbin/rndc reload; else /bin/kill -HUP $MAINPID; fi (code=exited, st>
      Process: 15533 ExecStart=/usr/sbin/named -u named -c ${NAMEDCONF} $OPTIONS (code=exited, status=0/SUCCESS)
      Process: 15531 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of>
     Main PID: 15534 (named)
        Tasks: 7 (limit: 4915)
       Memory: 109.5M
       CGroup: /system.slice/named.service
               └─15534 /usr/sbin/named -u named -c /etc/named.conf
    
    Oct 20 14:21:10 peeves.fedtrek.com named[15534]: client @0x7f86540dace0 127.0.0.1#33126 (smtp.mail.att.net): query (cache) 'smtp.mail.att.net/A/IN' denied
    Oct 20 14:21:10 peeves.fedtrek.com named[15534]: client @0x7f86540dace0 127.0.0.1#59252 (smtp.mail.att.net): query (cache) 'smtp.mail.att.net/A/IN' denied
    Oct 20 14:21:10 peeves.fedtrek.com named[15534]: client @0x7f86540dace0 127.0.0.1#37471 (smtp.mail.att.net): query (cache) 'smtp.mail.att.net/A/IN' denied
    Oct 20 14:21:10 peeves.fedtrek.com named[15534]: client @0x7f86540b2be0 127.0.0.1#54165 (smtp.mail.att.net): query (cache) 'smtp.mail.att.net/A/IN' denied
    Oct 20 14:21:10 peeves.fedtrek.com named[15534]: client @0x7f86540dace0 127.0.0.1#36003 (smtp.mail.att.net): query (cache) 'smtp.mail.att.net/A/IN' denied
    Oct 20 14:21:10 peeves.fedtrek.com named[15534]: client @0x7f86540cc550 127.0.0.1#37914 (smtp.mail.att.net): query (cache) 'smtp.mail.att.net/A/IN' denied
    Oct 20 14:21:17 peeves.fedtrek.com named[15534]: client @0x7f86540b2be0 127.0.0.1#57262 (smtp.mail.att.net): query (cache) 'smtp.mail.att.net/A/IN' denied
    Oct 20 14:21:17 peeves.fedtrek.com named[15534]: client @0x7f86540cc550 127.0.0.1#49018 (smtp.mail.att.net): query (cache) 'smtp.mail.att.net/A/IN' denied
    Oct 20 14:21:17 peeves.fedtrek.com named[15534]: client @0x7f86540cc550 127.0.0.1#43921 (smtp.mail.att.net): query (cache) 'smtp.mail.att.net/A/IN' denied
    Oct 20 14:21:17 peeves.fedtrek.com named[15534]: client @0x7f86540cc550 127.0.0.1#36204 (smtp.mail.att.net): query (cache) 'smtp.mail.att.net/A/IN' denied
    Code:
    # Generated by NetworkManager
    search fedtrek.com
    nameserver 192.168.0.1
    Code:
    [[email protected] postfix]# host smtp.mail.att.net
    smtp.mail.att.net is an alias for smtp-att.mail.yahoo.com.
    smtp-att.mail.yahoo.com is an alias for smtp.att.mail.fy4.b.yahoo.com.
    smtp.att.mail.fy4.b.yahoo.com has address 98.136.96.82
    smtp.att.mail.fy4.b.yahoo.com has address 67.195.228.97
     
  6. Steini86

    Steini86 Active Member

    Your problem seems to be with bind, not with postfix. I have no experience with bind, but have you enabled recursion in your config?
    Is that your PCs IP, or the one of another DNS server?
     

Share This Page