{"id":1459,"date":"2023-07-15T16:32:45","date_gmt":"2023-07-15T16:32:45","guid":{"rendered":"http:\/\/wp.chaoyu.nl\/?p=1459"},"modified":"2023-07-25T13:29:21","modified_gmt":"2023-07-25T11:29:21","slug":"oracle-apex-mail","status":"publish","type":"post","link":"https:\/\/chaoyu.nl\/?p=1459","title":{"rendered":"Oracle APEX Mail Relay Docker"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">It seems that APEX 23.1.0 made some changes to its smtp mail settings. I was no longer able to use straight smtp setting from my mail server. This behavior is also on APEX on ATP. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For mail services  on ATP, I use <a rel=\"noreferrer noopener\" href=\"https:\/\/www.oracle.com\/cloud\/networking\/email-delivery\/\" data-type=\"URL\" data-id=\"https:\/\/www.oracle.com\/cloud\/networking\/email-delivery\/\" target=\"_blank\">oracle oci mail service<\/a>. It requires some setting on my dns settings. It entire process is pretty painless. Here is a screenshot of how it looks like in my alwaysfree ATP Apex. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1912\" height=\"1254\" src=\"http:\/\/wp.chaoyu.nl\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-15-at-19.06.34.png\" alt=\"\" class=\"wp-image-1464\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Dont forget to create approved senders in OCI. only the approved sender mail address can be used as FROM<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">The only problem with this is that it is not entirely free. After 1000 mails, you start to pay. On a free Autonomous database, you are pretty much stucked with it, unless you have an paid ATP with an private IP within a vcn subnet and set up your relay smtp server within the same VCN. (I did not try it personally.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">My approach was on a 21xe machine on my network, where I run a <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/namshi\/docker-smtp\" data-type=\"URL\" data-id=\"https:\/\/github.com\/namshi\/docker-smtp\" target=\"_blank\">docker smtp rela<\/a>y in the same subnet. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">here is my docker-compose.yml file. <\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code lang=\"yaml\" class=\"language-yaml line-numbers\">version: '3'\nservices:\n  smtp:\n    image: namshi\/smtp\n    container_name: smtp_relay\n    restart: always\n    ports:\n     - \"25:25\"\n    environment:\n     # # MUST start with : e.g RELAY_NETWORKS=:192.168.0.0\/24:10.0.0.0\/16\n     # # if acting as a relay this or RELAY_DOMAINS must be filled out or incoming mail will be rejected\n      - RELAY_NETWORKS= :192.168.178.0\/24\n     # # what domains should be accepted to forward to lower distance MX server.\n     # - RELAY_DOMAINS= oci.chaoyu.nl\n     # # To act as a Gmail relay\n     # - GMAIL_USER=\n     # - GMAIL_PASSWORD=\n     # # For use with Amazon SES relay\n     # - SES_USER=\n     # - SES_PASSWORD=\n     # - SES_REGION=\n     # # if provided will enable TLS support\n     # - KEY_PATH=\n     # - CERTIFICATE_PATH=\n     # # the outgoing mail hostname\n     #  - MAILNAME=talk2fast.nl\n     # # set this to any value to disable ipv6\n     # - DISABLE_IPV6=\n     # # Generic SMTP Relay\n      - SMARTHOST_ADDRESS=&lt;server&gt;\n      - SMARTHOST_PORT=587  \n      - SMARTHOST_USER=&lt;USR&gt;\n      - SMARTHOST_PASSWORD=&lt;PWD&gt;\n      - SMARTHOST_ALIASES=&lt;server&gt;\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">For my smtp server which is from zohu, it only works on port 587<\/p>\n<cite>For you it might be 465<\/cite><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">here is my setting.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2058\" height=\"1452\" src=\"http:\/\/wp.chaoyu.nl\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-15-at-20.06.43.png\" alt=\"\" class=\"wp-image-1471\"\/><figcaption class=\"wp-element-caption\">I have used 825 insted of 25 on my docker for port mapping.<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>It seems that APEX 23.1.0 made some changes to its smtp mail settings. I was no longer able to use straight smtp setting from my mail server. This behavior is also on APEX on ATP. For mail services on ATP, I use oracle oci mail service. It requires some setting on my dns settings. It&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1124,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,54],"tags":[],"class_list":["post-1459","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apex","category-docker"],"_links":{"self":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts\/1459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1459"}],"version-history":[{"count":10,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts\/1459\/revisions"}],"predecessor-version":[{"id":1495,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts\/1459\/revisions\/1495"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/media\/1124"}],"wp:attachment":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}