2

I am trying to setup the mail on my fedora 20. Every time I try to fire a test mail it tells me the permission is denied on /usr/sbin/sendmail.

I checked the permissions and this is the output:

[root@localhost uone]# ls -ld /usr/sbin/sendmail
drwxr-sr-x. 2 uone uone 4096 Jun 14 17:42 /usr/sbin/sendmail

when I check the logs in /var/logs/mail, I get this

[root@localhost uone]# ls /var/log/maillog
/var/log/maillog

and

[root@localhost home]# cat /var/log/maillog
[root@localhost home]#  

Running ls -l gives me this

[root@localhost home]# ls -l /var/log/maillog
-rw-------. 1 root root 0 Jul 6 11:27 /var/log/maillog

Doing a ls -l on sendmail directory gives me this

[root@localhost sbin]# ls -l | grep sendmail
drwxr-sr-x. 2 uone uone 4096 Jun 14 17:42 sendmail lrwxrwxrwx. 1 root root 15 Jul 12 19:04 sendmail.ssmtp -> /usr/sbin/ssmtp

I have two questions:

  1. Am I missing something in setting up the "mail"? Is there anything else I need to do before I can try sending a mail?

  2. How can I get the logs to find out exactly what's happening?

  • 2
    I would be more useful to actually read the logfile rather than display its path. Try cat /var/log/maillog. – lgeorget Jul 17 '14 at 9:32
  • Thanks for replying. I did the ls to see if it has anything. I just did a cat on the path; Here is the output [root@localhost home]# cat /var/log/maillog [root@localhost home]# – Atul Jul 17 '14 at 9:33
  • 2
    /usr/sbin/sendmail is a directory?? What does ls -l /usr/sbin/sendmail show? What OS are you using? – Lars Rohrbach Jul 17 '14 at 9:39
  • I am running fedora 20 on vmware 8. Running ls -l gives me this "[root@localhost home]# ls -l /var/log/maillog -rw-------. 1 root root 0 Jul 6 11:27 /var/log/maillog " Doing a ls -l on sendmail directory gives me this [root@localhost sbin]# ls -l | grep sendmail drwxr-sr-x. 2 uone uone 4096 Jun 14 17:42 sendmail lrwxrwxrwx. 1 root root 15 Jul 12 19:04 sendmail.ssmtp -> /usr/sbin/ssmtp – Atul Jul 17 '14 at 9:41
  • 1
    The . after the permissions in the ls output means that there's an SELinux context. What does ls -Z /usr/sbin/sendmail say? Does restorecon -v /usr/sbin/sendmail help? What MTA did you install (what package provides /usr/sbin/sendmail)? What else did you do to “setup the mail”? – Gilles Jul 17 '14 at 21:50
3

Your permissions issue is not a file permissions issue but SELinux disallowing the sendmail executable from accessing files on the filesystem in a specific location. Your best friend for dealing with these is to use the SELinux troubleshooter GUI.

$ sealert -b 

   ss#1

You'll then want to follow the advice to add the necessary contexts to your filesystem to appease SELinux.

    ss #2

NOTE: In the above example I've selected the 2nd option and will run the commands semanage and restorecon as described to fix my issue here. You'll need to do the same for your sendmail issue.

Part of Fedora?

Yes SELinux, and therefore the tools used to troubleshoot are part of all the Red Hat distros. Whenever I cannot locate the name of a package a given executable is a member of I turn to the command repoquery.

$ repoquery -qf */sealert
setroubleshoot-server-0:3.2.17-1.fc20.x86_64
setroubleshoot-server-0:3.2.14-2.fc20.x86_64

Issues running as a GUI

If you're running into problems running sealert as a GUI you can drop back to running it via a terminal like so:

$ sudo sealert -a /var/log/audit/audit.log | less

You'll then have to look through the output for your particular issue and use the suggested commands to fix your SELinux issues. You're looking for the lines that say something along these lines:

***** Plugin openvpn (47.5 confidence) suggests ***************************

The ones with the higher "confidence" values are the actions you'll likely want to take. The commands to "fix" the SELinux issues follow after these lines, for example:

$ sudo semanage fcontext -a -t home_cert_t /home/slm/somedom.com.ca.crt
$ sudo restorecon -R -v /home/slm/somedom.com.ca.crt

References

  • Is sealert available for fedora? i doubt it. Could not find it via yum.. – Atul Jul 19 '14 at 6:36
  • @Atul - yes it is. I got those screenshots from running it on Fedora 20. It's in this pkg: setroubleshoot-server. – slm Jul 19 '14 at 13:27
  • @Atul - see updates. – slm Jul 19 '14 at 13:41
  • Bad luck! i tried launching the program and it tells me it can not attach to the desktop process. [root@localhost uone]# sealert could not attach to desktop process. I tried looking up the sealert via repoquery and it does nothing on the other hand it tells me setroubleshooter is installed fine. Any other way we can work on the SE part? Let me know if you need any logs? – Atul Jul 20 '14 at 8:38
  • @Atul - see updates. – slm Jul 20 '14 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.