bvstone

Resending Emails that have Errored Out with Updated Router or Authentication Information

Posted:

Resending Emails that have Errored Out with Updated Router or Authentication Information

There are times when you will send emails from your IBM i, and for one reason or another (your quota was reached, your internet was down, etc) you may have a large group of emails that are not delivered and need to be resent.

Normally you could use the MTPLUGLOG command to resend individual emails, or the MTPRESEND command to resend all errored email messages at once.

But there may be a case, such as in the case of your sending quotas going over the limit, where you would need to change the email router and/or authentication information to resend the email.

When an email errors out with MAILTOOL (and MAILTOOL Plus), the email (MIME file) itself is saved in the IFS along with a unique JSON configuration for that email.  The details of the FROM address and TO, CC and BCC recipients are also stored in the MAILTOOL log files. 

One option is to edit each of the configuration files and manually change the information you need (router, user, password, etc) but when you have hundreds or thousands of emails to resend that is an overwhelming task.

Instead, when resending emails using either MTPLUSLOG or MTPRESEND, you have the option to specify a different and specific JSON configuration file.

                     MAILTOOL Plus Resend (MTPRESEND)                        

Type choices, press Enter.                                          
Send to All Recipients . . . . .   *ERR          *ERR, *YES        
Configuration File . . . . . . .   *DFT                            
Prompt Before Running  . . . . .   *YES          *YES, *NO

In this example, *DFT is specified for the configuration file.  This tells MAILTOOL to use the configuration file that was created during sending of the email when it errored out to resend.  But, we can override this parameter with a specific configuration file we can create manually and have that applied to all of the emails that are resent.

Let's assume we create an IFS file named /tmp/tempemail.json, and use the following settings:

{  
   "variables":[  
      {  
         "name":"from_email",
         "default":"<your from address>"
      },
      {  
         "name":"send_with_server_type",
         "default":"*MAILTOOL"
      },
      {  
         "name":"mail_router",
         "default":"smtp.gmail.com"
      },
      {  
         "name":"use_mail_router",
         "default":"*ONLY"
      },
      {  
         "name":"use_ssl",
         "default":"*YES"
      },
      {  
         "name":"smtp_port",
         "default":"465"
      },
      {  
         "name":"smtp_auth_user",
         "default":"<smtp auth user id>"
      },
      {  
         "name":"smtp_auth_password",
         "default":"<smtp_password>"
      }
   ]
}

You would need to replace items  in < > with the correct information.  The FROM address is required, but won't be changed, even if what you use is different from the original email as the FROM address and recipients are taken from the MAILTOOL log files and already in the MIME file itself.  But, the mail router, port, SSL setting, and authentication parameters can be overridden with new values that WILL be replaced when sending the email.

It is STRONGLY advised, once you create the JSON configuration file, that you could then run one or more tests from MTPLUSLOG making sure to override the configuration file with the one you created.  If it works, you should be able to use MTPRESEND and also override the configuration file with the one you created.


Last edited 03/01/2019 at 12:04:36



Latest Posts:

Using GETURI to Make OAuth 2.0 Requests - Custom Headers for Access Tokens Using GETURI to Make OAuth 2.0 Requests - Custom Headers for Access Tokens
Posted by 2 days ago
BVSTools >> BVSTools Software Discussion >> Get URI (GETURI) Specific Discussion
GreenTools for Microsoft Apps (G4MS) v5.00 Released with Updated OneDrive Support and 3rd Party Functionality GreenTools for Microsoft Apps (G4MS) v5.00 Released with Updated OneDrive Support and 3rd Party Functionality
Posted by October 20, 2019
BVSTools >> BVSTools Announcements >> GreenTools for Microsoft Apps (G4MS) Specific Announcements
BVSTools is Now Running V7R4M0 BVSTools is Now Running V7R4M0
Posted by September 28, 2019
BVSTools >> BVSTools Announcements
GreenTools for G Suite (G4G) Now Includes Send Mail Functionality (G4GSMAIL Addon) GreenTools for G Suite (G4G) Now Includes Send Mail Functionality (G4GSMAIL Addon)
Posted by August 27, 2019
BVSTools >> BVSTools Announcements >> GreenTools for G Suite (Google Apps) (G4G) Specific Announcements
GreenTools For G Suite (G4G) v12.00 Released With Base OAuth 2.0 Functionality GreenTools For G Suite (G4G) v12.00 Released With Base OAuth 2.0 Functionality
Posted by July 28, 2019
BVSTools >> BVSTools Announcements >> GreenTools for G Suite (Google Apps) (G4G) Specific Announcements
BVSTools Small Price Increase in 2020 BVSTools Small Price Increase in 2020
Posted by July 26, 2019
BVSTools >> BVSTools Announcements
GreenTools for Vertex Cloud (VTXCLOUD) Now Available GreenTools for Vertex Cloud (VTXCLOUD) Now Available
Posted by July 22, 2019
BVSTools >> BVSTools Announcements >> GreenTools for Vertex Cloud (VTXCLOUD) Specific Announcements
GreenTools for Google Apps (G4G) - Drive Addon Successfully Verified by Google GreenTools for Google Apps (G4G) - Drive Addon Successfully Verified by Google
Posted by July 22, 2019
BVSTools >> BVSTools Announcements >> GreenTools for G Suite (Google Apps) (G4G) Specific Announcements
Why I Cancelled my DynDNS Service and How I Replaced It with an IBM i Application Why I Cancelled my DynDNS Service and How I Replaced It with an IBM i Application
Posted by July 17, 2019
IBM Power Systems >> (QGPL) IBM i
Green Tools for G Suite (G4G) Product Updates (Licensing, Functionality, Base Product) Green Tools for G Suite (G4G) Product Updates (Licensing, Functionality, Base Product)
Posted by July 13, 2019
BVSTools >> BVSTools Announcements >> GreenTools for G Suite (Google Apps) (G4G) Specific Announcements
Reading JSON Data from Standard Input With YAJL and RPG Reading JSON Data from Standard Input With YAJL and RPG
Posted by July 12, 2019
Programming >> Proof of Concept (POC)
MAILTOOL Updated to Allow Use of IBM Global Security Kit (GSKIT) for SSL/TLS Communications MAILTOOL Updated to Allow Use of IBM Global Security Kit (GSKIT) for SSL/TLS Communications
Posted by June 19, 2019
BVSTools >> BVSTools Announcements >> eMail Tool (MAILTOOL) Specific Announcements
GETURI v10.00 Released Supporting IBM Global Security Kit (GSKIT) and Server Name Indication (SNI) GETURI v10.00 Released Supporting IBM Global Security Kit (GSKIT) and Server Name Indication (SNI)
Posted by June 11, 2019
BVSTools >> BVSTools Announcements >> Get URI (GETURI) Specific Announcements
BVSTools Now Offers Vertex Cloud Interface BVSTools Now Offers Vertex Cloud Interface
Posted by April 15, 2019
BVSTools >> BVSTools Announcements
Token Has an Invalid Signature Error for Office 365 Email Token Has an Invalid Signature Error for Office 365 Email
Posted by March 22, 2019
BVSTools >> BVSTools Software Discussion >> GreenTools for Microsoft Apps (G4MS) Specific Discussion

Reply




Copyright 1983-2019 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).