IBM Support

SMTP Configuration Checklist

Troubleshooting


Problem

This document is intended to identify the basic configuration elements for native SMTP server on the IBM i.

Resolving The Problem

This document is intended to identify the basic configuration elements for native SMTP server on the IBM i.
 
A.
Check the TCP/IP domain information:

Issue the CFGTCP command, press Enter, and select Option 12. There must be a host name and a domain name defined. In most cases, Host Name Search Priority should be *Local. Verify that the DNS addresses are correct. In the additional parameters, 'Port' should be 53, 'Protocol' should be *UDP. 'Retries' and 'Time Interval' are typically 2.
B.
Check the TCP interfaces:

Issue the CFGTCP command, press Enter, and select Option 1. Make note of each interface and verify that it is active. The 127.0.0.1 interface should be here, and should be active.
C.
Check the TCP/IP Host table:

Issue the CFGTCP command, press Enter, and select Option 10. Check for 127.0.0.1 with the names LOOPBACK and LOCALHOST. Check for the IP addresses from the TCP interfaces list. One of them should be listed here with the 'host.domain' name. If a mail router is being used, it must resolve with either the local host table or DNS resolution.
D. Verify that Restricted Rename and Unlink is *No for '/tmp':

Issue the WRKLNK '/tmp' command, and press Enter. Select Option 8 on '/tmp', and press Enter. Page down two times. "Restricted Rename and Unlink" should be No. If not, change it to *No using the following command:
 
CHGATR OBJ('/tmp') ATR(*RSTDRNMUNL) VALUE(*NO)
E.
Verify the SMTP subdirectories exist and check for old e-mail fragments:

Issue the WRKLNK '/QTCPTMM' command, and press Enter. Select Option 5 on '/qtcptmm'. There should be the following subdirectories:
/ATTABOX
/DSN
/ENCODE
/FTRFILES
/LOCKBOX
/MAIL
/SMTPBOX
/TMP.

Select option 2 on '/ATTABOX'. Check to see if there are old e-mail fragments. If so, remove them. Do the same for '/SMTPBOX'.
F.
Check the POP server attributes:

Issue the CHGPOPA command, and press F4 to prompt. The Split Size should be *Nomax. The CCSID should typically be 00819.
G.
Check the directory entries if you are using SNDDST to send mail to an Internet address:

Issue the WRKDIRE command, and press Enter. There should not be a '*ANY/*ANY' directory entry. There should also not be a *ANY entry with the address of this partition/system.

Select 5 on the directory entry from the distribution attributes (INTERNET SMTPRTE).

Check the first five lines; they should look like the following:

User ID/Address . . . . : INTERNET SMTPRTE
Description . . . . . . : SMTP routing entry
System name/Group . . . : INTERNET
User profile . . . . . :
Network user ID . . . . : INTERNET SMTPRTE
On the second to last page, it should look like this:
Locally-defined . . . . : Yes
Indirect user . . . . . : No
Mail service level . . : User index
Preferred address . . . : NETUSRID *IBM
Address type . . . . : ATCONTXT

If this directory entry does not exist, use the command below to create it:
 
ADDDIRE USRID(INTERNET SMTPRTE) USRD('UserID to send to Internet') USER(*NONE) SYSNAME(INTERNET) PREFADR(NETUSRID *IBM ATCONTXT)
H.
Check the distribution attributes if you are using the SNDDST command to send mail:

Issue the CHGDSTA command, and press F4 to prompt. The 'Use MSF for Local' parameter should be *No. There should be a directory entry listed as the 'Route to SMTP gateway'. The most common is:
INTERNET SMTPRTE
If the 'User ID' and 'Address' are not set, use the command below to update it:
CHGDSTA KEEPRCP(*BCC) USEMSFLCL(*NO) SMTPRTE(INTERNET SMTPRTE)
I.
Check the SMTP attributes:

Issue the CHGSMTPA command and press F4 to prompt, then hit F9 to see all the parameters.  Items to review:
  • E-mail directory type - This parameter defaults to *SMTP.  To use the heritage method of sending mail we can set this to either *SDD or *SMTPMSF.
  • Allow Relayed Mail - This parameter should NOT be *All (the default value). *All is an 'Open Relay' and is a SPAM exposure. The Allow Relayed Mail parameter should be *None if you will only be using the iSeries to originate the e-mail (no clients sending mail), or *POPWDW if hosting POP3 mail clients, or *List if you want to include specific IP addresses for your clients.
  • Forwarding Mailhub Server - This parameter should be the name or the IP address of the external mail router that mail should be sent through.
  • Automatic Registration - This parameter should be set to *No. 
  • Mail Router - This parameter should be set to the same value as "Forwarding Mailhub Server".
  • Firewall - This parameter should be set to *Yes if there is a mail router defined in "Forwarding Mailhub Server" and "Mail Router".
  • Process all mail through MSF This parameter should be set to *No.
J.
Verify that the exit point programs are registered for SMTP and QMSF:

Issue the WRKREGINF command, and press Enter. Go down to QIBM_QZMFMSF_*. Compare the registered exit programs for each exit point with a working system if possible. If any are missing, refer to the following documentation: How to Register Missing Exit Point Programs Needed by QMSF and SMTP.
K.
To send mail using the SNDDST command, each user that would like to use the command will need a directory entry added for their user profile.  These can be added on the WRKDIRE screen.
To utilize the SNDSMTPEMM command, each user must have an SMTP user account.  To create these accounts, we can use the following documentation to import the account information from existing directory entries: How To Migrate SMTP on IBM i from *SDD to *SMTP/*SMTPMSF
L.
Once the above configuration items have been completed, the SMTP server needs to be ended/started for the changed to take effect using the following commands:
ENDTCPSVR SERVER(*SMTP)

STRTCPSVR SERVER(*SMTP)

Related information:
o For information on enabling TLS for the connection to the mail router, refer to the following documentation: Configuring SSL/TLS Between IBM i and Remote Mail Router WITHOUT Authentication
o For information on enabling TLS and client authentication to the mail router, refer to the following documentation:  How To Configure the SMTP Client To Use SMTP Authentication with a SMTP Relay
o For information on configuring SMTP to route to an Office365 or GMAIL mail router, refer to the following documentation: Configuration of the IBM i SMTP Client to Relay Email to Office365 and Gmail
o For information on debugging SMTP/QMSF failures, refer to the following documentation: Mustgather traces Needed to Debug SMTP and MSF When E-Mail Fails

[{"Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CINAA2","label":"Email and SMTP-\u003ESetup and Configure"}],"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Type":"MASTER"}]

Historical Number

562865621

Document Information

Modified date:
13 September 2024

UID

nas8N1012245