DSMTP can send a mail message to a program or "robot" for it to do with it as it pleases. Once the message has been given to the robot, DSMTP considers it delivered and, consequently, if the robot cannot be run or does not take the message, DSMTP will bounce the message.
Note: If the robot loses the message it is it's own fault :-) and DSMTP will not notice.
An example of a robot is an autoresponder, which automatically sends a message back to the sender of the message for the recipient. We have provided a version of an autoresponder, called DRespond in the DMail distribution set.
In order to run a robot, you need to create a Special Forward. Typically, you create a forward setting which specifies that a message received by DSMTP should be delivered to a specified robot. In order to let DSMTP know that the message is for a robot, you specify the robots path, starting with the pipe symbol "|" in place of the destination address.
forward firstname.lastname@example.org |drespond.exe
You can turn any mail redirection feature into a 'Special Forward'. So as well as a forward setting you could have an alias file entry "(" alias_file or alias_file_domain) or use a '.forward' file or use the 'fwd=""' field in the response to a user database lookup.
Examples: In order to deliver all mail for email@example.com to an
autoresponder called, drespond.exe you might set up an alias like,
Note: in order to include command line arguments for the robot, put the
entire command line within quotes, e.g.
Aliases and forward rules do not deliver the message to the original
recipient, so if you want the original recipient to get the message as
well as the robot, you will have to use a
forward_cc setting, e.g.
An autoresponder accepts a mail message from the SMTP server, analyses who it is for and who it was from and then sends a preset message back to the sender. Often the preset message says something like - "john is on holiday, he will respond to your message when he gets back".
DRespond is Netwin's autoresponder robot. We provide it in a ready built form on all platforms. If it is not in your distribution set, please contact DMail support.
OR, add an alias line like this to an alias file:
OR, in version 2.5d and above, you can enter the robot in the fwd="" field returned by an external authentication module:
DRespond takes a text file as it's main argument. The text within this file is used to form the body of the message to be sent as the autoresponse. If you use the -hasheader option then you can specify the "From:" and "Subject:" headers in the message text file. They should be the first two lines, and then there should be a blank line between them and the message body.
DRespond can be run from the command line, which is a good way to check that it is doing what you require, e.g.
Usage: drespond file.name [-debug] [-hasheader] [-subject "string"] [-from person@domain]
NOTE: currently, drespond cannot take a mapped drive path in the message file name on windows NT, e.g. f:\shared\message.txt or \\shared\message.txt do not work. We think that this is a windows NT bug because of the robot being spawned as a sub-process by DSMTP - it works when the robot is run from the command line. If you are more enlightened than us :-) or have got it to work, please contact firstname.lastname@example.org and let us know.
Here is an example message text file, file.name, with the "from" and "subject" headers included: