OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: How to override an MX value for a particular domain only?

From: Daniel L'Hommedieu (dlhommedieugmail.com)
Date: Thu Nov 05 2009 - 14:58:59 CST


On Nov 5, 2009, at 15:52, Eric B. wrote:
> "Eric B." <ebenzehotmail.com> wrote in message
> news:hcupsk$b8a$3ger.gmane.org...
>> "Victor Duchovni" <Victor.Duchovnimorganstanley.com> wrote in
>> message
>> news:20091104232940.GI27037np305c2n2.ms.com...
>>> On Wed, Nov 04, 2009 at 06:16:56PM -0500, Eric B. wrote:
>>>
>>>> Is there no way to direct Postfix to a different DNS server (as
>>>> opposed
>>>> to
>>>> the ones specified in resolve.conf) either for a particular
>>>> domain, or
>>>> for
>>>> all domains altogether?
>>>
>>> If you chroot-jail the smtp(8) delivery agent, it will use the
>>> resolv.conf
>>> file in the chroot jail. This is ugly, you are probably solving the
>>> wrong problem.
>>
>> Interesting thought. I agree that this is somewhat ugly, but might
>> be
>> something worth investigating...
>
> Ok - now I am very confused. I tried setting up Postfix in a chroot
> jail,
> and specified a different set of nameservers in
> /var/spool/postfix/etc/resolv.conf. However, it seems as though
> Postfix
> continues to use the name servers specified in /etc/resolv.conf and
> not the
> ones in the chroot jail.
>
> I have gone so far as to create an empty /var/spool/.../resolv.conf
> with no
> nameservers specified, and yet postfix is still able to deliver the
> email
> (to the wrong server). I would have expected that leaving the
> nameservers
> blank would have caused Postfix to choke, and yet it still connects.
>
> I definitley have chroot set to Y in my master.cf file, and have
> done a
> postfix restart. I do get a warning on restart that
> postfix/postfix-script: warning: /var/spool/postfix/etc/resolv.conf
> and
> /etc/resolv.conf differ
>
> Or does the fact that they differ cause the chroot to fail, and the
> process
> ends up running in regular mode instead?
>
> I have gone as far as deleting the /var/spool/postfix/lib and lib64
> directories, and postfix still starts without any error messages.
> And when
> I try to mail something, it still manages to send the mail. So that
> gives
> me confirmation that the chroot isn't working properly.
>
> Apart from setting chroot to y in master.cf, is there anything else
> I have
> to do to enable it properly?
>
> Thanks,

Eric,

Getting back to your original goal, my understanding is that the
original goal is to override the DNS "A" record for a single host,
yes? If so, that is a perfect use for /etc/hosts. Give that method a
try.

Daniel