Thursday, February 18, 2010

CentOS Sendmail error /etc/mail/submit.cf: line 544: --- Group writable directory

I was getting this error, when tried to send mail via SendMail server.
/etc/mail/submit.cf: line 544: fileclass: cannot open '/etc/mail/trusted-users': Group writable directory
Sendmail is default mail server for CentOS.

To test sendmail from ssh, use this:
echo "test" | mail -s testsubject abc@xyz.com
(replace abc@xyz.com with your email address, like hotmail or gmail etc.)

On doing this I was getting the above mentioned error.
Some forums said that the issue is because of permission problems. So run following command:
chmod -R 0755 /etc/mail
It will set 755 rights to all files in this folder.
It works in some cases but in my case it wasn't.

The solution for this is to edit the respective file, like /etc/mail/submit.cf
You can use vi to edit this.
Jump to line number mentioned in error. 544 in our case.
(Note: To see line numbers in vi, press Ctrl+G to get the line number of your cursor)
This is the line:
Ft/etc/mail/trusted-users
Now just change it to:
Ft-o /etc/mail/trusted-users

Done. Now try send the mail and it will work.

In some case the error line number and file changes, like e.g.
/etc/mail/sendmail.cf : line 91 : fileclass : Cannot open '/etc/mail/local-host-names' : World writable directory
Or
/etc/mail/sendmail.cf: line 588: fileclass: cannot open '/etc/mail/trusted-users': World writable directory
Etc etc..

Same procedure will be applied to this. Go to respective file and respective line number.
And you will find either Ft or Fw in start
Just add -o after Ft or Fw like Ft-o /etc.... and Fw-o /etc...

This should solve the issue...

2 comments:

  1. This fixed the problem, thanks!

    ReplyDelete
  2. chmod -R 0755 /var/mail - one more reason of this error - is group writeable permission on mail folder

    ReplyDelete

Developer Instincts