This section describes the tasks that are typically required for running your test programs that enqueue or dequeue messages. The tasks are divided into two groups, those used to run your test programs in a fully functional messaging environment, and those needed if you want to run them manually:
Add a test channel to the bottom of the imta.cnf file.
(required blank line) x_test x-test-daemon
Add rewrite rules to the top of the imta.cnf file.
The following code fragment illustrates this:
To enable your test channel so that mail can be addressed to user@x_test, recompile your configuration and restart the SMTP server.
Use the instructions found in the following code example:
# imsimta cnbuild # imsimta restart dispatcher
Create the job_controller.site text file.
The file should be owned by the Messaging Server and reside in the same directory as the job_controller.cnf file. The following code example shows the lines you must add to the file:
In the above example, file-path is the full path to your executable program.
Make sure your executable has permissions and ownership such that the Messaging Server can run it.
Restart the Job Controller.
Use the command found in the following code example:
# imsimta restart job_controller
If the program performing enqueues is also a channel that will be dequeuing messages, and more specifically, is doing intermediate processing that leaves the envelope recipient addresses unchanged, then special rewrite rules must be used to prevent a message loop in that the channel just enqueues the mail back to itself. For directions on how to prevent a message loop and other specific examples of rewrite rules, see Preventing Mail Loops when Re-enqueuing Mail.
If the program does not explicitly set the channel name, then you must define the PMDF_CHANNEL environment variable.
The value of that variable must be the name of your channel. The following example shows how to set the PMDF_CHANNEL environment variable:
# PMDF_CHANNEL=x_test # export PMDF_CHANNEL
For further information, see Running Your Enqueue and Dequeue Programs.
Ensure that any environment variables required to run a program linked against the MTA SDK are defined.
See Compiling and Linking Programs for additional information.
Under some circumstances, it might be useful to comment out the master_command= line in the job_controller.site file.
If you do this, you can enqueue mail to your test channel but not have the Job Controller actually run your channel program.
When repeatedly testing your channel program, it is often necessary to restart the Job Controller before each manual test run.
Otherwise, the Job Controller will hand off messages to your program on the first manual run but not the second manual run. The Job Controller will think that retries of the messages need to be delayed by several hours. By restarting the Job Controller, you cause it to “forget” which queued messages are to be deferred. Thus, when you run your channel again, it will be presented with all of the queued messages.