Difference between revisions of "Postfix"

From Nuclear Physics Group Documentation Pages
Jump to navigationJump to search
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
Postfix is a mail transfer agent that routes and delivers e-mail.
 
Postfix is a mail transfer agent that routes and delivers e-mail.
  
 +
= Diagnosis =
 +
 +
What you can do to check if postfix is working.
 +
* Send yourself a message from a Gmail account.
 +
* Mtools: https://mxtoolbox.com/SuperTool.aspx?action=smtp%3aeinstein.unh.edu&run=toolpage#
 +
* Ultra Tools: https://www.ultratools.com/tools/emailTest
 +
* Check the Blacklists: https://mxtoolbox.com/blacklists.aspx or http://mail-blacklist-checker.online-domain-tools.com
 +
* Try to telnet to einstein.unh.edu port 25.
 +
**  Note that this does not mean postfix is actually working properly, but if this doesn’t nothing else will.
 +
* Contact Bryan Scoville  <Bryan.Scovill@unh.edu> at UNH Telecom and ask to check the network connections.
 +
 +
 +
= Centos 7 Postfix =
 +
 +
We upgraded Einstein to Centos 7 and a newer version of postfix.
 +
 +
= Configuration Specifics =
 +
 +
To combat spam, we require any hosts that connect to postfix to have a resolvable DNS name. There is a specific exception to this rule for systems in the "client-access" list. This is needed for JLab, where you are not resolvable to outside systems.
 +
 +
In the /etc/postfix/main.cf file:
 +
  smtpd_client_restrictions = check_client_access hash:/etc/postfix/client_access, reject_unknown_reverse_client_hostname
 +
 +
the client_access file:
 +
  129.57.113.29    OK
 +
  129.57.    OK
 +
  bad.domain REJECT
 +
 +
= OUTDATED OLD POSTFIX =
 
== Configuration ==
 
== Configuration ==
 
Postfix stores its configuration files in the /etc/postfix/ directory. The following is a list of the more commonly used files:  
 
Postfix stores its configuration files in the /etc/postfix/ directory. The following is a list of the more commonly used files:  
  
; access : Used for access control, this file specifies which hosts are allowed to connect to Postfix.  
+
; access : Used for access control, this file specifies which hosts are allowed to connect to Postfix. '''Empty, except for comment documentation'''
; aliases : A configurable list required by the mail protocol.  
+
; aliases : A configurable list required by the mail protocol. '''Not present'''
; main.cf : The global Postfix configuration file. The majority of configuration options are specified in this file.  
+
; [[main.cf]] : The global Postfix configuration file. The majority of configuration options are specified in this file.
 
; master.cf : Specifies how Postfix interacts with various processes to accomplish mail delivery.  
 
; master.cf : Specifies how Postfix interacts with various processes to accomplish mail delivery.  
; transport : Maps email addresses to relay hosts.
+
; transport : Maps email addresses to relay hosts. '''Has one significant line: <code>xemed.com smtp:gm.xemed.com</code>'''
  
 
=== Basic Postfix Configuration ===
 
=== Basic Postfix Configuration ===
<font style="color: red;">Make sure that you use the <code>system-switch-mail</code> or <code>system-switch-mail-gnome</code> program to select Postfix as the default MTA.</font>
+
<font style="color: red;">Make sure that you use the <code>system-switch-mail</code> or <code>system-switch-mail-gnome</code> program to select Postfix as the default MTA. If you don't, you'll thrash the mail system and lose mail!</font>
 +
 
 +
