diff --git a/app/Models/File.php b/app/Models/File.php index 2f281e0..a11f30b 100644 --- a/app/Models/File.php +++ b/app/Models/File.php @@ -88,6 +88,10 @@ class File extends Model $matches = []; preg_match(sprintf('#^(%s)\ ((@?)(\d+)(\ ([A-Z]{3}([\+\-][0-9]+)))?)\ ?(.*)$#',Address::ftn_regex),$line,$matches); + // If our domain is blank, get the model's domain + if (! Arr::get($matches,6)) + $matches[1] .= '@'.$model->filearea->domain->name; + if ($x=Arr::get($matches,1)) { $ftn = Address::parseFTN($x); @@ -126,6 +130,9 @@ class File extends Model $model->set_seenby = $model->set_seenby->merge($path->pluck('address.ftn3d'))->unique()->filter(); foreach ($model->set_seenby as $sb) { + if (! preg_match('/@([a-zA-Z0-9\-_~]{0,8})/',$sb)) + $sb .= '@'.$model->filearea->domain->name; + $ftn = Address::parseFTN($sb); $ao = ($zone->domain->flatten)