Email Server - Apache JAMES

This bridge component enables to send fax based on recieved mails.
This bridge is meant for installation on apache james email servers.

Installation Instructions
1. Install Apache JAMES and validate it works properly
2. Put all jars from lib directory in [Apache JAMES installation directory]/conf/lib
3. Update the mailet configuration as follows:
3.1 copy the mailetcontainer-template.conf found in the [Apache JAMES installation directory]/conf directory
to same directory with new name: mailetcontainer.conf
3.2 Create a processor for fax mails as follows

<processor state="fax" enableJmx="true">
   <mailet match="All" class="org.fax4j.x2fax.email.james.EMail2FaxJamesMailet"/>
</processor>

In this example, the fax processor calls the EMail2FaxJamesMailet mailet which is in charge to send the fax.
All mails handled by this processor go through this mailet.
You can than add more mailet for this fax processor to continue handling the mail, for examle you may add
<mailet match="All" class="Null" />
after the fax mailet to delete the mail.
In similar way you can add custom mailets.
so complete example of processor with both mailets would be:

<processor state="fax" enableJmx="true">
   <mailet match="All" class="org.fax4j.x2fax.email.james.EMail2FaxJamesMailet"/>
   <mailet match="All" class="Null" />
</processor>

3.3 Create a routing mailet that will route specific mails based on the relevant criteria to the fax processor.
In case of default configuration, the matcher can select only mails that have a subject that starts with fax,
in which case the mailet configuration would be:

<mailet match="SubjectStartsWith=fax:" class="ToProcessor">
   <processor>fax</processor>
</mailet>

This configuration needs to be in the root processor.

The default mail parameters the mailet expects are as follows:
-Subject line: fax:[number] where number is the target address
-From email address would be used as sender email
-First attachment (or in case of none, the body text) would be used as the fax data

This may change in case the mail parser was changed via fax4j configuration.
More information on fax4j configuration can be found at: fax4j tutorial

HTTP - Jetty Standalone Server

The Jetty HTTP server enables to expose faxing capabilities via HTTP protocol.

This default parser expects a multi part HTTP request as follows:
-file [file content]
-filename [file name without path]
-priority [priority value as defined in the enum]
-targetaddress [target address]
-targetname [target name]
-sendername [sender name]
-senderfaxnumber [sender fax number]
-senderemail [sender email]

This may change in case the HTTP request parser was changed via fax4j configuration.
More information on fax4j configuration can be found at: fax4j tutorial

HTTP - Deployable WAR (Web2Fax.war)

The Web2Fax.war enables to expose faxing capabilities on top of HTTP web servers.

This default parser expects a multi part HTTP request as follows:
-file [file content]
-filename [file name without path]
-priority [priority value as defined in the enum]
-targetaddress [target address]
-targetname [target name]
-sendername [sender name]
-senderfaxnumber [sender fax number]
-senderemail [sender email]

This may change in case the HTTP request parser was changed via fax4j configuration.
More information on fax4j configuration can be found at: fax4j tutorial

CLI - Command Line Utility

The SendFax utility enables to send fax based on input parameters.

The default command line arguments the CLI expects are as follows:
-file [full file name]
-priority [priority value as defined in the enum]
-target_address [target address]
-target_name [target name]
-sender_name [sender name]
-sender_fax_number [sender fax number]
-sender_email [sender email]
-property:[property name] [property value]

This may change in case the command line arguments parser was changed via fax4j configuration.
More information on fax4j configuration can be found at: fax4j tutorial