Thank you very much.
Regards,
Mike
Below please find smarthost selection based on
sender envelope address (*.mc technique)
TO USE IT:
1) place the file in your sendmail m4 configuration hack directory
2) in your *.mc file add
FEATURE(`smarttable')
3) make sure that rules generated by HACK(`smarttble')
go just before the following line
R$* < @ $* > $* $: $>95 < $S > $1 < @ $2 > $3 glue on smarthost name
USAGE:
smarttable [/etc/mail/smrttable]:
te...@mike.com.hk lesspopular.mailhub.com
@mike.com.hk popular.mailhub.com
it should send email from te...@mike.com.hk (envelope sender)
via smarthost lesspopular.mailhub.com, all other
senders from mike.com.hk will be served by popular.mailhub.com
KNOW PROBLEMS:
* it seems that local addresses may be looked for
without domain name added
TESTED:
tested only via sendmail -bv on sendmail 8.8.7
You know why the version is 0.2 :-)
hack/smarttable.m4
---------------------------------------
divert(-1)
#
# Copyright (c) 1999 Andrzej Filip <an...@polbox.com>
#
# In short: you can do whatever you want with this, but don't blame me!
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
divert(0)
VERSIONID(`@(#)smarttable.m4 0.2 (Andrzej Filip) 1999-02-05')
divert(-1)
LOCAL_CONFIG
# smarthost selection based on sender
Ksmarttable hash /etc/mail/smarttable
dnl
LOCAL_NET_CONFIG
# smarttable rules
R$* $: <><$(dequote "" $&f $)> $1
R<> <$+> $* $: <$(smarttable $1 $: $)> <$1> $2
R<> <$+@$+> $* $: <$(smarttable @$2 $: $)> <$1@$2> $3
R<$*> <$*> $* $: $>95 <$1> $3
---------------------------------------
--
Andrzej (Andrew) A. Filip
home e-mail: an...@polbox.com