When we have multiple addresses, add we want a specific address, return the lowest role, or if strict mode enable, return the lowest role that is higher than the target

This commit is contained in:
2023-12-14 16:53:56 +11:00
parent 301fc33d2f
commit 27c050dc38
6 changed files with 24 additions and 10 deletions

View File

@@ -714,6 +714,7 @@ class Address extends Model
*
* @param bool $update
* @return Packet|null
* @throws \Exception
*/
public function getNetmail(bool $update=FALSE): ?Packet
{
@@ -769,7 +770,7 @@ class Address extends Model
public function getPacket(Collection $msgs,string $passwd=NULL): ?Packet
{
$s = Setup::findOrFail(config('app.id'));
$ao = $s->system->match($this->zone)->first();
$ao = our_address($this->zone->domain,$this);
// If we dont match on the address, we cannot pack mail for that system
if (! $ao) {