[Home] [Credit Search] [Category Browser] [Staff Roll Call] | The LINUX.COM Article Archive |
Originally Published: Monday, 20 August 2001 | Author: Henry Chen |
Published to: enhance_articles_sysadmin/Sysadmin | Page: 4/4 - [Printable] |
Install and Test Qmail with POP, IMAP and WebMail
Kill Sendmail? Are you kidding me? Well, no. In this first run original article Henry Chen provides us with free detailed step-by-step instructions for installing Qmail with Redhat 7.1, an alternative open source solution to your mail management needs.
|
<< Page 4 of 4 | |
Adding New UsersSetting up /etc/skelThis mkdir /etc/skel/Maildir mkdir /etc/skel/Maildir/cur mkdir /etc/skel/Maildir/new mkdir /etc/skel/Maildir/tmp mkdir /etc/skel/Maildir/.Trash mkdir /etc/skel/Maildir/.Trash/cur mkdir /etc/skel/Maildir/.Trash/new mkdir /etc/skel/Maildir/.Trash/tmp mkdir /etc/skel/Maildir/.Drafts mkdir /etc/skel/Maildir/.Drafts/cur mkdir /etc/skel/Maildir/.Drafts/new mkdir /etc/skel/Maildir/.Drafts/tmp mkdir /etc/skel/Maildir/.Sent\ Items mkdir /etc/skel/Maildir/.Sent\ Items/cur mkdir /etc/skel/Maildir/.Sent\ Items/new mkdir /etc/skel/Maildir/.Sent\ Items/tmp Now, whenever we create a new user with the Setting up quotaIt is also useful to setup quotas for the LABEL=/home /home ext2 defaults 1 2 With this line: LABEL=/home /home ext2 defaults,usrquota 1 2 Now, you need to reboot the server for this to take hold. It is a good time to reboot the server anyway, to test whether all the boot up scripts for Qmail and Courier IMAP will work properly. After the server reboots, you should see that the Qmail stuff is running
with su touch /home/aquota.user /usr/sbin/quotacheck /home quotacheck will report some errors because the #!/usr/bin/perl # # Wrapper for useradd and setquota # Usage: newuseradd [username] [password] "[comment]" use POSIX; if ($ARGV[0] eq '' || $ARGV[1] eq '' || $ARGV[2] eq '') { print "Usage: sxuseradd [username] [password] \"[comment]\"\n"; exit; } $username = $ARGV[0]; $comment = $ARGV[2]; # Encrypt password srand($$^time&$ENV{RANDOM}); $salt = seedchar().seedchar(); $password = crypt($ARGV[1],$salt); system "/usr/sbin/useradd -g client -c \"$comment\" -p $password $username"; system "/usr/sbin/setquota /home 0 10000 0 0 $username"; exit; sub seedchar { ('a'..'z','A'..'Z','0'..'9','.','/')[rand(64)]; } This assumes that you want to give new users a 10MB disk quota for
e-mail. I also used echo "alias useradd=/root/newuseradd" >> /root/.bashrc And don't forget to add the client group and make the new script executable: /usr/sbin/groupadd client chmod 755 /root/newuseradd So, now, every time you do an TestingSetup a few new users to make sure that they all have the correct Install IMPI thought about getting the tarball for horde and IMP but I am so tired by
this point that I gave the RPM's a try and they worked! All the RPMs do
is that they add some directories and files to the MySQLBefore you can begin installing horde and IMP RPMs, you must first install the mysql and php-mysql RPMs and start the mysql and apache server. To install RPMs, I did this (as root): rpm -ivh package_name To start mysql and apache (and at boot time), I did these: /etc/init.d/mysqld start /etc/init.d/httpd start cd /etc/rc3.d mv K12mysqld S12mysqld mv K15httpd S15httpd We need MySQL because we want to enable the mysqladmin -u root password new_password Horde/IMPNow to install horde and IMP (note the sequence, and you are still root): rpm -ivh horde-1.2.6-1rh7.noarch.rpm rpm -ivh horde-mysql-1.2.6-1rh7.noarch.rpm rpm -ivh imp-2.2.6-1rh7.noarch.rpm The horde/IMP installation packages are so well made that they give you almost all the instructions that you need to complete the rest of the installation. I followed the instructions and did these: cd /var/www/html/horde sh install.sh Then, I went to my browser and opened up http://yourhostname/horde/setup.php3
This created the $default->localhost = 'IP address of your server'; $default->server = 'IP address of your server'; $default->from_server = 'your domain name'; It is important to use the IP address, instead of the hostname. Otherwise, your virtual domain clients will not be able to use IMP if they do not specify the exactly correct hostname of your e-mail server. $default->sent_mail = 'Sent Items'; $default->postponed = 'Drafts'; Note that these are the IMAP folders we created earlier. And they mimic Exchange 2000. /* Cyrus Configuration */ $default->personal_folders = 'INBOX.' Watch out for this one on the web configuration interface. If you don't do this, IMP will not be able to see the other folders (under Inbox). /* Database Configuration */ $default->use_db = true; $default->database_driver = 'mysql'; This enables MySQL for IMP. Once the web configuration is complete, do this on console (you are still root): sh secure.sh mysql < /var/www/html/horde/scripts/database/mysql_create.sql /var/www/html/horde/scripts/database/dbpasswd.sh For the last two command lines, MySQL will prompt you for a
password. You should use the TestingTo play with IMP, goto http://yourhostname/horde/imp/
To make life simpler, I created a new <HTML> <meta http-equiv="refresh" content="0; URL=/horde/imp/"> </HTML> So now, http://yourhostname/ will end up in the IMP login screen. FinishCongratulations!!! You have just completed setup your new e-mail server with SMTP (with relay from authenticated users), POP, IMAP and web interface to the IMAP server. CreditI sourced a lot of people's material. I am trying to list all of them here. If I miss any, let me know and I will add them here:
ContractingIf all these is too much for you and you just want this to be done and someone to take care of it, you should consider contracting SurfXpress (and I will be involved) for a dedicated server solution and negotiate a server management contract with us. We can provide you with a full e-mail hosting solution package. Licensing
No WarrantyA lot of legal stuff should go here. Basically, it will say that this document is provided as is and there is no warranty of any kind... See the OpenContent License mentioned above. ContributionPlease send corrections, suggestions, complaints, fix any typo, grammatical errors, etc. to henry@sxpress.com. Or, you can contribute to my personal sanity by buying some stuff for me from Amazon.
| |
<< Page 4 of 4 |