Hi Guys,
wonder if anybody could help me with an issue I am having with the mail sent by the digium FAX module.

The module works without any issue, it will receive faxes and forward them to the email address specified in the Fax Extension settings. BUT problem is that the email are sent as [email protected] which causes some issues with some user’s mail system as freepbx.pbx is not a recognised domain.

I think there must be some kind of SMTP server in the FAX Module used by asterisk to send mail, I would like to know if the SMTP settings (domain etc) are editable so that I could redirect it through my company SMTP server and standardise the way in which mails are sent.

Can anybody shed any light on this?

Yes, you can set the From email address for faxes - from FreePBX GUI -> Settings -> Fax Configuration.

Add a value for the field - “Outgoing Email address” - this is the From email address.

After 6 years, @panzaman’s question still applies. We see that fax receipt notification email messages are not being sent using sendmail’s configuration the way that voicemail messages do. We use an SMTP gateway to send messages properly to prevent getting marked as spam. The fax module is ignoring these settings and sending directly as if the local machine is an SMTP server. This is causing our fax messages to get marked as spam.

How do you configure the fax module to use a proper SMTP gateway like the rest of FreePBX?

Since I found no answer, I dug into it myself and came up with an actual answer. Unlike FreePBX’s other notification e-mail messages, which are sent using sendmail’s configuration, Digium’s fax module uses CodeIgnite’s e-mail library (which completely ignores sendmail’s configuration).

You’ll need to edit one PHP file:

Find the following line (around line #103):
$email = new CI_Email();

Add the following code after the line above:

        $config = Array(
                'protocol' => 'smtp',
                'smtp_host' => 'ssl://smtp-relay.gmail.com', //Since we are using Gmail's relay
                'smtp_port' => 465

Obviously, use your own SMTP host and port. If needed, you can also add smtp_user and smtp_pass to the $config Array if you need to specify credentials.

Reference: h t t p s : / / codeigniter . com/userguide3/libraries/email.html (sorry, had to break it up since I’m a “new” user)

It’s probably smart not to add to the fax2mail.php file in case it is modified in a future version of FreePBX and instead put the settings into a separate config file. Here’s the relevant text from the link above:

If you prefer not to set preferences using the above method, you can instead put them into a config file. Simply create a new file called the email.php, add the $config array in that file. Then save the file at config/email.php and it will be used automatically. You will NOT need to use the $this->email->initialize() method if you save your preferences in a config file.

I have not tested this myself and am not sure how it works with relative paths.

If you have configured sendmail, then another alternative configuration change you can make is to exclude the smtp_host and smtp_port lines and only include the protocol line:

$config['protocol'] = 'sendmail';

This will force CI_Email to use sendmail (and its configurations) instead of sending directly via SMTP.

Settings > Fax Configuration > Outgoing Fax Email

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.