Mautic says 'emails sent', but nothing has actually gone out

Line 141 in ProcessEmailQueueCommand.php is the following:

        //set spool message limit
        if ($msgLimit = $input->getOption('message-limit')) {
            $commandArgs['--message-limit'] = $msgLimit;
        } elseif ($msgLimit = $container->getParameter('mautic.mailer_spool_msg_limit')) {
            $commandArgs['--message-limit'] = $msgLimit;
        }


I don’t see rename() there, so where does that come in? What does ‘supplied resource is not a valid Stream-Context resource’ mean? How does this work together?

I have not made any changes to message limits configuration btw; sending worked fine before with the same settings.

Here’s another one with the same error message. Unfortunately @mindeswx’s solution there does not work for me; I have always had that ‘Use owner as mailer’ setting set to ‘No’.

I guess to use ls | wc you have to change directory to the spool folder first? That is why I got unexpected results earlier I guess.

Where is the spool folder? Here according to Google:

You should find it in either /var/spool/mail/ (the traditional location) or /var/mail (new recommended location).

Could it be that the spool folder on my VPS was changed in an upgrade and that Mautic now can’t find the folder?

Result of ls | wc on /var/spool/mail/ is 0 0 0

Result of ls | wc on /var/mail/ is also 0 0 0

In both cases I would expect two emails that Mautic claims have been sent, but never arrived (in my test email boxes).