LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-01-2003, 03:34 PM   #16
Hube
Member
 
Registered: Mar 2003
Location: Ann Arbor - US
Distribution: RH 8.0
Posts: 55

Rep: Reputation: 15

I had trouble with RH 8.0 also, so don't assume that it will solve all your problems. How do you authenticate against your machine? I use auth_pam, which basically means use the system username and password (as opposed to a database or some other method of storing passwords). Look in:

/usr/lib/courier-imap/etc/authdaemonrc

on the line:

authmodulelist

use:

authmodulelist="authpam"

and in /etc/pam.d/imap (this file was created by the courier-imap install) make sure that the refernce to your security libraries is correct:

auth required /lib/security/pam_nologin.so
auth required /lib/security/pam_stack.so service=system-auth

**before i read something like:**
auth required pam_nologin.so (without path to the library!)

To create the maildir I think you may have to specify the path, e.g:

maildirmake /home/hube

I can't remember! it may even be:

maildirmake /home/hube/Maildir (even case sensitive as I know I deleted my original ones and then tried again!)

one more thing...

in the /etc/squirrelmail/config.php, make sure you have the following:

$default_folder_prefix = 'INBOX.';

*** Note the the '.' after Inbox, this also tripped me up ***

Let me know how you get on?

Hube

P.s, some of the 7.3 stuff may be different? I would hope that some people on this forum may know how to translate what I've written to 7.3 speak!
 
Old 04-01-2003, 04:07 PM   #17
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
'maildirmake' will make the drop box for your IMAP mail - but IMO it's easier to use the UW imap. I found courier to be a bit of a wrestling match.
 
Old 04-01-2003, 04:36 PM   #18
Hube
Member
 
Registered: Mar 2003
Location: Ann Arbor - US
Distribution: RH 8.0
Posts: 55

Rep: Reputation: 15
Yeah, courier was a pain but now it's working it's pretty cool :-) I was setting up my system based on a very quick conversation regarding what to do and got suckered in to using courier, after a late night I finally got it configured...

I have some notes on what I did but think you may be past that already, I could email them directly if that will help?

Hube
 
Old 04-01-2003, 04:45 PM   #19
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
I got courier up and running fine, however I ran into a roadblock with php-imap as they don't play nice. There's a workaround involving uw-imap source and such, but it looks pretty brittle for my liking. It just means I have to move the php app (tutos) to a different machine.

As for notes, post them here if you want to. Anything done by email only helps one person, whereas anybody can benefit if it's displayed on a public forum.

Last edited by mcleodnine; 04-01-2003 at 04:47 PM.
 
Old 04-01-2003, 08:25 PM   #20
Hube
Member
 
Registered: Mar 2003
Location: Ann Arbor - US
Distribution: RH 8.0
Posts: 55

Rep: Reputation: 15
Here are my notes/ramblings, I realize that I'm not very smart so I document things that I may have to repeat in the future...

There is no guarantee or anything else with these notes! Respect to the people who's links I have copied etc etc..

INSTALLATION
************

My rough notes, used on RH v8.0...

Notes
*****
If another imap server is installed, get rid of it using something like:

To find the rpm package name, try:

rpm -q imap

If this yields a response say 'imap-003', use the following to remove the rpm:

rpm -e imap-003 (replace imap-003 for what you saw above)

Download
********
When you install courier imap, you need to do some of it as a user (not root) and then some of it as root. The first thing to do is download the package from:

http://www.inter7.com/courierimap.html

Unpack
******
The package is distributed as bz2 zip file, use the following commands to unpack the package, ***note*** must be done as a user (not as root).

bunzip2 courier-imap-1.7.0.tar.bz2 (to unzip)
tar xf courier-imap-1.7.0.tar.gz (to unpack tar file)

--- or ---

tar xvjf courier-imap-1.7.0.tar.bz2 (to do it one foul swoop!)

Build as user
*************
Use the following command to build courier-imap.

./configure > configure.txt (so you have a record to look through)
make > make.txt (so you have a record to look through)
make check > make_check.txt (so you have a record to look through)

