Fix finding echomail origin AKA by including the domain name
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 39s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m53s
Create Docker Image / Final Docker Image Manifest (push) Successful in 12s

This commit is contained in:
Deon George 2024-06-05 21:26:09 +10:00
parent 2509aa99e1
commit 6b1cb8cd78

View File

@ -133,7 +133,7 @@ final class Echomail extends Model implements Packet
// Make sure our origin contains our FTN
$m = [];
if ((preg_match('#^(.*)\s+\(([0-9]+:[0-9]+/[0-9]+.*)\)+\s*$#',$model->set_origin,$m))
&& (Address::findFTN($m[2])->id === $model->fftn_id))
&& (Address::findFTN(sprintf('%s@%s',$m[2],$model->fftn->domain->name))?->id === $model->fftn_id))
$model->origin_id = Origin::firstOrCreate(['value'=>$m[1]])->id;
}