[http://www.postfix.org/BASIC_CONFIGURATION_README.html README]
 +
 
 +
=== Standard Postfix Configuration ===
 +
Slightly more advanced configuration:
 +
[http://www.postfix.org/STANDARD_CONFIGURATION_README.html README]
  
By default, Postfix does not accept network connections from any host other than the local host. Perform the following steps as root to enable mail delivery for other hosts on the network:  
+
From RedHat: <blockquote>By default, Postfix does not accept network connections from any host other than the local host. Perform the following steps as root to enable mail delivery for other hosts on the network:  
  
 
# Edit the /etc/postfix/main.cf file with a text editor, such as vi.  
 
# Edit the /etc/postfix/main.cf file with a text editor, such as vi.  
Line 25: Line 60:
  
 
Once these steps are complete, the host accepts outside emails for delivery.
 
Once these steps are complete, the host accepts outside emails for delivery.
 +
</blockquote>
 +
However, much of this is actually unnecessary since Postfix has intellegent defaults (e.g. it can figure out the machine's hostname automatically). Follow the Postfix readme instead.
 +
 +
=== Database Configuration ===
 +
Setting up Postfix to cooperate with LDAP:
 +
[http://www.postfix.org/DATABASE_README.html README]
 +
 +
[http://www.postfix.org/ldap_table.5.html ldap_table]
  
 
==[http://www.postfix.org/OVERVIEW.html Postfix Architecture Overview]==
 
==[http://www.postfix.org/OVERVIEW.html Postfix Architecture Overview]==

Latest revision as of 16:38, 13 November 2018

Postfix is a mail transfer agent that routes and delivers e-mail.

Diagnosis

What you can do to check if postfix is working.


Centos 7 Postfix

We upgraded Einstein to Centos 7 and a newer version of postfix.

Configuration Specifics

To combat spam, we require any hosts that connect to postfix to have a resolvable DNS name. There is a specific exception to this rule for systems in the "client-access" list. This is needed for JLab, where you are not resolvable to outside systems.

In the /etc/postfix/main.cf file:

 smtpd_client_restrictions = check_client_access hash:/etc/postfix/client_access, reject_unknown_reverse_client_hostname

the client_access file:

  129.57.113.29    OK
  129.57.    OK
  bad.domain REJECT

OUTDATED OLD POSTFIX

Configuration

Postfix stores its configuration files in the /etc/postfix/ directory. The following is a list of the more commonly used files:

access
Used for access control, this file specifies which hosts are allowed to connect to Postfix. Empty, except for comment documentation
aliases
A configurable list required by the mail protocol. Not present
main.cf
The global Postfix configuration file. The majority of configuration options are specified in this file.
master.cf
Specifies how Postfix interacts with various processes to accomplish mail delivery.
transport
Maps email addresses to relay hosts. Has one significant line: xemed.com smtp:gm.xemed.com

Basic Postfix Configuration

Make sure that you use the system-switch-mail or system-switch-mail-gnome program to select Postfix as the default MTA. If you don't, you'll thrash the mail system and lose mail!

README

Standard Postfix Configuration

Slightly more advanced configuration: README

From RedHat:

By default, Postfix does not accept network connections from any host other than the local host. Perform the following steps as root to enable mail delivery for other hosts on the network:

  1. Edit the /etc/postfix/main.cf file with a text editor, such as vi.
  2. Uncomment the mydomain line by removing the hash mark (#), and replace domain.tld with the domain the mail server is servicing, such as example.com.
  3. Uncomment the myorigin = $mydomain line.
  4. Uncomment the myhostname line, and replace host.domain.tld with the hostname for the machine.
  5. Uncomment the mydestination = $myhostname, localhost.$mydomain line.
  6. Uncomment the mynetworks line, and replace 168.100.189.0/28 with a valid network setting for hosts that can connect to the server.
  7. Uncomment the inet_interfaces = all line.
  8. Restart the postfix service.

Once these steps are complete, the host accepts outside emails for delivery.

However, much of this is actually unnecessary since Postfix has intellegent defaults (e.g. it can figure out the machine's hostname automatically). Follow the Postfix readme instead.

Database Configuration

Setting up Postfix to cooperate with LDAP: README

ldap_table

Postfix Architecture Overview

How Postfix recieves mail

Postfix-get.png

We use smtpd. Yes, our "sendmail" isn't the real thing, but rather a Postfix component.

How Postfix delivers mail

Postfix-send.png

External Information