I can send email only with root, but not with non-root user


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users I can send email only with root, but not with non-root user
# 1  
Old 04-14-2020
I can send email only with root, but not with non-root user

Hi,

I have RHEL 5.7 server. I am able to send mail from this server to my Inbox with root login, but not with a non-root user. Using sendmail. Permission of sendmail.sendmail looks okay and emails are not holding up in the server, when I do mailq immediately after sending an email. Please suggest, what I am supposed to check or what I am missing.
Code:
[jsmith@rhel-serv1-prod ~]$ cat /etc/mail/sendmail.cf | grep DS
DSwksb-mail1-prod.pedro.com
# Return-Receipt-To: header implies DSN request
# DHParameters (only required if DSA/DH is used)
[jsmith@rhel-serv1-prod ~]$
[jsmith@rhel-serv1-prod ~]$ mailx -v john.smith@mycompany.com
Subject: test-non-root
.
Cc:
Null message body; hope that's ok
john.smith@mycompany.com... Connecting to [127.0.0.1] via relay...
220 rhel-serv1-prod.pedro.com ESMTP Sendmail 8.13.8/8.13.8; Mon, 13 Apr 2020 15:45:52 -0700
>>> EHLO rhel-serv1-prod.pedro.com
250-rhel-serv1-prod.pedro.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<user@rhel-serv1-prod.mycompany.com> SIZE=58
250 2.1.0 <user@rhel-serv1-prod.mycompany.com>... Sender ok
>>> RCPT To:<user.name@mycompany.com>
>>> DATA
250 2.1.5 <user.name@mycompany.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 03DMjqn5028836 Message accepted for delivery
john.smith@mycompany.com... Sent (03DMjqn5028836 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 rhel-serv1-prod.mycompany.com closing connection
[user@rhel-serv1-prod ~]$
[user@rhel-serv1-prod ~]$ mailq
/var/spool/mqueue is empty
                Total requests: 0
[user@rhel-serv1-prod ~]$
[user@rhel-serv1-prod ~]$ ls -l /usr/sbin/sendmail.sendmail
-rwxr-sr-x 1 root smmsp 775064 Jul 28  2011 /usr/sbin/sendmail.sendmail
[user@rhel-serv1-prod ~]$

If I check /var/log/maillog, it is not giving me any clue. In below output, first part is, when I send with non-root and second part with root
Code:
Apr 13 16:46:26 rhel-serv1-prod sendmail[3341]: 03DNkPou003341: from=jsmith, size=58, class=0, nrcpts=1, msgid=<202004132346.03DNkPou003341@rhel-serv1-prod.pedro.com>, relay=jsmith@localhost
Apr 13 16:46:26 rhel-serv1-prod sendmail[3355]: 03DNkQ2n003355: from=<jsmith@rhel-serv1-prod.pedro.com>, size=399, class=0, nrcpts=1, msgid=<202004132346.03DNkPou003341@rhel-serv1-prod.pedro.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Apr 13 16:46:26 rhel-serv1-prod sendmail[3341]: 03DNkPou003341: to=john.smith@mycompany.com, ctladdr=jsmith (30421/30421), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30058, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (03DNkQ2n003355 Message accepted for delivery)
Apr 13 16:46:26 rhel-serv1-prod sendmail[3357]: 03DNkQ2n003355: to=<john.smith@mycompany.com>, ctladdr=<jsmith@rhel-serv1-prod.pedro.com> (30421/30421), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=120399, relay=wksb-mail1-prod.pedro.com [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 6D48DEB58)
-----------------------------------------
Apr 13 16:46:44 rhel-serv1-prod sendmail[3537]: 03DNkiu6003537: from=root, size=54, class=0, nrcpts=1, msgid=<202004132346.03DNkiu6003537@rhel-serv1-prod.pedro.com>, relay=root@localhost
Apr 13 16:46:44 rhel-serv1-prod sendmail[3538]: 03DNkiZV003538: from=<root@rhel-serv1-prod.pedro.com>, size=381, class=0, nrcpts=1, msgid=<202004132346.03DNkiu6003537@rhel-serv1-prod.pedro.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Apr 13 16:46:45 rhel-serv1-prod sendmail[3537]: 03DNkiu6003537: to=john.smith@mycompany.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30054, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (03DNkiZV003538 Message accepted for delivery)
Apr 13 16:46:45 rhel-serv1-prod sendmail[3540]: 03DNkiZV003538: to=<john.smith@mycompany.com>, ctladdr=<root@rhel-serv1-prod.pedro.com> (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=120381, relay=wksb-mail1-prod.pedro.com [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 20DCEEC48)

Please advise, what I am missing.

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Can you gain root privileges if the suid program does not belong to root?

I had a question in my test which asked where suppose user B has a program with 's' bit set. Can user A run this program and gain root privileges in any way? I suppose not as the suid program run with privileges of owner and this program will run with B's privileges and not root. (1 Reply)
Discussion started by: syncmaster
1 Replies

2. UNIX for Dummies Questions & Answers

Exim root email

Hello I have configured LFD alerts/Login failure alerts to be sent to "root" However I'm unable to find/change root email. I'm using exim and i dont want to use postfix. Therefore /etc/aliases will not work because newaliases command will not work I tried creating a .forward file still... (0 Replies)
Discussion started by: johnchristy
0 Replies

3. Shell Programming and Scripting

How to give root access to non root user?

Currently in my system Red Hat is installed. And Many user connect to my machine via SSH Techia Terminal. I want to give some users a root level access. Can anyone please help me how to make it possible. I too searched on the Google but didn't find the correct way Regards ADI (4 Replies)
Discussion started by: adisky123
4 Replies

4. UNIX for Advanced & Expert Users

Root and non-root user not able to delete the file

Hi!! one strange problem occurred with my RHEL 5 box. i'm having logs folder with ownership of non-root user. Created some files with root user under logs folder. here is the scene: -rw-r----- 1 root root 1048227 Feb 28 12:34 SystemOut_13.02.28_12.34.10.log -rw-r----- 1 root root ... (6 Replies)
Discussion started by: sukhdip
6 Replies

5. Solaris

Migration of system having UFS root FS with zones root to ZFS root FS

Hi All After downloading ZFS documentation from oracle site, I am able to successfully migrate UFS root FS without zones to ZFS root FS. But in case of UFS root file system with zones , I am successfully able to migrate global zone to zfs root file system but zone are still in UFS root file... (2 Replies)
Discussion started by: sb200
2 Replies

6. UNIX for Dummies Questions & Answers

Sudo to delegate permission from non-root user to another non-root user

I've been through many threads before i decide to create a separate thread. I can't really find the solution to my (simple) problem. Here's what I'm trying to achieve: As "canar" user I want to run a command, let's say "/opt/ocaml/bin/ocaml" as "duck" user. The only to achieve this is to... (1 Reply)
Discussion started by: canar
1 Replies

7. Shell Programming and Scripting

Need to run a bash script that logs on as a non-root user and runs script as root

So I have a script that runs as a non-root user, lets say the username is 'xymon' . This script needs to log on to a remote system as a non-root user also and call up a bash script that runs another bash script as root. in short: user xymon on system A needs to run a file as root user and have... (2 Replies)
Discussion started by: damang111
2 Replies

8. UNIX for Dummies Questions & Answers

How to allow access to some commands having root privleges to be run bu non root user

hi i am new to unix and i have abig task. i have to \run particular commands having root privileges from a non root user. i know sudo is one of the way but i need sum other approach kindly help Thanks (5 Replies)
Discussion started by: suryashikha
5 Replies

9. AIX

Cannot send mail to root@localhost but can externally

hello, I need to configure our AIX 5.3 to relay mail to exchange. I have got this working with no issues yet, I can not send mail to root@localhost. # uname -a AIX Blade1 3 5 0000E6DAD400 # oslevel -s 5300-07-01-0748 # mailq /var/spool/mqueue (2 requests)... (14 Replies)
Discussion started by: pobman
14 Replies

10. UNIX for Dummies Questions & Answers

Run non-root script as root with non-root environment

All, I want to run a non-root script as the root user with non-root environment variables with crontab. The non-root user would have environment variables for database access such as Oracle or Sybase. The root user does not have the Oracle or Sybase enviroment variables. I thought you could do... (2 Replies)
Discussion started by: bubba112557
2 Replies
Login or Register to Ask a Question