From: Andrzej Adam Filip on
Moby <moby(a)mobsternet.com> wrote:
> I have a weird requirement. Say I am the backup MX for a domain. If I
> get email from any machine for domain A, I want to deliver it as per my
> virtusertable rules (this part is working - I add the appropriate
> entires in my virtusertable and also add the domain name to my
> local-host-names). However, if people on specific hosts using my mail
> server send email to the domain, I want it sent out, as per MX lookup
> rules etc (assuming primary MX is up and running). How can I do this?
>
> The crux of the matter appear to be:
> 1) In order to be able to accept mail for the domain, I have to add it
> to my local-host-names.
> 2) Once added to my local-host-names, my server always accepts mail for
> the domain and does not do an MX lookup.
>
> I need to be able to have my sendmail server accept mail for the domain
> locally ~except~ when the mail originates from certain specific machines
> - can this be done with sendmail?
>
> Thanks in advance for any help.

It can be done be writing a few custom R lines.
You can insert then in right place in sendmail.cf using LOCAL_RULE_0

--
[pl>en Andrew] Andrzej Adam Filip : anfi(a)onet.eu : Andrzej.Filip(a)gmail.com
Open-Sendmail: http://open-sendmail.sourceforge.net/
Tomorrow's computers some time next month.
-- DEC
From: Moby on
On 02/18/2010 10:39 AM, Andrzej Adam Filip wrote:
> Moby <moby(a)mobsternet.com> wrote:
>> I have a weird requirement. Say I am the backup MX for a domain. If I
>> get email from any machine for domain A, I want to deliver it as per my
>> virtusertable rules (this part is working - I add the appropriate
>> entires in my virtusertable and also add the domain name to my
>> local-host-names). However, if people on specific hosts using my mail
>> server send email to the domain, I want it sent out, as per MX lookup
>> rules etc (assuming primary MX is up and running). How can I do this?
>>
>> The crux of the matter appear to be:
>> 1) In order to be able to accept mail for the domain, I have to add it
>> to my local-host-names.
>> 2) Once added to my local-host-names, my server always accepts mail for
>> the domain and does not do an MX lookup.
>>
>> I need to be able to have my sendmail server accept mail for the domain
>> locally ~except~ when the mail originates from certain specific machines
>> - can this be done with sendmail?
>>
>> Thanks in advance for any help.
>
> It can be done be writing a few custom R lines.
> You can insert then in right place in sendmail.cf using LOCAL_RULE_0
>
I was sure custom R lines could accomplish this, but I rather dread
trying to cook up custom R lines for sendmail, hence my leaning towards
firing up a second instance of sendmail and using the much much
friendlier mailertable etc configuration route. I did get a hold of the
Sendmail Cookbook, so I might decide to torture myself and try to come
up with custom R lines to accomplish what I need.

Thanks.
From: Andrzej Adam Filip on
Moby <moby(a)mobsternet.com> wrote:
> On 02/18/2010 10:39 AM, Andrzej Adam Filip wrote:
>> Moby <moby(a)mobsternet.com> wrote:
>>> I have a weird requirement. Say I am the backup MX for a domain. If I
>>> get email from any machine for domain A, I want to deliver it as per my
>>> virtusertable rules (this part is working - I add the appropriate
>>> entires in my virtusertable and also add the domain name to my
>>> local-host-names). However, if people on specific hosts using my mail
>>> server send email to the domain, I want it sent out, as per MX lookup
>>> rules etc (assuming primary MX is up and running). How can I do this?
>>>
>>> The crux of the matter appear to be:
>>> 1) In order to be able to accept mail for the domain, I have to add it
>>> to my local-host-names.
>>> 2) Once added to my local-host-names, my server always accepts mail for
>>> the domain and does not do an MX lookup.
>>>
>>> I need to be able to have my sendmail server accept mail for the domain
>>> locally ~except~ when the mail originates from certain specific machines
>>> - can this be done with sendmail?
>>>
>>> Thanks in advance for any help.
>>
>> It can be done be writing a few custom R lines.
>> You can insert then in right place in sendmail.cf using LOCAL_RULE_0
>>
> I was sure custom R lines could accomplish this, but I rather dread
> trying to cook up custom R lines for sendmail, hence my leaning towards
> firing up a second instance of sendmail and using the much much
> friendlier mailertable etc configuration route. I did get a hold of the
> Sendmail Cookbook, so I might decide to torture myself and try to come
> up with custom R lines to accomplish what I need.
>
> Thanks.

Take a look at FEATURE(`anfi/smarttable') at
http://open-sendmail.sourceforge.net/

You can "twist it" to your needs by:
a) using LOCAL_RULE_0 instead of LOCAL_NET_CONFIG
b) using &{client_addr} instead of &$f

--
[pl>en Andrew] Andrzej Adam Filip : anfi(a)onet.eu : Andrzej.Filip(a)gmail.com
If a camel is a horse designed by a committee,
then a consensus forecast is a camel's behind.
-- Edgar R. Fiedler
From: Moby on
>>>
>>> It can be done be writing a few custom R lines.
>>> You can insert then in right place in sendmail.cf using LOCAL_RULE_0
>>>
>> I was sure custom R lines could accomplish this, but I rather dread
>> trying to cook up custom R lines for sendmail, hence my leaning towards
>> firing up a second instance of sendmail and using the much much
>> friendlier mailertable etc configuration route. I did get a hold of the
>> Sendmail Cookbook, so I might decide to torture myself and try to come
>> up with custom R lines to accomplish what I need.
>>
>> Thanks.
>
> Take a look at FEATURE(`anfi/smarttable') at
> http://open-sendmail.sourceforge.net/
>
> You can "twist it" to your needs by:
> a) using LOCAL_RULE_0 instead of LOCAL_NET_CONFIG
> b) using &{client_addr} instead of &$f
>

Thanks - I shall do that.