<<

. 44
( 69 .)



>>


– The Buddy List AIM screen – Your new buddy appears in
‹ Type the information Á Click Invite to Chat.
opens. about your new buddy in the Buddy List window.
– iChat tells you whether
the text fields.
ˇ Right-click to select a your buddy is available.
› Click Add. buddy from your list.




213
UNIX FOR MAC




CONFIGURE SENDMAIL
The easiest way to resolve the conflict between sendmail's

Y
ou can configure sendmail on your Mac OS X system.
cautious character and the lenient directory permissions of
Sendmail is a mail server; it can listen for e-mail
Mac OS X is to modify the DontBlameSendmail setting in
requests from other systems. Sendmail configuration
sendmail's configuration file. This name refers to the fact
is one of the most difficult tasks in Unix administration. The
that the developers of sendmail do not want you blaming
software itself is complicated and its initial deployment on
the software if you reduce its level of security. Modifying
Mac OS X brings along some additional problems that must
the setting will, however, allow sendmail to start and will
be resolved. However, with a little care and some insight,
not reduce your system security.
you may get off easily and end up with a mail server that
behaves properly.
Sendmail's configuration file is stored in /etc/mail and is
called sendmail.cf. You should always use care in editing
Some of the difficulties related to sendmail on Mac OS X
this file as the lines in this file are difficult to understand
are due to a conflict between the way that Mac OS X and
and easy to mistype. However, it is not especially difficult to
sendmail deal with directory permissions. Where sendmail
generate a new sendmail configuration file and the tools
wants to be sure that directories it uses can only be
you need to do so are already on your system.
modified by root, Mac OS X is far more lenient about
directory permissions in order to support privileged users
who want to do things like dragging files into root-owned
directories. If you try to start sendmail using the default
configuration, sendmail will balk at world writable
directories and not start.


CONFIGURE SENDMAIL




– The editor opens your file.
¤ Press Return. ‹ Type /DontBlame and
EDIT SENDMAIL.CF
press Return.
„ Type sudo vi
/etc/mail/sendmail.cf.


214
13
INSTALL AND USE INTERNET APPLICATIONS




If you have trouble starting or running sendmail, you
To ensure that sendmail does not read its
can check your /var/log/system.log file for messages
configuration file from NetInfo, you may need to
that may pertain to the problem. If you see an error
type the following commands found in the
message that the file /etc/mail/access.db does not
/etc/mail/README file:
exist, you can create this file from /etc/aliases with
niutil -create . /locations/sendmail
the command makemap hash /etc/mail/
niutil -createprop . /locations/sendmail
access.db < /etc/aliases. The /etc/aliases
sendmail.cf /etc/mail/sendmail.cf
file contains lines such as test: user where test
is an alias and user is a real username.
These commands tell sendmail, whenever it tries
to look at NetInfo, to look instead at /etc/mail/
sendmail.cf.
If you encounter errors that indicate you cannot
write temp files, you must open permissions
on the /var/spool/mqueue and /var/spool/
clientmqueue directories. You can do this with the
command chmod 777 /var/spool/*mqueue.
These directories are used to temporarily store
the details and content of e-mail messages
before the messages are delivered.




– Your cursor moves to the – Your edits appear.
› Type :s/#O DontBlame ˇ Save your file and exit vi
line you need to edit. by typing :wq and pressing
Sendmail=safe/O DontBlame
Return.
Sendmail=GroupWritableDir
PathSafe/ and press Return.
CONTINUED
215
UNIX FOR MAC



CONFIGURE SENDMAIL (CONTINUED)
You then want to edit this file. The lines of interest are all

T
o modify DontBlameSendmail, you would do one of
lumped together at the bottom. After the first line starting
two things. For one, you would edit the sendmail.cf
with the word define, you should add a line that reads
file and then try starting sendmail again. The line #O
define('confDONT_BLAME_SENDMAIL','GroupWrit
DontBlameSendmail=safe will have to be changed to O
ableDirPathSafe'). Then, save file.
DontBlameSendmail=GroupWritableDirPathSafe.
Another way is to generate an entirely new configuration
The next thing you need to do is run m4 to use the
file. While this may sound like it would be a lot more work,
specifications that you just edited into a new configuration
the file that you need to edit to generate a new configuration
file. That command would look like this: m4 ../m4/cf.m4
file is far more approachable than sendmail.cf. In addition,
yourdomain.mc > /tmp/sendmail.cf. That leaves
while you are at it, you can also add some other useful
your new configuration file in /tmp. You then back up your
options to your configuration.
current configuration file and install your new configuration
file in its place. You then start sendmail.
To start the process of creating a brand new configuration
file, you will make a copy of the default mail configuration
To ensure that sendmail starts up every time your system is
file. To find this file, you will move into the /usr/share/
booted, you need to modify /etc/hostconfig. This file plays
sendmail/conf/cf directory. The default file is called generic-
a critical role in starting services. You will change
darwin.mc. Your copy should be called yourdomain.
MAILSERVER=-NO- to MAILSERVER=-YES-.
mc, though you can replace yourdomain with your domain
name if you have one. The basic idea is to preserve the
original file for safekeeping.


CONFIGURE SENDMAIL (CONTINUED)




– vi opens your new file.
¤ Type sudo cp generic- › Type /^define and press
GENERATE NEW
SENDMAIL.CF FILE Return.
darwin.mc yourdomain.mc
„ Type cd /usr/share/ and press Return.
sendmail/conf/cf and press – A copy of the generic file
Return. is created.
‹ Type vi yourdomain.mc
and press Return.
216
13
INSTALL AND USE INTERNET APPLICATIONS

You can test sendmail by typing the words in blue in the following interaction.

Example:
[ferro:˜] user% telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 ferro.local ESMTP Sendmail 8.12.2/8.10.2; Tue, 24 Jun 2003 19:46:36 -0400 (EDT)
hello whatever.org
250 ferro.local Hello localhost [127.0.0.1], pleased to meet you
MAIL FROM: rustydog@whatever.org
250 2.1.0 rustydog@whatever.org... Sender ok
RCPT TO: user
250 2.1.5 user... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
this is a message
.
250 2.0.0 h5ONkaCw000883 Message accepted for delivery
quit
221 2.0.0 ferro.local closing connection
Connection closed by foreign host.




– Your cursor is positioned at Á Type define(`confDONT_ ° Type m4 ../m4/cf.m4 ‚ Type sudo mv
the first line starting with the BLAME_SENDMAIL',`Group yourdomain.mc > /tmp/sendmail.cf
word define. WritableDirPathSafe') and /tmp/sendmail.cf /etc/mail/sendmail.cf
press Esc to exit input mode. and press Return. and press Return.
ˇ Type the letter o.
‡ Type :wq and press · Type sudo mv ” Type sudo sendmail
– A new line opens up. Return to save your file and /etc/mail/sendmail.cf -bd -q15m.
exit vi. /etc/mail/sendmail.cf.`date
217
+%y%m%d and press Return.
UNIX FOR MAC




SEND E-MAIL FROM UNIX
Your recipient can read your message in a variety of ways. If

Y
ou can create and send messages from the command
they are a command line user like you, they may opt to use
line in Mac OS X, as you can with most UNIX systems.
the mail command by typing mail on a line by itself. A list
You do not need to open up a mail client. The easiest
of messages appears, and they can read them one at a time
and fastest way to do this is by using the echo command to
or delete them without reading them. If they want to
create a message and then piping the message to the mail
respond, they can do that, too. The mail command
command. For example, you can type the following message
includes the arguments r for reply and d for delete. To read
on the command line to create a message with the subject
a message, the user simply presses Return or, in the case of
line lunch and add it to the inbox of user shs.
multiple e-mails, selects the message number and presses
Return. If your system is set up with a mail client, such as
echo Please do not forget we have a lunch
pine or elm, you may prefer to open your mailbox using
date today | mail -s "lunch" shs
one of these tools.
If you want to send a longer message, you can run the mail
command ” for example, mail shs ” and then type your
subject line and message. When you are finished typing
your message, you enter a period (.) on a line by itself, and
the system sends the message.


SEND E-MAIL FROM UNIX




¤ Type | mail -s "test" › Type mail followed by a Á Type your message, and
SEND A MESSAGE
followed by a space. space and the name of a user, press Return.
„ Type echo "Can you read and press Return.
‹ Type your username, and ‡ Type a dot (.) on a line by
this?" followed by a space.
ˇ Type a subject line at the
press Return. itself, and press Return.
prompt, and press Return.
– The mail system delivers
your message.

218

<<

. 44
( 69 .)



>>