Setting up Postfix configuration

Set up and validate Postfix configuration.

About this task

Set up an email on the NPS docker.

Note: For versions 11.0.7.0 and newer, skip steps 1 through 5.

Procedure

  1. As root, check if Postfix is installed inside the docker container:
    systemctl status postfix
  2. As root, change the Postfix smtp port to 51025 inside the docker container:
    sed -i -e '/^smtp.*inet.*smtpd/s/^smtp/51025/' /etc/postfix/master.cf
  3. As root, enable Postfix inside the docker container:
    systemctl enable postfix
  4. As root, copy the modified Postfix master.cf file to the containers on other control plane nodes:
    docker cp ipshost1:/etc/postfix/master.cf /tmp
    for dev in node2 node3; do scp /tmp/master.cf $dev:/tmp; ssh $dev "docker cp /tmp/master.cf ipshost1:/etc/postfix/master.cf"; done
  5. As root, start Postfix inside the docker container:
    systemctl start postfix
  6. Run the mailx command to check if you can send an email:
    (ex:echo "Hi" | mailx -s "Just Postfix" "destination e-mail ID"
  7. Run mailq to check if the emails are stuck in queue.
  8. Check if the email is in /var/log/maillog.
    Look for the error:
    (Sep 27 06:38:39 vt-nps01 postfix/error[405759]: C74C02800637A: to=example@us.ibm.com, relay=none, 
    delay=0.01, delays=0/0/0/0, dsn=4.4.3, status=deferred (delivery temporarily suspended: 
    Host or domain name not found. Name service error for name=us.ibm.com type=MX: Host not found, try again)
  9. Add a relayhost to /etc/postfix/main.cf.
    Example:
    #relayhost = $mydomain #relayhost = [gateway.my.domain] #relayhost = [mailserver.isp.tld] 
    #relayhost = uucphost #relayhost = [an.ip.add.ress] Add the relayhost entry as follows: 
    #relayhost = $mydomain #relayhost = [gateway.my.domain] #relayhost = [mailserver.isp.tld] 
    #relayhost = uucphost #relayhost = [an.ip.add.ress] relayhost =