PDA

View Full Version : [Solved] [sendmail] Masquerading


fonz
February 18th, 2009, 21:05
Howdy,

A quick sendmail question:
When usingdefine(`SMART_HOST', `smtp.my-isp.org')in sendmail.mc, how does one instruct sendmail to masquerade all outgoing mail from anyuser@localnonexistentdomain.com to remoteuser@my-isp.org?

Thanks in advance,

Alphons

DutchDaemon
February 18th, 2009, 22:26
See "MASQUERADING AND RELAYING" in /usr/src/contrib/sendmail/cf/README

fonz
February 18th, 2009, 22:57
See "MASQUERADING AND RELAYING" in /usr/src/contrib/sendmail/cf/README
That only discusses masquerading as a domain, which leads to localuser@localdomain being masqueraded as localuser@remotedomain. I need it to be remoteuser@remotedomain.

I've added the following to sendmail.mc:define(`SMART_HOST', `smtp.remotehost.nl')

FEATURE(local_no_masquerade)
FEATURE(masquerade_envelope)
FEATURE(genericstable,DATABASE_MAP_TYPE` -o 'MAIL_SETTINGS_DIR`genericstable')
GENERICS_DOMAIN(`localhost')
GENERICS_DOMAIN(`hostname.localdomain.nl')and /etc/mail/genericstable contains:@localhost remoteuser@remotedomain.nl
@hostname.localdomain.nl remoteuser@remotedomain.nl
but still no joy: outgoing mail is shown as localuser@hostname.localdomain.nl.

Alphons

DutchDaemon
February 18th, 2009, 23:40
You may try userdb. You will have to define every single local user for that to work, but I guess we're not talking hundreds here?

Example:
http://forums.serverbeach.com/archive/index.php/t-1438.html
http://cri.ch/linux/docs/sk0009.html

Or google for 'sendmail userdb'

fonz
February 19th, 2009, 01:31
You may try userdb. You will have to define every single local user for that to work, but I guess we're not talking hundreds here?Nah, only a few.

Anyway: according to this link (http://www.netfrag.org/cgi-bin/dwww/usr/share/doc/rmail/examples/db/userdb):# NOTE: Combined with virtusertable and/or aliases, Genericstable
# can do everything the userdb can and more (and the difference
# is growing bigger). The userdb is basically obsolete.Now, primo: I don't know how much of that is true. And secundo: as long as it works, what do I care?

Unfortunately, I couldn't get userdb to work either. However, I found this little HOWTO: http://www.lege.com/Sendmail+Dialup.v1.00-5.html. And guess what: it works now!

Anyway, thanks for the help!

Alphons

Edit: Note to add: I could write a little guide on this in the HOWTO forum, unless you guys think it's too trivial.