Friday, October 2, 2009

Episode 3: Using Sendmail to Change the Sender's Email Address

1) Add these statements to your /etc/mail/ file to activate the feature:

FEATURE(`genericstable',`hash -o /etc/mail/genericstable.db')dnl

2) Create a /etc/mail/generics-domains file that is just a list of all the domains that should be inspected. Make sure the file includes your server's canonical domain name, which you can obtain using the command:

[root@Innova ~]# sendmail -bt -d0.1
> You have new mail in /var/spool/mail/root
[root@Innova ~]#

Here is a sample /etc/mail/generics-domains file:
[root@Innova ~]# cat /etc/mail/generics-domains

3) Create your /etc/mail/genericstable file. First sendmail searches the /etc/mail/generics-domains file for a list of domains to reverse map. It then looks at the /etc/mail/genericstable file for an individual email address from a matching domain. The format of the file is


Run m4 command followed by service restart for the sendmail to work.
This time if you send mail as:

[mailadmin ~]$ echo "hello" | mail -v -s "hello"

The Mail will arrive as: and not

No comments:

Post a Comment