SMTP Module

  • Simple Mail Transfer Protocol (SMTP) and DNS
  • Configuring the SMTP module
  • Sending Messages via the Internet
  • Receiving Messages
  • Serving Dial-up Client Hosts
  • Simple Mail Transfer Protocol (SMTP) and DNS

    The CommuniGate Pro SMTP module implements E-mail message transfer using the SMTP and ESMTP Internet protocols via TCP/IP networks.

    The Simple Mail Transfer Protocol allows computers to transfer messages using network connections. A computer that has a message to send connects to the recipient's computer and establishes a network link. Then it sends one or several messages and closes the network connection.

    Mailer applications (such as Eudora®, Netscape® mailer, and many others) use the SMTP protocol to submit messages to the mail servers, and mail servers then forward the submitted messages to the recipients. All mailers have a setting called SMTP Host Address that specifies the network address of the mail server computer. Mailer applications open connections to that address when they have a message to submit.

    The mail servers use the global Domain Name System to find the network address of the recipient computer or the recipient mail server. Each domain (part of the E-mail address after the @ sign) should have a special so-called MX-record in the Domain Name System. That record specifies the name of the computer that actually receives mail for that domain. For example, MX records can specify that mail for the domain company.com should be sent to the computer mail.company.com, and mail to the domain enduser.com should be sent to the computer provider.com.

    There can be several MX-records for one domain (with different priority values). If one (high-priority or primary) computer cannot receive mail, mail is sent to lower-priority computers (called Back-up Mail Servers). Back-up mailer servers then try to deliver the message to the primary server.

    When the name of the recipient computer is retrieved from the DNS, the sending mail server consults the DNS again. Now it uses the DNS to convert the receiving mail server name into its network address. The so-called DNS A-records contain the pairs that link a computer name to its global Internet network (IP) address.

    When the network address of the recipient mail server is received from the DNS, the sending mail server opens an SMTP connection to that server and transfers the message(s). When all messages to that domain are transferred, the connection is closed.

    When a message contains several addresses within the same domain, the SMTP module can transfer only one copy of the message to the mail server serving that domain, and that server delivers messages to all recipients in that domain. But if there are too many addresses, the SMTP module can break them in several portions and send several copies, each containing only a portion of the address set.

    If there are several messages to one domain, the SMTP module can open several connections to the mail server serving that domain and send those messages simultaneously.

    If you want to receive messages from the Internet with your own mail server, you should register your domain name, and ask your provider to register that name with the Domain Name System. The DNS records should point on the computer running your mail server.


    Configuring the SMTP module

    To configure the SMTP module, use any Web browser to connect to the CommuniGate Pro Server, and open the SMTP section. To configure the SMTP module, you should have the Can Modify Settings access right.

    Log:

     

    Use the Log setting to specify what kind of information the SMTP module should put in the Server Log. Usually you should use the Major (message transfer reports) or Problems (message transfer and non-fatal errors) levels. But when you experience problems with the SMTP module, you may want to set the Log Level setting to Low-Level or All Info: in this case protocol-level or link-level details will be recorded in the System Log. When the problem is solved, set the Log Level setting to its regular value, otherwise your System Log files will grow in size very quickly.

    The SMTP module records in the System Log are marked with the SMTP tag for incoming connections, with the SMTPO tag for outgoing connections, and with SMTPW tag for connections used to wake up the back-up server.


    Sending Messages via the Internet

    If you want to send messages over the Internet, your server should have a TCP/IP link to the Internet. When a message should be transferred to some remote host, the SMTP module connects to that host via the TCP/IP network, and it transfers the message using the SMTP protocol .

    Sending Options

    Channels Limit: Retry Every:
    Send Directly Keep Trying for:
    Forward Forwarding Server:
    Channels/Host: Add Channel after:

    If you do not plan to use the Internet E-mail (a LAN-only, one-server configuration), set the number of Channels Limit to zero in the Sending Options field, and skip this Sending section.

    If you do plan to send messages over the Internet, specify a non-zero value for the Channels Limit setting in the Sending Options field. This setting limits the number of SMTP connections the module is allowed to open simultaneously.

    When sending messages over the Internet, the SMTP module can forward them to some other mail server, or it can deliver messages directly to the recipients, using the DNS MX-records to find the recipient hosts on the Internet.

    Use the Retry Every setting to tell the module when it should retry to send a message if a connection fails. If you use a foreign mail server, this option specifies when the module should retry to connect to that server if the previous connection failed for any reason. If you use the Directly to Recipients method, and a connection to some remote host (domain) fails, all messages directed to that domain will be suspended for the specified time. Usually SMTP systems suspend messages for 30 minutes.

    Sending via a Foreign Mail Server

    When the Forward option is selected, the SMTP module connects to the specified "foreign" mail host and sends all queued messages to that host. Since the foreign mail server host is usually "close" to your server, messages leave your system quickly. But this method can cause additional delays in message delivery, since messages are queued on the foreign server and those queues can be processed slowly. This method is recommended when your server is connected to the Internet using a slow link, or when you use a dial-up link and you want messages to leave your server as soon as possible to keep the connection time short.

    Select the Forward option and specify the name or the IP address of the "foreign" server. The SMTP module will forward all outgoing messages to that mail server for delivery.

    Note: the name of the "foreign mail server" should be the name of the real computer (as specified in an A-type DNS record), not a mail domain name. While your provider domain name can be provider.com, the name of the provider mail server can be something like mail.provider.com. Consult with your provider to get the exact name of their mail server.

    Note: when a recipient domain name is specified as an IP address, i.e. user@[12.34.56.78], the SMTP module delivers messages directly to the host with the IP address 12.34.56.78, even if the Forward option is selected. You may want to use this feature for message exchange between several mail servers on a LAN that does not have its own Domain Name Server.

    Sending Messages Directly to Recipients

    When the Directly option is selected, the SMTP module uses the DNS (Domain Name System) to convert message recipient addresses into the names and addresses of the receiving hosts. A receiving host can be the recipient host itself, or a relay host. The information about the proper relay host is stored in so-called MX records on Domain Name Servers. For each destination host several records can exist, each record having a priority value. If the SMTP module fails to connect to the relay host with the highest priority, other MX records are used and other relay hosts are tried. If no relay host is available, the message remains in the SMTP queue, and more attempts to deliver it (and all other messages to the same host) are made later.

    This method allows the system to deliver a message either directly to the recipient computer or to a relay host that is "very close" to the recipient computer. Recipients can read your messages almost immediately, and your messaging system does not rely on any "foreign mail server" performance.

    Use the Keep Trying setting to limit the number of attempts to deliver a message. If a message cannot be delivered within the specified period of time, the message is rejected and an error report saying that the host is unavailable is sent back to the message sender.

    Multi-channel Delivery

    When the Server queue contains several messages to be directed to the same domain, the SMTP module opens a connection to that domain mail server and sends messages one by one. If the established connection is slow and there is a large message in the Queue, other messages would wait too long before being delivered. You may want to allow the SMTP module to open additional connections to the same mail server and send other messages in parallel.

    Use the Channels/Host setting to limit the number of TCP connection the SMTP module is allowed to establish with one domain mail server. Use the Add Channel after setting to specify the "reasonable wait" time period.

    Additional connections to a domain mail server are opened if:


    Receiving Messages

    The SMTP protocol is used to receive messages from the Internet and from the client mailer applications. If you want to receive messages from the Internet, you need a TCP/IP link to the Internet, and your server domain name and the IP address should be included into the DNS records.

    Receiving Options

    Channels Limit: Message Size Limit:
    Wakeup Backup Server Relay for Clients Only
    Every: Verify Return Paths

    When you specify a non-zero value for the Channels Limit setting, the SMTP module creates a so-called "listener". The module starts to accept all SMTP connections that other mail servers establish in order to send mail to your Server. This setting is used to limit the number of simultaneous connections the SMTP module can accept. If there are too many incoming connections open, the module will reject new connections, and sending mail systems will retry later.

    The Message Size Limit option allows you to reject all messages that are larger than the specified limit.

    See the Anti-Spam chapter for the information about the Relay for Clients Only and the Verify Return-Path options.

    Waking up the Backup Server

    If your Server has a dial-up link, its domain should have at least one additional DNS MX record, specifying a "back-up" mail server (usually, your ISP mail server). When your Server is off-line, all messages directed to your domain(s) are sent to that back-up mail server.

    The back-up mail server tries to deliver collected messages to your server. Usually, the retry period is 30 minutes, so your system should stay on-line for at least that period of time in order to receive messages from the back-up server.

    To avoid this delay, the SMTP module can be configured to send the Remote Queue Starting ("ETRN") command to the back-up server. When the back-up server receives that command, it immediately starts to send the collected messages to your Server.

    Select the Wakeup Back-up Server option and enter the name of that server in the text field. Use the Every option to specify how often the Remote Queue Starting command should be sent.

    Note: the name of the back-up server should be the name of the real computer (as specified in an A-type DNS record), not a mail domain name. While your provider domain name can be provider.com, the name of the provider mail server can be something like mail.provider.com. Consult with your provider to get the exact name of your back-up server, or just examine the DNS MX records for your domain: your back-up server is specified with an MX record that has the priority next to your own Server name priority.


    Serving Dial-up Client Hosts

    The CommuniGate Pro Server can be used as a back-up mail server for dial-up systems. Dial-up systems receiving mail via SMTP expect their back-up servers to receive and keep all their messages when they are off-line. When a dial-up system connects to the Internet again, it connects to its back-up mail servers and issues the special Remote Queue Starting command (ETRN, RFC1985).

    When the back-up server receives the ETRN command, it tries to send all the messages collected for the host specified as the command parameter. This method allows the dial-up system to get its messages immediately, instead of waiting for the back-up server to make the next attempt to deliver the collected messages.

    The SMTP module supports the ETRN command, so it can be used as a back-up mail server. No special setting is required, this feature is always enabled.