Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Oct 2, 2024
1 parent 5d42587 commit 7326062
Show file tree
Hide file tree
Showing 12 changed files with 250 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/Modules/Email/App/Console/SetupEmailServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function handle()
$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);

$findDkim = DomainDkim::where('domain_name', setting('email.hostname'))->first();
$findDkim = DomainDkim::where('domain_name', setting('email.domain'))->first();
$postfixMainCf = PhyreBlade::render('email::server.postfix.main.cf', [
'hostName' => setting('email.hostname'),
'domain' => setting('email.domain'),
Expand Down
67 changes: 67 additions & 0 deletions web/Modules/Email/App/Filament/Resources/DomainDkimResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

namespace Modules\Email\App\Filament\Resources;

use Modules\Email\App\Filament\Resources\DomainDkimResource\Pages;
use Modules\Email\App\Filament\Resources\DomainDkimResource\RelationManagers;
use Modules\Email\App\Models\DomainDkim;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;

class DomainDkimResource extends Resource
{
protected static ?string $model = DomainDkim::class;

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
{
return $form
->schema([
//
]);
}

public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('domain_name'),
Tables\Columns\TextColumn::make('description'),
Tables\Columns\TextColumn::make('selector'),
// Tables\Columns\TextColumn::make('private_key'),
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}

public static function getRelations(): array
{
return [
//
];
}

public static function getPages(): array
{
return [
'index' => Pages\ListDomainDkims::route('/'),
'create' => Pages\CreateDomainDkim::route('/create'),
'edit' => Pages\EditDomainDkim::route('/{record}/edit'),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Modules\Email\App\Filament\Resources\DomainDkimResource\Pages;

use Modules\Email\App\Filament\Resources\DomainDkimResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;

class CreateDomainDkim extends CreateRecord
{
protected static string $resource = DomainDkimResource::class;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Modules\Email\App\Filament\Resources\DomainDkimResource\Pages;

use Modules\Email\App\Filament\Resources\DomainDkimResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

class EditDomainDkim extends EditRecord
{
protected static string $resource = DomainDkimResource::class;

protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Modules\Email\App\Filament\Resources\DomainDkimResource\Pages;

use Modules\Email\App\Filament\Resources\DomainDkimResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

class ListDomainDkims extends ListRecords
{
protected static string $resource = DomainDkimResource::class;

protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php

namespace Modules\Email\App\Filament\Resources;

use Faker\Provider\Text;
use Modules\Email\App\Filament\Resources\DomainDkimSigningResource\Pages;
use Modules\Email\App\Filament\Resources\DomainDkimSigningResource\RelationManagers;
use Modules\Email\App\Models\DomainDkimSigning;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;

class DomainDkimSigningResource extends Resource
{
protected static ?string $model = DomainDkimSigning::class;

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
{
return $form
->schema([
//
]);
}

public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('author'),
Tables\Columns\TextColumn::make('dkim.domain_name'),
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}

public static function getRelations(): array
{
return [
//
];
}

public static function getPages(): array
{
return [
'index' => Pages\ListDomainDkimSignings::route('/'),
'create' => Pages\CreateDomainDkimSigning::route('/create'),
'edit' => Pages\EditDomainDkimSigning::route('/{record}/edit'),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Modules\Email\App\Filament\Resources\DomainDkimSigningResource\Pages;

use Modules\Email\App\Filament\Resources\DomainDkimSigningResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;

class CreateDomainDkimSigning extends CreateRecord
{
protected static string $resource = DomainDkimSigningResource::class;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Modules\Email\App\Filament\Resources\DomainDkimSigningResource\Pages;

use Modules\Email\App\Filament\Resources\DomainDkimSigningResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

class EditDomainDkimSigning extends EditRecord
{
protected static string $resource = DomainDkimSigningResource::class;

protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Modules\Email\App\Filament\Resources\DomainDkimSigningResource\Pages;

use Modules\Email\App\Filament\Resources\DomainDkimSigningResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

class ListDomainDkimSignings extends ListRecords
{
protected static string $resource = DomainDkimSigningResource::class;

protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
}
10 changes: 9 additions & 1 deletion web/Modules/Email/App/Http/Livewire/DkimSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ public function render()
{
$secure = $this->secure();
$verify = $this->verify();
$mainDomain = $this->getMainDomain();

return view('email::livewire.dkim-setup', [
'secure' => $secure,
'verify' => $verify,
'mainDomain' => $mainDomain,
]);
}

public function verify()
public function getMainDomain()
{
$getMainDomain = '';
$parseDomain = explode('.', $this->domain);
Expand All @@ -32,6 +34,12 @@ public function verify()
$getMainDomain = $this->domain;
}

return $getMainDomain;
}
public function verify()
{
$getMainDomain = $this->getMainDomain();

$checks = [];
$checkOne = shell_exec('dig @1.1.1.1 +short MX '.$getMainDomain);
$checkOnePass = false;
Expand Down
5 changes: 5 additions & 0 deletions web/Modules/Email/App/Models/DomainDkimSigning.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ class DomainDkimSigning extends Model

protected $table = 'domain_dkim_signings';


public function dkim()
{
return $this->belongsTo(DomainDkim::class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
@endif

<div>
You do not have a DMARC record, please add a TXT record to your domain _dmarc.multiweber.com with the following value:
You do not have a DMARC record, please add a TXT record to your domain _dmarc.{{$mainDomain}} with the following value:
<br />
v=DMARC1; p=none
</div>

<div>
You do not have a SPF record, please add the following one to your domain multiweber.com:
You do not have a SPF record, please add the following one to your domain {{$mainDomain}}:
<br />
v=spf1 a mx ip4:91.107.217.103 ~all
</div>
Expand Down

0 comments on commit 7326062

Please sign in to comment.