diff --git a/banner_warn.php b/banner_warn.php index 9a1fe4e..4cca807 100644 --- a/banner_warn.php +++ b/banner_warn.php @@ -36,6 +36,8 @@ function init() $RCMAIL = rcmail::get_instance(); // Get config + $host = $RCMAIL->config->get('org_email_regex'); + $this->org_mail_regex = rcube_utils::parse_host($host); $this->org_mail_regex = $RCMAIL->config->get('org_email_regex'); $this->x_spam_status_header = $RCMAIL->config->get('x_spam_status_header'); $this->x_spam_level_header = $RCMAIL->config->get('x_spam_level_header'); diff --git a/config.inc.php.dist b/config.inc.php.dist index a5c9b09..1775e21 100644 --- a/config.inc.php.dist +++ b/config.inc.php.dist @@ -3,7 +3,13 @@ $config = array(); // Regex to match against the email to determine if from your organization -$config['org_email_regex'] = "/@(.*\.|)iitb\.ac\.in/i"; +// Supported replacement variables: +// %n - hostname ($_SERVER['SERVER_NAME']) +// %t - hostname without the first part +// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part) +// %s - domain name after the '@' from e-mail address provided at login screen +// For example %n = mail.domain.tld, %t = domain.tld +$config['org_email_regex'] = '/@(.*\.|)%t/i'; // Turn on letter avatars $config['avatars'] = true;