How do I inspect mail messages in Behat tests?
Ensure you don't have anti-spam modules installed and doing their job! 

The @BeforeScenario and @AfterScenario code in the original question is correct except in the case where you have an anti-spam module that is interfering with a Scenario.

For example, if  you've got honeypot installed, ensure that you disable the time_limit setting. time_limit is there to protect the Drupal site against spambots .... and test programs! ... on the assumption that humans can't enter stuff in less than a few seconds whereas bots and test programs do so almost instantaneously.

So, if you, as I did, have honeypot installed, then you will need to temporarily disable time_limit for the duration of the test. For example my @BeforeScenario and @AfterScenario code is now as follows:

/** 
   *  @BeforeScenario @email
   */
  public function beforeEmailScenario(BeforeScenarioScope $scope)
  {
    $this-&gt;m_config = \Drupal::configFactory()-&gt;getEditable('mailsystem.settings');
    $this-&gt;saved_mailsystem_defaults = $this-&gt;m_config-&gt;get('defaults'); 
    $this-&gt;m_config
      -&gt;set('defaults.sender', 'test_mail_collector')
      -&gt;set('defaults.formatter', 'test_mail_collector')
      -&gt;save();
    // Reset the state variable that holds sent messages.
    \Drupal::state()-&gt;set('system.test_mail_collector', array());

    // If we have honeypot installed then ensure that we disable time_limit
    // So that automated tests / bots can run  
    $this-&gt;h_config = \Drupal::configFactory()-&gt;getEditable('honeypot.settings');
    $this-&gt;saved_honeypot_time_limit = $this-&gt;h_config-&gt;get('time_limit');
    if ($this-&gt;saved_honeypot_time_limit) {
      $this-&gt;h_config
        -&gt;set('time_limit', '0')
        -&gt;save();
    }
  }

  /** 
   *  @AfterScenario @email 
   */
  public function afterEmailScenario(AfterScenarioScope $scope)
  {
    // revert mail system after scenarios agged with @email
    $this-&gt;m_config
      -&gt;set('defaults.sender', $this-&gt;saved_mailsystem_defaults['sender'])
      -&gt;set('defaults.formatter', $this-&gt;saved_mailsystem_defaults['formatter'])
      -&gt;save();

    // Ensure we protect against spambots again if honeypot is installed
    if ($this-&gt;saved_honeypot_time_limit) {
      $this-&gt;h_config
        -&gt;set('time_limit', $this-&gt;saved_honeypot_time_limit)
        -&gt;save();
    }
  }