Removing "List-Unsubscribe" from civimail headers (for when getting seemingly random unsubscribes)
thanks to @pradpnayak for guidance :D

according to the docs for hook_civicrm_alterMailParams:


  You can add custom headers by appending to $params['headers']. Example:

$params['headers']['X-My-Header'] = 'my header value';

  
  The headers key may not exist in the $params array when passed into the > hook.


so this was the code in an extension to unset the existing 'List-Unsubscribe', and put in a NULL replacement into the headers:

/**
 * Implements hook_civicrm_alterMailParams().
 *
 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_config
 */
function custom_civicrm_alterMailParams(&amp;$params, $context) {
  if ($context == 'flexmailer' || $context == 'civimail') {
    // remove existing header
    unset($params['List-Unsubscribe']);
    // replace via the 'headers' key
    $params['headers']['List-Unsubscribe'] = NULL;
  }
}