The easiest way to accomplish this is to determine which order the ports are increasing (this can be different depending on the hardware). The best way to determine this is to check the hardware documentation.
Another approach is to plug in a single phone line to the far right port of the first board, and open only the first com port which is attached to the device. Try to send a fax. If the software reports no dialtone, then you have the wrong port. Plug the phone line in the far left port and try again. Once you determine which port is the first one, then the rest of the ports on that card would be ports 2-8, and the first four ports on the other card would be ports 9-12. Please keep in mind that the actual com port number may be different. For example, Com 3 might be the first port on your first card.