1748198 Members
2632 Online
108759 Solutions
New Discussion юеВ

Re: Sendmail problem.

 
SOLVED
Go to solution
Jeffrey F. Goldsmith
Super Advisor

Sendmail problem.

When mail is sent to root it should use the .forward file and forward the mail to me via outlook. For some reason it isnt doing that anymore. I can use sendmail to send mail to me and it uses the .forward and forwards the mail to me via outlook.
Here is the /var/adm/syslog/mail.log file that shows what is happening when I try to send mail to root.

Mar 17 10:51:40 diomede sendmail[22363]: KAA22363: from=root, size=51, class=0, pri=60051, nrcpts=2, msgid=<200503171951.KAA22363@di
omede.>, relay=root@localhost
Mar 17 10:51:41 diomede sendmail[22405]: KAA22363: to=ssmith@co.fairbanks.ak.us,jgoldsmith@co.fairbanks.ak.us, ctladdr=root (0/3), d
elay=00:00:21, xdelay=00:00:01, mailer=smtp, relay=co.fairbanks.ak.us. [172.16.0.150], stat=Sent (OK)
Mar 17 10:52:37 diomede sendmail[22406]: KAA22406: forward /home/root/.forward.diomede: World writable directory
Mar 17 10:52:37 diomede sendmail[22406]: KAA22406: forward /home/root/.forward: World writable directory
Mar 17 10:52:43 diomede sendmail[22406]: KAA22406: from=root, size=11, class=0, pri=30011, nrcpts=1, msgid=<200503171952.KAA22406@di
omede.>, relay=root@localhost
Mar 17 10:52:43 diomede sendmail[22409]: KAA22406: forward /home/root/.forward.diomede: World writable directory
Mar 17 10:52:43 diomede sendmail[22409]: KAA22406: forward /home/root/.forward: World writable directory
Mar 17 10:52:43 diomede sendmail[22409]: KAA22406: to=root, ctladdr=root (0/3), delay=00:00:06, xdelay=00:00:00, mailer=local, stat=
Sent

Anyone know how to fix this problem?
10 REPLIES 10
RAC_1
Honored Contributor

Re: Sendmail problem.

Correct this and check.

home/root/.forward.diomede: World writable directory
There is no substitute to HARDWORK
Jeffrey F. Goldsmith
Super Advisor

Re: Sendmail problem.

How do I correct it?
The only thing in the /home/root/.forward is my outlook e-mail address.
John Dvorchak
Honored Contributor

Re: Sendmail problem.

Sendmail will not forward if the .forward file is world writable because that means that the file could be compromised. All you have to do is to cd to your home directory and chmod 400 .forward

root> chmod 400 .forward

Then sendmail will like it and start using it to forward your email.
If it has wheels or a skirt, you can't afford it.
John Dvorchak
Honored Contributor
Solution

Re: Sendmail problem.

Sorry I missed the part about the world writeable directory. Your home directory, /home/root/ is evidently world writeable. Check the perms and remove the write permission for everyone on the directory itself.


root> chmod o-w /home
root> chmod o-w /home/root

That command means change mode removing write access for other for the directory /home and /home/root

If it has wheels or a skirt, you can't afford it.
Steven E. Protter
Exalted Contributor

Re: Sendmail problem.

The problem with the /root/ directory being world writable is that anybody could conceivably get that .forward file and redirect mail or perhaps use it to relay spam.

Bad idea. Thats why the log file is complaining. I think its always a good idea to know why somethng is happening.

The chmod fix is good.

A better place however to handle root mail forwarding is in /etc/aliases or /etc/mail/access file.

You need to know how to generate sendmail.cf but this presentation and script shows you how to do that with sendmail 8.11.1

http://www.hpux.ws/buildmail.hpux.text

@ http://www.hpux.ws/

Regards,

Steven
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jeffrey F. Goldsmith
Super Advisor

Re: Sendmail problem.

Here are the changes that I made and what the results are.
chmod o-w home
drwxr-xr-x 176 root root 4096 Jan 25 08:42 home

chmod o-w root
drwxrwxr-x 6 root sys 1024 Mar 17 11:12 root

Now when I try to send root an email this is what shows up in the mail.log file.

Mar 17 11:38:30 diomede sendmail[26580]: LAA26580: forward /home/root/.forward.diomede: Group writable directory
Mar 17 11:38:30 diomede sendmail[26580]: LAA26580: forward /home/root/.forward: Group writable directory
Mar 17 11:38:35 diomede sendmail[26580]: LAA26580: from=root, size=11, class=0, pri=30011, nrcpts=1, msgid=<200503172038.LAA26580@di
omede.>, relay=root@localhost
Mar 17 11:38:35 diomede sendmail[26582]: LAA26580: forward /home/root/.forward.diomede: Group writable directory
Mar 17 11:38:35 diomede sendmail[26582]: LAA26580: forward /home/root/.forward: Group writable directory
Mar 17 11:38:35 diomede sendmail[26582]: LAA26580: to=root, ctladdr=root (0/3), delay=00:00:05, xdelay=00:00:00, mailer=local, stat=
Sent
RAC_1
Honored Contributor

Re: Sendmail problem.

chmod 755 /home/root/
There is no substitute to HARDWORK
Jeffrey F. Goldsmith
Super Advisor

Re: Sendmail problem.

I made the change to root and found that root's mail is now being forwarded to me via outlook. Yea!
Thanks for all the help.
Now I need to go back and figure out when and who changed roots permissions.
Question, I rebuilt the alias database /etc/mail/aliases the same day that root was changed. Doing that rebuile wouldnt have made any changes to root would it?

RAC_1
Honored Contributor

Re: Sendmail problem.

Absolutely not. Someone must have changed it.
There is no substitute to HARDWORK