Navigation:  Additional MDaemon Features > The RAW Message Specification >

The RAW Message Specification

Print this Topic Previous pageReturn to chapter overviewNext page

MDaemon has inherent support for a simple and powerful mail message format known as RAW mail. The purpose of the RAW mail system is to provide a simple and standard format that software systems such as MDaemon can use to create much more complex RFC-2822 compliant message. Use of mail transport agents such as RAW allow client software to offload to the server all the complicated work of maintaining adherence to Internet mail standards.

RAW mail consists of a series of required and optional text headers followed by a message body. Most headers consist of a token followed by a value enclosed in <> symbols. Each header line ends with a <CRLF> combination of characters. Headers are separated from the message body by a blank line and are case insensitive, and the from and to headers are the only ones that are required. All text, headers and body, are plain ASCII text and must be contained in a file that ends with the extension, ".raw" (for example "my-message.raw"). Then, to queue the message for delivery, place the *.raw file in MDaemon's RAW queue (typically located at, "C:\MDaemon\Queues\Raw").

Bypassing the Content Filter

By default, RAW messages are passed through the Content Filter like normal messages. If you want a given RAW message to bypass the filter then start the name of the file with "p" or "P". For example, "P_my-message.raw" would bypass the Content Filter but "my-message.raw" would be processed through it normally.

Bypassing the Content Filter will prevent messages from being DK or DKIM signed. If you have configured MDaemon to sign all messages then this could potentially cause some delivery problems. If you want MDaemon to sign RAW messages configured to bypass the Content Filter then you can do so by using the x-flag=sign option outlined below.

RAW Headers

From <mailbox@host.com>

This field contains the email address of the sender.

To <mailbox@host.com [, mailbox@host.com]>

This field contains the email address(es) of the recipient(s).  Multiple recipients can be specified by separating each one with a comma character.

ReplyTo <mailbox@host.com>

An optional email address where replies to this message will be directed.

CC <maibox@host.com[, mailbox@host.com]>

An optional list of carbon copy recipients of this message.  Multiple carbon recipients can be specified by separating each one with a comma character.

Subject <text>

An optional subject for the message.

Header <Header: Value>

Allows you to explicitly place Header/Value combinations into the message. This makes it possible for you to place custom or other non-standard headers into your *.raw messages.

Special Fields Supported by RAW

File attachment and encoding

x-flag=attach <filepath, method> [-x]

Example: x-flag=attach <c:\utils\pkzip.exe, MIME> -x

This X-FLAG specifies the value "ATTACH" along with two parameters within the <> characters. The first parameter is a complete path to the file which should be attached to the message. The second parameter which is separated from the first by a comma character and specifies the method of encoding that is to be used when attaching the message. MDaemon supports two values for this parameter. The method of MIME instructs the server to use the Internet standard Base64 method of message encoding. The method of ASCII instructs the server to simply import the file into the message. An optional -X parameter at the end of the string instructs the server to remove the file from disk once it has been attached.

Delivery Status Notification

x-flag=confirm_delivery

When converting a RAW message which contains this flag into RFC-2822 mail, the string is transformed to the "Return-Receipt-To: <sender@host.org>" construct.

Placing Specific Header/Value Combinations into the RFC-2822 Message

header <header: value>

If you wish to place a specific header/value combination into the RFC-2822 message that will be generated from a RAW file, you will need to use the HEADER macro listed in the RAW Headers section above. For example, if you want the header "Delivered-By: mail-machine@domain.com" to be placed into the RFC-2822 message you would place this: "header <Delivered-By: mail-machine@domain.com>" in the RAW message. Note that the "header" macro requires both the field and value. You can place as many "header" macros as you need into a RAW message.

DK/DKIM Signing RAW Messages

x-flag=sign

Including this special command in a *.raw file will cause the RAW message to be DK/DKIM signed. This should only be used in RAW messages that you have configured to bypass the Content Filter (by starting their filenames with "p" or "P"). You should not use this command in normal RAW Messages that are processed through the filter. Those messages will be signed normally.

All RAW messages that are generated by the Content Filter will use the x-flag=sign command automatically.

Sample RAW mail messages

Sample 1:

from <mdaemon@altn.com>

to <JohnSmith@somewhere.com>

 

Hello John!

Sample 2:

from <JohnSmith@nowhere.com>

to <President@Whitehouse.gov>

subject <Secret FBI Files>

X-FLAG=CONFIRM_DELIVERY

X-FLAG=ATTACH <c:\secret\files\dole.zip, MIME> -X

Here are all those files you asked for.