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).
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.
THE AUTHOR NAME MUST BE QUOTED IN ANY WORK DERIVATED FROM THE WORK.
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
Create /etc/mail/smarttable file and compile it using makemap.
Copy provided smarttable.m4 file into cf/feature directory (smarttable.m4 signature).
Use "Save as" command in your browser. In some cases "copy and paste" looses required info (e.g. tabs - \t)
In *.mc file you use to generate sendmail.cf add:
FEATURE(`smarttable')dnl
and generate new sendmail.cf or sendmail-test.cf.
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
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>