July 22, 2010

 Auto-detect domain name in login page

To make Atmail detect the hostname of your Atmail URL, and make it automatically detect the domain name for the login page, do the following:

- open up /usr/local/atmail/webmail/application/modules/mail/views/scripts/auth
index.phtml

- find this line block:

$("#loginPage").bind('submit', function() {
email = $("#email").val();
//alert(email);
emailArgs = email.split('@');
//alert(emailArgs[0] + ":" + emailArgs[1]);
$("input[name=emailName]").val(emailArgs[0]);
$("input[name=emailDomain]").val(emailArgs[1]);

Change this to:

$("#loginPage").bind('submit', function() {
email = $("#emailName").val() + "@" + $("#emailDomain").val();
emailArgs = email.split('@');
$("input[name=emailName]").val(emailArgs[0]);
$("input[name=emailDomain]").val(emailArgs[1]);

Then, find:

RememberMe();

Below this, add:
emailDom = window.location.host.substring(8);
$("#emailDomain").attr('value', emailDom);

Note the number "8". This assumes that you use webmail.domain.com for your Atmail vhost. If you are using another Alias like mail.domain.com, the number will change from the number of the letters in the Alias plus one - making it:

emailDom = window.location.host.substring(5);

Then, find:

<tr>
<td>
<label class="user"><?php print $this->translate('Email') ?>:</label> <input id="email" class="input-email" type="text" name="email" tabindex="1" />
</td>
</tr>

Change to:

<tr>
<td>
<label class="user"><?php print $this->translate('Email') ?>:</label> <input id="emailName" class="input-email" type="text" name="emailName" tabindex="1" />
</td>
</tr>
<tr>
<td>
<label class="user"><?php print $this->translate('Domain') ?>:</label> <input id="emailDomain" class="input-email" type="text" name="emailDomain" tabindex="1" />
</td>
</tr>

This will then auto-fill the login page with the domain part of the URL entered.


Filed under: Uncategorized, Customization, Interface, Atmail 6 — John Contad @ 7:40 pm

 

March 5, 2009

 Fixing Broken Text Email Display for Firefox 3.0.7

As of Firefox version 3.0.7 some text only emails will not display in the popup "read email" window on the Advanced Interface. To resolve the issue you have two options:

Option 1

If you have access to our Trac you can download the fixed version of the relevant file from http://dev.atmail.com/tracphp/browser/trunk/webmail/lang/html/xul/readmail-frame.html?rev=1846&format=txt

Save this file to html/lang/xul/readmail-frame.html and from your Atmail web-root you will then need to run:

php lang.php english lang/languages/english/english.lang

Of cause replace "english" with your required language if required

Option 2

Edit html/{your-lang}/xul/readmail-frame.html:

Add this into the body tag: onload="msgwinint()"

and near the bottom of the file replace:

msgwin.document.open();
msgwin.document.write('' + document.getElementById('atmailmsg').innerHTML);
msgwin.document.close();

with:

function msgwinint() {
msgwin.document.open();
msgwin.document.write('' + document.getElementById('atmailmsg').innerHTML);
msgwin.document.close();
}


Filed under: Interface, PHP version, Improvements and Fixes, Atmail 5 — Brad Kowalczyk @ 5:16 pm

 

February 17, 2008

 SubAdmin login session error.

If you are experiencing problems with logging into SubAdmin due to session error try the following.

1> cat /etc/php.ini | grep session

2> Find session.save_path = "/var/lib/php/session"
This directory must be owned by the webserver user.

3> ps aux |grep httpd
To find the webserver username.

4> chown -R atmail /var/lib/php/session


Filed under: Interface, PHP version — Stewart Bazley @ 11:02 am

 

January 1, 2008

 Re-encoding HTML templates to another charset

To recode HTML templates to a specific character-set, just do the following:

- download recode from:

wget "http://recode.progiciels-bpi.ca/archives/recode-3.6.tar.gz"

(Alternatively, it is available at yum and apt repositories, and can be installed automatically.)

- untar, install

% tar xvfz recode-3.6.tgz
% ./configure && make && make install

- recode your language file:

% recode utf8..[charset] /path/to/language.lang

(Where [charset] is the character set, and /path/to/language.lang is the path to your .lang file)

- note that recode may need several "jumps" before it can re-encode the lang file properly. Say, you have a file in ISO-8859-1 that needs to be translated to Big-5; this may need a jump from UTF-8.

% recode latin1..utf-8..big-5

- Go to the @Mail root directory, and execute the lang file:

% cd /usr/local/atmail/webmail
% perl lang.pl /path/to/language.lang

This will then re-encode all HTML files to your chosen character set.


Filed under: Interface — John Contad @ 12:00 pm

 

February 13, 2007

 Compose page causes high CPU usage on IE7

The Compose page can create 100% CPU usage at times. To fix this, just do the following:- open up: /usr/local/atmail/webmail/java script/innovaeditor/editor.js

- find the following lines:

function editorDoc_onkeyup(oName)
{
if(eval(oName).isAfterPaste)
{
eval(oName).cleanDeprecated();

//*** RUNTIME STYLES ***
eval(oName).runtimeBorder(false);
eval(oName).runtimeStyles();
//***********************
eval(oName).isAfterPaste=false;
}
realTime(oName);
}

- change the lines so it looks like:

function editorDoc_onkeyup(oName)
{
if(eval(oName).isAfterPaste)
{
eval(oName).cleanDeprecated();

//*** RUNTIME STYLES ***
eval(oName).runtimeBorder(false);
eval(oName).runtimeStyles();
//***********************
eval(oName).isAfterPaste=false;
}
//realTime(oName);
}

This will then fix the problem.


Filed under: Interface — info @ 5:32 am

 

July 27, 2005

 Image caching via Apache to improve performance

Using Apache with the mod_expire module, you can define the Webserver to allow the client to "cache" images within @Mail, including java script and CSS files.

This greatly improves the load-time of the WebMail interface and reduces the bandwidth loads on the server.

Validate you are running Apache with the "expires_module" defined in the httpd.conf . This generally comes installed under Apache 2.X , older Apache 1.X is an option module build.

To enable edit the httpd.conf and define:

ExpiresActive On
ExpiresByType text/css "access plus 1 day"
ExpiresByType text/java script "access plus 1 day"
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/png A2592000

Next, restart the Webserver and any images used within @Mail are cached for 30-days from the original access-time.


Filed under: Interface — Ben Duncan @ 10:10 am