Skip to content

mailwatch_sendmail_queue.php does not accomodate SRS recipient addresses #1290

@andrewt918

Description

@andrewt918

The rcpts regex in mailwatch_sendmail_queue.php (line 82) does not allow for an equals sign as is present in SRS addresses. With PHP 8.0 and higher this will result in the following error since the case to set $output[$msgid]['rcpts'] is never met:

Fatal error: Uncaught TypeError: implode(): Argument #1 ($pieces) must be of type array, string given in /usr/local/bin/mailwatch_sendmail_queue.php:277 Stack trace: #0 /usr/local/bin/mailwatch_sendmail_queue.php(277): implode() #1 {main} thrown in /usr/local/bin/mailwatch_sendmail_queue.php on line 277

Prior to PHP 8.0, the @implode suppressed this issue per the PHP docs:

https://www.php.net/manual/en/language.operators.errorcontrol.php

Warning Prior to PHP 8.0.0, it was possible for the @ operator to disable critical errors that will terminate script execution. For example, prepending @ to a call of a function which did not exist, by being unavailable or mistyped, would cause the script to terminate with no indication as to why.

We ran into this after migrating our install to an updated OS with PHP 8.0 instead of PHP 7.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions