This document was created using the >e-novative> DocBook Environment (eDE)

How to Configure Sendmail on OSX 10.2


Revision History
Revision 0.125 May 2003MC
Initial draft


How to Configure Sendmail on OSX 10.2. From

Table of Contents

1. How to Configure Sendmail on OSX 10.2

1. How to Configure Sendmail on OSX 10.2

1.1. Step 1 - Get Sendmail running

  1. From the Finder, use the Go menu and choose Go to Folder and type in: /etc

  2. Click once on the hostconfig icon and use the File menu to Show Info [command-I]. Click on the lock to unlock the privileges. Change the owner to yourself with read and write privileges. Close the Info window.

  3. Use BBEdit to open hostconfig. Look down the file until you see the line about the Mailserver. Change it to read:


  4. Save the changes and close the hostconfig file.

  5. With the hostconfig icon still selected, use the File menu to Show Info [command-I]. Change the owner back to System. Close the Info window.

  6. Either reboot your computer or open the Terminal application. At the % prompt, type:

        sudo nohup /System/Library/StartupItems/Sendmail &

  7. Hit return/enter. Terminal will ask for your password. Put it in and hit return/enter.

  8. In the terminal application type:

        sudo cp /usr/share/sendmail/conf/cf/ /etc/mail/

  9. From the finder, use the Go menu and Go to Folder. Type in:


  10. Select the icon and change its owner to you. (Use Show Info from the Finder's File menu.)

  11. Use BBEdit to open

  12. Scroll down to find the line undefine(`ALIAS_FILE'). Remove that line, and add in these 3 lines:

         define(`ALIAS_FILE', `/etc/mail/aliases')
         define(`confDONT_BLAME_SENDMAIL', `GroupWritableDirPathSafe')
         define(`LUSER_RELAY', `local:webb_k')
    (Replace webb_k with your username),

  13. Save the file and close it.

  14. Open BBEdit and create a new file that contains this text. [replace the 2 places where it says with your own e-mail address:

    #  Aliases in this file will NOT be expanded in the header from
    #  Mail, but WILL be visible over networks.
    #       >>>>>>>>>>      The program "newaliases" must be run after
    #       >> NOTE >>      this file is updated for any changes to
    #       >>>>>>>>>>      show through to sendmail.
    # AND FUNCTIONS', May 1997
    # Pretty much everything else in this file points to "root", so
    # you would do well in either reading roots mailbox or forwarding
    # roots email from here.
    # Basic system aliases -- these MUST be present
    MAILER-DAEMON: postmaster
    postmaster: root
    # General redirections for pseudo accounts
    bin:    root
    daemon: root
    man:    root
    news:   root
    nobody: root
    operator: root
    pop:    root
    usenet: news
    xten:   root
    abuse:          root
    noc:            root
    security:       root
    ftp:            root
    ftp-bugs:       ftp
    hostmaster:     root
    webmaster:      root
    www:            webmaster
    mailman:    webb_k@xx.xx
    mailman-owner:    mailman

  15. Save the file on your desktop and name it aliases

  16. In this part you'll copy the aliases file from your desktop to /etc/mail Open the Terminal application. At the % prompt type:

        sudo cp

  17. Make sure you type a space after the cp. Then drag the aliases icon from your desktop into the Terminal window. (That will put the path on the command line.) Then type a space and type:

    The command will then look like this:
        sudo cp /Users/webb_k/Desktop/aliases /etc/mail
    Hit return/enter.

  18. x

  19. y

  20. z

  21. z1

1.2. Step 6) Finish Sendmail's setup and get it running.

  1. In the Terminal application, type: (I used root)

        cd /usr
        sudo mkdir adm
        cd adm
        sudo mkdir sm.bin
        cd sm.bin
        sudo ln -s /Applications/mailman/mail/wrapper wrapper
        sudo /System/Library/StartupItems/Sendmail/Sendmail start
        sudo m4 /usr/share/sendmail/conf/m4/cf.m4 /etc/mail/ > /tmp/
        sudo mv /etc/mail/ /etc/mail/
        sudo mv /tmp/ /etc/mail/
        sudo makemap hash /etc/mail/access < /etc/mail/access
    WARNING: Group writable directory /
        sudo newaliases
        sudo /System/Library/StartupItems/Sendmail/Sendmail restart
        sudo niutil -create . /locations/sendmail
        sudo niutil -createprop . /locations/sendmail /etc/mail/

1.3. NOTES

  1. You also need to tell sendmail where to route mail, and open port 25 in your firewall.

  2. If you get this error in your mail log: May 25 22:07:39 mabel sendmail[866]: h4Q37KoP000865: h4Q37doP000866: DSN: Data format error

    1. Change /etc/hosts: Line localhost To localhost

    2. Uncomment this line in /etc/mail/ ... #O HostsFile=/etc/hosts

    3. Restart sendmail

  3. If mail sent to root is disappearing, then .forward may say "/dev/null".

  4. f you have to edit your aliases file, then you have to run newaliases again and stop/restart sendmail.

  5. Mail may be rejected by your isp if the hostname is not valid (for example, mabel.local.). If so, edit /etc/hostconfig to change it.

This document was created using the >e-novative> DocBook Environment (eDE)