- Table of Contents
- Copyright
- About the Author
- Acknowledgments
- Tell Us What You Think!
- Introduction
- Part I: Introduction to Mac OS X
- Chapter 1. Mac OS X Component Architecture
- Chapter 2. Installing Mac OS X
- Chapter 3. Mac OS X Basics
- Chapter 4. The Finder: Working with Files and Applications
- Chapter 5. Running Classic Mac OS Applications
- Part II: Inside Mac OS X
- Chapter 6. Native Utilities and Applications
- Chapter 7. Internet Communications
- Chapter 8. Installing Third-Party Applications
- Part III: User-Level OS X Configuration
- Chapter 9. Network Setup
- Chapter 10. Printer and Font Management
- Chapter 11. Additional System Components
- Part IV: Introduction to BSD Applications
- Chapter 12. Introducing the BSD Subsystem
- Chapter 13. Common Unix Shell Commands: File Operations
- Part V: Advanced Command-Line Concepts
- Chapter 14. Advanced Shell Concepts and Commands
- Chapter 15. Command-Line Applications and Application Suites
- Chapter 16. Command-Line Software Installation
- Chapter 17. Troubleshooting Software Installs, and Compiling and Debugging Manually
- Chapter 18. Advanced Unix Shell Use: Configuration and Programming (Shell Scripting)
- Part VI: Server/Network Administration
- Chapter 19. X Window System Applications
- Chapter 20. Command-Line Configuration and Administration
- Chapter 21. AppleScript
- Chapter 22. Perl Scripting and SQL Connectivity
- Chapter 23. File and Resource Sharing with NetInfo
- Chapter 24. User Management and Machine Clustering
- Chapter 25. FTP Serving
- Chapter 26. Remote Access and Administration
- Chapter 27. Web Serving
- Part VII: Server Health
- Chapter 28. Web Programming
- Chapter 29. Creating a Mail Server
- Running a Mail Server
- Activating Sendmail
- Sendmail Configuration
- University of Washington imapd
- Web-Based E-mail
- Summary
- Chapter 30. Accessing and Serving a Windows Network
- Chapter 31. Server Security and Advanced Network Configuration
- Chapter 32. System Maintenance
- Appendix A. Command-Line Reference
- Appendix B. Administration Reference
University of Washington imapd
Sendmail makes up only part of the mail-server picture. Although Sendmail handles sending and receiving e-mail on the server side, it does not have any provisions for the client software, such as Eudora or Outlook Express. To provide e-mail for remote clients, Mac OS X will need an IMAP server, a POP3 server, or both. Thankfully, the University of Washington has created an easy-to-install software package that will kill two birds with one stone.
The UW imapd server is capable of handling both IMAP and POP3 traffic and it is already Mac OS X–aware, so it takes very little work to install. Even better, there is absolutely no configuration file for the software, so after it's installed, it's ready to use.
Installing UW imapd
Installing imapd is straightforward, but will require a few additional modifications to be able to perform smoothly on your OS X computer. To start, fetch the current sources from ftp://ftp.cac.washington.edu/imap/. Unarchive the source and cd into the distribution directory:
[primal:~] jray% curl -o ftp://ftp.cac.washington.edu/imap/imap.tar.Z [primal:~] jray% tar zxf imap.tar.Z [primal:~] jray% cd imap-2001.BETA.SNAP-0106252013/
Before compiling, there is a very important change that should be made to the file src/osdep/unix/env_unix.c. By default, the IMAP server will attempt to create all mailboxes directly in the user's home directory. In fact, it assumes that any directory in the home directory is an IMAP folder. This results in potentially hundreds (or thousands) of folders being downloaded and displayed. To get around this, the env_unix.c file must be adjusted so that a directory other than the main home directory is used. This can be any directory, as long as it exists in every user's account. A good choice is ~/Library/Mail/Mailboxes because it contains the mailboxes created by the Mail application. This enables remote access to mail downloaded onto the Mac OS X computer. Just remember to create the directory name you choose in each account that will access the IMAP server.
Edit the src/osdep/unix/env_unix.c file to add the mailbox directory name you've chosen. Look for a line reading
static char *mailsubdir = NIL; /* mail subdirectory name */
Change the text to include the directory you've chosen. For example
static char *mailsubdir = "Library/Mail/Mailboxes"; /* mail subdirectory name */
The source code is now ready to compile using make osx:
[primal:~/imap-2001.BETA.SNAP-0106252013] jray% make osx Applying an process to sources... tools/an "ln -s" src/c-client c-client tools/an "ln -s" src/ansilib c-client tools/an "ln -s" src/charset c-client tools/an "ln -s" src/osdep/unix c-client tools/an "ln -s" src/mtest mtest ...
The compile process takes only a minute or two because the server application is really quite small. Unfortunately, installation of the compiled software is not automated, so you will need to copy the binary files to an appropriate location.
The Mac OS X /etc/inetd.conf file already has entries for the IMAP and POP servers, so we'll just use the standard settings (/usr/local/libexec/). You'll have to create the libexec directory within /usr/local, then copy the files imapd and ipop3d to the new directory:
[primal:~/imap-2001] jray% mkdir /usr/local/libexec [primal:~/imap-2001] jray% sudo cp imapd/imapd /usr/local/libexec/ [primal:~/imap-2001] jray% sudo cp ipopd/ipop3d /usr/local/libexec/
Next, edit the /etc/inetd.conf file to uncomment the imap and pop server entries. You need uncomment (remove the # character) only the line for the server you want to run. If you want both, uncomment both lines. In addition, you'll need to change the name of the POP3 server to match the installed binary (ipopd). The original two lines read:
##pop3 stream tcp nowait root /usr/libexec/tcpd /usr/local/libexec/popper ##imap4 stream tcp nowait root /usr/libexec/tcpd /usr/local/libexec/imapd
The modified versions should look like this
pop3 stream tcp nowait root /usr/libexec/tcpd /usr/local/libexec/ipop3d imap4 stream tcp nowait root /usr/libexec/tcpd /usr/local/libexec/imapd
Adding Services to NetInfo
On most Unix systems, you would finish the install by adding entries for the protocols pop3 and imap4 to the /etc/services file. Under Mac OS X, however, this file is replaced by the NetInfo database. Chapter 23 provides an introduction to NetInfo.
There are two different methods for adding service definitions to the NetInfo database—through the command line and via the graphical NetInfo manager. This chapter will examine the command-line version, and Chapter 30, "Accessing and Serving a Windows Network," will demonstrate the GUI procedure. Either way, the result is the same.
Two protocol definitions must be added to the NetInfo database:
- Name: pop3
- Protocol: tcp
- Port: 110
and
- Name: imap4
- Protocol: tcp
- Port: 143
To add these entries to your local NetInfo database, use the nicl utility as follows. First, the IMAP4 protocol:
[primal:~] jray% sudo nicl / -create /services/imap4 name imap [primal:~] jray% sudo nicl / -append /services/imap4 port 143 [primal:~] jray% sudo nicl / -append /services/imap4 protocol tcp
Next, POP3:
[primal:~] jray% sudo nicl / -create /services/pop3 name pop3 [primal:~] jray% sudo nicl / -append /services/pop3 port 110 [primal:~] jray% sudo nicl / -append /services/pop3 protocol tcp
Finally, reboot the Mac OS X computer, or force the inetd process to reload its configuration using kill -1 and the inetd process ID.
Test to make sure that the services you want to run are running by telneting into port 110 (POP3) and port 143 (IMAP):
[primal:/Users/jray] root# telnet localhost 110 Trying 127.0.0.1... Connected to localhost.ag.ohio-state.edu. +OK POP3 primal.ag.ohio-state.edu v2001.76 server ready Escape character is '^]'. Connection closed by foreign host.
and
[primal:/Users/jray] root# telnet localhost 143 Trying 127.0.0.1... Connected to localhost.ag.ohio-state.edu. Escape character is '^]'. * OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS AUTH=LOGIN] localhost.ag.ohio-state.eduIMAP4rev1 2001.309 at Wed, 27 Jun 2001 19:01:15 -0400 (EDT)
Both services are running, as we intended. As a rule, remember that less is more when it comes to servers. If you aren't going to use the IMAP or POP3 servers, don't activate them in the /etc/inetd.conf file.
The UW imapd server is now ready for use. You can connect to the Mac OS X machine to pick up e-mail that has been received by the Sendmail SMTP daemon.
Web-Based E-mail | Next Section

Account Sign In
View your cart