Looking for a rule to send user@domain.com via SMART_HOST

Looking for a rule to send user@domain.com via SMART_HOST

am 05.10.2007 10:05:27 von DieSpeedy

Hi everybody,

I am looking for a possibility to specify that a mail user@domain.com
should always be send via SMART_HOST.
(I can not use the mailer table, because other mails of domain.com
should be delivered locally as usual.)

But the problem is that sendmail expects that user@domain.com is a
local user. (I got: user unknown - thats correct)
But this special should never pick up his mail from my server. He
collects his mail always from an external provider, which also provide
mydomain.com (the same as I use internal).

Is there any possibility to tell sendmail not to deliver a specific
mail address locally???

Thx a lot for any hints...

DieSpeedy

Re: Looking for a rule to send user@domain.com via SMART_HOST

am 05.10.2007 20:44:57 von per

In article <1191571527.262073.299980@k79g2000hse.googlegroups.com>
DieSpeedy writes:
>
>But the problem is that sendmail expects that user@domain.com is a
>local user. (I got: user unknown - thats correct)
>But this special should never pick up his mail from my server. He
>collects his mail always from an external provider, which also provide
>mydomain.com (the same as I use internal).
>
>Is there any possibility to tell sendmail not to deliver a specific
>mail address locally???

You can use ldap_routing, with `null', and
specifying a hash map that has the sole entry

user@domain.com SMART_HOST

(SMART_HOST needs to be the actual name (or [ip.add.re.ss]) of the smart
host).

--Per Hedeland
per@hedeland.org

Re: Looking for a rule to send user@domain.com via SMART_HOST

am 06.10.2007 12:25:03 von DieSpeedy

Hi Per,

> You can use ldap_routing, with `null', and
> specifying a hash map that has the sole entry
>
> u...@domain.com SMART_HOST
>
> (SMART_HOST needs to be the actual name (or [ip.add.re.ss]) of the smart
> host).

ldap_routing seems to be really a possibility. :-)
But do you know, if I can use it also if I use a SMART_HOST with
AuthInfo?

For the moment I checked some documentations, but I am really unsure
what`s the correct syntax.
(I am sorry, but I use webmin for the m4 configuration and I am not
very familiar with the sendmail m4 configuration.)

I would try something like this:
FEATURE(`ldap_routing','', MY_SMART_HOST.'user@localdomain.com)

Do you agree with this?

Thx a lot.
DieSpeedy

Re: Looking for a rule to send user@domain.com via SMART_HOST

am 06.10.2007 15:17:21 von per

In article <1191666303.289064.55570@k79g2000hse.googlegroups.com>
DieSpeedy writes:
>
>> You can use ldap_routing, with `null', and
>> specifying a hash map that has the sole entry
>>
>> u...@domain.com SMART_HOST
>>
>> (SMART_HOST needs to be the actual name (or [ip.add.re.ss]) of the smart
>> host).
>
>ldap_routing seems to be really a possibility. :-)
>But do you know, if I can use it also if I use a SMART_HOST with
>AuthInfo?

Umm, I can't parse that - what has SMART_HOST got to do with Authinfo,
and what has Authinfo got to do with mail routing? But you can certainly
use ldap_routing with SMART_HOST, ldap_routing takes precedence.

>For the moment I checked some documentations, but I am really unsure
>what`s the correct syntax.
>(I am sorry, but I use webmin for the m4 configuration and I am not
>very familiar with the sendmail m4 configuration.)
>
>I would try something like this:
> FEATURE(`ldap_routing','', MY_SMART_HOST.'user@localdomain.com)
>
>Do you agree with this?

No, that's quite messed up - for starters you must use matching open (`)
and close (') quotes as you do on `ldap_routing' on all things that need
to be quoted. Second, you can't specify any map *contents* on the
FEATURE line, only specify a map to use. So you could have something
like this in the .mc file (completely untested):

define(`SMART_HOST', `smtp.yourisp.com')
LDAPROUTE_DOMAIN(`localdomain.com')
FEATURE(`ldap_routing', `hash /etc/mail/mailhost', `null')

Then in the file /etc/mail/mailhost:

user@localdomain.com smtp.yourisp.com

And finally you need to:

# makemap hash /etc/mail/mailhost < /etc/mail/mailhost

Of course for a single user you could do this more easily with a single
custom rewrite rule in the .mc file, but with this method you have
something where more users can be added without changing .mc and
rebuilding sendmail.cf, and don't risk making typos in the rule(s).

--Per Hedeland
per@hedeland.org

Re: Looking for a rule to send user@domain.com via SMART_HOST

am 06.10.2007 15:37:10 von per

In article <1191666303.289064.55570@k79g2000hse.googlegroups.com>
DieSpeedy writes:
>
>> You can use ldap_routing, with `null', and
>> specifying a hash map that has the sole entry
>>
>> u...@domain.com SMART_HOST
>>
>> (SMART_HOST needs to be the actual name (or [ip.add.re.ss]) of the smart
>> host).
>
>ldap_routing seems to be really a possibility. :-)
>But do you know, if I can use it also if I use a SMART_HOST with
>AuthInfo?

Umm, I can't parse that - what has SMART_HOST got to do with Authinfo,
and what has Authinfo got to do with mail routing? But you can certainly
use ldap_routing with SMART_HOST, ldap_routing takes precedence.

>For the moment I checked some documentations, but I am really unsure
>what`s the correct syntax.
>(I am sorry, but I use webmin for the m4 configuration and I am not
>very familiar with the sendmail m4 configuration.)
>
>I would try something like this:
> FEATURE(`ldap_routing','', MY_SMART_HOST.'user@localdomain.com)
>
>Do you agree with this?

No, that's quite messed up - for starters you must use matching open (`)
and close (') quotes as you do on `ldap_routing' on all things that need
to be quoted. Second, you can't specify any map *contents* on the
FEATURE line, only specify a map to use. So you could have something
like this in the .mc file (completely untested):

define(`SMART_HOST', `smtp.yourisp.com')
LDAPROUTE_DOMAIN(`localdomain.com')
FEATURE(`ldap_routing', `hash /etc/mail/mailhost', `null')

Then in the file /etc/mail/mailhost:

user@localdomain.com smtp.yourisp.com

And finally you need to:

# makemap hash /etc/mail/mailhost < /etc/mail/mailhost

Of course for a single user you could do this more easily with a single
custom rewrite rule in the .mc file, but with this method you have
something where more users can be added without changing .mc and
rebuilding sendmail.cf, and don't risk making typos in the rule(s).

--Per Hedeland
per@hedeland.org

Re: Looking for a rule to send user@domain.com via SMART_HOST

am 06.10.2007 18:29:07 von DieSpeedy

Hi Per,

thank you very much! That`s works fantastic!
I already tested some different possibilities and everything worked
fine!

About AuthInfo... It`s no problem because it`s already configured for
this SMART_HOST so sendmail uses it automatically. :-)

Great! Thank you!!!

DieSpeedy