Skip to content

[bug]: Missing attachment format silently sends empty fax emails #1324

Description

@jerryriggin

FreePBX Version

FreePBX 17

Issue Description

Missing attachment format silently sends empty fax emails

fax 17.0.3.5: absent attachformat defaults to 'none' when 'Both' is selected — fax emails delivered with no attachment, no warning

Summary

When a user has no fax/attachformat setting, fax2mail.php coerces the missing value to 'none' and sends a fax notification email containing no fax. Nothing is logged and the email is delivered successfully, so it looks like the fax simply never arrived.

Steps to reproduce

  1. Have a user with fax enabled and an email address, but no fax/attachformat row in userman_users_settings.
  2. Receive a fax for that user.
  3. The email arrives with no attachment. Message size in the mail log is ~750 bytes rather than tens of KB.
    Expected — a missing value inherits a usable default (the module already uses 'pdf' as its default elsewhere), or the condition is at minimum logged.
    Actual — modules/fax/bin/fax2mail.php line 52:
    $var['attachformat'] = !empty($var['attachformat']) ? $var['attachformat'] : 'none';
    then:
    case 'none':
    break;

Suggested fix
Delete the 'Both' option and default to 'PDF' for consistency with the rest of the module, or log a warning when falling back to 'none' so the condition is diagnosable.
Impact
A user with fax correctly enabled receives a stream of valid, well-addressed, entirely empty fax notifications. Because delivery succeeds, mail logs look healthy and the fault presents as "faxes are not arriving" with no evidence anywhere.

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