Operating System - HP-UX
1753877 Members
7674 Online
108809 Solutions
New Discussion юеВ

trying to setup an alias ???

 
SOLVED
Go to solution
RobertCarback
Frequent Advisor

trying to setup an alias ???

I have a unix user -- fname
Would like to have the user look like -- first.name@company.com -- 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?
3 REPLIES 3
Heironimus
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 sendmail.cf (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.
Sameer_Nirmal
Honored Contributor
Solution

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 sendmail.cf using
O UserDatabaseSpec=/etc/mail/userdb.db

create a /etc/mail/userdb file as

david:mailname david.xyz@abc.com
david.xyz:maildrop david

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

Then test it by sending an email.





RobertCarback
Frequent Advisor

Re: trying to setup an alias ???

Sameer -- thanks. this worked