List of Variables
Posted by Yuri K., Last modified by Yuri K. on 22 June 2015 06:25 AM

Here's a list of variables that can also be seen with additional examples \icewarp\examples\ variables.dat.html.

 

These variables can be used in several places of IceWarp, as in content filters, auto-replies and messages sent by Mailing lists (for mailings, you must enable the Process mailing list of variables in the Options tab).

 

List of System Variables And Commands:

 

This file contains the message with variables and commands that will be sent back. It can be either a plain text message or you can include attachments, make html messages or simply anything.

 

Variables (Functions that return values):

%%From%%   -   whole From header of the message 

%%From_Email%%   -   first email address from the From header 

%%From_Alias%%   -   alias part of the first email address from the From header 

%%From_Domain%%   -   domain part of the first email address from the From header 

%%From_Name%%   -   name taken from the From header 

%%To%%   -   whole To header of the message 

%%To_Email%%   -   first email address from the To header 

%%To_Alias%%   -   alias part of the first email address from the To header 

%%To_Domain%%   -   domain part of the first email address from the To header 

%%To_Name%%   -   name taken from the To header 

%%Sender%%   -   sender of the message (whole content of MAIL FROM: command, even with < and >) 

%%Sender_Email%%   -   email address of the sender (without < and >) 

%%Sender_Alias%%   -   alias part of senders email address 

%%Sender_Domain%%   -   domain part of senders email address 

%%Auth_Email%%   -   email address of the authenticated user (without < and >), or empty if nobody authenticated 

%%Auth_Username%%   -   username of the authenticated user (without < and >), or empty if nobody authenticated 

%%secure_connection%%   -   "1" or "0" - indicates if connection is secured (either via direct SSL, or using STARTTLS) 

