Messinet Secure Services
wiki:FAXGateway/Config/Postfix
Last modified 5 months ago Last modified on 01/04/12 11:08:19

FAX Gateway - Postfix Configuration

The simplest method available is to create a "fax.your-domain.com" sub domain in your internal DNS to which all outbound faxes are sent so Postfix can route them to the fax-gw script via transport maps. The creation of the DNS sub domain and discussion of Postfix's highly configurable transport map implementation are outside the scope of this document.

Create /etc/postfix/transport_maps (the file can be named whatever you want) with the following content; when finished, issue the 'postmap /etc/postfix/transport_maps' command.

fax.your-domain.com fax:localhost

Edit /etc/postfix/main.cf to include the following parameters, noting that the 'fax_time_limit' parameter (in seconds) must be longer than the timeout you configure in fax-gw.conf

transport_maps = hash:/etc/postfix/transport_maps
fax_destination_concurrency_limit = 1
fax_destination_recipient_limit = 1
fax_time_limit = 1800

Edit /etc/postfix/master.cf to add the 'fax' service as below; this tells Postfix how to send the incoming e-mail to the Asterisk Fax Gateway script.

fax     unix    -       n       n       -       1       pipe
  flags=D user=asterisk argv=/usr/share/asterisk/agi-bin/fax-gw/fax-gw.agi -s ${sender} -t ${recipient}

The next step, while optional, is recommended and allows only those networks specified in Postfix's "mynetworks" variable to send mail to the "fax.your-domain.com" domain. Also, you should NOT create a public/external DNS entry for the "fax.my-domain.com" host. Ensure that Postfix's "smtpd_recipient_restrictions" variable contains something similar to the following, the relevant part being the "check_recipient_access" line:

smtpd_recipient_restrictions =
  permit_mynetworks
  reject_unauth_destination
  check_recipient_access hash:/etc/postfix/recipient_access

Create /etc/postfix/recipient_access (the file can be named whatever you want) with the following content; when finished, issue the 'postmap /etc/postfix/recipient_access' command.

fax.your-domain.com permit_mynetworks,reject