Skip to content

RDS ORACLE local smtp

0

HI all, is it possibile to use a local smtp server to send mail via utl_smtp package through port 25 or there are some kind of restriction and it not possibile use the port 25? Many thanks.

asked a year ago251 views
2 Answers
0
Accepted Answer

It is not possible to use UTL_SMTP from Oracle RDS directly over port 25. Port 25 is blocked by default in AWS VPCs to prevent spam.

As an alternative:

You can use an intermediate EC2 instance with UTL_HTTP + a Web API. Create an HTTP/HTTPS endpoint to receive email data. From RDS, use UTL_HTTP to send the request to the endpoint, and then the EC2 instance sends the email via SMTP.

or

Use Amazon SES in combination with a Lambda function or EC2 instance.

answered a year ago
EXPERT
reviewed a year ago
0

Yes, it is possible to use a local SMTP server to send mail via the UTL_SMTP package through port 25 on Amazon RDS for Oracle. However, there are some important considerations and potential restrictions to be aware of:

  1. By default, AWS restricts outbound traffic on port 25 for RDS instances. This restriction is in place to prevent potential spam issues.

  2. To use port 25 for SMTP, you need to request the removal of this restriction. You can do this by submitting a request to AWS Support using the "Request to remove email sending limitations" form. It's important to note that processing this request can take up to 48 hours.

  3. After the port 25 restriction is removed, you'll need to configure the SMTP server by setting the SMTP_OUT_SERVER parameter. This can be done at the session level or as a default for the DB instance using a DB parameter group.

  4. When using UTL_SMTP, you'll need to install the required scripts and then use the package's procedures to open a connection to the SMTP server, initiate the handshake, set sender and recipient details, add the message content, and terminate the SMTP transaction.

  5. It's worth noting that while UTL_SMTP is available, Oracle also provides the UTL_MAIL package, which is generally easier to use and supports attachments. UTL_MAIL is recommended for most cases unless you have a specific need for UTL_SMTP.

  6. Keep in mind that there are some limitations when using these packages on RDS, such as lack of Transport Layer Security (TLS) encryption and no SMTP server authentication.

Remember to consider security implications when opening port 25, and ensure that your use case complies with AWS policies and best practices for email sending.
Sources
Oracle UTL_MAIL - Amazon Relational Database Service
Send notifications for an Amazon RDS for SQL Server database instance by using an on-premises SMTP server and Database Mail - AWS Prescriptive Guidance
Oracle UTL_MAIL or UTL_SMTP and Amazon Simple Notification Service - Oracle to Aurora MySQL Migration Playbook
Using Database Mail on Amazon RDS for SQL Server - Amazon Relational Database Service

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.