If anyone has APEX application users using subscriptions, and the production database instance gets cloned, you may have run into problems with multiple subscription emails looking like they come from the production instance. These are some tidbits I've found as I'm researching how to deal with cloned APEX applications. I believe they are accurate. Have any comments?
APEX 4.2.1.00.08
You can send emails explicitly from an APEX IR using Actions > Download > Email, and by creating Subscriptions. The emails include links so the recipient of a download can go directly to the IR page, and of a subscription can unsubscribe. This is good. The links also help identify the instance from which APEX is sending the emails.
But it looks like the host information in the links is created inconsistently, and that causes a problem for subscriptions.
1. This is what you see in the explicit download email. It contains the instance URL, including the app_id:page_id (915:80) that the report comes from.
This email sent by MSMITH.
http://ah9.appshosting.com:7780/pls/apex/f?p=915:80
2. This is what you see in a subscription email.
See attached
You are receiving this email from Interactive report subscription created by MSMITH.
If you no longer wish to receive emails, please click unsubscribe to manage your subscription.
FYI, the unsubscribe link is <a href="http://ah9.appshappy.com:7780/pls/apex/f?p=4155:200:0:::200:P200_ID:92666525623681551&p_lang=en">unsubscribe</a> . In this example, "appshappy" does not exist, but was entered by the instance admin.
The download apparently uses the same host URL as you get from API apex_util.host_url('SCRIPT'), which gives the true server information.
However, the subscription uses a value the APEX administrator can set at Home > Manage Instance > Instance Settings > Instance Settings. Then Email. Set Application Express Instance URL. The documentation says you can also set the value with apex_instance_admin.set_parameter, where the parameter is 'EMAIL_INSTANCE_URL'. (I haven't gotten that to work yet.) The value may be defaulted when the instance is first created, but it can be changed (spoofed) any time by the Instance Admin.
If the database instance is cloned, the clone will have a correct link to the IR in downloaded emails, but will not have the correct unsubscribe link for any subscriptions created after the clone was created.
Skip