Smart Table (sendmail)

Abstract

The document describes how to make sendmail select smart host [e-mail relay host] based on envelope sender address (full address or domain part only).


Copyright (c) 1999,2002 by Anfi

Usage

In smarttable file you can put entries like the ones given below:

test@mike.com.hk lesspopular.mailhub.com
@mike.com.hk     popular.mailhub.com
test@domain.pl   uucp:nodex
test@domain.us   esmtp:[smtp.domain.us]:my.isp
# relay for <> sender [version 8.2+ of smarttable]
@                relay:smtp.myisp.com

lesspopular.mailhub.com will be used to relay messages send from test@mike.com.hk. Messages from remaining addresses in mike.com.hk will be relayed via popular.mailhub.com. You can also specify mailer used as shown in the remaning lines.

The lastest smarttable version is 8.5 released 2002-07-28. I detected problems in versions 8.1-8.4

Install

  1. Create /etc/mail/smarttable file and compile it using makemap.

  2. Copy provided smarttable.m4 file into cf/feature directory.
    Use "Save as" command in your browser. In some cases "copy and paste" looses required info (e.g. tabs - \t)

  3. In *.mc file you use to generate sendmail.cf add:

      FEATURE(`smarttable')dnl
    

    and generate new sendmail.cf or sendmail-test.cf.

Tests

You can use commands given below for testing the feature:

sendmail -C sendmail-test.cf -bt <<END
3,0 recipient@test.com
.Dfsender@sender.domain
3,0 recipient@test.com 
END

Additional

Original Posting

The posting
Subject: Re: How to relay the mail according to the sender domain
Date: 1999-02-05
Newsgroups: comp.mail.sendmail
Message-ID: <36BB38E3.A2F8C332@polbox.com>