Connecting Systems Using E-mail

E-mail is the oldest and most popular application on the Internet. In fact, e-mail actually predates the Internet. Before ARPANET(the precursor to the Internet), companies had access to internal e-mail systems and various bulletin board–based systems such as Bitnet.

E-mail is a store-and-forward protocol, which means that when a message is sent, the sender no longer has any control over it. This makes it unsuitable for transactional applications in which the client sends a request and needs some sort of immediate confirmation that the request was processed. For less time-critical applications, however, e-mail can provide a simple and robust transport mechanism.

To send and receive e-mail, a system must have access to a mail server. Two popular protocols for sending and receiving e-mail are (respectively) the Simple Mail Transfer Protocol (SMTP) and Post Office Protocol 3 (POP3). Another widely used mail client protocol is the Internet Mail Access Protocol (IMAP). Before committing to a particular technology, it is important to determine which protocols are supported by the available corporate mail servers.

E-mailing XML documents is one of the slowest but most robust ways to connect two systems. Figure 8.1 shows how two back-office systems can communicate using e-mail to send and receive application messages.

Figure 8.1. The client application sends a “blind” message to the server application.


Mail servers are programmed to continue trying to send messages over a period of several days, making it an ideal transport for solutions where network reliability is not guaranteed.

See Chapter 14, “Offline Order Processing Using Store-and-Forward” project for an example of a system like this.

Compatibility

Any operating system and programming language that supports opening, reading, and writing a TCP/IP socket can support e-mail transfers. Modern programming languages such as Perl and Java have built-in classes for interfacing with mail servers. Even if no explicit SMTP or POP3 support is available, the protocol used to send e-mail is very simple and can be implemented rapidly.

Reliability

Mail servers are very resilient to changes in network topography, temporary network failures, and so on. The Domain Name Server (DNS) system is used to resolve e-mail addresses to physical hosts for e-mail delivery. In most cases, sent messages can be delivered to the target host within a few minutes.

All that is required is a public e-mail address for each system that wants to participate. In a one-way message exchange, the client machine need not even have a message inbox. The only complications that might arise are related to modern SMTP security features that are designed to prevent unauthorized users from forwarding mail (spam) through public mail servers.

Data Integrity

Although it is possible for the contents of e-mail messages to become corrupted, this is not a frequent occurrence. If absolute integrity is an issue, checksums and secure message digests should be considered to ensure that a message has not changed or been tampered with. Again, many freely available libraries exist for implementing modern encryption and message digest functions for popular programming languages.

Security

Unfortunately, Internet e-mail is not a particularly secure medium. A message might pass through several servers before arriving at its final destination. To ensure that sensitive data is protected, consider using a public-key encryption system to encrypt the data before sending it to the mail server.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.17.28