input()); if($inbound->mailboxHash()){ //check if we can find the ticket_hash LookupTicketInvitation::setServerByField('ticket_hash', $inbound->mailboxHash()); } elseif($inbound->to()) { //otherwise check if we can find the unique localpart. $parts = explode("@", $inbound->to()); LookupAccount::setServerByField('support_email_local_part', $parts[0]); } /** * If we don't trigger any of these if blocks, we need to die() */ return $next($request); } }