switch ($this->headerRules
[$name] ?? self::HEADER_SET_IF_EMPTY
) { case self::HEADER_SET_IF_EMPTY:
break;
case self::HEADER_REPLACE:
$headers->
remove($name);
$headers->
add($header);
break;
case self::HEADER_ADD:
if (!Headers::
isUniqueHeader($name)) { $headers->
add($header);
break;
} $h =
$headers->
get($name);
if (!
$h instanceof MailboxListHeader
) { throw new RuntimeException(sprintf('Unable to set header "%s".',
$name));
} Headers::
checkHeaderClass($header);