%%Recipient%%   -   list of all recipients delimited with semicolon ((whole content of RCPT TO: commands, even with < and >) 

%%Forward_recipients Host#port%%   -   list of all recipients prepared for relay to given Host, delimited with semicolon

Eg: %%Forward_recipients mail.domain.com%% -> @mail.domain.com:r1@xx.com;@mail.domain.com:r2@xy.com;  

%%Forward_local_recipients Host#port%%   -   similar to %%Forward_recipients%% , but only local accounts are added to the output

%%Forward_domain_recipients Host#port;domain1;domain2%%   -   similar to %%Forward_recipients%% , but only recipients from given domains are added to the output

%%BCC_Recipient%%   -   list of recipients not present in TO: or Cc: headers, delimited with semicolon ( even with < and >). If this variable is used in content filter during "copy incoming/outgoing mail" operation (using the "apply content filter" option), original email recipients are used, not the recipients where the message is being copied to. 

%%Current_Recipient%%   -   email address of the current recipient - the address of the account being processed 

%%Recipient_Email%%   -   email address of first recipient of the message 

%%Recipient_Alias%%   -   alias part of email address of first recipient of the message 

%%Recipient_Domain%%   -   domain part of email address of first recipient of the message 

%%Extension%%   -   Extension of the recipient email address containing the extension separator 

%%ExtensionNoSep%%   -   Extension of the recipient email address without separator 

%%Subject%%   -   Subject of the message 

%%Message-ID%%   -   Message-ID of the message (even with < and >) 

%%Date%%   -   current date 

%%Time%%   -   current time 

%%Header%%   -   all headers of the message 

%%Body%%   -   body of the message in plain text 

%%Body MaxSize%%   -   body of the message in plain text limited to MaxSize 

%%Body_HTML%%   -   body of the message in HTML (if any) 

%%Body_HTML MaxSize%%   -   body of the message in HTML limited to MaxSize (if any) 

%%Size%%   -   size of the message in kB 

%%IP%%   -   IP address of the sender 

%%PORT%%   -   port of the sender 

%%Local_IP%%   -   Active local IP address 

%%Local_PORT%%   -   Active local port 

%%UniqueID%%   -   Unique ID string (md5 random hash) 

%%RFC822_Date%%   -   current date and time in RFC822 format, based on server time and GMT offset 

%%RFC822_Date Num%%   -   date and time Num seconds in the future in RFC822 format, based on server time and GMT offset

Eg: %%RFC822_Date 60%%  

%%AttachmentNames%%   -   names of the attachments delimited with semicolon

Use rarely. Requires a high CPU usage and processing time. 

%%Header HeaderItem%%   -   particular message header.

Eg: %%Header X-Mailer%% 

%%Include FileName%%   -   includes content of the filename. Please see the example at the end of this file 

%%Include_Base64 FileName%%   -   includes filename in Base64 encoding. Please see the example at the end of this file 

%%MessageFile%%   -   filename (.tmp or .imap file) storing actual content of the message 

%%Copy HeaderItem Position Length%%   -   copy Length characters of HeaderItem from Position 

%%Delete HeaderItem Position Length%%   -   delete Length characters of HeaderItem from Position 

%%FormatDateTime Format%%   -   formated date of the message

Eg: Today is %%FormatDateTime yyyy-mm-dd hh:nn:ss%% 

%%StrReplace Variable OldString NewString CaseSensitive%%   -   Returns another Variable with some OldString replaced with NewString.

Eg: when %%Recipient%% returns a@t.com , then %%StrReplace Recipient @t @q 0%% returns a@q.com 

%%CharEscape Variable EscapeChar CharsToEscape%%   -   Returns escaped value of another Variable. Each character from CharsToEscape is prefixed by EscapeChar

Eg: when %%Recipient%% returns a@t.com , then %%CharEscape Recipient \ @%% returns a\@t.com 

%%VirusName%%   -   name of the viruses delimited with semicolon 

%%VirusDBDate%%   -   last update date of the database for AntiVirus engine 

%%SpamProbability%%   -   SPAM probability returned from Bayesian filter 

%%SpamPercentage%%   -   SPAM probability returned from Bayesian filter in percent units 

%%SpamHits%%   -   Total message SPAM score 

%%SpamScore%%   -   The same as %%SpamHits%% 

%%SpamReason%%   -   reason why message has been marked as spam 

%%MailboxPath%%   -   Path to user mailbox relative to mail directory 

%%Mailbox%%   -   Name of user mailbox directory 

%%Alias%%   -   Primary alias of user 

%%PhoneAlias%%   -   Phone alias of user 

%%InstallPath%%   -   Path to server installation directory 

%%Temp%%   -   Contains last fetched line from client, suitable for Milter filters 

%%Exec CommandPath%%   -   Variable is replaced by string returned by executable at CommandPath 

 

Commands:

(These special extended variable commands work only for Auto Responders and Content Filter message actions)  

$$SetSender Sender$$   -   set sender of the message to some value 

$$SetRecipient Recipient$$   -   set recipient of the message to some value 

$$SetActualTo To$$   -   set To header to some value 

$$SetActualFrom From$$   -   set From header to some value 

$$SetSubject Subject$$   -   set Subject to some value 

$$SetReplyTo ReplyTo$$   -   set ReplyTo header to some value 

$$SetMessageID MessageID$$   -   set MessageID to some value 

$$SetPartBoundary PartBoundary$$   -   set Boundary (used for messages with attachment, see the example at the end of this file) 

$$SetContentType ContentType$$   -   set Content Type of particular Boundary (see the example at the end of this file) 

$$SetHeader Header$$   -   set some header to some value 

$$Exec CommandPath$$   -   Application at CommandPath is executed (not available in auto responder) 

 

Example #1 (Simple Auto Responder):

Hello, I received your your message at %%Time%% on the %%Date%% and the size was %%Size%% kB. 

 

Example #2 Advanced Auto Responder With An Attachment:

Works only for Content Filters with "Send message" or "Reply with message" actions

(not for normal AutoResponders, because of security)  

$$SetSubject Message Subject: %%Subject%%$$

$$SetPartBoundary --BoundaryXX$$

----BoundaryXX

Content-Type: text/plain

 

This is the text part of the message. The following part contains an attachment image.

 

----BoundaryXX

Content-Type: application/octet-stream; name="image.gif"

Content-Transfer-Encoding: base64

 

%%Include_Base64 c:\temp\image.gif%%

 

----BoundaryXX 

 

Example #3 (Message containing only attachment):

Works for Content filters only  

$$SetHeader Content-Type: application/octet-stream; name="filename.ext"$$$$SetHeader Content-Transfer-Encoding: base64$$

%%Include_Base64 d:\daily.txt%%

 

Example #4 (Virus Warning):

Warning: Virus '%%VirusName%%' detected. Message was rejected.

Message's header:

%%Header%% 

 

Example #5 Advanced Auto Responder with Embedded Image:

Works only for Content Filters with "Send message" or "Reply with message" actions

(not for normal AutoResponders, because of security)  

$$SetSubject Message Subject: %%Subject%%$$

$$SetPartBoundary b1_6b8b8572a3c9723a4ccf208d838b6d1d$$

(0 vote(s))
Helpful
Not helpful

Comments (0)