Administrator's Guide - Kerio Software Archive

Administrator's Guide - Kerio Software Archive Administrator's Guide - Kerio Software Archive

download.kerio.com
from download.kerio.com More from this publisher
11.07.2015 Views

Chapter 15Sending and Receiving Mail15.1 Mail Delivery over the InternetUnderstanding the basic principles of mail delivery over the Internet will help you correctlyset your mailserver. This chapter gives a brief overview of the most important information onthis topic. Experienced network administrators can skip this chapter. JMX RecordsAppropriate records must be entered into the DNS (DNS is a world-wide distributed databaseof domain names) for each Internet domain. One of these records is called a MX record (MaileXchanger or the mailserver). An MX record for the domain company.com might look like this:company.com MX 10 mail.company.comMX 20 smtp.provider.commail.company.com A 215.75.128.33smtp.provider.com A 215.75.128.1These records indicate that the mailserver with a preference of 10 is a computernamed mail.company.com and the server with a preference of 20 is a computer namedsmtp.isp.com. Preference means value of the server. The lower the preference the higherthe priority of that server — this implies that the server mail.company.com is the highestpriority mail server for the domain company.com and the server smtp.isp.com is the secondhighest priority mail server for the domain. Arbitrary number of MX records can be definedfor the given domain. If two or more records have the same priority, then one of these serversis chosen randomly (load balancing).The other two records are A type (Address). These tell us which IP address is assigned toa given computer (a MX record can only be assigned to a DNS name, but not an IP address).Email DeliveryHow does an email travel from the sender to the addressee?The sender’s mail client sends the email to its SMTP server. The server checks the recipient’saddress and if the domain contained within the address is qualified as local the email is saveddirectly into the appropriate mailbox. If the domain is not local, the SMTP server finds thename of the primary mailserver (SMTP) for the target domain from the DNS (by sending a DNSrequest) and sends the email to this server. This saves it to a mailbox from which the recipientdownloads it using his/her email client.136

15.1 Mail Delivery over the InternetIf the primary mailserver for the target domain is not accessible, the sending SMTP server triesto contact the secondary server (the server with the next priority) and send the email there. Ifno server listed in the MX record for the target domain is accessible the SMTP server will try tosend the mail again repeatedly in defined intervals. If it does not succeed after a certain timethe email is returned to the sender as undeliverable.If, for example, only the secondary server is accessible the email is sent to this secondaryserver. In principle, any SMTP server can function as a secondary (tertiary, etc.) server fora domain.Sending Email via a Different SMTP Server (Relaying)There is also another way email can be delivered to addressees. The client sends the emailmessage to its SMTP server. This server forwards it to another SMTP server which delivers itto the target domain as described above. This method of delivering email is known as relaying(passing to the relay server).The advantage of this relaying is that sending email is an on-off action. Furthermore, emailcan be placed in a queue and sent in defined time intervals. The sending SMTP server doesnot need to ask the DNS about the target domains’ mailservers or try to send the email againif the target servers are inaccessible. This is important mainly for slow or dial-up Internetconnections and it can significantly decrease costs of such connections.Most SMTP servers on the Internet are protected against relaying to prevent misuse of serversfor sending spam email. If you wish to send email via a different SMTP server, you shouldcontact the server’s administrator and ask them that relaying be enabled for you (usuallybased on checking your IP address or using username/password authentication).ETRN CommandETRN is a command of SMTP protocol. It serves for requesting emails stored on another SMTPserver. Typically, it is used in the following situations:1. The client has its own domain (e.g. company.com) and his server is connected to theInternet via a dial-up line. Dial-up must have a fixed IP address. The primary MX recordfor the domain company.com is directed to the ISP’s SMTP server (e.g. smtp.isp.com).When it is connected to the Internet, the client’s SMTP server sends an ETRN commandthat informs that it is online and ready to receive mail. If the primary server has someemails for the given domain, then it sends them. If not, it can send a negative responseor it need not reply at all. That’s why the client’s server must have the timeout to specifyhow long it will wait for the response from the primary server.Note: The primary server will create a new connection to the client’s server after the ETRNcommand reception. This connection is used for mail transmission. If the client’s serveris protected by firewall, TCP port 25 must be accessible (open) to the Internet.2. Let’s suppose that the domain company.com has a primary server smtp.company.com anda secondary server smtp2.company.com. Both servers are permanently connected to the137

Chapter 15Sending and Receiving Mail15.1 Mail Delivery over the InternetUnderstanding the basic principles of mail delivery over the Internet will help you correctlyset your mailserver. This chapter gives a brief overview of the most important information onthis topic. Experienced network administrators can skip this chapter. JMX RecordsAppropriate records must be entered into the DNS (DNS is a world-wide distributed databaseof domain names) for each Internet domain. One of these records is called a MX record (MaileXchanger or the mailserver). An MX record for the domain company.com might look like this:company.com MX 10 mail.company.comMX 20 smtp.provider.commail.company.com A 215.75.128.33smtp.provider.com A 215.75.128.1These records indicate that the mailserver with a preference of 10 is a computernamed mail.company.com and the server with a preference of 20 is a computer namedsmtp.isp.com. Preference means value of the server. The lower the preference the higherthe priority of that server — this implies that the server mail.company.com is the highestpriority mail server for the domain company.com and the server smtp.isp.com is the secondhighest priority mail server for the domain. Arbitrary number of MX records can be definedfor the given domain. If two or more records have the same priority, then one of these serversis chosen randomly (load balancing).The other two records are A type (Address). These tell us which IP address is assigned toa given computer (a MX record can only be assigned to a DNS name, but not an IP address).Email DeliveryHow does an email travel from the sender to the addressee?The sender’s mail client sends the email to its SMTP server. The server checks the recipient’saddress and if the domain contained within the address is qualified as local the email is saveddirectly into the appropriate mailbox. If the domain is not local, the SMTP server finds thename of the primary mailserver (SMTP) for the target domain from the DNS (by sending a DNSrequest) and sends the email to this server. This saves it to a mailbox from which the recipientdownloads it using his/her email client.136

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!