Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 

trying to setup an alias ???

Go to solution
Frequent Advisor

trying to setup an alias ???

I have a unix user -- fname
Would like to have the user look like -- -- when emails are received from him.

I've tried setting this up in /etc/mail/aliases but I can't get the user name to look any way but 'fname'. What is the syntax I should be using in /etc/mail/aliases?
Honored Contributor

Re: trying to setup an alias ???

aliases is the wrong file for that. For outbound mail you'd need to set up address rewriting, which is a bit more complex. As I recall, the general process is to set up genericstable, do a makemap on it, enable it in (if it's not already there), and restart sendmail. There's a lot of documentation out on the web, this should give you enough of a starting point to find it without too much trouble.
Honored Contributor

Re: trying to setup an alias ???

With /etc/mail/aliases file, you can't rewrite "From" address. You need to make use of User Database (USERDB) functionality of the sendmail.

This funcationality needs to be there inbuilt in sendmail. Check using

# /usr/sbin/sendmail -d0.1 -bt < /dev/null

It can be enabled in using
O UserDatabaseSpec=/etc/mail/userdb.db

create a /etc/mail/userdb file as

david:mailname david

Create user DB using
# cd /etc/mail
# makemap btree ./userdb.db < ./userdb

Then test it by sending an email.

Frequent Advisor

Re: trying to setup an alias ???

Sameer -- thanks. this worked