November 17, 2010

 How to reset the admin password

It happens, you forget the admin user password for Atmail, or your sysadmin leaves without providing the password.

So how do you reset the adminitration password for Atmail? Easy.

1: Find the mysql details for Atmail under webmail/config/dbconfig.ini

2: Connect to the mysql server, e.g

mysql -u root -p

3: Reset the password via SQL

update AdminUsers set Password=MD5('mynewpass') where Username='admin' and UMasterAdmin='1';

4: Login via the Atmail Webadmin with the new password!


Filed under: Database, PHP version, Atmail 6 — info @ 10:46 pm

 

November 7, 2010

 Fail2Ban for Exim SMTP Auth

Fail2Ban is a great utility which can be found via: http://www.fail2ban.org. It checks for the output of various log files, and assigns an action to take, based on the IP address in the log file.This can be handy for introducing lockouts for various services. In this scenario, we will use Fail2Ban to create a lockout time for 3 consecutive failed logins to Exim SMTP Auth, via IP tables.

Prerequisites:

- IPTables

- Python 2.3 or newer

Steps:

1.) Download Fail2Ban for your distribution via: http://www.fail2ban.org/wiki/index.php/Downloads

2.) If using the source version, untar the file, then install:

% tar xvfj fail2ban-0.8.3.tar.bz2
% cd fail2ban-0.8.3
% python setup.py install

3.) This will create the fail2ban binary. To check if everything is running fine, run:

% fail2ban-client -h

This will have an output similar to:

% fail2ban-client -h
Usage: /usr/bin/fail2ban-client [OPTIONS]

Fail2Ban v0.8.3 reads log file that contains password failure report
and bans the corresponding IP addresses using firewall rules.

4.) Download the jail-smtpauth.conf and smtpauth.conf files from the following links:

- http://atmail.com/kb/attach/smtpauth.conf

- http://atmail.com/kb/attach/jail-smtpauth.conf

5.) Place jail-smtpauth.conf in /etc/fail2ban/jail.conf. Place smtpauth.conf in /etc/fail2ban/filter.d/smtpauth.conf.

6.) Start the fail2ban service:

% fail2ban-client start

7.) You can further alter the parameters. By default, if a user fails to login to Exim SMTP Auth for three times, the user is blocked from port 25 for about 10 minutes. Should you want to change this behaviour, open the /etc/fail2ban/jail.conf file, and find the following lines:

# "bantime" is the number of seconds that a host is banned.
bantime  = 600

# A host is banned if it has generated "maxretry" during the last "findtime"
# seconds.
findtime  = 600

# "maxretry" is the number of failures before a host get banned.
maxretry = 3

8.) So should you wish to  set it so that the user can fail to login for five times in the span of 20 minutes, before banning the IP for an hour, the settings will look like:

# "bantime" is the number of seconds that a host is banned.
bantime  = 3600

# A host is banned if it has generated "maxretry" during the last "findtime"
# seconds.
findtime  = 1200

# "maxretry" is the number of failures before a host get banned.
maxretry = 5

9.) Stop and start Fail2Ban afterwards:

% fail2ban-client stop
% fail2ban-client start


Filed under: Uncategorized, Anti-Spam, Exim, OS, Anti-Virus, Atmail 6 — John Contad @ 8:33 pm

 

November 4, 2010

 How to change the default sort behavior

By default Atmail 6 sorts all emails on the UID (received date) of the message to the server.

Some clients prefer to sort emails from the "date" header specified in the email, vs the received time to the mailbox.

To do so edit:

application/modules/mail/controllers/MailController.php
Change:

                if( !isset($this->session->sort) )
{
$this->session->sort = 'UID';
}

To:

                if( !isset($this->session->sort) )
{
$this->session->sort = 'Date';
}

You can also specify the default sort behavior to Subject, From. And remember, you can change the sort order anytime via the 2-pane UI, click the message headers to sort.


Filed under: User Questions, Atmail 6 — info @ 4:00 pm

 

November 1, 2010

 Apache Giving 404s for Valid Atmail Webmail URLs

Atmail Webmail creates URLs that have trailing path information after the index.php, for example: /atmail/webmail/index.php/mail/auth/processlogin. Most Apache http servers will see the index.php in the URL, discover that the file exists at the given path and execute it while passing the trailing path information (/mail/auth/processlogin in this example) into the PATH_INFO variable which Atmail later processes in order to discover what action it should take.

Now if you are getting 404s with these kinds of URLs (URLs with trailing path information after an existing file name) then all you need to do to resolve the issue is to adjust an Apache configuration directive:

1. Open your httpd.conf and search for the AcceptPathInfo directive. If you cannot find it then it may be in one of the .conf files that get included so search them also (If you cannot find it anywhere then add it to the end of your httpd.conf).
2. This will almost certainly be set to Off so you will need to change it to On

AcceptPathInfo On

3. save the file and restart apache

You should now be able to use Atmail and not get 404s because of the trailing path information. Enjoy!


Filed under: Uncategorized, Atmail 6, apache/php configuration — Brad Kowalczyk @ 3:53 pm