Setting up a Site Server with Jaguar
Pages: 1, 2, 3, 4
Last Stop: Setting up IMAPd
The last thing we need to do to have a fully-functional site server is to set up a POP and IMAP server so that we can get our mail. Unfortunately, software for these mail servers doesn't ship by default on Mac OS X. Fortunately, it's easy to get, compile, and set up. We're going to use the University of Washington IMAP server. It's been widely tested, is stable, and is easy to use. It also works well with OpenSSL, which is installed as part of Mac OS X.
This integration with OpenSSL is very important, because you have to have a password to log in to your IMAP server, and you do not want others to be able to see this password while it is in transmission. To make sure that your passwords stay secure, I'm going to give you instructions on how to build the IMAP server to use OpenSSL only. This configuration will be compatible with any mail client that understands SSL -- this includes Mail.app and Entourage.
Setting up the Developer Tools
But, before we can build the IMAP server, we need to have the developer tools installed with the optional BSD SDK on the system. If you haven't already installed the developer tools, or neglected to install the BSD SDK, grab the Developer Tools CD that came with Mac OS X, insert it into your computer, and double click on the Developer.mpkg file in the window that appears. Proceed through the installation wizard until just after you have selected the disk to install onto. When you see the announcement "Click Install to perform a basic installation of this software package," clike the Customize button instead. Make sure that the BSD SDK checkbox is clicked, and then click "Install."
The installer will chug on for a while. Do something else while it works, as it is not a quick install. Grab some coffee. Or water.
Download and Build the IMAP Server
Next, we need to download and build the IMAP server. This is a relatively straightforward process when you know exactly what to type. All you need to do is follow this script and you will have a built and functional SSL-enabled IMAP server ready to be set up. As you type most of these commands in, output on what is happening will scroll by, but as long as you don't make a mistake, everything should be fine.
% curl ftp://ftp.cac.washington.edu/imap/imap.tar.Z > imap.tar.Z
% uncompress imap.tar.Z
% tar xf imap.tar
% cd imap-2002.RC2/
% make osx SSLTYPE=nopwd SSLDIR=/usr SSLCERTS=/etc/sslcerts
% sudo mkdir -p /usr/local/bin
% sudo cp imapd/imapd /usr/local/bin/imapd
There. That wasn't so bad, was it? You now have a fully-functional IMAP server just waiting to be used.
Configure the IMAP Server
There are two things we need to do to configure the IMAP server. The first is to set up the SSL certificate that will be used by the server. The second is to enable the server to handle requests.
To install a self-signed certificate (perfectly adequate for our needs), use the following commands. You will be asked a few questions as part of the process of making this certificate. The answers I used are highlighted in bold.
% sudo mkdir -p /etc/sslcerts
% sudo openssl req -new -x509 -nodes -out /etc/sslcerts/imapd.pem -keyout /etc/sslcerts/imapd.pem -days 3650
Using configuration from /System/Library/OpenSSL/openssl.cnf
Generating a 1024 bit RSA private key
...................................................++++++
...........................++++++
writing new private key to '/etc/sslcerts/imapd.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:California
Locality Name (eg, city) []:San Francisco
Organization Name (eg, company) [Internet Widgits Pty Ltd]:x180
Organizational Unit Name (eg, section) []:Home Mail
Common Name (eg, YOUR name) []:James Duncan Davidson
Email Address []:duncan@x180.net
The last thing we need to do is configure Mac OS X to start up the IMAP server when it sees requests to the IMAP over SSL port (port 993). To do this, we need to edit the /etc/inetd.conf file.
% sudo pico /etc/inetd.conf
Add the following line to the very end of the file:
imaps stream tcp nowait root /usr/libexec/tcpd /usr/local/bin/imapd
Now, we just need to restart the inetd deamon:
% ps -ax | grep inetd
323 ?? Ss 0:00.01 inetd
4798 std R+ 0:00.00 grep inetd
% sudo kill -HUP 323
Congratulations. You're done. Now it's time to set up your mail client to use it. Besides setting up your mail client to use the host, username, and password for your mail account, you'll want to make sure that you enable the SSL option. This is shown in the following configuration panel from Mail.app.
|
|
Also, notice that I've setup an IMAP path prefix. This is the directory in my home directory on the server in which my IMAP mailboxes will be kept. If you don't specify this, then your home directory will be used, and you'll see them show up in your Mail application.
Conclusion
We've just set up everything needed to have a full-fledged site server on the Internet with Mac OS X. There are many other things that can be tweaked, configured, and added to this foundation. You can find instructions for many of these here on the O'Reilly Network. Another great resource to use is Stepwise.
There's one last important thing to say before we're done. Now that you have a server up and running, you'll want to make sure that it doesn't automatically go to sleep on you. Just go into the System Preferences, click on Energy Saver, and make the appropriate selections.
|
Related Resources: "Learning the Mac OS X Terminal" -- Chris Stone, contributor to Mac OS X: The Missing Manual, shows you how to get comfortable using the Terminal application in Mac OS X. His hands-on tutorials will have you punching out command lines in no time at all. "Homemade Dot-Mac with OS X" -- So you don't want to pony up the $99 annual fee for .Mac? No problem if you've switched to Mac OS X, because everything is built-in for you to set up your own .Mac suite of services. Alan Graham shows you how. "Apache Web Serving with Mac OS X" -- There's a powerful Apache Web server built in to every Mac OS X computer. Kevin Hemenway shows you how to start serving Web pages within minutes, then gives you the tools for advanced techniques that seasoned system administrators use every day. Apache: The Definitive Guide -- Written and reviewed by key members of the Apache group, this book is the only complete guide on the market that describes how to obtain, set up, and secure the Apache software. Apache Pocket Reference -- Provides a summary of Apache command-line options, configuration directives, and modules, and covers Apache support utilities. sendmail, 2nd Edition -- covers |
James Duncan Davidson is a freelance author, software developer, and consultant focusing on Mac OS X, Java, XML, and open source technologies. He currently resides in San Francisco, California.
Return to the Mac DevCenter.
-
crontab
2004-09-25 22:07:47 Durer [View]
- Trackback from http://marsyas.blogdns.org/blogs/archives/000020.html
Poursuite de mes investigations dans les entrailles unixiennes du Mac
2004-02-28 10:15:09 [View]
-
Batteries
2003-12-01 02:48:54 juanjose [View]
-
Panther = IMAP Broken
2003-10-25 08:19:44 anonymous2 [View]
-
Panther = IMAP Broken
2003-10-29 07:12:31 anonymous2 [View]
-
Panther = IMAP Broken
2003-10-27 18:34:41 anonymous2 [View]
-
Panther = IMAP Broken
2003-10-27 10:20:54 cian [View]
-
Panther = IMAP Broken
2003-10-30 21:08:05 anonymous2 [View]
-
Panther = IMAP Broken
2003-10-31 11:00:39 anonymous2 [View]
-
Panther = IMAP Broken
2003-11-01 06:11:41 anonymous2 [View]
-
Panther = IMAP Broken-> 2 solutions
2003-10-30 19:16:06 anonymous2 [View]
-
Panther = IMAP Broken
2003-10-27 07:14:29 sbromlin [View]
-
Panther = IMAP Broken
2003-10-27 08:51:11 anonymous2 [View]
-
Panther = IMAP Broken
2003-10-27 15:36:15 anonymous2 [View]
-
Panther = IMAP Broken
2003-10-27 04:29:38 anonymous2 [View]
-
Panther = IMAP Broken
2003-10-26 14:04:02 anonymous2 [View]
-
Panther = Sendmail is Gone
2003-10-16 15:38:35 anonymous2 [View]
-
Panther = Sendmail is Gone
2003-11-13 10:33:51 atoms [View]
-
Panther = Sendmail is Gone
2003-11-07 13:09:42 anonymous2 [View]
-
Panther = Sendmail is Gone
2003-10-27 09:27:15 anonymous2 [View]
-
"550: Relaying..." from external mail
2003-09-07 19:28:35 anonymous2 [View]
-
Common Name
2003-08-03 12:57:17 anonymous2 [View]
-
inetd will not register imapd
2003-07-28 23:57:15 anonymous2 [View]
-
inetd will not register imapd
2003-10-30 19:28:16 anonymous2 [View]
-
inetd will not register imapd
2003-11-30 10:57:58 ianwsmith [View]
-
Passwords
2003-07-17 11:01:36 cmwhitney [View]
-
UW IMAPd
2003-06-07 03:07:25 anonymous2 [View]
-
UW IMAPd
2003-06-10 15:57:07 anonymous2 [View]
-
serving thru airport
2003-05-28 19:39:34 anonymous2 [View]
-
serving thru airport
2003-06-02 01:45:18 anonymous2 [View]
-
Why some have success and others not?
2003-05-28 01:04:29 anonymous2 [View]
-
Why some have success and others not?
2003-06-28 06:42:37 anonymous2 [View]
-
am i missing something
2003-05-23 13:18:58 anonymous2 [View]
-
Great article - got it all working fine
2003-05-22 19:38:49 mikeall [View]
-
using the IMAP server.
2003-05-21 03:56:03 anonymous2 [View]
-
netgear rp114 facilitates dyndns updates
2003-04-29 22:38:22 anonymous2 [View]
-
netgear rp114 facilitates dyndns updates
2003-12-10 04:28:06 anonymous2 [View]
-
netgear rp114 facilitates dyndns updates
2005-02-18 06:47:05 saanzinnah [View]
-
empowering
2003-04-29 17:22:59 anonymous2 [View]
-
Fantastic!
2003-03-31 23:55:11 anonymous2 [View]
-
crontab wont work...
2003-02-11 11:31:06 keithflux [View]
-
Private IP address?
2003-02-10 17:41:01 anonymous2 [View]
-
Troubleshooting IMAP
2003-02-08 19:16:26 anonymous2 [View]
-
Changes needed for MacOSX Server 10.2.3?
2003-02-06 13:07:49 anonymous2 [View]
-
disable directory browsing
2003-02-05 07:34:13 jakewilliamson [View]
-
disable directory browsing
2003-04-16 17:03:53 jeffulri [View]
-
Error messages on Sendmail start
2003-01-25 02:14:40 anonymous2 [View]
-
Error messages on Sendmail start
2003-01-25 02:30:06 anonymous2 [View]
-
Recommend e-Commerce software
2003-01-24 08:28:16 keithflux [View]
-
Hosting Multiple Domains
2003-01-23 06:40:25 anonymous2 [View]
-
problem
2003-01-23 05:41:28 anonymous2 [View]
-
problem
2003-04-09 23:23:29 anonymous2 [View]
-
imapd, it works!
2003-01-21 04:02:48 anonymous2 [View]
-
imapd, last question, i hope
2003-01-20 14:59:27 anonymous2 [View]
-
imap again...
2003-01-20 12:49:15 anonymous2 [View]
-
imap again...
2003-01-20 13:34:16 James Duncan Davidson |
[View]
-
Sendmail startup script -> kernel panics
2003-01-07 15:21:33 anonymous2 [View]
-
problem fixed - Sendmail startup script -> kernel panics
2003-01-12 18:38:54 dan1 [View]
-
How do I use sendmail for outgoing mail?
2002-12-27 07:24:47 docwalker [View]
-
How do I use sendmail for outgoing mail?
2003-04-25 11:30:08 anonymous2 [View]
-
How do I use sendmail for outgoing mail?
2003-04-25 11:28:31 anonymous2 [View]
-
Sendmail Problems
2002-12-24 22:22:19 anonymous2 [View]
-
can't recieve behind firewall & newaliases does not run
2002-12-19 08:43:33 wowmomnyc [View]
-
can't recieve behind firewall & newaliases does not run
2003-01-05 23:16:04 wowmomnyc [View]
-
Remember to chmod
2002-12-12 19:20:28 anonymous2 [View]
-
CGI and ...
2002-12-12 07:30:02 keithflux [View]
-
RE: IMAP is BUILT in to 10.2
2002-11-27 05:16:49 anonymous2 [View]
-
RE: Squirrelmail and imap from this tutorial
2002-11-27 05:10:55 anonymous2 [View]
-
Sendmail Log Error
2002-11-18 11:34:25 anonymous2 [View]
-
Sendmail Log Error
2003-04-23 06:38:46 anonymous2 [View]
-
Sendmail Log Error
2003-12-12 12:13:04 anonymous2 [View]
-
Error code 1
2002-11-05 12:26:52 mcni7e [View]
-
Dissable SSL CERT in IMAP
2002-11-04 06:34:51 anonymous2 [View]
-
Can't send or receive email
2002-10-31 11:51:32 urcindalo [View]
-
imaps SSL service unable to load certificate
2002-10-20 15:02:58 tjj [View]
-
imap-2002.RC8 solved my certificate problems-firewall remains a PITA
2002-10-21 04:23:34 tjj [View]
-
Several entries in SMART_HOST line for roamers
2002-10-22 03:25:06 tjj [View]
-
Error creating SSL cert
2002-10-19 19:16:51 anonymous2 [View]
-
Rejects password
2002-10-18 20:10:31 anonymous2 [View]
-
Rejects password
2003-06-03 15:30:22 anonymous2 [View]
-
can't connect to imap server
2002-10-14 13:58:02 anonymous2 [View]
-
can't connect to imap server
2003-03-25 10:48:42 anonymous2 [View]
-
can't connect to imap server
2003-11-22 16:13:28 anonymous2 [View]
-
proftpd with mysql
2002-10-13 08:56:58 anonymous2 [View]
-
imapd not compiling
2002-10-12 22:25:33 anonymous2 [View]
-
imapd not compiling
2003-05-17 22:09:57 anonymous2 [View]
-
imapd not compiling
2002-11-17 17:39:42 anonymous2 [View]
-
Debugging mailserver
2002-10-12 21:18:35 anonymous2 [View]
-
Debugging mailserver
2003-08-26 20:16:16 anonymous2 [View]
-
Squirrelmail and imap from this tutorial
2002-10-04 21:01:24 anonymous2 [View]
-
Setup same username at different account...
2002-10-02 16:24:33 anonymous2 [View]
-
Squirrelmail and imap from this tutorial
2002-09-25 08:08:38 anonymous2 [View]
-
PHP/MySQL installation error?
2002-09-23 05:47:38 seacube [View]
-
e-mail delivery delay
2002-09-23 00:59:24 daesan [View]
-
10.2.1 no go
2002-09-22 17:18:41 bostonmacosx [View]
-
Can't get pass pg.3 hostconfig file different!
2002-09-20 22:52:26 anonymous2 [View]
-
webserver subdirs
2002-09-20 04:24:16 anonymous2 [View]
-
can't get new mail in IMAP account
2002-09-19 09:46:28 anonymous2 [View]
-
Apple Laptop Keyboards Unsuitable for Unix Users
2002-09-18 02:21:34 anonymous2 [View]
-
Cant point the domain name @ my server
2002-09-13 20:41:10 anonymous2 [View]
-
Entourage is complaining
2002-09-12 11:20:57 j4e [View]
-
multiple imap users
2002-09-10 11:23:41 anonymous2 [View]
-
multiple imap users
2002-09-11 13:54:27 James Duncan Davidson |
[View]
-
Alternatives to Sendmail
2002-09-09 21:03:19 anonymous2 [View]
-
Alternatives to Sendmail
2002-09-11 13:56:21 James Duncan Davidson |
[View]
-
Security
2002-09-09 20:59:33 anonymous2 [View]
-
Question regarding Apache and DynDNS
2002-09-09 16:08:21 anonymous2 [View]
-
Trouble compiling imap
2002-09-08 16:11:59 bin2 [View]
-
But I DID install the BSD headers
2002-09-12 14:08:00 bin2 [View]
-
Make sure to install the BSD Development headers!
2002-09-11 13:58:43 James Duncan Davidson |
[View]
-
Trouble compiling imap -> download openssl headers
2002-09-09 15:26:57 anonymous2 [View]
-
Doesn't Work
2002-09-07 14:09:12 maclaxguy [View]
-
No openssl headers, cant send mail
2002-09-06 15:03:44 bin2 [View]
-
STARTTLS and sendmail
2002-09-06 21:16:39 ianwsmith [View]
-
Sending mail
2002-09-05 18:45:19 4profit [View]
-
IMAP SSL refusing connections
2002-09-02 16:50:10 mbarr [View]
-
two domain names?
2002-09-01 23:51:20 qryss [View]
-
answer: two domain names?
2002-09-02 20:17:19 qryss [View]
-
10.2 as server via win2000
2002-09-01 17:56:22 cyberonyx [View]
-
10.2 as server via win2000
2002-09-02 13:58:51 ianwsmith [View]
-
nslookup doesn't work?
2002-09-01 11:15:47 sbills [View]
-
nslookup doesn't work?
2003-05-02 13:19:32 anonymous2 [View]
-
nslookup doesn't work?
2004-12-09 19:42:07 Another-Lurker [View]
-
nslookup doesn't work?
2002-09-02 07:44:38 ianwsmith [View]
-
Follow-Up IMAP (questions)
2002-08-31 11:45:49 russh [View]
-
Follow-Up IMAP (questions)
2002-08-31 12:50:41 russh [View]
-
chmod g-w ... vs. appropriate sendmail setting
2002-08-31 09:57:50 fuerst [View]
-
Simple Answer: Security
2002-08-31 11:06:04 James Duncan Davidson |
[View]
-
Localhost only
2002-08-29 20:29:02 mark_osx [View]
-
Localhost only
2002-08-30 18:02:59 James Duncan Davidson |
[View]
-
IMAP is BUILT in to 10.2
2002-08-26 07:56:35 poshpaws [View]
-
No imapd in Jaguar by default
2002-08-26 11:31:37 James Duncan Davidson |
[View]
-
What happened at the end?
2002-08-25 18:27:15 mladd [View]
-
What happened at the end?
2002-08-25 21:28:37 James Duncan Davidson |
[View]
-
What happened at the end?
2002-08-31 07:31:32 afternoon [View]
-
IMAP Fix
2002-08-25 13:14:36 dwldzm9 [View]
-
Errata: IMAP Instructions
2002-08-25 15:14:14 James Duncan Davidson |
[View]
-
IMAP Server Error
2002-08-24 22:37:18 jabevan [View]
-
IMAP Server Error
2002-08-24 22:49:47 jabevan [View]
-
IMAP Server Error
2002-08-24 23:21:53 James Duncan Davidson |
[View]
-
accessing e-mail via http
2002-08-24 22:01:18 harywilke [View]
-
accessing e-mail via http
2002-08-27 11:32:46 rgraham [View]
-
accessing e-mail via http
2002-08-24 23:50:33 James Duncan Davidson |
[View]
-
accessing e-mail via http
2002-08-25 19:05:49 harywilke [View]


