Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sendmail change sender

Status
Not open for further replies.

scrsadmin

Technical User
May 3, 2004
62
US
I'm new to unix and need a way where i can change not only the domain name but also the user name mail is coming from.
For example i have a user of user1 and when i send mail logged on as user1 it says it came from user1@domain1.com
I have figured out how to change the domain1.com to someother.com by using masquerade but i am still seeing user1@someother.com. I want to be able to also change it so that when user1 sends mail it appears as if it is other@someother.com.
This is HPUX 11i



 
what is your mail server? sendmail? postfix? another one?

Chacal, Inc.[wavey]
 
I suppose you use sendmail, so you need to setup a user database:
- in /etc/mail create a file called userdb
- entries in userdb have the following form (for root):
root:mailname user_name
- execute the following command:
makemap btree /etc/mail/userdb.db < /etc/mail/userdb
- uncomment the following line in /etc/mail/sendmail.cf:
O UserDatabaseSpec=/etc/mail/userdb.db
- restart sendmail:
/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

Hope that helps.
 
Thanks swolf. That worked for the email address but i am also trying to remove the display name. For example when i send the mail user1@domain1.com it now come back with other@someother.com as i wanted but it also has a display name in front like this: host1 user1 other@someother.com. How do i get ride of the host1 and user1 part?

Thanks again

Yes we are using sendmail :)
 
Hi,
i advise you to have a look into the sendmail bible (O'Reilly "Sendmail").
I never did what you want to do, so i start guessing: you might have to experiment with the F=i flag in the delivery agent to have the sender-envelope rewritten, and with the F=k flag to have the recipient headers rewritten.
What i forgot: when you have a user:mailname entry in your userdb for outgoing mails, you, of course, need a matching user:maildrop entry for incoming mails. They should always occur in pairs like
root:maildrop sysadmin@somwhere.com
syadmin:mailname root
But be aware:
"The UserDatabaseSpec option is not safe. If specified from the command line, it may cause sendmail to relinquish its root privilege" as the sendmail bible says.
Good luck,
swolf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top