Please enable JavaScript to view this site.

MDaemon Email Server 24.5

Navigation: Additional MDaemon Features > The RAW Message Specification

The RAW Message Specification

Scroll Prev Top Next More

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 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@example.com>

This field contains the email address of the sender.

To <mailbox@example.com [, mailbox@example.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@example.com>

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

CC <maibox@example.com[, mailbox@example.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@example.com>" 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@example.com" to be placed into the RFC-2822 message you would place this: "header <Delivered-By: mail-machine@example.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.

DKIM Signing RAW Messages

x-flag=sign

Including this special command in a *.raw file will cause the RAW message to be 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 <user01@example.com>

 

Hello John!

Sample 2:

from <user01@example.com>

to <user09@example.net>

subject <Requested Files>

X-FLAG=CONFIRM_DELIVERY

X-FLAG=ATTACH <c:\docs\files\data01.zip, MIME> -X

Here are all those files you asked for.