mail problem (NOT Mail or Mail.app)

chenly

Moof!
When I try to use the CLI mail, I get the following error. What's wrong?

Welcome to Darwin!
[***-***-***-***:~] [username]% mail root
Subject: test
test
.
EOT
[***-***-***-***:~] [username]% /etc/mail/sendmail.cf: line 81: fileclass: cannot open /etc/mail/local-host-names: Group writable directory


Do I just need to change the permissions on /etc/mail/local-host-names, or is this a problem with the IP addressing/naming of the machine as supplied by my ISP, AOL/TimeWarner RoadRunner (i.e., not AOL service)?
 
Although you have a more complicated problem than I'm going to admit to..here's a quick fix...chmod these directories...

[lhaven:/] root% chmod g-w /private/etc /etc/mail

sendmail should work...I'll post a more detailed explanation later if I get the time
 
I'm no sendmail expert (who is), but I just commented line 81 out and made the directories not group writable and all seems to be working well enough...

>>From Sendmail.cf
Cwlocalhost
# file containing names of hosts for which we receive email
#Fw/etc/mail/local-host-names


hth
Todd
 
The problem with that fix is that all the mails coming from crontab reports will start filling up your /var/mail/root....a more permanent solution is to patch your mc file...but here's a patch for your cf....

--- /etc/mail/sendmail.cf.orig Sun Sep 2 20:19:22 2001
+++ /etc/mail/sendmail.cf Sun Mar 3 09:32:26 2002
@@ -67,6 +67,7 @@
# addressing the actual file configuration problem is preferred
# need to set this before any file actions are encountered in the cf file
#O DontBlameSendmail=safe
+O DontBlameSendmail=GroupWritableDirPathSafe

# default LDAP map specification
# need to set this now before any LDAP maps are defined

that still doesn't solve the crontab problem tho...so here's a patch for crontab...

--- /etc/crontab.orig Sun Sep 2 13:52:07 2001
+++ /etc/crontab Mon Mar 11 22:03:06 2002
@@ -13,6 +13,6 @@
#*/10 * * * * root /usr/libexec/atrun

# do daily/weekly/monthly maintenance
-15 3 * * * root sh /etc/daily 2>&1 | tee /var/log/daily.out | mail -s "`hostname` daily output" root
-30 4 * * 6 root sh /etc/weekly 2>&1 | tee /var/log/weekly.out | mail -s "`hostname` weekly output" root
-30 5 1 * * root sh /etc/monthly 2>&1 | tee /var/log/monthly.out | mail -s "`hostname` monthly output" root
+15 3 * * * root sh /etc/daily 1>/var/log/daily.out 2>&1
+30 4 * * 6 root sh /etc/weekly 1>/var/log/weekly.out 2>&1
+30 5 1 * * root sh /etc/monthly 1>/var/log/monthly.out 2>&1

p.s. do a man patch or start another thread about patch if you need help
 
fintler, what do I do with these?

Originally posted by fintler

--- /etc/mail/sendmail.cf.orig Sun Sep 2 20:19:22 2001
+++ /etc/mail/sendmail.cf Sun Mar 3 09:32:26 2002
@@ -67,6 +67,7 @@
# addressing the actual file configuration problem is preferred
# need to set this before any file actions are encountered in the cf file
#O DontBlameSendmail=safe
+O DontBlameSendmail=GroupWritableDirPathSafe

# default LDAP map specification
# need to set this now before any LDAP maps are defined


and for crontab:

--- /etc/crontab.orig Sun Sep 2 13:52:07 2001
+++ /etc/crontab Mon Mar 11 22:03:06 2002
@@ -13,6 +13,6 @@
#*/10 * * * * root /usr/libexec/atrun

# do daily/weekly/monthly maintenance
-15 3 * * * root sh /etc/daily 2>&1 | tee /var/log/daily.out | mail -s "`hostname` daily output" root
-30 4 * * 6 root sh /etc/weekly 2>&1 | tee /var/log/weekly.out | mail -s "`hostname` weekly output" root
-30 5 1 * * root sh /etc/monthly 2>&1 | tee /var/log/monthly.out | mail -s "`hostname` monthly output" root
+15 3 * * * root sh /etc/daily 1>/var/log/daily.out 2>&1
+30 4 * * 6 root sh /etc/weekly 1>/var/log/weekly.out 2>&1
+30 5 1 * * root sh /etc/monthly 1>/var/log/monthly.out 2>&1
 
...but without a command line to apply, I can't decipher a man page an hope to get this exactly right on my first and only try.
 
and as I said..those patches are only a temporary solution, you should modify your mc file, toss it through m4 and make a custom cf file so you don't have to do a work around
 
Back
Top