This commit is contained in:
Bozhidar 2024-09-19 16:22:09 +03:00
parent b9f3d0c90c
commit 177dba0eb5
5 changed files with 33 additions and 13 deletions

View file

@ -47,6 +47,23 @@ class SetupDockerEmailServer extends Command
}
}
$mysqlDbDetails = [
'host' => PhyreConfig::get('MYSQL_HOST', '127.0.0.1'),
'port' => PhyreConfig::get('MYSQL_PORT', 3306),
'username' => PhyreConfig::get('DB_USERNAME'),
'password' => PhyreConfig::get('DB_PASSWORD'),
'database' => PhyreConfig::get('DB_DATABASE'),
];
$postfixMysqlVirtualAliasMapsCf = PhyreBlade::render('email::server.postfix.sql.mysql_virtual_alias_maps.cf',$mysqlDbDetails);
file_put_contents('/etc/postfix/sql/mysql_virtual_alias_maps.cf', $postfixMysqlVirtualAliasMapsCf);
$postfixMysqlVirtualDomainsMapsCf = PhyreBlade::render('email::server.postfix.sql.mysql_virtual_domains_maps.cf',$mysqlDbDetails);
file_put_contents('/etc/postfix/sql/mysql_virtual_domains_maps.cf', $postfixMysqlVirtualDomainsMapsCf);
$postfixMysqlVirtualMailboxMapsCf = PhyreBlade::render('email::server.postfix.sql.mysql_virtual_mailbox_maps.cf',$mysqlDbDetails);
file_put_contents('/etc/postfix/sql/mysql_virtual_mailbox_maps.cf', $postfixMysqlVirtualMailboxMapsCf);
$postfixMainCf = PhyreBlade::render('email::server.postfix.main.cf', [
'hostName' => setting('email.hostname'),
'domain' => setting('email.domain'),

View file

@ -22,6 +22,6 @@ class EmailAlias extends Model
public function getForwardAttribute()
{
return $this->address . '@' . $this->domain;
return $this->address . '@' . $this->domain;
}
}

View file

@ -1,5 +1,6 @@
user = phyre_postfix
password = phyre_postfix_password
hosts = 127.0.0.1
dbname = phyre_postfix
user = {{$username}}
password = {{$password}}
hosts = {{$host}}
dbname = {{$database}}
port = {{$port}}
query = SELECT goto FROM alias WHERE address='%s' AND active = '1'

View file

@ -1,5 +1,6 @@
user = phyre_postfix
password = phyre_postfix_password
hosts = 127.0.0.1
dbname = phyre_postfix
user = {{$username}}
password = {{$password}}
hosts = {{$host}}
dbname = {{$database}}
port = {{$port}}
query = SELECT domain FROM domain WHERE domain='%s' AND active = '1'

View file

@ -1,5 +1,6 @@
user = phyre_postfix
password = phyre_postfix_password
hosts = 127.0.0.1
dbname = phyre_postfix
user = {{$username}}
password = {{$password}}
hosts = {{$host}}
dbname = {{$database}}
port = {{$port}}
query = SELECT maildir FROM mailbox WHERE username='%s' AND active = '1'