June 7, 2010

 Nginx and Atmail

This document covers the steps you need to take to have Atmail working with the NginX platform.

Nginx is a free, open-source, high-performance HTTP server and reverse proxy. It uses an event-driven architecture that distingtuishes it from the likes of Apache. It uses low-resources, and is used for high-performance environments. See: http://wiki.nginx.org/Main for more info.

First, download spawn-fcgi from http://redmine.lighttpd.net/projects/spawn-fcgi/news:

% wget "http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz"

Untar, install:

% tar xvfz spawn-fcgi-1.6.3.tar.gz
% cd spawn-fcgi-1.6.3
% ./configure && make && make install

Then, download nginx from http://nginx.org/en/download.html:

% wget "http://nginx.org/download/nginx-0.8.40.tar.gz"

Untar, install:

% tar xvfz nginx-0.8.40.tar.gz
% cd nginx-0.8.40
% ./configure && make && make install

This will install nginx in /usr/local/nginx/. You will then need to move the /usr/local/nginx/conf/nginx.conf file, and replace it with the file from: http://atmail.com/download/nginx.conf.txt

% mv /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.old
% cd /usr/local/nginx/conf
% wget "http://atmail.com/download/nginx.conf.txt"
% mv nginx.conf.txt nginx.conf

Spawn the FastCGI process afterwards. For this example, we will run it in port 34480:

% /usr/local/bin/spawn-fcgi -f /usr/bin/php-cgi -a 127.0.0.1 -p 34480 -P /var/run/fastcgi-php.pid -C 2

You will then need to edit the /usr/local/nginx/conf/nginx.conf file. It will contain this line:

  fastcgi_pass   127.0.0.1:34480;  # IP and Port of your spawn-fcgi process

If you change the spawn-fcgi port, you will need to edit it in the nginx.conf file as well. For example, a spawn-fcgi port of 51000 will have this command:

/usr/local/bin/spawn-fcgi -f /usr/bin/php-cgi -a 127.0.0.1 -p 51000 -P /var/run/fastcgi-php.pid -C 2

And this configuration line:

  fastcgi_pass   127.0.0.1:51000;  # IP and Port of your spawn-fcgi process

The configuration file will also contain the following lines of interest:

root   /usr/local/atmail/webmail/;  

This defines the document root you wish to have.

user  atmail;

This defines the username you want to run nginx as.

worker_processes  2;

This sets the number of processes that nginx spawns. We recommend it to be set to the number of CPU cores you have available.

When you are satisfied, run the nginx process:

% /usr/local/nginx/sbin/nginx


Filed under: Uncategorized, Applications, Optimization, Atmail 5, Atmail 6 — John Contad @ 10:46 pm

 

April 23, 2009

 SpamAssassin Allowed Clients

On certain machines, you might not have a loopback address assigned. And when trying to use SpamAssassin, it shows this error in /var/log/maillog:

host-foo spamd: spamd: connection from [ip address] at port 55390
spamd: unauthorized connection from [ipaddress]

SpamAssassin usually binds to all the IP addresses on the machine, but you'll need to specify which IP addresses are allowed to be a client. If you have no loopback IPs configured, it detects your IP as a public IP.

You will need to do the following:

- open up /etc/rc.d/atmailserver (or an equivalent)

- find this line:

/usr/local/atmail/spamassassin/bin/spamd -d -x -q -u atmail --virtual-config-dir=/usr/local/atmail/ -m 6 -r /usr/local/atmail/spamassassin/spamd.pid

- change to:

/usr/local/atmail/spamassassin/bin/spamd -A [public IP adddress] -d -x -q -u atmail --virtual-config-dir=/usr/local/atmail/ -m 6 -r /usr/local/atmail/spamassassin/spamd.pid

Where [public IP address] is your IP address.

- restart AtMail:

   % /etc/init.d/atmailserver restart 


Filed under: Uncategorized, Anti-Spam, Applications, Atmail 5, Atmail 6 — John Contad @ 5:18 pm

 

April 5, 2009

 SELinux and MySQL on the network

If you are using an external MySQL server, and an AtMail installation on an operating system that has SELinux enabled, you might experience the following:

- the installation fails when connecting to the MySQL server
- connecting manually using the mysql command succeeds.

In this case, you need to set SELinux so that it allows HTTP modules to connect to the network. This can be done by executing the following command:

% /usr/sbin/setsebool -P httpd_can_network_connect true 

Retry the installation afterwards.


Filed under: Uncategorized, Applications, Database, Installation, Linux version, Atmail 5, Atmail 6 — John Contad @ 5:53 pm

 

December 15, 2008

 Set Atmail WebMail as the default email-application

When using Windows and a email-address/mailto link is clicked in Internet-explorer ( or another other application ) , Outlook is automatically used to compose an email message.By modifying the registry this can be replaced with Atmail. When an email-link is clicked, the compose page of Atmail is displayed.The user must first be logged into Atmail, otherwise the login prompt will be displayed.To enable run regedit and modify the following key:HKEY_CLASSES_ROOT\mailto\shell\open\commandReplace with:

C:PROGRA~1Internet ExplorerIexplore.exe “http://yourdomain/parse.php?file=html/english/xul/compose.html&XUL=1&func=new”Replace http://yourdomain.com/mail/ with the URL of Atmail on your server.

Filed under: Applications, Optimization — info @ 4:51 pm

 

January 1, 2008

 Finding httpd.conf

Having trouble with multiple copies of the httpd.conf file on your system?Try:

httpd -V

This will give you the following listing:

(more...)


Filed under: Applications — info @ 12:00 pm

 

 Expect Error installing Courier-IMAP

When you get the error:

--
configure: WARNING: expect not found - will not be able to change passwds
configure: WARNING: in webmail
--

Means that you are missing the component called "expect", that normally
comes with tcl. Download the expect RPM, then install on your server
this should resolve the problem

(more...)


Filed under: Applications — info @ 12:00 pm

 

 Compose page slow to load

Under some browsers with McAfee installed on the system OS, the compose screen of @Mail can take up to 10 seconds to load.This is due to the "scriptscan" feature enabled via McAfee. This will search all java script as a security method.

Disabling "scriptscan" will resolve the issue with the slow loading of @Mail.


Filed under: Applications — info @ 12:00 pm

 

 Exim compile problem in Solaris: “Undefined symbol

When compiling Exim in Solaris, and you get this error:

----
Undefined first referenced
symbol in file
floor                               /usr/local/mysql/lib/mysql/libmysqlclient.a(password.o)
ld: fatal: Symbol referencing errors. No output written to exim
collect2: ld returned 1 exit status
----

(more...)


Filed under: Applications — info @ 12:00 pm

 

 Using Pyzor with SpamAssassin

Pyzor is a collaborative, networked system to detect and block spam using identifying digests of messages. You can use this along with SpamAssassin to identify spam for incoming mail.To use Pyzor with SpamAssassin, just run through the following steps:

- download the pyzor source from http://pyzor.sourceforge.net

(more...)


Filed under: Applications — info @ 12:00 pm

 

 Whitelisting domains for specific users

Sometimes, you might want to add whole domains to your whitelist for specific users. This is doable via manual manipulation of the @Mail database - just run through the following steps:- in your MySQL database, select the last line:

mysql> select * from SpamSettings order by prefid desc limit 1;

(more...)


Filed under: Applications — info @ 12:00 pm