Getting Error configuring Sendmail

ajazurrahman

New Member
Credits
20
I have been able to install send mail but when i try to send email using following command i get following error:
echo "This is message body" | mail -s "hello subject" [email protected]


[[email protected] alternatives]# can not chdir(/var/spool/clientmqueue/): Permission denied
Program mode requires special privileges, e.g., root or TrustedUser.


I have gone through many solutions provided over internet, mostly suggesting setting the suid and permission on mutiple file but they don't seem to work. I am using RedHat Linux 7.1 ,

[[email protected] alternatives]# ls -ltr /usr/sbin/sendmail.sendmail
-rwxr-sr-x. 1 root smmsp 836928 Aug 8 2019 /usr/sbin/sendmail.sendmail

drwx------. 2 root smmsp 4096 Feb 23 2016 cron
drwxr-xr-x. 2 root smmsp 4096 Mar 10 2016 lpd
drwxr-xr-x. 2 root smmsp 4096 Jul 1 2016 plymouth
drwx------. 2 root smmsp 4096 Jul 22 2016 up2date
drwxrwxr-x. 2 root root 4096 Aug 8 2019 mqueue
drwxr-xr-x. 2 root smmsp 4096 Nov 13 21:06 anacron
drwxr-xr-x. 3 root smmsp 4096 Nov 13 21:06 rhsm
drwxr-xr-x. 16 root smmsp 4096 Nov 13 21:06 postfix
drwxrwxr-x. 2 root smmsp 4096 Dec 26 07:48 mail
drwxrwx---. 2 smmsp smmsp 4096 May 5 13:06 clientmqueue


Any help in this regard is highly appriciated.
 


f33dm3bits

Gold Member
Gold Supporter
Credits
25,777
1. Why are you wanting to use sendmail instead of the RHEL7 default, postfix?
-rwxr-sr-x. 1 root smmsp 836928 Aug 8 2019 /usr/sbin/sendmail.sendmail
2. That setguid isn't going to do anything because it only allows you to execute a binary as the group that owns it as a user that has no user or group ownership. When you execute it to /usr/sbin/sendmail.sendmail it will still need to be able to write to another location, changing the permissions of that file isn't going to fix anything.

3. That same file doesn't do the sending since you are using the mail command to send a mail, that command is most likely used by sendmail when transporting mail.

4. The ownership of those directories don't look correct. I would expect all those files to be owned by root.root except for the mail directory. So something like this.
Code:
drwxr-xr-x.  2 root root  63 Feb 27 19:18 anacron
drwx------.  2 root root   6 Aug 14  2019 cron
drwxr-xr-x.  2 root root   6 Apr 15  2018 lpd
drwxrwxr-x.  2 root mail   6 Apr 15  2018 mail
drwxr-xr-x.  2 root root   6 Oct  5  2020 plymouth
drwxr-xr-x. 16 root root 201 Feb 27 19:19 postfix
Change the owner/group of those directories in /var/spool where you have smmsp to root for all those directories and for the mail directory change the group to mail. After you have changed the the user and group owership of those directories try sending a mail again using the mail command.
 
Last edited:
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Top