linux_wiki:configure_a_system_to_forward_all_email_to_a_central_mail_server

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:configure_a_system_to_forward_all_email_to_a_central_mail_server [2018/04/17 23:32]
billdozor [Null Client Setup]
linux_wiki:configure_a_system_to_forward_all_email_to_a_central_mail_server [2019/05/25 23:50] (current)
Line 40: Line 40:
 \\ \\
 Configure postfix parameters Configure postfix parameters
 +  * Option A: Use postconf (faster if you have an idea what parameters you need to configure)<code bash># check a setting
 +postconf relayhost
  
-  * Option A: Edit the main configuration<code bash>vim /etc/postfix/main.cf+# check all settings 
 +postconf | grep <keyword> 
 + 
 +# configure - important 
 +postconf -e 'relayhost = [192.168.1.151]' 
 + 
 +# configure - probably already defaults (or set to localhost) 
 +postconf -e 'inet_interfaces = loopback-only' 
 +postconf -e 'mydestination =' 
 +postconf -e 'mydomain = example.com' 
 +</code> 
 +  * Option B: Edit the main configuration<code bash>vim /etc/postfix/main.cf
  
 # Relayhost to forward mail to # Relayhost to forward mail to
Line 55: Line 68:
 mydomain = example.com mydomain = example.com
 </code> </code>
-  * Option B: Use postconf<code bash># check a setting 
-postconf relayhost 
  
-# check all settings 
-postconf | grep <keyword> 
- 
-# configure 
-postconf -e 'relayhost = [192.168.1.151]' 
-postconf -e 'inet_interfaces = loopback-only' 
-postconf -e 'mydestination =' 
-postconf -e 'mydomain = example.com' 
-</code> 
  
 \\ \\
Line 114: Line 116:
 vim /etc/postfix/main.cf vim /etc/postfix/main.cf
  
 +# listening interfaces
 inet_interfaces = all inet_interfaces = all
 +
 +# Accept mail for these domains
 mydestination = example.com, server2.example.com, server2 mydestination = example.com, server2.example.com, server2
  
Line 144: Line 149:
 ====== Null Client Testing ====== ====== Null Client Testing ======
  
-**From server1**.+**From server1**
  
 Install a mail client (if not already installed) Install a mail client (if not already installed)
Line 154: Line 159:
 Send a test message Send a test message
 <code bash> <code bash>
-echo "This is the subject body" | mail -s "This is a postfix forward test" root@server2.example.com+echo "Did it work?" | mail -s "This is a postfix forward test" root@server2.example.com
 </code> </code>
  
Line 161: Line 166:
 <code bash> <code bash>
 tail -f /var/log/maillog tail -f /var/log/maillog
 +</code>
 +
 +\\
 +**From server2**
 +
 +On the postfix relayhost, check root's mail
 +<code bash>
 +mail
 </code> </code>
  
  • linux_wiki/configure_a_system_to_forward_all_email_to_a_central_mail_server.1524022332.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)