Products Downloads Prices Support Company
DMailWeb and CWMail
Common Links
Download Now
Features
FAQ
Customer Comments
Example Gallery
Updates
License
WAP/WML Support
CWMail Links
Email Support
Demo
Users guide
Manual
DMailWeb Links
Email Support
Demo
Users guide
Manual
   


CWMail: Corporate Web Mail

Installation and Management Guide

NOTE: This product is frozen, and only supported for existing customers, new customers should use WebMail instead.

http://netwinsite.com/webmail

This guide is intended for system administrators who are installing, customizing or managing a CWMail site. CWMail works in conjunction with a web server and your normal email POP and SMTP servers. CWMail can be extensively customized to provide distinctive web based email service for your customers. The web pages the clients see are based on a series of template files which can be modified to suit your particular needs. These template files make use of template variables to refer to all the configuration, user or message specific items. This allows the templates provided to be used as they are, or completely re-written to provide a particular look and feel which matches other web pages from your site. For the users, processing their email from a web-browser has the advantages that they do not need to setup an email client package, and that they can access their email from a web-browser running on any computer located anywhere which has access to the web server.

The following sections describe:


NT Installation

The self-extracting archive you have downloaded will normally run WMSetup once it has unpacked the files to a temporary directory. All you need to do is answer the questions to complete the installation.
If you want to handle the installation manually use the following instructions:


You must install the CWMail CGI on your WEB server, in a directory that you have already set up as containing CGI programs. You should read your web server documentation if you don't currently know how to set up a CGI program. Normally a server will have a special directory for storing CGI's - it may be called something like SERVER_ROOT\cgi-bin     
or c:\inetpub\scripts
or "FrontPage Webs\Content\cgi-bin"

You also need to copy all the template files to a directory on your system, it can be anywhere as long as you define the templates variable in CWMail.ini to point to the same place. Note: By default the CWMail user files are stored below the template directory. Therefore the template directory should not be in the web-pages tree as direct access to user files could be a security risk.

If you plan to customize the template files (most people do :-) then you should probably keep a copy of the original set so that you can later compare them with future releases. This may save you much effort when adding  new features into your customized set.

Example:

    download the self extracting archive from netwinsite

    cwmail10.exe          # Unzip the self extracting archive to cwtemp

    cd \cwtemp            # Change to temporary unpack directory

 

    mkdir \cwmail         # Create a directory for templates

    mkdir \inetpub\wwwroot\nwimg         # Create a directory for .wav files

    copy * \cwmail        # Copy docs templates etc to destination

    copy *.wav \inetpub\wwwroot\nwimg        # Copy sound files

    copy *.gif  \inetpub\wwwroot\nwimg        # Copy sound files

    copy cwmail.exe "\inetpub\scripts"   # Copy cgi 

    copy cwmail.ini "\inetpub\scripts"     # Copy ini file (must be with .exe)

    del  \cwtemp                                        # Remove temp files

Now edit CWMail.ini and define values for the four settings shown below:

  • notepad \SERVER_ROOT\cgi-bin\CWMail.ini
Symbol Example Explanation
pophost pop.your.domain The name or IP number of your POP server
templates \dmweb The directory where you have copied the *.tpl files
smtphost mail.your.domain The name or IP number of your SMTP server
domain acme.com Your domain, this will be used to construct email addresses

If you wish, you can tailor the template files to give CWMail the same look and feel as your own web pages. It is assumed you know how to edit raw html files, in addition there are some variables that you can use. The list of variables depends on which page CWMail is showing. For example the %%h_subject%% variable only works when displaying an item, or directory listing.


Unix Installation

Normally you just download the distribution set uncompress and untar it
and then run the installation setup wizard WMSetup. For example

  • download the distribution set from netwinsite to a temp directory
  • uncompress cwmail10.tar                      # Uncompress tar file
  • tar -xvf cwmail10.tar                           # Extract distribution files to CWMail sub-directory
  • cd CWMail                                          # Change to temporary CWMail sub-directory
  • ./wmsetup                                         # Run setup wizard

 
Then just answer the questions to complete the installation. If you want to perform the installation by hand rather than using the setup wizard use the following instructions:

You must install the CWMail CGI on your WEB server, in a directory that you have already set up as containing CGI programs. You should read your web server documentation if you don't currently know how to set up a cgi program. Normally a server will have a special directory for storing CGI's - it may be called something like SERVER_ROOT/cgi-bin or "/home/httpd"

You also need to copy all the template files to a directory on your system, it can be anywhere as long as you define the templates variable in CWMail.ini to point to the same place. Note: By default the CWMail user files are stored below the template directory. Therefore the template directory should not be in the web-pages tree as direct access to user files could be a security risk.

If you plan to customize the template files (most people do :-) then you should probably keep a copy of the original set so that you can later compare them with future releases. This may save you much effort when adding  new features into your customized set.

If you happen to be using httpd and it's in /home/httpd then the command file install.sh supplied will do the installation or upgrade for you. Note it will not overwrite templates or the ini file in case you already have modified ones.

