Auto Responders and MBF Files
Creating and Using Auto Responders and MBF Files.
Auto responders are useful tools for automating events to be triggered by an incoming email message. One popular use for auto responders is to send back a user-defined message to any person who sends an email to a user who will be unable to read it due to a vacation, illness, or some other circumstance. Using the auto-response mechanisms provided with MDaemon Server v8 (located in Accounts Auto Responders…), incoming mail can act as a trigger generating automated and personalized replies or as the cause of a server hosted process in which the message itself is passed as a command line parameter. Automated response message files (*.RSP files) can contain any template string available to an MBF file.
MBF or Mailbox Format Files are text files designed to allow cross compatibility with other email transport systems that can accept ASCII text files into their mail streams. MBF files are essentially templates that contain a set of special formatting macros that enable MDaemon to transform an RFC-822 message into a variety of other text-based formats. Using MBFs, MDaemon can be configured to automatically reformat incoming mail into specific alternatives on a per mailbox basis. When a message arrives for an MDaemon account, the account's MBF file is used to reformat the incoming data before distributing it to the user.
See Creating Auto Response Scripts for more information on creating automated response message files to be used by Auto Responders.
See Creating and Using MBF Files for more information on MBF files.
Account List
This control lists all available local mailboxes that can host an auto responder. Double-click an account in this list to open its corresponding Auto Resp dialog. Use the Auto Resp dialog, which is outlined below, to configure an auto responder for the account.
Auto Response Event
Enable an auto responder for this account
Enable this control to activate an auto responder for the account.
Use this auto response script
This field specifies the full path and filename of the response file (*.RSP) that will be processed and dispatched to the message sender. This file will first be passed through the filtering mechanism associated with MBF files. Any template string available for use in an MBF file will also be available for use in an auto-response file.
Schedule
Click this button to open the Schedule dialog on which you can set a start and end date and time for the Auto Responder to be active. Leave the Schedule blank if you want the Auto Responder to be active continually.
Do not send auto response if message is from one of these addresses
Here you can list addresses that you wish to be excluded from responses initiated by this Auto Responder.
Del
Click this button to delete selected entries from the list of excluded addresses.
Add
After entering an address in the New Excluded Address text box, click this button to add it to the list of excluded address.
New excluded address
If you wish to add an address to the list of excluded addresses enter it here and then click the Add button.
Run a Program
Run this program
This field specifies the full path and filename to a program that will be launched when new mail arrives at the specified mailbox. Care must be taken to ensure that this process terminates properly and can run unattended. Optional command line parameters can be entered immediately following the executable path if desired.
Pass message to process
Select this option and the process specified in the Run This Process field will be passed the name of the triggering message as the first available command line parameter. Note that by the time the message name is passed to the specified process the account's MBF file will already have been applied. This is useful in that applying an MBF can reformat the message into a consistent structure regardless of the source of the original message. When the auto responder is setup on an account which is forwarding mail to another location and not retaining a local copy in its own mailbox (see Forwarding) then this functionwill be disabled.
Add sender to this mailing list
If a mailing list is entered in this field then the sender of the mail message will be automatically joined to that mailing list. This is a very handy feature for building automatic lists.
Remove sender from this mailing list
If a mailing list is entered in this field then the sender of the mail message will be automatically removed from the specified mailing list.
Exception
Use the Exception List to configure global exceptions to auto responders-messages from entries in the list will not receive any auto responders. Both email addresses and header/value pairs can be included on the list. Enter one address or header/value pair per line. Wildcards are permitted.
Options
Auto responders are triggered by intra-domain mail
Click this option if you want local mail to trigger Auto Responders.
Limit auto responses to one per day per recipient
Click this option to limit the number of auto responder generated messages to one per day per recipient. This will prevent a person from receiving the same redundant auto response message from you over and over again in the same day every time he or she sends you an email.
Creating Auto Response Scripts
Auto Response scripts define the m
essages that are returned as the result of an auto-response event. They are constructed the same as MBF files and can contain the same macros. However, several additional macros are provided which allow you to develop more powerful auto-response messages.
In addition to those template variables defined for MBF files, auto-response scripts can use any or all of the following macros, which override the values parsed from the original message:
%SetSender% ex: %SetSender%=mailbox@host.org
MDaemon will treat this address as if it had sent the original message.
%SetRecipient% ex: %SetRecipient%=mailbox@host.org
Sets the address that will receive the auto-response message, regardless of the original sender.
%SetReplyTo% ex: %SetReplyTo%=mailbox@host.org
Controls the value of the RFC-822 ReplyTo header
%SetActualTo% ex: %SetActualTo%=mailbox@host.org
Changes who MDaemon thinks the "actual" recipient of the mail message should be.
%SetSubject% ex: %SetSubject%=Subject Text
Replaces the value of the message's subject.
%SetMessageId% ex: %SetMessageId%=ID String
Changes the ID string of the message.
%SetPartBoundary% ex: %SetPartBoundary%=Boundary String
Changes what MDaemon thinks is the part boundary.
%SetContentType% ex: %SetContentType%=MIME type
Changes what MDaemon thinks is the content-type of the message.
%SetAttachment% ex: %SetAttachment%=filespec
Forces MDaemon to attach the specified file to the newly generated auto-response message.
Auto Response Script Samples
A typical auto response script might be called VACATION.RSP and look like this:
Greetings $SENDER$
You're message regarding '$SUBJECT$' won't be read by me because I'm on vacation so LEAVE ME ALONE!
Yours truly (yeah right!),
$RECIPIENT$
This is essentially the VACATION.RSP file that shipped with the first version of MDaemon. This example script uses macros developed for MBF files. Using the macros defined in the above table you can also control the headers which will be generated when this auto-response script is processed and mailed back to $SENDER$.
Let's amend our old VACATION.RSP file to use some of the new macros:
Greetings $SENDER$
You're message regarding '$SUBJECT$' won't be read by me because I'm on vacation so LEAVE ME ALONE!
Yours truly (yeah right!),
$RECIPIENT$
%SetSubject%=RE: $SUBJECT$ %SetAttachment%=c:\windows\bugoff.exe
The new message, which will be generated using this script as a template, will have a custom subject line and will have the specified file encoded as a MIME attachment.
The %SetSubject%=RE: $SUBJECT$ instruction is handled in this way:
- The $SUBJECT$ portion is expanded and replaced by the original message's subject text. This makes the string equivalent to: %SetSubject%=RE: Original Subject Text.
- MDaemon replaces the original subject, which it has stored in its internal buffers, with this newly calculated one. From then on any call to $SUBJECT$ or use of the subject field will return the new result.
Note the placement of the new macros - they are listed at the bottom of the response script. This is needed to avoid side effects. For example, if the %SetSubject% macro were placed before the $SUBJECT$ macro, which appears in the third line of the response script, the subject text will have been changed by the time the $SUBJECT$ macro is expanded. Therefore, instead of replacing $SUBJECT$ with the content of the original message's "Subject:" header, it will be replaced with whatever you have set the value of %SetSubject% to be.
