|
Version 6.3 |
|
| ||||||||||||||||||||||
The Submitted FolderThe CommuniGate Pro PIPE module creates the Submitted folder inside the CommuniGate Pro base folder. The PIPE module scans this folder periodically, and processes the files with the .sub file name extension. When such a file is found, the module copies it into a message queue file and submits that file to the Server kernel for processing. The .sub text files should contain messages in the RFC822 format. The module uses the data in the RFC822 header fields to compose the message envelope.
If processing of a .sub file fails (for example, if the file does not have any recipient address), the module places a record into the System Log, and changes the file extension to .bad. If a .sub file is submitted successfully, the file is deleted from the Submitted folder. Because of the way the PIPE module processes the Submitted folder, it is recommended to compose messages in a different file directory and then move the composed .sub files to the Submitted folder, or to compose messages in the Submitted folder, in files with the .tmp file name extension, and then change the file name extension to .sub. Messages submitted via the PIPE module are marked as "received from a trusted source", so they can be relayed without restrictions. The Submitted folder is used for Legacy Mail Emulation. Delivering to External ApplicationsThe PIPE module accepts all messages directed to the pipe domain. The local part of the message address specifies the external application to launch. The part can contain parameters, and can be enclosed into the quotation marks.
<*@somedomain> = exec*@pipe
this Router record will direct messages sent to the joe@somedomain address to
the execjoe application.
<*@somedomain> = "execall\ -u\ *"@pipe
this Router record will direct messages sent to the joe@somedomain address to
the execall application started with the -u joe parameters.
To limit the set of applications that can be started via the PIPE module, the external application directory is specified as one of the PIPE module settings. The application names specified in message addresses can not include the slash (/) or the backslash (\) symbols, and they cannot start with the dot (.) symbol, and it specified the name of the application (program) file in the external application directory. The message text (including the message headers and the message body) is passed to the
external application as its standard input.
When the external application completes, the PIPE module reads and discards the application standard output. Make sure that your application does not write anything to its standard output, so it is not blocked when the communication channel (pipe) buffer between the application and the Server is full. When the external application completes, the PIPE module reads its standard error channel. If it is not empty, the message delivery fails, and the text written to standard error is sent as an error report to the message sender. Serialized DeliveryIn order to allow several PIPE processors to deliver messages simultaneously,
the PIPE module creates a separate queue for each message it has to deliver. If you want to
serialize processing, you can use the following form of the PIPE address:
<incoming> = "queue[PROC1] procin -mark"@pipe
All messages sent to the <incoming@maindomain.com> and <control@maindomain.com>
will be processed one-by-one using one PIPE processor.
<control> = "queue[PROC1] procin1 -control"@pipe <archiver> = "queue[ARCH] appendfile /var/archive"@pipe For PIPE addresses that do not have the queue[name] prefix, the PIPE module creates separate queues with numeric names. Command TagsThe message text (the header and the body) is sent to the task as that task standard input (stdin). An application name can be prefixed with the [FILE] tag:[FILE] application parameters When this prefix is used, the application standard input will be empty (closed), or it will contain only the message header fields added by Rules. The string -f Queue/fileid.msg (the -f flag and the Message file name, relative to the base directory) will be appended to the end of the application parameters: -f Queue/12002345.msg Note: The beginning of a Queue file contains the service information (envelope, options, etc.). The application should ignore this information skipping the file data till the first empty line. The message itself starts after that first empty line in the Queue file. Note: Header fields added to the message by Server-wide and Cluster-wide Rules are not stored in the message Queue file, they are sent via the task standard input. Note: this prefix should not be used on MS Windows platform, as the Server keeps the message file open, making it impossible for an external Task to read the file. An application name can be prefixed with the [RETPATH] tag:[RETPATH] application parameters When this prefix is specified, the string "-p" followed by the message return-path address is added to the end of the application parameters: -p address@domain.com An application name can be prefixed with the [RCPT] tag: [RCPT]application parameters When this prefix is specified the string "-r" followed by the original recipient address is added to the end of the application parameters: -r address1@domain1.com An application name can be prefixed with the [STDERR] tag (see below). An application name can have several prefix strings, and they can be specified in any order. If several of [FILE], [RETPATH], and [RCPT] prefix strings are specified, the -f flag and its parameter are added first, followed with the -p flag and its parameter, followed with the -r flag and its parameter. If the [STDERR] prefix is specified and the external application completes sending some data to its standard error channel, the standard error data is used to compose the error report text. Configuring the PIPE moduleUse the WebAdmin Interface to configure the PIPE module. Open the Mail pages in the Settings realm, then open the PIPE page.
Foreign Queue ProcessingIn emergency situations you may need to process an additional Queue directory without stopping your server. These situations include a server hardware failure when the rescued Queue files should be processed with some other, already running server. To process an additional Queue directory, move it to the base directory of a running server as the ForeignQueue directory. If you prefer to use symbolic links, make sure that the Queue and ForeignQueue directories are created on the same file system. Every 3 minutes the PIPE module checks if the ForeignQueue directory exists in the server base directory. If the ForeignQueue directory is found, the module moves all .msg files from the ForeignQueue to the Queue directory (it can rename the files in the process), and deletes all .tmp files found in the ForeignQueue directory. Files with other extensions are left in the ForeignQueue directory. All moved .msg files are submitted to the Server kernel, into the ENQUEUER queue, and the Server starts to process them in the same way it processes all submitted messages. When the scanning process is completed, the ForeignQueue directory can be removed from the base directory. |