Operating System - HP-UX
1827451 Members
4119 Online
109965 Solutions
New Discussion

How to rewrite the "From" address on outgoing mail

 
SOLVED
Go to solution
Enbin Hu
Advisor

How to rewrite the "From" address on outgoing mail

Hi All,

I am new to the HP and got a question here:

We have a client request to rewrite his 'from' address whenever his mail is sent from the server to the outside of the company. Since the server is inside the company firewall, the regular return address (e.g. bsmith@appserver.nj.foo.com, bsmith is his id on the UNIX server) can't be a reachable address when the recepient hit the reply button. So my question was: is there anyway I can change the sendmail configure file so when the "From" line become a reachable email address, something like bob.smith@foo.com?

I have HPUX 11.00 running on the server.

Thanks for all your help.

Enbin
6 REPLIES 6
Lasse Knudsen
Esteemed Contributor

Re: How to rewrite the "From" address on outgoing mail

Hi,

Use the 'DM' masquerade in /etc/mail/sendmail.cf - eg. DMfoo.com
In a world without fences - who needs Gates ?
Rick Garland
Honored Contributor

Re: How to rewrite the "From" address on outgoing mail

Use of the FEATURE(`mailertable') will accomplish this. However, unless you know how to modify the sendmail.cf file directly, recompile using the m4 preprocessor.

This is explained in full in the BAT book (the O'Reilly sendmail book)
CHRIS_ANORUO
Honored Contributor

Re: How to rewrite the "From" address on outgoing mail

In your sendmail.cf file, add the name of your NT server under DS(i.e. DSappserver).
Stop and start sendmail(/sbin/init.d/sendmail stop/start)
Test your configuration as follows:
sendmail -v bob.smith@foo.com.
Also check this previous thread - http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0xc35fc5ea0230d411ade80090279cd0f9,00.html

When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Rita C Workman
Honored Contributor
Solution

Re: How to rewrite the "From" address on outgoing mail

I had to do this since we send alot of reports via sendmail in our jobstreams.
I got the following from DocID:KBRC00001457.
We have sendmail 8
Uncomment the following line in /etc/mail/sendmail.cf file:
UserDatabaseSpec=/etc/mail/userdb.db

If not already done so uncomment the first rule in ruleset 94. (I didn't have to do this)
Now:
To rewrite the from lines on outgoing mail:
Create the file /etc/mail/userdb that contains two entries for each mail who will have outgoing mail on the system. (In my case all reports are made to one generic addr)
The entries should be in the following format example:
bkelley:mailname Bob_Kelley
Bob_Kelley:maildrop bkelley

build the /etc/mail/userdb.db file with the makemap routine:

#makemap btree /etc/mail/userdb.db < /etc/mail/userdb

It was quite easy...now we send our reports and if they need to send a msg back that there was a problem with the report it goes to the generic mail addr for operator/programmer or whoever to check it out...

Hope this helps ya !
Enbin Hu
Advisor

Re: How to rewrite the "From" address on outgoing mail

Hi,

I followed Rita's suggestion and it works now. Thank all for the help.

Enbin
Shannon Petry
Honored Contributor

Re: How to rewrite the "From" address on outgoing mail

A more simple way of doing what you did, was to make /etc/aliases look like you want.
mailname:UX-ID
bob.smith:bsmith
his.id:user1
her.id:user2
run /usr/sbin/newaliases.
edit the /etc/mail/sendmail.cf file, and look for the C macro. (search for class).
the default is CE which means expose the hosts true identity. If you change this to CM the the domain is masqueraded. As long as the users e-mail creation tool says his identity is bob.smith, it is good. If the users mail program shows his identity as bsmith@foo.com, it will go. If his ID is bob.smith@foo.com the alias is valid so this message will go too.
Microsoft. When do you want a virus today?