diff --git a/config.inc.php b/config.inc.php index 1518b423..8863f1b7 100644 --- a/config.inc.php +++ b/config.inc.php @@ -72,9 +72,11 @@ $CONF['database_tables'] = array ( ); // Site Admin -// Define the Site Admins email address below. -// This will be used to send emails from to create mailboxes. -$CONF['admin_email'] = 'postmaster@change-this-to-your.domain.tld'; +// Define the Site Admin's email address below. +// This will be used to send emails from to create mailboxes and +// from Send Email / Broadcast message pages. +// Leave blank to send email from the logged-in Admin's Email address. +$CONF['admin_email'] = ''; // Mail Server // Hostname (FQDN) of your mail server. diff --git a/functions.inc.php b/functions.inc.php index 813437a5..1f02ddc9 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1340,6 +1340,19 @@ function smtp_mail ($to, $from, $data, $body = "") { return true; } +/** + * smtp_get_admin_email + * Action: Get configured email address or current user if nothing configured + * Call: smtp_get_admin_email + * @return String - username/mail address + */ +function smtp_get_admin_email() { + global $CONF; + if(isset($CONF['admin_email']) && !empty($CONF['admin_email'])) + return $CONF['admin_email']; + else + return authentication_get_username(); +} //