Chapter 3. Implementing Primary and Secondary DNS Servers
3.2 Task Summary
3.2.3 Configuring AS1 as a Mail Server
since it receives queries from clients attempting to learn the IP address for the mail server that accepts mail for users in the domain mycompany.com.
Also, in this scenario we made a decision to let users use SMTP domain names
of mycompany.com as the domain in the mail’s destination when addressing their
mail. The following example explains this further:
UserA in domain mycompany.com wants to send mail to Tim Jones who is also a
POP3 client in the mycompany.com domain. UserA sends mail from the POP3 client to the e-mail address of [email protected], which should be delivered to Tim’s POP3 server on AS1. In the following sections, we show how to
configure the POP3 directory entry for Tim on AS1, how to configure the SMTP server on AS1, and how to configure the DNS server on AS1.
The assumptions for this scenario:
• The outgoing SMTP server for UserA’s client is AS1. • The incoming POP3 serverfor Tim’s client is AS1.
• mycompany.com does not have access to the Internet for the purpose of
exchanging mail with Internet users.
• There is no firewall in the mycompany.com network. • AS1 is the only mail server for all mycompany.com domain.
• Tim’s PC where the POP3 client resides is configured to use AS1 as its DNS server.
3.2.3.1 Configuring a POP3 User on AS1
The user Tim needs to have a user profile and a POP3 directory entry on AS1. Tim’s user profile is JONEST2. We need to add an entry in the system distribution directory for the POP3 user. Use the Add Directory Entry (ADDDIRE) command shown in Figure 35 and press Enter.
The easiest way to configure mail in an internal network is to use an SMTP domain name of <host.domain_name>. Mail should be addressed to
[email protected], where AS1 is the host name of the mail server. However, most users do not want to have to remember the host name as part of the SMTP domain name when addressing mail. Thus, in this scenario, we show the configuration to handle both situations: when a user addresses mail
to: [email protected], and when the user addresses mail to the same
user as \[email protected]. In both cases, mail is delivered to the AS1 mail server.
Figure 35. Adding an Entry in the System Distribution Directory for User JONEST2
We now change the newly created directory entry to configure the user as a POP3 user. To change the directory entry, enter the following AS/400 command:
WRKDIRE
Press F17 to position to the JONEST2 directory entry. Use option 2 to Change
JONEST2 directory entry.
Once into the Change Directory Entry display, page down four times until you get to the portion of the directory entry that contains the parameters Mail service level
and Preferred address.
A POP3 directory entry must have a mail service level = 2 (System message
store) and a Preferred address = 3 (SMTP name). See Figure 36.
Add Directory Entry (ADDDIRE) Type choices, press Enter. User identifier: User ID . . . jonest2 Character value Address . . . as1 Character value User description . . . Tim Jones' POP directory entry
User profile . . . jonest2 Name, *NONE System name: System name . . . *LCL Character value, *LCL, System group . . . Character value Network user ID . . . *USRID
Change Directory Entry User ID/Address . . . . : JONEST2 AS1 Type changes, press Enter. Mail service level . . 2 1=User index 2=System message store 4=Lotus Domino 9=Other mail service For choice 9=Other mail service: Field name . . . . F4 for list Preferred address . . . 3 1=User ID/Address 2=O/R name 3=SMTP name 9=Other preferred address Address type . . . . F4 for list For choice 9=Other preferred address: Field name . . . . F4 for list More... F3=Exit F4=Prompt F5=Refresh F12=Cancel F18=Display location details F19=Change name for SMTP F20=Specify user-defined fields F24=More keys
Press F19 to enter Tim’s SMTP user ID and SMTP domain name in the Change Name for SMTP display. Press Enter to confirm that you want to add an SMTP userid and SMTP Domain name for this directory entry. Type in:
SMTP user ID = tim
SMTP domain = AS1.mycompany.com
See Figure 37.
Press Enter twice to confirm.
Figure 37. Adding SMTP UserId and SMTP Domain Name for User JONEST2 3.2.3.2 Configuring POP3 Clients
First, let’s summarize: Tim now has a POP3 directory entry on AS1. You can think of this as representing Tim’s POP3 mailbox. Mail sent to [email protected]
is delivered to this mailbox until the user Tim takes the option to "Get Mail" from the POP3 client.
Tim’s SMTP User ID is tim and his SMTP domain name is AS1.mycompany.com. Another user in mycompany.com can send mail to Tim by addressing mail to
[email protected]. Tim must configure his POP3 client (running on his PC,
for example, Netscape mail) with a POP3 User Name that matches the POP3 directory entry User profile (JONEST2 in our example). Of course if you want to
Although users can address mail to Tim using the ’Mail To’ of:
[email protected] (we will show you how to configure it shortly), the SMTP
domain name must still be AS1.mycompany.com. Important
Add Name for SMTP System: AS1 Type choices, press Enter. User ID . . . : JONEST2 Address . . . : AS1 SMTP user ID . . . tim SMTP domain . . . as1.mycompany.com SMTP route . . .
and an incoming mail POP3 server. The POP3 User Name matches the User profile in the AS/400 system distribution directory entry.
Figure 38. Specifying the Mail Server Option to the Netscape POP3 Mail Client
3.2.3.3 Configuring the Domain’s Mail Server in the DNS Server
There must be an A record for the domain’s mail server (also called mail
exchanger) in the forward mapping primary domain file, mycompany.com, in the reverse mapping primary domain file 69.5.10.in-addr.arpa. In our scenario, AS1 already has an A record in both files as shown in Figure 31 on page 43 and Figure 33 on page 43.
To tell the name server that AS1 is the mail server for the domain, we need to add an MX record to the mycompany.com primary domain file. We use a wildcard MX record for this. The following steps show how to configure a wildcard MX record: 1. Right click on the mycompany.com primary domain.
2. Select Properties. 3. Select Mail Tab. 4. Click Add.
.
Figure 39. Configuring the DNS Primary Domain Mycompany.com’s Mail Server
6. Enter the host name of the mail server (in this case, as1, as shown in Figure 40).
7. Click on OK. The result is shown in Figure 41.
8. Click on OK a second time to exit out of the Properties window. 9. Close the DNS window to Save the DNS Configuration.
mycompany.com domain and review the contents of the Mail tab. To view the actual MX record, you can use the Operations Navigator File System to display the mycompany.com.DB file contained in the
/QIBM/UserData/OS400/DNS path.
Figure 41. Result of Wildcard MX Record Added to mycompany.com Primary Domain File
If an MX query is sent to the name server for a host that does have an A record configured on the name server, the wildcard MX record is not used. The name server sends a negative response. However, for SMTP and mail, this is OK because after receiving a negative response for the MX query, the SMTP code sends an A record query for that host to the name server. Since an A record exists for that host, the name server sends a positive response to the A record query and SMTP attempts to send the mail to that host’s IP address.
It is not a requirement that the mail server and the DNS server be the same AS/400 system.
3.2.3.4 Verifying the TCP/IP and SMTP Configuration on AS1
We should verify the TCP/IP configuration parameters relevant to mail as well as the SMTP configuration on the mail server (AS1).
Use the Change SMTP Attributes (CHGSMTPA) command to verify the SMTP configuration. Figure 42 shows the SMTP attributes in AS1. Since this network is not connected to the Internet and there is no firewall installed in the network, we want to confirm that the parameter Mail Router = *NONE and the parameter
The MX record of domain name of *.mycompany.com is called a wildcard MX record. If a client sends an MX record query to the name server for a host in domain mycompany.com and the name server does not have an A record for that host, then the name server sends a response stating that
AS1.mycompany.com is the mail server for the domain mycompany.com.
Figure 42. AS1 SMTP Attributes
Verify the TCP/IP domain configuration. Use the Configure TCP command: CFGTCP
option 12.
Verify the host name (AS1) and domain name (mycompany.com). Make sure that
the Search First parameter is *LOCAL and the Internet Address is the IP address
of AS1’s DNS server, which is 10.5.69.222. This ensures that when the SMTP server on AS1 attempts to deliver mail, it checks the AS/400 host table first and then the DNS server at 10.5.69.222 to resolve host names. We need the local host table searched first because it contains the alias mycompany.com for AS1, which the SMTP server needs to find. See Figure 43.
Figure 43. CFGTCP Opt 12 on AS1 System
Change SMTP Attributes (CHGSMTPA) Type choices, press Enter. Mail router . . . *NONE Coded character set identifier 00819 1-65533, *SAME, *DFT Mapping tables: Outgoing EBCDIC/ASCII table . *CCSID Name, *SAME, *CCSID, *DFT Library . . . Name, *LIBL, *CURLIB Incoming ASCII/EBCDIC table . *CCSID Name, *SAME, *CCSID, *DFT Library . . . Name, *LIBL, *CURLIB Firewall . . . *NO *YES, *NO, *SAME
Change TCP/IP Domain (CHGTCPDMN) Type choices, press Enter. Host name . . . 'AS1' Domain name . . . 'mycompany.com' Host name search priority . . . *LOCAL *REMOTE, *LOCAL, *SAME Internet address . . . '10.5.69.222'
Search First = *LOCAL (from CFGTCP opt 12) allows mail addressed to
[email protected] to be delivered to the AS1 mail server. Mail addressed to
[email protected] is also delivered to the AS1 with this configuration.
Figure 44. Configuring mycompany.com as an ALIAS to AS1 and as1mycompany.com 3.2.3.5 Starting Mail Jobs on the Mail Server (AS1)
To start SMTP, POP3, and the mail server framework jobs, issue the following commands:
•strtcpsvr *smtp •strtcpsvr *pop •strmsf
If some of these jobs fail and cancel, you need to check the job logs for errors. See Section 8.1.10.4, “SMTP and POP Servers” on page 203.