Operating System - HP-UX
1833744 Members
2676 Online
110063 Solutions
New Discussion

Sendmail not populating from: header as current logged-on user after an SU

 
David Hartman
New Member

Sendmail not populating from: header as current logged-on user after an SU

I have a 10.20 box running 8.9.3 sendmail which is working fine, except when users (or jobs) SU to root & send mail. The sendmail daemon seems to populate the From: header in the SMTP message with the original user, not the current user (in this case root) as seem in the mail.log file with verbose enable. I have tried comparing the configuration to another box (running 11.11) but came up empty. I thought perhaps it could be a YP issue, but could not find anything conclusive.

Any help would be greatly appreciated!
4 REPLIES 4
Vijaya Kumar_3
Respected Contributor

Re: Sendmail not populating from: header as current logged-on user after an SU

I always doubts permissions if root can able to do something but not users.... if you post your sendmail verbose mode output would be a great help in identifying the peoblem...

sendmail -v -d8.99 -d38.99 someuser@mydomain.com

post the output

-Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
Steven E. Protter
Exalted Contributor

Re: Sendmail not populating from: header as current logged-on user after an SU

su username or
su - username

The latter gets the target users environment.

Note this:

whoami
who am i

These two commands will show different results if you are su - user

Try this diagnostic, it might get you a bit of data.

sendmail -v -8.99 -d38.99 someone@some.net
type some text

.


You'll see how sendmail builds the mail. Then you decide how to make things work the way you want.

Also note:

/etc/mail/virtusertable
/etc/mail/genericstable

These two files can set up inbound and outbound mail lookup to hanldle issues such as multiple mail domains on the same server.


Entries in these two files could get the smtp names to start building the way you want.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Michael Steele_2
Honored Contributor

Re: Sendmail not populating from: header as current logged-on user after an SU

Are you logging into the server with anything other than telnet or rlogin? SSH?

When was the last time you cleared out /etc/utmp and /etc/wtmp? Test for corruption with 'last'

# last root

To clear out corruption:

# /dev/null > /etc/wtmp
# /dev/null > /etc/utmp
Support Fatherhood - Stop Family Law
Kasper Haitsma
Trusted Contributor

Re: Sendmail not populating from: header as current logged-on user after an SU

Hi,

This has to do with the login uid.
If you want the sending to be really perfomred by root, you should consider to perform an
exec login
see
man login
for details. This way, your original login uid will be replaced by root's login uid. The drawback is, that you completely lose the session you were in.

Something to think about too, is there are exceptions in sendmail.cf for masquerading when sending from root.

HTH

Kasper Haitsma
HP support engineer for sendmail
It depends