Fax to multiple emails

Anyone know how to have the faxes go to multiple email addresses not just the one? Any help is greatly appreciated.

There are a lot of ways to do this, the easiest of which is to have the initial email go to an alias or distribution list that then sends to the other recipients.

The details of theimplementation depend entirely on what you have available to you and how your existing mail infrastructure is set up.

I need multiple mail addresses tied to different extensions. I suppose the only needed action is injection of FAX_RX_EMAIL variable. But how can it be implemented?

[email protected]%[email protected]%[email protected]
; We use a percentage sign to separate the emails
;

exten => s,n(faxloop),Set(FAX_EMAIL=${CUT(FAX_RX_EMAIL_LIST,%,1-)})
exten => s,n,system(/var/lib/asterisk/bin/fax-process.pl --to ${FAX_MAIL} --from ${FAX_RX_FROM} --dest “${FROM_DID}” --subject “Fax from ${URIENCODE(${CALLERID(number)})} ${URIENCODE(${CALLERID(name)})}” --attachment fax_${URIENCODE(${CALLERID(number)})}.pdf --type application/pdf --file ${FAXFILE});
exten => s,n,GotoIf($[“foo${FAX_RX_EMAIL_LIST}=foo”]?end:faxloop)
exten => s,n(end),Noop(Exiting fax)

The loop I copied from extension_additional.conf, and haven’t test yet, but that’s maybe the right way to do so.
You can set a complex variable, consist of all the email needed, and then do a loop through that. The system(/var/lib/asterisk/bin/fax-process.pl) line is the most important part. You can specify more variable as needed. Here, I only give you the idea. Haven’t got time to test this yet. :slight_smile:
Best regards

Thanks for your answer.
I’ve already found a more GUI-friendly solution at Russian asteriskforum. :slight_smile:

Made a custom extension:

[custom-faxreceive] exten => s,1,Set(FAX_RX_EMAIL=${RGPREFIX}) exten => s,n,Goto(ext-fax,in_fax,1)
Tied it to GUI with Custom Context & Custom Destination. Fax extensions are created as Ring Groups with fake extensions, e-mail instead of RG Prefix and custom no-answer destinations.

Ok first thanks to all for the replies greatly appreciated. I have got it figured out now, so here was my solution. I needed a very easy way for the pbx to send the fax email to multiple email addresses. If I want to do this now I separate the email addresses with a “,”(backslash comma). In order for that to work I updated the “fax-process.pl” script so when it gets ready to send the email it splits the string on the comma like this.

" $smtp-> recipient(split(’,’,"$to"));"

I also had to change the table in mysql to allow more than 20 characters on that field.

No big changes to the gui just enter multiple emails in the same one text box for fax-email and your done.

Oh and by the way I have tested this and it works great! If you have any questions post here or email me

[email protected]

I think FreePBX should save the FAX_RECEIVE email array in an astDB value. We can change this value at anytime.
And in Asterisk 1.6, when you build SpandSP, app_fax will work. There’s no need to use app_rxfax and app_txfax from SpandSP anymore. This will make fax_process.pl change alot in its structure, eg, compare the version, and choose the right application.

After years of doing this, I found the best way to do this is like Kodak said, to use email alias or distribution list that then sends to the other recipients.

This way it matters not when a update happens on the PBX, plus as all my customers have web based GUI for the email servers to add / change / reassign the emails without touching the PBX, it is a better solution all around.
we also use a email filtering system to redirect faxes based on the time once they are in the email system.