Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Sep 19, 2024
1 parent b9f3d0c commit 177dba0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
17 changes: 17 additions & 0 deletions web/Modules/Email/App/Console/SetupDockerEmailServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@ public function handle()
}
}

$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'),
Expand Down
2 changes: 1 addition & 1 deletion web/Modules/Email/App/Models/EmailAlias.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ class EmailAlias extends Model

public function getForwardAttribute()
{
return $this->address . '@' . $this->domain;
return $this->address . '@' . $this->domain;
}
}
Original file line number Diff line number Diff line change
@@ -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'
Original file line number Diff line number Diff line change
@@ -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'
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit 177dba0

Please sign in to comment.