bvstone

Using Multiple Mail Routers with MAILTOOL During Transition to Cloud Server

Posted:

Using Multiple Mail Routers with MAILTOOL During Transition to Cloud Server

Update:  Be sure to check out this article on how to use GreenTools for Google Apps (G4G) to specify G4GSMAIL as an option as well as separate routers!

I was recently contacted by a customer asking if MAILTOOL could use more than one mail router.  We recently did update MAILTOOL to handle multiple routers in the case of failure of one, but in this case the reason was that they were moving from a locally hosted Microsoft Exchange server to a Cloud Hosted Server, in this case Office 365.

Because MAILTOOL not only has the ability to set it's values at a command level but also at a system and/or user level using configuration files, this is fairly simple to accomplish.

1.  Create a default configuration file in /bvstools/mailtool/config/defaults.json.  This will contain the settings for the Microsoft Exchange server:

{
	"variables": [
	{
		"name":"send_with_server_type",
		"default":"*MAILTOOL"
	},
	{
		"name":"mail_router",
		"default":"<exchange.router.host.or.ip>"
	},
	{
		"name":"use_mail_router",
		"default":"*ONLY"
	},
  ]
}

 

Replace <exchange.router.host.or.ip> with your mail router information.  

This setup is used in the case where your Microsoft Exchange server does not require any type of authentication.  If it does, please feel free to contact me for more options.

2.  For each user you switch over to Office 365, set up a configuration file for that user id in /bvstools/mailtool/config/<USERID>/defaults.json where <USERID> is the specific user id.

That file would look like this:

{
	"variables": [
    {
		"name":"from_email",
		"default":"<from email address>"
	},
	{
		"name":"from_name",
		"default":"<user name>"
	},
	{
		"name":"send_with_server_type",
		"default":"*MAILTOOL"
	},
	{
		"name":"mail_router",
		"default":"smtp.office365.com"
	},
	{
		"name":"use_mail_router",
		"default":"*ONLY"
	},
	{
		"name":"perform_mx_lookup",
		"default":"*NO"
	},
	{
		"name":"use_ssl",
		"default":"*TLS"
	},
	{
		"name":"smtp_port",
		"default":"587"
	},
	{
		"name":"smtp_auth_user",
		"default":"<from email address>
	},
	{
		"name":"smtp_auth_password",
		"default":"<account password>"
	}	
  ]
}

Again, anything in < > replace with the appropriate data.

Because Office 365 requires authentication you will need a configuration file for each user since each account will have different authentication data.

There is another option for using Office 365 that uses OAuth 2.0.  With this method you don't have to store the password for the user, but there is a small setup for each user account.  And it also requires licensing of addition software.

3.  Turn off Strict SSL for MAILTOOL. 

Turning off Strict SSL for MAILTOOL is done by copying and pasting the following command:

CHGDTAARA DTAARA(MAILTOOL/MLTSSL01DA *ALL) VALUE(*NO)

We could instead import the proper Certificate Authorities (CAs), but lately MS has been pretty flaky with their SSL certificates.  Feel free to contact me for information on how to import the CAs.

4.  Set up the MAILTOOL command to use the configuration files by default. 

This is done by copying and pasting the following command:

CHGCMDDFT CMD(MAILTOOL) NEWDFT('CONFIG(*DFT)') 

What this does is set the default for Configuration File on the MAILTOOL command so that it will use the default (*DFT).  The default is first looking for /bvstools/mailtool/config/<USERID>/defaults.json and if that's not found it will use /bvstools/mailtool/config/defaults.json.

If you are also using SPLTOOL and the SPL2EMAIL or SPL2EMAILB command you will want to change the defaults for the Configuration File parameter on them as well.

Remember that any field in the configuration file will automatically override those on the command, so the parameters mentioned here aren't the only ones you need to use, but they are the minimum that you will want to use.

 


Last edited 08/17/2020 at 09:13:56



Latest Posts:

