Recently I got some issue with Sendmail. When I tried to check mail queue, then it throw me following error.
/etc/mail/sendmail.cf: line 91: fileclass: cannot open '/etc/mail/local-host-names': World writable directory
e.g.
[root@test ~]# mailq
/etc/mail/sendmail.cf: line 91: fileclass: cannot open '/etc/mail/local-host-names': World writable directory
/etc/mail/sendmail.cf: line 588: fileclass: cannot open '/etc/mail/trusted-users': World writable directory
As Error clearly incdicate that mentioned file have write access for other and group as well and need to change permission for this. So just change permissions and restart sendmail service as below :
$su (If you not login with root)
#chmod go-w /
#chmod go-w /etc
#chmod go-w /etc/mail
#service sendmail restart
[root@test ~]# mailq
/var/spool/mqueue (5 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
qAHFnjL8006870 166 Sat Nov 17 07:49
(Deferred: Connection refused by test.com.)
qAG9F7d9023285 5631 Fri Nov 16 01:15 MAILER-DAEMON
Thanks!!
/etc/mail/sendmail.cf: line 91: fileclass: cannot open '/etc/mail/local-host-names': World writable directory
e.g.
[root@test ~]# mailq
/etc/mail/sendmail.cf: line 91: fileclass: cannot open '/etc/mail/local-host-names': World writable directory
/etc/mail/sendmail.cf: line 588: fileclass: cannot open '/etc/mail/trusted-users': World writable directory
As Error clearly incdicate that mentioned file have write access for other and group as well and need to change permission for this. So just change permissions and restart sendmail service as below :
$su (If you not login with root)
#chmod go-w /
#chmod go-w /etc
#chmod go-w /etc/mail
#service sendmail restart
[root@test ~]# mailq
/var/spool/mqueue (5 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
qAHFnjL8006870 166 Sat Nov 17 07:49
(Deferred: Connection refused by test.com.)
qAG9F7d9023285 5631 Fri Nov 16 01:15 MAILER-DAEMON
Sendmail is strict on the permissions. :)
Thanks!!
Ohh I faced the same frustrating Sendmail error took me hours to figure out it was all due to world-writable directories! Just fixed the permissions and boom, mailq worked like magic. WebSpaceKit should seriously consider doing a quick guide on this; so many admins would benefit!
ReplyDelete