Mail server

From CNM Wiki
Revision as of 05:36, 21 June 2019 by Gary (talk | contribs) (Locations)
Jump to: navigation, search

A mail server (hereinafter, the Server) is any software instance that transfers electronic mail messages from or to other Servers most commonly using the Simple Mail Transfer Protocol (SMTP) or its modifications. The Servers may also take the messages from sender's mail user agents (MUAs) and deliver those to recipient's MUAs, usually, using POP3 and/or IMAP protocols.

The Server can also refer to mail server software. More broadly, email software refers to all the software utilized for both the Server and MUAs.


Features

Functions

The Server may be one or more of the following:
  1. Mail submission agent (also known as outgoing mail server, message submission agent or by its acronym MSA), which is a computer application used to accept, analyze, correct, and send emails that end-users enter into their MUAs;
  2. Mail transfer agent (also known as message transfer agent or by its acronym MTA), which is a computer application used to transfer emails between computers;
  3. Mail exchanger (also known as mail relay, message exchanger or MX, and MX host), which is a computer application that locates DNS records such as MX records and use those in order to route emails;
  4. Mail delivery agent (also known as incoming mail server, message delivery agent or by its acronym MDA), which is a computer application used to deliver an email to its recipient's MUA.

Process model

The following model illustrates the process of electronic mail message transfer:
  1. A common sender enters some electronic mail message to his or her MUA;
  2. The MUA transfers the message to a mail submission agent;
  3. The mail submission agent transfers the message to a mail exchanger;
  4. The mail exchanger finds the location of recipient's mail delivery agent in order to transfer the message to this agent directly or through those mail exchangers that communicate with the recipient's mail delivery agent;
  5. The mail delivery agent transfers the message to receiver's MUA or MUAs;
  6. The recipient now is able to read the message and send the response.

Locations

Depending on their functionality, the Servers are hosted in two types of locations:

Records

Main wikipage: DNS record

Several DNS records are used to both evaluate sent mail and map mail transfers.

A record

Main wikipage: A record
Mail exchangers look for A records to locate the IPv4 address of the recipient's host device. An example of this record is

mail.friendsofcnm.org. IN A 134.209.40.232

MX record

Main wikipage: MX record
Any MX record is the DNS record that identifies the server that handles email address for the hostname. MX is an abbreviation for mail exchanger.
Each MX record contains three pieces of information: the hostname, the priority, and the hostname of the mail server that handles mail for the host device. The sample of the MX record is as follows: friendsofcnm.org IN MX 10 friendsofcnm.org, where:
Sample code Field Description Values
friendsofcnm.org Labels One or more labels of the hostname and TLD name. Selected
IN Class The Internet or intranet; other options are all outdated. IN
MX Record MX stands for MX record and sets up the relationship between hostname labels and IP address Stable
10 Priority A numerical value that signifies the priority of this particular MX record and, consequently, for the mail server. The values used for this are only important if more than one mail server is used. The lower the value of the priority field, the higher the priority of the mail server. Assigned
mail.friendsofcnm.org Mail server hostname The hostname of the mail server that handles email for this domain. This hostname is a google address when Google Apps handle emails for this host device. Any mail server hostname should have a validly configured A record in order to receive emails smoothly. Assigned

TXT record

Main wikipage: TXT record
Any TXT record is a DNS record that allows for storage of human-readable and machine-readable texts that, if posted, would be assigned to a specific hostname.
With regard to machine-readable texts, TXT records may serve multiple purposes, including:
  • Sender policy framework (SPF) data storage. This data confirms the actual systems that are authorized to send mail on behalf of the given hostname. This is useful in the prevention of spam emails being sent with a forged sender address originating from the particular host device. RFC 4408 discourages this practice as "not optimal," however, because SPF now has its own DNS resource record type (code 99);
  • DomainKeys Identified Mail (DKIM) data. This data allows a receiving mail server to authenticate entities that have signed a specific email message. DKIM is similar to SPF in that it can help reduce spam email from containing forged email addresses originating from your domain, but it also contains a large amount of additional functionality.
Main wikipage: A record
Mail exchangers look for A records to locate the IPv4 address of the recipient's host device. An example of this record is

mail.friendsofcnm.org. 134.209.40.232

Setting up the MX record

c7Apht1[1]

(There is a ‘dot’ after the domain name) Setting up the SPF record

We create a new TXT record

"v=spf1 a mx ip4:1.2.3.4 -all"

cyFoSjh[1]

The SPF record protects from email spoofing. It will simply tell other mail servers that only our server is authorized to send emails for yourdomain.com (more aboutSPF). Setting up the DMARC record

We create a new TXT record named _dmarc.yourdomain.com. (There is a ‘dot’ after the domain name)

"v=DMARC1; p=quarantine; rua=mailto:postmaster@yourdomain.com"

Now we will setup the hostname for the PTR record

Gg6s1vv Our configuration should look similar to this

o1BA9Fy

It will take a while to propagate the new configuration throughout the entire internet.

PTR record

Main wikipage: PTR record
Any PTR record is a DNS record that translates a hostname into an IP address. PTR is an abbreviation for pointer; PTR records point to IP addresses. In comparison with A records, PTR records perform the exact opposite function.
PTR records use the following format: <IP address in a reverse order>.in-addr.arpa PTR <hostname>. For instance, 1.93.89.159.in-addr.apra PTR friendsofcnm.org, where:
Sample code Field Description Values
1.93.89.159 Reversed IP address The IP address of the location that the resulting hostname points to in a reverse order. The actual IP address used in this example is 159.89.93.1 Assigned
.in-addr.arpa Domain The domain name that historically arrived from the times when the Internet was called Arpa. In-addr is an abbreviation for internet address. No other options
PTR Record PTR stands for PTR record and sets up the relationship between IP address and hostname. Stable
friendsofcnm.org Hostname The hostname that points to the IP address. Selected
PTR records are needed for outgoing mail servers such as Postfix, because most of the mail providers reject or mark as spam messages received by mail servers without valid reverse dns configuration such as a missing PTR record or mismatch with an A record for the hostname.

Best practices