Copyright © 2003 Michael Cook
2003-05-25
Revision History | ||
---|---|---|
Revision 0.1 | 25 May 2003 | MC |
Initial draft |
Abstract
How to Configure Sendmail on OSX 10.2. From http://www.mail-archive.com/mailman-users@python.org/msg12599.html
Table of Contents
From the Finder, use the Go menu and choose Go to Folder and type in: /etc
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.
Use BBEdit to open hostconfig. Look down the file until you see the line about the Mailserver. Change it to read:
MAILSERVER=-YES-
Save the changes and close the hostconfig file.
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.
Either reboot your computer or open the Terminal application. At the % prompt, type:
sudo nohup /System/Library/StartupItems/Sendmail &
Hit return/enter. Terminal will ask for your password. Put it in and hit return/enter.
In the terminal application type:
sudo cp /usr/share/sendmail/conf/cf/generic-darwin.mc /etc/mail/config.mc
From the finder, use the Go menu and Go to Folder. Type in:
/etc/mail
Select the config.mc icon and change its owner to you. (Use Show Info from the Finder's File menu.)
Use BBEdit to open config.mc.
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),
Save the file and close it.
Open BBEdit and create a new file that contains this text. [replace the 2 places where it says webb_k@xx.xxx 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. # See also RFC 2142, `MAILBOX NAMES FOR COMMON SERVICES, ROLES # 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. root: webb_k@xx.xxx # 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 # NETWORK OPERATIONS MAILBOX NAMES abuse: root noc: root security: root # SUPPORT MAILBOX NAMES FOR SPECIFIC INTERNET SERVICES ftp: root ftp-bugs: ftp hostmaster: root webmaster: root www: webmaster mailman: webb_k@xx.xx mailman-owner: mailman ########################
Save the file on your desktop and name it aliases
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
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:
/etc/mailThe command will then look like this:
sudo cp /Users/webb_k/Desktop/aliases /etc/mailHit return/enter.
x
y
z
z1
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/config.mc > /tmp/sendmail.cf sudo mv /etc/mail/sendmail.cf /etc/mail/sendmail.cf.old sudo mv /tmp/sendmail.cf /etc/mail/sendmail.cf 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 sendmail.cf /etc/mail/sendmail.cf
You also need to tell sendmail where to route mail, and open port 25 in your firewall.
If you get this error in your mail log: May 25 22:07:39 mabel sendmail[866]: h4Q37KoP000865: h4Q37doP000866: DSN: Data format error
Change /etc/hosts: Line 127.0.0.1 localhost To 127.0.0.1 localhost localhost.mabel.skyprod1.dyndns.org
Uncomment this line in /etc/mail/sendmail.cf ... #O HostsFile=/etc/hosts
Restart sendmail
If mail sent to root is disappearing, then .forward may say "/dev/null".
f you have to edit your aliases file, then you have to run newaliases again and stop/restart sendmail.
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.