***notes***
- the configure script can take quite a while and look like it's in a loop, it's
not, that's normal behavior. It also has some good flags that are worth
investigating, in particular pay attention to the authentification methods.


Take over as root
*****************
su root
umask 022
make install > make_install.txt (so you have a record to look through)
make install-configure > make_install_configure.txt (so you have a record to look through)
make install-configure # Install configuration files.

***notes***
- make install puts everything in /usr/lib/courier-imap
- If the directory /etc/pam.d exists, make install creates /etc/pam.d/imap
and /etc/pam.d/pop, this will replace existing files (be warned). Read
below for more commentary on pam, it's good stuff :-) & nothing will work
without some changes...

Configuration
*************
After the install there are a few tasks to do.

There are notes in the official docs regarding /usr/lib/courier-imap/etc... These are my terse notes.

To run courier-imap (and ssl daemon) use the following:

/usr/lib/courier-imap/libexec/imapd.rc start
/usr/lib/courier-imap/libexec/imapd-ssl.rc start

To stop courier-imap use the following:

/usr/lib/courier-imap/libexec/imapd.rc stop
/usr/lib/courier-imap/libexec/imapd-ssl.rc stop

Take a look in:

/usr/lib/courier-imap/etc/imapd

and check that the settings are OK. Do the following:

