Please enable JavaScript to view this site.

MDaemon Messaging Server 21.5

Navigation: Accounts Menu > Account Settings > Autoresponders

Creating Auto Response Messages

Scroll Prev Top Next More

OOF.mrk files are plain ASCII text files contained in each user's root \data\ folder, which define the messages that are returned as the result of an autoresponder. When an auto response message is triggered by an autoresponder, the file is processed and scanned for macros, which will then be replaced by actual data from the incoming message that triggered the response. Lines beginning with the "#" character are ignored and are used for comments. There are two sample messages listed below.

Auto Response Macros

$HEADERS$

This macro will be replaced by all of the incoming message's headers. Text immediately preceding this macro will be duplicated at the start of each expanded line.

$HEADER:XX$

This macro will cause the value of the header specified in place of "xx" to be expanded in the message. For example:  If the incoming message has "TO: joe@example.com" then the $HEADER:TO$ macro will expand to "joe@example.com". If the original message has "SUBJECT: This is the subject" then the $HEADER:SUBJECT$ macro would be replaced with the text "This is the subject".

$BODY$

This macro will be replaced by the entire message body. In an attempt to preserve character sets for different languages, MDaemon will read the message body as binary data rather than pure text, thus allowing a  byte-for-byte copy of the message body.

$BODY-AS-TEXT$

Like the $BODY$ macro, this macro will be replaced by the entire message body, but as text rather than binary. Text immediately preceding this macro will be duplicated at the start of each expanded line. So, using ">>$BODY-AS-TEXT$" in a script would place each line of the original message into the generated message, but each line would begin with ">>". Text can also be added to the right of this macro.

$SENDER$

This macro resolves to the full address contained in the incoming message's "From:" header.

$SENDERMAILBOX$

This macro resolves to the mailbox of the sender. The mailbox is the portion of the email address to the left of the "@" symbol.

$SENDERDOMAIN$

This macro resolves to the domain of the sender. This is the portion of the email address to the right of the "@" symbol.

$RECIPIENT$

This macro resolves to the full address of the message recipient.

$RECIPIENTMAILBOX$

This macro resolves to the mailbox of the message recipient.  The mailbox is the portion of the email address to the left of the "@" symbol.

$RECIPIENTDOMAIN$

This macro resolves to the domain of the message recipient.  The domain is the portion of the email address to the right of the "@" symbol.

$SUBJECT$

This macro resolves to the value of the "Subject:" header.

$MESSAGEID$

This macro resolves to the value of the "Message-ID" header.

$CONTENTTYPE$

This macro resolves to the value of the "Content-Type" header.

$PARTBOUNDARY$

This macro resolves to the value of the MIME "Part-Boundary" value found in the "Content-Type" header for multipart messages.

$DATESTAMP$

This macro expands to an RFC-2822 style date-time stamp line.

$ACTUALTO$

Some messages may contain an "ActualTo" field which generally represents the destination mailbox and host as it was entered by the original user prior to any reformatting or alias translation. This macro expands to that value.

$ACTUALFROM$

Some messages may contain an "ActualFrom" field which generally represents the origination mailbox and host prior to any reformatting or alias translation. This macro expands to that value.

$REPLYTO$

This macro resolves to the value found in the "ReplyTo" header.

$PRODUCTID$

This macro expands to the MDaemon version information string.

$AR_START$

Returns the auto-responder start date/time.

$AR_END$

Returns the auto-responder end date/time.

Header Replacement Macros

The macros listed below control the auto response message's headers.

%SetSender%

ex: %SetSender%=mailbox@example.com

Just for the purpose of the auto-response message, this macro resets the sender of the original message before constructing the auto-response message headers. Thus, this macro controls the auto-response message's TO header. For example, if the sender of the original message were "user2@example.org" and recipient's autoresponder used the %SetSender% macro to change it to "user1@example.com" then the auto-response message's TO header would be set to "user1@example.com."

%SetRecipient%

ex: %SetRecipient%=mailbox@example.com

Just for the purpose of the auto-response message, this macro resets the recipient of the original message before constructing the auto-response message headers. Thus, this macro controls the auto-response message's FROM header. For example, if the recipient of the original message were "michael@example.com" and Michael's account had an autoresponder using the %SetRecipient% macro to change it to "michael.mason@example.com," then the auto-response message's FROM  header would be set to "michael.mason@example.com."

%SetReplyTo%

ex: %SetReplyTo%=mailbox@example.com

Controls the value of the auto-response message's ReplyTo header.

%SetSubject%

ex: %SetSubject%=Subject Text

Replaces the value of the original message's subject.

%SetMessageId%

ex: %SetMessageId%=ID String

Changes the ID string of the message.

%SetPartBoundary%

ex: %SetPartBoundary%=Boundary String

Changes the part boundary.

%SetContentType%

ex: %SetContentType%=MIME type

Changes the content-type of the message to the declared value.

%SetAttachment%

ex: %SetAttachment%=filespec

Forces MDaemon to attach the specified file to the newly generated auto-response message. Only files specified on the Attachments screen can be attached to autoresponders.

Auto Response Message Samples

A simple oof.mrk auto response message using several auto response macros:

Greetings $SENDER$

Your message regarding '$SUBJECT$' won't be read by me because I'm on vacation. Hurray!!!

Yours truly,

$RECIPIENT$

 

You can also use some of the header replacement macros to expand this script and control the headers that will be generated when the auto response message is mailed back to $SENDER$:

Greetings $SENDER$

Your message regarding '$SUBJECT$' won't be read by me because I'm on vacation. Hurray!!!

Yours truly,

$RECIPIENT$

%SetSubject%=RE: $SUBJECT$

%SetAttachment%=c:\photos\me_on_vaction.jpg

Using that script the auto response message will have "RE: " added to the beginning of the subject and have the specified file attached.

The "%SetSubject%=RE: $SUBJECT$" line is handled like this:

1.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

2.MDaemon replaces the original subject, which it has stored in its internal buffers, with this newly calculated one. From that point forward, any use of "$SUBJECT$" in the script 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 second line of the response script, the subject text would have already been changed by the time the $SUBJECT$ macro was expanded. Therefore, instead of replacing $SUBJECT$ with the content of the original message's "Subject:" header, it would be replaced with whatever you have set the value of %SetSubject% to be.

See: