Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to relay the mail according to the sender domain

105 views
Skip to first unread message

Mike Ng

unread,
Feb 3, 1999, 3:00:00 AM2/3/99
to
Hi all,
I use the sendmail 8.8.8. I have a question that when I receive the mail
from specific sender domain(e.g. te...@mike.com.hk) I need to relay this
email to specific mail hub(popular.mailhub.com) according to the sender
domain.
Regret that I am not familiar to configure the sendmail. Anyone can help me
how to add a rule set to achieve this requirement. Pls also tell me what
position for this rule set to be placed.
I am very very urgent to use this.

Thank you very much.

Regards,
Mike

Andrzej Filip

unread,
Feb 5, 1999, 3:00:00 AM2/5/99
to Mike Ng
Mike Ng wrote:

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

smarttable.m4
0 new messages