Welcome to CASI Software - Innovations in Mainframe Information Delivery
Skip Navigation Links

EMS - SMTP Gateway and POP3 Server


With the addition of the SMTP/POP3 gateway for EMS, EMS customers are able to, for the first time, connect directly or indirectly to the internet or an intranet, and exchange mail with other SMTP compliant mail systems. This includes UNIX systems as well as Microsoft Exchange Server and Lotus Notes Server. It also allows for POP3 based clients such as Microsoft’s Outlook or Outlook Express, or Netscape’s Navigator, or Qualcomm’s Eudora, to name a few, to use EMS as their mail server either over the internet, or within a company’s internal intranet.

The headaches that used to accompany attempts to communicate between other companies are no longer there. No more address translations as mail is passed from gateway to gateway and through value added networks, just to get from point A to point B. All that is needed are simple internet SMTP addresses.

No more forcing your company employees that do not use other 3270 applications to use a 3270 interface for their mail system, or, worse yet, to manage multiple mail systems just so they can have GUI based software on their workstations. Now EMS can service both your 3270 users and your GUI users. And, best of all, you’re not stuck with a proprietary mail system for your users to learn. As mentioned, any software product that supports POP3 mail exchange is able to connect to EMS as its mail server.


Overview of SMTP

SMTP, Simple Mail Transfer Protocol, is a standard for electronic mail interchange. The standard was developed and set by the developers of the internet. SMTP was developed predominately on UNIX; however, it has become a widely supported cross platform standard for mail exchange. SMTP is considered a part of the suite of standard applications or services included in a full function TCP/IP software system (often called the "Stack"). Some other features are FTP (File Transfer Protocol) and HTTP, which is the basis for Web Browsers.

The standard SMTP facility supplied with IBM's TCP/IP stack allows TSO users to send and receive mail, and uses JES as a repository for inbound and outbound messages. EMS's SMTP gateway replaces the IBM SMTP process with a process that runs under CICS. Inbound and outbound messages are kept in VSAM files and delivered to either EMS users with 3270 interfaces or POP3 clients, such as MS Exchange, Netscape or Eudora.

SMTP was defined to only carry ASCII text. However, it has been supplemented by the MIME standard that supports the encoding of attached binary files. Since an SMTP message may pass through many machines before final delivery, a method called BASE64 encoding is used to transform a binary file into an all text file using an algorithm that only uses characters supported by all computers.

Email addresses in SMTP are based around a two part address: the "local part", usually a user ID or name, and the "domain part" separated by an "at" (@) sign . For example: "bobl@casisoft.com". In the world of the internet, the domain names are registered with the internet Network Information Center (INTER-NIC). An EMS user can address a message inline, on the fly, or with a redefined EMS shadow profile. For on the fly addressing, a message could begin with "/TO /SMTP bobl@casisoft.com". If SMTP has been defined as the "default" external gateway, the message author only needs "/TO bobl@casisoft.com" and EMS will know that the message is for the SMTP gateway.

SMTP addresses can also be kept with the personal nicknames, on the master name directory, or in an EMS profile that is explicitly set up as an SMTP destination.

When messages are received from an SMTP source, EMS keeps the full return address and the user can amend and reply directly to the message without having to rekey the address.

Overview of POP3

Whereas SMTP is sometimes called a "Push" protocol--it pushes the message to its next destination and assumes that a user at the destination will "signon" and read their mail directly-- POP3 is a "Pull" protocol, in that the user's mail client pulls down the message to their work station. In other words, a POP3 client will signon to your mailbox, download all of your unread mail, and disconnect, allowing you to work offline on your PC. POP3 is a protocol defined in the internet standards, and as such has been implemented on many platforms. EMS's POP3 server facility allows POP3 clients to pick up their mail from EMS without ever seeing a mainframe (3270) screen image. When the POP3 client/user composes messages to send, the client agent connects to the SMTP gateway of EMS and accepts and then sends their mail.

EMS's POP3 server also supports MIME (binary) attachments, and will even download attached EMS reports.

