내용으로 건너뛰기

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.

질문됨 일 년 전268회 조회

2개 답변
0
수락된 답변

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.

답변함 일 년 전

전문가

검토됨 일 년 전

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

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