Hi all,
I’ve done what I think is an extensive search on the topic. I’m trying to set my fromemail
variable for the Backup and Restore FreePBX module to send me notification emails. I keep getting the “Unable to send backup email!” notifications. In looking through the /var/www/html/admin/modules/backup/functions.inc/class.backup.php
file, I see the following lines:
//Generic email
$from = '[email protected]';
//If we have sysadmin and "from is set"
if(function_exists('sysadmin_get_storage_email')){
$emails = sysadmin_get_storage_email();
//Check that what we got back above is a email address
if(!empty($emails['fromemail']) && filter_var($emails['fromemail'],FILTER_VALIDATE_EMAIL)){
$from = $emails['fromemail'];
}
}
//If the user set an email in advanced settings it wins, otherwise take whatever won above.
$from = filter_var($this->amp_conf['AMPBACKUPEMAILFROM'],FILTER_VALIDATE_EMAIL)?$this->amp_conf['AMPBACKUPEMAILFROM']:$from;
I see various references to sysadmin_get_storage_email
and AMPBACKUPEMAILFROM
.
I know that sysadmin_get_storage_email
comes from the sysadmin module. But as this is really a fun project as opposed to a production PBX, I have opted (as yet) not to purchase the sysadmin. So, absent this module, is there any other way of setting the email?
Alternatively, I know I can set AMPBACKUPEMAILFROM
in amportal.conf
. But the first lines of amportal.conf
warns:
#; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to
#; this file must be done via the Web GUI. This file is IGNORED BY FreePBX
#; The purpose of this file is to allow legacy applications to still function by just reading ampportal.conf
#; #;--------------------------------------------------------------------------------
#;--------------------------------------------------------------------------------
#; All settings can be set from the Advanced Settings page accessible in FreePBX
#;--------------------------------------------------------------------------------
Since I don’t want to upset the FreePBX gods, I went to Advanced Settings, and enabled Display and Override Readonly Settings. I see an entry for AMPUSERMANEMAILFROM
for emails from the user management module, but this is not the correct settings. In fact, despite the reference to AMPBACKUPEMAILFROM
, I don’t see any entry (deprecated or otherwise) in amportal.conf.
So, I tried going into /var/www/html/admin/modules/backup/functions.inc/class.backup.php
and replacing the email here:
$from = '[email protected]';
only to realized I really angered the FreePBX gods, because it then put up a great big Security Warning that:
Module: "Backup & Restore", File: "/var/www/html/admin/modules/backup/functions.inc/class.backup.php altered"
Despite ignoring this error, it didn’t resolve the “Unable to send backup email!” notification.
So, I decided to push my luck with the FreePBX gods again, and this time add the following lines to the end of amportal.conf
:
[email protected]
Same result.
So, I’m still where I started. Can anyone help? I can accept that there is no way around buying the sysadmin module, but since this is a just a side fun project, I thought I’d keep digging.
Thanks in advance.
b