July 24, 2014, 02:40:32 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Sendmail - Masquerading multiple domains with different addresses  (Read 966 times)

Offline rohit_4739

  • New Member
  • Posts: 2
Hello Friends,

I am running Sendmail 8.14 on rhel6. I have one simple question regarding domain masquerading, i would want to masquerade different domains with different addresses. By that what i mean is that lets say i have 3 domains as home.com, example.com, test.com and i would want to masquerade these as under

home.com > (123.com - just fictitious)
example.com > (456.com)
test.com > (789.com)

So how can i achieve this functionality, because by default MASQUERADE_AS(`key_value') directive will masquerade all the domains with the value specified.

I was reading an post on it and was working my way through it, however i am facing a small issue in generating the genericstable.db file using makemap. This is the error i get

Code: [Select]
#makemap dbm genericstable < genericstable
makemap: Need to recompile with -DNDBM for dbm support


How ever it is working fine when i use hash db with makemap. I have installed the db4-utils as well as db4-devel package and other related packages. So my first question here is why makemap is not working with dbm but with hash ?
So can anyone please answer that.

Since "dbm" format is not working so i used "hash" and I am able to generate the genericstable.db file but the domain masquerading is still not working as desired.  What i am trying to achieve is that box.example.com should masquerade to 123.home.com and host1.example.com should masquerade to 456.home.com as under.
Code: [Select]
box.example.com > 123.home.com
host1.example.com > 456.home.com
Here are the various config files:

Code: [Select]

sendmail.mc

DOMAIN(generic)dnl
define(`confLOG_LEVEL',`10')dnl
define(`confMAX_MESSAGE_SIZE',`4096')dnl
define(`confMAX_RCPTS_PER_MESSAGE',`2')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`masquerade_entire_domain')dnl
MASQUERADE_AS(`home.com')dnl
MASQUERADE_DOMAIN(`box.example.com')dnl
FEATURE(`genericstable', `hash /etc/mail/genericstable')dnl
GENERICS_DOMAIN_FILE(`/etc/mail/genericstable')dnl
FEATURE(`access_db', `hash -o -T<TMPF> /etc/mail/access')dnl
MAILER(local)dnl
MAILER(smtp)dnl

Code: [Select]
genericstable file

box.example.com 123.home.com
host1.example.com 456.home.com

So could you please let me know what i need to do here to make things work.