Impostazione della configurazione di Postfix

Impostare e convalidare la configurazione di Postfix.

Informazioni su questa attività

Impostare un'e-mail sul docker NPS.

Nota: per le versioni 11.0.7.0 e successive, saltare i passaggi da 1 a 5.

Procedura

  1. Come 'root, verificare se Postfix è installato nel contenitore docker:
    systemctl status postfix
  2. Come 'root, cambiare la porta di Postfix 'smtp in '51025 all'interno del contenitore docker:
    sed -i -e '/^smtp.*inet.*smtpd/s/^smtp/51025/' /etc/postfix/master.cf
  3. Come 'root, abilitare Postfix all'interno del contenitore docker:
    systemctl enable postfix
  4. Come 'root, copiare il file 'master.cf di Postfix modificato nei contenitori su altri nodi del piano di controllo:
    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. Come 'root, avviare Postfix all'interno del contenitore docker:
    systemctl start postfix
  6. Eseguite il comando 'mailx per verificare se potete inviare un'e-mail:
    (ex:echo "Hi" | mailx -s "Just Postfix" "destination e-mail ID"
  7. Eseguire 'mailq per verificare se le e-mail sono bloccate in coda.
  8. Controllare se l'email è in '/var/log/maillog.
    Cercare l'errore:
    (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. Aggiungere un 'relayhost a '/etc/postfix/main.cf.
    Esempio:
    #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 =