|
Mail Server Mini-Howto |
Chapter 3 |
||
|
|
|||
|
|||
Setting up IMAP and POPIn this section, we will set up an IMAP4 and POP3 server. For more information about what IMAP is, go to the University of Washington IMAP Information Center.
Download IMAPFirst, you will need to download the IMAP source tarball. You can get this from ftp://ftp.cac.washington.edu/imap, look for the imap.tar.Z file, it should be a link to the latest version. As of this writing, the latest is imap-4.4.tar.Z. Downloaded the file into /usr/src/tar (or wherever you like). In the examples to follow, I will assume that you downloaded the tarball into /usr/src/tar/imap.tar.Z.
Extract the IMAP Source$ cd /usr/src $ tar -zxf tar/imap.tar.Z This will extract the IMAP source files into a directory called /usr/src/imap4.4 (or something like similar).
Edit the IMAP source filesWe have to edit the IMAP source files to tell it where to look for our inbox, and where to store the IMAP folders. As I mentioned before, I want my inbox to be in ~/mail/inbox and my IMAP folders to be stored in ~/mail. $ cd /usr/src/imap4.4/src/osdep/unix Open env_unix.c in your favourite editor and search for the function char *sysinbox(). Change the line: $ sprintf (tmp,"%s/%s",MAILSPOOL,myusername ()); to this $ sprintf (tmp,"%s/inbox",myhomedir ()); Next, search for the function long env_init (char *user,char *home). Change the line: $ myHomeDir = cpystr (home); to this $ sprintf (tmp,"%s/mail",home); $ myHomeDir = cpystr (tmp); Save the file and exit the editor.
Compile ItGo into the IMAP source directory and compile it $ cd /usr/src/imap4.4 $ make slx You should read the documentation to see what what target you should be making. I use slx, but you might not.
Move the BinariesHopefully everything compiled for you, now you have to move the binaries that were compiled: $ mv src/imapd/imapd /usr/sbin $ mv src/ipopd/ipop3d /usr/sbin You can also move src/ipopd/ipop2d to /usr/sbin if you want a POP2 service.
Edit your inetd.confOpen up /etc/inetd.conf and uncomment the the pop3 and imap entries. They should look this: pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d imap stream tcp nowait root /usr/sbin/tcpd imapd Save the file and restart inetd like so: $ killall -HUP inetd Voila, now you have IMAP and POP3 servers are now running. You might also want to check your /etc/services file to see that imap and pop3 services are there (should be on ports 143 and 110 respectively). If everything went smoothly, then you should be able to connect to your box with any IMAP capable mail reader. In the next section, we will look at configuring some Unix and Windows clients to work with the IMAP and POP services we just set up. |
|||
|
|
|||
| Web Database Mini-Howto by Ying Zhang (ying @ zippydesign dot com) | |||