December 22, 2004

 Rsync Setup Instructions (Multiserver)

rsync is a powerful tool that allows you to synchronize the contents of your servers (i.e., configuration files, spamassassin .cf filters and the like). They are specially useful if you are doing the multiserver installation of @Mail, and want to load-balance the stress across multiple servers.

This article details the process of creating an Rsync master and a client. For illustrative purposes in this example, the Rsync master hostname will be called "Master-Foo-01" - the Client hostname will be called "Slave-Foo-02":

1.) Create a SSH public key on the Master server:

atmail@master-foo-01# ssh-keygen -t rsa

2.) This will produce a public key in /home/atmail/.ssh/id_rsa.pub. Copy the .pub file to the Slave machine:

atmail@master-foo-01# scp /home/atmail/.ssh/id_rsa.pub root@slavae-foo-02:/home/atmail/.ssh/id_rsa.pub

3.) Pipe the public key into a file called authorized_keys, in your .ssh directory.

atmail@slave-foo-02# cat /home/atmail/.ssh/id_rsa.pub >> authorized_keys

4.) Make sure that the authorized_keys file, and all of the contents of the .ssh directory have 600 permissions:

atmail@slave-foo-02# chmod 600 /home/atmail/.ssh/*

5.) Try to login, sans password, from the Master Machine to the Client machine.

atmail@master-foo-01# ssh atmail@slave-foo-02

6.) If it logins successfully, go on to instruction 7. Otherwise, redo the key-gen process, or check the permissions of your SSH directory.

7.) Create the file "/home/atmail/rsyncservers.sh" in the master server, that contains the following:

#!/bin/sh
/usr/bin/rsync -e ssh -avr --delete /usr/local/atmail/webmail/ atmail@slave-foo-02:/usr/local/atmail/webmail/
/usr/bin/rsync -e ssh -avr --delete /usr/local/atmail/mailserver/configure atmail@slave-foo-02:/usr/local/atmail/mailserver/configure
/usr/bin/rsync -e ssh -avr --delete /usr/local/atmail/mailserver/etc/ atmail@slave-foo-02:/usr/local/atmail/mailserver/etc/
/usr/bin/rsync -e ssh -avr --delete /usr/local/atmail/av/etc/ atmail@slave-foo-02:/usr/local/atmail/av/etc/
/usr/bin/rsync -e ssh -avr --delete /usr/local/atmail/spamassassin/etc/ atmail@slave-foo-02:/usr/local/atmail/spamassassin/etc/

8.) Give it execute permissions:

atmail@master-foo-01# chmod 755 /home/atmail/rsyncservers.sh

9.) Place the following entry in /etc/crontab:

01,10,20,30,40,50 * * * * atmail /home/atmail/rsync-servers.sh

Your rsync service should now check every 10-minutes for altered files, and synchronize when necessary.


Filed under: Multiserver — John Contad @ 8:45 am

 

December 20, 2004

 SpamAssassin Post-Upgrade Database Errors.

When you upgrade SpamAssassin 3.0, you sometimes get this error when starting sa-learn:

/usr/local/atmail/spamassassin/bin/sa-learn --spam --showdots /usr/local/atmail/users/u/s/userfoo@domain.com/.Spam/cur
bayes: bayes db version 2 is not able to be used, aborting! at /usr/local/atmail/spamassassin//lib/perl5/site_perl/5.8.1/Mail/SpamAssassin/BayesStore/DBM.pm line 160.

(more...)


Filed under: Applications — info @ 2:16 am

 

December 15, 2004

 MySQL Archive Script

It is highly recommended to use a script which automatically backs up the database.Using the script you can setup a daily-cronjob which automatically backs up the mySQL database used by @Mail.

The script will keep an archive of backups for 7 days, and will automatically prune old archives, allowing you to rollback the database to a specific day.

(more...)


Filed under: Backup — info @ 8:39 am

 

December 14, 2004

 Exim system-wide filters

When you have to block specific addresses, domains, senders, or subjects on a system-wide level, you can just create system-wide filters for Exim.

Below are instructions on how to create it. The example filter blocks email messages with a specific subject line.

1.) First, add the following in the Main Configuration section of the Exim configuration file (/usr/local/atmail/mailserver/configure):

system_filter = /usr/local/atmail/mailserver/.filter

2.) Then, create the file described above (/usr/local/atmail/mailserver/.filter), and place the following inside it:

# Exim Filter

if ($h_subject CONTAINS "Email Subject Foo") then
fail text "Email Subject Foo Detected - blocked"
endif

3.) Replace "Email Subject Foo" with the message subject you are describing, save all changes, then restart Exim. This will block all incoming/outgoing messages with the Subject line, "Email Subject Foo".

Note that you can add your own filters in the file - just visit http://www.exim.org/exim-html-3.10/doc/html/filter.html


Filed under: Exim — John Contad @ 3:54 am

 

December 7, 2004

 SpamAssassin and pure_vendor_install error

If you get an error during the SpamAssassin compile:make: don't know how to make pure_vendor_install

You can run the perl Makefile.PL string without the INSTALLDIRS=vendor option:
perl Makefile.PL CONTACT_ADDRESS=user@domain.comPREFIX=/usr/local/atmail/spamassassin/ CONFDIR=/usr/local/atmail/spamassassin/etc/ DATADIR=/usr/local/atmail/spamassassin/etc/ ; make ; make install

This will allow the compile and install of SpamAssassin to continue.


Filed under: Applications — info @ 2:55 am

 

December 4, 2004

 Backup Addressbook Data for a selected user

Common question from clients is how to backup a selected user-addressbook, without having to dump the entire database.Solution below:

Login to the server running @Mail and run the command:

(more...)


Filed under: Backup — info @ 2:52 am