lwc:linux:postfix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
lwc:linux:postfix [2021/09/25 10:17] – created John Harrisonlwc:linux:postfix [2021/11/11 05:59] (current) John Harrison
Line 11: Line 11:
 sudo postconf -e 'smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt' sudo postconf -e 'smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt'
 sudo cp /etc/resolv.conf /var/spool/postfix/etc/resolv.conf # getting hostname unresolved without this. A bug in 14.04 that remains? sudo cp /etc/resolv.conf /var/spool/postfix/etc/resolv.conf # getting hostname unresolved without this. A bug in 14.04 that remains?
-sed -e '0/^smtp/s/^/#/' -i /etc/postfix/master.cf # shut down smtp incoming +sudo sh -c 'echo inet_interfaces = loopback-only >> /etc/postfix/main.cf' # smtp accepted but only internally
-sudo sh -c 'echo inet_interfaces = loopback-only >> /etc/postfix/main.cf' # smtp accepted only internally (redundant?)+
 sudo postfix stop; sudo postfix start; sudo postfix reload sudo postfix stop; sudo postfix start; sudo postfix reload
 </code> </code>
Line 25: Line 24:
 sudo postfix stop; sudo postfix start; sudo postfix reload sudo postfix stop; sudo postfix start; sudo postfix reload
 </code> </code>
 +=== Remap root@localhost to another to address ===
 +  * add ''root:        <EMAILADDR>'' to ''/etc/aliases''
 +  * ''sudo newaliases''
 === test === === test ===
 +Test with sendmail:
 <code> <code>
 sendmail -f sender@example.com recipient@example.com # -f allows you to specify from and is not required sendmail -f sender@example.com recipient@example.com # -f allows you to specify from and is not required
Line 33: Line 36:
 . .
 </code> </code>
 +or [[https://www.thomas-krenn.com/en/wiki/Test_TCP_Port_25_(smtp)_access_with_telnet|test with telnet]]
 === Tips === === Tips ===
   * postfix should be set up with no configuration. When you do this, there are instructions given at the end to copy some sort of sample configuration.   * postfix should be set up with no configuration. When you do this, there are instructions given at the end to copy some sort of sample configuration.
Line 38: Line 42:
   * to reload the settings: ''sudo postfix stop; sudo postfix start; sudo postfix reload''   * to reload the settings: ''sudo postfix stop; sudo postfix start; sudo postfix reload''
   * when testing ''tail -f /var/log/mail.log'' is your friend   * when testing ''tail -f /var/log/mail.log'' is your friend
 +  * view queued mail: ''postqueue -p''
 +  * flush queued mail: ''postqueue -f''
 +  * purge all queued mail: ''sudo postsuper -d ALL''
 ==== Optional ==== ==== Optional ====
   * get current hostname: ''hostname''   * get current hostname: ''hostname''
   * set hostname with ''hostnamectl set-hostname <HOSTNAME>''   * set hostname with ''hostnamectl set-hostname <HOSTNAME>''
  
  • lwc/linux/postfix.1632583070.txt.gz
  • Last modified: 2021/09/25 10:17
  • by John Harrison