The VisualMail configuration file visualmail.conf
The visualmail.conf file contains all the configuration parameters of VisualMail and is located in the /etc directory.
Is the directory where the HTX files are placed. Read the HTX section for more information about the HTX files.
This parameter applies to both versions.
Is the directory where VisualMail saves the configuration, expiration data, and folders of each user.
This parameter applies to both versions.
Is the file that contains all the VisualMail messages listed one per line.
This parameter applies to both versions.
Is the temporary directory where VisualMail saves temporary data. (eg. /tmp)
This parameter applies to both versions.
Is the URL of the VisualMail executable file. This parameter is used to compose HTML files. (eg. /cgi-bin/visualmail)
This parameter applies to both versions.
Is the file that contains all the users that can't access VisualMail listed one per line.
This parameter applies to both versions.
Is the validation method used by VisualMail.
VisualMail supports two validation methods:
You can specify here:
This parameter applies to both versions.
Is the domain name or IP address of the SMTP server used to send mails.
This parameter applies to both versions.
Is the port number of the SMTP server used to send mails.
This parameter applies to both versions.
Is the domain name or IP address of the Main Mail Server. This is the server accessed by default.
This parameter applies to both versions.
Is the port number of the Main Mail Server, usually 110 for POP3 and 143 for IMAP4 servers.
This parameter applies to both versions.
Is the Main Mail Server type.
You can specify here:
POP3: for POP3 server.
IMAP: for IMAP2 or IMAP4 servers.
This parameter applies to both versions.
If VisualMail should leave the mails on the Main Mail Server once downloaded.
You can specify here either yes or no.
This parameter applies to the enterprise version.
Is the default domain name used to compose user's e-mail addresses.
This parameter applies to both versions.
Is the amount of time that an user can be connected without activity or 0 to disable AutoLogout.
This parameter applies to both versions.
Is the maximum attachment file size allowed to upload, expressed in kilobytes or 0 to disable the attach limit.
This parameter applies to the enterprise version.
Is the maximum disk space that an user can use for storing his/her mails, expressed in megabytes or 0 to disable disk quota.
This parameter applies to both versions.
This parameter specifies the logging level used by VisualMail, the entries are recorded using the syslog facility.
Levels are:
0: Disable logging.
1: Logs logins and logouts.
2: Logs logins, logouts and several errors.
3: Logs logins, logouts and all the errors.
4: Logs everything.
The Banned Users file
The banned.cfg file contains a list of users that can't have access to VisualMail, one per line. Is suggested that you add any root users of your system to this list in order to avoid force brute password cracking.
The Language file
The language.cfg file contains all the messages displayed by VisualMail listed one per line. Modifying this file, you can customize date formatting options, error messages and some default texts.
The language file is common to both versions of VisualMail. Don't delete or add any line(s) of the language file, or you will receive error messages.
The date formatting macros are the same used by strftime():
%a The abbreviated weekday name according to the current locale.
%A The full weekday name according to the current locale.
%b The abbreviated month name according to the current locale.
%B The full month name according to the current locale.
%c The preferred date and time representation for the current locale.
%d The day of the month as a decimal number (range 01 to 31).
%H The hour as a decimal number using a 24-hour clock (range 00 to 23).
%I The hour as a decimal number using a 12-hour clock (range 01 to 12).
%j The day of the year as a decimal number (range 001 to 366).
%m The month as a decimal number (range 01 to 12).
%M The minute as a decimal number.
%p Either Am' or Pm' according to the given time value, or the corresponding strings for the current locale.
%S The second as a decimal number.
%U The week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week.
%W The week number of the current year as a decimal number, starting with the first Monday as the first day of the first week.
%w The day of the week as a decimal, Sunday being 0.
%x The preferred date representation for the current locale without the time.
%X The preferred time representation for the current locale without the date.
%y The year as a decimal number without a century (range 00 to 99).
%Y The year as a decimal number including the century.
%Z The time zone or name or abbreviation.
The HTX Language
VisualMail creates all the HTML files using a languange called HTX.
The HTXs files contain a mini language used to place dynamic text and objects in the HTML that is displayed to the end-user.
The structure of the VisualMail HTXs is similar to the HTXs used by Microsoft Internet Information Server.
This language is very simple, it has only 'if' and 'while' control commands and tags used to print dynamic information and HTML objects.
Let's view an example of the HTX language:
1:<H1>Welcome <% UserFullName %> to VisualMail!</H1><BR>
2:<% if HaveMail %>
3:<B><U>You have mail!</U></B><BR>
4:<% while GetMail %>
5:<HR>
6: Message from: <% MsgFrom %><BR>
7: Subject: <% MsgSubject %><BR>
8: Size: <% MsgSize %><BR>
9: Date: <% MsgSize %><BR>
10: <% while end %>
11: <% else %>
12: <B><U>You don't have mail.</U></B><BR>
13: <% end if %>
Line 1 prints the Full Name of the current logged in user.
Line 2 checks if the user has mail on his mailbox, and if this condition is true the HTX is parsed until the <% else %> directive is found, otherwise the HTX is parsed from the <% else %> to the <% end if %> directive.
Line 4 is parsed from the <% while %> to the <% end while %> as many times as messages in the mailbox.
Lines 6 to 9 print information about each message.
Each HTX page has different commands, but there are some global commands that can be referenced from any page.
The following table describes the function of each HTX file:
File |
Name |
Description |
login.htx |
Login screen |
Where the login is performed. |
error.htx |
Error screen |
Displayed when an error occurs. |
index.htx |
Index Screen |
Displayed after the user logs in, usually this screen is used to specify frames information. |
optbar.htx |
Option Bar Screen |
Displayed as a frame, contains a toolbar. This screen doesn’t contain additional HTX commands. |
inbox.htx |
InBox Screen |
Where the messages are listed. |
viewmsg.htx |
Message View Screen |
Where a message is viewed. |
options.htx |
Options Screen |
Where the user selects which section to configure. |
filterconf.htx |
Filters Configuration Screen |
Where the filters are configured. This screen is only available in the enterprise version. |
persconf.htx |
Personal Configuration Screen |
Where the personal options are configured. |
servconf.htx |
Server Configuration Screen |
Where the additional mail servers are configured. |
address.htx |
Address Book Screen |
Where the e-mail addresses and mailing lists are maintained. |
folder.htx |
Folder Screen |
Where the folders are maintained. This screen is only available in the enterprise version. |
signconf.htx |
Signature Configuration Screen |
Where the signature is configured. |
compose.htx |
Message Compose Screen |
Where the messages are composed. |
logout.htx |
Logout Screen |
Displayed when the user logout. |
As you can see this is a very simple language but very helpful to customize VisualMail and change default behaviors.
If you want to write your own HTX files, use as a guide the examples that come with VisualMail and read the Appendix A ( HTX command reference).