Admin Alert: Changing your SMTP Server is Easy-ish
March 18, 2009 Joe Hertvik
My shop recently upgraded its email system from Novell GroupWise to Microsoft Exchange. Along with the server change, we also had to reconfigure six i5/OS partitions to use the new Exchange server as their SMTP relay. If you’re faced with this type of issue, here’s an easy checklist for painlessly making the change.
Three Easy Steps
Changing your iSeries/System i/Power i SMTP relay is a relatively easy process with one or two minor kinks. There are three keys to making this change.
I’ll run through these issues and you’ll see how easy it is to make this change.
Step 1: Changing the SMTP Mail Relay Settings
An email forwarding server can be called by several different names including the mail router, SMTP relay, SMTP server name, or it can even be designated by the IP address of an outside SMTP server. These terms all refer to the same thing, which is the DNS name of an SMTP email server that will relay AS/400-based email to the outside world. Although an iSeries/System i/Power i SMTP server can function as a mail relay for another partition, most shops forward their i5/OS-generated email to an outside machine, such as an Exchange server.
Before you can reconfigure your setup to forward email to another server, check with your email System Administrator to ensure that your i5/OS partition is on the authorized relay list for the target SMTP server. If your partition isn’t authorized to forward email through the new SMTP server, you could change your configuration only to wind up having your email rejected because of authority issues.
There are two ways to change the SMTP relay that your i5/OS partition routes email to. To change it on the green screen, type in the following Change SMTP Attributes command (CHGSMTPA) and press F4 to prompt for its parameters.
This command allows you to change the parameters associated with the i5/OS SMTP server. Page down to the second CHGSMTPA screen and you’ll see a parameter called Mail Router (MAILROUTER). Enter the fully qualified DNS name of your new SMTP relay server in this field. For example, if I’m changing my configuration to send SMTP email to a server with a DNS entry of exchange.joesystemi.com, I would change my SMTP parameters on the second CHGSMTPA screen to look like this.
Change SMTP Attributes (CHGSMTPA) Type choices, press Enter. User ID delimiter . . . . . . . USRIDDELIM '?' Mail router . . . . . . . . . . MAILROUTER 'exchange.joesystemi.com' Coded character set identifier CCSID 00819 Outgoing EBCDIC/ASCII table: TBLSMTPOUT Outgoing EBCDIC/ASCII table . *CCSID Library . . . . . . . . . . Incoming ASCII/EBCDIC table: TBLSMTPIN Incoming ASCII/EBCDIC table . *CCSID Library . . . . . . . . . . Firewall . . . . . . . . . . . . FIREWALL *YES Journal . . . . . . . . . . . . JOURNAL *YES Process all mail through MSF . . ALLMAILMSF *NO Percent routing character . . . PCTRTGCHR *YES
Fill in the DNS name of your new SMTP relay, press enter, and your SMTP server parameters will be changed.
To change the SMTP relay setting using OpsNav, open the Network→Servers&rarr TCP/IP node under your target partition and right-click on the SMTP server entry that appears in OpsNav’s right-hand pane. Click on Properties from the pop-up menu that appears and you will find the SMTP mail router field under the General tab of the SMTP Properties window that comes up. Put in your new SMTP server name and click OK to save the setting.
However, just because you’ve changed the SMTP mail router parameter doesn’t mean you’re ready to use the new SMTP relay. You first have to follow a few more quick steps.
Step 2: Changing Third-Party Software SMTP Mail Settings
If you’re using any third-party packages that deliver email through SMTP, you may also have to reconfigure the software’s SMTP settings to point to the new relay server. In my shop, we use Gumbo Software’s Spoolmail package for emailing reports and Bytware’s MessengerConsole to send email alerts when there’s a system problem. Spoolmail uses the mail router setting from the i5/OS SMTP server, while MessengerConsole has a separate SMTP server name for designating the SMTP relay. The morale is that all email-based packages may have a different way of designating their relay server, so check your third-party software documentation for any individual SMTP settings that need to be changed.
Step 3: Restarting Your SMTP Server and Possibly Your AnyMail/400 Mail Server Framework
After you’ve changed your SMTP mail router setting, you need to stop and restart your SMTP server and possibly your AnyMail/400 Mail Server Framework for the changes to take effect.
While the SMTP server is a standard SMTP implementation inside the operating system, the AnyMail/400 Mail Server Framework (MSF) is a different animal. According to IBM, the MSF is an open structure for electronic mail distribution that is provided with the operating system. It also provides a set of mail-related functions for use in i5/OS as well as inside the older OS/400 operating system. For more details on MSF, see the AnyMail/400 Mail Server Framework manual (SC41-5411-00).
To determine if you’re running MSF on your partition, type in the following Work with Job command (WRKJOB).
If the Select Job display that appears shows active QMSF jobs, then you are running MSF on your system, and you will need to stop and restart it along with your SMTP server to get the new mail setting to work.
To restart QMSF and the SMTP server, enter the following commands from a green-screen control line.
ENDMSF OPTION(*IMMED) ENDTCPSVR SERVER(*SMTP) STRTCPSVR SERVER(*SMTP) STRMSF
Be sure to enter these commands in this sequence.
The End Mail Server Framework (ENDMSF) and Start Mail Server Framework (STRMSF) commands end and restart the Mail Server Framework on your machine, while the two End TCP/IP Server (ENDTCPSVR) and Start TCP/IP Server (STRTCPSVR) commands stop and restart your SMTP server. Although you can restart SMTP from OpsNav, I’ve haven’t found any easy way to restart the MSF jobs from the graphical interface. So I usually restart these servers from the green-screen.
If you’re not running MSF, you can just stop and restart the SMTP server, and the new settings should take effect.
And that’s the drill for changing the SMTP mail router setting on an i5/OS or OS/400 machine.