Operating System - HP-UX
1833451 Members
3179 Online
110052 Solutions
New Discussion

rewriting "from" line from mail header

 
SOLVED
Go to solution
Rasika Wije
Occasional Advisor

rewriting "from" line from mail header

Hi,
I need to change the "from" for e-mial sent using mailx/mail. Right now it shows a part from the 3rd field of passwrd file (comment field). I cannot change the password file as it is a company policy. The e-mail apprears as
field_from_passwd

I want the "field_form_passwrd" part removed. The rest is OK.
I tried putting userdb.db as suggested in an earlier post but it only changes the part.
3 REPLIES 3
Laurent Paumier
Trusted Contributor
Solution

Re: rewriting "from" line from mail header

You'll have to play with the rewriting rules... Find the line in your /etc/mail/sendmail.cf file that defines the From: header. It should be something like this :
H?F?From: $?x$x <$g>$|$g$.
Change it to this :
H?F?From: <$g>
Rita C Workman
Honored Contributor

Re: rewriting "from" line from mail header

There is an easy way to do this by simply creating a small database using the makemap command.
Take a look at this thread and it will explain it:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xaaf16c96588ad4118fef0090279cd0f9,00.html

Regards,
Rita
Rasika Wije
Occasional Advisor

Re: rewriting "from" line from mail header

Laurent:
Yes re-writing the rule did the trick. It no longer displays the info. from password file

Rita:
I had tried creating the userdb according to your earlier post. But I could only change the "login" part of the e-mail in
"password_file_info"

can we change the "passwd_file_info" part using the userdb??. If so I would like to do that since the above fix applies to all the e-mail and userdb fix can be applied at user level.
Thanks for both of you