Introduction Installation Beginning Admin Quick Ref FTP Server SMTP Server Database Security
Statements Objects String Parsing Events Queues Samples Special names Error Handling Accessories   Back
Special Names>Special File Names>Properties>Error404.html
Caravan Business Server>Help>Special Names>Special File Names> Properties Error404.html
Name Error404.html
Text
Kindly refer to 'Error Handling'
Syntax
Sample
Caravan Business Server>Help>Special Names>Special File Names> Properties> mailuser.html
Name mailuser.html
Text Tells Caravan if it is ok to accept mail for a particular user or not.
This is done by setting the property accept

mail(accept)="ok";
if you have just this all mail will be accepted or you can have your own logic for this.

Syntax
Sample //mail is accepted if the user exists

<caravan>
append c:\adint\doc\mail.txt;// appends to this file for logging purpose
time t
"Got mail for user ";mail(recipient);" at ";t(dd);"-";t(mm);"-";t(yy);" ";t(hour);":";t(minute);// logs the time etc
var mailto={mail(recipient)}X{"`*`\@`*`"}:{userid,domain};// a caravan parser at work
                                                // splits email address to userid and domain
if mailto;                      // mailto is created if the email was in format
    user x;                     // instance of user
    x(userid)=mailto(userid);   // set userid
    if x(uid);                    // check if it return valid numeric id
     if x(uid)<>"0";            // there is non zero id for this user
       mail(accept)="ok";       // ok to accept
       "-- Accepted";           // logs this as  accepted
     endif
    endif
endif
"\r\n";                         // add a linefeed to our log
</caravan>

Caravan Business Server>Help>Special Names>Special File Names> Properties> mailaction.html
Name mailaction.html
Text An object of type mail is passed to this script. This is the received mail with
all the attendant properties set. You may do what you wish with it.

additional properties of received mail:

recipient: (list of all all recipients of this mail)
received: smtp headers which contains the text appended by the routing smtps
The recipient property has as many values as there are recipients for this mail.

Logic for mailaction.html:

Loop through all the recipients and parse each name to get the userid and domain.
If it is for our domain, insert the contents of this mail including the text, attachments, header,
current time etc into separate fields of our mail table. Additional information like userid is also
useful so that an sql query can be used get the users mail, when implementing a web based mail
client. Such a facility is implemented on response4u. To avoid confusion I am not attaching this
code here because other concepts of caravan language needs to be explained before one
can understand this code.

Syntax
Sample
Home       Back