Operating System - HP-UX
1852196 Members
3706 Online
104064 Solutions
New Discussion

Re: Sendmail changing domains

 
Andy McDade
Advisor

Sendmail changing domains

I have, due to a complicated firewall setup, and bit of a problem with sendmail.
In order to send mail through the firewalls, the clients send mail to a relay1, which sends the mail to another relay2 (exchange server), which then delivers it.
This works fine, but users have to use a slightly different format to the addresses:
instead of username@domain.co.uk, which is their actuaul address, they have to use "username@gateway.domain.co.uk".

What I want to do is have relay1 turn any address which ends "@domain.co.uk" into "@gateway.domain.co.uk" for relaying onto relay2, so relay2 does not reject it.

I've been looking at "mailertable" and "domaintable" without success so far.
Can anyone suggest how I might do this?
Thanks
6 REPLIES 6
Cem Tugrul
Esteemed Contributor

Re: Sendmail changing domains

Andy McDade
Advisor

Re: Sendmail changing domains

Thanks for that, but I have already looked at a great many threads on the ITRC, as I hinted at in my first post, but to no avail.
It seems no-one else has quite the same issues.

I don't have any problems sending mail, I just want mails to "user@domain.co.uk" tro actually go to "user@gateway.domain.co.uk", and have that work done by the HP-UX relay1.
Andy McDade
Advisor

Re: Sendmail changing domains

Got it now, sorry to waste anyones time.
I used domaintable in the end, but I was not uncommenting the rule in sendmail.cf
Steven E. Protter
Exalted Contributor

Re: Sendmail changing domains

A few resources:
http://www.sendmail.org
http://www.hpux.ws

I post hpux.ws

There is an HP-UX adaptation of a sendmail macro process there.

Its a script that takes a sendmail.mc macro and turns it into a sendmail.cf file. This negates the need to manually edit the sendmail.cf file.

sendmail.org is a great place to learn the product.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bejoy C Alias
Respected Contributor

Re: Sendmail changing domains

Just have a try using genericstable ..
Be Always Joy ......
Uday_S_Ankolekar
Honored Contributor

Re: Sendmail changing domains

I think you should configure domaintable for this to work.
Here is the tips from Knowledge Base:

The domaintable is a feature that allows you to use multiple domain names when for example transitioning from an old domain to a new one. The domaintable enables such transitions to operate smoothly by rewriting the old domain to the new.

1. Create the file /etc/mail/domaintable. Examples for the syntax in this file:

old.domain new.domain
other.domain local.host.domain

In it the left side of each line has one of possibly many fully qualified hostnames, and the right side has either your new domain name or one of your local hostnames.

2. Build the /etc/mail/domaintable.db file with the makemap routine:

makemap hash /etc/mail/domaintable.db < /etc/mail/domaintable

3. Make the following changes in /etc/mail/sendmail.cf:

old: #Kdomaintable dbm /etc/mail/domaintable
new: Kdomaintable hash -o /etc/mail/domaintable

Search for this string:

# look up domains in the domain table

Remove the hash in front of this line:

# R$* < @ $+ > $* $: $1 < @ $(domaintable $2 $) > $3

4. Restart sendmail

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start
Good Luck..