From d80816ad866e77ab6d26c3ce37436eb72d8d21c9 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 28 Sep 2014 10:39:42 +0000 Subject: [PATCH] DomainHandler: - $CONF[default_aliases] can now use the new domain as alias target http://sourceforge.net/p/postfixadmin/patches/124/ config.inc.php: - update comment for $CONF[default_aliases] git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1690 a1433add-5e2c-0410-b055-b7f2511e0802 --- CHANGELOG.TXT | 1 + config.inc.php | 3 +++ model/DomainHandler.php | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 930cc369..b2193354 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -21,6 +21,7 @@ SVN changes since 3.0 beta1 (2.91) - fix logging (run setup.php to fix old log entries) (bug#317) - fetchmail.php: change error_reporting() to exclude E_NOTICE (bug#322) - fr.lang translation update (patch#123) +- $CONF[default_aliases] can now use the new domain as alias target (patch#124) Version 3.0 beta1 (2.91) - 2014/05/06 - SVN r1670 ------------------------------------------------- diff --git a/config.inc.php b/config.inc.php index 294fefdd..5f7278c5 100644 --- a/config.inc.php +++ b/config.inc.php @@ -180,6 +180,9 @@ $CONF['page_size'] = '10'; // Default Aliases // The default aliases that need to be created for all domains. +// You can specify the target address in two ways: +// a) a full mail address +// b) only a localpart ('postmaster' => 'admin') - the alias target will point to the same domain $CONF['default_aliases'] = array ( 'abuse' => 'abuse@change-this-to-your.domain.tld', 'hostmaster' => 'hostmaster@change-this-to-your.domain.tld', diff --git a/model/DomainHandler.php b/model/DomainHandler.php index 30de0e93..8db77375 100644 --- a/model/DomainHandler.php +++ b/model/DomainHandler.php @@ -104,6 +104,10 @@ class DomainHandler extends PFAHandler { if ($this->new && $this->values['default_aliases']) { foreach (Config::read('default_aliases') as $address=>$goto) { $address = $address . "@" . $this->id; + # if $goto doesn't contain @, let the alias point to the same domain + if(!strstr($goto, '@')) { + $goto = $goto . "@" . $this->id; + } # TODO: use AliasHandler->add instead of writing directly to the alias table $arr = array( 'address' => $address,