Rewriting Sender addresses for Entire Domain in Sendmail
Sun, 06/28/2009 - 23:13 — sandip- Edit /etc/mail/sendmail.mc and add the below lines replacing domain.tld with the actual domain name:
dnl # BEGIN: Rewriting Sender addresses for Entire Domain
dnl #
dnl # Process login names through the genericstable
FEATURE(`genericstable', `hash -o /etc/mail/genericstable.db 9;)dnl
dnl # Interpret the value in G as a domain name
FEATURE(generics_entire_domain)dnl
dnl # masquerade not just the headers, but the envelope as well
FEATURE(masquerade_envelope)dnl
dnl # Load domain.tld into G
GENERICS_DOMAIN(domain.tld)dnl
dnl #
dnl # END: Rewriting Sender addresses for Entire Domain - Create /etc/mail/genericstable, which is very similar to an /etc/aliases, two columns separated by whitespace:
web1_user1 user1@domain.tld
web1_user2user2@domain.tld
web1_user3user3@domain.tld - Create the db:
# makemap -hash /etc/mail/genericstable < /etc/mail/genericstable
- Restart sendmail.
Feature "genericstable" tells sendmail to use the generics table.
Feature "generics_entire_domain" allows to add hosts to genericstable without having to rebuild sendmail.cf.
Feature "masquerade_envelope" applies the rewriting process to the mail envelope as well as to the mail header.
"GENERICS_DOMAIN" defines the domains to which you wish to apply the generics table.
- sandip's blog
- Login or register to post comments
- Read more