Operating System - HP-UX
1832622 Members
2425 Online
110043 Solutions
New Discussion

How to stop sendmail from reading comment field of /etc/passwd

 
Geoff Wild
Honored Contributor

How to stop sendmail from reading comment field of /etc/passwd

In other words, rewrite the header envelope..

IE, I have a role account with the following in the comment field of /etc/passwd:

roleadm - John Smith

When email is sent out, it shows up as mail from:

roleadm - John Smith

reply to address is:
roleadm@mydomain.com

Joe doesn't like that - he wants it to be:

HisApplication EDI

I've been playing in the genericstable....but no luck so far.

I'm using /usr/newconfig/etc/mail/cf/cf/gen_cf to generate sendmail.cf file.

And no, I won't change the passwd file - as it is needed by SOX.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: How to stop sendmail from reading comment field of /etc/passwd

Shalom,


Ideas:
1)Change authentication to use ADS on a windows box, then sendmail might ignore the contents of /etc/passwd. NIS or LDAP might acheive the same effect.
2) Compile and use a client like squirrelmail which overrides the /etc/passwd contents.
3) Use DS directive and relay though a Linux or HP-UX box with a doctored /etc/passwd file.

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
James R. Ferguson
Acclaimed Contributor

Re: How to stop sendmail from reading comment field of /etc/passwd

Hi Geoff:

Perhaps this helps:

http://docs.hp.com/en/5991-6611/ch02s03.html#cciecbcb

Regards!

...JRF...
Geoff Wild
Honored Contributor

Re: How to stop sendmail from reading comment field of /etc/passwd

Has to be a way...

From

http://www.unet.univie.ac.at/aix/files/aixfiles/sendmail.cf.htm

"The $x macro is set to the full name of the sender. This can be determined in several ways. It can be passed as flag to sendmail. It can be defined in the NAME environment variable. The third choice is the value of the "Full-Name:" line in the header if it exists, and the fourth choice is the comment field of a "From:" line. If all of these fail, and if the message is being originated locally, the full name is looked up in the /etc/passwd file."

I've tried the $NAME - but no luck...

Rgds...Geofff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Geoff Wild
Honored Contributor

Re: How to stop sendmail from reading comment field of /etc/passwd

James - not quite....the userdb just re-writes the userid - not the Full Name...

So I get email from:

Roleadm - John Smith [HisApplication_EDI@mydomain.com]

It's still picking up from the /etc/passwd comment...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Steven E. Protter
Exalted Contributor

Re: How to stop sendmail from reading comment field of /etc/passwd

Shalom,

Are you saying there is nothing in http://www.sendmail.org that helps.

Long shots:
http://www.sendmail.org/ftp/past-releases/sendmail.8.9.2.patch
Comment:
It Fl o Don't display the name of the mailer in the output.

http://www.sendmail.org/~ca/email/sm-X/design-2005-05-05/main.pdf.gz

Notes: This is going to be a PITA and you've kind of been painted into a corner. I don't know how to do it and don't expect any points for this. I will say that nearly anything is possible and the answer is probably buried somewhere in sendmail.org

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
Patrick Wallek
Honored Contributor

Re: How to stop sendmail from reading comment field of /etc/passwd

Geoff,

Have a look here:

http://www.unix.org.ua/orelly/networking/sendmail/ch30_08.htm

and then search for the string "30.8.43 F=w" and also "31.10.42 $x".

You may get some good ideas from those.

I hope this helps.

Patrick
Geoff Wild
Honored Contributor

Re: How to stop sendmail from reading comment field of /etc/passwd

Patrick - well, that helped me with a workaround...

Note that unusual gecos fields in the password file can cause pre-V8 mail to fail. Consider the following passwd(5) entry:


happy:123:456:Happy Guy ;-),Ext 789,,:/u/happy:/bin/sh

The gecos field here will be parsed by all but V8 sendmail into a value for $x that can yield a faulty header - one with unbalanced parentheses:


From: happy@our.domain (Happy Guy ;-))


So, I changes the gecos field from:

Roleadm - John Smith

to:

Roleadm , John Smith


Thanks...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Heironimus
Honored Contributor

Re: How to stop sendmail from reading comment field of /etc/passwd

Is it just the From: line he's worried about? That generally comes from the MUA, not the MTA. You probably can do it within sendmail (you can do anything in sendmail), but it's probably going to be a little difficult. Depending on how the mail is being generated it might be a lot easier to change what the message looks like before it even gets to sendmail.