diff --git a/app/Classes/File/Send.php b/app/Classes/File/Send.php index cba62f2..0eb71ce 100644 --- a/app/Classes/File/Send.php +++ b/app/Classes/File/Send.php @@ -230,6 +230,12 @@ final class Send extends Item */ public function mail(Address $ao): void { + // If the node is marked as hold - dont send any mail. + if ($ao->system->hold) { + Log::info(sprintf('%s: - System [%d] mail is marked as hold - not checking for mail.',self::LOGKEY,$ao->system_id)); + return; + } + // Netmail if ($x=$ao->getNetmail()) { Log::debug(sprintf('%s: - Netmail(s) added for sending to [%s]',self::LOGKEY,$ao->ftn)); diff --git a/app/Http/Controllers/SystemController.php b/app/Http/Controllers/SystemController.php index 300f43e..4794252 100644 --- a/app/Http/Controllers/SystemController.php +++ b/app/Http/Controllers/SystemController.php @@ -258,7 +258,7 @@ class SystemController extends Controller public function add_edit(SystemRegister $request,System $o) { if ($request->post()) { - foreach (['name','location','sysop','phone','address','port','active','method','notes','mailer_type','mailer_address','mailer_port','zt_id'] as $key) + foreach (['name','location','sysop','hold','phone','address','port','active','method','notes','mailer_type','mailer_address','mailer_port','zt_id'] as $key) $o->{$key} = $request->post($key); $o->save(); diff --git a/app/Http/Requests/SystemRegister.php b/app/Http/Requests/SystemRegister.php index 8203de2..70fe914 100644 --- a/app/Http/Requests/SystemRegister.php +++ b/app/Http/Requests/SystemRegister.php @@ -46,6 +46,7 @@ class SystemRegister extends FormRequest ], ($this->so->exists || ($request->action != 'create')) ? [ 'location' => 'required|min:3', + 'hold' => 'required|boolean', 'sysop' => 'required|min:3', 'phone' => 'nullable|regex:/^([0-9-]+)$/', 'address' => 'nullable|regex:/^(?!:\/\/)(?=.{1,255}$)((.{1,63}\.){1,127}(?![0-9]*$)[a-z0-9-]+\.?)$/i', diff --git a/database/migrations/2022_01_15_112024_system_mail_hold.php b/database/migrations/2022_01_15_112024_system_mail_hold.php new file mode 100644 index 0000000..f1798a1 --- /dev/null +++ b/database/migrations/2022_01_15_112024_system_mail_hold.php @@ -0,0 +1,32 @@ +boolean('hold')->default(FALSE); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('systems', function (Blueprint $table) { + $table->dropColumn(['hold']); + }); + } +} diff --git a/resources/views/system/ours.blade.php b/resources/views/system/ours.blade.php index d43fd7b..3f41d38 100644 --- a/resources/views/system/ours.blade.php +++ b/resources/views/system/ours.blade.php @@ -31,7 +31,7 @@ @foreach (\App\Models\SystemZone::select('*')->with(['system','zone.domain'])->get() as $oo)