!!!WARNING!!!
This HOWTO (which should be named "misleading install guide that is too old to be taken seriously) no longer matches Oli's at pofo.de. Please direct your attention to lifewithqmail.org for better help and more details. (I'm only leaving this up until I can figure out how to gracefully remove it.)
SF - 2005-11-30
4.1 qmailadmin
4.2 vqadmin
4.3 SqWebMail
4.4 vQregister
4.5 SquirrelMail (coming soon)
This section of the documentation is different from that which Olliver Lehmann wrote, insofar as I have included installation instructions for vQregister and SquirrelMail and have changed the layout somewhat. I was considering using vQregister for a free hosting project I am working on and currently use SquirrelMail as the webmail tool for the domains currently under my control. The advantage of using a tool like SquirrelMail over SqWebMail is that the site does not need to necessarily be hosted on the same machine as the email server. I do not know, however, the real security implications of running SquirrelMail on a separate server. My opinion is that SquirrelMail is no less safe than using an email client, as it accesses the server through IMAP just like an email client would (unless you are using SSL). I also do not know, however, how scalable one is over the other, so depending on your needs, you may wish to choose differently than I have. I do know that the constant changes in php has been a cause for headaches in my services because it has led to breaks in the software. In many ways, using the cgi based services that Oliver has described in his HOWTO are positive because they usually continue to work successfully with each new version of apache (although, having said that, I will not touch the new apache 2.x yet - I have simply had too many problems with that server/service). This chapter assumes you already have a functioning version of apache running along with cgi and php services. I also cannot stress how important it is to look at and read the documentation for each of these packages.
qmailadmin is a tool used to administer accounts on an already existing domain. There are three methods of administration for users and mailing lists in qmailadmin. One is to log into the administration menu as the "postmaster" of domain1.tld. The other is to log in as the user on domain1.tld to administer that account only. (The password for "postmaster" or "user" is their respective POP3/IMAP password.) If you do not want qmailadmin to install into the default /usr/local/www/cgi-bin directory, then you must manually make changes to the qmailadmin port Makefile.
To go through the default installation:
make all install clean
You can manage/administer users AND domains through the use of vqadmin.
To install vqadmin:
make all install clean
cd $SRC_PATH
fetch http://www.inter7.com/devel/vqadmin-2.3.5.tar.gz
tar -xzf vqadmin-2.3.5.tar.gz
cd vqadmin-2.3.5
sed 's|@LIBS@|& -L/usr/local/lib -lgetline|g' Makefile.in > Makefile.in.2
mv Makefile.in.2 Makefile.in
fetch http://pofo.de/HOWTO/qmail/files/vqadmin-configure.patch
patch < vqadmin-configure.patch
./configure \
--enable-cgibindir=/usr/local/share/web/mail.domain1.tld/cgi-bin \
--enable-htmldir=/usr/local/share/web/mail.domain1.tld/htdocs
gmake
gmake install-strip
The installation will cause an htaccess file to be copied to /usr/local/www/mail.domain1.tld/cgi-bin/vqadmin. Edit this file and change the path so that it is correctly locating the password file. Then create the password file by using the htpasswd command. The user who should have password-protected access to the site should be added to the /usr/local/www/mail.domain1.tld/cgi-bin/vqadmin/vqadmin.acl file. An example of a user who is already defined as having access to the vqadmin site is "admin."
[I would highly recommend reading the documentation for vqadmin at inter7.com. If you have difficulty understanding the process of creating an htaccess protected web service and the appropriate users, then the documentation available at inter7 will be helpful. It would also be helpful to read some of the resources available on the web regarding htaccess files for apache. If you are not using apache, I cannot really offer any assistance.]
SqWebAdmin provides you with a webmail system that impressively fast and efficient. [The points made by Oliver here are valid. Especially the coming comment regarding not having to access email through normal client methods such as POP3 and IMAP.] Due to the fact that the service accesses the user accounts directly, instead of thought POP3 and/or IMAP4, the service runs faster and stresses the server less.
The FreeBSD ports can be used for installation. The CGIBINDIR and WEBDATADIR variables can be changed to fit your specific installation needs. [Again, be sure to take a look at the documentation available at inter7.com regarding installation and configuration.].
make WITH_VCHKPW=YES \
CGIBINDIR=/usr/local/www/sites/domain.tld/cgi-bin \
WEBDATADIR=/usr/local/www/sites/domain.tld/htdocs
make install clean
The user is authenticated through a so-called authdaemon. This must be installed so that it is activated at boot time.
/usr/local/share/sqwebmail/authdaemonrc
echo "/usr/local/libexec/sqwebmail/authlib/authdaemond start" >> /etc/rc.local
crontab -l >crontab
echo '40 * * * * /usr/local/share/sqwebmail/cleancache.pl >/dev/null 2>&1' >>crontab
crontab crontab -u root
vQregister allows you to offer a web interface for automated email account creation. I have been experimenting with it for use on fettig.org and have yet to have any problems (other than the potential for user abuse). In order to properly install vQregister, you need to make sure you have mySQL installed and have a new database added to mySQL (an example would be a database named vqregister with the username "vqregister" and password "cryptedpassword"). You must also edit the included Makefile to show the correct path for some mySQL libraries. (Otherwise the install will break.)
fetch http://www.inter7.com/vqregister/vqregister-2.5.tar.gz
tar -xzvf vqregister-2.5.tar.gz
cd vqregister-2.5
ee vqregister.conf
At this point go through the vqregister.conf file and make the appropriate changes. The descriptions in the conf file may be confusing, but if you take time to go though it thoroughly, your life will be made quite a bit easier. Once the appropriate changes have been made, save the file by exiting ee. You may also want to edit the vqregister.email file to correspond with your own wishes. I have left it as the default.
At this point, you should edit the Makefile and change the following line:
LIBS = -L$(VDIR)/lib -lvpopmail -lcrypt -L/usr/local/mysql/lib/mysql -lmysqlclient
to:
LIBS = -L$(VDIR)/lib -lvpopmail -lcrypt -L/usr/local/lib/mysql -lmysqlclient
Please be aware that this change assumes you have the default mySQL installation (i.e. from the ports). I do not know enough awk, etc. to create a simple script to make these changes. If anyone does, please contact me.
Now, simply run:
Comments (6)
Hi,
nice piece of tutorial
all wen really well except i had one problem with Squirrelmail, till version 1.4.1 when a user failed the login it didnt show the proper message instead it gave
'Fatal error: Allowed memory size xxxx bytes exhausted at (null):0 (tried to allocate 4097 bytes) in /usr/local/squirrelmail/functions/imap_general.php ...'
and from 1.4.1 the message was 'Error, disconected from server' or something.
I recriated a imap session by telnet and find that when a user failed the login the server instead of printing some kind of error like it just closed the conection and it was messing up Squirremail.
I changed for 1.4.1 in squirrelmail_dir/functions/imap_general.php
function sqimap_read_data_list
and and after
... $resultlist = array();
$data = array();
$read = sqimap_fgets($imap_stream);
/* fix for courier */
if ($read == '') {
$read = $tag_uid.' NO LOGIN failed';
}
and also changed in the
function sqimap_fgets
if (!($read = fgets($imap_stream, $buffer))) {
/* this happens in case of an error */
/* courier fix */
$results = '';
return $results;
}
quite ugly and dirty... but i didnt get more the anoying error.
This is a bit of a stupid question, but with this system qmail+vpopmail, how can i redirect to a specific mail account the output from the dayly scripts ?
Best regards
Marco Gonçalves
Posted by Marco Gonçalves | July 8, 2003 10:04 AM
Posted on July 8, 2003 10:04
I had a stupid javascript error on qmailadmin when changing some user.
You can fix this following this http://www.mail-archive.com/qmailadmin@inter7.com/msg03432.html
Best regards
Marco
Posted by marco Gonçalves | July 16, 2003 2:39 PM
Posted on July 16, 2003 14:39
Hi,
I have followed ur howto exactly as mentioned but.. i am unable to start qmail.
As shown below is my /var/qmail/rc file
#!/bin/sh
exec env - PATH="/var/qmail/bin:$PATH" \
qmail-start ./Maildir/ /usr/local/bin/multilog t /var/log/qmail qmaill
also.. how do i start my tcpserver and stuff.
Is there a file that will start everything?
Thanx
Posted by Rick | August 3, 2003 10:24 PM
Posted on August 3, 2003 22:24
any one have a howto like this one BUT
vpopmail+mysql and WITHOUT the courier imap hack and with SMTP-Auth IMAP-Auth and POP3-Auth?, thx!
Posted by anti-nerd | August 14, 2003 6:19 PM
Posted on August 14, 2003 18:19
I have a question about VqAdmin. Is there a way in VqAdmin's http-based admin to block specific domains, email addresses and/or IP addresses from sending to our server? I'd rather do this within VqAdmin as opposed to via-command line.
In the qmail control file menu, I see options like...
badmailfrom
bouncefrom
bouncehost
doublebouncehost
doublebounceto
envnoathost
What do those all mean? Does badmailfrom mean it blocks emails? I ran a bunch of tests and none of those seemed to block emails.
Any help is greatly appreciated, we're trying to blockout a few domains from sending to us.
Thanks! Please email ryan@sunspotsproductions.com with response to this question.
Ryan
Posted by Ryan Salazar | February 8, 2004 9:34 AM
Posted on February 8, 2004 09:34
Hello,
I am trying to integrate the "change password" option into squirrelmail but thus far have managed to only frustrate myself. I am running qmail+courier-imap+vpopmail+mySQL+squirrelmail-1.4.3a
I tried the change_mysqlpasswd and change_pass plugins available at the squirrelmail website, without any success. Anyone do it yet? Thanks .
Posted by Mahmud Husain Khan | June 21, 2004 3:15 AM
Posted on June 21, 2004 03:15