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.

[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

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

Take a look in your '/etc/aliases' and '/etc/mail/virtusertable' configurations and see if you have a rule that includes error:nouser. If you do, comment/remove it and re-test. Good luck!

3 Likes

This topic was automatically closed 59 days after the last reply. New replies are no longer allowed.