Operating System - HP-UX
1837984 Members
2825 Online
110124 Solutions
New Discussion

sendmail : modify "From:" field

 
SOLVED
Go to solution
j773303
Super Advisor

sendmail : modify "From:" field

/etc/hosts
10.1.12.1 hostA.123.com

When I use root to sendmail, "From:" filld would display "root@hostA.123.com" in the outlook express. I want ot "From:" only shows "root". Is it possible to do that in sendmail 8.9.3 ? Thanks.
Hero
11 REPLIES 11
j773303
Super Advisor

Re: sendmail : modify "From:" field

Does anyone has the experience about how to let "FROM:" doesn't include "@hostname.domain"

Thanks in advanced.
Hero
Geoff Wild
Honored Contributor
Solution

Re: sendmail : modify "From:" field

Try this in /etc/mail/sendmail.cf


###################################################################
### Ruleset 93 -- convert header names to masqueraded form ###
###################################################################

S93

Rroot < @ $* > $* root.$w < @ $1 > $2 Special case for root


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.
Chan 007
Honored Contributor

Re: sendmail : modify "From:" field

Hi Just try Dj parameter in your sendmail.cf

Steven E. Protter
Exalted Contributor

Re: sendmail : modify "From:" field

Shalom,

1) The sendmail should be updated.
2) So long as the domain name desired is under 8 characters, you can change the system hostname to get the same results as the Dj directive host becomes host.your.net

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
Geoff Wild
Honored Contributor

Re: sendmail : modify "From:" field

Actually, what I gave you displays:

root.hostname@yourdomain.com

as long as the DM maacro is set...

# who I masquerade as (null for no masquerading) (see also $=M)
DMyourdomain.com

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.
j773303
Super Advisor

Re: sendmail : modify "From:" field

Rroot < @ $* > $* root.$w < @ $1 > $2 Special case for root

I can't set above line in the sendmail.cf due to the start sendmail daemon would got error message. Can you give a sample file "sendmail.cf" including above line for me testing. Thanks.
Hero
j773303
Super Advisor

Re: sendmail : modify "From:" field

Error msg as below:

/# /sbin/init.d/sendmail start
/etc/mail/sendmail.cf: line 1642: invalid rewrite line "Rroot < @ * > * root.w < @ 1 > 2" (tab expected)
554 /etc/mail/sendmail.cf: line 1642: invalid rewrite line "Rroot < @ * > * root.w < @ 1 > 2" (tab expected)
Hero
Geoff Wild
Honored Contributor

Re: sendmail : modify "From:" field

Yes - you need tabs...I'll attach that section.

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.
j773303
Super Advisor

Re: sendmail : modify "From:" field

Thanks. sendmail.cf is ok to start.

But I don't want to
"root.hostname@yourdomain.com" in the mail "From:" , I just whan "From:" shows "root" . Is it posslbe to do that ?
Thanks in advanced.
Hero
Geoff Wild
Honored Contributor

Re: sendmail : modify "From:" field

Sure - drop the .W$:

root < @ $1 > $2


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.
j773303
Super Advisor

Re: sendmail : modify "From:" field

Rroot < @ $* > $* root < @ $1 > $2 Special case for root

After changed to above, in the mail "FROM:" still show "root@hostanem.domain"

Could you check the format when I configure wrong ?

Is it possible only shows the username, such as "root", "user1", "user2" and so on. Thanks in advanced.
Hero