- 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
- 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
Activating Sendmail
Assuming that you've decided to go ahead and create a mail server, the first step is to turn on the server application itself. Mac OS X includes the Sendmail software, but it is not activated when the system first boots.
To automate Sendmail startup, open the file /etc/hostconfig in your favorite text editor. Edit the line that reads MAILSERVER=-NO- to MAILSERVER=-YES-:
## # /etc/hostconfig ## # This file is maintained by the system control panels ## # Network configuration HOSTNAME=Primal ROUTER=-AUTOMATIC- # Services AFPSERVER=-YES- APPLETALK=en0 AUTHSERVER=-NO- AUTOCONFIG=-YES- AUTODISKMOUNT=-REMOVABLE- AUTOMOUNT=-YES- CONFIGSERVER=-NO- IPFORWARDING=-NO- MAILSERVER=-YES- MANAGEMENTSERVER=-NO- NETBOOTSERVER=-NO- NISDOMAIN=-NO- ...
Next, you must adjust the Sendmail configuration so that it doesn't detect a security error. By default, Sendmail detects any group-writable directories that contain its configuration files and fails to start if it finds even one. Because of the user and group structure in Mac OS X, if you were to change the permissions on the Sendmail configuration directories, you'd lose other administrative features. If you fail to complete this step, Sendmail will start at boot time, but will immediately quit, saving errors such as this to the /var/spool/mail.log file:
Jun 23 04:30:36 Primal sendmail[501]: NOQUEUE: SYSERR(root): /etc/mail/sendmail.cf: line81: fileclass: cannot open /etc/mail/local-host-names: Group writable directory Jun 23 04:30:37 Primal sendmail[502]: NOQUEUE: SYSERR(root): /etc/mail/sendmail.cf: line
81: fileclass: cannot open /etc/mail/local-host-names: Group writable directory
To fix the problem, open the /etc/mail/sendmail.cf and look for the line
#O DontBlameSendmail=safe
Change the line to read
O DontBlameSendmail=GroupWritableDirPathSafe
This adds the option DontBlameSendmail with flag GroupWritableDirPat h Safe. This instructs Sendmail to define group-writable directories as being safe.
You can now restart your Mac OS X computer. The Sendmail e-mail server will start. You can verify that the server is running and responding by using telnet to connect to port 25 (SMTP):
[primal:/etc/mail] root# telnet localhost 25 Trying 127.0.0.1... Connected to localhost.ag.ohio-state.edu. Escape character is '^]'. 220 primal.ag.ohio-state.edu ESMTP Sendmail 8.10.2/8.10.2; Mon, 25 Jun 2001 21:08:27 -0400(EDT)
If your connection fails, verify that you do have a DNS-registered hostname for your computer and check for error messages in the /var/log/mail.log file. The Sendmail messages are quite verbose and a great deal of help with debugging a faulty installation.
Try sending yourself a test message from a remote computer. Be sure to specify the destination as the hostname and username used on your Mac OS X machine. Incoming messages are stored in /var/spool/ <username> . Use the command-line mail utility to read the contents of your mailbox:
[primal:/etc/mail] root# mail Mail version 8.1 6/6/93. Type ? for help. "/var/mail/jray": 1 message 1 new >N 1 jray@poisontooth.com Mon Jun 25 21:11 20/838 "Testing"
Congratulations. Your Mac OS X computer is now running an enterprise-class SMTP server.
Sendmail Configuration | Next Section

Account Sign In
View your cart