What Objects Should I Omit from Replication to Ensure My License Keys Work on my HA/DR System? What Objects Should I Omit from Replication to Ensure My License Keys Work on my HA/DR System?
Posted by 3 days ago
BVSTools >> BVSTools Software Discussion
GreenTools for Google Apps (G4G) v15.00 Now Offers Functions to Bypass Registration Command and BVSTools Landing Page GreenTools for Google Apps (G4G) v15.00 Now Offers Functions to Bypass Registration Command and BVSTools Landing Page
Posted by May 3, 2022
BVSTools >> BVSTools Announcements >> GreenTools for G Suite (Google Apps) (G4G) Specific Announcements
How Do I Switch From MAILTOOL Plus to GreenTools for Google or Microsoft Office 365? How Do I Switch From MAILTOOL Plus to GreenTools for Google or Microsoft Office 365?
Posted by April 18, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
PTFs Issued for SSL/TLS Issues PTFs Issued for SSL/TLS Issues
Posted by March 12, 2022
IBM Power Systems >> PTF Watch
Google Dropping Support for Google Dropping Support for "Less Secure Apps" May 30th, 2022. What Does This Mean for Your IBM i Email?
Posted by March 4, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Have You Installed a New Version of MAILTOOL and Now Things Are Acting Different?  Check the Command Defaults! Have You Installed a New Version of MAILTOOL and Now Things Are Acting Different? Check the Command Defaults!
Posted by February 28, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Using MAILTOOL Plus on V7R1, or Any OS Using TLS 1.1 or Older Using MAILTOOL Plus on V7R1, or Any OS Using TLS 1.1 or Older
Posted by January 27, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
BVSTools ILE Functions Being Updated to Remove Hashtag (#) from Function Names BVSTools ILE Functions Being Updated to Remove Hashtag (#) from Function Names
Posted by December 30, 2021
BVSTools >> BVSTools Announcements
GETURI v12.00 Released Removing Beginning # (Hashtag) From Function Names GETURI v12.00 Released Removing Beginning # (Hashtag) From Function Names
Posted by December 28, 2021
BVSTools >> BVSTools Announcements >> Get URI (GETURI) Specific Announcements
Is any of BVSTools Software Affected by the log4j exploit? Is any of BVSTools Software Affected by the log4j exploit?
Posted by December 20, 2021
BVSTools >> BVSTools Software Discussion
GreenTools for Microsoft Apps (G4MS) Updated to Allow Downloads, Deletes, and Sharing of Files GreenTools for Microsoft Apps (G4MS) Updated to Allow Downloads, Deletes, and Sharing of Files
Posted by December 17, 2021
BVSTools >> BVSTools Announcements >> GreenTools for Microsoft Apps (G4MS) Specific Announcements
SSL Handshake Errors with GETURI, MAILTOOL and GreenTools Products SSL Handshake Errors with GETURI, MAILTOOL and GreenTools Products
Posted by October 18, 2021
BVSTools >> BVSTools Software Discussion
MAILTOOL Updated to Retry Sending when GSK SSL Handshake Error 415 (GSK_ERROR_BAD_PEER) is Encountered MAILTOOL Updated to Retry Sending when GSK SSL Handshake Error 415 (GSK_ERROR_BAD_PEER) is Encountered
Posted by August 19, 2021
BVSTools >> BVSTools Announcements >> eMail Tool (MAILTOOL) Specific Announcements
MAILTOOL Updated to Allow List-Unsubscribe and User Defined Headers MAILTOOL Updated to Allow List-Unsubscribe and User Defined Headers
Posted by August 13, 2021
BVSTools >> BVSTools Announcements >> eMail Tool (MAILTOOL) Specific Announcements
AWS signing process in as400 AWS signing process in as400
Posted by August 13, 2021
Programming >> Web Programming

Reply




Copyright 1983-2020 BVSTools
GreenBoard(v3) Powered by the eRPG SDK, MAILTOOL Plus!, GreenTools for Google Apps, jQuery, jQuery UI, BlockUI, CKEditor and running on the IBM i (AKA AS/400, iSeries, System i).