EMS has tested the POP3 interface with Microsoft's mail exchange client, which is bundled with Windows 95 and NT, Netscape Navigator, Eudora Mail Pro, and Z-Mail Pro from Net Manage. When moving a message with an attachment across EMS, we even keep the original filename and suffix, so the receiver of the attached "spread sheet" (or whatever) can simply click on "attachment" and launch the appropriate application.

With the SMTP gateway and POP3 server, EMS becomes a super size email server with all of the reliability and scale-ability of the mainframe. Instead of a mail server supporting a few hundred users, some EMS customers are supporting several thousand users on a single system.

TCP/IP on the mainframe

For many years, the main communication protocol supported by IBM on the mainframe was its own proprietary SNA. TCP/IP (Transmission Control Protocol/Internet Protocol) is an alternative communication protocol. The standard "suite" is based on ASCII, not EBCDIC, and includes some higher level services such as email, file transfer, remote login, and telnet including TN3270. The "suite" of services is still growing. There are many books on the TCP/IP subject, so we won't try to reproduce them here.

We have found three TCP/IP stacks for IBM mainframes. The first is from IBM and is for MVS, the second is from Interlink and is also for MVS, and the third is for VSE.

The TCP/IP stack from IBM includes a program interface called CICS-Sockets which EMS uses for the SMTP and POP3 facilities. EMS's SMTP gateway replaces the SMTP task supplied with IBM's TCP/IP stack. In the case of POP3, IBM does not supply a POP3 server.

Internet vs Intranet

Two of the biggest "buzz words" going around are internet and intranet. For the purposes of this document we will assume that both are basically just TCP/IP networks, and the main difference is that internet connects your system to the world wide network of networked computers, and an intranet uses the TCP/IP protocol to connect computers within your organization. You may have both, an intranet for your in-house computers and workstations, and access points or gateways or "firewalls" to connect you to the outside world. Basically, you need to talk to an ISP (Internet Service Provider) about connection to the internet.

With TCP/IP on one end and a PC with TCP/IP on the other end ... mainframe to PC integration is pretty tight. With the TN3270 access the user can access the host's "legacy", or core business, systems, and EMS supplies the email to the user's preferred POP3 mail client.

Remote users -- Traveling

Since the POP3 client "pulls down" the mail, a person traveling can connect to a local ISP, connect to their mailbox in EMS, upload any outbound mail, download any new mail, and disconnect.

Standard remote client

One very nice feature of the EMS SMTP/POP3 setup is that there is no special client software to distribute, license, track, or support. The TCP/IP and Mail agents come with Windows or are available off-the-shelf for a very low cost. Basically, we do the mainframe software and Microsoft (or others) do the PC software.

PassThru vs Break Apart -- Attachment handling

When EMS receives an SMTP message that has several attachments, it normally breaks the various attachments into separate EMS messages. This allows a message that comes in from the internet with an attached spread sheet file to be downloaded by the 3270 user with a tool such as IND$FILE, or maybe the message will be forwarded to an MHS destination.

This is fine for an EMS 3270 user, and is usually ok for a POP3 user in the same situation. However, as internet messages begin to contain multiple attachments, including an HTML "package" that is intended to be viewed with a browser, this approach has limitations.

With the PassThru option, messages that are received from an I-net can be passed through EMS with few or no changes; what comes in goes out. With this approach, messages are not broken apart, and the entire received message is "packaged together" as a single attached report and shipped to its destination.

To enable the PassThru facility in general, a setting on the SMTP Gateway Default settings screens must be enabled.

Second, when the message is received, it looks at where it is going. If it is going directly out to an SMTP destination, then it is just passed through. This most commonly occurs when a POP3 client sends an outbound message; it is uploaded to EMS which in turn ships it out to the internet.

The second situation that triggers the PassThru is when the destination is an EMS user that has requested that their message be passed through. This is most likely an EMS user that uses a POP3 client to pickup their mail and generally never uses the 3270 interface. This "Passthru" mode is set in the #2 screen of the user's EMS profile.

The "Allow POP3 Access" should only be set to "P" if the user is normally a POP3 user and wants all of their mail be passed through with minimal changes.

