Software Support Documentation
Login Screen Customization
@Mail System Documentation : v 5.0
The latest version of this file can be found at:
http://support.atmail.com/

 

@Mail Login Customization


1 Introduction:

Customizing the login and sign-up screens in @Mail is a simple and effective way of branding @Mail and incorporating it into your web-site theme. It can be done on a per-domain basis allowing you to provide a unique Webmail service for several domains, while still only having one copy of @Mail installed on your server.

2 Background Information

The login page for @Mail can be found in : /usr/local/atmail/webmail/html/english/login.html

2.1 Language Support

@Mail uses a language template system to make it easier for translation. If you are using a language other than english, you must edit the following pages:

/usr/local/atmail/webmail/lang/html/login.html

If you require multilingual support in @Mail you will need to build the interface after you have modified it. Please see http://support.atmail.com/language.html for more information

2.2 Variables

Variables are need for @Mail to function correctly. Within the HTML template the you will see text similar to:

$var{EmailSubject}or $atmail->{username}, etc.

Please do not alter these strings, they are required for @Mail to function.

2.3 Incorporating a login page for an existing site

You can build the @Mail login page into an existing page by adding the following HTML code :

<FORM action="atmail.pl" method="post" name="loginPage" target="_top">

<font>E-Mail Name</font>

<INPUT name="username" size="9" value="$var{username}">
@

<select name="pop3host"> $var{domainbox} </select>

<font>Password</font>

<INPUT name=password type=password>

<font>Interface</font>

<select name="LoginType">
<option value="simple">Simple (Any browser)</option>
<option value="xp">Advanced (IE6+)</option>
</select>

<font>Options</font>
<select name="Language"> <option value="" selected>Default</option> $var{languagebox} </select>
$var{mailtype}
<input class="submito" type="submit" name="Login" value="Login">

</form>

Or the following for @Mail in Client mode :

<FORM action="atmail.pl" method="post" name="loginPage" target="_top">

<font>E-Mail Name</font>

<INPUT name="username" size="9" value="$var{username}">
@
<input type="text" name="pop3host" value="$var{pop3host}" size="15">

<font>Password</font>

<INPUT name=password type=password>

<font>Interface</font>

<select name="LoginType">
<option value="simple">Simple (Any browser)</option>
<option value="xp">Advanced (IE6+)</option>
</select>

<font>Options</font>
<select name="Language"> <option value="" selected>Default</option> $var{languagebox} </select>
$var{mailtype}
<input class="submito" type="submit" name="Login" value="Login">

</form>

 

2.4 Direct login from existing site:

If your users have to sign in to your web-site before they have access to @Mail, your users can have one click access to @Mail, without having to type in all their details again (as long as their login / pass details are the same for both).

The following is the full URL to access @Mail:

http://server.com/atmail.pl?username=username&password=password
&pop3host=domain.com&LoginType=xp&Language=english

You may want to hard code domain.com , xp and english if your users only use one server, login type and language ( specify fields as a hidden field in a <form> ) Remember the use the POST method in the form to avoid sending the username/password in the URL.

You can replace username and password with the variables used to gain access to your main site. Make sure that the username and password is the same for both @Mail and your main site for this to work.

2.5 Creating unique login on per domain basis:

@Mail is designed so that you can have different login and signup pages for each domain. Using the @Mail Subadmin, you can delegate control of a domain-name and the branding for the site to another SubAdmin account.

To create unique login / signup page, follow the steps below:

  • Edit your httpd.conf
  • Copy /usr/local/atmail/webmail/html/english/login.html file to the file /usr/local/atmail/webmail/html/vhosts/domain-name.html
  • Customize the new login template for the domain-name

Editing httpd.conf :

Add the following for each <VirtualHost>

Alias /webmail/ "/usr/local/atmail/webmail/"

You will need to restart Apache.

root# apachectl restart

Copying login.html template

The standard HTML login template can be replicated into to the webmail/html/vhosts/domain-name.html file. Where domain-name is the full host of the domain-name in the URL. @Mail will parse the server $ENV{HTTP_HOST}field and display the custom login page if available in the atmail/html/vhosts/ directory.

Next, edit the new template and replace the line :

<input type="text" name="pop3host" value="$var{pop3host}">

To the normal text name of your POP3/Mailserver hostname for the unique template.

Put a hidden variable of the POP3 host in the form (replace domain.com with your domain):

<input type="hidden" name="pop3host" value="domain.com">

If you have more than one POP3 host, use a select box :

<select name="pop3host">
<option value="$var{pop3host}">POP3domain.com</option>
<option ....
</select>

The select box will not require the hidden variable.

2.6 When the mailserver is different to the email-address domain

If your Mail Server has a Domain name of pop.domain.com , and your username is username@domain.com , you need to use the mailserver option.

<input type="hidden" name="MailServer" value="pop.domain.com">

You can set the input type to Text if you want your users to type in the mailserver field manually.

3. Examples

Here is a table of the fields we will be using in the examples, and what they do.

Field Remarks
username the users name, e.g. bill@domain.com
password the password field, with type="password" the password is masked on the user's screen
pop3host the domain name e.g. bill@domain.com
MailServer the mailserver that @Mail connects to when the user's domain is not the same as the mailserver eg, user's address is bill@domain.com, but the mailserver is at mail.domain.com
MailType the protocol that @Mail will use to attempt to connect to the mailserver, the default is POP3
LoginType the Interface that the either matches the user's browser type, or the user's selection.
Language the Language chosen from the list of supported language packs.

Here are the example login pages, feel free to modify them for your own requirements

Below are additional features for the custom login pages of @Mail.

JavaScript Browser detection

This detects the user's browser and selects the most appropriate WebMail interface for the users browser.

To enable this feature, the following Javascript can be added to the bottom of the login-page ( must be on the bottom to correctly parse the login form )

<script language="JavaScript" src="http://demo.atmail.com/javascript/browsercheck.js"></script>

<select name="LoginType">
<option value="simple">Simple (Any browser)</option>
<option value="xp">Advanced (IE6+)</option>
</select>

The order of the LoginType select box is important - The browsercheck.js will select the most appropriate interface by the array-index of the select-box.

Language Selection

Please note that even if the Default language is set in Webadmin, the language selection should still be available for the user, otherwise the user will have to select their language every time they login.

4 Related Articles

Browse related articles from our online Knowledge-base regarding the Login Customization guide

5. Contact Support

For additional support, please visit our web site, http://atmail.com . Or send us an eMail : support@CalaCode.com

877-4-ATMAIL (Sales) +1 773-451-8334 (USA) +61 245-730745 (Australia)

home | email server | webmail client | email appliance | antivirus | anti spam | groupware | secure email | email admin | email sms | purchase | FAQ | support | KB | Blog | sitemap