IBM Support

How To Migrate SMTP on IBM i from *SDD to *SMTP/*SMTPMSF

How To


Summary

This document discusses the recommended process to migrate your SMTP Server & Client configuration from the *SDD (System Distribution Directory) email directory type to the *SMTP/*SMTPMSF (Pure SMTP Server) email directory type.

Steps

New Email Directory Types:

*SMTP                                                    
    The server uses the SMTP local directory.  Users for this directory are specified using ADDUSRSMTP.

*SMTPMSF                                                  
    The server uses the SMTP local directory and uses MSF (Mail Server Framework) to deliver local email.  Users for this directory are specified using ADDUSRSMTP.

New IBM i SMTP Commands (Available with *SMTP and *SMTPMSF email directory types only)

*SMTP/*SMTPMSF EMail Directory Type Commands

Features and Benefits of migrating to the *SMTP or *SMTPMSF email directory type

  • Improved performance
    • The SMTP Client and Daemon jobs will be migrated from single-threaded and prestart jobs to 2 multi-threaded daemon jobs, QTSMTPSRVD and QTSMTPCLTD.  Prestart jobs are no longer used.  This reduces the total number of jobs required to process emails as well as the amount of system resources (temp storage, job structures, CPU, etc.) required to process emails.
  • Historical email logging
    • The WRKSMTPEMM CL command  is available to query historical emails.
    • WRKSMTPEMM LISTBY(*RCP) SORTBY(*TIME) QUEUE(*ALL) will retrieve all emails sorted by time and listed by recipient.
    • IBM recommends setting the JOURNAL(*YES) and KEEPUNTIL SMTP attributes using CHGSMTPA to retain historical email logs with verbose information.
  • Reduction in points-of-failure
    • The SNDSMTPEMM and IBM i SMTP APis will now send email distributions directly to the IBM i SMTP client daemon job, QTSMTPCLTD, instead of using the Mail Server Framework (MSF) server and IBM i System Distribution Directory (SDD).
    • This improves reliability and reduces points-of-failure.
  • Support for configuring TLS with a Forwarding Mailhub Server without credential authentication.
    • This allows the configuration of TLS communications with a SMTP relay when userID and password authentication is not required.  Example:  Authentication is performed by IP address instead.
  • Strict adherence to SMTP RFCs
    • This ensures the IBM i SMTP Server & Client are aligned with the Simple Mail Transfer Protocol standards
Steps to migrate from the *SDD to *SMTP/*SMTPMSF email directory type
 
1.

Migrate all of your System Distribution Directory (SDD) users to the new SMTP user repository.

Execute the STRIMPSMTP command for each individual user you would like to migrate or specify *ALL for the SDDUSRID parameter to migrate all users from the System Distribution Directory to the new SMTP user directory.

STRIMPSMTP SDDUSRID(*ALL) DLTSDDUSR(*NO)

You can also add your users manually to the new SMTP user directory by using ADDUSRSMTP and WRKSMTPUSR.

NOTE:  IBM strongly recommends you verify the DLTSDDUSR parameter is set to *NO before executing the STRIMPSMTP command.  System Distribution Directory Entries are required for the SNDDST command to complete successfully, even when DIRTYPE = *SMTP or *SMTPMSF.

2.

Set up the FROM email address for the new SMTP users.

Refer to the following IBM Technical document for more information on how to manage your SMTP user's FROM email addresses.

How To Customize The FROM EMail Address When Sending Mail From Your IBM i Server

3.

Configure your *SMTP/*SMTPMSF SMTP Attributes using CHGSMTPA to use the new email directory type.

Email Directory Type (DIRTYPE) = *SMTP or *SMTPMSF

Journal (JOURNAL) = *YES - this will add verbose information to your SMTP email logs.

Keep Until (KEEPUNTIL) = The number of seconds you want to retain email information.

Maximum email message size (MAXEMMSIZE) = Maximum accepted email message size.  *DFT = 10MB maximum size

i.e. CHGSMTPA DIRTYPE(*SMTP) KEEPUNTIL(345600) MAXEMMSIZE(1048576)

This will enable the new *SMTP email directory type, retain e-mail logs and information for 4 days, and set the maximum email size to 1G.

4.

Restart the SMTP server for the changes to take effect.

ENDTCPSVR SERVER(*SMTP)

STRTCPSVR SERVER(*SMTP)

5.

Review the QSYSWRK subsystem to verify the new *SMTP jobs have started successfully.

WRKACTJOB SBS(QSYSWRK)

Scroll down and look for the following jobs.

QTSMTPCLTD with Function PGM-QTMSSMTPC

QTSMTPSRVD with Function PGM-QTMSSMTPD

6.

Send an email and verify it is delivered successfully.

SNDSMTPEMM RCP(('email@domain.com')) SUBJECT('test email') NOTE('This is a test email.')

If the email is delivered successfully, then we encourage you to test other users to make sure they can send emails as well.  Of course, every email user requires an entry in the SMTP user registry using ADDUSRSMTP or WRKSMTPUSR (Refer to steps 1 & 2).


If the email is not received, IBM recommends you verify the Forwarding Mailhub Server SMTP Attribute using CHGSMTPA first.  If this is valid and set correctly, then IBM recommends you gather an SMTP client trace and contact IBM Support to investigate the issue further.

ENDTCPSVR *SMTP

TRCTCPAPP APP(*SMTPCLT) SET(*ON)

STRTCPSVR *SMTP

Re-create the issue. i.e. SNDSMTPEMM RCP(('email@domain.com')) SUBJECT('test email') NOTE('This is a test email.')

Wait 20 seconds for processing.

TRCTCPAPP APP(*SMTPCLT) SET(*OFF)

One or more QTMSSTRC spool files will be generated in the user's output queue.  Convert these files to plain text and contact IBM Support for further assistance.

[{"Type":"SW","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHfAAM","label":"Email and SMTP"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.2.0;7.3.0;7.4.0"}]

Document Information

Modified date:
21 July 2022

UID

ibm10715761