Oracle EM13c in Oracle Cloud Infrastructure – sending Mail Notifications by Email Delivery Service

For the Trivadis Oracle Enterprise Manager Training, we setup and Oracle EM13c in the Oracle Cloud Infrastructure. One student exercise is, to setup notification rules. Therefore a mail server is required. In Oracle Cloud Infrastructure, there is an Email Delivery service available which fits best: Overview of the Email Delivery Service (oracle.com)

I have tried to setup a local postfix mail gateway which used the NAT gateway address as sender’s address. But the NAT gateway addresses are blacklisted in spam services like spamhaus.com. Even Microsoft doesn’t want to allow these mails send by the NAT gateway. You can see my attempts at the bottom of this blog post.

Setup

Subnet Component Purpose
Public Virtual Machine Bastion Server, SSH Access, Apache Guacamole
Private Virtual Machine Oracle Enterprise Manager EM13c – OMS
Private Database System Oracle Enterprise Manager EM13c – Repository

 

Email Delivery Service Prerequisites

The configuration for this service has to be done as non-federated user.  If you want to use the service as a federated user, you get this message: Email Delivery is not available with your current permissions. Please Contact Support for further assistance.

IAM User

This is why I have created a IAM user called email-delivery-service-user. The user needs these permissions to manage the email delivery service.

email-delivery-service-user
email-delivery-service-group
email-delivery-service-policy Allow group Email-Delivery-Service-Group to manage approved-senders in compartment training:o-em
Allow group Email-Delivery-Service-Group to use email-family in compartment training:o-em

 

SMTP Credentials

Additional a SMTP credential for this user is created. This SMTP credentials are used for Oracle Enterprise Manager EM13c mail server configuration. Identity >> Users >> User Details >> SMTP Credentials. Copy the provided OCID and password temporary for later use.

 

Email Delivery Service Setup

Login in Oracle Cloud Infrastructure user interface as previous created user to configure the approved sender list. Developer Services >> Email Delivery. Add the mail address what you want to use for OEM communication to the approved sender list. Take care at the policy. Here in this case, the user is only allowed to do it in the O-EM called sub-compartment. Now we are ready to configure the Oracle Enterprise Manager EM13c.

The SMTP server is visible on the Email Configuration page and depends on your region. In my case, the SMTP endpoint in data center Zurich is used:

Oracle Enterprise Manager EM13c – Mail Servers Configuration

In Setup >> Notifications >> Mail Servers, we add a new mail server.

Host SMTP host provided by OCI
Port 587
User Name SMTP Credentials user name
Password SMTP Credentials password
Use Secure Connections TLS, if available

 

Set the Sender Identity, the Sender’s Email Address corresponds to the entry in the deliver approved sender list.

Oracle Enterprise Manager EM13c – Mail Servers Test

The configuration is done, we can test it. Test Mail Servers – click on the image for more details. After some seconds, you see a confirmation at the top that the test succeeded. Verify your mailbox for the test message. That’s all folks.

Addendum – Spamhaus and Outlook.com

Before I used the Email Delivery Service, the first try was to configure postfix as local mail agent, there is a good manual available here: Oracle Linux: Install the Postfix Email Server. But this was not successful. When I tried to send mails to my companies’ address or to an outlook.com (hotmail.ch is one of them), I always got a SMTP error: Client host [152.67.94.216] blocked using Spamhaus

152.67.94.216 is the public IP address from the Oracle Cloud Infrastructure NAT gateway, first I did a removal request online at spamhaus.org – the URL was provided in the error message. And 2hrs later, I got a message and confirmed my request.

Two things:

  1. my company syncs their spam filter on a regular base, so after a while, I was able to send notifications to my personal company mail address
  2. but for the Hotmail (Outlook.com) address, it did still not work: Unfortunately, messages from [152.67.94.216] weren’t sent. Please contact your Internet service provider since part of their network is on our block list (S3140)

So I tried to contact Microsoft on the same way with a support request:

And some minutes later I git the answer: Not qualified for mitigation.

Summary

This is quite simple: If you are in the cloud – use the cloud services.