Configuring SMTP Log Target In Datapower
Here in this blog, we are going to learn how to configure SMTP log target in Datapower.
Before you go to DataPower:
Go to the following link :
https://support.google.com/mail/?p=InvalidSecondFactor
Click on Google Account
Go to Security Tab:
Enable 2-step verification and go back then,
Set Application Password, generate it and store it.
Logon to Datapower:
- Go to User Agent
- Click on Default.
- Go to SMTP Client Policies :
Configure the following as shown above:
URL Matching Expression: dsmtp://smtp.gmail.com*
Recipient e-mail : *Reciever_Mail_Address
Sender e-mail : *Sender_Mail_Address
Subject : Anything you want
Options : Enable both – STARTTLS & Authentication
Authentication Method : set as LOGIN
- Go the Basic-Auth Policy in the same tab :
Select Password Alias :
In the password field:
Give your generated password for applications in your Gmail, then select APPLY.
Search Log Target in the search bar and configure it as shown below:
Go to Event Filters:
If you want specific service logs to be triggered, place or select that error code in the Event subscription filter and click on Add.
Go to Event Subscriptions:
If you only want certain service logs, choose that option; if not, choose everything in the menu and choose the lowest event priority. Here I selected all errors i.e., all the errors irrespective of the services will be triggered to mail.
Testing:
I am sending JSON request but in DataPower MPGW request type is Configured as XML
Go to system logs in DataPower, the event filter error code we configured is logged so our SMTP log target should be triggered.
Now let’s check whether the mail is sent to a specific recipient we configured in the log target or not.