Example:

    download the distribution set from netwinsite to a temp directory

    uncompress cwmail10.tar          # Uncompress tar file

    tar -xvf cwmail10.tar            # Extract distribution to CWMail sub-directory

    cd CWMail                        # Change to temporary CWMail sub-directory



    mkdir /var/spool/cwmail                 # Create a directory for template files etc.

    mkdir /home/httpd/nwimg                 # Create a directory for template files etc.

    chown nobody /var/spool/cwmail          # Set appropriate ownership

    cp -i ./tpl/* /var/spool/cwmail         # Copy template files over

    cp -i ./tpl/*.wav /home/httpd/nwimg         # Copy sound files over

    cp -i ./tpl/*.gif /home/httpd/nwimg         # Copy image files over

    cp * /var/spool/cwmail                  # Copy docs etc.

    cp cwmail.cgi /home/httpd/cgi-bin       # Copy cgi

    cp -i cwmail.ini /home/httpd/cgi-bin    # Copy ini file

    rm -r -f ../cwmail                      # Remove temp files

Note:  .ini must be with .cgi 

 

Now edit CWMail.ini and define values for the four settings listed below:

  • vi /SERVER_ROOT/cgi-bin/CWMail.ini
Symbol Example Explanation
pophost pop.your.domain The name or IP number of your POP server
templates /var/spool/cwmail The directory where you have copied the *.tpl files
smtphost mail.your.domain The name or IP number of your SMTP server
domain acme.com Your domain, this will be used to construct email addresses

If you wish, you can tailor the template files to give CWMail the same look and feel as your own web pages. It is assumed you know how to edit raw html files, in addition there are some variables that you can use. The list of variables depends on which page CWMail is showing. For example the %%h_subject%% variable only works when displaying an item, or directory listing.


Address Books:

CWMail/DMailWeb supports both private and shared address books and a pick list of recently used email addresses. The address books themselves are simple text files with one substitution per line.  The following are example lines:

bill=bill@sitcom.co

john=MrJohn@vet.doc.uk

friends=bill@whatsit,john@the.uni,dad@home

When processing to, cc and bcc lines the translations are made. For each entry in a to line which does not contain an @ symbol the following sequence of searches are performed.

  1. Search each of the users private address books for a match (i.e. those in addr_books)
  2. Search each of the public address books this user has entered in gadd_books
  3. Just add the local domain on

The search stops on the first match. So if bill is found in my own address book it takes preference. If no entry is found in any address book then the name is assumed to be for a local user and @localdomain  is added to the entry.

Public address books are just normal user address books but with the prefix public_

So if user john@netwin.co wants to share his home address book with pete he just stores it with the name public_home and then Pete can make an entry in his pick list page: john@netwin.co/public_home

If you as system administrator want to give everyone access to a company address book then you need to pick a user to administer it e.g. admin@my.company.co and then create the address book say public_company then set in default.dat and/or use the system administrator page to add the line:

gaddr_books admin@my.company.co/public_company

The files used for address books always have an extension .abk and can only be stored in user directories.


Multi-Language Support:

The template files can be edited to provide an interface in a language other than English. In addition the names of folders such as Trash, Copies to Self, etc. can be changed using ini file settings.

To translate error and informational messages place the following line in the ini file

language_file lang.dat

Then edit the lang.dat file as required. This contains two lines for each error or informational message contained in the package. Lines beginning with a # are considered comments. The lines look like this:

I23 %d of %d users from %s user directories deleted successfully
Translation of: I23 %d of %d users from %s user directories deleted successfully

The I23 identifies the particular message, normally I is used for information and E for errors, W for warnings. The second of each pair of lines should be replaced with a translation into whatever language you want to use. When editing the line be careful not to remove the %d %s parts of the line as these are replaced at run time with relevant information. In the example above the actual message shown might be:

I23: 1 of 1234 users from c:\dmweb\u_* user directories deleted successfully

You can also use multiple copies of the cgi to provide different sets of templates etc. for different languages. You can also setup a single copy of CWMail to handle multiple templates sets for different languages on either a per user or at login selection.

 


Supporting Virtual Hosts or multiple email domains.

If you have multiple groups of users you can support them with CWMail in a variety of different ways. The method you choose will depend largely on the POP and SMTP server you have and how they support virtual domains.

Let's consider two groups of users, domain.one and domain.two. They both have a user called fred.

If you only have a few virtual domains you can just duplicate the CWMail cgi and ini file and run multiple copies specifying different pophost, smpthost and domain settings.

You can make users enter a pop-host as part of the login page. Either as a separate field or as part of the username. E.g. username ralph@domain2

The most powerful method is to use the vhost vend ini settings (requires version 2.1h or later). After all the common settings in the ini file you can have sections for different virtual hosts. So if users from domain one use the url http://domain.one/cgi-bin/cwmail.cgi and users from domain two user the url http://domain.two/cgi-bin/cwmail.cgi both access the same copy of cwmail.cgi  but will be kept separate by the vhost sections of cwmail.ini.

A typical example might be

vhost domain.one
domain domain.one
pophost pop.domain.one
vhost domain.two
domain domain.two
pophost pop.domain.two
vend

In the line
    vhost xxx
the xxx is matched against the host name in the url. (This is usually taken from the cgi environment variable SERVER_NAME but you can match against anything else - say HTTP_HOST by adding an ini setting
vhost_match HTTP_HOST     )

If the same pophost is to be used but with a username suffix the above would be changed to:

vhost domain.two
suffix /d2            or          suffix @domain.two
vend

The vhost - vend can bracket any ini settings to be applied to users from that domain so for example to use different templates for domain one we might have:

vhost domain.two
suffix /d2            or          suffix @domain.two
templates \cwmail\domain2
vend


Using multiple template sets.

CWMail can be setup to use multiple sets of templates. You might choose to do this to allow for the use of multiple languages or just to allow individual users to select a set of templates they like working with. For example you might have a very simple set for use by young children or those new to computing, and an extended set for advanced users.

As an example the addition of a second set of templates referred to as Nicks Templates is described below. These can be retrieved from our website and then unpacked.

For NT, download   the self extracting archive cwm_ntpl10.exe and unpack it then follow the directions below.

For Unix, download the file cwm_ntpl10.tar.Z and then

uncompress cwm_ntpl10.tar

tar -xvf cwm_ntpl10.tar

then follow the directions below:

Nick's CWMail Templates Version 1.0 1/12/98
-------------------------------------------

This is an additional set of templates for use with CWMail
It can be used as a second set of templates which individual users may select at login time or from the config page. Alternatively it can replace the original set of templates.

To replace the original set of templates just copy the full contents of this directory into your existing templates directory and copy the .gif, .wav and .jpg files into your nwimg directory.

Alternatively if you have CWMail version 2.0h or later you can copy this directory to a directory like \cwmail\ntpl, copy the .gif .wav and .jpg files to nwimg directory and then add a line to cwmail.ini as follows
tpl_set 2 \cwmail\ntpl

Individual users can then choose to use these templates from the login or configuration page.

To allow selection from the login page you add a line like this to login.tpl in the main templates directory.
<input type="checkbox" name="tpl_set2" value="ON">Use template set 2
Using this method of selection requires the choice to be made at each login.

An alternative is to allow the selection to be made from the config page. To allow this add the following line to the form in the login page.
<input type="hidden" name="tpl_set" value="config">


Template Files:

Here is a list of the template files, and a brief description of each. Each file may optionally have a frame version which has the same name with the suffix f for frames. For a frame login frame.tpl is loaded and menubar.tpl is placed in the top frame.

File Name Description
login.tpl The first page shown when CWMail is run, this handles the user login
list.tpl A list of new mail messages
item.tpl A single mail item
send.tpl Sending a new mail message
sent.tpl Confirmation message when a message has been sent
forward.tpl Forwarding one or more messages
error.tpl Used to display any error messages
menubar.tpl Menu bar used if Frame Login rather than normal login

There are also other example sets of template files available. If you create a particularly nice set you might like to share them with others. If so send them to netwin@netwinsite.com and we will add them to this list.

Download Page


Template Commands

The template files contain ordinary html plus %%variables%% plus various commands to the cgi. The commands may take the form of a submit button with a particular name or a defined variable of the form cmd=xyz. Most commands can be used in either format.   Normally if the command is used as a button name in a form, hidden fields are used to include other required information such as the user token and folder.

Example:

<form  name="List" method="POST" action="||b_action||" >
<input type=hidden name="utoken" value="||utoken||">
<input type=hidden name="fld" value="||fld||">
<input type=input name="list" value="Show New Mail Folder">

The same function can be used as an href, thus:

<a href="||b_action||?cmd=list&utoken=||utoken||&fld=||fld||&&">Show New Mail Folder</a>

For common functions a preformatted version of this href is available. For example the list new mail href  can be used thus:

<a href=||b_list||>Show New Mail Folder</a>

In addition a variable of the form set_xyz=abc or name="set_xyz" value="abc"
can be used to create a template variable with a value abc for the template page which is to be returned. Thus for example send message form could be changed to add the following variable
<input type=hidden name="fred" value="send message page">

In a similar way a form can contain a hidden value to perform the same function as in:

<input type="hidden" name="set_fred" value="bill">

The error.tpl page could then include :
Error processing ||fred||
to add send page specific information to the general error.tpl page.

If these set constructs are used with variables starting u_ then the value is also stored permanently in the user.dat file. an href finishing &u_fred=bill will add a line

u_fred bill

to the user.dat file and will replace ||u_fred|| in any template served with the value bill

The cmd=xyz form are listed in the table below:

cmd = b_ Function
delitem   Delete msg and return to mail list page list.tpl
delitemn   Delete msg and show next message or message list if no next item.
list b_list Show list of New Mail folder
list_copy   Show list of copies to self folder
list_waste   Show list of waste folder
show&page=xyz   Display template page xyz.tpl
&set_fred=bill   Set template variable fred to contain bill and serve out as part of next template displayed
cmd=lg&url=xyz   Logout and then go to url xyz using the loaction: header
cmd=x&process=y&page=z   Run cmd x then process command y then display page z

Template Variables

Here is a list of some of the general variables that you can use in these template files. Note: in the template file each variable has the form %%variable_name%%

Variable Description Typically used in
%%do(program params)%% will execute any program and pass it parameters including translated template variables and replace with output from the program. For example:
||do(\cwmail\lookup.exe ||user||@||h_pophost||)|| might be replaced by
"Mr. Smith"smith@our.site  using lookup.exe to access some database.
Note: The output from the program must be terminated with a newline character.
any
%%ifdef%%var%% Conditional inclusion if variable is defined any
%%ifndef%%var%% Conditional inclusion if variable is not defined any
%%ifequal%%var%%val%% Conditional inclusion if template variable equals val, case sensitive. e.g.
%%ifequal%%nitems%%0%%
<h2> sorry no mail for you today
%%endif%%
any
%%ifnequal%%var%%val%% Conditional inclusion if template variable does no equal val, case sensitive. any
%%ifinstr%%var%%val%% Conditional inclusion if template variable var contains string val, case sensitive any
%%ifninstr%%var%%val%% Conditional inclusion if template variable var does not contain string val, case sensitive any
%%else%% Optional else section to go with ifdef ifinstr etc. any
%%endif%% Marks end of ifdef or else section any
%%include%%file%% Reads the named file in which may include template variables any
%%include%%$fred%% Reads the file whos name is stored in the user variable  fred. note variable must contain whatever.tpl and file must be located in template directory any
%%var%%left%%nn%% return left nn chars of variable var any
%%var%%left+%%nn%% return left nn chars of variable var with trailing ...   eg left 4 of meeting is meet... any
||set||fred||bill|| sets template fred to value bill which will be served in next template and in the following lines of this template any
abook Content of currently selected address book pick.tpl
abook_edit Address book to edit pick.tpl
abook_only Current address book - if set then picklist will only show entries from address books rather than from pick list and address books pick.tpl
add_br add <br> to end of each line in a message being sent. send.tpl
addr_books Pick list of current address books stored in user.dat variable addr_books pick.tpl
gaddr_books Group address book list as a comma separated list stored in user.dat variable gaddr_books. Note prefix public_ and suffix .abk are added automatically pick.tpl
attachment_names List of attachments to message being forwarded (set when forwarding using the forward_edit command). fwdedit.tpl,fwdeditf.tpl
attachments List of links to display/save attachments. If inline is true then %%attachments%% is not defined. item.tpl
b_list_next List next page of messages in a folder any
b_list_prev List previous page of messages in a folder any
begin_list Starts list of new mail messages list.tpl
begin_flist Starts list of folders within list use variables:
f_name folder name
f_msgs number of messages in folder
f_size   size of folder in kbytes
f_new number of new messages in folder
f_unread number of unread messages
f_del href to delete folder
||fld_rename||f_id|| button name to rename folder
f_name||f_id|| variable to contain new name for a folder
f_delete complete <a> to delete folder but blank for non deleteable folders i.e. new trash copies to self
f_rename complete <input tag for rename ///ly blank for 0,1,2
f_newname complete <input tag for new name ///ly blank...
f_tmsgs, f_tsize, f_tnew, f_tunread   totals for all folders
folders.tpl
b_action, action Ref. to CWMail. Example <img src="%%action%%/myimage.gif"> Will load file from templates directory which user does not normally have access to. list.tpl
b_follow Goes to form for posting follow-up messages item.tpl
b_forward Ref., forward this message to someone list.tpl
b_forward_edit Ref., forward and edit this message to someone. Uses fwdedit.tpl list.tpl
b_item Show a specific mail message list.tpl
b_list Ref., List new mail
b_next Next mail message item.tpl
b_prev Previous mail message item.tpl
b_reply Ref., send a reply to this person
b_replyall Ref., Send a reply to everyone whom this message was to
b_send Ref., Send a new message to someone
checknew If set on login page then cgi will check for new mail on login login.tpl frame.tpl
copyright An href and copyright notice. Must remain somewhere on login or menubar page any
copyright2 similar but not an href any
dflt_reply The user's preferred reply-to address
disk_quota_kbytes Disk quota in kbytes *.tpl
disk_used_kbytes Disk space used in kbytes for message files *.tpl
docmd When a href include variable newframe= then query - newframe= is put into docmd and passed to frame.tpl for later action. This allows all frames to be refreshed and something other than list put in list frame. frame.tpl
end_list Ends list of new items list.tpl
end_flist Ends list of folders folders.tpl
error_do If set then on error do this command rather than servng error.tpl eg in send.tpl adding <input type="hidden" name="error_do" value="list"> would return to send page if to: was not specified *.tpl
from This user's email address
fwdedit Set during command forward_edit so spell-check will return to correct fwdedit template. fwdedit.tpl, fwdeditf.tpl, sp_show.tpl, sp_edit.tpl
fwdedit_attachments Used to preserve the state of forward edit attachments checkbox fwdedit.tpl, fwdeditf.tpl, sp_show.tpl, sp_edit.tpl
fwdedit_headers Set during command forward_edit. Allows inclusion of 'one-time' initialisation code in fwdedit templates. fwdedit.tpl, fwdeditf.tpl
h_subject The subject for a given mail message list.tpl,item.tpl
h_date The date for a given item items.tpl
h_date_d 1 to 31
h_date_y 2001 etc
h_date_m jan feb mar etc.
Broken out date for a given item items.tpl
h_date_time The time from h_date in this format 1:15:06 pm list.tpl
h_date_t24 The time from h_date in 24 hour format i.e. 13:15:06 list.tpl
h_flags List of your current mail folders suitable for a select box.
h_from The "From:" header from the current message list.tpl
h_isreplied 0 or 1 if message has been replied to
h_sender Sender: header line
h_to To: header line
h_xfrom The "From:" header from message we are forwarding fwdedit.tpl
h_lines The number of lines in this message list.tpl
h_isread Mesage has been read - 0 if false 1 if true *.tpl
h_isforwarded Message has been forwarded - 0 if false 1 if true *.tpl
h_isremote Message was left on pop server *.tpl
http First part of protocol variable ie http:// or https:// or wml:// as appropriate any
info_msg Informational message such as "Quota exceeded 23 messages left on server" *.tpl
item The UID (Unique Identifier of this message assigned by CWMail)
item_id The number of this item ( i.e. msg) eg 3 or 4
logged_out If user  is logged out this is set to "true" any
last_login Time of last login. This is only served the first time list.tpl is displayed after a login list.tpl
list_i The message number on this page ie 3rd of 10 on this page list.tpl
list_m The message number as in the 13th of 20 list.tpl
max_download_msgs Maximum number of messages to download at one time config.tpl
max_download_kbytes Maximum message size to download from pop host config.tpl
nitems Number of items in this folder
nnew Number of new messages (new from pop server on this check)
nm_sound url reference for sound to play when new mail arrives eg. /nwimg/nmsound1.wav config.tpl stub.tpl list.tpl
nosortpick is checked if picklist should not be sorted. read from config.tpl set in all templates config.tpl  read
all write
nosortaddr is checked if address book should not be sorted. read from config.tpl set in all templates config.tpl  read
all write
page The name of the template file being served. Can also be used to set the page to display with  cmd=x, page=y any
pages The number of pages of messages available in list.tpl nmsgs/page_size list.tpl
page_num The page we are on if multiple pages are being used in list.tpl list.tpl
page_size Number of messages to show on each list page. Default 10 can be set in template config.tpl list.tpl
wml_page_size Number of messages to show on each list.wml page. Default 5 can be set in template config.tpl list.tpl
poplist List of pop hosts defined.
pop_cur Index in poplist of current pop host any
pop_name0 Main pophost for this user any
pop_user0 Username for main pophost for this user any
pop_replyn The user's preferred reply-to address for pop host n config.tpl
pop_portn The user's preferred pop port for pop host n default is 110 config.tpl
refresh time in seconds between auto-refresh of list.tpl for checking mail 0 means no autorefresh. Cant be set to < fetch_min which defaults to 200 seconds. list.tpl
remote_addr ip address connection came from any
reply This user's email address
real_name This user's real name, for use in friendly From: "User Smith"<usmith@abc.z>
roffset Offset to first character not shown when a message is truncated due to body_limit. When read as part of a cmd=item command it specifies the offset. The line containing this character is the first one shown as part of the message body. Used in Next Section command in item.wml item.tpl
sort_on  sort_field and sort_direction returns field name messages are being sorted on with - prefix for descending

sort_field is just field name and direction is ascending or descending
these all appear in lang.dat so can be translated to foreign languages.

any
server vhost server name. Can be used with b_action to make it an absolute url rather than a relative reference. any
time time in seconds  (as returned by c time(NULL)) any
t time in seconds modulo 99 can be used thus href="||b_action||?cmd=checknew&utoken=||utoken||&t=||t||&&  to stop silly browser cacheing the href any
topick list of recent email addresses send.tpl
tolist list of recent email addresses and entries from address books send.tpl
tpl_setn tick boxes for tpl_set1 to tpl_set10 see below
tpl_set Template set to use 1-10  defined in ini file Read from config and login. Set for config.tpl
tunread Number of unread messages in a folder list.tpl
uaddress users address any
uage users age
usex users sex ( as in mail female boy girl i.e. a string)
upto message number to start display at in list.tpl list.tpl
user Current username (excluding sufix and prefix)
fuser Current username (including sufix and prefix)
user_agent Contents of environment variable http_user_agent. Useful for picking up what browser is being used. Example:

%%ifinstr%%user_agent%%msie 3.02%%

any
umax_attach max size of attachment which can be sent config.tpl
uvar1-4 User variables stored for each user and initialized for new users from default.dat Can be used to add additional user options and field defaults. Note to clear a uvar from a form field a singe - character is used as empty fields cannot be distinguished from non existent fields. any
vhost vhost name being used instead of server name to match vhost lines in ini file.
vhost_port vhost port number, enables use of vhosts with web-servers running on non-standard ports.
v_asis Show page as it is so that html refs. interpreted as is
var1-8 From ini file settings var1 to var8
wysiwyg true/false config page setting. Allows user to make wysiwyg send message editor the default send, config

Folder and Rule Variables

Variable Description
folder Current mail folder name
fld Current mail folder number
fldlist List of folders
r_addr Address to send email to if rule applies
r_actions List of valid actions for a rule
r_contains If header contains this text then rule applies
r_folders List of valid folders for a rule
r_headers List of valid headers for a rule
rule_log A log of the rule processing

Message Headers available as variables:

Variable Description
a_from address only part of h_from so if h_from="Ralph Pugmire"rhp@netmail.com a_from=rhp@netmail.com
h_from From: header line
h_to To: header line
h_from_trim Just nice form of h_from. ie realname part of  from header i.e. john for "john"<jpc@a.b.c>
h_from_trim2 same as h_from_trim but if result is ralph@whatsit.com just return ralph
h_to_trim Just realname of to header i.e. john for "john"<jpc@a.b.c>
h_reply  
a_reply address only part of h_reply so if h_reply="Ralph Pugmire"rhp@netmail.com a_reply=rhp@netmail.com
h_reference  
h_resent_from Resent-from: header line found in forwarded messages
h_subject Re: subject header line, Truncated values available h_subject_30, h_subject_40, h_subject_60
h_subject_raw raw subject header line
h_date
h_date_mn
h_date_time
h_date_24
h_date_day h_date_d h_date_y h_date_m
date header from a message and various parts of that header using variables below
month as number 1 to 12
time am/pm
time in 24 hour clock
day in Mon, Tues, Wed...
day as a number 1 to 7
year
month
h_date  
h_content-type  
h_pophost pop host item was read from
h_priority if in send.tpl contents will be sent as Priority: header
a_cc address only part of CC header line
h_cc CC header line
h_lines Number of lines in message including header lines
h_bytes Number of bytes in message, including headers
h_popn The number (in the users config page pophost list) of the pop host this message came from
h_kbytes Number of kilobytes in message, including headers

Obscure/Internal data

Variable Description
utoken Current login information for this user, must be carried through all forms
fwdlist The list of items to be forwarded in a multiple forward operation
nfwd Number of items being forwarded

Hidden variables passed in from forms:

Variable Description
utoken Current login information for this user, must be carried thru all forms
fld The folder number being processed
vhost Value of vhost to use instead of actual server when matching vhost lines in ini file
send_date On send use this value rather than servers date_time for date: header on message. Usefull if user are in a different timezone from the server.

True/False Settings

Variable Description
autoadd add addresses to pick list automatically
autoadda add addresses to address book  addr_booksa automatically
v_myfrom use users from address instead of original from address when forwarding a message

Note this is read from forward.tpl so if you do not provide a tick box and want it todefault true then you have to put it in as a hidded field with value "on"

v_font display variable width font, set to true or false, valid in config.tpl,item.tpl
fwdlist show all the headers or not, valid in items.tpl
v_inline show images inline, or as a list of attachments, items.tpl
sig Config setting, add signature to message.

Detailed Descriptions of Template variables:

%%include%%advert.htm%%

Useful for displaying adverts, you would setup a cron job (or program that runs every 10 minutes) to change the advert file, thus displaying a new advert each time someone reads their mail.


%%ifinstr%%var%%val%%

Conditional inclusion if variable var contains string val, case sensitive.

Example:

%%ifinstr%%folder%%New%%

<hf> This is the New folder</h4>

%%else%%

<hf> This is some other folder</h4>

%%endif%%

v_asis

Show page as it is so that html refs are interpreted as is.


User Settings

The settings for each user are stored in user.dat files one for each user. Each user has a directory which is a subdirectory of the template or work directory. So for example if the templates are stored in \cwmail a user ralph@myfirm.co would have a directory \cwmail\u_ra\ralph@myfirm.co which would contain a user.dat file containing the settings for user Ralph. (Alternative hash methods can be set in the ini file to use more complex methods for creating user directories.) This user.dat file is a text file which can be edited by the system administrator. The default settings come either from global ini file settings or from the default user.dat file which is called default.dat and is stored in the main template directory. (Note you will need to create default.dat if it does not already exist) For example you might create a default.dat to change the default reply to address from the users login name to some prompt string such as "Enter your email address here" to do this just create default.dat with the single line"dflt_reply Enter your email address here

You could also create batch scripts or programs to modify the contents of the user.dat files to do things like updating users' disk quotas or changing their "Real name" based on the contents of some central user database.

You may also use the variable %%user%% within the default.dat file. For example to set uvar1 to fax-username you could add a line

uvar1 fax-%%user%%

A manager page is also provided as part of the cwmail/dmailweb cgi to enable the system administrator to change settings in the user.dat files. It allows you to change a setting for a wildcard selection of users and to perform other manager tasks. For example you might want to change the name of the "Trashcan" folder for all existing users, having changed the name for new users by modifying the waste_name ini file setting. To access the manager page you enter a url of the following form:

http://my.site.com/cgi-bin/dmailweb.exe?cmd=manager

It also requires the use of a manager_password which must match the corresponding setting in the cwmail.ini or dmailweb.ini configuration file. Note: If you put a manager password in the ini file you need to ensure web users cannot read this file. You can also use the form
manager_password @fred
in which case the password will be read from fred.dat in templates directory.
The cgi directory should normally be set execute only for web users. The file should only allow owner read access so only CWMail or DMailWeb can read it.

The manager.tpl like other template files can be completely tailored by the system administrator. It uses the following %%variables%%

Manager variables

Variable Description
uadd If checked then user.dat files not containing any value for the setting being modified will have a setting line added.
ub_only If checked only modify user.dat files for which this setting is blank or missing.
upurge If checked a purge of all cached new mail messages for the selected users will be performed. This is essentially a forced logout for matching users who have been logged in for more than 12 hours.
uwild Wildcard selection of users to process. Note: user name includes both username and pop account of the form: ralph@netwin.co.nz so to change ralph settings for all accounts use ralph* and to change all users with accounts on netwin.co.nz use *@netwin.co.nz
uset User setting to change. Examine user.dat file with a text editor to see what settings can be modified.
uval New value for setting uset to be entered into user.dat for each matching user.
last_purge Time of last purge of cached new mail messages.
nmatches Number of matching user/host name combinations
nusers Total number of user/host name combinations found on system
nadded Number of user.dat files which had a setting line added to them
nmodified Total number of lines in user.dat files which were modified to the new value (uval)

Manager Page:

An example of the manager page is shown below:

DMailWeb Management

This form allows you to modify user settings for a wild card selection of users by modifying the values stored in their users.dat files. These files store settings for a variety of options from disk quotas to default reply addresses. The user.dat files are simple text files and can also be edited directly with any text editor.

Manager Password:
1 of 2 user.dat files purged
2 of 2 user.dat files updated successfully
Apply to users matching: Setting to Change: New Value
Add a line for users with no current matching setting Purge cache for timed out users

Results:

Number of users   2
Matching users   2
Lines modified   2
Files added to   0
Last purge   Mon Jun 29 20:41:15 1998

CWMail 1.7b Copyright NetWin Ltd


Allowing Users to change their passwords

The config.tpl page from Version 2.1b onwards allows users to change their password by pressing a change password button. Note; at present this function is only available if the particular pop host also supports the poppassd protocol. See poppassd for an example of the unix and NT source for poppassd.

Much more extensive control of user password modification, account creation, mailing list control etc. is provided by a companion product NetAuth.


Parent-Child accounts and SPAM Control

CWMail provides several features for control of SPAM, in addition to a unique Parent-Child email account system.

  • User set of New Mail Filtering Rules
  • Reject list of SPAM sender addresses
  • Parent-Child Accounts

Filtering Rules:

Unwanted email can be controlled using the normal Rule Filtering options for new mail. These allow searching particular headers for strings, and a variety of action options.

Reject Lists:

In addition each user has a reject-from list which contains email addresses from which email messages should be rejected. This list can be edited from the user config page. NOTE that messages with a sender, from or reply-to header matching an entry in this list are immediately and irrevocably deleted when the POP server is checked for new messages. The only record of these messages is a count of rejected messages.

When a message is being displayed on the item.tpl page, in addition to the normal buttons for Reply, Forward, Delete etc. there is a Reject button. The reject button does the following:

  • Deletes the message (without copying to trash)
  • Adds the sender's address to your reject list
  • Displays the next message

Parent-Child Accounts:

Parent-Child accounts provide a simple way for parents to control who a child will receive email from.

When a child receives email from a person the following steps occur:

  • Check if the message is on the child's reject-list, if so delete it.
  • Check if the sender is on the child's accept-list, if so deliver the message to the child
  • Otherwise forward the message to the parent, with attached child_accept, child_reject options.
  • If the parent presses child_accept then the message is returned to the child and the sender is added to the child's accept list.
  • If the parent presses child_reject then the message is deleted and the sender is added to the child's reject list.

The parent may also edit the child's accept and reject lists directly. Parent and child accounts are just normal CWMail email accounts. To register another account as a child account you must know the email address and password for that account. Once an account has a registered parent it becomes a child account and the user of it loses the ability to control their own accept and reject lists - this control passes to the parent. A parent may control multiple child accounts.

Setting up a Child Account

For a user to setup a child account they must firstly just create (or have created for them) a normal email account for the child. The child must log in so that his/her user.dat is created. The parent then logs in and goes to the options page of their own account and then to child setup. There they must enter the child's email address anna@a.b.c for example and the password for that account and then press save.

This records in the child's user.dat that they are the parent. An account can have only one parent but multiple children.

Parent-Child commands variables and template files:

  • New template files:
    File Function
    rules.tpl New mail filtering rules and accept_from reject_from lists
    child.tpl Used to display and edit settings for a child account
    confmenu.tpl Used in child, config and rules template files as a sub menu
  • New user.dat variables:
    Variable Function
    af: Only accept email with sender/from/reply matching an af: line. Multiple entries allowed, one per line. Wild cards allowed. If no af: settings then any address is acceptable
    rf: Reject email with sender/from/reply matching an rf: line. Multiple entries allowed, one per line. Wild cards allowed. Rejected emails are deleted and counted.
    rejected Total number of rejected emails
    parent email address of parent. The existence of a parent entry defines an account as a child account.
    ch: child accounts, one entry per line.
    child_edit current child account to be displayed, edited etc.
  • New || variables:
    Variable Function or Contents
    children list of child accounts
    child_edit Email address of current child account to load/save
    child_pass password for new child to edit. To view/edit a child account you must either enter the password or be already defined as the parent of that account.
    ch_accept_from List of email addresses child's account will accept emails from. Email with a sender not on the accept or reject list is transferred to parent.
    ch_reject_from List of email addresses child's account will not accept email from. One entry per line, wildcards are allowed. Email with a matching sender/from/reply address will be deleted from POP host without download.
    b_child_reject Can be used in href to provide a button to delete msg and add sender to child's reject list. See item.tpl for an example of its use.
    b_child_accept Can be used in an href to provide a link/button to delete a message and return it to child's account and add the sender address to the child's accept from list
    accept_from List of email addresses to accept email from. If list is empty any from address is acceptable. One entry per line. Can contain wildcards.
    reject_from List of email addresses to reject email from. Email with matching sender/from/reply are deleted from POP server.
    rejected Count of rejected emails
    nrej Count of rejected emails on last POP check
    b_reject Can be used in an href to provide a button/link which will delete the current message, add the sender address to your reject_from list and move to next message.
  • New commands:
    Command Function
    reject Delete message and add sender to reject list
    child_accept Delete message after returning it to child account and adding sender to child's accept_from list
    child_reject Delete message and add sender to child's reject_from list
    child_show Display settings for a child account
    child_save Save new settings for a child account
    child_release Release a child account from parental control
    child_load Load settings for a new child account. child_pass should be entered.

Hashing of User Directories:

For most systems the simple approach of using directories of the form workarea/u_fr/fred@netwin_co_nz for user fred at netwin.co.nz is best. This provides a spread of user directories and an easy way to find the user.dat for any given user. On some very large unix systems the directory lookups can be slow if there are more than about 800 entries in a directory. For these systems a second hashing more complex hasing method is provided. It is set by putting:
hash_method nhash
or
hash_method 2

in the ini file. This new method allows any characters in usernames and uses a two level directory structure    eg. workarea/n_a9/b4/encoded_user@domain.name
rather than just workarea/u_xx/user@domain_name
It provides a very flat distribution and will produce less than 800 directories per directory even on systems with many milliions of user accounts.
Note1: Most large systems even on unix do not see a problem with existing hash method which is more transparent.
Note2: As changeing the hashing method will make the cgi look in a different directory for a users files it should not be done on a working system. (Users would loose their messages and settings)
A utility wmcd which returns a user_directory for a given username@domain is included in the new distribution.

Example

wmcd ralph/a@domain.one%.two
.\n_i5\l9\ralph_Ja_Pdomain_Ione_9_Itwo

Later a change hash method utility will be provided to move user files should this become  necessary.


CWMail.ini settings

General configuration settings are stored in cwmail.ini which must be in the same directory and have the same root name as the executable. So if the the cgi is renamed xmail.cgi then the configuration file will be xmail.ini

Symbol Example Default Explanation
@pop true false Allows user to enter pop host by using user@pophost in the username field in login.tpl. Without this setting user@pophost would be passed to the pop server as a username.
add_header <META HTTP-EQUIV="Pragma" CONTENT="no-cache"><META
HTTP-EQUIV="cache-control" CONTENT="no-cache">
blank Can be used to add html to the <head> section of all template files. The example shown would stop pages being cached by a browser on a public computer.
allow_java true false Allows the execution of Java applets included in  html email messages. If the setting is false applets are effectively commented out of the message. The default is false to prevent Trojan horse attacks.
allow_script true false Allows the interpretation of Java scripts in html email messages. If the setting is false Java scripts are effectively commented out of the message. The default is false to prevent Trojan horse attacks.
allow_form true false Allows the interpretation of html forms in email messages. If the setting is false forms are effectively commented out of the message. The default is false to prevent Trojan horse attacks.
auto_login 1 netauth.exe $(workarea)/../netauth show=passwd.tpl none Allows auto_login to another product with a template href like this <a href="||action||?cmd=send_auto_login&n=1&utoken=||utoken||&&">Netauth</a>
See listf.tpl for examples of links and default ini files for example in settings. This method can also be used by third party cgi's Uses pass_file auto_login method.

Note: If the last parameter starts with a , it is inserted directly after cmd=auto_login rather than at the end - this enables one to send for example
cmd=auto_login,fwd1&othertuff=value to give multiple commands to NetAuth.

auto_logout_mins 200 60 Time since last activity for logged in user before cache of new mail messages is purged

body_add

http://xxx.yyy.zzz

blank

Adds the line given to the body of all outgoing email messages. You can have multiple body_add lines to produce a multi-line addition. To add blank lines use a body_add line with trailing spaces. If the value for body_add is from_template then the body add  text will be taken from a field called body_add in the send.tpl form ( this can be used with javascript to produce different body adds).
Extended body_add functionality - requires version 2.8a
body_add ~command - execute 'command' and append it's output to the message.
body_add @file.txt - append the contents of the file file.txt from the
templates directory to the message.

body_limit

wbl

2000 nolimit If set it will limit the number of characters served in message body in item.tpl or item.wml Used for browsers like wap phones which can only handle limited number of characters. It can also be used as a form variable to make it user dependent and even agent dependant so it can vary when user connects from another device. Can be set from login page and list page as wbl variable. ie if login page contains hidden variable wbl with value 10 then on login body_limit will be set to 10

Note: in ini file there can be a setting body_limit
        it is also stored in user.dat so ini file default is
        overwritten by user.dat value.
        It can also be set in template files (where it is called wbl rather than body_limit)  template wbl value overwrites user.dat value of body_limit.

cache_posts false true If false send the html headers to browser to stop it cacheing responses to POSTS headers sent are:

Pragma: no-cache
Cache-Control: no-cache

content_type text/x-html text/html HTML MIME content type, some servers allow 'special' features for documents with a modified type.
cookie_ipcheck 4 3 Determines how many sections of IP from address is matched when checking for use of cookie based login
copy_name sent_messages copies to self The name of the folder to store copies to self items in
cgi_path http://myserver.com/scripts/cwmail.exe env var Sets the cgi_path. Only needed if Web Server does not set the appropriate environment variable for cgi's.
date_format dmy mdy Sets the date format to month first or day first
debug True false Enables verbose debug output.
default_max_dkbytes 100000 4000 Used for initial setting and to limit users setting of max_download_kbytes. Messages larger than this will not be downloaded from pop server.
default_max_dmsgs 20 100 Used for initial setting and to limit users setting of max_download_msgs. Only this many messages will be downloaded from pop server at one time.
default_quota 100000 100000 Initial disk quota for new users. Users quotas can be changed by modifying setting in each users user.dat file. Given in kilobytes.
domain acme.com this host Used to create the email 'from address' for each user. Can be $pophost to signify use the pophost setting entered by user on login page or in default.dat
empty_passwords true false If you have some accounts without passwords and you want cwmail/dmailweb to  allow logins to these accounts then this setting must be set true in ini file.
empty_trash_on_exit true false Force an "empty trash can" on logout and login (after 12 hours)
extended_index true false Added in 2.7a If false it limits headers stored in index to keep it compatible with 2.6k and before.
For new systems this should be set true to enable all new features to work.
frames_default true false If true then the default login is a frames login. In I.E. pressing Enter on login page performs a default login.
fetch_min 600 200 Minimum time before rechecking POP host for new mail for mail list page
fix_from true false When true the reply-to field is only used for reply_to header inside sent messages. The from header and envelope header are fixed as user@domain
fld_maxlength 20 14 Sets the max length for folder names which will be accepted
force_primary true false Insists that the user logs into your local pop server first. POP entries in login.tpl are ignored.
hash_method 2  or nhash 1 Changes hashing method for user directories. Note! Dont change  on existing systems as user files wont be found after change.
hash_num 5 2 The number of characters to use in hashing username for user files.
With setting 2 user johns files will be in workarea/u_jo/john@pop_domain
hide_ip true false When true this setting stops this header being added to outgoing mail:
X-User-Info: ip.addrs.of.machine.running.dmw
hide_host true false When true this setting removes the  POP host name from the error message the user will see if their login fails. 
hide_x_mailer true false Removes the x-mailer cwmail... header on sent messages if registered
inline_options target="newpage" none Allows options to be set for inline http references in messages. Example target="newpage" will force a new browser window to be created when an inline reference is clicked.
ipcheck 4 3 Number of bytes of ip address to match when checking from address matches. For example if set to 3 from address 161.22.3.2 will match with 161.22.3.7
iso true false If true then any characters sent to the web browser as part of message body etc have the following trnslations performed. Any characters with codes greater than 127 are sent in &#nnn; format.
item_pre1 <p> <pre> The tag sent before a mail message body
item_post1 </p> </pre> The tag sent after a message body
item_pre2 <p> none The tag sent before a mail message body when variable_width_font display setting is in effect.
item_post2 </p> none The tag sent after a mail message body when variable_width_font display setting is in effect.
keep_index false true Keep the index of remote messages on logout so that message read and other flags are not lost
key 2222-333-44-222 1 month key Used to enter Registration key
language_file lang.dat none If included then lang.dat file will be used to translate information and error messages
last_first true false If true then when retrieving message from POP server the last message will be downloaded first. This is less efficient but if a user has 1000 messages and it is set to only download 100 at a time users may prefer to see the last(i.e. most recent) 100
limit_list true false if true then in list of mails when expanding begin_list end_list we check chars printed and if reach body limit we stop even if page size has not been reached. Usefull for wap phones.
lock_id 123 first part of hostname When seting up a server farm with several machines running CWMail and sharing a work area each must have a unique lock_id. THis will normally happen by default as the lock_id is set to this first part of the hostname. eg for netwin.co.nz it would be NetWin. If you are running two machines with shared cgi-bin  and hence shared ini file then you must NOT have this set in ini file.
lock_old 100 300 A lock older than this (secs) is ignored. Too large a value means an account takes to long to free up after a problem occurs. Too small means user.dat can get overwritten just because POP server takes a long time to respond or transfer of file to user over slow link takes too long.
lock_wait 2 5 When waiting for a lock give up and return an error after this time in secs. Too short and you get cant get lock errors. Too long and load increases due to many copies of cgi waiting for locks.
lock_force_wait 2 0 When finished with a lock wait this long before giving it up
log send,rules,cookie,user_rw,locks,dotlocks,query,environ,purge,body_limit
,top_reply,stat_reply,uidl_reply,list_reply,index
none list of extra items to log (when debug true)
log_file /logs/cwmail ini dir Directory to store the log file in
logout_time 16:30 or 2000 0 user utokens normal expire at midnight use this setting to make them expire at some other time of day hh:mm or seconds
lowercase_password true false Always lowecase password so password secret is the same as Secret and SECRET
lowercase_pophost true false Always lowecase pophost so Whatsit.com is same as whatsit.com
lowercase_username true false Always lowecase username so user ralph is same as Ralph and RALPH
no_manager true false Disable all manager access to cgi.
manager_ip 163.4.5.55 any comma separated wildcard list of ip addresses to accept cmd=manager from eg 162.4.5.*,173.2.3.4
manager_password mysecretpassword

or

@filename

none Password for access to manager.tpl manager page. Note if you put a manager password in the ini file you need to ensure web users cannot read this file. If you use @filename then you must put the password in a text file in template directory called filename.dat
match match headername matchstring variablename htmlvalue none match headername matchstring variablename htmlvalue

eg. match from "@netwin" fromnetwin bgcolor="#EE0000"
    would create a template variable ||fromnetwin|| with value bgcolour="EE0000" on lines in listf.tpl which have a from header containing string @netwin
  if "!@netwin" was used instead of "@netwin" then it would match lines which have a header name which does not contain @netwin

  as headername you can also use _flags which will contain some of
  read, unseen, new, file

max_sends 20 500 Maximum number of messages a user may send in one day.
mcache_kbytes 200 10 Messages larger than this initially only have their headers downloaded or cached
=0 means always leave body on server - never cache body
<0 means never leave body on server - always cache body
new_mail_name inbox New Mail The name for the folder that new messages are put in
nfs true false On a shared nfs file system need this set true as normal file locking does not work.
no_checksum true false Normally when reading user.dat files a checksum is used and if its wrong the  read is aborted. If a third party application is being used to add setting to user.dat you may want turn this check off.
no_cookie_domain true true If true cookies are generated for a specific domain. THis is more secure as calls to other domains will not return the cookies.
no_delete mrbig@whatsit.com none User cannot setup delete rules which filter messages based on a string contained in no_delete. EG if no_delete=me@a.com then user cannot auto delete messages from me@a.com
no_ipcheck true false If true don't check for same IP from address during session.
no_new_users true false Disables new user account creation
no_pick_in_tolist true false Don't show pick list entries in ||tolist|| ie just address book entries
no_quoted_printable true false Disable conversion to quoted printable when sending messages
no_sender true false If true then no sender header is generated for  new messages..
no_slash_filename true false When an attachment is shown within a message the url used contains /filename after the cwmail.cgi and before the parameter list eg. http://myplace.com/cgi-bin/cwmail.cgi/letter.doc?cmd=...
If you try to save the attachment to disk  this helps some browsers know what filename to suggest. However some web servers dont like anything after the cgi name and before the ?   This setting allows you to disable this feature if you have such a web server.
no_rename true false Disables use of rename file for updating user.dat. Needed on some shared nfs systems.
no_tcode true false Disables the use of tcode in login.tpl
This will reduce security but allows the use of a static  login page. The tcode is placed in the login page by the cgi and is checked at login. Each tcode is only allowed once. This prevents a cached login page being used again.
no_trash true false Disable delete actions from doing an auto copy to Trashcan.
noedit_reply_to true false Prevents users from editing their default reply to field
noedit_real_name true false Prevents users from editing their real_name field
nwimg /images/nwimg ||b_action|| relative url to use for locating images used in templates. These are normally stored in /nwimg in main web server directory but can be elsewhere. If no nwimg setting is included in the ini file then ||b_action|| is used which is the cgi path and the cgi will serve the images from the templates directory.
original_pophost my.test.com none When users are first created a directory for each userame@pophost is created. If you later change the pophost setting in the ini file they will be connecting to a newpophost but there settings are stored in username@oldpophost. By having an ini setting for original_pophost (which should never be changed)  you can change the pophost setting and CWMail will automatically translate as appropriate between newpophost and oldpophost.
peruser_pophost true false If set then never refresh users pop_host setting from the ini file. i.e. always use the one from user.dat pophost 0 line. This allows each user to have a different pop host (stored in user.dat) even for DMailWeb
pick_abook_max 100 250 Max number of items from address books to be displayed in pick list
port 1100 110 POP port to connect on
pophost pop.your.domain this host The name or number of your POP mail server
pop_retry 5 1 Number of times to retry connecting to POP when its busy. 1 second sleep between attempts
pop_busy locked by another user please try again try again If we see this string in a failed login reply from POP server then try again after a 1 sec sleep
pop_timeout 90 30 Time-out in seconds to wait for response to command from POP and SMTP servers.
pop_delete_default false true Sets the default setting for each new user. True implies delete message after download. Individual users can change setting in their config page.
poplist_width 20 no limit Limits the width of entries displayed in poplist list of pop hosts.
purge_mins 600 no purges The time between purges of cached new mail messages for logged in users who have reached the auto_logout time
read_status true false If true then check the status header for  O for opened and if found set our read flag so we see message read elsewhere as read in cwmail/dmailweb
read_flag R O use with read_status true to tell it what to check for in status header - some POP servers use R for read and some O for opened
read_wrap 75 85 Wraps message lines in received messages at this point. Use -1 to set no_wrap
reply_prefix false   or  ---    any string > The prefix used in ||quote_body|| for each line of message body used in reply
replyto_fixed true false Stops the user from modifying their 'from' address.
require_cookies true false If set true then it will only talk to clients with cookies enabled
rset true false Send POP server an RSET command before quit to stop it marking messages as read when read by cwmail/dmailweb but not deleted.
send_wrap 75
set_charset false true When set we set the charset in content type header based on charset found in msg header. Used for displaying messages with special character sets.
set_status true false When true and RSET ini setting also true. On connection to pop server we only get headers using top n 0 and then send rset before quit. This makes pop server leave Read/unread flag in status header alone. Then when user reads message the flag will be set.
show_tiff true false Enable inline view of tiff images assumes browser supports tiff images.
smtphost mail.your.domain this host The name or IP number of your SMTP mail gateway
smtp_auth true false Enables authentication when connecing to the smtp server
smtp_port 250 25 The port to use for  SMTP mail gateway
stats true false if true then everytime a template file (eg fred.tpl) is served one byte is added to a file called stat_fred_tpl.s in workarea or fred_tpl.s in stats_path if that is defined
stats_path /var/spool/stats none Path for daily stats file. one line per login. default is no collection of stats. Logs:
  1. timestamp in seconds
  2. login username@pop_address
  3. connection from IP address
  4. messages served
  5. disk space used by messages
stream_max 10 1 Sends up to this many top commands at once to pop server. Some pop servers can't handle this but if yours can this will provide faster response on checknew when there are lots of new messages - eg 100's
suffix /domain.two none Appends a suffix to the username as used in tokens, user.dat directory name and pop host logins. Usually used with vhost sections.
templates /var/spool/cwmail NONE The directory where you have copied the *.tpl files
text_stdin true false Set to true for buggy webservers that dont use binary for attachments. One javawebserver needs it.
top myframe _top On logout etc. target = top so if CWMail is to be run in a frame as part of some other page this will need to be set.
tpl_set n 2 /var/spool/cwmail/French NONE Set the path for an alternative set of template files. 1<n<10 can use $templates as first part of path to signify main template directory
timezone nzst GMT offset An alternative string to append to local time in date header of sent messages. eg nzst instead of -1200 for Wellington New Zealand
u_eight_bit true false This is actually stored in user.dat If it is set then when displaying a message character codes greater than 127 are passed thru directly rather than converting into &#nn; format. See list.wml for an expample of its use.
use_page_size true false If true then lists of message are shown a page at a time. The default number of messages is 10 but can be set by user on config page.
uvar1-4 users computer type none Four general purpose user variables which you can store any user specific stuff in.
user_prefix saveit_ u_ Any fields in forms which have a name starting with this prefix will have there values stored in user.dat and can be used in any template
utok_cookie true false Allow user to move from within CWMail to other web pages and then return without logging in or keeping utoken
We serve utoken as a cookie on login with a 1 hour timeout and accept in queries and posts without utokens
valid_pop my.pop.host none limits pop hosts users can connect to
valid_to ralph*,*.nz none limits email addresses users can send email to
valid_user *smith,ralph,john none limits usernames which may be used to a wildcard list
var1-8 my_setting_for_var1 NONE Settings for user variables defined in ini file and used as variables in templates
vhost my.domain.two none Starts a section of ini settings which apply to a virtual host my.domain.two Note vhost sections must follow any general settings.
vhost_match HTTP_HOST SERVER_NAME The environment variable that is matched against vhost lines.
vend Ends a section of ini setting which apply to a particular virtual host
waste_name rubbish bin Trash Can The name of the folder into which deleted messages are put
wbl body_limit see body_limit
wml true false Set true for use with wml rather than html devices such as nokia 7110 cell phone. Changes  various defaults and tags to those suitable for wml devices. Looks for .wml rather than .tpl files. Includes content-type text/vnd.wap.wml, <br/> instead of <br>, removes <pre> etc.

Translates $`|{} and char 127 to the &#nnn; equivalents to keep wml browsers happy with chars like  

work fred-george /work2 none For users with usernames between fred and george use work area /work2
workarea /var/spool/cwm_work templates The directory to create CWMail work files and user subdirectories in.