xiaodown n00b
Joined: 12 Dec 2004 Posts: 3
|
Posted: Tue Dec 14, 2004 5:42 am Post subject: Installing qmail vpopmail courier squirrelmail etc problems |
|
|
This is here just to document what I did to fix my problems that I expierenced while installing the "ultimate mail solution". In essence, I want this to be a continuation of the guide found at: https://forums.gentoo.org/viewtopic.php?t=171499
The above guide is excellent at getting everything installed, and yet after it is done, kind of leaves you hanging on the specifics of how to configure it.
Anyway, do all the stuff in the above guide. I would recomend strongly against installing the vpopmail plugin for squirrelmail unless you can find a workaround for having to run apache as vpopmail:vpopmail. This will cause you permissions headaches with cgi scripts and what-not, and will cause you to need a bunch of world readable files. In short, unless your machine is doing only mail servering, and no other business, don't bother. Of course, this is linux, so... Do what you like, your mileage may vary, etc. My server serves all my functions, though, as in - it is also a full time webserver (it's not dedicated to mail), and thus I need to run it by standard users and groups.
Now. You've installed all that stuff - qmail, vmailmgr, vpopmail, courier-imap, f-prot, qmail-scanner, spamassassin, squirrelmail, qmailadmin. Congratulations.
Wait.
How do you use it?
The instructions say:
Code: | go to http://yourdomain.com/cgi-bin/qmailadmin |
If this doesn't work, check to see if you've changed the default document root or the system cgi-bin in your apache config file. If you have, you may need to move some files around, or change the config file back.
If that is working, you are treated to a screen that has three boxes: Username (probably filled in for you as postmaster), Domain, and Password. You don't know what those are yet, so stop racking your brain, trying to remember something you set in a config file 2 days ago when the compiling just started. You'll need to create the "virtual domains" and give them passwords as needed.
First, check to make sure that you can log into your mysql database for vpopmail:
Code: | mysql -u vpopmail -p vpopmail <press enter>
password: <enter password>
|
If you don't know what the password is, try 'secret'. At any rate, the file in which it is set is /etc/vpopmail.conf. The default one looks like this:
Code: |
# Line 1 defines the connection to use for database reads,
# Line 2 defines the connection to use for database updates/writes.
#
# If you omit line 2, then the same settings will be
# used for both read and write.
#
# settings for each line:
# host|port|user|password|database
# Read-only DB
localhost|0|vpopmail|secret|vpopmail
# Write DB
localhost|0|vpopmail|secret|vpopmail
|
Change the password if you want. Now, to create the domain, virtually speaking.
Code: | cd ~vpopmail/bin
./vadddomain testdomain.com postmaster_password
|
If it gives you trouble here (and occasionally it does, based on what I've found in googling and searching the gentoo forums), just look in /var/vpopmail/domains and see if that domain already exists. If it does, delete it and try to create it again.
Now, go back to your qmailadmin interface (yourdomain.com/cgi-bin/qmailadmin) and log in, with useraccount 'postmaster', domain 'testdomain.com', and password 'postmaster_password'. From here, you should be able to administer the email for testdomain.com.
To check your mail, go to your squirrelmail page. When you emerge squirrelmail, it puts its files in (by default, as of 12/2004) /var/www/localhost/htdocs/squirrelmail. In theory, this should mean that you can go to http://yourserver.com/squirrelmail to get to the squirrelmail login, but this may not be the case (again, as above, this assumes your document root is set to /var/www/localhost/htdocs). You should be able to fix this if it's a problem (move files or change documet roots).
As an aside, whenever I register a domain, I always set up the DNS record so that the MX record points to mail.thatdomain.com, and I set up an A record that points to the IP of my server. This way, if anyone is doing nslookups querying the MX record, it comes back as mail.thatdomain.com, not mail.xiaodowns_server.com, which I think is more professional, plus since the A record is pointing at my server, I can set up an apache conf entry for it and point http://mail.thatdomain.com/ to the squirrelmail login page.
So, log in to squirrelmail. What's that?? It gives you a "Connection Dropped by IMAP server"?? Darn.
When this happened to me, I eventually dug through the syslog and saw that it was trying to call something about authvcheckpw in order to authenticate me in squirrelmail. That should read authvchkpw (chk not check). There's a config file, and darn it if it doesn't escape me where it is at the moment, where 'authvcheckpw' needs to be changed to 'authvchkpw'. If I find that config file, I'll edit this post, or mabey someone will reply with it.
Anyway, I changed the above, and was still getting an error from squirrelmail (well, imapd vicariously through squirrelmail). The error (in /var/log/messages) was:
Code: | imapd: /usr/lib/courier-imap/authlib/authvchkpw: No such file or directory
|
Lo and behold, that file actually didn't exist. This is where I'm wondering if my install was a freak, or if this happens to other people. I did a cd /; find | grep authvchkpw, and there's an authvchkpw.c in the courier-imapd downloaded-and-extracted source, but no corresponding file where imapd expects it. Mabey the emerge didn't complete cleanly? Who knows. Anyway, to fix it I just emerge -U courier-imap. Restart it via /etc/init.d script, and squirrelmail works.
To log into squirrelmail, you have to put your full email address in the "username" field. The reason for this is simple: You're not really a user on the system, in the typical SVR4 sense of the word, PAM auth would not let you log in, you have no entry in /etc/passwd, etc. Your "username" is a virtual username, and it is your complete email address. The reason for this is to make a distinction between bob@testdomain.com and bob@mylittleponyfan.com - in case both are on the machine, no one can just log in as "bob".
So anyway, to log into squirrelmail, use username 'email@testdomain.com', and the password that you set up in qmailadmin when you created email@testdomain.com. There you are.
Extras:
--for the curious, this system uses qmails .maildir directories, they're just all in /var/vpopmail/domains/<whatever.com>/<username>/.maildir/ - that's where the mail is stored.
--If you want to change the squirrelmail screen to change "username" to "email address", you should edit /var/www/localhost/htdocs/squirrelmail/src/login.php - on about line 122 (as of 12/2004), there's a place to change the string that is before the text entry box.
--To log in with a mail client (outlook express, eudora, thunderbird, etc) using this system, you'll just set up an account in the standard way:
Code: | Incoming (POP3) server: yourserver.com
Outgoing (SMTP) server: mail.user's_isp.com
Login Name: email@testdomain.com (You need to use the FULL EMAIL here, too).
Password: whatever.
|
Anyway, I meant to check this for spelling errors and whatnot, but I'm exhausted, so... It is what it is. I hope this helps someone. If you have questions, please ask, or if you have something to add, Please be my guest. |
|