mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-21 23:20:24 +00:00
update
This commit is contained in:
parent
29493603b4
commit
9718506b3b
5 changed files with 32 additions and 12 deletions
|
@ -55,6 +55,10 @@ class SetupEmailServer extends Command
|
||||||
'database' => PhyreConfig::get('DB_DATABASE'),
|
'database' => PhyreConfig::get('DB_DATABASE'),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (!is_dir('/etc/postfix/sql')) {
|
||||||
|
mkdir('/etc/postfix/sql');
|
||||||
|
}
|
||||||
|
|
||||||
$postfixMysqlVirtualAliasMapsCf = PhyreBlade::render('email::server.postfix.sql.mysql_virtual_alias_maps.cf',$mysqlDbDetails);
|
$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);
|
file_put_contents('/etc/postfix/sql/mysql_virtual_alias_maps.cf', $postfixMysqlVirtualAliasMapsCf);
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,13 @@ class EmailSettings extends BaseSettings
|
||||||
|
|
||||||
protected static ?int $navigationSort = 4;
|
protected static ?int $navigationSort = 4;
|
||||||
|
|
||||||
|
public function save() : void
|
||||||
|
{
|
||||||
|
parent::save();
|
||||||
|
|
||||||
|
\Artisan::call('email:setup-email-server');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function schema(): array
|
public function schema(): array
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,9 +29,14 @@ Welcome to your new account.
|
||||||
';
|
';
|
||||||
public $subject = 'Welcome';
|
public $subject = 'Welcome';
|
||||||
|
|
||||||
|
public function getEmailDomain()
|
||||||
|
{
|
||||||
|
return setting('email.domain');
|
||||||
|
}
|
||||||
|
|
||||||
public function form(Form $form): Form
|
public function form(Form $form): Form
|
||||||
{
|
{
|
||||||
$this->from = 'admin@';
|
$this->from = 'admin@'.$this->getEmailDomain();
|
||||||
|
|
||||||
return $form
|
return $form
|
||||||
->schema([
|
->schema([
|
||||||
|
@ -57,9 +62,11 @@ Welcome to your new account.
|
||||||
public function send()
|
public function send()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$emailDomain = $this->getEmailDomain();
|
||||||
|
|
||||||
$phpMailer = new PHPMailer();
|
$phpMailer = new PHPMailer();
|
||||||
$phpMailer->isMail();
|
$phpMailer->isMail();
|
||||||
$phpMailer->setFrom('admin@allsidepixels.com', 'admin@allsidepixels.com');
|
$phpMailer->setFrom('admin@' . $emailDomain, 'admin@'.$emailDomain);
|
||||||
$phpMailer->addAddress($this->to);
|
$phpMailer->addAddress($this->to);
|
||||||
$phpMailer->Subject = $this->subject;
|
$phpMailer->Subject = $this->subject;
|
||||||
$phpMailer->Body = $this->body;
|
$phpMailer->Body = $this->body;
|
||||||
|
|
|
@ -34,9 +34,10 @@ class EmailBoxResource extends Resource
|
||||||
Forms\Components\TextInput::make('username')
|
Forms\Components\TextInput::make('username')
|
||||||
->label('Username')
|
->label('Username')
|
||||||
->disabled(function ($record) {
|
->disabled(function ($record) {
|
||||||
return $record->exists;
|
if ($record) {
|
||||||
})
|
return $record->exists;
|
||||||
->columnSpanFull(),
|
}
|
||||||
|
})->columnSpanFull(),
|
||||||
|
|
||||||
Forms\Components\Select::make('domain')
|
Forms\Components\Select::make('domain')
|
||||||
->label('Domain')
|
->label('Domain')
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
sudo apt-get update -y
|
sudo apt-get update -y
|
||||||
sudo apt-get install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved -y
|
|
||||||
sudo apt-get install postfix postfix-mysql -y
|
sudo DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved -yq
|
||||||
sudo apt-get install mailutils -y
|
sudo DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends install postfix postfix-mysql -yq
|
||||||
sudo apt-get install opendkim opendkim-tools -y
|
sudo apt-get --no-install-recommends install mailutils -yq
|
||||||
sudo apt-get install spamassassin spamc -y
|
sudo apt-get --no-install-recommends install opendkim opendkim-tools -yq
|
||||||
sudo apt-get install clamav clamav-daemon -y
|
sudo apt-get --no-install-recommends install spamassassin spamc -yq
|
||||||
sudo apt-get install amavisd-new -y
|
sudo apt-get --no-install-recommends install clamav clamav-daemon -yq
|
||||||
|
sudo apt-get --no-install-recommends install amavisd-new -yq
|
||||||
|
|
||||||
# Enable email ports
|
# Enable email ports
|
||||||
ufw allow 25
|
ufw allow 25
|
||||||
|
|
Loading…
Reference in a new issue