Enable system mail hold

This commit is contained in:
Deon George
2022-01-15 22:38:45 +11:00
parent 6f1d47a6ab
commit c7e6bb2575
6 changed files with 60 additions and 3 deletions

View File

@@ -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));

View File

@@ -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();

View File

@@ -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',