Configuration Alternatives

The following diagrams exhibit various possible connection configurations for the EMS SMTP/POP facility. They may be helpful to understand where the various elements fit in the scheme of things.

Direct SMTP to/from Internet

Figure 1 illustrates a configuration in which the Host is talking directly to the internet. In this situation, the Host must stay UP all of the time to accept incoming messages. Well, not really "all of the time" since the SMTP "senders" are going to have "retry" logic if the host goes down for a short period of time. In this setup, EMS would attempt to deliver each message to a target Host that will accept the mail item. The registered Domain Name points to the IP address of the MVS system.

If EMS cannot find a target HOST to accept the mail, the item will most likely be "passed" off to your ISP's postoffice/mailer to attempt regular message delivery. Since any number of "remote senders" could be trying to deliver a message to us, there could be several receive processes going on at the same time. At present, the system is configured to support 50 active receivers.


  • Most direct message delivery. EMS can be confident that the message was delivered or not. No extra message "hops".
  • No need for UNIX knowledge.


  • Host must stay up to receive mail.
  • Could have to support unknown number of incoming "receiver" tasks.

SMTP to/from Internet w/UNIX

The configuration depicted in Figure 2 assumes that a UNIX machine will act as a buffer between the mainframe and the internet. We tested the system with a SCO/UNIX system, but Windows NT with proper mailer software should do the job as well.

This configuration assumes that the Registered Domain name points to the IP address of the UNIX box.

The MAILER on the UNIX box is configured to accept all incoming mail and forward it to the MVS/EMS system. In this manner the UNIX box acts as a receiver postoffice/buffer and should the mainframe go down, mail can still be received on the UNIX system.

Since only the UNIX box should be sending mail to the MVS/EMS system, this should keep the number of "receiver" tasks to one.

This is a configuration whereby the UNIX box could be located outside of the "firewall" and the MVS system is protected inside the "firewall".

Outbound mail can be handled in one of two ways. The first is to simply dump all of the outbound mail to the UNIX box and let it route/deliver the mail. The disadvantage here is that the only delivery process that EMS knows about is to the UNIX box, which will always work, and we won't know if the message failed to be delivered until the UNIX system attempts delivery and sends back a "notice of failure" after the fact. But there are several advantages to this setup: the UNIX box can be outside the firewall and the connection to the UNIX box is very fast, thus we can pass off the outbound mail traffic very quickly.

The second is for EMS to attempt direct delivery, and then only mail that cannot be routed is dumped to the UNIX box as a backup. This has the advantage of EMS knowing if the message was delivered properly or explicitly rejected, and only mail without a proper DNS lookup or a valid domain name is passed to the UNIX system.

It should be noted that the communications protocol is still TCP/IP from the MVS/CICS/EMS system to the UNIX box.

POP3 with no Internet

Figure 3 shows a configuration with no internet access, thus it is truly an intranet setup.

In this configuration we don't even have internet access. Why would anyone want this? Because...

  • We want the 3270 users and the PC users to have email
  • We don't want to manage multiple mail servers
  • We don't want to install custom software on each PC

The POP3 (read PC) user never even sees a 3270 screen. Their POP3 mailer connects to the mainframe and downloads their mail, including attachments (binary or not). When they send mail, the PC client passes the mail to the SMTP facility on the MVS/EMS mainframe. In effect, the PC just treats the mainframe like just another (big) server.

In the diagram we have included Macintosh computers. We have not personally tested a Mac (we don't have any), but as long as the "client" is POP3/SMTP compliant, it should work.

POP3 and Internet

The configuration shown in Figure 4 includes everything. It assumes that the UNIX box is used as a buffer and the MVS/EMS box ALSO has direct internet access. The Laptop user in this case can dial into a local internet provider and have the POP3 client on his laptop connect to EMS on the MVS system, signon, pickup mail, and disconnect. At the same time, any outbound "queued" up mail is passed up to EMS for delivery.

    © 2017 Computer Application Services, Inc. - All Rights Reserved