This section describes how to use the conversion channel options to bounce, delete, or hold messages. The basic procedure is as follows:
Set OVERRIDE-OPTION-FILE=1 in the appropriate conversions file entry. This tells the conversion channel to read the output options from the OUTPUT_OPTIONS file.
Use the conversion script to determine what action is required on a particular message body part.
In the script, specify the special directive for that action by writing the STATUS=directive_code option in the OUTPUT_OPTIONS file.
A complete listing of special directives can be found in msg-svr-base/include/deprecated/pmdf_err.h. The ones commonly used by the conversion channel are:
Table 13–5 Special Directives Commonly Used By the Conversion Channel
NAME |
Hex Value |
Decimal Value |
---|---|---|
PMDF__FORCEHOLD |
0x0A9C86AA |
178030250 |
PMDF__FORCERETURN |
0x0A9C857A |
178029946 |
PMDF__FORCEDELETE |
0x0A9C8662 |
178030178 |
PMDF__FORCEDISCARD |
0x0A9C86B3 |
178030259 |
PMDF__AGN |
0x0A9C809A |
178028698 |
We will explain the functions of these directives using examples.
To bounce a message using the conversion channel set OVERRIDE-OPTION-FILE=1 in the appropriate conversions file entry and add the following line to your conversion script:
echo "STATUS=178029946" >> $OUTPUT_OPTIONS
If you wish to add a short text string to the bounced message add the following line to the conversion script:
echo OUTPUT_DIAGNOSTIC=text-string >> $OUTPUT_OPTIONS
where text string is something like: “The message sent from your machine contained a virus which has been removed. Be careful about executing email attachments.”
It may be useful to delete parts conditionally, depending on what they contain. This can be done using the output options. By contrast, the DELETE=1 conversion parameter clause unconditionally deletes a message part.
To delete a message part using the output options, set OVERRIDE-OPTION-FILE=1 in the appropriate conversions file entry and add the following line to your conversion script:
echo "STATUS=178030178" >> $OUTPUT_OPTIONS
Similarly, to delete the entire message you could use:
echo "STATUS=178030259" >> $OUTPUT_OPTIONS
It may be useful to hold messages conditionally, depending on what they contain. To delete a message part using the output options, set OVERRIDE-OPTION-FILE=1 in the appropriate conversions file entry and add the following line to your conversion script:
echo "STATUS=178030250" >> $OUTPUT_OPTIONS
This requests that the conversion channel hold the message as a .HELD file in the conversion channel queue.
When a converter script encounters a temporary resource problem (for example, the system can't connect to an external server, a needed file is locked, and so on), you can use PMDF_AGN to tell the conversion channel to consider processing messages that have encountered a temporary error. The MTA will record a "Q" status message in the mail.log_current, retain the message in the conversion channel, and retry the processing later.
Add the following line to your conversion script:
echo "STATUS=178028698" >> $OUTPUT_OPTIONS