DEBUG_LOGIN=1 (think 1 is the default don't set to 2 at this puts the user
password totally non-encypted in /var/log/maillog!

Change the ADDRESS variable to 127.0.0.1. ***NO***, if you want courier-imap to listen for connections from other machines then this needs to be set to 0. This tripped me up for a long time!

That's all I changed (here)!
Because I opted to offer ssl, we need a signature certificate, it is possible to create one although this will throw a warning message to any user connecting to the server. It is possible to buy a proper X.509 certificate, for testing we can create one using:

/usr/lib/courier-imap/share/mkimapdcert

It takes a while! This generates a certificate:

/usr/lib/courier-imap/share/imapd.pem


Now we add the startup script so that courier imap starts on boot:

cp /usr/lib/courier-imap/libexec/imapd.rc /etc/rc.d/init.d/courier-imap

***note*** , it's worth going to http://howtos.eoutfitters.net/email/...%20courierimap as he posts an alternative startup script there for Linux.


Set up the right ownership and permissions for it:

chown root.root /etc/rc.d/init.d/courier-imap
chmod 755 /etc/rc.d/init.d/courier-imap

Now we can use chkconfig to make this rc script start courier-imap at boot time (as root):

/sbin/chkconfig courier-imap on


Now start the service (so we don't have to reboot!) as root use:

service courier-imap start


Testing
*******
Let's test connecting to the server. This requires telnet to be installed:

telnet localhost 143

You should see something alongs the lines of:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK Courier-IMAP ready. Copyright 1998-2002 Double Precision, Inc. See COPYING
for distribution information.

use:

1 logout

to exit

To me this is not a conclusive test since you need to log in as a user and with a password to fully verify this structure. I was able to complete the test above but still not able to get email from imap. I later found out that my
authentification was screwed up but that's another story. I went back to try this later on but couldn't get it to work!

We need to set/modify some environment variables: PATH and MANPATH. For Red Hat distributions (and possibly others), edit /etc/man.config (as root) and add the following line under the other entries that start with MANPATH:

MANPATH /usr/lib/courier-imap/man

Next, add the following under the entries that start with MANPATH_MAP:

MANPATH_MAP /usr/lib/courier-imap/bin /usr/lib/courier-imap/man
MANPATH_MAP /usr/lib/courier-imap/sbin /usr/lib/courier-imap/man

We can implement the PATH changes to all users by adding two scripts to
/etc/profile.d (one for bash users and one for (t)csh users):

http://howtos.eoutfitters.net/email/...ourier-imap.sh

Save it as /etc/profile.d/courier-imap.sh.

http://howtos.eoutfitters.net/email/...urier-imap.csh

Save it as /etc/profile.d/courier-imap.csh.

I'm not sure if this is necessary, but I did it anyway to match the rest of the
files that were there:

chmod 755 /etc/profile.d/courier-imap.csh /etc/profile.d/courier-imap.sh
chown root.root /etc/profile.d/courier-imap.csh /etc/profile.d/courier-imap.sh

PAM
***
What the **** is pam I first asked myself when I started this, and more to the point, what are all these authentifiaction protocols... I saw the following:

authcustom authcram authuserdb authldap authpam

and read mention of authpwd authshadow, now these two seem to make a lot more sense to me, since I know about /etc/passwd as the place where user account and passwords are stored and that using shadow is an even more secure way to store these passwords and furthermore that the two files work hand in hand! So why I keep asking myself don't I either see or use these in the authdaemonrc script file and more to the point when I add them to the authdaemonrc they don't work (/usr/lib/courier-imap/etc). Ahh
this is where pam comes in... It basically have quite a few methods available for me to authenticate my incomming users, mysql, ldap, custom to name a few.

What pam does is provide at api (application programmers interface) which allows me to choose in a configuration file exactly what method of authentication I want to use.

The first thing to do is change the following line in:

/usr/lib/courier-imap/etc/authdaemonrc

authmodulelist="authpam" (just use authpam)

This then means that /etc/pam.d/imap will be used. Look in other files such as 'su' and 'sshd' to see what methods of authentification are used. So, the hurdle that I had was the implemenntation of the imap file that gets loaded into /etc/pam.d. The docs mention that this file needs to be configured for 'your' system... and in my case all that meant was changing the following:

From:
auth required pam_nologin.so
auth required pam_stack.so service=system-auth
account required pam_stack.so service=system-auth
session required pam_stack.so service=system-auth

To:
auth required /lib/security/pam_nologin.so
auth required /lib/security/pam_stack.so service=system-auth
account required /lib/security/pam_stack.so service=system-auth
session required /lib/security/pam_stack.so service=system-auth

That's it! The path to /lib/security was missing.

What we have basically done is tell Linux that when the user logs in that the methods in the pam.d directory for imap should be used. In this case we are using pam_stack.so. Documentation on what this done can be read by using:

man pam_stack

OK, I didn't know how to make sure that everything was hunky dorey so I did a reboot at this point and was finally able to configure courier-imap.

That should be it, installation of courier-imap should be complete. Some pain involved but that's all part of the fun!!!

You also need to make the maildirs but I've forgotten how to do that...
 
Old 04-02-2003, 01:44 PM   #21
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Original Poster
Rep: Reputation: 52
I followed the same instructions for your first post Hube and mine still spits out the same error...hmmm, i think i'll re-install using redhat 8.0 and follow your instructions. Doing a google search, i see that it's hard to find tutorials for installation of squirrelmail for redhat 7.3 but more on 8.0 so i'll go the 8.0 way. Thank you very much for your help tho! i really appreciate it ..... Oh yea, i'll keep your notes..that would help me A LOT!

-twantrd
 
Old 04-02-2003, 01:55 PM   #22
Hube
Member
 
Registered: Mar 2003
Location: Ann Arbor - US
Distribution: RH 8.0
Posts: 55

Rep: Reputation: 15
OK, shout if you need help. Hube
 
Old 09-05-2003, 10:27 PM   #23
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
Quote:
Originally posted by Hube
Here are my notes/ramblings, I realize that I'm not very smart so I document things that I may have to repeat in the future...

There is no guarantee or anything else with these notes! Respect to the people who's links I have copied etc etc..

INSTALLATION
************

My rough notes, used on RH v8.0...

Notes
*****
If another imap server is installed, get rid of it using something like:

To find the rpm package name, try:

rpm -q imap

If this yields a response say 'imap-003', use the following to remove the rpm:

rpm -e imap-003 (replace imap-003 for what you saw above)

Download
********
When you install courier imap, you need to do some of it as a user (not root) and then some of it as root. The first thing to do is download the package from:

http://www.inter7.com/courierimap.html

Unpack
******
The package is distributed as bz2 zip file, use the following commands to unpack the package, ***note*** must be done as a user (not as root).

bunzip2 courier-imap-1.7.0.tar.bz2 (to unzip)
tar xf courier-imap-1.7.0.tar.gz (to unpack tar file)

--- or ---

tar xvjf courier-imap-1.7.0.tar.bz2 (to do it one foul swoop!)

Build as user
*************
Use the following command to build courier-imap.

./configure > configure.txt (so you have a record to look through)
make > make.txt (so you have a record to look through)
make check > make_check.txt (so you have a record to look through)

***notes***
- the configure script can take quite a while and look like it's in a loop, it's
not, that's normal behavior. It also has some good flags that are worth
investigating, in particular pay attention to the authentification methods.


Take over as root
*****************
su root
umask 022
make install > make_install.txt (so you have a record to look through)
make install-configure > make_install_configure.txt (so you have a record to look through)
make install-configure # Install configuration files.

***notes***
- make install puts everything in /usr/lib/courier-imap
- If the directory /etc/pam.d exists, make install creates /etc/pam.d/imap
and /etc/pam.d/pop, this will replace existing files (be warned). Read
below for more commentary on pam, it's good stuff :-) & nothing will work
without some changes...

Configuration
*************
After the install there are a few tasks to do.

There are notes in the official docs regarding /usr/lib/courier-imap/etc... These are my terse notes.

To run courier-imap (and ssl daemon) use the following:

/usr/lib/courier-imap/libexec/imapd.rc start
/usr/lib/courier-imap/libexec/imapd-ssl.rc start

To stop courier-imap use the following:

/usr/lib/courier-imap/libexec/imapd.rc stop
/usr/lib/courier-imap/libexec/imapd-ssl.rc stop

Take a look in:

/usr/lib/courier-imap/etc/imapd

and check that the settings are OK. Do the following:

DEBUG_LOGIN=1 (think 1 is the default don't set to 2 at this puts the user
password totally non-encypted in /var/log/maillog!

Change the ADDRESS variable to 127.0.0.1. ***NO***, if you want courier-imap to listen for connections from other machines then this needs to be set to 0. This tripped me up for a long time!

That's all I changed (here)!
Because I opted to offer ssl, we need a signature certificate, it is possible to create one although this will throw a warning message to any user connecting to the server. It is possible to buy a proper X.509 certificate, for testing we can create one using:

/usr/lib/courier-imap/share/mkimapdcert

It takes a while! This generates a certificate:

/usr/lib/courier-imap/share/imapd.pem


Now we add the startup script so that courier imap starts on boot:

cp /usr/lib/courier-imap/libexec/imapd.rc /etc/rc.d/init.d/courier-imap

***note*** , it's worth going to http://howtos.eoutfitters.net/email/...%20courierimap as he posts an alternative startup script there for Linux.


Set up the right ownership and permissions for it:

chown root.root /etc/rc.d/init.d/courier-imap
chmod 755 /etc/rc.d/init.d/courier-imap

Now we can use chkconfig to make this rc script start courier-imap at boot time (as root):

/sbin/chkconfig courier-imap on


Now start the service (so we don't have to reboot!) as root use:

service courier-imap start


Testing
*******
Let's test connecting to the server. This requires telnet to be installed:

telnet localhost 143

You should see something alongs the lines of:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK Courier-IMAP ready. Copyright 1998-2002 Double Precision, Inc. See COPYING
for distribution information.

use:

1 logout

to exit

To me this is not a conclusive test since you need to log in as a user and with a password to fully verify this structure. I was able to complete the test above but still not able to get email from imap. I later found out that my
authentification was screwed up but that's another story. I went back to try this later on but couldn't get it to work!

We need to set/modify some environment variables: PATH and MANPATH. For Red Hat distributions (and possibly others), edit /etc/man.config (as root) and add the following line under the other entries that start with MANPATH:

MANPATH /usr/lib/courier-imap/man

Next, add the following under the entries that start with MANPATH_MAP:

MANPATH_MAP /usr/lib/courier-imap/bin /usr/lib/courier-imap/man
MANPATH_MAP /usr/lib/courier-imap/sbin /usr/lib/courier-imap/man

We can implement the PATH changes to all users by adding two scripts to
/etc/profile.d (one for bash users and one for (t)csh users):

http://howtos.eoutfitters.net/email/...ourier-imap.sh

Save it as /etc/profile.d/courier-imap.sh.

http://howtos.eoutfitters.net/email/...urier-imap.csh

Save it as /etc/profile.d/courier-imap.csh.

I'm not sure if this is necessary, but I did it anyway to match the rest of the
files that were there:

chmod 755 /etc/profile.d/courier-imap.csh /etc/profile.d/courier-imap.sh
chown root.root /etc/profile.d/courier-imap.csh /etc/profile.d/courier-imap.sh

PAM
***
What the **** is pam I first asked myself when I started this, and more to the point, what are all these authentifiaction protocols... I saw the following:

authcustom authcram authuserdb authldap authpam

and read mention of authpwd authshadow, now these two seem to make a lot more sense to me, since I know about /etc/passwd as the place where user account and passwords are stored and that using shadow is an even more secure way to store these passwords and furthermore that the two files work hand in hand! So why I keep asking myself don't I either see or use these in the authdaemonrc script file and more to the point when I add them to the authdaemonrc they don't work (/usr/lib/courier-imap/etc). Ahh
this is where pam comes in... It basically have quite a few methods available for me to authenticate my incomming users, mysql, ldap, custom to name a few.

What pam does is provide at api (application programmers interface) which allows me to choose in a configuration file exactly what method of authentication I want to use.

The first thing to do is change the following line in:

/usr/lib/courier-imap/etc/authdaemonrc

authmodulelist="authpam" (just use authpam)

This then means that /etc/pam.d/imap will be used. Look in other files such as 'su' and 'sshd' to see what methods of authentification are used. So, the hurdle that I had was the implemenntation of the imap file that gets loaded into /etc/pam.d. The docs mention that this file needs to be configured for 'your' system... and in my case all that meant was changing the following:

From:
auth required pam_nologin.so
auth required pam_stack.so service=system-auth
account required pam_stack.so service=system-auth
session required pam_stack.so service=system-auth

To:
auth required /lib/security/pam_nologin.so
auth required /lib/security/pam_stack.so service=system-auth
account required /lib/security/pam_stack.so service=system-auth
session required /lib/security/pam_stack.so service=system-auth

That's it! The path to /lib/security was missing.

What we have basically done is tell Linux that when the user logs in that the methods in the pam.d directory for imap should be used. In this case we are using pam_stack.so. Documentation on what this done can be read by using:

man pam_stack

OK, I didn't know how to make sure that everything was hunky dorey so I did a reboot at this point and was finally able to configure courier-imap.

That should be it, installation of courier-imap should be complete. Some pain involved but that's all part of the fun!!!

You also need to make the maildirs but I've forgotten how to do that...
This is the 3rd Time I've found the need of this thread, so I'd like to thank you for the notes! The problem I continually run into is remembering to give the full path in PAM...

Thanks again!

Cool
 
Old 09-08-2003, 10:10 AM   #24
Hube
Member
 
Registered: Mar 2003
Location: Ann Arbor - US
Distribution: RH 8.0
Posts: 55

Rep: Reputation: 15
A pleasure! Glad that the notes continue to help :-) I've pretty much left the machine running for the past five months and it's still going strong... I hope the notes are useful when I finally have to upgrade from RH v8.0... but that's a different story!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squirrelmail help Child of Wonder Linux - Networking 8 01-11-2006 09:14 PM
how did SquirrelMail get there? novaprime Linux - Software 4 01-24-2005 05:49 AM
How to get imap running with squirrelmail don_dimo Linux - Software 1 10-30-2003 10:12 PM
Squirrelmail gallet Linux - Software 15 08-08-2003 05:04 AM
Running Squirrelmail gallet Linux - Software 3 08-05-2003 01:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration