Update to Mac OS X Terminal, Part 3
by Chris Stone06/07/2002
The series continues in Learning the Terminal in Mac OS X, Automating Mail from the Mac OS X Terminal, Configuring Email from the Mac OS X Terminal, Customizing the Mac OS X Terminal, and Synchronizing Drives with Cron and the Mac OS X Terminal.
However, none of the first three parts of the series will work in Mac OS X 10.2 (Jaguar) or newer. Jaguar brought several major changes to the OS that require significant changes to the procedure. I'll be posting Jaguar compatible updates to these articles shortly.
As those of you who've updated to Mac OS X 10.1.5 have discovered, sendmail no longer works as described in Learning the Mac OS X Terminal, Part 3. The 10.1.5 version updates sendmail to 8.12.2 from 8.11, and in the process tightened up security considerably.
In short, what you need to do is generate a new sendmail.cf file from scratch, using the m4 "macro language processor." You'll also need to change some permissions, as well as configure your system to run the sendmail daemon at startup. (This was not necessary for sending local mail in 10.1.4 and earlier, but apparently is now).
If you are using sendmail primarily to receive job reports locally from Cron, as described in this tutorial, then the following steps will get you going again. If you are using sendmail to do more than that, then this procedure still might work, but I can't guarantee that.
Also, if you've made any prior changes to your sendmail.cf, you'll need to make them again to the new one you'll generate here. I'll show you how to add the DontBlameSendmail line again.
You'll find some instructions in
/etc/mail/README, which I paraphrase here:Go to
/usr/share/sendmail/conf/cf:cd /usr/share/sendmail/conf/cfCopy the default config file to
yourdomain.mc:sudo cp generic-darwin.mc yourdomain.mc(It’s OK to use the literal "yourdomain" if you don't have a domain for your machine. If you do have a domain, then use it instead.)
If you want to use the
DontBlameSendmailoption as described in the tutorial, then you can add it themcfile here:sudo pico yourdomain.mcAnd add this line to the end of the file:
define(`confDONT_BLAME_SENDMAIL', `GroupWritableDirPathSafe')dnlRegenerate your
sendmail.cffile from them4file you just edited:m4 ../m4/cf.m4 yourdomain.mc > /tmp/sendmail.cfBack up your old
sendmail.cf:sudo cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.origPut your new
sendmail.cfin place:sudo cp /tmp/sendmail.cf /etc/mail/The new version of sendmail is compiled to look at NetInfo for a pointer to its config file, so you'll need to add that record. So, to ensure that sendmail does not read its config file from NetInfo, execute the following commands:
sudo niutil -create . /locations/sendmail sudo niutil -createprop . /locations/sendmail sendmail.cf /etc/mail/sendmail.cfThis will tell sendmail (when it looks at NetInfo) to not look in NetInfo for its config file, but to look at
/etc/mail/sendmail.cf.-
You'll need to fix the group of the sendmail client queue directory:
sudo chgrp smmsp /var/spool/clientmqueue -
If you're not using the
DontBlameSendmailoption, then you'll need to turn off group-writablity for the root directory again, since the update turns that back on:sudo chmod g-w / -
To have sendmail launch at system startup, you'll need to make two changes in two files.
First open
/etc/hostconfig:sudo pico /etc/hostconfigFind this line:
MAILSERVER=-NO-And change it to this (NO to YES):
MAILSERVER=-YES-Save that file and then open
/System/Library/StartupItems/Sendmail/Sendmail:sudo pico /System/Library/StartupItems/Sendmail/SendmailFind this line near the end:
/usr/sbin/sendmail -bd -q1hAnd add this line after it:
/usr/sbin/sendmail -C /etc/mail/submit.cf -q1hSave that file and restart your machine to allow the startup script to run. You should find that sendmail will work again as it had in 10.1.4. It might turn out that these steps can be simplified further, and I'll keep you posted if that's the case. For now, though, this will at least get you running again.
Chris Stone is a Senior Macintosh Systems Administrator for O'Reilly, coauthor of Mac OS X in a Nutshell and contributing author to Mac OS X: The Missing Manual, which provides over 40 pages about the Mac OS X Terminal.
Return to the MacDevCenter.com.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 65 of 65.
-
m4 installed only with developer tools?
2003-03-04 15:04:05 anonymous2 [Reply | View]
I don't have m4 in any of my binary paths. Perhaps it is only installed with the developer tools. Is that the case?
-
sendmail and Mac OS X Server
2002-10-01 16:17:23 anonymous2 [Reply | View]
Been asked to find out if the e-mail server that runs on Mac OS X Server is based on sendmail.
Note that this question is for Mac OS X Server only, sorry if it's not quite on topic.
-
Still not working for me
2002-09-24 03:10:24 anonymous2 [Reply | View]
Using G4Powerbook (OS 10.1.5) and still not getting it working. A quick look at /var/log/daily.out shows this:
mail:
/etc/mail: line 0: not a plain file
Also update says:
>>Find this line near the end:
>>/usr/sbin/sendmail -bd -q1h
>>And add this line after it:
>>/usr/sbin/sendmail -C /etc/mail/submit.cf -q1h
Is the flag -q'l'h or q'1(One)'h. My file had it as a one:
/usr/sbin/sendmail -bd -q1h
-
Configuring Sendmail for 10.2.x!
2002-09-23 09:12:11 Chris Stone |
[Reply | View]
For those of you trying to follow these instructions on Mac OS X 10.2 here's the article you should follow instead:
http://www.macdevcenter.com/pub/a/mac/2002/09/10/sendmail.html
--Chris
-
chdir problems
2002-09-22 02:36:29 giedo [Reply | View]
Can't send mail via command line or via php forms any longer after making the changes described at http://www.macdevcenter.com/pub/a/mac/2002/06/07/sendmail_1015.html?page=last on Mac OS X 10.2.1
can not chdir(/var/spool/mqueue/): Permission denied
Program mode requires special privileges, e.g., root or TrustedUser.
I have no clue what to do.
Changing the permissions as described at http://www.oreillynet.com/cs/user/view/cs_msg/7757 didn't help either?.
Can anyone help me?
TIA,
-
The sendmail fix with MacOS X 10.2.1
2002-09-21 09:34:14 anonymous2 [Reply | View]
Following exactly your commands, I see Sendmail running with telnet localhost 25.
But if i try to use the command "mail nam@domain" or "mail root' I get the following errors and mail isn't sent.
[ratatorsk:~] squirrel% mail giedo@beaware.be
Subject: test
test
.
EOT
[ratatorsk:~] squirrel% can not chdir(/var/spool/mqueue/): Permission denied
Program mode requires special privileges, e.g., root or TrustedUser.
Please can you help me out with this one?
-
Jaguar Mail No Unix Mail account option
2002-09-01 00:44:24 Subhash [Reply | View]
How about getting your reports with your eMail address as shown by Chris Stone in Learning the Mac OS X Terminal, Part 3, Page 2? -
Jaguar Mail No Unix Mail account option
2002-09-03 18:31:42 karmaworld [Reply | View]
After a clean install and going thru all the steps again, including the update to part 3, I get the following message when trying to send mail to local and or outside email address as suggested,
[G4-Home:~] laurence% mail laurence
Subject: Test From Terminal
Did this work
.
EOT
[G4-Home:~] laurence% No local mailer defined
QueueDirectory (Q) option must be set
Any suggestions?
-
Jaguar Mail No Unix Mail account option
2002-09-03 16:31:39 geoffsaulnier [Reply | View]
You miss the point! Some of us have fetchmail picking up mail from the ISP's POP3 server, passing it to sendmail which delivers the mail to each person with an account on the box. UNIX mail accounts are a must to be able to read that mail!!
Geoff. -
Jaguar Mail No Unix Mail account option
2002-09-04 17:06:59 geoffsaulnier [Reply | View]
Someone on the macosxhints.com forums suggested using ipopd as a local pop3 server and picking up mail by pop3 from localhost. That works like a charm!!
Do a search in the forums to find info about a pre-compiled version of ipop3d. caveat emptor: a precompiled binary could be doing absolutely anything!! For all I know, this is currently using my machine to hack the FBI or something... Still, I decided to trust it.
-
Jaguar Mail No Unix Mail account option
2002-08-25 08:01:47 karmaworld [Reply | View]
Mail no longer allows setup of a Unix account...any suggestions on how to complete the process
-
Testing your setup
2002-08-20 18:59:42 magnethead [Reply | View]
I used:
mail -s "test email" someone@someplace.net
This is a test
.
and received some errors:
collect: Cannot write ./dfg7L1sl6t000695 (bfcommit, uid=501, gid=25): Permission denied
queueup: cannot create queue temp file ./tfg7L1sl6t000695, uid=501: Permission denied
Which I take to mean the mqueue and clientmqueue dirs in /var/spool
Just thought this would be helpful.
-thomas
-
rebooting not necessary
2002-07-22 14:24:52 a3ulafia [Reply | View]
In the true sprit of UNIX and expecially BSD (which is known for greater than 365 days of uptime) rebooting the entire box just to start sendmail is not necessary. Since the only thing the /System/Library/StartupItems/Sendmail/Sendmail script does is start sendmail, we can execute it manually from the command line with:
sudo ./System/Library/StartupItems/Sendmail/Sendmail start
the ./ preceding the full path is necessary. This is the way to tell the shell to execute the script since it is not a proper binary-executable file.
Rebooting is for OS 9 boxes and Windows, c'mon.
-
I think I got it now
2002-07-13 12:03:34 benwillies [Reply | View]
To fix the slowness problem, slow bootup problem and the "not being able to send email problem (DNS error)", I repeated the instructions in the article by Chris, but with the following changes...
In Step 1, after "sudo pico yourdomain.mc", add the following lines to the end of the file:
define(`confDONT_BLAME_SENDMAIL',`GroupWritableDirPathSafe')dnl
define(`confSERVICE_SWITCH_FILE', `/etc/mail/service.switch')dnl
define(`confHOSTS_FILE', `/etc/hosts')dnl
define(`SMART_HOST', `mail.earthlink.net')dnl
But replace "mail.earthlink.net" with the one your ISP told you to use for sending mail (it's the Outgoing Mail Server in Internet System Preferences, like smtp.mac.com).
I also added the following lines right before the first "MAILER" line:
FEATURE(`accept_unresolvable_domains')dnl
FEATURE(`accept_unqualified_senders')dnl
In Step 2, to eliminate the error about Apache (www) not being able to "chdir", enter this line instead:
sudo chown smmsp:smmsp /var/spool/clientmqueue
Since I use my ISP for mail services, I skipped Step 4.
To fix the slowness problem ("sleeping for retry" error), I added a Step 5:
sudo pico /etc/hosts
And change the "127.0.0.1 localhost" line to read:
127.0.0.1 localhost mail.yourdomain.com
where "yourdomain" can be anything you want as long as it is in the familiar something.something.something format (I use mail.benwillies.com for consistency).
To tell sendmail not to do DNS lookups for mail it will be sending to your ISP's ("SMART_HOST") mail server, I added a Step 6:
sudo pico /etc/mail/service.switch
This file will be empty, so add the following line:
hosts files
I'm not sure it matters, but I was careful to have only the one line in this file (check how many lines pico writes out) because it's easy to accidently add a blank line with pico.
As always with Unix, you have to be very careful to do stuff in the right order and not to skip any steps and to enter all the special characters exactly right. I would recommend printing out the instructions and then copying the individual commands from the web page to the terminal window rather than trying to type them in (be sure to position the cursor first when inside pico).
Before repeating all of these steps, I would download and run the "Repair Privileges" utility from the Support section of Apple's web site, so that I knew I didn't screw something else up while frantically trying to fix this problem (it takes a long time to run).
I do not get any errors at all now ("tail /private/var/log/mail.log"), whether sending mail internally or to outside addresses. I was having lots of problems, particularly related to DNS lookups, until I yanked my DSL router and directly connected. It seems I do not know how to configure my router properly.
I do LAMP (Linux-Apache-MySQL-PHP) development where many of my web applications register users via email and this setup works both at home (testing) and at work (production) where only the "SMART_HOST" setting is different.
I have not tested this setup with "MAILSERVER=-YES-", or having Cron send emails, or re-routing external mail to other internal addresses (users), so please report any problems you encounter.
Everything contained herein is public domain to be used in any way you like. I relinquish all rights. It would be nice to have a single article describing all the steps, since we will probably have to do this all over again when Jaguar arrives (I vote for Chris).
References:
http://www.macdevcenter.com/pub/a/mac/2002/06/07/sendmail_1015.html?page=last
http://www.hserus.net/sendmail.html
http://www.sial.org/sendmail/macosx/
http://www.sendmail.org/m4/cf-readme.txt
http://www.sendmail.com/idemo/prod_guide/switch/switchdemo/helplets/en/confDONT_BLAME_SENDMAIL.html
http://cerebus.sandiego.edu/~jerry/UnixTips/sendmail.html
http://www.netneurotic.de/mac/configuring.html
http://spitfire.velocet.net/pipermail/freebsd-stable/2002-April/029292.html
http://www.sendmail.org/tips/DontBlameSendmail.html
-
MySQL No Longer Starts
2002-07-12 23:30:08 toocrued [Reply | View]
Thank you for the help getting sendmail to work but now I'm having trouble getting MySQL to start up. When I try to start SQL I get this error: KERN_PROTECTION_FAILURE (0x0002) at 0x00000000
I'm not sure what happened, I just know MySQL will not start at all.
-
Revert to original files
2002-07-09 15:31:42 nibinc [Reply | View]
After going through Parts 2 and 3, I was able to set up sendmail and receive mail via the terminal. However, I wasn't able to set up Mail. When I tried though, my Entourage settings got messed up.
Also, since setting up sendmail, it now takes forever to start up my computer. It always gets hung up on starting sendmail.
So my question is, how do I revert back to the original settings? I'm using 10.1.5, am a newbie when it comes to unix and am just wanting to prevent any more damage.
Any help would be greatly appreciated!
-
How to delete messages saved in mbox
2002-07-08 21:45:43 sacerdos [Reply | View]
As a novice to UNIX, I sweated through Cris's update and I guess everything works ok. I stopped at the point of setting up a GUI Mail application to access my local Unix mailbox.
Undoubtedly I'm missing tons of subtle functionalities, but if I am only interested in seeing cron reports, why shouldn't I be content to read them in Terminal? And if this is a reasonable abbreviation for users like me, is it possible to delete the messages from the Terminal? -
How to delete messages saved in mbox
2003-03-31 03:51:15 anonymous2 [Reply | View]
Messages kept in my inbox mail and sent mails which are of no need to me any more I bring to scene the text and i click delete but i dont see that my space in my html minimised . I think that i do something wrong can you help me -
How to delete messages saved in mbox
2002-07-13 12:30:50 benwillies [Reply | View]
Type "mail" in the terminal window and it will say whether you have mail or not. If no mail, it will automatically quit. Otherwise it will list the mail messages for the user you are logged-in as, each one uniquely numbered. Type "?" to see a list of commands. To read a message, just enter its number. To delete, type "d#" where # is the message number. If you "exit" mail, then nothing will be deleted; you have to "quit" instead. To mess around with mail for the first time, send yourself a message...
mail -s testing yourusername
blah-blah-blah
.
Note the period as it indicates the end of the message. To check whether mail is functioning properly, read the log by entering "tail /private/var/log/mail.log". Each message will have at least two entries in the log, one ending with "relay=" and the other ending with "Sent" . Other entries are errors, some of which you can ignore (except it fills-up the log) as the mail gets sent anyway, but others can drive you crazy trying to figure-out what is wrong. It's important at this point not to blindly follow what you read about sendmail on the web because MacOS X (darwin) is not the same as Linux or other Unixes and your machine can get really hosed (I speak from experience :-)
-
No more slow go, but no more mail
2002-07-04 05:49:25 bcathey [Reply | View]
First of all, Chris's instructions worked for me the first time, even though I had little idea the theory behind any of it (newbie to unix). However, per Ben's (benwillies) comment, there was a significant delay. So, I followed his instructions to speed it up. Yep, it was fast, but it stopped sending e-mail--no errors either, other than in the log it did not have the phrase "relay=excellent..." like it did right after I did Chris's initial changes. I'm sending e-mail to an outside address, like brad@highgatecross.com (I have no idea what Cron is ). Any, this was my experience.
-
sendmail slowness/host name (localhost) unknown; sleeping for retry
2002-07-01 12:15:17 benwillies [Reply | View]
After following the instructions in Chris Stone's excellent article, you may notice a drastic slowdown in how long it takes sendmail to actually send something. In the /private/var/log/mail.log you'll see that sendmail goes to sleep for a full minute because it doesn't like that locahost is not in the familiar www.yourdomain.com format (hence the "sleeping" log entry).
To fix, edit the /etc/hosts file so that the line...
127.0.0.1 localhost
reads...
127.0.0.1 localhost mail.yourdomain.com
where mail.yourdomain.com can be anything you want (yes, anything with 3 names separated by dots will work, but I use mail.benwillies.com because I'm gonna have a real domain someday :-).
Now tell sendmail to use the /etc/hosts file to resolve localhost...
edit the /etc/mail/sendmail.cf file and uncomment the line that says...
#O HostsFile=/etc/hosts
or in other words, remove the '#' on this line. Please note that this configuration option should be put into the mc file like the DONT_BLAME_SENDMAIL option, but I don't know how to do that (define? feature?), so I just changed the cf file directly.
Now test it...
mail -s testing yourusername
blah-blah-blah
.
Check the /private/var/log/mail.log and you will probably still see another error message, but it should have been sent anyway, without sleeping. There are lots of reasons why you might get another error, depending on your setup, which you could fix, but it still works.
If you changed the security of some of these files, like jrperry's post says below, then you will have to add write permissions to the sendmail.cf to make the changes, then remove write permissions or sendmail might complain (thanks, perry!).
I would also highly recommend the "Apple Repair Privileges Utility for 10.1.5" for getting things back to the base. This fixed some general slowness and jerkiness that I introduced by mass-changing privileges everywhere (because I was too lazy to read the logs).
BTW, this is not Apple's fault, but is caused by the new version of sendmail, which was tightened-up for security reasons. It's just a shame that sendmail couldn't circumvent some of this stuff for us little localhost guys who aren't running mail servers, but most peeps are not behind firewalls, so better safe than sorry.
Please respond if anything goes wrong because there is some other stuff you might have to do to get it perfect (smart host, etc).
-
sendmail slowness/host name (localhost) unknown; sleeping for retry
2002-07-09 14:43:56 dasper [Reply | View]
Thanks. I took your advice. Now sendmail initializes quickly and I can send messages without finding errors in the mail log. I receive messages that I send to my login id. I am concerned, however, about editing sendmail.cf, as you mentioned. And I wonder why I can't receive messages from my email address when I send them with the mail command. I don't see errors occur when I do this, but I don't receive the messages in my Mozilla inbox.
I also wonder about this message, which I see in my console.log:
Jul 9 17:17:44 localhost lookupd[174]: DNSAgent: dns_send_query_server - timeout for 204.127.160.1
-
sendmail & real addresses
2002-06-23 10:08:40 dennisj [Reply | View]
Root's .forward file wil send messages to my local user, but will not send to my real address. I have a full time DSL connection with a fixed IP but I do not have a domain name. It looks like send mail wants a domain - can I use my IP as a domain instead of a name? If so, how?
The bounce back message is:
( tail /var/log/mail.log is below)
================================
From: Mail Delivery Subsystem <MAILER-DAEMON>
Date: Sun Jun 23, 2002 09:52:12 AM US/Pacific
To: dennisj
Subject: Returned mail: see transcript for details
The original message was received at Sun, 23 Jun 2002 09:52:11 -0700 (PDT)
from dennisj@localhost
----- The following addresses had permanent fatal errors -----
dennisj@mac.com
(reason: 553 5.5.4 <dennisj@localhost>... Real domain name required for sender address)
(expanded from: root)
----- Transcript of session follows -----
... while talking to smtp-mx.mac.com.:
MAIL From:<dennisj@localhost> SIZE=90
<<< 553 5.5.4 <dennisj@localhost>... Real domain name required for sender address
501 5.6.0 Data format error
Reporting-MTA: dns; localhost
Arrival-Date: Sun, 23 Jun 2002 09:52:11 -0700 (PDT)
Final-Recipient: RFC822; root@localhost
X-Actual-Recipient: RFC822; dennisj@mac.com
Action: failed
Status: 5.5.4
Diagnostic-Code: SMTP; 553 5.5.4 <dennisj@localhost>... Real domain name required for sender address
Last-Attempt-Date: Sun, 23 Jun 2002 09:52:12 -0700 (PDT)
From: Dennis Jones <dennisj>
Date: Sun Jun 23, 2002 09:52:11 AM US/Pacific
To: root
Subject: test today
testing new root .forward file including dennisj@mac.com.
==================================
==================================
[localhost:~root] dennisj% tail /var/log/mail.log
Jun 18 21:04:33 localhost sendmail[359]: g5J44WBI000357: g5J44XBH000359: DSN: Data format error
Jun 18 21:04:34 localhost sendmail[359]: g5J44XBH000359: to=dennisj, delay=00:00:01, xdelay=00:00:01, mailer=local, pri=31117, dsn=2.0.0, stat=Sent
Jun 23 09:51:10 localhost sendmail[430]: My unqualified host name (localhost) unknown; sleeping for retry
Jun 23 09:52:10 localhost sendmail[430]: unable to qualify my own domain name (localhost) -- using short name
Jun 23 09:52:11 localhost sendmail[430]: gethostbyaddr(192.168.1.16) failed: 1
Jun 23 09:52:11 localhost sendmail[430]: g5NGqBGq000430: from=dennisj, size=90, class=0, nrcpts=2, msgid=<200206231652.g5NGqBGq000430@localhost>, relay=dennisj@localhost
Jun 23 09:52:11 localhost sendmail[433]: g5NGqBGq000430: to=dennisj, ctladdr=dennisj (501/20), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=60030, dsn=2.0.0, stat=Sent
Jun 23 09:52:12 localhost sendmail[433]: g5NGqBGq000430: to=dennisj@mac.com, ctladdr=dennisj (501/20), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=60030, relay=smtp-mx.mac.com. [204.179.120.49], dsn=5.6.0, stat=Data format error
Jun 23 09:52:12 localhost sendmail[433]: g5NGqBGq000430: g5NGqCGp000433: DSN: Data format error
Jun 23 09:52:12 localhost sendmail[433]: g5NGqCGp000433: to=dennisj, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31114, dsn=2.0.0, stat=Sent
-
Startup script doesn't work with OS X Server
2002-06-22 10:39:49 beepbeep [Reply | View]
Out going mail seems work fine but it doesn't like to receive one. I have to input the syntax of the startup script manually in terminal to make it work. Any idea please?
-
Still can't get it to work
2002-06-17 22:46:05 jrperry [Reply | View]
Since upgrading I have not been able to send mail to external mailboxes. As with the last post I already had the 'don'tblameme' set in my sendmail.cf. I tried the suggested simple fix to no avail. I am a novice at this stuff and can't seem to figure out what is wrong. I have cgi sripts that allow users to register for access to my DB. I then send confirming emails. Everything worked fine until I upgraded to 10.1.5. When someone registers to use the database now no email gets sent and the following error message is displayed in the browser
"can not chdir(/var/spool/clientmqueue/): Permission denied"
This looks simple enought to fix but I don't have a clue. Does anyone have a suggestion ? If so, please email me at jack@perry-family.org
Thanks -
Still can't get it to work
2002-06-18 19:14:46 jrperry [Reply | View]
replying to my own post:
I contacted sendmail.org and the problem I had. I already had done the suggested changes for Don'tblmeme to get sendmail to run the first time in OSX. I was informed that Apple failed to set the set-group-id bit on the sendmail binary. i was also given the following permissions to check as stated in the sendmail security. This solved my problems!
below is the quoted text reply from the sendmail.org folks, a great group people and have always been willing to help this novice user!
"Please check the permissions as stated in sendmail/SECURITY:
-r-xr-sr-x root smmsp ... /PATH/TO/sendmail
drwxrwx--- smmsp smmsp ... /var/spool/clientmqueue
drwx------ root wheel ... /var/spool/mqueue
-r--r--r-- root wheel ... /etc/mail/sendmail.cf
-r--r--r-- root wheel ... /etc/mail/submit.cf
If that doesn't help, post the permissions for those
files/directories, and the output of
grep smmsp /etc/passwd /etc/group"
-
Still can't get it to work
2002-06-18 15:06:07 mike_dowe [Reply | View]
Unfortunately, I don't have a fix for you. I can tell you that I got that same error you describe until I ran the 2 net-info commands in /etc/mail/README (you need to run those as root). Now I can send mail out to external mailboxes though still with the annoying warning:
Warning: first argument in [IPC] mailer must be TCP or FILE
I'm trying to figure out how to make that go away.
-
Simpler fix ?
2002-06-17 16:53:56 mike_dowe [Reply | View]
I had sendmail working under the "don't blame sendmail" scheme until 10.5.1
Before I saw this O'Reilly update, I acted on Chris' post in the original article which said to follow the instructions in /etc/mail/README.
I figured I didn't want to edit sendmail.cf (I had in the past and it looked the same). I gathered from the README that netinfo was the problem so I followed these instructions:
* To ensure that sendmail does not read its config file from netinfo,
execute the following commands:
niutil -create . /locations/sendmail
niutil -createprop . /locations/sendmail sendmail.cf /etc/mail/sendmail.cf
I sent a test message to root and it worked (after rebooting).
-
Simpler fix ?
2002-06-17 17:12:33 mike_dowe [Reply | View]
By the way, though this simple fix worked for me. I do get these messages in the terminal when I send a message to root (which is automatically forwarded to me):
Msmtp: Warning: first argument in [IPC] mailer must be TCP or FILE
Mesmtp: Warning: first argument in [IPC] mailer must be TCP or FILE
Msmtp8: Warning: first argument in [IPC] mailer must be TCP or FILE
Mdsmtp: Warning: first argument in [IPC] mailer must be TCP or FILE
Mrelay: Warning: first argument in [IPC] mailer must be TCP or FILE
I don't know what they mean. Again, despite these warnings the mail still gets through.
-
Simpler fix ? (with error messages)
2002-08-07 09:33:13 kwidholm [Reply | View]
If you take a look at /var/log/daily.out, you'll see these error messages repeated there (assuming you've set up your computer to do its maintenance tasks). I don't get these messages when sending mail to root, I get them as part of the daily maintenance tasks or if I issue the 'sudo mailq' command.
The interesting thing is that when I issue the 'mailq' command with the -v (verbose) switch, I get the following message:
Warning: .cf file is out of date: sendmail 8.12.2 supports version 10, .cf file is version 9
Would be nice to see Apple address all this stuff.
-
what is a domain in this context ?
2002-06-16 06:21:02 mmurray [Reply | View]
sudo cp generic-darwin.mc yourdomain.mc
(It’s OK to use the literal "yourdomain" if you don't have a domain for your machine. If you do have a domain, then use it instead.)
--------
How do I know if I have a domain for my machine ?
Thanks - Michael -
what is a domain in this context ?
2003-07-21 19:07:16 anonymous2 [Reply | View]
this is just the name of the file, so what you call it is not too important. the name doesn't affect any programs, it's just for your reference. typically, if
you had several machines with similar configs, then
you'd name the file something that would indicate that,
such as graphicslab.mc or foocom.mc. I usually use the
name of the specific machine, since I tend to have different
configs on different machines. --bressen
-
relaying and php
2002-06-15 16:59:13 theladyboo [Reply | View]
Well, the details in this article helped with virtual domains and getting sendmail running but my relay domains are no longer working. No matter what address i send to the outside world i get back relaying denied. I can receive mail fine.
I don't know if it's related or not yet but the next window for the php3 script twig no longer works either. since this script is mail related, i don't know. to busy trying to fix the sendmail problem. -
relaying and php
2002-06-15 20:19:20 jeffulri [Reply | View]
Let me guess, you're using a dynamic IP? If so, the solution is simple, HUP the two sendmail processes AFTER you've made your internet connection... -
relaying and php
2002-06-19 22:12:07 theladyboo [Reply | View]
Actually no, I have a static IP. The php problem was an upgrade issue. It's fixed.
The relay issue I'm not sure yet because my machine crashed a day later. kernel panics no matter what I did. I had to reinstall 10.1.3 to get back up and running. So, no, I'm not going to go back to 10.1.5 with my main server. Perhaps when I have a machine to play with I will.
bpack
http://www.onlymacintosh.com
-
Works for Me
2002-06-15 09:49:03 Theory [Reply | View]
I set up Sendmail under 10.1.3 or .4, and since I upgraded, it has continued to work. What am I missing?
-
This Series
2002-06-15 00:52:56 tomp2002 [Reply | View]
Part 3 nicely continues the first two parts of this series. IMO some of its readers may look for this section to be one for specific troubleshooting. I don't think that's useful, preferring instead to read more general comments if possible.
There must be dozens of excellent forums to trouble shoot problems. My impression is that they do not relate to anything in this series of articles. My current Sendmail, for example, is totally screwed by some Apple or third party installer. I knew that before reading Part III.
I suggest all of us learn to monitor our systems so that some late blooming problem is not attributed to something recent. It would also appear that some readers may have forgotten the content of Parts 1 and 2.
And yes I do have Sendmail working fine on another Mac and find not a thing wrong with this article or its instructions. The bulk of my "education" on use of Terminal is derived from this series, a PDF "for beginners" I snagged somewhere and reading the "man" files at lenth <sigh>...
With all due respect......
I remain a geek NOT but one who is interested. :)
-
Consequences?
2002-06-13 11:21:31 arunkle [Reply | View]
This article is useful, however, it appears that there are a number of ways to get sendmail working on 10.1.5 again. It would be handy to have a description of why some of these steps were implemented.
I have been able to get sendmail running correctly (time will tell) without adding the second sendmail line. I have also include a procedure during the boot process to change the protection of root directories so that I do not need the DontBlameSendmail feature.
As a final comment/question, the default sendmail configuration that is supplied by apple seems to be geared toward server systems supporting mail relaying using configuration files to maintain security. It would be useful to have a template configuration that was oriented for non-SysAdmin types that want just a simple secure environment to support just their machine.
Allan Runkle -
I agree
2002-06-14 13:46:17 nirs [Reply | View]
I also running 10.1.5 with sendmail using only one instance and setting the permisions in the sendmail startup script. It seems that everything runs fine. I am sending mail from Mail.app to the outside world through smtp server at 127.0.0.1, and get mail from my local unix acount.the mail command also works for both local mail to myself or root and mail to internet addresses.
I wonder why the second sendmai instance is needed. -
Consequences?
2002-06-13 12:37:28 Chris Stone |
[Reply | View]
Excellent points, Allen!
I will be updating thes article again once I find the soution that works for everyone. Then again, by that time, hopefully Jaguar will come with sendmail all ready to go...!
--Chris
-
Sendmail takes 3 minutes to start
2002-06-10 11:44:06 jimlongo [Reply | View]
Hi,
After following these instructions, when I reboot it takes 3 minutes for sendmail to start during the "blue bar part" of the bootup. I notice that there are two processes called sendmail running one owned by root and the other by smmsp(?).
It works afterwards, sending the cron reports, and also sending to some of my pop email accounts.
But mail is refused by mac.com accounts with the return message that "Real domain name required for sender address".
Many thanks. -
Sendmail takes 3 minutes to start
2002-06-13 09:34:53 jiclark [Reply | View]
I was just coming back to see if Chris had posted a response to any of our questions, and saw this topic. I, too, have noticed that "starting sendmail" now takes more than two minutes during startup on my Dual500/G4. This is a little frustrating, and makes me wonder if it's really necessary...
Is there anything we can do to fix this???
Thanks, John -
Sendmail takes 3 minutes to start
2002-06-13 12:29:17 Chris Stone |
[Reply | View]
I'm guessing this happens when sendmail is unable to resolve the domain name. I've suggested to some folks that they just revert their hostconfig file back to NO for mailserver, and see how that works. So far, for local only mail delivery , that seems to works OK.
There're could be an issue, though, if both sendmail and your email client are trying send (use port 25) at the same time, so watch for that.
Let us know how it goes for you...
Thanks,
--Chris -
Sendmail takes 3 minutes to start
2002-06-17 10:16:58 jimlongo [Reply | View]
Thanks Chris,
Setting the mailserver to NO solves the startup issue.
I can still send mail from the terminal to most POP accounts, so I'm not sure what functionality I have lost.
Jim -
Sendmail takes 3 minutes to start
2002-06-14 13:38:17 nirs [Reply | View]
edit System/Library/Startupitems/Sendmail/Sendmail
put & at the end of the sendmail command:
/usr/sbin/sendmail -bd -q1h &
this will start sendmil at the background. It can sit and try to resolve the domain name for few mintes but you will never know it.
-
nevermind, sort of...
2002-06-08 15:36:36 jiclark [Reply | View]
Well, I figured out how to "sudo mail root", and it worked, so I figure I'll start getting the cron job reports again tomorrow. So do I still have the 'extra' security that the new version of sendmail is supposed to provide? Is that why it's not possible to send mail to root without sudo-ing first?? [I did do the DontBlameSendmail part of your instructions, BTW, does that eliminate the new security 'features'? And if so, how do I go back and make the cron emails work and still not compromise security??]
Sorry to be so ignorant, but I'm a good representative of the vast majority of OS X users: an old Mac hand that knows NOTHING about Unix!!! We all need a little hand-holding through this transition...
Thanks again, John -
nevermind, sort of...
2002-06-08 21:42:03 jeffulri [Reply | View]
I can answer that one for you at this point. Doing a su does NOT circumvent the new security - in fact, the fact you MUST su is due to the new security features. You didn't used to (10.1.4) have to do that. CHMOD 777 the folder that returns that nasty error so that it doesn't throw the error...that circumvents the new security (Grin)...
-
Help, please...
2002-06-08 15:21:02 jiclark [Reply | View]
I followed your instructions, but now cannot send mail to root as you describe in the tutorial. I get the same message as the previous poster, and don't know how to "su" previous to sending mail in the Terminal. All I want is to be able to receive my local mail reporting the cron jobs. Will this still work now that I've followed the above instructions? Could you possibly give us an update on what we need to do to be able to have the same functionality that we had PREVIOUS to the 10.1.5 update???
Many thanks, John
-
Further Clarification
2002-06-08 12:55:38 jeffulri [Reply | View]
This article DOES allow sendmail to send it's cronjob reports to a local user (It does so as ROOT - so the SU requirement to send mail makes sense to me as well). Which I suppose was the the sole intent of THIS PARTICULAR article. I make that statement on the basis of what has been posted previously. However, I could previously (Mac OS 10.1.4) send mail OUT to non-local addresses before the 10.1.5 update. Now, even with this article's additional instructions, I am not. Does anyone have a solution for that problem? -
Further Clarification
2002-06-09 20:39:52 jafager [Reply | View]
If you have an SMTP relay that you can use, you can avoid sendmail entirely and use a lightweight MTA like smtp.pl to forward outgoing mail to the relay. I use that method to handle mail sent from mutt.
What I have not figured out is how to send mail to different relays based on the current network location (I have a laptop and send mail from several different networks).
jafager -
Not using sendmail is not the direction I want to go.
2002-06-10 08:52:48 jeffulri [Reply | View]
There are many ways to get around using sendmail. That's not what I want to do. Being able to actually use sendmail, I believe, was the entire point of this article, as well as my request for clarification, not providing alternitives to it. Thanks for your suggestion though! Should sendmail in it's present form become completely unsuitable for PHP's email interface, I'll most likely end up taking a different route. I'm still left unable to use MAIL if I haven't SU'ed first. Thereby making it impossible to use PHP's sendmail interface to mail comments from my weblog to me, send out mailings to my Forum's members, etc. as I had been able to with the previous version of sendmail. Any comprehensive instructions on the usage of the new version of sendmail's TrustedUser database would be helpful. After an exhaustive search, I've turned up nothing. There's no man page for it, and it's usage isn't mentioned the sendmail's man pagess either. As it is, I've been forced to cmod 777 /var/spool/mqueue to allow me to use sendmail as I had. Thereby eleminating the security the current version of sendmail affords. I have yet to check at http://www.sendmail.org/ for information on the TrustedUser database. That's where I'm headed next. Having not used the TrustedUser database before, having usage instructions from someone who has would be helpful in this instance.
-
A typo?
2002-06-08 12:35:24 jeffulri [Reply | View]
Your article suggests that one, "Save that file and then open /System/Library/StartupItems/Sendmail/Sendmail:
sudo pico /System/Library/StartupItems/Sendmail/Sendmail
Find this line near the end:
/usr/sbin/sendmail -bd -q1h
And add this line after it:
/usr/sbin/sendmail -C /etc/mail/submit.cf -q1h
Save that file and restart your machine to allow the startup script to run."
Thus generating the following Sendmail file
---[Cut Here]---
#!/bin/sh
. /etc/rc.common
##
# Start mail server
##
if [ "${MAILSERVER:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Starting mail services"
##
# Remove junk from the outbound mail queue directory and start up
# the sendmail daemon. /usr/spool/mqueue is assumed here even though
# it can be changed in the sendmail configuration file.
##
queue=/var/spool/mqueue
rm -f ${queue}/nf* ${queue}/lf*
/usr/sbin/sendmail -bd -q1h
/usr/sbin/sendmail -C /etc/mail/submit.cf -q1h
fi
---[Cut Here]---
Presumabably, you only wanted us to ADD to that line. Thereby generating the following Sendmail file
---[Cut Here]---
#!/bin/sh
. /etc/rc.common
##
# Start mail server
##
if [ "${MAILSERVER:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Starting mail services"
##
# Remove junk from the outbound mail queue directory and start up
# the sendmail daemon. /usr/spool/mqueue is assumed here even though
# it can be changed in the sendmail configuration file.
##
queue=/var/spool/mqueue
rm -f ${queue}/nf* ${queue}/lf*
/usr/sbin/sendmail -C /etc/mail/submit.cf -q1h
fi
---[Cut Here]---
Please clarify and or change your article to correctly reflect your intent.
Also, why are you not appending a & to the line in question, thereby making sendmail a backgournd app, as it should be? -
A typo?
2002-06-09 20:44:25 jafager [Reply | View]
> Also, why are you not appending a & to the
> line in question, thereby making sendmail a
> backgournd app, as it should be?
IIRC, sendmail is well-behaved and will background itself.
jafager -
A typo?
2002-06-09 14:58:51 Chris Stone |
[Reply | View]
Actually, I meant what I wrote:
"Find this line near the end:
/usr/sbin/sendmail -bd -q1h
And add this line after it:
/usr/sbin/sendmail -C /etc/mail/submit.cf -q1h"
The lines, then, should look like this:
/usr/sbin/sendmail -bd -q1h
/usr/sbin/sendmail -C /etc/mail/submit.cf -q1h
That is, two sendmail instances are to be started.
Thanks,
--Chris
-
This only works after SU'ing first
2002-06-08 12:28:23 jeffulri [Reply | View]
From the terminal, after performing the aforementioned operations, I am only able to send mail (EG: mail julrikson@mac.com) if I have SU'ed first. Otherwise I get the following error: can not chdir(/var/spool/mqueue/): Permission denied
Program mode requires special privileges, e.g., root or TrustedUser.
Presumably, I could change the permissions on /var/spool/mqueue/ to all Group R/W/E and defeat security to allow me to send mail as any of my created users. I'd rather not do this. Also, I am unable to send mail out with PHP scripts that worked in 10.1.4. So, apparently, there's some why to add "TrustedUser(s)." I haven't found ducumentation on this anywhere. Anyone else run into this same problem? If so, how did you approach it. -
This only works after SU'ing first
2002-06-13 20:23:50 bradpuett [Reply | View]
The only time I received the error you mentioned ("can not chdir(/var/spool/mqueue/): Permission denied") was after I had changed permissions, BUT before I 'generate(d) a new sendmail.cf file from scratch, using the m4 "macro language processor." ' Once the sendmail.cf file was regenerated, everything worked as before ...






I was a windows user but moved to Mac OS X. I have some perl scripts I run on MS-DOS cmd.exe but have been having problems running those scripts on Mac OS X terminal.
Is there any command used for running perl scripts or how do I go about it.
Thanks for responding.
Cruzapete