API Docs
Message Command Files
MailEnable API Guide > MailEnable Constructs > Message Command Files

Glossary Item Box

For most messages queues there are two files per message. The first is called a command file and the second is the message body. The command file contains details concerning the delivery of the message (such as sender, retry count, etc.). These details may vary slightly depending on the queue the message is in. For example, the command file for the SMTP connector is located in the Mail Enable\Queues\SMTP\Outgoing directory. It has the file extension .MAI. The first part of the name should be a GUID to avoid overwriting existing files. The command file corresponds to the actual message that is located in the Mail Enable\Queues\SMTP\Outgoing\Messages directory. Make sure you write the message file before you write the command file, in order to avoid the SMTP service reading the command file and not finding the message.

 

The command file has the following format:

 

DomainName=[Setting]<CRLF>

CommandType=[Setting]<CRLF>

Server=[Setting]<CRLF>

Recipients=[Setting]<CRLF>

Sender=[Setting]<CRLF>

Retries=[Setting]<CRLF>

NextSendTime=[Setting]<CRLF>

TimeAcquired=[Setting]<CRLF>

MessageID=[Setting]<CRLF>

Priority=[Setting]<CRLF>

Status=[Setting]

 

The values of the items are described below:

 

DomainName:

This is the name of the domain that will be connected to. If this is a new message, you can leave this blank (i.e. just have DomainName=), as MailEnable will resolve it. This is only used only when sending messages out the SMTP Connector and is written only by the connector once MX lookup has occurred.

CommandType:

Indicates whether the message is a non-delivery receipt. For new messages this should be "Normal", and for system generated messages it is “NDR”. When NDR messages are sent outbound from the SMTP connector they are sent with a NULL sender address (<>).

Server:

The name of the Windows server that is to process the file. You do not need to set this at this stage. You do not need to set this value unless you wish to denote the message as being owned by a particular server (ie: if you are clustering).

Recipients:

The email address of the recipients. You can one or more recipients. If you have more than one recipient, separate the addresses with a semi-colon, such as:

 

[SMTP:email@domain.com];[SMTP:anotheremail@domain.com]

 

Sender:

The email address of the sender. This is formatted using the MailEnable address format.

Retries:

The amount of retries the message has had. For new messages set this to zero.

NextSendTime:

The message will tried to be sent if the current time is greater than this time. This is measured in the number of seconds since midnight January 1, 1970, in local time. To send a message immediately, set this to the same value as TimeAcquired.

TimeAquired:

The time the message was created. This is used when checking to see if the message has expired. This is measured in the number of seconds since midnight January 1, 1970, in local time.

MessageID:

The name of the message file. Both the message and command files should have the same filename.

Priority:

Unused. Usually set to "Normal".

Status:

What status the message is in. Set this to "Unsent" for new messages. When a message is being sent, this becomes "Sending".

IPAddress:

This is the IP address of the originating client (it is only relevant/populated  by SMTP Inbound).

Account:

This field denotes the 'Owner’ Account or Postoffice of message. This records the Account/Postoffice who would get billed for the message (by an integrated billing system).

AuthenticationStatus:

This field indicates whether the sender of the message has authenticated before inserting the message into the MailEnable Queues. In the case of SMTP Inbound messages, this entry is populated with a value other than zero under the following circumstances:

  • The sender authenticated via SMTP Authentication, sets value to “1”
  • The sender has been permitted to relay from an authorized IP address range – sets value to “2”.

Note: the authentication flag value of “1” will take precedence over the value of “2”. Ie: If the sender has authenticated and are authorized to relay, the value will be set to “1”.

 


Example command file:

 

DomainName=mailenable.com

CommandType=NORMAL

Server=

Recipients=[SMTP:info@mailenable.com]

Sender=[SMTP:support@mailenable.com]

Retries=2

NextSendTime=1009515032

TimeAcquired=1009407032

MessageID=D9880414C29A4DEC94C02457718EE.MAI

Priority=Normal

Status=Unsent

Server=MESRV01