Skip to content

[bug]: Sender address HTML entities not decoded #1323

Description

@jerryriggin

FreePBX Version

FreePBX 17

Issue Description

Sender address HTML entities not decoded

fax 17.0.3.5: Outgoing Email address stored HTML-encoded, breaking fax2mail envelope sender
Summary
Fax Configuration → Outgoing Email address stores < and > as < / >. fax2mail.php does not decode them, so the display-name form documented in the field's own help text produces an invalid envelope sender and inbound fax emails are never delivered.
Steps to reproduce

  1. Fax Configuration → Outgoing Email address → eFax efax@jraphones.com (the form the help text recommends). Submit, Apply.
  2. select value from fax_details where key='sender_address'
  3. Receive an inbound fax and check the mail log.
    Expected — envelope sender efax@jraphones.com, display name eFax.
    Actual — stored as:
    eFax &lt;efax@jraphones.com&gt;
    and postfix logs:
> from=<eFax> ... nrcpt=3
> to=<efax@jraphones.com&gt>    status=bounced (bad address syntax)
> to=<&lt@cca03.jraphones.com>  status=bounced (unknown user: "&lt")
> to=<jerry@riggin.net>         status=bounced (Sender address is not allowed)
> The mangled string is parsed into three bogus recipients and an envelope sender of eFax. Any relay enforcing sender ownership rejects the message. The bounce is addressed to the same invalid sender, so it bounces too and the failure is completely silent.

The mangled string is parsed into three bogus recipients and an envelope sender of eFax. Any relay enforcing sender ownership rejects the message. The bounce is addressed to the same invalid sender, so it bounces too and the failure is completely silent.
Suggested fix — decode at point of use:

$from = html_entity_decode((string) $mod_fax->getSetting("sender_address"), ENT_QUOTES, "UTF-8");
Better still, stop HTML-encoding on save and escape only on output.
Workaround
Enter the bare address (efax@jraphones.com) with no display name — it contains nothing to encode.
Impact
Any install whose smarthost enforces sender ownership (IONOS, Google Workspace, Microsoft 365, most ISPs) silently stops delivering inbound fax notifications, with no error surfaced in the GUI.

Operating Environment

FreePBX 17.0.33
fax module 17.0.3.5
Asterisk 22.10.1
PHP 8.2.33
OS Debian GNU/Linux 12 (bookworm)

Relevant log output

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageTriage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions